gi
Class SLR1_Grammar
java.lang.Object
gi.Lexicon
gi.Grammar
gi.LR0_Grammar
gi.SLR1_Grammar
- public class SLR1_Grammar
- extends LR0_Grammar
This class implements an SLR(1) parser around a Grammar. The parser adapts to changes in the underlying Grammar. Semantics in a phrase are evaluated during a bottom-up parse, from left to right after all subtrees rooted in the phrase have been constructed. Attributes throughout the phrase are available during evaluation. SLR(1) parsing is more space- and time-efficient than LR(1) parsing; however, SLR(1) parsing is more easily confused than LR(1) parsing, since it considers lookahead terminals generally following a nonterminal (rather than specifically following it in a context) to choose between applicable phrases.
- Version:
- 1.2
- Author:
- © 1999-2004 Craig A. Rich <carich@csupomona.edu>
|
Method Summary |
String |
toString()
Returns the string representation of this parser, specifically "SLR(1)". |
toString
public String toString()
Returns the string representation of this parser, specifically "SLR(1)".
- Overrides:
toString in class LR0_Grammar
- Returns:
- the string representation of this parser, specifically "SLR(1)".
- Since:
- 1.1
© 1999-2004 Craig A. Rich <carich@csupomona.edu>