org.mozilla.javascript

Class Token

public class Token extends Object

This class implements the JavaScript scanner. It is based on the C source files jsscan.c and jsscan.h in the jsref package.

Author: Mike McCabe Brendan Eich

See Also:

Field Summary
static intADD
Token types.
static intAND
static intARRAYLIT
Token types.
static intASSIGN
static intASSIGN_ADD
static intASSIGN_BITAND
static intASSIGN_BITOR
static intASSIGN_BITXOR
static intASSIGN_DIV
static intASSIGN_LSH
static intASSIGN_MOD
static intASSIGN_MUL
static intASSIGN_RSH
static intASSIGN_SUB
static intASSIGN_URSH
static intBINDNAME
Token types.
static intBITAND
Token types.
static intBITNOT
Token types.
static intBITOR
Token types.
static intBITXOR
Token types.
static intBLOCK
static intBREAK
static intCALL
Token types.
static intCASE
static intCATCH
static intCATCH_SCOPE
Token types.
static intCOLON
static intCOLONCOLON
static intCOMMA
static intCONTINUE
static intDEC
static intDEFAULT
static intDEFAULTNAMESPACE
Token types.
static intDELPROP
Token types.
static intDEL_REF
Token types.
static intDIV
Token types.
static intDO
static intDOT
static intDOTDOT
static intDOTQUERY
static intELSE
static intEMPTY
static intENTERWITH
Token types.
static intENUM_ID
Token types.
static intENUM_INIT_KEYS
Token types.
static intENUM_INIT_VALUES
Token types.
static intENUM_NEXT
Token types.
static intEOF
Token types.
static intEOL
Token types.
static intEQ
Token types.
static intERROR
Token types.
static intESCXMLATTR
Token types.
static intESCXMLTEXT
Token types.
static intEXPORT
static intEXPR_RESULT
static intEXPR_VOID
static intFALSE
Token types.
static intFINALLY
static intFIRST_ASSIGN
static intFIRST_BYTECODE_TOKEN
Token types.
static intFOR
static intFUNCTION
static intGE
Token types.
static intGETELEM
Token types.
static intGETPROP
Token types.
static intGETVAR
Token types.
static intGET_REF
Token types.
static intGOTO
Token types.
static intGT
Token types.
static intHOOK
static intIF
static intIFEQ
Token types.
static intIFNE
Token types.
static intIMPORT
static intIN
Token types.
static intINC
static intINSTANCEOF
Token types.
static intJSR
static intLABEL
static intLAST_ASSIGN
static intLAST_BYTECODE_TOKEN
static intLAST_TOKEN
static intLB
static intLC
static intLE
Token types.
static intLEAVEWITH
Token types.
static intLOCAL_BLOCK
static intLOCAL_LOAD
Token types.
static intLOOP
static intLP
static intLSH
Token types.
static intLT
Token types.
static intMOD
Token types.
static intMUL
Token types.
static intNAME
Token types.
static intNE
Token types.
static intNEG
Token types.
static intNEW
Token types.
static intNOT
Token types.
static intNULL
Token types.
static intNUMBER
Token types.
static intOBJECTLIT
Token types.
static intOR
static booleanprintTrees
static intPOS
Token types.
static intRB
static intRC
static intREF_CALL
Token types.
static intREF_MEMBER
Token types.
static intREF_NAME
Token types.
static intREF_NS_MEMBER
Token types.
static intREF_NS_NAME
Token types.
static intREF_SPECIAL
Token types.
static intREGEXP
Token types.
static intRESERVED
static intRETHROW
Token types.
static intRETURN
Token types.
static intRETURN_RESULT
Token types.
static intRP
static intRSH
Token types.
static intSCRIPT
static intSEMI
static intSETELEM
Token types.
static intSETELEM_OP
static intSETNAME
Token types.
static intSETPROP
Token types.
static intSETPROP_OP
static intSETVAR
Token types.
static intSET_REF
Token types.
static intSET_REF_OP
static intSHEQ
Token types.
static intSHNE
Token types.
static intSTRING
Token types.
static intSUB
Token types.
static intSWITCH
static intTARGET
static intTHIS
Token types.
static intTHISFN
Token types.
static intTHROW
Token types.
static intTO_DOUBLE
static intTO_OBJECT
static intTRUE
Token types.
static intTRY
static intTYPEOF
Token types.
static intTYPEOFNAME
static intURSH
Token types.
static intUSE_STACK
static intVAR
static intVOID
static intWHILE
static intWITH
static intXML
static intXMLATTR
static intXMLEND
Method Summary
static Stringname(int token)

Field Detail

ADD

public static final int ADD
Token types. These values correspond to JSTokenType values in jsscan.c.

AND

public static final int AND

ARRAYLIT

public static final int ARRAYLIT
Token types. These values correspond to JSTokenType values in jsscan.c.

ASSIGN

public static final int ASSIGN

ASSIGN_ADD

public static final int ASSIGN_ADD

ASSIGN_BITAND

public static final int ASSIGN_BITAND

ASSIGN_BITOR

public static final int ASSIGN_BITOR

ASSIGN_BITXOR

public static final int ASSIGN_BITXOR

ASSIGN_DIV

public static final int ASSIGN_DIV

ASSIGN_LSH

public static final int ASSIGN_LSH

ASSIGN_MOD

public static final int ASSIGN_MOD

ASSIGN_MUL

public static final int ASSIGN_MUL

ASSIGN_RSH

public static final int ASSIGN_RSH

ASSIGN_SUB

public static final int ASSIGN_SUB

ASSIGN_URSH

public static final int ASSIGN_URSH

BINDNAME

public static final int BINDNAME
Token types. These values correspond to JSTokenType values in jsscan.c.

BITAND

public static final int BITAND
Token types. These values correspond to JSTokenType values in jsscan.c.

BITNOT

public static final int BITNOT
Token types. These values correspond to JSTokenType values in jsscan.c.

BITOR

public static final int BITOR
Token types. These values correspond to JSTokenType values in jsscan.c.

BITXOR

public static final int BITXOR
Token types. These values correspond to JSTokenType values in jsscan.c.

BLOCK

public static final int BLOCK

BREAK

public static final int BREAK

CALL

public static final int CALL
Token types. These values correspond to JSTokenType values in jsscan.c.

CASE

public static final int CASE

CATCH

public static final int CATCH

CATCH_SCOPE

public static final int CATCH_SCOPE
Token types. These values correspond to JSTokenType values in jsscan.c.

COLON

public static final int COLON

COLONCOLON

public static final int COLONCOLON

COMMA

public static final int COMMA

CONTINUE

public static final int CONTINUE

DEC

public static final int DEC

DEFAULT

public static final int DEFAULT

DEFAULTNAMESPACE

public static final int DEFAULTNAMESPACE
Token types. These values correspond to JSTokenType values in jsscan.c.

DELPROP

public static final int DELPROP
Token types. These values correspond to JSTokenType values in jsscan.c.

DEL_REF

public static final int DEL_REF
Token types. These values correspond to JSTokenType values in jsscan.c.

DIV

public static final int DIV
Token types. These values correspond to JSTokenType values in jsscan.c.

DO

public static final int DO

DOT

public static final int DOT

DOTDOT

public static final int DOTDOT

DOTQUERY

public static final int DOTQUERY

ELSE

public static final int ELSE

EMPTY

public static final int EMPTY

ENTERWITH

public static final int ENTERWITH
Token types. These values correspond to JSTokenType values in jsscan.c.

ENUM_ID

public static final int ENUM_ID
Token types. These values correspond to JSTokenType values in jsscan.c.

ENUM_INIT_KEYS

public static final int ENUM_INIT_KEYS
Token types. These values correspond to JSTokenType values in jsscan.c.

ENUM_INIT_VALUES

public static final int ENUM_INIT_VALUES
Token types. These values correspond to JSTokenType values in jsscan.c.

ENUM_NEXT

public static final int ENUM_NEXT
Token types. These values correspond to JSTokenType values in jsscan.c.

EOF

public static final int EOF
Token types. These values correspond to JSTokenType values in jsscan.c.

EOL

public static final int EOL
Token types. These values correspond to JSTokenType values in jsscan.c.

