gi
Class LR1_Grammar
java.lang.Object
|
+--gi.Lexicon
|
+--gi.Grammar
|
+--gi.LR0_Grammar
|
+--gi.LR1_Grammar
- public class LR1_Grammar
- extends LR0_Grammar
This class implements an LR(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. LR(1) parsing considers context-specific lookahead terminals to more accurately choose between applicable phrases. LR(1) parsing is the default method used for a Grammar
around which no parser has been explicitly constructed, and is the recommended method.
- Version:
- 0.9
- Author:
- © 1999-2000 Craig A. Rich <carich@acm.org>
- See Also:
- Source code
Constructor Summary |
protected |
LR1_Grammar()
Constructs an LR(1) parser around a new empty Grammar . |
protected |
LR1_Grammar(Grammar grammar)
Constructs an LR(1) parser around an existing Grammar . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LR1_Grammar
protected LR1_Grammar()
Constructs an LR(1) parser around a new empty Grammar
.
LR1_Grammar
protected LR1_Grammar(Grammar grammar)
Constructs an LR(1) parser around an existing Grammar
.
- Parameters:
grammar
- the Grammar
around which the parser is constructed.
© 1999-2000 Craig A. Rich <carich@acm.org>