7 my $class = ref($proto) || $proto;
11 my $state = \%{$self->{STATE}};
12 my $stack = \@{$self->{STACK}};
13 my $include_found = \${$self->{INCLUDE_FOUND}};
14 my $conditional_found = \${$self->{CONDITIONAL_FOUND}};
16 $$include_found = shift;
17 $$conditional_found = shift;
24 my $include_found = \${$self->{INCLUDE_FOUND}};
28 &$$include_found($argument);
33 my $state = \%{$self->{STATE}};
34 my $conditional_found = \${$self->{CONDITIONAL_FOUND}};
38 $$state{$name} = "def";
40 &$$conditional_found($name);
45 my $state = \%{$self->{STATE}};
46 my $conditional_found = \${$self->{CONDITIONAL_FOUND}};
50 $$state{$name} = "undef";
52 &$$conditional_found($name);
57 my $state = \%{$self->{STATE}};
58 my $stack = \@{$self->{STACK}};
60 my $directive = shift;
66 } elsif(/^1\s*\|\|/) {
70 if(/^(!)?defined\s*\(\s*(.+?)\s*\)\s*((\&\&|\|\|)\s*)?/){
72 if(defined($1) && $1 eq "!") {
79 } elsif(/^(\w+)\s*(<|<=|==|!=|>=|>)\s*(\w+)\s*((\&\&|\|\|)\s*)?/) {
81 } elsif(/^(\w+)\s*$/) {
86 print "*** Can't parse '#$directive $_' ***\n";
94 my $state = \%{$self->{STATE}};
95 my $stack = \@{$self->{STACK}};
101 if(defined($argument)) {
102 $self->begin_if("elif", $argument);
108 my $state = \%{$self->{STATE}};
109 my $stack = \@{$self->{STACK}};
111 my $macro = pop @$stack;
112 delete $$state{$macro} if defined($macro);
117 my $state = \%{$self->{STATE}};
118 my $stack = \@{$self->{STACK}};
120 my $directive = shift;
121 my $argument = shift;
123 local $_ = $directive;
125 $self->begin_if("if",$argument);
127 $self->begin_if("if", "defined($argument)");
128 } elsif(/^ifndef$/) {
129 $self->begin_if("if", "!defined($argument)");
130 push @$stack, $argument;
132 $self->else_if($argument);
137 } elsif(/^include/) {
138 $self->include($argument);
144 my $state = \%{$self->{STATE}};
148 my $status = $$state{$name};
150 return defined($status) && $status eq "def";
155 my $state = \%{$self->{STATE}};
159 my $status = $$state{$name};
161 return defined($status) && $status eq "undef";
166 my $state = \%{$self->{STATE}};
170 my $status = $$state{$name};
172 return !defined($status);