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@cin.ufpe.br)
Field Summary |
static Token |
EOF_TOKEN
The EOF token. |
private java.lang.String |
lexeme
The lexeme associated with this token. |
private int |
tokenType
The type of this token. |
Fields inherited from interface jeops.compiler.parser.TokenConstants |
ACTIONS,
ASTERISK,
CLOSE_CURLY_BRACKET,
COMMA,
COMMENT,
CONDITIONS,
DECLARATIONS,
DOT,
EOF,
EQUALS,
ERROR,
EXTENDS,
IDENT,
IMPLEMENTS,
IMPORT,
LOCALDECL,
NONE_ABOVE,
OPEN_CURLY_BRACKET,
PACKAGE,
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 |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
tokenType
private int tokenType
- The type of this token.
- See Also:
TokenConstants
lexeme
private java.lang.String lexeme
- The lexeme associated with this token.
EOF_TOKEN
public static final Token EOF_TOKEN
- The EOF token.
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.
getLexeme
public java.lang.String getLexeme()
- Returns the lexeme associated with this token.
- Returns:
- the lexeme associated with this token.
getTokenType
public int getTokenType()
- Returns the type of this token.
- Returns:
- the type of this token.
- See Also:
TokenConstants
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.