edu.umd.cs.findbugs

Class Token

public class Token extends Object

Simple token class.

Author: David Hovemeyer

See Also: Tokenizer

Field Summary
static intCOMMENT
A comment.
static intEOF
End of file.
static intEOL
End of line.
static intSINGLE
A single character token.
static intSTRING
A string or character literal.
static intWORD
An ordinary word, number, etc.
Constructor Summary
Token(int kind, String lexeme)
Constructor.
Token(int kind)
Constructor when there is no text.
Method Summary
intgetKind()
Get the kind of token.
StringgetLexeme()
Get the text value of the token.

Field Detail

COMMENT

public static final int COMMENT
A comment.

EOF

public static final int EOF
End of file.

EOL

public static final int EOL
End of line.

SINGLE

public static final int SINGLE
A single character token.

STRING

public static final int STRING
A string or character literal.

WORD

public static final int WORD
An ordinary word, number, etc.

Constructor Detail

Token

public Token(int kind, String lexeme)
Constructor.

Parameters: kind the kind of token lexeme the text value of the token

Token

public Token(int kind)
Constructor when there is no text. E.g., EOF and EOL.

Parameters: kind the kind of token

Method Detail

getKind

public int getKind()
Get the kind of token.

getLexeme

public String getLexeme()
Get the text value of the token.
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.