Package jminusminus
Enum Class TokenKind
- All Implemented Interfaces:
Serializable
,Comparable<TokenKind>
,Constable
An enum of token kinds. Each entry in this enum represents the kind of a token along with its image (string
representation).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionReserved word, "abstract".Operator, "=".Reserved word, "boolean".Reserved word, "char".Character literal.Reserved word, "class".Separator, ",".Operator, "--".Separator, ".".Reserved word, "else".End of file character.Operator, "==".Reserved word, "extends".Reserved word, "false".Operator, ">".Identifier.Reserved word, "if".Reserved word, "import".Operator, "++".Reserved word, "instanceof".Reserved word, "int".Integer literal.Operator, "&&".Separator, "[".Separator, "{}".Operator, "<=".Operator, "!".Separator, "(".Operator, "-".Reserved word, "new".Reserved word, "null".Reserved word, "package".Operator, "+".Operator, "+=".Reserved word, "private".Reserved word, "protected".Reserved word, "public".Separator, "]".Separator, "}".Reserved word, "return".Separator, ")".Separator, ";".Operator, "*".Reserved word, "static".String literal.Reserved word, "super".Reserved word, "this".Reserved word, "true".Reserved word, "void".Reserved word, "while". -
Method Summary
Modifier and TypeMethodDescriptionimage()
Returns the token kind's image.tokenRep()
Returns the token kind's string representation.static TokenKind
Returns the enum constant of this class with the specified name.static TokenKind[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ABSTRACT
Reserved word, "abstract". -
BOOLEAN
Reserved word, "boolean". -
CHAR
Reserved word, "char". -
CLASS
Reserved word, "class". -
ELSE
Reserved word, "else". -
EXTENDS
Reserved word, "extends". -
FALSE
Reserved word, "false". -
IF
Reserved word, "if". -
IMPORT
Reserved word, "import". -
INSTANCEOF
Reserved word, "instanceof". -
INT
Reserved word, "int". -
NEW
Reserved word, "new". -
NULL
Reserved word, "null". -
PACKAGE
Reserved word, "package". -
PRIVATE
Reserved word, "private". -
PROTECTED
Reserved word, "protected". -
PUBLIC
Reserved word, "public". -
RETURN
Reserved word, "return". -
STATIC
Reserved word, "static". -
SUPER
Reserved word, "super". -
THIS
Reserved word, "this". -
TRUE
Reserved word, "true". -
VOID
Reserved word, "void". -
WHILE
Reserved word, "while". -
ASSIGN
Operator, "=". -
DEC
Operator, "--". -
EQUAL
Operator, "==". -
GT
Operator, ">". -
INC
Operator, "++". -
LAND
Operator, "&&". -
LE
Operator, "<=". -
LNOT
Operator, "!". -
MINUS
Operator, "-". -
PLUS
Operator, "+". -
PLUS_ASSIGN
Operator, "+=". -
STAR
Operator, "*". -
COMMA
Separator, ",". -
DOT
Separator, ".". -
LBRACK
Separator, "[". -
LCURLY
Separator, "{}". -
LPAREN
Separator, "(". -
RBRACK
Separator, "]". -
RCURLY
Separator, "}". -
RPAREN
Separator, ")". -
SEMI
Separator, ";". -
IDENTIFIER
Identifier. -
CHAR_LITERAL
Character literal. -
INT_LITERAL
Integer literal. -
STRING_LITERAL
String literal. -
EOF
End of file character.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
tokenRep
Returns the token kind's string representation.- Returns:
- the token kind's string representation.
-
image
Returns the token kind's image.- Returns:
- the token kind's image.
-