public static enum JavaScanner.TokenType extends Enum<JavaScanner.TokenType>
Enum Constant and Description |
---|
C_COMMENT
Starts with
"/*" and ends with "&42;/" . |
CHARACTER_LITERAL
A Java character literal as it appears in the input, i.e. including the leading and the trailing
single quote and any escape sequence.
|
CXX_COMMENT
Starts with
"//" and always ends with a line break (unless it is the last token). |
FLOATING_POINT_LITERAL
A Java floating point literal as it appears in the input, i.e. digits, decimal point and/or
exponent, optionally followed by
'd' or 'D' . |
IDENTIFIER
A Java identifier.
|
INTEGER_LITERAL
A Java integer literal as it appears in the input, i.e. a decimal, hexadecimal or octal constant,
optionally followed by
'l' or 'L' . |
KEYWORD
One of the Java keywords (
"abstract" , "assert" and so forth). |
MULTI_LINE_C_COMMENT_BEGINNING
Starts with
"/*" and ends with a line break. |
MULTI_LINE_C_COMMENT_END
Ends with
"*/" . |
MULTI_LINE_C_COMMENT_MIDDLE
Ends with a line break.
|
OPERATOR
One of the Java "operators":
>>>=
<<= >>= >>>
+= -= *= /= &= |= ^= %=
== <= >= !
|
SEPARATOR
One of the Java "separators":
( ) { } [ ] ; . , |
SPACE
One or more characters that are "
[ \t\n\x0B\f\r] ". |
STRING_LITERAL
A Java string literal as it appears in the input, i.e. including the leading and the trailing double
quote and all escape sequences.
|
Modifier and Type | Method and Description |
---|---|
static JavaScanner.TokenType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JavaScanner.TokenType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final JavaScanner.TokenType SPACE
[ \t\n\x0B\f\r]
".
This token type is the only one that is not deterministic, e.g. two space could be scanned into one or into two space tokens.
public static final JavaScanner.TokenType CXX_COMMENT
"//"
and always ends with a line break (unless it is the last token).public static final JavaScanner.TokenType C_COMMENT
"/*"
and ends with "&42;/"
.
If the C comment spans multiple lines, the line breaks appear exactly as in the input, for
example: "/**\r * @throws IOException\r\n */"
Notice that a Java scanner may represent multi-line C comments either as a C_COMMENT
,
token, or as a sequence of
MULTI_LINE_C_COMMENT_BEGINNING
{ MULTI_LINE_C_COMMENT_MIDDLE
}
MULTI_LINE_C_COMMENT_END
public static final JavaScanner.TokenType MULTI_LINE_C_COMMENT_BEGINNING
"/*"
and ends with a line break.
The line break appear exactly as in the input, for
example: "/**\r"
Notice that a Java scanner may represent multi-line C comments either as a C_COMMENT
,
token, or as a sequence of
MULTI_LINE_C_COMMENT_BEGINNING
{ MULTI_LINE_C_COMMENT_MIDDLE
}
MULTI_LINE_C_COMMENT_END
public static final JavaScanner.TokenType MULTI_LINE_C_COMMENT_MIDDLE
The line break appear exactly as in the input, for
example: " * @throws IOException\n"
Notice that a Java scanner may represent multi-line C comments either as a C_COMMENT
,
token, or as a sequence of
MULTI_LINE_C_COMMENT_BEGINNING
{ MULTI_LINE_C_COMMENT_MIDDLE
}
MULTI_LINE_C_COMMENT_END
public static final JavaScanner.TokenType MULTI_LINE_C_COMMENT_END
"*/"
.
Notice that a Java scanner may represent multi-line C comments either as a C_COMMENT
,
token, or as a sequence of
MULTI_LINE_C_COMMENT_BEGINNING
{ MULTI_LINE_C_COMMENT_MIDDLE
}
MULTI_LINE_C_COMMENT_END
public static final JavaScanner.TokenType KEYWORD
"abstract"
, "assert"
and so forth).public static final JavaScanner.TokenType IDENTIFIER
public static final JavaScanner.TokenType SEPARATOR
( ) { } [ ] ; . ,
public static final JavaScanner.TokenType OPERATOR
>>>= <<= >>= >>> += -= *= /= &= |= ^= %= == <= >= != && || ++ -- << >> = > < ! ~ ? : + - * / & | ^ % @
public static final JavaScanner.TokenType STRING_LITERAL
public static final JavaScanner.TokenType CHARACTER_LITERAL
public static final JavaScanner.TokenType INTEGER_LITERAL
'l'
or 'L'
.public static final JavaScanner.TokenType FLOATING_POINT_LITERAL
'd'
or 'D'
.public static JavaScanner.TokenType[] values()
for (JavaScanner.TokenType c : JavaScanner.TokenType.values()) System.out.println(c);
public static JavaScanner.TokenType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2018 Arno Unkrig. All rights reserved.