symbol.py 2.1 KB

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