Token

object Token

This class implements the JavaScript scanner's token codes.

It is based on the C source files jsscan.c and jsscan.h in the jsref package.

Types

Link copied to clipboard

Which kind of comment the lexer found.

Properties

Link copied to clipboard
const val ADD: Int
Link copied to clipboard
const val AND: Int
Link copied to clipboard
const val ARRAYCOMP: Int
Link copied to clipboard
const val ARRAYLIT: Int
Link copied to clipboard
const val ARROW: Int
Link copied to clipboard
const val ASSIGN: Int
Link copied to clipboard
const val ASSIGN_ADD: Int
Link copied to clipboard
const val ASSIGN_BITAND: Int
Link copied to clipboard
const val ASSIGN_BITOR: Int
Link copied to clipboard
const val ASSIGN_BITXOR: Int
Link copied to clipboard
const val ASSIGN_DIV: Int
Link copied to clipboard
const val ASSIGN_EXP: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val ASSIGN_LSH: Int
Link copied to clipboard
const val ASSIGN_MOD: Int
Link copied to clipboard
const val ASSIGN_MUL: Int
Link copied to clipboard
const val ASSIGN_NULLISH: Int
Link copied to clipboard
const val ASSIGN_RSH: Int
Link copied to clipboard
const val ASSIGN_SUB: Int
Link copied to clipboard
const val ASSIGN_URSH: Int
Link copied to clipboard
const val BIGINT: Int
Link copied to clipboard
const val BINDNAME: Int
Link copied to clipboard
const val BITAND: Int
Link copied to clipboard
const val BITNOT: Int
Link copied to clipboard
const val BITOR: Int
Link copied to clipboard
const val BITXOR: Int
Link copied to clipboard
const val BLOCK: Int
Link copied to clipboard
const val BREAK: Int
Link copied to clipboard
const val CALL: Int
Link copied to clipboard
const val CASE: Int
Link copied to clipboard
const val CATCH: Int
Link copied to clipboard
const val CATCH_SCOPE: Int
Link copied to clipboard
const val COLON: Int
Link copied to clipboard
const val COLONCOLON: Int
Link copied to clipboard
const val COMMA: Int
Link copied to clipboard
const val COMMENT: Int
Link copied to clipboard
Link copied to clipboard
const val CONST: Int
Link copied to clipboard
const val CONTINUE: Int
Link copied to clipboard
const val DEBUGGER: Int
Link copied to clipboard
const val DEC: Int
Link copied to clipboard
const val DEFAULT: Int
Link copied to clipboard
Link copied to clipboard
const val DEL_REF: Int
Link copied to clipboard
const val DELPROP: Int
Link copied to clipboard
const val DIV: Int
Link copied to clipboard
const val DO: Int
Link copied to clipboard
const val DOT: Int
Link copied to clipboard
const val DOTDOT: Int
Link copied to clipboard
const val DOTDOTDOT: Int
Link copied to clipboard
const val DOTQUERY: Int
Link copied to clipboard
const val ELSE: Int
Link copied to clipboard
const val EMPTY: Int
Link copied to clipboard
const val ENTERWITH: Int
Link copied to clipboard
const val ENUM_ID: Int
Link copied to clipboard
const val ENUM_INIT_ARRAY: Int
Link copied to clipboard
const val ENUM_INIT_KEYS: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val ENUM_NEXT: Int
Link copied to clipboard
const val EOF: Int
Link copied to clipboard
const val EOL: Int
Link copied to clipboard
const val EQ: Int
Link copied to clipboard
const val ERROR: Int

Token types. These values correspond to JSTokenType values in jsscan.c.

