Generic Interpreter 1.2
Public API

gi
Class LR0_Grammar

java.lang.Object
  extended bygi.Lexicon
      extended bygi.Grammar
          extended bygi.LR0_Grammar
Direct Known Subclasses:
LR1_Grammar, SLR1_Grammar

public class LR0_Grammar
extends Grammar

This class implements an LR(0) 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(0) parsing is not very practical, since it ignores lookahead information and is easily confused, but it forms a basis around which SLR(1) and LR(1) parsers are constructed.

Version:
1.2
Author:
© 1999-2004 Craig A. Rich <carich@csupomona.edu>

Method Summary
 String toString()
          Returns the string representation of this parser, specifically "LR(0)".
 
Methods inherited from class gi.Grammar
interpret
 
Methods inherited from class gi.Lexicon
interpret, interpret, interpret, interpret, interpret, interpret
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

toString

public String toString()

Returns the string representation of this parser, specifically "LR(0)".

Returns:
the string representation of this parser, specifically "LR(0)".
Since:
1.1

 

© 1999-2004 Craig A. Rich <carich@csupomona.edu>