org.waxeye.ast
Class NoChildren<E extends java.lang.Enum<?>>

java.lang.Object
  extended by org.waxeye.ast.NoChildren<E>
Type Parameters:
E - The node types for the AST.
All Implemented Interfaces:
IAST<E>
Direct Known Subclasses:
Char, Empty

public abstract class NoChildren<E extends java.lang.Enum<?>>
extends java.lang.Object
implements IAST<E>

A class to represent an AST with no children.

Author:
Orlando Hill

Constructor Summary
NoChildren(E type)
          Creates a new NoChildren AST.
 
Method Summary
 java.lang.String childrenAsString()
          Treats the children of the AST as IChar's and concatenates their values into a String.
 java.util.List<IAST<E>> getChildren()
          Returns a new empty list since this node doesn't allow children.
 Position getPosition()
          Returns the position.
 E getType()
          Returns the type.
 int hashCode()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.waxeye.ast.IAST
acceptASTVisitor
 

Constructor Detail

NoChildren

public NoChildren(E type)
Creates a new NoChildren AST.

Parameters:
type - The type of the AST.
Method Detail

hashCode

public final int hashCode()

Overrides:
hashCode in class java.lang.Object

getChildren

public final java.util.List<IAST<E>> getChildren()
Returns a new empty list since this node doesn't allow children.

Specified by:
getChildren in interface IAST<E extends java.lang.Enum<?>>
Returns:
Returns a new empty list.

getPosition

public final Position getPosition()
Returns the position. Can be null if the AST doesn't have a position set.

Specified by:
getPosition in interface IAST<E extends java.lang.Enum<?>>
Returns:
Returns the position;

getType

public final E getType()
Returns the type.

Specified by:
getType in interface IAST<E extends java.lang.Enum<?>>
Returns:
Returns the type.

childrenAsString

public final java.lang.String childrenAsString()
Treats the children of the AST as IChar's and concatenates their values into a String.

Specified by:
childrenAsString in interface IAST<E extends java.lang.Enum<?>>
Returns:
The AST's IChar children as a String.


Waxeye Parser Generator