Package org.codehaus.janino
Enum TokenType
- java.lang.Object
-
- java.lang.Enum<TokenType>
-
- org.codehaus.janino.TokenType
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BOOLEAN_LITERAL
The token represents a boolean literal; itsToken.value
is either 'true' or 'false'.C_PLUS_PLUS_STYLE_COMMENT
The token represents a C++-style comment like "// This is a C++-style comment.
".C_STYLE_COMMENT
The token represents a C-style comment, like "/* This is a C-style comment. */
", which may span multiple lines.CHARACTER_LITERAL
The token represents a character literal; itsToken.value
is the text of the character literal exactly as it appears in the source code (including the single quotes around it).END_OF_INPUT
Indicates the "end-of-input" condition.FLOATING_POINT_LITERAL
The token represents a floating-point literal; itsToken.value
is the text of the floating-point literal exactly as it appears in the source code (e.g. "1.23", "1.23F", "1.23D", "1IDENTIFIER
The token represents a Java identifier.INTEGER_LITERAL
The token represents an integer literal; itsToken.value
is the text of the integer literal exactly as it appears in the source code (e.g. "0", "123", "123L", "03ff", "0xffff", "0b10101010").KEYWORD
The token represents a Java keywordNULL_LITERAL
The token represents thenull
literal; itsToken.value
is 'null'.OPERATOR
The token represents an operator; itsToken.value
is exactly the particular operator (e.gSTRING_LITERAL
The token represents a string literal; itsToken.value
is the text of the string literal exactly as it appears in the source code (including the double quotes around it).TEXT_BLOCK
The token represents a text block; itsToken.value
is the text of the text block exactly as it appears in the source code (including the leading and trailing"""
).WHITE_SPACE
The token represents "white space"; i.e. a non-empty sequence of whitespace characters.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static TokenType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static TokenType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
END_OF_INPUT
public static final TokenType END_OF_INPUT
Indicates the "end-of-input" condition.
-
IDENTIFIER
public static final TokenType IDENTIFIER
The token represents a Java identifier.
-
KEYWORD
public static final TokenType KEYWORD
The token represents a Java keyword. ("true"
,"false"
and"null"
are not Java keywords, butBOOLEAN_LITERAL
s andNULL_LITERAL
s.)
-
INTEGER_LITERAL
public static final TokenType INTEGER_LITERAL
The token represents an integer literal; itsToken.value
is the text of the integer literal exactly as it appears in the source code (e.g. "0", "123", "123L", "03ff", "0xffff", "0b10101010").
-
FLOATING_POINT_LITERAL
public static final TokenType FLOATING_POINT_LITERAL
The token represents a floating-point literal; itsToken.value
is the text of the floating-point literal exactly as it appears in the source code (e.g. "1.23", "1.23F", "1.23D", "1.", ".1", "1E13").
-
BOOLEAN_LITERAL
public static final TokenType BOOLEAN_LITERAL
The token represents a boolean literal; itsToken.value
is either 'true' or 'false'.
-
CHARACTER_LITERAL
public static final TokenType CHARACTER_LITERAL
The token represents a character literal; itsToken.value
is the text of the character literal exactly as it appears in the source code (including the single quotes around it).
-
STRING_LITERAL
public static final TokenType STRING_LITERAL
The token represents a string literal; itsToken.value
is the text of the string literal exactly as it appears in the source code (including the double quotes around it).
-
TEXT_BLOCK
public static final TokenType TEXT_BLOCK
The token represents a text block; itsToken.value
is the text of the text block exactly as it appears in the source code (including the leading and trailing"""
).
-
NULL_LITERAL
public static final TokenType NULL_LITERAL
The token represents thenull
literal; itsToken.value
is 'null'.
-
OPERATOR
public static final TokenType OPERATOR
The token represents an operator; itsToken.value
is exactly the particular operator (e.g. "<<<=").
-
WHITE_SPACE
public static final TokenType WHITE_SPACE
The token represents "white space"; i.e. a non-empty sequence of whitespace characters. Specifically, any line terminators appear exactly as in the input stream. JLS8 3.6
-
C_PLUS_PLUS_STYLE_COMMENT
public static final TokenType C_PLUS_PLUS_STYLE_COMMENT
The token represents a C++-style comment like "// This is a C++-style comment.
". Notice that the line terminator is not part of the comment; hence, this token is always followed by aWHITE_SPACE
token (or byEND_OF_INPUT
).
-
C_STYLE_COMMENT
public static final TokenType C_STYLE_COMMENT
The token represents a C-style comment, like "/* This is a C-style comment. */
", which may span multiple lines. In the latter case, the enclosed line terminators appear exactly as in the input stream.
-
-
Method Detail
-
values
public static TokenType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TokenType c : TokenType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TokenType valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-