LALR parser generator: Difference between revisions

Content deleted Content added
BattyBot (talk | contribs)
changed {{Unreferenced}} to {{Refimprove}} & general fixes using AWB (8062)
Move material from LALR parser to new section
Line 23:
 
Today, there are many LALR parser generators available, for example [[GNU bison]], a pun on the original Yacc/[[Yak]].
 
==Generating LALR tables==
 
The LALR parser and its alternatives, the SLR parser and the [[Canonical LR parser]], have similar methods and parsing tables; their main difference is in the mathematical grammar analysis algorithm used by the parser generation tool. LALR generators accept more grammars than do SLR generators, but fewer grammars than full LR(1). Full LR involves much larger parse tables and is avoided unless clearly needed for some particular computer language. Real computer languages can often be expressed as LALR(1) grammars. In cases where they can't, a LALR(2) grammar is usually adequate. If the parser generator allows only LALR(1) grammars, the parser typically calls some hand-written code whenever it encounters constructs needing extended lookahead.
 
==See also==