⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 token.java

📁 java中比较著名的js引擎当属mozilla开源的rhino
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is Rhino code, released * May 6, 1999. * * The Initial Developer of the Original Code is * Netscape Communications Corporation. * Portions created by the Initial Developer are Copyright (C) 1997-1999 * the Initial Developer. All Rights Reserved. * * Contributor(s): *   Roger Lawrence *   Mike McCabe *   Igor Bukanov *   Milen Nankov * * Alternatively, the contents of this file may be used under the terms of * the GNU General Public License Version 2 or later (the "GPL"), in which * case the provisions of the GPL are applicable instead of those above. If * you wish to allow use of your version of this file only under the terms of * the GPL and not to allow others to use your version of this file under the * MPL, indicate your decision by deleting the provisions above and replacing * them with the notice and other provisions required by the GPL. If you do * not delete the provisions above, a recipient may use your version of this * file under either the MPL or the GPL. * * ***** END LICENSE BLOCK ***** */package org.mozilla.javascript;/** * This class implements the JavaScript scanner. * * It is based on the C source files jsscan.c and jsscan.h * in the jsref package. * * @see org.mozilla.javascript.Parser * * @author Mike McCabe * @author Brendan Eich */public class Token{    // debug flags    public static final boolean printTrees = false;    static final boolean printICode = false;    static final boolean printNames = printTrees || printICode;    /**     * Token types.  These values correspond to JSTokenType values in     * jsscan.c.     */    public final static int    // start enum        ERROR          = -1, // well-known as the only code < EOF        EOF            = 0,  // end of file token - (not EOF_CHAR)        EOL            = 1,  // end of line        // Interpreter reuses the following as bytecodes        FIRST_BYTECODE_TOKEN    = 2,        ENTERWITH      = 2,        LEAVEWITH      = 3,        RETURN         = 4,        GOTO           = 5,        IFEQ           = 6,        IFNE           = 7,        SETNAME        = 8,        BITOR          = 9,        BITXOR         = 10,        BITAND         = 11,        EQ             = 12,        NE             = 13,        LT             = 14,        LE             = 15,        GT             = 16,        GE             = 17,        LSH            = 18,        RSH            = 19,        URSH           = 20,        ADD            = 21,        SUB            = 22,        MUL            = 23,        DIV            = 24,        MOD            = 25,        NOT            = 26,        BITNOT         = 27,        POS            = 28,        NEG            = 29,        NEW            = 30,        DELPROP        = 31,        TYPEOF         = 32,        GETPROP        = 33,        SETPROP        = 34,        GETELEM        = 35,        SETELEM        = 36,        CALL           = 37,        NAME           = 38,        NUMBER         = 39,        STRING         = 40,        NULL           = 41,        THIS           = 42,        FALSE          = 43,        TRUE           = 44,        SHEQ           = 45,   // shallow equality (===)        SHNE           = 46,   // shallow inequality (!==)        REGEXP         = 47,        BINDNAME       = 48,        THROW          = 49,        RETHROW        = 50, // rethrow caught execetion: catch (e if ) use it        IN             = 51,        INSTANCEOF     = 52,        LOCAL_LOAD     = 53,        GETVAR         = 54,        SETVAR         = 55,        CATCH_SCOPE    = 56,        ENUM_INIT_KEYS = 57,        ENUM_INIT_VALUES = 58,        ENUM_NEXT      = 59,        ENUM_ID        = 60,        THISFN         = 61,        RETURN_RESULT  = 62, // to return prevoisly stored return result        ARRAYLIT       = 63, // array literal        OBJECTLIT      = 64, // object literal        GET_REF        = 65, // *reference        SET_REF        = 66, // *reference    = something        DEL_REF        = 67, // delete reference        REF_CALL       = 68, // f(args)    = something or f(args)++        REF_SPECIAL    = 69, // reference for special properties like __proto        // For XML support:        DEFAULTNAMESPACE = 70, // default xml namespace =        ESCXMLATTR     = 71,        ESCXMLTEXT     = 72,        REF_MEMBER     = 73, // Reference for x.@y, x..y etc.        REF_NS_MEMBER  = 74, // Reference for x.ns::y, x..ns::y etc.        REF_NAME       = 75, // Reference for @y, @[y] etc.        REF_NS_NAME    = 76; // Reference for ns::y, @ns::y@[y] etc.        // End of interpreter bytecodes    public final static int        LAST_BYTECODE_TOKEN    = REF_NS_NAME,        TRY            = 77,        SEMI           = 78,  // semicolon        LB             = 79,  // left and right brackets        RB             = 80,        LC             = 81,  // left and right curlies (braces)        RC             = 82,        LP             = 83,  // left and right parentheses        RP             = 84,        COMMA          = 85,  // comma operator        ASSIGN         = 86,  // simple assignment  (=)        ASSIGN_BITOR   = 87,  // |=        ASSIGN_BITXOR  = 88,  // ^=        ASSIGN_BITAND  = 89,  // |=        ASSIGN_LSH     = 90,  // <<=        ASSIGN_RSH     = 91,  // >>=        ASSIGN_URSH    = 92,  // >>>=        ASSIGN_ADD     = 93,  // +=        ASSIGN_SUB     = 94,  // -=        ASSIGN_MUL     = 95,  // *=        ASSIGN_DIV     = 96,  // /=        ASSIGN_MOD     = 97;  // %=    public final static int        FIRST_ASSIGN   = ASSIGN,        LAST_ASSIGN    = ASSIGN_MOD,        HOOK           = 98, // conditional (?:)        COLON          = 99,        OR             = 100, // logical or (||)        AND            = 101, // logical and (&&)        INC            = 102, // increment/decrement (++ --)        DEC            = 103,        DOT            = 104, // member operator (.)        FUNCTION       = 105, // function keyword        EXPORT         = 106, // export keyword        IMPORT         = 107, // import keyword        IF             = 108, // if keyword        ELSE           = 109, // else keyword        SWITCH         = 110, // switch keyword        CASE           = 111, // case keyword        DEFAULT        = 112, // default keyword        WHILE          = 113, // while keyword        DO             = 114, // do keyword        FOR            = 115, // for keyword

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -