ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/SCRAM/src/Runtime.pm
(Generate patch)

Comparing COMP/SCRAM/src/Runtime.pm (file contents):
Revision 1.1.2.3 by williamc, Fri Mar 31 10:27:03 2000 UTC vs.
Revision 1.1.2.4 by williamc, Fri Apr 7 08:14:39 2000 UTC

# Line 18 | Line 18
18  
19   package Runtime;
20   require 5.004;
21 + use ActiveDoc::SimpleDoc;
22  
23   sub new {
24          my $class=shift;
# Line 85 | Line 86 | sub _parsefile {
86          my $self=shift;
87          my $filename=shift;
88  
89 <        my $Tags={
90 <             'Runtime' => \&Runtime_text,
91 <             'Runtime_StartTag' => \&Runtime_start,
92 <             'Runtime_EndTag' => \&Runtime_end,
93 <             'ignore' => 'none',
94 <             'ignore_EndTag' => \&ignoretag_end,
95 <             'ignore_StartTag' => \&ignoretag,
96 <             'Architecture_StartTag' => \&Arch_Start,
97 <             'Architecture' => 'none' ,
98 <             'Architecture_EndTag' => \&Arch_End
98 <        };
99 <        use Utilities::Switcher;
100 <        $self->{switch}=Switcher->new($Tags, $filename);
89 >        $self->{switch}=ActiveDoc::SimpleDoc->new();
90 >        $self->{switch}->newparse("runtime");
91 >        $self->{switch}->addignoretags("runtime");
92 >        $self->{switch}->filetoparse($filename);
93 >        $self->{switch}->addtag("runtime","Runtime",
94 >             \&Runtime_start, $self,
95 >             \&Runtime_text, $self,
96 >             \&Runtime_end, $self);
97 >        $self->{switch}->addtag("runtime","Architecture",
98 >             \&Arch_Start, $self, "",$self, \&Arch_End, $self);
99          $self->{Runtimecontext}=0;
100 <        $self->{switch}->parse();
100 >        $self->{switch}->parse("runtime");
101   }
102  
103   sub _printoutenv {
# Line 120 | Line 118 | sub _printoutenv {
118   # ------ Tag Routines
119  
120   sub Runtime_start {
121 +        my $self=shift;
122          my $name=shift;
123 <        my @vars=@_;
125 <        my $hashref;
123 >        my $hashref=shift;
124  
125 <        $hashref=$self->{switch}->SetupValueHash(\@vars);
126 <        $self->{switch}->checkparam($hashref,$name,'name');
129 <        $self->{switch}->checkparam($hashref,$name,'value');
125 >        $self->{switch}->checktag($name,$hashref,'name');
126 >        $self->{switch}->checktag($name,$hashref,'value');
127          if ( $self->{Arch} ) {
128            if ( $self->{Runtimecontext} == 1 ) {
129             print "No </$name> before new tag at line ".
# Line 157 | Line 154 | sub Runtime_start {
154   }
155  
156   sub Runtime_text {
157 +        my $self=shift;
158          my $name=shift;
159          my @vars=@_;
160  
# Line 168 | Line 166 | sub Runtime_text {
166   }
167  
168   sub Runtime_end {
169 +        my $self=shift;
170          my $name=shift;
171          if ( $self->{Arch} ) {
172             $self->{Runtimecontext}=0;
173          }
174   }
175 +
176 + sub Arch_Start {
177 +        my $self=shift;
178 +        my $name=shift;
179 +        my $hashref=shift;
180 +
181 +        $toolswitch->checktag($name, $hashref,'name');
182 +        ( ($ENV{SCRAM_ARCH}=~/$$hashref{name}.*/) )? ($self->{Arch}=1)
183 +                                                : ($self->{Arch}=0);
184 +        push @{$self->{ARCHBLOCK}}, $self->{Arch};
185 + }
186 +
187 + sub Arch_End {
188 +        my $self=shift;
189 +        my $name=shift;
190 +
191 +        pop @{$self->{ARCHBLOCK}};
192 +        $self->{Arch}=$self->{ARCHBLOCK}[$#{$self->{ARCHBLOCK}}];
193 + }
194 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines