Class Token


  • public class Token
    extends java.lang.Object
    This class implements the JavaScript scanner. It is based on the C source files jsscan.c and jsscan.h in the jsref package.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ADD
      Token types.
      static int AND
      Token types.
      static int ANNOTATION
      Token types.
      static int ARRAYLIT
      Token types.
      static int ASSIGN
      Token types.
      static int ASSIGN_ADD
      Token types.
      static int ASSIGN_BITAND
      Token types.
      static int ASSIGN_BITOR
      Token types.
      static int ASSIGN_BITXOR
      Token types.
      static int ASSIGN_DIV
      Token types.
      static int ASSIGN_LSH
      Token types.
      static int ASSIGN_MOD
      Token types.
      static int ASSIGN_MUL
      Token types.
      static int ASSIGN_RSH
      Token types.
      static int ASSIGN_SUB
      Token types.
      static int ASSIGN_URSH
      Token types.
      static int BANG
      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
      Token types.
      static int BREAK
      Token types.
      static int CALL
      Token types.
      static int CASE
      Token types.
      static int CAST
      Token types.
      static int CATCH
      Token types.
      static int COLON
      Token types.
      static int COMMA
      Token types.
      static int CONST
      Token types.
      static int CONTINUE
      Token types.
      static int DEBUGGER
      Token types.
      static int DEC
      Token types.
      static int DEFAULT  
      static int DEFAULT_CASE
      Token types.
      static int DELPROP
      Token types.
      static int DIV
      Token types.
      static int DO
      Token types.
      static int ELLIPSIS
      Token types.
      static int EMPTY
      Token types.
      static int EOC
      Token types.
      static int EQ
      Token types.
      static int EQUALS
      Token types.
      static int ERROR
      Token types.
      static int EXPR_RESULT
      Token types.
      static int FALSE
      Token types.
      static int FOR
      Token types.
      static int FUNCTION
      Token types.
      static int GE
      Token types.
      static int GET  
      static int GETELEM
      Token types.
      static int GETPROP
      Token types.
      static int GETTER_DEF
      Token types.
      static int GT
      Token types.
      static int HOOK
      Token types.
      static int IF
      Token types.
      static int IN
      Token types.
      static int INC
      Token types.
      static int INSTANCEOF
      Token types.
      static int LABEL
      Token types.
      static int LABEL_NAME
      Token types.
      static int LB
      Token types.
      static int LC
      Token types.
      static int LE
      Token types.
      static int LP  
      static int LSH
      Token types.
      static int LT
      Token types.
      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
      Token types.
      static int PARAM_LIST
      Token types.
      static int PIPE
      Token types.
      static int POS
      Token types.
      static int QMARK
      Token types.
      static int REGEXP
      Token types.
      static int RETURN
      Token types.
      static int RSH
      Token types.
      static int SCRIPT
      Token types.
      static int SET  
      static int SETTER_DEF
      Token types.
      static int SHEQ
      Token types.
      static int SHNE
      Token types.
      static int STAR
      Token types.
      static int STRING
      Token types.
      static int STRING_KEY
      Token types.
      static int SUB
      Token types.
      static int SWITCH
      Token types.
      static int THIS
      Token types.
      static int THROW
      Token types.
      static int TRUE
      Token types.
      static int TRY
      Token types.
      static int TYPEOF
      Token types.
      static int URSH
      Token types.
      static int VAR
      Token types.
      static int VOID
      Token types.
      static int WHILE
      Token types.
      static int WITH
      Token types.
    • Constructor Summary

      Constructors 
      Constructor Description
      Token()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String name​(int token)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • ERROR

        public static final int ERROR
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • RETURN

        public static final int RETURN
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • BITOR

        public static final int BITOR
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • BITXOR

        public static final int BITXOR
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • BITAND

        public static final int BITAND
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • EQ

        public static final int EQ
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • NE

        public static final int NE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • LT

        public static final int LT
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • LE

        public static final int LE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • GT

        public static final int GT
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • GE

        public static final int GE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • LSH

        public static final int LSH
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • RSH

        public static final int RSH
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • URSH

        public static final int URSH
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ADD

        public static final int ADD
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • SUB

        public static final int SUB
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • MUL

        public static final int MUL
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • DIV

        public static final int DIV
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • MOD

        public static final int MOD
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • NOT

        public static final int NOT
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • BITNOT

        public static final int BITNOT
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • POS

        public static final int POS
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • NEG

        public static final int NEG
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • NEW

        public static final int NEW
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • DELPROP

        public static final int DELPROP
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • TYPEOF

        public static final int TYPEOF
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • GETPROP

        public static final int GETPROP
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • GETELEM

        public static final int GETELEM
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • CALL

        public static final int CALL
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • NAME

        public static final int NAME
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • NUMBER

        public static final int NUMBER
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • STRING

        public static final int STRING
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • NULL

        public static final int NULL
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • THIS

        public static final int THIS
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • FALSE

        public static final int FALSE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • TRUE

        public static final int TRUE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • SHEQ

        public static final int SHEQ
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • SHNE

        public static final int SHNE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • REGEXP

        public static final int REGEXP
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • THROW

        public static final int THROW
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • IN

        public static final int IN
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • INSTANCEOF

        public static final int INSTANCEOF
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ARRAYLIT

        public static final int ARRAYLIT
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • OBJECTLIT

        public static final int OBJECTLIT
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • TRY

        public static final int TRY
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • PARAM_LIST

        public static final int PARAM_LIST
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • COMMA

        public static final int COMMA
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN

        public static final int ASSIGN
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_BITOR

        public static final int ASSIGN_BITOR
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_BITXOR

        public static final int ASSIGN_BITXOR
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_BITAND

        public static final int ASSIGN_BITAND
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_LSH

        public static final int ASSIGN_LSH
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_RSH

        public static final int ASSIGN_RSH
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_URSH

        public static final int ASSIGN_URSH
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_ADD

        public static final int ASSIGN_ADD
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_SUB

        public static final int ASSIGN_SUB
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_MUL

        public static final int ASSIGN_MUL
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_DIV

        public static final int ASSIGN_DIV
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ASSIGN_MOD

        public static final int ASSIGN_MOD
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • HOOK

        public static final int HOOK
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • OR

        public static final int OR
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • AND

        public static final int AND
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • INC

        public static final int INC
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • DEC

        public static final int DEC
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • FUNCTION

        public static final int FUNCTION
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • IF

        public static final int IF
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • SWITCH

        public static final int SWITCH
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • CASE

        public static final int CASE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • DEFAULT_CASE

        public static final int DEFAULT_CASE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • WHILE

        public static final int WHILE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • DO

        public static final int DO
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • FOR

        public static final int FOR
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • BREAK

        public static final int BREAK
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • CONTINUE

        public static final int CONTINUE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • VAR

        public static final int VAR
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • WITH

        public static final int WITH
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • CATCH

        public static final int CATCH
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • VOID

        public static final int VOID
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • EMPTY

        public static final int EMPTY
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • BLOCK

        public static final int BLOCK
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • LABEL

        public static final int LABEL
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • EXPR_RESULT

        public static final int EXPR_RESULT
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • SCRIPT

        public static final int SCRIPT
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • GETTER_DEF

        public static final int GETTER_DEF
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • SETTER_DEF

        public static final int SETTER_DEF
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • CONST

        public static final int CONST
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • DEBUGGER

        public static final int DEBUGGER
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • LABEL_NAME

        public static final int LABEL_NAME
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • STRING_KEY

        public static final int STRING_KEY
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • CAST

        public static final int CAST
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ANNOTATION

        public static final int ANNOTATION
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • PIPE

        public static final int PIPE
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • STAR

        public static final int STAR
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • EOC

        public static final int EOC
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • QMARK

        public static final int QMARK
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • ELLIPSIS

        public static final int ELLIPSIS
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • BANG

        public static final int BANG
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • EQUALS

        public static final int EQUALS
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • LB

        public static final int LB
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • LC

        public static final int LC
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
      • COLON

        public static final int COLON
        Token types. These values correspond to JSTokenType values in jsscan.c.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Token

        public Token()
    • Method Detail

      • name

        public static java.lang.String name​(int token)