jeops.compiler.parser
Class Token

java.lang.Object
  |
  +--jeops.compiler.parser.Token

public class Token
extends java.lang.Object
implements TokenConstants

Class used to store the tokens read from the rules file. It's returned by the scanner to the parser of the rules.

Version:
0.01 04.01.2000
Author:
Carlos Figueira Filho (csff@di.ufpe.br)

Field Summary
static Token EOF_TOKEN
          The EOF token.
 
Fields inherited from interface jeops.compiler.parser.TokenConstants
ACTIONS, ASTERISK, CLOSE_CURLY_BRACKET, COMMA, COMMENT, DECLARATIONS, DOT, EOF, EQUALS, ERROR, EXTENDS, IDENT, IMPORT, LOCALDECL, NONE_ABOVE, OPEN_CURLY_BRACKET, PACKAGE, PRECONDITIONS, PUBLIC, RULE, RULE_BASE, SEMICOLON, STRING, WHITE_SPACE
 
Constructor Summary
Token(int type, java.lang.String lexeme)
          Class constructor.
 
Method Summary
 java.lang.String getLexeme()
          Returns the lexeme associated with this token.
 int getTokenType()
          Returns the type of this token.
 java.lang.String toString()
          Returns a string representing this token.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EOF_TOKEN

public static final Token EOF_TOKEN
The EOF token.
Constructor Detail

Token

public Token(int type,
             java.lang.String lexeme)
Class constructor.
Parameters:
type - the type of this token.
lexeme - the lexeme associated with this token.
Method Detail

getTokenType

public int getTokenType()
Returns the type of this token.
Returns:
the type of this token.
See Also:
TokenConstants

getLexeme

public java.lang.String getLexeme()
Returns the lexeme associated with this token.
Returns:
the lexeme associated with this token.

toString

public java.lang.String toString()
Returns a string representing this token. Useful for debugging.
Overrides:
toString in class java.lang.Object
Returns:
a string representing this token.