Imported modules
|
|
from kjParser import TERMFLAG, NOMATCHFLAG, MOVETOFLAG, REDUCEFLAG, TRANSFLAG, KEYFLAG, NONTERMFLAG, TERMFLAG, EOFFLAG, ENDOFFILETOKEN
import kjSet
import regex
import string
|
Functions
|
|
|
|
FullBody
|
FullBody ( list, ObjectGram )
FullBody should receive
[ string, Bodylist]
must determine whether the string represents
a keyword, a nonterminal, or a terminal of the object
grammar.
returns (KEYFLAG, string) (TERMFLAG, string) or
(NONTERMFLAG, string) respectively
|
|
FullRuleList
|
FullRuleList ( list, ObjectGram )
FullRuleList should receive list of form
[ Rule, RuleList ]
|
|
GrammarDumpSequence
|
GrammarDumpSequence ( ReconstructObj )
general procedure for different types of archiving for grammars
|
|
IdentFun
|
IdentFun ( string )
for identifiers simply return the string
|
|
InterpNonTerm
|
InterpNonTerm ( list, ObjectGram )
InterpNonTerm should receive
[ string ]
|
|
InterpRule
|
InterpRule ( list, ObjectGram )
InterpRule should receive list of form
[keyword RSKEY,
RuleNameStr,
keyword COLKEY,
Nontermtoken,
keyword LTKEY,
Bodylist]
|
|
InterpRuleName
|
InterpRuleName ( list, ObjectGram )
InterpRuleName should receive
[ string ]
|
|
NullBody
|
NullBody ( list, ObjectGram )
NullBody should receive []
|
|
NullCGrammar
|
NullCGrammar ()
function to create a "null CGrammar"
|
|
NullRuleList
|
NullRuleList ( list, ObjectGram )
NullRuleList should receive list of form
[]
|
|
RootReduction
|
RootReduction ( list, ObjectGram )
RootReduction should receive list of form
[ nontermtoken, keyword COLKEY, RuleList ]
|
|
ruleGrammar
|
ruleGrammar ()
function to generate a grammar for parsing grammar rules
|
Classes
|
|
CFSMachine | a derived FSM class, with closure computation methods defined
|
CGrammar | a derived grammar class (object oriented programming is cool!)
|
Reconstruct | - utility classes
Grammar reconstruction objects
|
codeReconstruct | grammar reconstruction to a file
|
marshalReconstruct | reconstruction using marshalling to a file
|
ruleset | Ruleset class, used to compute NFA and then DFA for
|
|