Lalr Parser

Look-Ahead LR parsers or LALR parsers are a specialized form of LR parsers that can deal with more context-free grammars than Simple LR parsers but less than LR(1) parsers can. It is a very popular type of parser because it gives a good trade-off between the number of grammars it can deal with and the size of the parsing tables it requires. It is these types of parsers that are generated by compiler-compilers such as yacc and GNU bison. Like SLR, LALR is a refinement to the technique for constructing LR(0) parse tables. While SLR uses follow sets to construct reduce actions, LALR uses lookahead sets, which are more specific because they take more of the parsing context into account. follow sets are associated with a symbol, while lookahead sets are specific to an LR(0) item and a parser state. Specifically, the follow set for a given LR(0) item I in a given parser state S contains all symbols that are allowed by the grammar to appear after I's left-hand-side nonterminal. In contrast, the lookahead set for I contains only those symbols that are allowed by the grammar to appear after I's right-hand-side has been parsed starting from state S. follow(I) is effectively the union of the lookahead sets for all LR(0) items with the same left-hand-side as I, regardless of parser states or right-hand-sides, therefore losing all context information. Because the LOOKAHEAD set is specific to a particular parsing context, it can be more selective, therefore allowing finer distinctions than the FOLLOW set.

External links

 

<< PreviousWord BrowserNext >>
liar paradox
louchebem
leon m. lederman
lcd (disambiguation)
louis the pious
liquid crystal
long gun
lisp
language game
law of definite proportions
limbo
lethe
lebesgue integration
laurence sterne
linear a
lucasarts
lafcadio hearn
learning theory (education)
long term memory
list of latin phrases
latin declension
list of latin words with english derivatives
latin spelling and pronunciation
latin conjugation
louisa may alcott
lds
learning disability
language center
lift (force)
leo iii
lombards
limit
loki
lisp programming language
lou gehrig
logarithmic identities
lost city
louis agassiz
li bai
longship
luigi alamanni
louis aleman
lr parser
leone battista alberti