Package iota
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 ConstantDescriptionOperator, "=".Reserved word, "boolean".Separator, ",".Operator, "/".Reserved word, "else".End of file character.Operator, "==".Reserved word, "false".Operator, ">=".Operator, ">".Identifier.Reserved word, "if".Reserved word, "int".Integer literal.Operator, "&&".Separator, "{".Operator, "<=".Operator, "!".Operator, "||".Separator, "(".Operator, "<".Operator, "-".Operator, "!=".Operator, "+".Separator, "}".Operator, "%".Reserved word, "return".Separator, ")".Separator, ";".Operator, "*".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
-
BOOLEAN
Reserved word, "boolean". -
ELSE
Reserved word, "else". -
FALSE
Reserved word, "false". -
IF
Reserved word, "if". -
INT
Reserved word, "int". -
RETURN
Reserved word, "return". -
TRUE
Reserved word, "true". -
VOID
Reserved word, "void". -
WHILE
Reserved word, "while". -
COMMA
Separator, ",". -
LCURLY
Separator, "{". -
LPAREN
Separator, "(". -
RCURLY
Separator, "}". -
RPAREN
Separator, ")". -
SEMI
Separator, ";". -
ASSIGN
Operator, "=". -
DIV
Operator, "/". -
EQUAL
Operator, "==". -
GE
Operator, ">=". -
GT
Operator, ">". -
LAND
Operator, "&&". -
LE
Operator, "<=". -
LT
Operator, "<". -
LNOT
Operator, "!". -
LOR
Operator, "||". -
MINUS
Operator, "-". -
NOT_EQUAL
Operator, "!=". -
PLUS
Operator, "+". -
REM
Operator, "%". -
STAR
Operator, "*". -
IDENTIFIER
Identifier. -
INT_LITERAL
Integer 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.
-