Simple LR parser: Difference between revisions

Content deleted Content added
DBSand (talk | contribs)
Add explanatory intro.
DBSand (talk | contribs)
Remove (parser) algorithm section.
Line 15:
LALR generators calculate lookahead sets by a more precise method based on the graph of parser states and their transitions. This method considers the particular context of the current parser state. It customizes the handling of each grammar occurrence of some nonterminal S. See article [[LALR parser]] for further details of this calculation. The lookahead sets calculated by LALR generators are a subset of (and hence better than) the approximate sets calculated by SLR generators. If a grammar has table conflicts when using SLR follow sets, but is conflict-free when using LALR follow sets, it is called a LALR grammar.
 
== Algorithm ==
The parsing algorithm for an SLR parser is the same as for an LR parser; the only difference between the two is how their action tables are constructed.
== Example ==