- java.lang.Object
-
- java.lang.Enum<Tree.Kind>
-
- jdk.nashorn.api.tree.Tree.Kind
-
- All Implemented Interfaces:
Serializable
,Comparable<Tree.Kind>
- Enclosing interface:
- Tree
public static enum Tree.Kind extends Enum<Tree.Kind>
Enumerates all kinds of trees.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AND
Used for instances ofBinaryTree
representing bitwise and logical "and"&
.AND_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing bitwise and logical "and" assignment&=
.ARRAY_ACCESS
Used for instances ofArrayAccessTree
.ARRAY_LITERAL
Used for instances ofArrayLiteralTree
.ASSIGNMENT
Used for instances ofAssignmentTree
.BITWISE_COMPLEMENT
Used for instances ofUnaryTree
representing bitwise complement operator~
.BLOCK
Used for instances ofBlockTree
.BOOLEAN_LITERAL
Used for instances ofLiteralTree
representing a boolean literal expression of typeboolean
.BREAK
Used for instances ofBreakTree
.CASE
Used for instances ofCaseTree
.CATCH
Used for instances ofCatchTree
.CLASS
Used for instances ofClassDeclarationTree
.CLASS_EXPRESSION
Used for instances ofClassExpressionTree
.COMMA
Used for instances ofBinaryTree
representing comma,
.COMPILATION_UNIT
Used for instances ofCompilationUnitTree
.CONDITIONAL_AND
Used for instances ofBinaryTree
representing conditional-and&&
.CONDITIONAL_EXPRESSION
Used for instances ofConditionalExpressionTree
.CONDITIONAL_OR
Used for instances ofBinaryTree
representing conditional-or||
.CONTINUE
Used for instances ofContinueTree
.DEBUGGER
Used for instances ofDebuggerTree
.DELETE
Used for instances ofUnaryTree
representing logical delete operatordelete
.DIVIDE
Used for instances ofBinaryTree
representing division/
.DIVIDE_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing division assignment/=
.DO_WHILE_LOOP
Used for instances ofDoWhileLoopTree
.EMPTY_STATEMENT
Used for instances ofEmptyStatementTree
.EQUAL_TO
Used for instances ofBinaryTree
representing equal-to==
.ERROR
Used for instances ofErroneousTree
.EXPORT_ENTRY
Used for instances ofExportEntryTree
.EXPRESSION_STATEMENT
Used for instances ofExpressionStatementTree
.FOR_IN_LOOP
Used for instances ofForInLoopTree
.FOR_LOOP
Used for instances ofForLoopTree
.FUNCTION
Used for instances ofFunctionDeclarationTree
.FUNCTION_EXPRESSION
Used for instances ofFunctionExpressionTree
.FUNCTION_INVOCATION
Used for instances ofFunctionCallTree
.GREATER_THAN
Used for instances ofBinaryTree
representing greater-than>
.GREATER_THAN_EQUAL
Used for instances ofBinaryTree
representing greater-than-equal>=
.IDENTIFIER
Used for instances ofIdentifierTree
.IF
Used for instances ofIfTree
.IMPORT_ENTRY
Used for instances ofImportEntryTree
.IN
Used for instances ofBinaryTree
representing in operatorin
.INSTANCE_OF
Used for instances ofInstanceOfTree
.LABELED_STATEMENT
Used for instances ofLabeledStatementTree
.LEFT_SHIFT
Used for instances ofBinaryTree
representing left shift<<
.LEFT_SHIFT_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing left shift assignment<<=
.LESS_THAN
Used for instances ofBinaryTree
representing less-than<
.LESS_THAN_EQUAL
Used for instances ofBinaryTree
representing less-than-equal<=
.LOGICAL_COMPLEMENT
Used for instances ofUnaryTree
representing logical complement operator!
.MEMBER_SELECT
Used for instances ofMemberSelectTree
.MINUS
Used for instances ofBinaryTree
representing subtraction-
.MINUS_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing subtraction assignment-=
.MODULE
Used for instances ofModuleTree
.MULTIPLY
Used for instances ofBinaryTree
representing multiplication*
.MULTIPLY_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing multiplication assignment*=
.NEW
Used for instances ofNewTree
.NOT_EQUAL_TO
Used for instances ofBinaryTree
representing not-equal-to!=
.NULL_LITERAL
Used for instances ofLiteralTree
representing the use ofnull
.NUMBER_LITERAL
Used for instances ofLiteralTree
representing a number literal expression of typedouble
.OBJECT_LITERAL
Used for instances ofObjectLiteralTree
.OR
Used for instances ofBinaryTree
representing bitwise and logical "or"|
.OR_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing bitwise and logical "or" assignment|=
.OTHER
An implementation-reserved node.PARENTHESIZED
Used for instances ofParenthesizedTree
.PLUS
Used for instances ofBinaryTree
representing addition or string concatenation+
.PLUS_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing addition or string concatenation assignment+=
.POSTFIX_DECREMENT
Used for instances ofUnaryTree
representing postfix decrement operator--
.POSTFIX_INCREMENT
Used for instances ofUnaryTree
representing postfix increment operator++
.PREFIX_DECREMENT
Used for instances ofUnaryTree
representing prefix decrement operator--
.PREFIX_INCREMENT
Used for instances ofUnaryTree
representing prefix increment operator++
.PROPERTY
Used for instances ofPropertyTree
.REGEXP_LITERAL
Used for instances ofRegExpLiteralTree
.REMAINDER
Used for instances ofBinaryTree
representing remainder%
.REMAINDER_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing remainder assignment%=
.RETURN
Used for instances ofReturnTree
.RIGHT_SHIFT
Used for instances ofBinaryTree
representing right shift>>
.RIGHT_SHIFT_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing right shift assignment>>=
.SPREAD
Used for instances ofSpreadTree
representing spread "operator" for arrays and function call arguments.STRICT_EQUAL_TO
Used for instances ofBinaryTree
representing equal-to===
.STRICT_NOT_EQUAL_TO
Used for instances ofBinaryTree
representing not-equal-to!==
.STRING_LITERAL
Used for instances ofLiteralTree
representing a string literal expression of typeString
.SWITCH
Used for instances ofSwitchTree
.TEMPLATE_LITERAL
Used for instances ofTemplateLiteralTree
.THROW
Used for instances ofThrowTree
.TRY
Used for instances ofTryTree
.TYPEOF
Used for instances ofUnaryTree
representing logical typeof operatortypeof
.UNARY_MINUS
Used for instances ofUnaryTree
representing unary minus operator-
.UNARY_PLUS
Used for instances ofUnaryTree
representing unary plus operator+
.UNSIGNED_RIGHT_SHIFT
Used for instances ofBinaryTree
representing unsigned right shift>>>
.UNSIGNED_RIGHT_SHIFT_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing unsigned right shift assignment>>>=
.VARIABLE
Used for instances ofVariableTree
.VOID
Used for instances ofUnaryTree
representing logical void operatorvoid
.WHILE_LOOP
Used for instances ofWhileLoopTree
.WITH
Used for instances ofWithTree
.XOR
Used for instances ofBinaryTree
representing bitwise and logical "xor"^
.XOR_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing bitwise and logical "xor" assignment^=
.YIELD
Used for instances ofYieldTree
representing (generator) yield expressionyield expr
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<? extends Tree>
asInterface()
Returns the associated interface type that uses this kind.boolean
isExpression()
Returns if this is an expression tree kind or not.boolean
isLiteral()
Returns if this is a literal tree kind or not.boolean
isStatement()
Returns if this is a statement tree kind or not.static Tree.Kind
valueOf(String name)
Returns the enum constant of this type with the specified name.static Tree.Kind[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ARRAY_ACCESS
public static final Tree.Kind ARRAY_ACCESS
Used for instances ofArrayAccessTree
.
-
ARRAY_LITERAL
public static final Tree.Kind ARRAY_LITERAL
Used for instances ofArrayLiteralTree
.
-
ASSIGNMENT
public static final Tree.Kind ASSIGNMENT
Used for instances ofAssignmentTree
.
-
CLASS
public static final Tree.Kind CLASS
Used for instances ofClassDeclarationTree
.
-
CLASS_EXPRESSION
public static final Tree.Kind CLASS_EXPRESSION
Used for instances ofClassExpressionTree
.
-
COMPILATION_UNIT
public static final Tree.Kind COMPILATION_UNIT
Used for instances ofCompilationUnitTree
.
-
CONDITIONAL_EXPRESSION
public static final Tree.Kind CONDITIONAL_EXPRESSION
Used for instances ofConditionalExpressionTree
.
-
CONTINUE
public static final Tree.Kind CONTINUE
Used for instances ofContinueTree
.
-
DO_WHILE_LOOP
public static final Tree.Kind DO_WHILE_LOOP
Used for instances ofDoWhileLoopTree
.
-
DEBUGGER
public static final Tree.Kind DEBUGGER
Used for instances ofDebuggerTree
.
-
FOR_IN_LOOP
public static final Tree.Kind FOR_IN_LOOP
Used for instances ofForInLoopTree
.
-
FUNCTION_EXPRESSION
public static final Tree.Kind FUNCTION_EXPRESSION
Used for instances ofFunctionExpressionTree
.
-
ERROR
public static final Tree.Kind ERROR
Used for instances ofErroneousTree
.
-
EXPRESSION_STATEMENT
public static final Tree.Kind EXPRESSION_STATEMENT
Used for instances ofExpressionStatementTree
.
-
MEMBER_SELECT
public static final Tree.Kind MEMBER_SELECT
Used for instances ofMemberSelectTree
.
-
FOR_LOOP
public static final Tree.Kind FOR_LOOP
Used for instances ofForLoopTree
.
-
IDENTIFIER
public static final Tree.Kind IDENTIFIER
Used for instances ofIdentifierTree
.
-
INSTANCE_OF
public static final Tree.Kind INSTANCE_OF
Used for instances ofInstanceOfTree
.
-
LABELED_STATEMENT
public static final Tree.Kind LABELED_STATEMENT
Used for instances ofLabeledStatementTree
.
-
MODULE
public static final Tree.Kind MODULE
Used for instances ofModuleTree
.
-
EXPORT_ENTRY
public static final Tree.Kind EXPORT_ENTRY
Used for instances ofExportEntryTree
.
-
IMPORT_ENTRY
public static final Tree.Kind IMPORT_ENTRY
Used for instances ofImportEntryTree
.
-
FUNCTION
public static final Tree.Kind FUNCTION
Used for instances ofFunctionDeclarationTree
.
-
FUNCTION_INVOCATION
public static final Tree.Kind FUNCTION_INVOCATION
Used for instances ofFunctionCallTree
.
-
OBJECT_LITERAL
public static final Tree.Kind OBJECT_LITERAL
Used for instances ofObjectLiteralTree
.
-
PARENTHESIZED
public static final Tree.Kind PARENTHESIZED
Used for instances ofParenthesizedTree
.
-
PROPERTY
public static final Tree.Kind PROPERTY
Used for instances ofPropertyTree
.
-
REGEXP_LITERAL
public static final Tree.Kind REGEXP_LITERAL
Used for instances ofRegExpLiteralTree
.
-
TEMPLATE_LITERAL
public static final Tree.Kind TEMPLATE_LITERAL
Used for instances ofTemplateLiteralTree
.
-
RETURN
public static final Tree.Kind RETURN
Used for instances ofReturnTree
.
-
EMPTY_STATEMENT
public static final Tree.Kind EMPTY_STATEMENT
Used for instances ofEmptyStatementTree
.
-
SWITCH
public static final Tree.Kind SWITCH
Used for instances ofSwitchTree
.
-
VARIABLE
public static final Tree.Kind VARIABLE
Used for instances ofVariableTree
.
-
WHILE_LOOP
public static final Tree.Kind WHILE_LOOP
Used for instances ofWhileLoopTree
.
-
POSTFIX_INCREMENT
public static final Tree.Kind POSTFIX_INCREMENT
Used for instances ofUnaryTree
representing postfix increment operator++
.
-
POSTFIX_DECREMENT
public static final Tree.Kind POSTFIX_DECREMENT
Used for instances ofUnaryTree
representing postfix decrement operator--
.
-
PREFIX_INCREMENT
public static final Tree.Kind PREFIX_INCREMENT
Used for instances ofUnaryTree
representing prefix increment operator++
.
-
PREFIX_DECREMENT
public static final Tree.Kind PREFIX_DECREMENT
Used for instances ofUnaryTree
representing prefix decrement operator--
.
-
UNARY_PLUS
public static final Tree.Kind UNARY_PLUS
Used for instances ofUnaryTree
representing unary plus operator+
.
-
UNARY_MINUS
public static final Tree.Kind UNARY_MINUS
Used for instances ofUnaryTree
representing unary minus operator-
.
-
BITWISE_COMPLEMENT
public static final Tree.Kind BITWISE_COMPLEMENT
Used for instances ofUnaryTree
representing bitwise complement operator~
.
-
LOGICAL_COMPLEMENT
public static final Tree.Kind LOGICAL_COMPLEMENT
Used for instances ofUnaryTree
representing logical complement operator!
.
-
DELETE
public static final Tree.Kind DELETE
Used for instances ofUnaryTree
representing logical delete operatordelete
.
-
TYPEOF
public static final Tree.Kind TYPEOF
Used for instances ofUnaryTree
representing logical typeof operatortypeof
.
-
VOID
public static final Tree.Kind VOID
Used for instances ofUnaryTree
representing logical void operatorvoid
.
-
COMMA
public static final Tree.Kind COMMA
Used for instances ofBinaryTree
representing comma,
.
-
MULTIPLY
public static final Tree.Kind MULTIPLY
Used for instances ofBinaryTree
representing multiplication*
.
-
DIVIDE
public static final Tree.Kind DIVIDE
Used for instances ofBinaryTree
representing division/
.
-
REMAINDER
public static final Tree.Kind REMAINDER
Used for instances ofBinaryTree
representing remainder%
.
-
PLUS
public static final Tree.Kind PLUS
Used for instances ofBinaryTree
representing addition or string concatenation+
.
-
MINUS
public static final Tree.Kind MINUS
Used for instances ofBinaryTree
representing subtraction-
.
-
LEFT_SHIFT
public static final Tree.Kind LEFT_SHIFT
Used for instances ofBinaryTree
representing left shift<<
.
-
RIGHT_SHIFT
public static final Tree.Kind RIGHT_SHIFT
Used for instances ofBinaryTree
representing right shift>>
.
-
UNSIGNED_RIGHT_SHIFT
public static final Tree.Kind UNSIGNED_RIGHT_SHIFT
Used for instances ofBinaryTree
representing unsigned right shift>>>
.
-
LESS_THAN
public static final Tree.Kind LESS_THAN
Used for instances ofBinaryTree
representing less-than<
.
-
GREATER_THAN
public static final Tree.Kind GREATER_THAN
Used for instances ofBinaryTree
representing greater-than>
.
-
LESS_THAN_EQUAL
public static final Tree.Kind LESS_THAN_EQUAL
Used for instances ofBinaryTree
representing less-than-equal<=
.
-
GREATER_THAN_EQUAL
public static final Tree.Kind GREATER_THAN_EQUAL
Used for instances ofBinaryTree
representing greater-than-equal>=
.
-
IN
public static final Tree.Kind IN
Used for instances ofBinaryTree
representing in operatorin
.
-
EQUAL_TO
public static final Tree.Kind EQUAL_TO
Used for instances ofBinaryTree
representing equal-to==
.
-
NOT_EQUAL_TO
public static final Tree.Kind NOT_EQUAL_TO
Used for instances ofBinaryTree
representing not-equal-to!=
.
-
STRICT_EQUAL_TO
public static final Tree.Kind STRICT_EQUAL_TO
Used for instances ofBinaryTree
representing equal-to===
.
-
STRICT_NOT_EQUAL_TO
public static final Tree.Kind STRICT_NOT_EQUAL_TO
Used for instances ofBinaryTree
representing not-equal-to!==
.
-
AND
public static final Tree.Kind AND
Used for instances ofBinaryTree
representing bitwise and logical "and"&
.
-
XOR
public static final Tree.Kind XOR
Used for instances ofBinaryTree
representing bitwise and logical "xor"^
.
-
OR
public static final Tree.Kind OR
Used for instances ofBinaryTree
representing bitwise and logical "or"|
.
-
CONDITIONAL_AND
public static final Tree.Kind CONDITIONAL_AND
Used for instances ofBinaryTree
representing conditional-and&&
.
-
CONDITIONAL_OR
public static final Tree.Kind CONDITIONAL_OR
Used for instances ofBinaryTree
representing conditional-or||
.
-
MULTIPLY_ASSIGNMENT
public static final Tree.Kind MULTIPLY_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing multiplication assignment*=
.
-
DIVIDE_ASSIGNMENT
public static final Tree.Kind DIVIDE_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing division assignment/=
.
-
REMAINDER_ASSIGNMENT
public static final Tree.Kind REMAINDER_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing remainder assignment%=
.
-
PLUS_ASSIGNMENT
public static final Tree.Kind PLUS_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing addition or string concatenation assignment+=
.
-
MINUS_ASSIGNMENT
public static final Tree.Kind MINUS_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing subtraction assignment-=
.
-
LEFT_SHIFT_ASSIGNMENT
public static final Tree.Kind LEFT_SHIFT_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing left shift assignment<<=
.
-
RIGHT_SHIFT_ASSIGNMENT
public static final Tree.Kind RIGHT_SHIFT_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing right shift assignment>>=
.
-
UNSIGNED_RIGHT_SHIFT_ASSIGNMENT
public static final Tree.Kind UNSIGNED_RIGHT_SHIFT_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing unsigned right shift assignment>>>=
.
-
AND_ASSIGNMENT
public static final Tree.Kind AND_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing bitwise and logical "and" assignment&=
.
-
XOR_ASSIGNMENT
public static final Tree.Kind XOR_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing bitwise and logical "xor" assignment^=
.
-
OR_ASSIGNMENT
public static final Tree.Kind OR_ASSIGNMENT
Used for instances ofCompoundAssignmentTree
representing bitwise and logical "or" assignment|=
.
-
SPREAD
public static final Tree.Kind SPREAD
Used for instances ofSpreadTree
representing spread "operator" for arrays and function call arguments.
-
YIELD
public static final Tree.Kind YIELD
Used for instances ofYieldTree
representing (generator) yield expressionyield expr
.
-
NUMBER_LITERAL
public static final Tree.Kind NUMBER_LITERAL
Used for instances ofLiteralTree
representing a number literal expression of typedouble
.
-
BOOLEAN_LITERAL
public static final Tree.Kind BOOLEAN_LITERAL
Used for instances ofLiteralTree
representing a boolean literal expression of typeboolean
.
-
STRING_LITERAL
public static final Tree.Kind STRING_LITERAL
Used for instances ofLiteralTree
representing a string literal expression of typeString
.
-
NULL_LITERAL
public static final Tree.Kind NULL_LITERAL
Used for instances ofLiteralTree
representing the use ofnull
.
-
OTHER
public static final Tree.Kind OTHER
An implementation-reserved node. This is the not the node you are looking for.
-
-
Method Detail
-
values
public static Tree.Kind[] 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 (Tree.Kind c : Tree.Kind.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Tree.Kind valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
asInterface
public Class<? extends Tree> asInterface()
Returns the associated interface type that uses this kind.- Returns:
- the associated interface
-
isLiteral
public boolean isLiteral()
Returns if this is a literal tree kind or not.- Returns:
- true if this is a literal tree kind, false otherwise
-
isExpression
public boolean isExpression()
Returns if this is an expression tree kind or not.- Returns:
- true if this is an expression tree kind, false otherwise
-
isStatement
public boolean isStatement()
Returns if this is a statement tree kind or not.- Returns:
- true if this is a statement tree kind, false otherwise
-
-