net.sourceforge.pmd.lang.python.ast.PythonTokenKinds Maven / Gradle / Ivy
The newest version!
/* Generated By:JavaCC: Do not edit this line. PythonParserImplConstants.java */
package net.sourceforge.pmd.lang.python.ast;
/**
* net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken literal values and constants.
* Generated by org.javacc.parser.OtherFilesGen#start()
*/
/** Token kinds ({@link net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken#kind}) for this language. */
@net.sourceforge.pmd.annotation.InternalApi
@net.sourceforge.pmd.annotation.Generated("org.javacc.javacc")
public final class PythonTokenKinds {
private PythonTokenKinds() { /* Utility class */ }
public static final int EOF = 0;
public static final int SPACE = 1;
public static final int CONTINUATION = 4;
public static final int NEWLINE = 5;
public static final int TRAILING_COMMENT = 6;
public static final int LPAREN = 7;
public static final int RPAREN = 8;
public static final int LBRACE = 9;
public static final int RBRACE = 10;
public static final int LBRACKET = 11;
public static final int RBRACKET = 12;
public static final int SEMICOLON = 13;
public static final int COMMA = 14;
public static final int DOT = 15;
public static final int COLON = 16;
public static final int BACKTICK = 17;
public static final int PLUS = 18;
public static final int MINUS = 19;
public static final int MULTIPLY = 20;
public static final int DIVIDE = 21;
public static final int FLOORDIVIDE = 22;
public static final int POWER = 23;
public static final int LSHIFT = 24;
public static final int RSHIFT = 25;
public static final int MODULO = 26;
public static final int NOT = 27;
public static final int XOR = 28;
public static final int OR = 29;
public static final int AND = 30;
public static final int EQUAL = 31;
public static final int GREATER = 32;
public static final int LESS = 33;
public static final int EQEQUAL = 34;
public static final int EQLESS = 35;
public static final int EQGREATER = 36;
public static final int LESSGREATER = 37;
public static final int NOTEQUAL = 38;
public static final int PLUSEQ = 39;
public static final int MINUSEQ = 40;
public static final int MULTIPLYEQ = 41;
public static final int DIVIDEEQ = 42;
public static final int FLOORDIVIDEEQ = 43;
public static final int MODULOEQ = 44;
public static final int ANDEQ = 45;
public static final int OREQ = 46;
public static final int XOREQ = 47;
public static final int LSHIFTEQ = 48;
public static final int RSHIFTEQ = 49;
public static final int POWEREQ = 50;
public static final int OR_BOOL = 51;
public static final int AND_BOOL = 52;
public static final int NOT_BOOL = 53;
public static final int IS = 54;
public static final int IN = 55;
public static final int LAMBDA = 56;
public static final int IF = 57;
public static final int ELSE = 58;
public static final int ELIF = 59;
public static final int WHILE = 60;
public static final int FOR = 61;
public static final int TRY = 62;
public static final int EXCEPT = 63;
public static final int DEF = 64;
public static final int CLASS = 65;
public static final int FINALLY = 66;
public static final int PRINT = 67;
public static final int PASS = 68;
public static final int BREAK = 69;
public static final int CONTINUE = 70;
public static final int RETURN = 71;
public static final int YIELD = 72;
public static final int IMPORT = 73;
public static final int FROM = 74;
public static final int DEL = 75;
public static final int RAISE = 76;
public static final int GLOBAL = 77;
public static final int EXEC = 78;
public static final int ASSERT = 79;
public static final int AS = 80;
public static final int WITH = 81;
public static final int AT = 82;
public static final int NAME = 83;
public static final int LETTER = 84;
public static final int DECNUMBER = 85;
public static final int HEXNUMBER = 86;
public static final int OCTNUMBER = 87;
public static final int BINNUMBER = 88;
public static final int FLOAT = 89;
public static final int COMPLEX = 90;
public static final int EXPONENT = 91;
public static final int DIGIT = 92;
public static final int SINGLE_STRING = 105;
public static final int SINGLE_STRING2 = 106;
public static final int TRIPLE_STRING = 107;
public static final int TRIPLE_STRING2 = 108;
public static final int SINGLE_BSTRING = 109;
public static final int SINGLE_BSTRING2 = 110;
public static final int TRIPLE_BSTRING = 111;
public static final int TRIPLE_BSTRING2 = 112;
public static final int SINGLE_USTRING = 113;
public static final int SINGLE_USTRING2 = 114;
public static final int TRIPLE_USTRING = 115;
public static final int TRIPLE_USTRING2 = 116;
static final int DEFAULT = 0;
static final int IN_STRING11 = 1;
static final int IN_STRING21 = 2;
static final int IN_STRING13 = 3;
static final int IN_STRING23 = 4;
static final int IN_BSTRING11 = 5;
static final int IN_BSTRING21 = 6;
static final int IN_BSTRING13 = 7;
static final int IN_BSTRING23 = 8;
static final int IN_USTRING11 = 9;
static final int IN_USTRING21 = 10;
static final int IN_USTRING13 = 11;
static final int IN_USTRING23 = 12;
/** Returns a string describing the given token kind.
* Returns null if the kind is unknown.
*
* @param kind Kind of token
*
* @return A string describing the given kind
*/
public static @org.checkerframework.checker.nullness.qual.Nullable
String describe(int kind) {
return kind < 0 || kind >= tokenImage.length
? null
: tokenImage[kind];
}
/** Returns a new token manager for this language. The CharStream
* should be configured with the correct language-specific escaping
* and token document. This is not a published API, it's intended to
* be used as a basis for a CPD Tokenizer.
*/
@net.sourceforge.pmd.annotation.InternalApi
public static net.sourceforge.pmd.lang.TokenManager newTokenManager(net.sourceforge.pmd.lang.ast.impl.javacc.CharStream cs) {
return new PythonParserImplTokenManager(cs);
}
private static final
String[] tokenImage = {
"",
"\" \"",
"\"\\t\"",
"\"\\f\"",
"",
"",
"",
"\"(\"",
"\")\"",
"\"{\"",
"\"}\"",
"\"[\"",
"\"]\"",
"\";\"",
"\",\"",
"\".\"",
"\":\"",
"\"`\"",
"\"+\"",
"\"-\"",
"\"*\"",
"\"/\"",
"\"//\"",
"\"**\"",
"\"<<\"",
"\">>\"",
"\"%\"",
"\"~\"",
"\"^\"",
"\"|\"",
"\"&\"",
"\"=\"",
"\">\"",
"\"<\"",
"\"==\"",
"\"<=\"",
"\">=\"",
"\"<>\"",
"\"!=\"",
"\"+=\"",
"\"-=\"",
"\"*=\"",
"\"/=\"",
"\"//=\"",
"\"%=\"",
"\"&=\"",
"\"|=\"",
"\"^=\"",
"\"<<=\"",
"\">>=\"",
"\"**=\"",
"\"or\"",
"\"and\"",
"\"not\"",
"\"is\"",
"\"in\"",
"\"lambda\"",
"\"if\"",
"\"else\"",
"\"elif\"",
"\"while\"",
"\"for\"",
"\"try\"",
"\"except\"",
"\"def\"",
"\"class\"",
"\"finally\"",
"\"print\"",
"\"pass\"",
"\"break\"",
"\"continue\"",
"\"return\"",
"\"yield\"",
"\"import\"",
"\"from\"",
"\"del\"",
"\"raise\"",
"\"global\"",
"\"exec\"",
"\"assert\"",
"\"as\"",
"\"with\"",
"\"@\"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"\"\\\'\"",
"\"\\\"\"",
"\"\\\'\\\'\\\'\"",
"\"\\\"\\\"\\\"\"",
"\"\\\'\"",
"\"\\\"\"",
"\"\\\'\\\'\\\'\"",
"\"\\\"\\\"\\\"\"",
"\"\\\'\"",
"\"\\\"\"",
"\"\\\'\\\'\\\'\"",
"\"\\\"\\\"\\\"\"",
"\"\\\\\\\'\"",
"\"\\\\\\\"\"",
"\"\\\\\\r\\n\"",
"\"\\\\\\n\"",
"\"\\\\\\r\"",
"\"\\\\\\\\\"",
"",
"\"\\r\\n\"",
"\"\\n\"",
"\"\\r\"",
"",
"",
};
/** Nams of the tokens, each index corresponds to a kind. See also {@link #describe(int)}. */
public static final java.util.List TOKEN_NAMES = java.util.Collections.unmodifiableList(java.util.Arrays.asList(tokenImage));
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy