Module parser :: Class LALRtable1
[hide private]
[frames] | no frames]

Class LALRtable1

source code

LRtable --+
          |
         LALRtable1
Known Subclasses:

Class for construction of LALR(1) tables

Instance Methods [hide private]
 
make_action_goto(self)
Make action[i,X] and goto[i,X] all pairs (i,s) not in action and goto dictionaries are 'error'
source code
 
items(self)
An LALR(1) item of a grammar G is a production of Gwith a dot at some position of the right hand side and a list of terminals: is coded as a dictonary with key (rule_number,dot_position) and value a set of terminals
source code
 
print_items(self, c)
Print LALR(1) items
source code
 
goto(self, items, s)
goto(I,X) where I is a set of items and X a grammar symbol is the closure of the set of all items (A -> sX.r,a) such that (A -> s.Xr,a) in I
source code
 
closure(self, items)
The closure of a set of LR(1) items I is the set of items construted from I by the two rules:
source code
 
get_union(self, c, j) source code
 
core_merge(self, c, j) source code
 
NextToDot(self, item)
returns symbol next to the dot or empty string
source code
 
AfterDot(self, item, items)
returns FIRST of strings after the dot concatenated with lookahead
source code
 
dotatend(self, item, c, i) source code

Inherited from LRtable: __init__, add_action, resolve_shift_reduce, rules_precedence

Instance Variables [hide private]

Inherited from LRtable: Log, gr, operators

Method Details [hide private]

make_action_goto(self)

source code 

Make action[i,X] and goto[i,X] all pairs (i,s) not in action and goto dictionaries are 'error'

Overrides: LRtable.make_action_goto

closure(self, items)

source code 

The closure of a set of LR(1) items I is the set of items construted from I by the two rules:

  • every item of I is in closure(I)
  • If [A -> s.Bt,a] in closure(I),for B ->r and each terminal b in first(ta), add [B ->.r,b] to closure(I)