token.h 2.6 KB

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