Content deleted Content added
→References: Transfer references about parser-generation from LALR article. Parser generation info from the LALR article has already been transfered. |
Transfer parser-generator-relative info from Advantages-Disadvantages list of "LALR parser" article |
||
Line 25:
Similar to an [[SLR parser]] and Canonical LR parser generator, an LALR parser generator constructs the LR(0) state machine first and then computes the lookahead sets for all rules in the grammar, checking for ambiguity. The Canonical LR constructs full lookahead sets. LALR uses merge sets, that is it merges lookahead sets where the LR(0) core is the same. The SLR uses [[LR(1)#FIRST and FOLLOW sets|FOLLOW]] sets as lookahead sets which associate the right hand side of a LR(0) core to a lookahead terminal. This is a greater simplification that in the case of LALR because many conflicts may arise from LR(0) cores sharing the same right hand side and lookahead terminal, conflicts that are not present in LALR. This why SLR has less language recognition power than LALR with Canonical LR being stronger than both since it does not include any simplifications.
== Advantages ==
# Error recovery may already be built-in to the parser.
# Generalized error messages may already be built into the parser.
# Abstract-syntax-tree construction may already be built into the parser.
# Recognition of context-sensitive language constructs may already be built into the parser.
== Disadvantages ==
# Software engineers are required to use an LALR parser generator, which may or may not be user friendly and may require some learning time.
# If an error occurs, it may be difficult to determine whether it's in the grammar or the parser code.
# If there is an error in the parser generator, this may be very difficult to fix.
==See also==
|