Enum Class TokenType
- All Implemented Interfaces:
Serializable, Comparable<TokenType>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionintgetKind()intgetName()com.oracle.truffle.api.strings.TruffleStringgetNext()intbooleanIs type one of= *= /= %= += -= <<= >>= >>>= &= ^= |= **= &&= ||= ??=?booleanbooleanbooleanbooleanisOperator(boolean in) Determines if the type is a valid operator.booleanneedsParens(TokenType other, boolean isLeft) Determines if the token has greater precedence than other.toString()static TokenTypeReturns the enum constant of this class with the specified name.static TokenType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ERROR
-
EOF
-
EOL
-
COMMENT
-
DIRECTIVE_COMMENT
-
NOT
-
NE
-
NE_STRICT
-
MOD
-
ASSIGN_MOD
-
BIT_AND
-
AND
-
ASSIGN_BIT_AND
-
ASSIGN_AND
-
LPAREN
-
RPAREN
-
MUL
-
ASSIGN_MUL
-
EXP
-
ASSIGN_EXP
-
ADD
-
INCPREFIX
-
ASSIGN_ADD
-
COMMARIGHT
-
SUB
-
DECPREFIX
-
ASSIGN_SUB
-
PERIOD
-
DIV
-
ASSIGN_DIV
-
COLON
-
SEMICOLON
-
LT
-
SHL
-
ASSIGN_SHL
-
LE
-
ASSIGN
-
EQ
-
EQ_STRICT
-
ARROW
-
GT
-
GE
-
SAR
-
ASSIGN_SAR
-
SHR
-
ASSIGN_SHR
-
TERNARY
-
LBRACKET
-
RBRACKET
-
BIT_XOR
-
ASSIGN_BIT_XOR
-
LBRACE
-
BIT_OR
-
ASSIGN_BIT_OR
-
OR
-
ASSIGN_OR
-
RBRACE
-
BIT_NOT
-
ELLIPSIS
-
NULLISHCOALESC
-
ASSIGN_NULLCOAL
-
OPTIONAL_CHAIN
-
AT
-
ACCESSOR
-
AS
-
ASSERT
-
ASYNC
-
AWAIT
-
BREAK
-
CASE
-
CATCH
-
CLASS
-
CONST
-
CONTINUE
-
DEBUGGER
-
DEFAULT
-
DELETE
-
DO
-
ELSE
-
ENUM
-
EXPORT
-
EXTENDS
-
FALSE
-
FINALLY
-
FOR
-
FROM
-
FUNCTION
-
GET
-
IF
-
IMPLEMENTS
-
IMPORT
-
IN
-
INSTANCEOF
-
INTERFACE
-
LET
-
NEW
-
NULL
-
OF
-
PACKAGE
-
PRIVATE
-
PROTECTED
-
PUBLIC
-
RETURN
-
SET
-
STATIC
-
SUPER
-
SWITCH
-
THIS
-
THROW
-
TRUE
-
TRY
-
TYPEOF
-
VAR
-
VOID
-
WHILE
-
WITH
-
YIELD
-
DECIMAL
-
NON_OCTAL_DECIMAL
-
HEXADECIMAL
-
OCTAL_LEGACY
-
OCTAL
-
BINARY_NUMBER
-
BIGINT
-
FLOATING
-
STRING
-
ESCSTRING
-
IDENT
-
REGEX
-
OBJECT
-
ARRAY
-
TEMPLATE
-
TEMPLATE_HEAD
-
TEMPLATE_MIDDLE
-
TEMPLATE_TAIL
-
PRIVATE_IDENT
-
COMMALEFT
-
DECPOSTFIX
-
INCPOSTFIX
-
SPREAD_ARGUMENT
-
SPREAD_ARRAY
-
SPREAD_OBJECT
-
YIELD_STAR
-
ASSIGN_INIT
-
NAMEDEVALUATION
-
-
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
-
needsParens
Determines if the token has greater precedence than other.- Parameters:
other- Compare token.isLeft- Is to the left of the other.- Returns:
trueif greater precedence.
-
isOperator
public boolean isOperator(boolean in) Determines if the type is a valid operator.- Parameters:
in-falseif IN operator should be ignored.- Returns:
trueif valid operator.
-
getLength
public int getLength() -
getName
-
getNameTS
public com.oracle.truffle.api.strings.TruffleString getNameTS() -
getNameOrType
-
getNext
-
getKind
-
getPrecedence
public int getPrecedence() -
isLeftAssociative
public boolean isLeftAssociative() -
getECMAScriptVersion
public int getECMAScriptVersion() -
toString
-
isAssignment
public boolean isAssignment()Is type one of= *= /= %= += -= <<= >>= >>>= &= ^= |= **= &&= ||= ??=? -
isContextualKeyword
public boolean isContextualKeyword() -
isFutureStrict
public boolean isFutureStrict()
-