org.sc3d.apt.sss.v3
Class Tree.NonTerminal
java.lang.Object
org.sc3d.apt.sss.v3.Tree
org.sc3d.apt.sss.v3.Tree.NonTerminal
- Enclosing class:
- Tree
public static class Tree.NonTerminal
- extends Tree
The subclass of Tree with 'isTerminal==false', which represents zero or more parse-trees all matching the same non-terminal of the grammar. In other words, this class represents a string that matches a Grammar.NonTerminal.
Field Summary |
int |
length
The number of repeats that the parser found. |
Methods inherited from class org.sc3d.apt.sss.v3.Tree |
toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
length
public final int length
- The number of repeats that the parser found. If the Grammar.NonTerminal was marked as optional, this field may be zero, otherwise it must be non-zero. If the Grammar.NonTerminal was marked as repeatable, this field may be more than one, otherwise it must be at most one.
Tree.NonTerminal
public Tree.NonTerminal(Tree.Production[] repeats)
- Constructs a NonTerminal.
get
public Tree.Production get(int index)
- Returns the parse-tree of the repeat with index 'index'.
get
public Tree.Production get()
- Returns 'get(0)', or 'null' if 'length' is zero.
- Throws:
java.lang.IllegalArgumentException
- if 'length' is greater than one.