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

Comparing COMP/SCRAM/src/Utilities/Switcher.pm (file contents):
Revision 1.1 by williamc, Mon Mar 1 10:35:01 1999 UTC vs.
Revision 1.4 by williamc, Mon Jun 7 15:02:57 1999 UTC

# Line 1 | Line 1
1 #!/usr/local/bin/perl5
2 #
1   # Switcher Module
2   #
3   # Look for elements given in input has in a string
# Line 8 | Line 6
6   # processed.
7  
8   package Switcher;
9 + require 5.001;
10   require Exporter;
11   use Carp;
12   @ISA    = qw(Exporter);
# Line 16 | Line 15 | sub new {
15          my $class=shift;
16          my $hash=shift;
17          my $file=shift;
18 +        my $objectname=shift;
19          my $self = {};
20 +        $self->{allw}=$objectname;
21          bless $self, $class;
22          $self->_initialise($hash,$file);
23          return $self;
# Line 119 | Line 120 | WHILELOOP: while ( ($word=shift @{$self-
120                          # Do we call the tag init routine?
121                          if ( ( defined ( ${$self->{labelhash}}{$rtname} )) &&
122                            ( ! ( ${$self->{labelhash}}{$rtname}=~/none/i )) ) {
123 <                          &{${$self->{labelhash}}{$rtname}}( $temp,
124 <                                @{$self->{tagblock}});
123 >                          &{${$self->{labelhash}}{$rtname}}( $self->{allw},
124 >                        $temp, @{$self->{tagblock}});
125                          }
126                          $self->_flipcontext($temp);    
127                          $#{$self->{tagblock}}= -1;
# Line 225 | Line 226 | sub _closeprevious {
226          ( ! ( ${$self->{labelhash}}{${$self->{lastcon}}[$#{$self->{lastcon}}]}
227                                          =~/none/i )) ) {
228      &{ ${$self->{labelhash}}{${$self->{lastcon}}[$#{$self->{lastcon}}]}}(
229 <         ${$self->{lastcon}}[$#{$self->{lastcon}}], @{$self->{tagblock}});
229 >        $self->{allw}, ${$self->{lastcon}}[$#{$self->{lastcon}}], @{$self->{tagblock}});
230     }
231    }
232   }
# Line 237 | Line 238 | sub checkparam($hash, $name, $key) {
238          my $key=shift;
239  
240          if ( ! defined $$hashref{$key} ) {
241 <           print "BootParser: Badly formed $name tag -".
241 >           print "Switcher: Badly formed $name tag -".
242                          " undefined $key parameter\n";
243             exit 1;
244          }
245          $$hashref{$key}=~s/["']//;
246   }
247  
248 + #
249 + # return the current line number
250 + #
251 + sub line {
252 +        return $self->{linecount};
253 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines