1 2 /* Token types */ 3 #ifndef Py_LIMITED_API 4 #ifndef Py_TOKEN_H 5 #define Py_TOKEN_H 6 #ifdef __cplusplus 7 extern "C" { 8 #endif 9 10 #undef TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */ 11 12 #define ENDMARKER 0 13 #define NAME 1 14 #define NUMBER 2 15 #define STRING 3 16 #define NEWLINE 4 17 #define INDENT 5 18 #define DEDENT 6 19 #define LPAR 7 20 #define RPAR 8 21 #define LSQB 9 22 #define RSQB 10 23 #define COLON 11 24 #define COMMA 12 25 #define SEMI 13 26 #define PLUS 14 27 #define MINUS 15 28 #define STAR 16 29 #define SLASH 17 30 #define VBAR 18 31 #define AMPER 19 32 #define LESS 20 33 #define GREATER 21 34 #define EQUAL 22 35 #define DOT 23 36 #define PERCENT 24 37 #define LBRACE 25 38 #define RBRACE 26 39 #define EQEQUAL 27 40 #define NOTEQUAL 28 41 #define LESSEQUAL 29 42 #define GREATEREQUAL 30 43 #define TILDE 31 44 #define CIRCUMFLEX 32 45 #define LEFTSHIFT 33 46 #define RIGHTSHIFT 34 47 #define DOUBLESTAR 35 48 #define PLUSEQUAL 36 49 #define MINEQUAL 37 50 #define STAREQUAL 38 51 #define SLASHEQUAL 39 52 #define PERCENTEQUAL 40 53 #define AMPEREQUAL 41 54 #define VBAREQUAL 42 55 #define CIRCUMFLEXEQUAL 43 56 #define LEFTSHIFTEQUAL 44 57 #define RIGHTSHIFTEQUAL 45 58 #define DOUBLESTAREQUAL 46 59 #define DOUBLESLASH 47 60 #define DOUBLESLASHEQUAL 48 61 #define AT 49 62 #define ATEQUAL 50 63 #define RARROW 51 64 #define ELLIPSIS 52 65 /* Don't forget to update the table _PyParser_TokenNames in tokenizer.c! */ 66 #define OP 53 67 #define AWAIT 54 68 #define ASYNC 55 69 #define ERRORTOKEN 56 70 #define N_TOKENS 57 71 72 /* Special definitions for cooperation with parser */ 73 74 #define NT_OFFSET 256 75 76 #define ISTERMINAL(x) ((x) < NT_OFFSET) 77 #define ISNONTERMINAL(x) ((x) >= NT_OFFSET) 78 #define ISEOF(x) ((x) == ENDMARKER) 79 80 81 PyAPI_DATA(const char *) _PyParser_TokenNames[]; /* Token names */ 82 PyAPI_FUNC(int) PyToken_OneChar(int); 83 PyAPI_FUNC(int) PyToken_TwoChars(int, int); 84 PyAPI_FUNC(int) PyToken_ThreeChars(int, int, int); 85 86 #ifdef __cplusplus 87 } 88 #endif 89 #endif /* !Py_TOKEN_H */ 90 #endif /* Py_LIMITED_API */ 91