public final class Scanner.Token
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
BOOLEAN_LITERAL
The token represents a boolean literal; its
value is either 'true' or 'false'. |
static int |
CHARACTER_LITERAL
The token represents a character literal; its
value is the text of the character literal exactly as
it appears in the source code (including the single quotes around it). |
private short |
columnNumber |
static int |
EOF
Indication of the 'end-of-input' condition.
|
static int |
FLOATING_POINT_LITERAL
The token represents a floating-point literal; its
value is the text of the floating-point literal
exactly as it appears in the source code. |
static int |
IDENTIFIER
The token represents an identifier.
|
static int |
INTEGER_LITERAL
The token represents an integer literal; its
value is the text of the integer literal exactly as it
appears in the source code. |
static int |
KEYWORD
The token represents a keyword.
|
private short |
lineNumber |
private Location |
location |
static int |
NULL_LITERAL
The token represents the
null literal; its value is 'null'. |
static int |
OPERATOR
The token represents an operator; its
value is exactly the particular operator (e.g. |
private java.lang.String |
optionalFileName |
static int |
STRING_LITERAL
The token represents a string literal; its
value is the text of the string literal exactly as it
appears in the source code (including the double quotes around it). |
int |
type
The type of this token; legal values are the various public constant declared in this class.
|
java.lang.String |
value
The text of the token exactly as it appears in the source code.
|
Modifier | Constructor and Description |
---|---|
private |
Token(int type,
java.lang.String value) |
Modifier and Type | Method and Description |
---|---|
Location |
getLocation() |
java.lang.String |
toString() |
private final java.lang.String optionalFileName
private final short lineNumber
private final short columnNumber
private Location location
public final int type
public static final int EOF
public static final int IDENTIFIER
public static final int KEYWORD
public static final int INTEGER_LITERAL
value
is the text of the integer literal exactly as it
appears in the source code.public static final int FLOATING_POINT_LITERAL
value
is the text of the floating-point literal
exactly as it appears in the source code.public static final int BOOLEAN_LITERAL
value
is either 'true' or 'false'.public static final int CHARACTER_LITERAL
value
is the text of the character literal exactly as
it appears in the source code (including the single quotes around it).public static final int STRING_LITERAL
value
is the text of the string literal exactly as it
appears in the source code (including the double quotes around it).public static final int NULL_LITERAL
null
literal; its value
is 'null'.public static final int OPERATOR
value
is exactly the particular operator (e.g. "<<<=").public final java.lang.String value
public Location getLocation()
public java.lang.String toString()
toString
in class java.lang.Object