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.
    See Also:
    • Constructor Detail

      • Token

        public Token()
    • Method Detail

      • name

        public static String name​(int token)
        Returns a name for the token. If Rhino is compiled with certain hardcoded debugging flags in this file, it calls #typeToName; otherwise it returns a string whose value is the token number.
      • typeToName

        public static String typeToName​(int token)
        Always returns a human-readable string for the token name. For instance, FINALLY has the name "FINALLY".
        token - the token code
        the actual name for the token code
      • isValidToken

        public static boolean isValidToken​(int code)
        Return true if the passed code is a valid Token constant.
        code - a potential token code
        true if it's a known token