Methods
|
|
|
|
Dump
|
Dump ( self, *k )
|
|
SetCaseSensitivity
|
SetCaseSensitivity ( self, Boolean )
setting case sensitivity: must happen before keyword installation
in LexD.
|
|
Token
|
Token (
self,
String,
StartPosition,
)
function to do same as __getitem__ above but looking inside a string
instead of at the whole string
returns (token,skip)
where token is one of
((KEYFLAG,name),name) or ((TERMFLAG,termname),value)
and skip is the length of substring of string that matches thetoken
|
|
__init__
|
__init__ ( self )
Evaluate determines whether rules should be evaluated
after reductions. Context is an argument passed to the
list reduction function
|
|
comment
|
comment ( self, str )
register a regular expression as a comment
|
|
compile
|
compile ( self )
|
|
isCaseSensitive
|
isCaseSensitive ( self )
testing and altering case sensitivity behavior
|
|
keyword
|
keyword ( self, str )
LD.keyword("this") will make a new keyword "this" if not found
|
|
punctuation
|
punctuation ( self, Instring )
register a string as a punctuation
|
|
terminal
|
terminal (
self,
str,
regexstr=None,
Function=None,
)
LD.terminal("this") will just look for "this"
LD.terminal("this", RE, F) will register a new terminal
RE must be a compiled regular expression or string reg ex
F must be an interpretation function
|