Link copied to clipboard
const val ESCXMLATTR: Int
Link copied to clipboard
const val ESCXMLTEXT: Int
Link copied to clipboard
const val EXP: Int
Link copied to clipboard
const val EXPORT: Int
Link copied to clipboard
const val EXPR_RESULT: Int
Link copied to clipboard
const val EXPR_VOID: Int
Link copied to clipboard
const val FALSE: Int
Link copied to clipboard
const val FINALLY: Int
Link copied to clipboard
const val FIRST_ASSIGN: Int
Link copied to clipboard
Link copied to clipboard
const val FIRST_TOKEN: Int
Link copied to clipboard
const val FOR: Int
Link copied to clipboard
const val FUNCTION: Int
Link copied to clipboard
const val GE: Int
Link copied to clipboard
const val GENEXPR: Int
Link copied to clipboard
const val GET: Int
Link copied to clipboard
const val GET_REF: Int
Link copied to clipboard
const val GETELEM: Int
Link copied to clipboard
const val GETELEM_SUPER: Int
Link copied to clipboard
const val GETPROP: Int
Link copied to clipboard
const val GETPROP_SUPER: Int
Link copied to clipboard
const val GETPROPNOWARN: Int
Link copied to clipboard
Link copied to clipboard
const val GETVAR: Int
Link copied to clipboard
const val GOTO: Int
Link copied to clipboard
const val GT: Int
Link copied to clipboard
const val HOOK: Int
Link copied to clipboard
const val IF: Int
Link copied to clipboard
const val IFEQ: Int
Link copied to clipboard
const val IFNE: Int
Link copied to clipboard
const val IMPORT: Int
Link copied to clipboard
const val IN: Int
Link copied to clipboard
const val INC: Int
Link copied to clipboard
const val INSTANCEOF: Int
Link copied to clipboard
const val JSR: Int
Link copied to clipboard
const val LABEL: Int
Link copied to clipboard
const val LAST_ASSIGN: Int
Link copied to clipboard
Link copied to clipboard
const val LAST_TOKEN: Int
Link copied to clipboard
const val LB: Int
Link copied to clipboard
const val LC: Int
Link copied to clipboard
const val LE: Int
Link copied to clipboard
const val LEAVEWITH: Int
Link copied to clipboard
const val LET: Int
Link copied to clipboard
const val LETEXPR: Int
Link copied to clipboard
const val LOCAL_BLOCK: Int
Link copied to clipboard
const val LOCAL_LOAD: Int
Link copied to clipboard
const val LOOP: Int
Link copied to clipboard
const val LP: Int
Link copied to clipboard
const val LSH: Int
Link copied to clipboard
const val LT: Int
Link copied to clipboard
const val METHOD: Int
Link copied to clipboard
const val MOD: Int
Link copied to clipboard
const val MUL: Int
Link copied to clipboard
const val NAME: Int
Link copied to clipboard
const val NE: Int
Link copied to clipboard
const val NEG: Int
Link copied to clipboard
const val NEW: Int
Link copied to clipboard
const val NOT: Int
Link copied to clipboard
const val NULL: Int
Link copied to clipboard
Link copied to clipboard
const val NUMBER: Int
Link copied to clipboard
const val OBJECTLIT: Int
Link copied to clipboard
const val OR: Int
Link copied to clipboard
const val POS: Int
Link copied to clipboard
Link copied to clipboard
const val QUESTION_DOT: Int
Link copied to clipboard
const val RB: Int
Link copied to clipboard
const val RC: Int
Link copied to clipboard
const val REF_CALL: Int
Link copied to clipboard
const val REF_MEMBER: Int
Link copied to clipboard
const val REF_NAME: Int
Link copied to clipboard
const val REF_NS_MEMBER: Int
Link copied to clipboard
const val REF_NS_NAME: Int
Link copied to clipboard
const val REF_SPECIAL: Int
Link copied to clipboard
const val REGEXP: Int
Link copied to clipboard
const val RESERVED: Int
Link copied to clipboard
const val RETHROW: Int
Link copied to clipboard
const val RETURN: Int
Link copied to clipboard
const val RETURN_RESULT: Int
Link copied to clipboard
const val RP: Int
Link copied to clipboard
const val RSH: Int
Link copied to clipboard
const val SCRIPT: Int
Link copied to clipboard
const val SEMI: Int
Link copied to clipboard
const val SET: Int
Link copied to clipboard
const val SET_REF: Int
Link copied to clipboard
const val SET_REF_OP: Int
Link copied to clipboard
const val SETCONST: Int
Link copied to clipboard
const val SETCONSTVAR: Int
Link copied to clipboard
const val SETELEM: Int
Link copied to clipboard
const val SETELEM_OP: Int
Link copied to clipboard
const val SETELEM_SUPER: Int
Link copied to clipboard
const val SETNAME: Int
Link copied to clipboard
const val SETPROP: Int
Link copied to clipboard
const val SETPROP_OP: Int
Link copied to clipboard
const val SETPROP_SUPER: Int
Link copied to clipboard
const val SETVAR: Int
Link copied to clipboard
const val SHEQ: Int
Link copied to clipboard
const val SHNE: Int
Link copied to clipboard
const val STRICT_SETNAME: Int
Link copied to clipboard
const val STRING: Int
Link copied to clipboard
const val STRING_CONCAT: Int
Link copied to clipboard
const val SUB: Int
Link copied to clipboard
const val SUPER: Int
Link copied to clipboard
const val SWITCH: Int
Link copied to clipboard
Link copied to clipboard
const val TARGET: Int
Link copied to clipboard
const val TEMPLATE_CHARS: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val THIS: Int
Link copied to clipboard
const val THISFN: Int
Link copied to clipboard
const val THROW: Int
Link copied to clipboard
const val TO_DOUBLE: Int
Link copied to clipboard
const val TO_OBJECT: Int
Link copied to clipboard
const val TRUE: Int
Link copied to clipboard
const val TRY: Int
Link copied to clipboard
const val TYPEOF: Int
Link copied to clipboard
const val TYPEOFNAME: Int
Link copied to clipboard
const val UNDEFINED: Int
Link copied to clipboard
const val URSH: Int
Link copied to clipboard
const val USE_STACK: Int
Link copied to clipboard
const val VAR: Int
Link copied to clipboard
const val VOID: Int
Link copied to clipboard
const val WHILE: Int
Link copied to clipboard
const val WITH: Int
Link copied to clipboard
const val WITHEXPR: Int
Link copied to clipboard
const val XML: Int
Link copied to clipboard
const val XMLATTR: Int
Link copied to clipboard
const val XMLEND: Int
Link copied to clipboard
const val YIELD: Int
Link copied to clipboard
const val YIELD_STAR: Int

Functions

Link copied to clipboard

Return true if the passed code is a valid Token constant.

Link copied to clipboard
fun keywordToName(token: Int): String?

Convert a keyword token to a name string.

Link copied to clipboard
fun name(token: Int): String

Returns a name for the token. If the engine is compiled with certain hardcoded debugging flags in this file, it calls typeToName; otherwise it returns a string whose value is the token number.

Link copied to clipboard
fun typeToName(token: Int): String

Always returns a human-readable string for the token name. For instance, FINALLY has the name "FINALLY".