EQ

public static final int EQ
Token types. These values correspond to JSTokenType values in jsscan.c.

ERROR

public static final int ERROR
Token types. These values correspond to JSTokenType values in jsscan.c.

ESCXMLATTR

public static final int ESCXMLATTR
Token types. These values correspond to JSTokenType values in jsscan.c.

ESCXMLTEXT

public static final int ESCXMLTEXT
Token types. These values correspond to JSTokenType values in jsscan.c.

EXPORT

public static final int EXPORT

EXPR_RESULT

public static final int EXPR_RESULT

EXPR_VOID

public static final int EXPR_VOID

FALSE

public static final int FALSE
Token types. These values correspond to JSTokenType values in jsscan.c.

FINALLY

public static final int FINALLY

FIRST_ASSIGN

public static final int FIRST_ASSIGN

FIRST_BYTECODE_TOKEN

public static final int FIRST_BYTECODE_TOKEN
Token types. These values correspond to JSTokenType values in jsscan.c.

FOR

public static final int FOR

FUNCTION

public static final int FUNCTION

GE

public static final int GE
Token types. These values correspond to JSTokenType values in jsscan.c.

GETELEM

public static final int GETELEM
Token types. These values correspond to JSTokenType values in jsscan.c.

GETPROP

public static final int GETPROP
Token types. These values correspond to JSTokenType values in jsscan.c.

GETVAR

public static final int GETVAR
Token types. These values correspond to JSTokenType values in jsscan.c.

GET_REF

public static final int GET_REF
Token types. These values correspond to JSTokenType values in jsscan.c.

GOTO

public static final int GOTO
Token types. These values correspond to JSTokenType values in jsscan.c.

GT

public static final int GT
Token types. These values correspond to JSTokenType values in jsscan.c.

HOOK

public static final int HOOK

IF

public static final int IF

IFEQ

public static final int IFEQ
Token types. These values correspond to JSTokenType values in jsscan.c.

IFNE

public static final int IFNE
Token types. These values correspond to JSTokenType values in jsscan.c.

IMPORT

public static final int IMPORT

IN

public static final int IN
Token types. These values correspond to JSTokenType values in jsscan.c.

INC

public static final int INC

INSTANCEOF

public static final int INSTANCEOF
Token types. These values correspond to JSTokenType values in jsscan.c.

JSR

public static final int JSR

LABEL

public static final int LABEL

LAST_ASSIGN

public static final int LAST_ASSIGN

LAST_BYTECODE_TOKEN

public static final int LAST_BYTECODE_TOKEN

LAST_TOKEN

public static final int LAST_TOKEN

LB

public static final int LB

LC

public static final int LC

LE

public static final int LE
Token types. These values correspond to JSTokenType values in jsscan.c.

LEAVEWITH

public static final int LEAVEWITH
Token types. These values correspond to JSTokenType values in jsscan.c.

LOCAL_BLOCK

public static final int LOCAL_BLOCK

LOCAL_LOAD

public static final int LOCAL_LOAD
Token types. These values correspond to JSTokenType values in jsscan.c.

LOOP

public static final int LOOP

LP

public static final int LP

LSH

public static final int LSH
Token types. These values correspond to JSTokenType values in jsscan.c.

LT

public static final int LT
Token types. These values correspond to JSTokenType values in jsscan.c.

MOD

public static final int MOD
Token types. These values correspond to JSTokenType values in jsscan.c.

MUL

public static final int MUL
Token types. These values correspond to JSTokenType values in jsscan.c.

NAME

public static final int NAME
Token types. These values correspond to JSTokenType values in jsscan.c.

NE

public static final int NE
Token types. These values correspond to JSTokenType values in jsscan.c.

NEG

public static final int NEG
Token types. These values correspond to JSTokenType values in jsscan.c.

NEW

public static final int NEW
Token types. These values correspond to JSTokenType values in jsscan.c.

NOT

public static final int NOT
Token types. These values correspond to JSTokenType values in jsscan.c.

NULL

public static final int NULL
Token types. These values correspond to JSTokenType values in jsscan.c.

NUMBER

