Package jminusminus
Class TokenInfo
java.lang.Object
jminusminus.TokenInfo
A representation of tokens returned by the Scanner method getNextToken(). A token has a kind
 identifying what kind of token it is, an image for providing any semantic text, and the line in
 which it occurred in the source file.
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
TokenInfoConstructs a TokenInfo object given its kind, the semantic text forming the token, and its line number.- Parameters:
- kind- the token's kind.
- image- the semantic text forming the token.
- line- the line in which the token occurs in the source file.
 
- 
TokenInfoConstructs a TokenInfo object given its kind and its line number. Its image is simply the token kind's string representation.- Parameters:
- kind- the token's identifying number.
- line- the line in which the token occurs in the source file.
 
 
- 
- 
Method Details- 
kindReturns the token's kind.- Returns:
- the token's kind.
 
- 
linepublic int line()Returns the line number associated with the token.- Returns:
- the line number associated with the token.
 
- 
tokenRepReturns the token's string representation.- Returns:
- the token's string representation.
 
- 
imageReturns the token's image.- Returns:
- the token's image.
 
 
-