com.inxar.syntacs.analyzer
Class ConstantSymbol

java.lang.Object
  |
  +--com.inxar.syntacs.analyzer.AbstractSymbol
        |
        +--com.inxar.syntacs.analyzer.ConstantSymbol
All Implemented Interfaces:
Arboreal, Symbol

public class ConstantSymbol
extends AbstractSymbol

Concrete implementation of Symbol which needs no internal state other than the symbol type. This implementation might be used for tokens like "COLON_CHAR" or other punctuation symbols whose definition can be derived solely from its type.


Constructor Summary
ConstantSymbol(int type)
          Constructs an ConstantSymbol with the given type.
 
Method Summary
 boolean equals(Object other)
           
 String toString()
           
 void toTree(Tree t)
          Writes state to the given Tree.
 
Methods inherited from class com.inxar.syntacs.analyzer.AbstractSymbol
getSymbolType, setSymbolType
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConstantSymbol

public ConstantSymbol(int type)
Constructs an ConstantSymbol with the given type.
Method Detail

toString

public String toString()
Overrides:
toString in class Object

toTree

public void toTree(Tree t)
Description copied from interface: Arboreal
Writes state to the given Tree.

equals

public boolean equals(Object other)
Overrides:
equals in class Object