se.chalmers.cs.gf.parse
Class Token

java.lang.Object
  extended by se.chalmers.cs.gf.parse.Token

public class Token
extends java.lang.Object


Nested Class Summary
static class Token.Type
           
 
Constructor Summary
Token(java.lang.String value)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 boolean equals(Token t)
           
 Token.Type getType()
          Gets the type of this token.
 java.lang.String getValue()
          Get the value of this token.
 int hashCode()
           
 int intValue()
          Get the integer value of this token.
 boolean isWord()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Token

public Token(java.lang.String value)
Method Detail

getValue

public java.lang.String getValue()
Get the value of this token. If the token is a word, the value is the word itself. If the token is a string literal backslashes and double quotes in the value are not escaped.


getType

public Token.Type getType()
Gets the type of this token.


isWord

public boolean isWord()

intValue

public int intValue()
Get the integer value of this token.

Throws:
GFException - If this is not an integer token.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(Token t)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object