public static final int NUMBER
Token types. These values correspond to JSTokenType values in jsscan.c.

OBJECTLIT

public static final int OBJECTLIT
Token types. These values correspond to JSTokenType values in jsscan.c.

OR

public static final int OR

printTrees

public static final boolean printTrees

POS

public static final int POS
Token types. These values correspond to JSTokenType values in jsscan.c.

RB

public static final int RB

RC

public static final int RC

REF_CALL

public static final int REF_CALL
Token types. These values correspond to JSTokenType values in jsscan.c.

REF_MEMBER

public static final int REF_MEMBER
Token types. These values correspond to JSTokenType values in jsscan.c.

REF_NAME

public static final int REF_NAME
Token types. These values correspond to JSTokenType values in jsscan.c.

REF_NS_MEMBER

public static final int REF_NS_MEMBER
Token types. These values correspond to JSTokenType values in jsscan.c.

REF_NS_NAME

public static final int REF_NS_NAME
Token types. These values correspond to JSTokenType values in jsscan.c.

REF_SPECIAL

public static final int REF_SPECIAL
Token types. These values correspond to JSTokenType values in jsscan.c.

REGEXP

public static final int REGEXP
Token types. These values correspond to JSTokenType values in jsscan.c.

RESERVED

public static final int RESERVED

RETHROW

public static final int RETHROW
Token types. These values correspond to JSTokenType values in jsscan.c.

RETURN

public static final int RETURN
Token types. These values correspond to JSTokenType values in jsscan.c.

RETURN_RESULT

public static final int RETURN_RESULT
Token types. These values correspond to JSTokenType values in jsscan.c.

RP

public static final int RP

RSH

public static final int RSH
Token types. These values correspond to JSTokenType values in jsscan.c.

SCRIPT

public static final int SCRIPT

SEMI

public static final int SEMI

SETELEM

public static final int SETELEM
Token types. These values correspond to JSTokenType values in jsscan.c.

SETELEM_OP

public static final int SETELEM_OP

SETNAME

public static final int SETNAME
Token types. These values correspond to JSTokenType values in jsscan.c.

SETPROP

public static final int SETPROP
Token types. These values correspond to JSTokenType values in jsscan.c.

SETPROP_OP

public static final int SETPROP_OP

SETVAR

public static final int SETVAR
Token types. These values correspond to JSTokenType values in jsscan.c.

SET_REF

public static final int SET_REF
Token types. These values correspond to JSTokenType values in jsscan.c.

SET_REF_OP

public static final int SET_REF_OP

SHEQ

public static final int SHEQ
Token types. These values correspond to JSTokenType values in jsscan.c.

SHNE

public static final int SHNE
Token types. These values correspond to JSTokenType values in jsscan.c.

STRING

public static final int STRING
Token types. These values correspond to JSTokenType values in jsscan.c.

SUB

public static final int SUB
Token types. These values correspond to JSTokenType values in jsscan.c.

SWITCH

public static final int SWITCH

TARGET

public static final int TARGET

THIS

public static final int THIS
Token types. These values correspond to JSTokenType values in jsscan.c.

THISFN

public static final int THISFN
Token types. These values correspond to JSTokenType values in jsscan.c.

THROW

public static final int THROW
Token types. These values correspond to JSTokenType values in jsscan.c.

TO_DOUBLE

public static final int TO_DOUBLE

TO_OBJECT

public static final int TO_OBJECT

TRUE

public static final int TRUE
Token types. These values correspond to JSTokenType values in jsscan.c.

TRY

public static final int TRY

TYPEOF

public static final int TYPEOF
Token types. These values correspond to JSTokenType values in jsscan.c.

TYPEOFNAME

public static final int TYPEOFNAME

URSH

public static final int URSH
Token types. These values correspond to JSTokenType values in jsscan.c.

USE_STACK

public static final int USE_STACK

VAR

public static final int VAR

VOID

public static final int VOID

WHILE

public static final int WHILE

WITH

public static final int WITH

XML

public static final int XML

XMLATTR

public static final int XMLATTR

XMLEND

public static final int XMLEND

Method Detail

name

public static String name(int token)