Package tech.ixor.calclox.token
Enum Class TokenType
- All Implemented Interfaces:
Serializable,Comparable<TokenType>,Constable
Lexical categories recognized by the CalcLox scanner.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe keyword "define", used to define a user input value (that asks the user to input when running the program).The keyword "fun", used to define a function.An identifier, which is a (variable or function) name.A "nil" value, which is used to represent a null value.The keywordoutput, used to send a value to the host frontend.The keyword "var", used to declare a in-program variable that is not modifiable by the user directly. -
Method Summary
-
Enum Constant Details
-
DEFINE
The keyword "define", used to define a user input value (that asks the user to input when running the program). -
VAR
The keyword "var", used to declare a in-program variable that is not modifiable by the user directly. -
OUTPUT
The keywordoutput, used to send a value to the host frontend. -
NIL
A "nil" value, which is used to represent a null value. Reserved for future use. -
FUN
The keyword "fun", used to define a function. -
IF
-
ELSE
-
WHILE
-
FOR
-
BREAK
-
CONTINUE
-
RETURN
-
TRUE
-
FALSE
-
AND
-
OR
-
IDENTIFIER
An identifier, which is a (variable or function) name. -
STRING
-
NUMBER
-
LEFT_PAREN
-
RIGHT_PAREN
-
LEFT_BRACE
-
RIGHT_BRACE
-
COMMA
-
DOT
-
MINUS
-
PLUS
-
SEMICOLON
-
SLASH
-
STAR
-
BANG
-
BANG_EQUAL
-
EQUAL
-
EQUAL_EQUAL
-
GREATER
-
GREATER_EQUAL
-
LESS
-
LESS_EQUAL
-
EOF
-
-
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
-