From: Jan T. <de...@us...> - 2002-05-09 19:14:03
|
Update of /cvsroot/net-script/netscript2/src/perl/NetScript In directory usw-pr-cvs1:/tmp/cvs-serv26834 Modified Files: Interpreter.pm Log Message: * integrated new Event Handling System * autoload of DefaultLibrary Index: Interpreter.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Interpreter.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Interpreter.pm 3 May 2002 13:32:00 -0000 1.4 --- Interpreter.pm 9 May 2002 19:14:00 -0000 1.5 *************** *** 14,18 **** # file and then redirects the work to the libraries which are # registered. - # @author <a href="mailto:ko...@in...">Jan Thomä</a> #*/ package NetScript::Interpreter; --- 14,17 ---- *************** *** 29,35 **** --- 28,36 ---- use NetScript::Engine::EventRelay; use NetScript::Engine::StatementEvaluator; + use NetScript::Libraries::DefaultLibrary; use NetScript::Util::XMLParserRelay; use NetScript::Util::FileRetriever; use NetScript::Util::ConfigurationParser; + use NetScript::Util::UIDGenerator; use XML::DOM2::DOMParser; use XML::DOM2::DOMWriter; *************** *** 117,130 **** $this -> { m_ConfigFile } = "file:./config.xml"; $this -> { m_Filename } = $this -> getCGI() -> param( "filename" ); $this -> { m_FileRetriever } = NetScript::Util::FileRetriever -> new( $this ); $this -> { m_StatementEvaluator } = NetScript::Engine::StatementEvaluator -> new( $this ); - $this -> { m_EventRelay } -> - addEventListener( $this, { &FATAL_EVENT() => "onFatalEvent" } ); return $this; # return Object } #/** --- 118,142 ---- $this -> { m_ConfigFile } = "file:./config.xml"; $this -> { m_Filename } = $this -> getCGI() -> param( "filename" ); + $this -> { m_UIDGenerator } = + NetScript::Util::UIDGenerator -> new(); $this -> { m_FileRetriever } = NetScript::Util::FileRetriever -> new( $this ); $this -> { m_StatementEvaluator } = NetScript::Engine::StatementEvaluator -> new( $this ); + my $defLib = NetScript::Libraries::DefaultLibrary -> new(); + $defLib -> init( $this ); return $this; # return Object } + #/** + # Returns a unique ID, generated by <code>NetScript::Util::UIDGenerator</code> + # @return a unique ID + # @public + #*/ + sub getUID { + my ( $this ) = @_; + $this -> { m_UIDGenerator } -> createUID(); + } #/** *************** *** 160,167 **** "file:./test.xml" ) } ); ! # Create a DOMWalker my $domwalker = NetScript::Engine::DOMWalker -> new( $this ); ! # Walk over the DOM my $resultDOM = $domwalker -> walkOver( $dom ); --- 172,179 ---- "file:./test.xml" ) } ); ! # Create a DOMWalker my $domwalker = NetScript::Engine::DOMWalker -> new( $this ); ! # Walk over the DOM my $resultDOM = $domwalker -> walkOver( $dom ); *************** *** 171,177 **** document => $resultDOM, style => $domstyle } ); ! ! # print $this -> getCGI() -> header(); ! # print $string; --- 183,189 ---- document => $resultDOM, style => $domstyle } ); ! ! print $this -> getCGI() -> header(); ! print $string; |