com.neoworks.rdc
Class Token

java.lang.Object
  |
  +--com.neoworks.rdc.Token

public class Token
extends java.lang.Object

A class to represent tokens passed by the lexer.


Constructor Summary
Token(int tokenType, int tokenValue, java.lang.String lexeme)
          Construct the class by setting the values to the arguments passed.
Token(int tokenType, int tokenValue, java.lang.String lexeme, int tokenStart)
          Construct the class by setting the values to the arguments passed.
Token(Token copyToken)
          Copy constructor to create a token from another token.
Token(Token copyToken, int tokenStart)
          Copy constructor to create a token from another token.
 
Method Summary
 java.lang.String getLexeme()
          Return the lexeme of the token
 int getStart()
          Return the start index of the token
 int getTokenType()
          Return the type of the token
 int getTokenValue()
          Return the value of the token
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Token

public Token(int tokenType,
             int tokenValue,
             java.lang.String lexeme)
Construct the class by setting the values to the arguments passed.

Parameters:
tokenType - The type of the token
tokenValue - The value of the token
lexeme - The text of the token

Token

public Token(int tokenType,
             int tokenValue,
             java.lang.String lexeme,
             int tokenStart)
Construct the class by setting the values to the arguments passed.

Parameters:
tokenType - The type of the token
tokenValue - The value of the token
lexeme - The text of the token
tokenStart - The offset into the input string

Token

public Token(Token copyToken)
Copy constructor to create a token from another token.

Parameters:
copyToken - The token to copy into this one

Token

public Token(Token copyToken,
             int tokenStart)
Copy constructor to create a token from another token.

Parameters:
copyToken - The token to copy into this one
tokenStart - The new token start value
Method Detail

getTokenType

public int getTokenType()
Return the type of the token


getTokenValue

public int getTokenValue()
Return the value of the token


getLexeme

public java.lang.String getLexeme()
Return the lexeme of the token


getStart

public int getStart()
Return the start index of the token


toString

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