Editing LALR Parsers

Jump to: navigation, search

Please note that you are now editing the latest revision of this page, which is not the approved one shown by default.

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
LZIooj http://www.FyLitCl7Pf7kjQdDUOLQOuaxTXbj5iNG.com
+
'''''LALR''' - '''L'''ook '''A'''head '''L'''eft-to-right parse, '''R'''ightmost-derivation''.
 +
<br><br>
 +
 
 +
LALR parsers are a specialized form of [http://eplmediawiki.di.uminho.pt/index.php/LL(k)_----_LL(1)_Parsers LR parsers] that can deal with more context-free grammars than Simple LR parsers [INSERIR LINKS] but less than [http://eplmediawiki.di.uminho.pt/index.php/LL(k)_----_LL(1)_Parsers LR(1)] parsers can.
 +
<br><br>
 +
 
 +
LALR parsers were introduced as practical parsers for deterministic languages. Rather than building an exponential number of LR(k) states, LALR(k) parsers add lookahead sets to the actions of the small LR(0) parser. 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.
 +
<br><br>
 +
 
 +
In LR(1) parsing, an item '''A ::= a''' (s1) is different from '''A ::= a''' (s2) if s1 is different from s2. This results to a large number of states since the combinations of expected lookahead symbols can be very large. To reduce the number of states, when we have two items like those two, instead of creating two states (one for each item), we combine the two states into one by creating an item '''A := a''' (s3) where s3 is the union of s1 and s2. Since we make the expected lookahead sets larger, there is a danger that some conflicts will have worse chances to be resolved. But the number of states we get is the same as that for LR(0). This grammar is called LALR(1).
 +
<br><br>
 +
 
 +
== LALR parser generators ==
 +
# [http://www.parsifalsoft.com/ AnaGram]
 +
# [http://beaver.sourceforge.net/ BEAVER]
 +
# [http://www.cs.princeton.edu/~appel/modern/java/CUP CUP]
 +
# ELI
 +
# [http://www.devincook.com/goldparser/ Gold]
 +
# [http://www.hwaci.com/sw/lemon/ Lemon]
 +
# [http://eplmediawiki.di.uminho.pt/index.php/Lisa LISA]
 +
# [http://www.mathematik.uni-ulm.de/modula Ulm's Modula-2 System]
 +
# [http://eplmediawiki.di.uminho.pt/index.php/Yacc YACC]
 +
# [http://www.gradsoft.com.ua/products/yayacc_eng.html YaYacc]
 +
 
 +
[[Category:Basic Concepts]]

Please note that all contributions to eplmediawiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Eplmediawiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)
Personal tools
Namespaces

Variants
Actions
Navigation
extras
Toolbox