Generic Interpreter 1.3
Protected API

gi
Class Grammar.ParseTree

java.lang.Object
  extended by gi.Grammar.ParseTree
Enclosing class:
Grammar

protected static class Grammar.ParseTree
extends Object

This class implements a ParseTree constructed by interpreting a source stream.

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

Field Summary
 Grammar.ParseTree[] child
          The subtrees of the root of this ParseTree.
 Object root
          The symbol at the root of this ParseTree.
 Object value
          The attribute value at the root of this ParseTree.
 
Method Summary
 String toString()
          Returns the string representation of this ParseTree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

root

public Object root

The symbol at the root of this ParseTree. root can be a nonterminal, a terminal or Semantics.

Since:
1.1, renames symbol in version 1.0.

value

public Object value

The attribute value at the root of this ParseTree. If root is a terminal, value is initially the source word root matches; otherwise, value is initially null. value may be modified when interpreting by evaluation of embedded Semantics.

Since:
1.1, renames attribute in version 1.0.

child

public Grammar.ParseTree[] child

The subtrees of the root of this ParseTree. If root is a nonterminal, child is the array of subtrees produced by root; otherwise, child is null.

Since:
1.1, renames phrase in version 1.0.
Method Detail

toString

public String toString()

Returns the string representation of this ParseTree. The symbols in the ParseTree are shown in outline form, with children below their parent indented two columns. Each symbol is followed by its attribute value, if it is not null and differs from the symbol.

Overrides:
toString in class Object
Returns:
the string representation of this ParseTree.

 

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