__init__(self,
grammar,
table_shelve,
no_table=1,
tabletype=<class parser.LALRtable at 0x300ba720>,
operators=None,
noconflicts=1,
expect=0,
**args)
(Constructor)
-
- Parameters:
grammar -
is a list for productions; each production is a tuple
(LeftHandside,RightHandside,SemFunc,Prec?) with
LeftHandside nonterminal, RightHandside
list of symbols, SemFunc syntax-direct semantics, if
present Prec (PRECEDENCE,ASSOC) for ambiguous
rules
First production is for start symbol
table_shelve -
file where parser is saved
(type=string)
no_table -
if 0 table_shelve is created anyway
(type=integer)
tabletype -
type of LR table: SLR , LR1 ,
LALR
(type=LRtable class)
operators -
precedence and associativity for operators
(type=dictionary)
noconflicts -
if 0 LRtable conflicts are not resolved, unless spcecial
operator rules
(type=integer)
expect -
exact number of expected LR shift/reduce conflicts
(type=integer)
|