From: Jan T. <de...@us...> - 2002-04-01 20:59:15
|
Update of /cvsroot/net-script/netscript2/src/perl/NetScript/Engine In directory usw-pr-cvs1:/tmp/cvs-serv28061 Modified Files: Event.pm EventRelay.pm State.pm Added Files: Class.pm Statement.pm Log Message: * began interpreter model --- NEW FILE: Class.pm --- #-------------------------------------------------------- # $Id: Class.pm,v 1.1 2002/04/01 20:30:56 derkork Exp $ # # Class Event # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; #/** # This class represents a Class. #*/ package NetScript::Engine::Class; use vars qw($VERSION); #-------------------------------------------------------- # Globals #-------------------------------------------------------- $VERSION = '1.0'; #/** # Ctor. #*/ sub new { my ($proto, $argsRef) = @_; my $proto = shift; # get Prototype my $class = ref( $proto ) || $proto;# get the Classname my $this = {}; bless( $this, $class ); # create Object my %functions = (); my %members = (); $this -> { m_Name } = ""; # Classname $this -> { m_Functions } = \@functions; # Functions $this -> { m_Members } = \@members; # members return $this; # return Object } #/** # Returns the given function, or sets it. # @param function name # @optional an instance of Netscript::Engine::Function # @return an instance of NetScript::Engine::Function #*/ sub function { my ($this, $name, $function ) = @_; if ( defined( $function ) ) { $this -> { m_Functions } -> { $name } = $function; } $this -> { m_Functions } -> { $name }; } #/** # Returns the given member or sets it. # @param member name # @optional an instance if Netscript::Engine::Variable # @return an instance of Netscript::Engine::Variable #*/ sub member { my ($this, $name, $member) = @_; if ( defined( $member ) ) { $this -> { m_Members } -> { $name } = $member; } $this -> { m_Functions } -> { $name }; } 1; # make "require" happy --- NEW FILE: Statement.pm --- #-------------------------------------------------------- # $Id: Statement.pm,v 1.1 2002/04/01 20:30:56 derkork Exp $ # # Class Event # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- use strict; #/** # This class represents a Statement. Everything within the interpreter # is a statement. A statement has a value. The value can be void. # @abstract #*/ package NetScript::Engine::Statement; use vars qw($VERSION); #-------------------------------------------------------- # Globals #-------------------------------------------------------- $VERSION = '1.0'; #/** # Ctor. #*/ sub new { my ($proto, $argsRef) = @_; my $proto = shift; # get Prototype my $class = ref( $proto ) || $proto;# get the Classname my $this = {}; bless( $this, $class ); # create Object return $this; # return Object } 1; # make "require" happy Index: Event.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Engine/Event.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Event.pm 29 Nov 2001 22:15:45 -0000 1.2 --- Event.pm 1 Apr 2002 20:30:56 -0000 1.3 *************** *** 9,13 **** # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2001 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- --- 9,13 ---- # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- *************** *** 23,27 **** #/** # The constructor. Constructs a new event. ! # @param a hash containing the following key-value-pairs # EventType - a string defining the type of an event # EventMessage - a string holding a message --- 23,27 ---- #/** # The constructor. Constructs a new event. ! # @param a hash reference containing the following key-value-pairs # EventType - a string defining the type of an event # EventMessage - a string holding a message *************** *** 51,55 **** # Returns the event type. # @return a string holding the event Type. ! #+/ sub getEventType { my ($this) = @_; --- 51,55 ---- # Returns the event type. # @return a string holding the event Type. ! #*/ sub getEventType { my ($this) = @_; Index: EventRelay.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Engine/EventRelay.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EventRelay.pm 29 Nov 2001 22:15:45 -0000 1.3 --- EventRelay.pm 1 Apr 2002 20:30:56 -0000 1.4 *************** *** 14,18 **** # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2001 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- --- 14,18 ---- # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- *************** *** 57,61 **** # listeners. # @param an object reference to the listener. ! # @param a hash containing event-sub pairs. # The keys are strings, describing the events which is listened to, # the values are strings which describe the functions to be called --- 57,61 ---- # listeners. # @param an object reference to the listener. ! # @param a hash reference containing event-sub pairs. # The keys are strings, describing the events which is listened to, # the values are strings which describe the functions to be called Index: State.pm =================================================================== RCS file: /cvsroot/net-script/netscript2/src/perl/NetScript/Engine/State.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** State.pm 4 Jul 2001 10:25:14 -0000 1.1 --- State.pm 1 Apr 2002 20:30:56 -0000 1.2 *************** *** 7,11 **** # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2001 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- --- 7,11 ---- # NetScript and all related materials, such as documentation, # are protected under the terms and conditions of the Artistic License. ! # (C) 2000-2002 by Jan Thomä, insOMnia # mailto: ko...@in... #-------------------------------------------------------- *************** *** 155,158 **** --- 155,159 ---- # @return a scalar holding the value of the variable or undef, if the # variable is not defined. + #*/ sub getVariableValue { my ( $this, $variable ) = @_; *************** *** 205,208 **** --- 206,210 ---- # @return a scalar holding the value of the variable or undef, if the # variable is not defined. + #*/ sub getVariableValue { my ( $this, $array, $index ) = @_; |