symbol.py 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. import warnings
  13. warnings.warn(
  14. "The symbol module is deprecated and will be removed "
  15. "in future versions of Python",
  16. DeprecationWarning,
  17. stacklevel=2,
  18. )
  19. #--start constants--
  20. single_input = 256
  21. file_input = 257
  22. eval_input = 258
  23. decorator = 259
  24. decorators = 260
  25. decorated = 261
  26. async_funcdef = 262
  27. funcdef = 263
  28. parameters = 264
  29. typedargslist = 265
  30. tfpdef = 266
  31. varargslist = 267
  32. vfpdef = 268
  33. stmt = 269
  34. simple_stmt = 270
  35. small_stmt = 271
  36. expr_stmt = 272
  37. annassign = 273
  38. testlist_star_expr = 274
  39. augassign = 275
  40. del_stmt = 276
  41. pass_stmt = 277
  42. flow_stmt = 278
  43. break_stmt = 279
  44. continue_stmt = 280
  45. return_stmt = 281
  46. yield_stmt = 282
  47. raise_stmt = 283
  48. import_stmt = 284
  49. import_name = 285
  50. import_from = 286
  51. import_as_name = 287
  52. dotted_as_name = 288
  53. import_as_names = 289
  54. dotted_as_names = 290
  55. dotted_name = 291
  56. global_stmt = 292
  57. nonlocal_stmt = 293
  58. assert_stmt = 294
  59. compound_stmt = 295
  60. async_stmt = 296
  61. if_stmt = 297
  62. while_stmt = 298
  63. for_stmt = 299
  64. try_stmt = 300
  65. with_stmt = 301
  66. with_item = 302
  67. except_clause = 303
  68. suite = 304
  69. namedexpr_test = 305
  70. test = 306
  71. test_nocond = 307
  72. lambdef = 308
  73. lambdef_nocond = 309
  74. or_test = 310
  75. and_test = 311
  76. not_test = 312
  77. comparison = 313
  78. comp_op = 314
  79. star_expr = 315
  80. expr = 316
  81. xor_expr = 317
  82. and_expr = 318
  83. shift_expr = 319
  84. arith_expr = 320
  85. term = 321
  86. factor = 322
  87. power = 323
  88. atom_expr = 324
  89. atom = 325
  90. testlist_comp = 326
  91. trailer = 327
  92. subscriptlist = 328
  93. subscript = 329
  94. sliceop = 330
  95. exprlist = 331
  96. testlist = 332
  97. dictorsetmaker = 333
  98. classdef = 334
  99. arglist = 335
  100. argument = 336
  101. comp_iter = 337
  102. sync_comp_for = 338
  103. comp_for = 339
  104. comp_if = 340
  105. encoding_decl = 341
  106. yield_expr = 342
  107. yield_arg = 343
  108. func_body_suite = 344
  109. func_type_input = 345
  110. func_type = 346
  111. typelist = 347
  112. #--end constants--
  113. sym_name = {}
  114. for _name, _value in list(globals().items()):
  115. if type(_value) is type(0):
  116. sym_name[_value] = _name
  117. del _name, _value