symbol.py 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. testlist_star_expr = 273
  28. augassign = 274
  29. del_stmt = 275
  30. pass_stmt = 276
  31. flow_stmt = 277
  32. break_stmt = 278
  33. continue_stmt = 279
  34. return_stmt = 280
  35. yield_stmt = 281
  36. raise_stmt = 282
  37. import_stmt = 283
  38. import_name = 284
  39. import_from = 285
  40. import_as_name = 286
  41. dotted_as_name = 287
  42. import_as_names = 288
  43. dotted_as_names = 289
  44. dotted_name = 290
  45. global_stmt = 291
  46. nonlocal_stmt = 292
  47. assert_stmt = 293
  48. compound_stmt = 294
  49. async_stmt = 295
  50. if_stmt = 296
  51. while_stmt = 297
  52. for_stmt = 298
  53. try_stmt = 299
  54. with_stmt = 300
  55. with_item = 301
  56. except_clause = 302
  57. suite = 303
  58. test = 304
  59. test_nocond = 305
  60. lambdef = 306
  61. lambdef_nocond = 307
  62. or_test = 308
  63. and_test = 309
  64. not_test = 310
  65. comparison = 311
  66. comp_op = 312
  67. star_expr = 313
  68. expr = 314
  69. xor_expr = 315
  70. and_expr = 316
  71. shift_expr = 317
  72. arith_expr = 318
  73. term = 319
  74. factor = 320
  75. power = 321
  76. atom_expr = 322
  77. atom = 323
  78. testlist_comp = 324
  79. trailer = 325
  80. subscriptlist = 326
  81. subscript = 327
  82. sliceop = 328
  83. exprlist = 329
  84. testlist = 330
  85. dictorsetmaker = 331
  86. classdef = 332
  87. arglist = 333
  88. argument = 334
  89. comp_iter = 335
  90. comp_for = 336
  91. comp_if = 337
  92. encoding_decl = 338
  93. yield_expr = 339
  94. yield_arg = 340
  95. #--end constants--
  96. sym_name = {}
  97. for _name, _value in list(globals().items()):
  98. if type(_value) is type(0):
  99. sym_name[_value] = _name
  100. def _main():
  101. import sys
  102. import token
  103. if len(sys.argv) == 1:
  104. sys.argv = sys.argv + ["Include/graminit.h", "Lib/symbol.py"]
  105. token._main()
  106. if __name__ == "__main__":
  107. _main()