|
Generic Interpreter 1.2 Private API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgi.Grammar.ParseTree
This class implements a constructed by interpreting a source stream.ParseTree
| Field Summary | |
Grammar.ParseTree[] |
child
The subtrees of the root of this ParseTree. |
Object |
root
The symbol at the root of this ParseTree. |
private static StringBuffer |
t
The last string representation of a ParseTree returned. |
Object |
value
The attribute value at the root of this ParseTree. |
| Constructor Summary | |
(package private) |
Grammar.ParseTree(Object root,
Object value,
Grammar.ParseTree[] child)
Constructs a ParseTree with a root and its subtrees. |
| Method Summary | |
String |
toString()
Returns the string representation of this ParseTree. |
private void |
toString(int depth)
Appends the string representation of this ParseTree to t}. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
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.
phrase in version 1.0.public Object root
The symbol at the root of this ParseTree. root can be a nonterminal, a terminal or Semantics.
symbol in version 1.0.private static StringBuffer t
The last string representation of a ParseTree returned.
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.
attribute in version 1.0.| Constructor Detail |
Grammar.ParseTree(Object root,
Object value,
Grammar.ParseTree[] child)
Constructs a ParseTree with a root and its subtrees.
root - the symbol at the root.value - the attribute value at the root.child - the array of subtrees produced by root.| Method Detail |
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.
ParseTree.private void toString(int depth)
Appends the string representation of this ParseTree to t}.
depth - the depth at which this ParseTree occurs.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||