public class Token
extends java.lang.Object
Parser
Modifier and Type | Class and Description |
---|---|
static class |
Token.CommentType |
Modifier and Type | Field and Description |
---|---|
static int |
ADD
Token types.
|
static int |
AND |
static int |
ARRAYCOMP |
static int |
ARRAYLIT
Token types.
|
static int |
ASSIGN |
static int |
ASSIGN_ADD |
static int |
ASSIGN_BITAND |
static int |
ASSIGN_BITOR |
static int |
ASSIGN_BITXOR |
static int |
ASSIGN_DIV |
static int |
ASSIGN_LSH |
static int |
ASSIGN_MOD |
static int |
ASSIGN_MUL |
static int |
ASSIGN_RSH |
static int |
ASSIGN_SUB |
static int |
ASSIGN_URSH |
static int |
BINDNAME
Token types.
|
static int |
BITAND
Token types.
|
static int |
BITNOT
Token types.
|
static int |
BITOR
Token types.
|
static int |
BITXOR
Token types.
|
static int |
BLOCK |
static int |
BREAK |
static int |
CALL
Token types.
|
static int |
CASE |
static int |
CATCH |
static int |
CATCH_SCOPE
Token types.
|
static int |
COLON |
static int |
COLONCOLON |
static int |
COMMA |
static int |
COMMENT |
static int |
CONST |
static int |
CONTINUE |
static int |
DEBUGGER |
static int |
DEC |
static int |
DEFAULT |
static int |
DEFAULTNAMESPACE
Token types.
|
static int |
DEL_REF
Token types.
|
static int |
DELPROP
Token types.
|
static int |
DIV
Token types.
|
static int |
DO |
static int |
DOT |
static int |
DOTDOT |
static int |
DOTQUERY |
static int |
ELSE |
static int |
EMPTY |
static int |
ENTERWITH
Token types.
|
static int |
ENUM_ID
Token types.
|
static int |
ENUM_INIT_ARRAY
Token types.
|
static int |
ENUM_INIT_KEYS
Token types.
|
static int |
ENUM_INIT_VALUES
Token types.
|
static int |
ENUM_NEXT
Token types.
|
static int |
EOF
Token types.
|
static int |
EOL
Token types.
|
static int |
EQ
Token types.
|
static int |
ERROR
Token types.
|
static int |
ESCXMLATTR
Token types.
|
static int |
ESCXMLTEXT
Token types.
|
static int |
EXPORT |
static int |
EXPR_RESULT |
static int |
EXPR_VOID |
static int |
FALSE
Token types.
|
static int |
FINALLY |
static int |
FIRST_ASSIGN |
static int |
FIRST_BYTECODE_TOKEN
Token types.
|
static int |
FOR |
static int |
FUNCTION |
static int |
GE
Token types.
|
static int |
GENEXPR |
static int |
GET |
static int |
GET_REF
Token types.
|
static int |
GETELEM
Token types.
|
static int |
GETPROP
Token types.
|
static int |
GETPROPNOWARN
Token types.
|
static int |
GETVAR
Token types.
|
static int |
GOTO
Token types.
|
static int |
GT
Token types.
|
static int |
HOOK |
static int |
IF |
static int |
IFEQ
Token types.
|
static int |
IFNE
Token types.
|
static int |
IMPORT |
static int |
IN
Token types.
|
static int |
INC |
static int |
INSTANCEOF
Token types.
|
static int |
JSR |
static int |
LABEL |
static int |
LAST_ASSIGN |
static int |
LAST_BYTECODE_TOKEN |
static int |
LAST_TOKEN |
static int |
LB |
static int |
LC |
static int |
LE
Token types.
|
static int |
LEAVEWITH
Token types.
|
static int |
LET |
static int |
LETEXPR |
static int |
LOCAL_BLOCK |
static int |
LOCAL_LOAD
Token types.
|
static int |
LOOP |
static int |
LP |
static int |
LSH
Token types.
|
static int |
LT
Token types.
|
static int |
METHOD |
static int |
MOD
Token types.
|
static int |
MUL
Token types.
|
static int |
NAME
Token types.
|
static int |
NE
Token types.
|
static int |
NEG
Token types.
|
static int |
NEW
Token types.
|
static int |
NOT
Token types.
|
static int |
NULL
Token types.
|
static int |
NUMBER
Token types.
|
static int |
OBJECTLIT
Token types.
|
static int |
OR |
static int |
POS
Token types.
|
static boolean |
printTrees |
static int |
RB |
static int |
RC |
static int |
REF_CALL
Token types.
|
static int |
REF_MEMBER
Token types.
|
static int |
REF_NAME
Token types.
|
static int |
REF_NS_MEMBER
Token types.
|
static int |
REF_NS_NAME
Token types.
|
static int |
REF_SPECIAL
Token types.
|
static int |
REGEXP
Token types.
|
static int |
RESERVED |
static int |
RETHROW
Token types.
|
static int |
RETURN
Token types.
|
static int |
RETURN_RESULT
Token types.
|
static int |
RP |
static int |
RSH
Token types.
|
static int |
SCRIPT |
static int |
SEMI |
static int |
SET |
static int |
SET_REF
Token types.
|
static int |
SET_REF_OP |
static int |
SETCONST |
static int |
SETCONSTVAR |
static int |
SETELEM
Token types.
|
static int |
SETELEM_OP |
static int |
SETNAME
Token types.
|
static int |
SETPROP
Token types.
|
static int |
SETPROP_OP |
static int |
SETVAR
Token types.
|
static int |
SHEQ
Token types.
|
static int |
SHNE
Token types.
|
static int |
STRICT_SETNAME
Token types.
|
static int |
STRING
Token types.
|
static int |
SUB
Token types.
|
static int |
SWITCH |
static int |
TARGET |
static int |
THIS
Token types.
|
static int |
THISFN
Token types.
|
static int |
THROW
Token types.
|
static int |
TO_DOUBLE |
static int |
TO_OBJECT |
static int |
TRUE
Token types.
|
static int |
TRY |
static int |
TYPEOF
Token types.
|
static int |
TYPEOFNAME |
static int |
URSH
Token types.
|
static int |
USE_STACK |
static int |
VAR |
static int |
VOID |
static int |
WHILE |
static int |
WITH |
static int |
WITHEXPR |
static int |
XML |
static int |
XMLATTR |
static int |
XMLEND |
static int |
YIELD
Token types.
|
Constructor and Description |
---|
Token() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isValidToken(int code)
Return true if the passed code is a valid Token constant.
|
static java.lang.String |
keywordToName(int token)
Convert a keyword token to a name string for use with the
Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER feature. |
static java.lang.String |
name(int token)
Returns a name for the token.
|
static java.lang.String |
typeToName(int token)
Always returns a human-readable string for the token name.
|
public static final boolean printTrees
public static final int ERROR
public static final int EOF
public static final int EOL
public static final int FIRST_BYTECODE_TOKEN
public static final int ENTERWITH
public static final int LEAVEWITH
public static final int RETURN
public static final int GOTO
public static final int IFEQ
public static final int IFNE
public static final int SETNAME
public static final int BITOR
public static final int BITXOR
public static final int BITAND
public static final int EQ
public static final int NE
public static final int LT
public static final int LE
public static final int GT
public static final int GE
public static final int LSH
public static final int RSH
public static final int URSH
public static final int ADD
public static final int SUB
public static final int MUL
public static final int DIV
public static final int MOD
public static final int NOT
public static final int BITNOT
public static final int POS
public static final int NEG
public static final int NEW
public static final int DELPROP
public static final int TYPEOF
public static final int GETPROP
public static final int GETPROPNOWARN
public static final int SETPROP
public static final int GETELEM
public static final int SETELEM
public static final int CALL
public static final int NAME
public static final int NUMBER
public static final int STRING
public static final int NULL
public static final int THIS
public static final int FALSE
public static final int TRUE
public static final int SHEQ
public static final int SHNE
public static final int REGEXP
public static final int BINDNAME
public static final int THROW
public static final int RETHROW
public static final int IN
public static final int INSTANCEOF
public static final int LOCAL_LOAD
public static final int GETVAR
public static final int SETVAR
public static final int CATCH_SCOPE
public static final int ENUM_INIT_KEYS
public static final int ENUM_INIT_VALUES
public static final int ENUM_INIT_ARRAY
public static final int ENUM_NEXT
public static final int ENUM_ID
public static final int THISFN
public static final int RETURN_RESULT
public static final int ARRAYLIT
public static final int OBJECTLIT
public static final int GET_REF
public static final int SET_REF
public static final int DEL_REF
public static final int REF_CALL
public static final int REF_SPECIAL
public static final int YIELD
public static final int STRICT_SETNAME
public static final int DEFAULTNAMESPACE
public static final int ESCXMLATTR
public static final int ESCXMLTEXT
public static final int REF_MEMBER
public static final int REF_NS_MEMBER
public static final int REF_NAME
public static final int REF_NS_NAME
public static final int LAST_BYTECODE_TOKEN
public static final int TRY
public static final int SEMI
public static final int LB
public static final int RB
public static final int LC
public static final int RC
public static final int LP
public static final int RP
public static final int COMMA
public static final int ASSIGN
public static final int ASSIGN_BITOR
public static final int ASSIGN_BITXOR
public static final int ASSIGN_BITAND
public static final int ASSIGN_LSH
public static final int ASSIGN_RSH
public static final int ASSIGN_URSH
public static final int ASSIGN_ADD
public static final int ASSIGN_SUB
public static final int ASSIGN_MUL
public static final int ASSIGN_DIV
public static final int ASSIGN_MOD
public static final int FIRST_ASSIGN
public static final int LAST_ASSIGN
public static final int HOOK
public static final int COLON
public static final int OR
public static final int AND
public static final int INC
public static final int DEC
public static final int DOT
public static final int FUNCTION
public static final int EXPORT
public static final int IMPORT
public static final int IF
public static final int ELSE
public static final int SWITCH
public static final int CASE
public static final int DEFAULT
public static final int WHILE
public static final int DO
public static final int FOR
public static final int BREAK
public static final int CONTINUE
public static final int VAR
public static final int WITH
public static final int CATCH
public static final int FINALLY
public static final int VOID
public static final int RESERVED
public static final int EMPTY
public static final int BLOCK
public static final int LABEL
public static final int TARGET
public static final int LOOP
public static final int EXPR_VOID
public static final int EXPR_RESULT
public static final int JSR
public static final int SCRIPT
public static final int TYPEOFNAME
public static final int USE_STACK
public static final int SETPROP_OP
public static final int SETELEM_OP
public static final int LOCAL_BLOCK
public static final int SET_REF_OP
public static final int DOTDOT
public static final int COLONCOLON
public static final int XML
public static final int DOTQUERY
public static final int XMLATTR
public static final int XMLEND
public static final int TO_OBJECT
public static final int TO_DOUBLE
public static final int GET
public static final int SET
public static final int LET
public static final int CONST
public static final int SETCONST
public static final int SETCONSTVAR
public static final int ARRAYCOMP
public static final int LETEXPR
public static final int WITHEXPR
public static final int DEBUGGER
public static final int COMMENT
public static final int GENEXPR
public static final int METHOD
public static final int LAST_TOKEN
public static java.lang.String name(int token)
#typeToName
;
otherwise it returns a string whose value is the token number.public static java.lang.String typeToName(int token)
FINALLY
has the name "FINALLY".token
- the token codepublic static java.lang.String keywordToName(int token)
Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER
feature.token
- A tokenpublic static boolean isValidToken(int code)
code
- a potential token codeCopyright © 2010 - 2020 Adobe. All Rights Reserved