class TokenInfo extends Object
Constructor and Description |
---|
TokenInfo(TokenKind kind,
int line)
Construct a TokenInfo from its kind, and its line number.
|
TokenInfo(TokenKind kind,
String image,
int line)
Construct a TokenInfo from its kind, the semantic text forming the token,
and its line number.
|
Modifier and Type | Method and Description |
---|---|
String |
image()
Return the semantic text associated with the token.
|
TokenKind |
kind()
Return the token's kind.
|
int |
line()
Return the line number associated with the token.
|
String |
tokenRep()
Return the token's string representation.
|
String |
toString()
Return the token's image.
|
public TokenInfo(TokenKind kind, String image, int line)
kind
- the token's kind.image
- the semantic text comprising the token.line
- the line in which the token occurs in the source file.public TokenInfo(TokenKind kind, int line)
kind
- the token's identifying number.line
- identifying the line on which the token was found.public String tokenRep()
public String image()
public int line()
public TokenKind kind()