pycore_token.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /* Auto-generated by Tools/build/generate_token.py */
  2. /* Token types */
  3. #ifndef Py_INTERNAL_TOKEN_H
  4. #define Py_INTERNAL_TOKEN_H
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. #ifndef Py_BUILD_CORE
  9. # error "this header requires Py_BUILD_CORE define"
  10. #endif
  11. #undef TILDE /* Prevent clash of our definition with system macro. Ex AIX, ioctl.h */
  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. #define COLONEQUAL 53
  66. #define EXCLAMATION 54
  67. #define OP 55
  68. #define AWAIT 56
  69. #define ASYNC 57
  70. #define TYPE_IGNORE 58
  71. #define TYPE_COMMENT 59
  72. #define SOFT_KEYWORD 60
  73. #define FSTRING_START 61
  74. #define FSTRING_MIDDLE 62
  75. #define FSTRING_END 63
  76. #define COMMENT 64
  77. #define NL 65
  78. #define ERRORTOKEN 66
  79. #define N_TOKENS 68
  80. #define NT_OFFSET 256
  81. /* Special definitions for cooperation with parser */
  82. #define ISTERMINAL(x) ((x) < NT_OFFSET)
  83. #define ISNONTERMINAL(x) ((x) >= NT_OFFSET)
  84. #define ISEOF(x) ((x) == ENDMARKER)
  85. #define ISWHITESPACE(x) ((x) == ENDMARKER || \
  86. (x) == NEWLINE || \
  87. (x) == INDENT || \
  88. (x) == DEDENT)
  89. #define ISSTRINGLIT(x) ((x) == STRING || \
  90. (x) == FSTRING_MIDDLE)
  91. // Symbols exported for test_peg_generator
  92. PyAPI_DATA(const char * const) _PyParser_TokenNames[]; /* Token names */
  93. PyAPI_FUNC(int) _PyToken_OneChar(int);
  94. PyAPI_FUNC(int) _PyToken_TwoChars(int, int);
  95. PyAPI_FUNC(int) _PyToken_ThreeChars(int, int, int);
  96. #ifdef __cplusplus
  97. }
  98. #endif
  99. #endif // !Py_INTERNAL_TOKEN_H