StringPreParserclass
Base class for command input string preparsers.
Preparsers must be registered in order to run. During preinitialization, we will automatically register any existing preparser objects; preparsers that are created dynamically during execution must be registered explicitly, which can be accomplished by inheriting the default constructor from this class.
class
StringPreParser
:
PreinitObject
Superclass Tree (in declaration order)
StringPreParser
PreinitObject
ModuleExecObject
` object`
Subclass Tree
(none)
Global Objects
commentPreParser
specialTopicPreParser
Summary of Properties
regList
regListSorted
runOrder
Inherited from ModuleExecObject
:
execAfterMe
execBeforeMe
hasInitialized_
isDoingExec_
isExecuted_
Summary of Methods
construct
doParsing
execute
registerPreParser
runAll
Inherited from ModuleExecObject
:
_execute
classExec
Properties
regList
class property containing the list of registered parsers
regListSorted
class property - the registration list has been sorted
runOrder
My execution order number. When multiple preparsers are registered, we’ll run the preparsers in ascending order of this value (i.e., smallest runOrder goes first).
Methods
construct ( )
construction - when we dynamically create a preparser, register it by default
doParsing (str, which)
Do our parsing. Each instance should override this method to define the parsing that it does.
‘str’ is the string to parse, and ‘which’ is the rmcXxx enum giving the type of command we’re working with.
This method returns a string or nil. If the method returns a string, the caller will forget the original string and work from here on out with the new version returned; this allows the method to rewrite the original input as desired. If the method returns nil, it means that the string has been fully handled and that further parsing of the same string is not desired.
execute ( )
OVERRIDDEN
run pre-initialization
registerPreParser (pp)
register a preparser
runAll (str, which)
Class method - Run all preparsers. Returns the result of successively calling each preparser on the given string.
TADS 3 Library Manual
Generated on 5/16/2013 from TADS version 3.1.3