org.sc3d.apt.sss.v3
Class Tree.Production

java.lang.Object
  extended by org.sc3d.apt.sss.v3.Tree.Production
Enclosing class:
Tree

public static class Tree.Production
extends java.lang.Object

Represents something constructed using a Grammar.Production from a sequence of smaller things.


Field Summary
 java.lang.String name
          The name of the Grammar.Production that was used.
 int numParts
          The number of parts.
 
Constructor Summary
Tree.Production(java.lang.String name, Tree[] parts)
          Constructs a Production.
 
Method Summary
 Tree get(int index)
          Returns the part with index 'index'.
 Tree.NonTerminal getNT(int index)
          Returns '(NonTerminal)get(index)'.
 Tree.Production getP(int index)
          Returns '(Production)getNT(index).get()'.
 Tree.Terminal getT(int index)
          Returns '(Terminal)get(index)'.
 java.lang.String toString()
          Returns a String representation of this Production.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public final java.lang.String name
The name of the Grammar.Production that was used.


numParts

public final int numParts
The number of parts. This is the same as the corresponding field of the Grammar.Production that was used.

Constructor Detail

Tree.Production

public Tree.Production(java.lang.String name,
                       Tree[] parts)
Constructs a Production.

Method Detail

get

public Tree get(int index)
Returns the part with index 'index'.


getT

public Tree.Terminal getT(int index)
Returns '(Terminal)get(index)'.


getNT

public Tree.NonTerminal getNT(int index)
Returns '(NonTerminal)get(index)'.


getP

public Tree.Production getP(int index)
Returns '(Production)getNT(index).get()'.


toString

public java.lang.String toString()
Returns a String representation of this Production.

Overrides:
toString in class java.lang.Object