LALR parser generator: Difference between revisions

Content deleted Content added
OAbot (talk | contribs)
m Open access bot: doi updated in citation with #oabot.
Copyedit: BNF => CFG, "computer language" => CFL
Line 1:
{{Refimprove|date=August 2011}}
 
A '''lookahead LR parser (LALR) generator''' is a software tool that reads a [[BNF grammarcontext-free_grammar]] (CFG) and creates an [[LALR parser]] which is capable of parsing files written in the [[computercontext-free language]] defined by the BNF grammarCFG. [[LALR parser]]s are desirable because they are very fast and small in comparison to other types of parsers.
 
There are other types of [[parser generator]]s, such as [[Simple LR parser]], [[LR parser]], [[GLR parser]], [[LL parser]] and [[GLL parser]] generators. What differentiates one from another is the type of BNF grammarCFG which they are capable of accepting and the type of parsing algorithm which is used in the generated parser. An LALR parser generator accepts an LALR grammar as input and generates a parser that uses an LALR parsing algorithm (which is driven by LALR parser tables).
 
In practice, LALR offers a good solution, because LALR(1) grammars are more powerful than SLR(1), and can parse most practical LL(1) grammars. LR(1) grammars are more powerful than LALR(1), but ("canonical") LR(1) parsers can be extremely large in size and are considered not practical. Minimal LR(1) parsers are small in size and comparable to LALR(1) parsers.
 
==History==