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

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

public static class Tree.Terminal
extends Tree

The subclass of Tree with 'isTerminal==true', which represents a single Token. In other words, this class represents a string that matches a Grammar.Terminal.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.sc3d.apt.sss.v3.Tree
Tree.NonTerminal, Tree.Production, Tree.Terminal
 
Field Summary
 Token t
          The Token that the parser found.
 
Fields inherited from class org.sc3d.apt.sss.v3.Tree
isTerminal
 
Constructor Summary
Tree.Terminal(Token t)
          Constructs a Terminal.
 
Method Summary
 Tree parse()
          If this Terminal represents a bracket, parses the contents and returns the parse-tree.
 
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
 

Field Detail

t

public Token t
The Token that the parser found.

Constructor Detail

Tree.Terminal

public Tree.Terminal(Token t)
Constructs a Terminal.

Method Detail

parse

public Tree parse()
If this Terminal represents a bracket, parses the contents and returns the parse-tree. If there are any errors, this method attaches appropriate error messages to the sentence and returns 'null'. Do not call this method if this Terminal does not represent a bracket. The default implementation throws a RuntimeException.