Package com.google.javascript.rhino

# Class Token

java.lang.Object
com.google.javascript.rhino.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.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`ADD`
Token types.
`static final int`
`AND`
Token types.
`static final int`
`ANNOTATION`
Token types.
`static final int`
`ARRAYLIT`
Token types.
`static final int`
`ASSIGN`
Token types.
`static final int`
`ASSIGN_ADD`
Token types.
`static final int`
`ASSIGN_BITAND`
Token types.
`static final int`
`ASSIGN_BITOR`
Token types.
`static final int`
`ASSIGN_BITXOR`
Token types.
`static final int`
`ASSIGN_DIV`
Token types.
`static final int`
`ASSIGN_LSH`
Token types.
`static final int`
`ASSIGN_MOD`
Token types.
`static final int`
`ASSIGN_MUL`
Token types.
`static final int`
`ASSIGN_RSH`
Token types.
`static final int`
`ASSIGN_SUB`
Token types.
`static final int`
`ASSIGN_URSH`
Token types.
`static final int`
`BANG`
Token types.
`static final int`
`BITAND`
Token types.
`static final int`
`BITNOT`
Token types.
`static final int`
`BITOR`
Token types.
`static final int`
`BITXOR`
Token types.
`static final int`
`BLOCK`
Token types.
`static final int`
`BREAK`
Token types.
`static final int`
`CALL`
Token types.
`static final int`
`CASE`
Token types.
`static final int`
`CAST`
Token types.
`static final int`
`CATCH`
Token types.
`static final int`
`COLON`
Token types.
`static final int`
`COMMA`
Token types.
`static final int`
`CONST`
Token types.
`static final int`
`CONTINUE`
Token types.
`static final int`
`DEBUGGER`
Token types.
`static final int`
`DEC`
Token types.
`static final int`
`DEFAULT`
`static final int`
`DEFAULT_CASE`
Token types.
`static final int`
`DELPROP`
Token types.
`static final int`
`DIV`
Token types.
`static final int`
`DO`
Token types.
`static final int`
`ELLIPSIS`
Token types.
`static final int`
`EMPTY`
Token types.
`static final int`
`EOC`
Token types.
`static final int`
`EQ`
Token types.
`static final int`
`EQUALS`
Token types.
`static final int`
`ERROR`
Token types.
`static final int`
`EXPR_RESULT`
Token types.
`static final int`
`FALSE`
Token types.
`static final int`
`FOR`
Token types.
`static final int`
`FUNCTION`
Token types.
`static final int`
`GE`
Token types.
`static final int`
`GET`
`static final int`
`GETELEM`
Token types.
`static final int`
`GETPROP`
Token types.
`static final int`
`GETTER_DEF`
Token types.
`static final int`
`GT`
Token types.
`static final int`
`HOOK`
Token types.
`static final int`
`IF`
Token types.
`static final int`
`IN`
Token types.
`static final int`
`INC`
Token types.
`static final int`
`INSTANCEOF`
Token types.
`static final int`
`LABEL`
Token types.
`static final int`
`LABEL_NAME`
Token types.
`static final int`
`LB`
Token types.
`static final int`
`LC`
Token types.
`static final int`
`LE`
Token types.
`static final int`
`LP`
`static final int`
`LSH`
Token types.
`static final int`
`LT`
Token types.
`static final int`
`MOD`
Token types.
`static final int`
`MUL`
Token types.
`static final int`
`NAME`
Token types.
`static final int`
`NE`
Token types.
`static final int`
`NEG`
Token types.
`static final int`
`NEW`
Token types.
`static final int`
`NOT`
Token types.
`static final int`
`NULL`
Token types.
`static final int`
`NUMBER`
Token types.
`static final int`
`OBJECTLIT`
Token types.
`static final int`
`OR`
Token types.
`static final int`
`PARAM_LIST`
Token types.
`static final int`
`PIPE`
Token types.
`static final int`
`POS`
Token types.
`static final int`
`QMARK`
Token types.
`static final int`
`REGEXP`
Token types.
`static final int`
`RETURN`
Token types.
`static final int`
`RSH`
Token types.
`static final int`
`SCRIPT`
Token types.
`static final int`
`SET`
`static final int`
`SETTER_DEF`
Token types.
`static final int`
`SHEQ`
Token types.
`static final int`
`SHNE`
Token types.
`static final int`
`STAR`
Token types.
`static final int`
`STRING`
Token types.
`static final int`
`STRING_KEY`
Token types.
`static final int`
`SUB`
Token types.
`static final int`
`SWITCH`
Token types.
`static final int`
`THIS`
Token types.
`static final int`
`THROW`
Token types.
`static final int`
`TRUE`
Token types.
`static final int`
`TRY`
Token types.
`static final int`
`TYPEOF`
Token types.
`static final int`
`URSH`
Token types.
`static final int`
`VAR`
Token types.
`static final int`
`VOID`
Token types.
`static final int`
`WHILE`
Token types.
`static final int`
`WITH`
Token types.

## Constructor Summary

Constructors
Constructor
Description
`Token()`

## Method Summary

Modifier and Type
Method
Description
`static String`
`name(int token)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### 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

### DEFAULT

public static final int DEFAULT

See Also:
  - Constant Field Values

### GET

public static final int GET

See Also:
  - Constant Field Values

### LP

public static final int LP

See Also:
  - Constant Field Values

### SET

public static final int SET

See Also:
  - Constant Field Values

## Constructor Details

### Token

public Token()

## Method Details

### name

public static String name(int token)