From: Jan T. <de...@us...> - 2002-07-07 14:34:34
|
Update of /cvsroot/net-script/netscript2/src/perl/NetScript/Engine In directory usw-pr-cvs1:/tmp/cvs-serv4868 Modified Files: DOMWalker.pm Event.pm LibLoader.pm StatementEvaluator.pm Log Message: * added support for include/rinclude * various bugfixes * added mod_perl support Index: DOMWalker.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Engine/DOMWalker.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** DOMWalker.pm 9 Jun 2002 12:50:04 -0000 1.6 --- DOMWalker.pm 7 Jul 2002 14:34:31 -0000 1.7 *************** *** 31,34 **** --- 31,35 ---- $COMMENT_EVENT $PI_EVENT ); + #/** # Event which is generated upon start of the document *************** *** 243,247 **** sub walkOver { my ( $this, $source ) = @_; ! $this -> setCurrentSource( $source ); my $di = XML::DOM2::DOMImplementation -> new(); # create target document --- 244,261 ---- sub walkOver { my ( $this, $source ) = @_; ! $this -> resetDocument( $source ); ! $this -> goWalk(); ! # Return result document ! $this -> targetDocument(); ! } ! ! #/** ! # Resets the current document, clears the target document and ! # sets the source pointer to the document node of the source document. ! # @param the source document ! #*/ ! sub resetDocument { ! my ( $this, $sourceDocument ) = @_; ! my $di = XML::DOM2::DOMImplementation -> new(); # create target document *************** *** 252,261 **** $this -> setCurrentTarget( $document ); ! $this -> setSourceDocument( $source ); $this -> setTargetDocument( $document ); ! ! $this -> goWalk(); ! # Return result document ! $document; } --- 266,272 ---- $this -> setCurrentTarget( $document ); ! $this -> setSourceDocument( $sourceDocument ); $this -> setTargetDocument( $document ); ! $this -> setCurrentSource( $sourceDocument ); } *************** *** 269,272 **** --- 280,284 ---- while ( $this -> currentSource() ) { + warn "I'm walking: ". $this -> currentSource(); $this -> createEvent( $this -> currentSource() ); } Index: Event.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Engine/Event.pm,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Event.pm 15 May 2002 18:21:37 -0000 1.6 --- Event.pm 7 Jul 2002 14:34:31 -0000 1.7 *************** *** 74,78 **** # @public #*/ ! sub eventUnknown { my ($this) = @_; return $this -> { m_EventUnknown }; --- 74,78 ---- # @public #*/ ! sub getEventUnknown { my ($this) = @_; return $this -> { m_EventUnknown }; Index: LibLoader.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Engine/LibLoader.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LibLoader.pm 16 Jun 2002 18:15:12 -0000 1.1 --- LibLoader.pm 7 Jul 2002 14:34:31 -0000 1.2 *************** *** 41,45 **** my %importedLibs = (); ! $this -> { m_ImportedLibs } = \%importedLibs; $this -> { m_BaseDir } = $baseDir; $this -> { m_Interpreter } = $interpreter; --- 41,45 ---- my %importedLibs = (); ! $this -> { m_LoadedLibs } = \%importedLibs; $this -> { m_BaseDir } = $baseDir; $this -> { m_Interpreter } = $interpreter; *************** *** 80,83 **** --- 80,84 ---- # create instance my $libInstance = $perlLibName -> new(); + $this -> { m_LoadedLibs } -> { $libName } = $libInstance; # init instance $libInstance -> init( $this -> interpreter() ); *************** *** 91,95 **** $this -> interpreter() -> getEventRelay() -> createAndRaiseEvent( $NetScript::Interpreter::FATAL_EVENT, ! "Cannot load library \"$libName\". Library not found!" ); } } --- 92,96 ---- $this -> interpreter() -> getEventRelay() -> createAndRaiseEvent( $NetScript::Interpreter::FATAL_EVENT, ! "Cannot load library \"$libName\". Library not found (basedir: ".$this -> { m_BaseDir}. ")" ); } } *************** *** 105,108 **** --- 106,110 ---- # @param the base directory to start search from # @param the name of the library. + # @private #*/ sub lookupLibrary { *************** *** 152,155 **** --- 154,167 ---- } + + #/* + # Returns a reference to an array holding references to all loaded libraries. + # @public + #*/ + sub getLoadedLibraries { + my ( $this ) = @_; + my @values = values( %{ $this -> { m_LoadedLibs } } ); + return \@values; + } 1; # make "require" happy Index: StatementEvaluator.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Engine/StatementEvaluator.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** StatementEvaluator.pm 9 Jun 2002 12:50:04 -0000 1.8 --- StatementEvaluator.pm 7 Jul 2002 14:34:31 -0000 1.9 *************** *** 94,100 **** else { $result = $this -> getVariableValue( $param ); - # if (! defined($result)) { - # die "[standardlib] Error: undefined variable ", $param, "\n"; - # } } } --- 94,97 ---- |