Trees | Index | Help |
|
---|
Module parser :: Class CFGrammar |
|
Method Summary | |
---|---|
| |
Grammar rules | |
For each nonterminal s determines the set of nonterminals
a such that s ->* ar , for some r | |
For nonterminal s determines the set of nonterminals a
such that s -> ar , for some r | |
DERIVE_T(self)
| |
FIRST(s) is the set of terminals that begin the strings
derived from s | |
Recursivelly computes FIRST(X) for a nonterminal X | |
Determines FIRST(s) , for every symbol s, that is the set
of terminals that begin the strings derived from s | |
Transitiv closure of FIRST(X) | |
computes FOLLOW(A) for all nonterminals: the set of
terminals a that can appear immediately to the right of A in some
sentential form. | |
makeFFN(self)
| |
Extracts nonterminals from grammar rules. | |
Extracts terminals from the rules. | |
Determines which nonterminals X ->* [] | |
For each nonterminal s determines the set of nonterminals
a such that s ->* ar , for some r | |
TRAVERSE(self,
s,
d)
|
Instance Variable Summary | |
---|---|
nonterminals : nonterminals symbols | |
ntr : dictionary of rules for each nonterminal | |
rules : grammar rules | |
string | start : start symbol |
terminals : terminals symbols |
Method Details |
---|
__init__(self,
grammar)
|
__str__(self)
Grammar rules
|
DERIVE_NT(self)For each nonterminals determines the set of
nonterminals a such that s ->* ar , for some
r
|
DERIVE_ONE_NT(self, s)For nonterminals determines the set of nonterminals a
such that s -> ar , for some r
|
FIRST(self, s)FIRST(s) is the set of terminals that begin the strings
derived from s
|
FIRST_NT(self, s)Recursivelly computesFIRST(X) for a nonterminal X
|
FIRST_ONE(self)DeterminesFIRST(s) , for every symbol s, that is the
set of terminals that begin the strings derived from s
|
FIRST_TRA(self, s, d)Transitiv closure ofFIRST(X)
|
FOLLOW(self)computesFOLLOW(A) for all nonterminals: the set of
terminals a that can appear immediately to the right of A in some
sentential form.
|
makenonterminals(self)Extractsnonterminals from grammar rules.
|
maketerminals(self)Extractsterminals from the rules.
nonterminals must already exist
|
NULLABLE(self)Determines which nonterminalsX ->* []
|
TransClose(self)For each nonterminals determines the set of
nonterminals a such that s ->* ar , for some
r
|
Instance Variable Details |
---|
nonterminalsnonterminals symbols |
ntrdictionary of rules for each nonterminal |
rulesgrammar rules |
startstart symbol
|
terminalsterminals symbols |
Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sun Nov 16 11:16:30 2003 | http://epydoc.sf.net |