symbol.py 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. """Non-terminal symbols of Python grammar (from "graminit.h")."""
  2. # This file is automatically generated; please don't muck it up!
  3. #
  4. # To update the symbols in this file, 'cd' to the top directory of
  5. # the python source tree after building the interpreter and run:
  6. #
  7. # python3 Tools/scripts/generate_symbol_py.py Include/graminit.h Lib/symbol.py
  8. #
  9. # or just
  10. #
  11. # make regen-symbol
  12. #--start constants--
  13. single_input = 256
  14. file_input = 257
  15. eval_input = 258
  16. decorator = 259
  17. decorators = 260
  18. decorated = 261
  19. async_funcdef = 262
  20. funcdef = 263
  21. parameters = 264
  22. typedargslist = 265
  23. tfpdef = 266
  24. varargslist = 267
  25. vfpdef = 268
  26. stmt = 269
  27. simple_stmt = 270
  28. small_stmt = 271
  29. expr_stmt = 272
  30. annassign = 273
  31. testlist_star_expr = 274
  32. augassign = 275
  33. del_stmt = 276
  34. pass_stmt = 277
  35. flow_stmt = 278
  36. break_stmt = 279
  37. continue_stmt = 280
  38. return_stmt = 281
  39. yield_stmt = 282
  40. raise_stmt = 283
  41. import_stmt = 284
  42. import_name = 285
  43. import_from = 286
  44. import_as_name = 287
  45. dotted_as_name = 288
  46. import_as_names = 289
  47. dotted_as_names = 290
  48. dotted_name = 291
  49. global_stmt = 292
  50. nonlocal_stmt = 293
  51. assert_stmt = 294
  52. compound_stmt = 295
  53. async_stmt = 296
  54. if_stmt = 297
  55. while_stmt = 298
  56. for_stmt = 299
  57. try_stmt = 300
  58. with_stmt = 301
  59. with_item = 302
  60. except_clause = 303
  61. suite = 304
  62. namedexpr_test = 305
  63. test = 306
  64. test_nocond = 307
  65. lambdef = 308
  66. lambdef_nocond = 309
  67. or_test = 310
  68. and_test = 311
  69. not_test = 312
  70. comparison = 313
  71. comp_op = 314
  72. star_expr = 315
  73. expr = 316
  74. xor_expr = 317
  75. and_expr = 318
  76. shift_expr = 319
  77. arith_expr = 320
  78. term = 321
  79. factor = 322
  80. power = 323
  81. atom_expr = 324
  82. atom = 325
  83. testlist_comp = 326
  84. trailer = 327
  85. subscriptlist = 328
  86. subscript = 329
  87. sliceop = 330
  88. exprlist = 331
  89. testlist = 332
  90. dictorsetmaker = 333
  91. classdef = 334
  92. arglist = 335
  93. argument = 336
  94. comp_iter = 337
  95. sync_comp_for = 338
  96. comp_for = 339
  97. comp_if = 340
  98. encoding_decl = 341
  99. yield_expr = 342
  100. yield_arg = 343
  101. func_body_suite = 344
  102. func_type_input = 345
  103. func_type = 346
  104. typelist = 347
  105. #--end constants--
  106. sym_name = {}
  107. for _name, _value in list(globals().items()):
  108. if type(_value) is type(0):
  109. sym_name[_value] = _name
  110. del _name, _value