home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 April / PCWorld_2001-04_cd.bin / Software / TemaCD / webclean / !!!python!!! / BeOpen-Python-2.0.exe / SYMBOL.PY < prev    next >
Encoding:
Python Source  |  2000-09-28  |  1.7 KB  |  94 lines

  1. #! /usr/bin/env python
  2.  
  3. """Non-terminal symbols of Python grammar (from "graminit.h")."""
  4.  
  5. #  This file is automatically generated; please don't muck it up!
  6. #
  7. #  To update the symbols in this file, 'cd' to the top directory of
  8. #  the python source tree after building the interpreter and run:
  9. #
  10. #    python Lib/symbol.py
  11.  
  12. #--start constants--
  13. single_input = 256
  14. file_input = 257
  15. eval_input = 258
  16. funcdef = 259
  17. parameters = 260
  18. varargslist = 261
  19. fpdef = 262
  20. fplist = 263
  21. stmt = 264
  22. simple_stmt = 265
  23. small_stmt = 266
  24. expr_stmt = 267
  25. augassign = 268
  26. print_stmt = 269
  27. del_stmt = 270
  28. pass_stmt = 271
  29. flow_stmt = 272
  30. break_stmt = 273
  31. continue_stmt = 274
  32. return_stmt = 275
  33. raise_stmt = 276
  34. import_stmt = 277
  35. import_as_name = 278
  36. dotted_as_name = 279
  37. dotted_name = 280
  38. global_stmt = 281
  39. exec_stmt = 282
  40. assert_stmt = 283
  41. compound_stmt = 284
  42. if_stmt = 285
  43. while_stmt = 286
  44. for_stmt = 287
  45. try_stmt = 288
  46. except_clause = 289
  47. suite = 290
  48. test = 291
  49. and_test = 292
  50. not_test = 293
  51. comparison = 294
  52. comp_op = 295
  53. expr = 296
  54. xor_expr = 297
  55. and_expr = 298
  56. shift_expr = 299
  57. arith_expr = 300
  58. term = 301
  59. factor = 302
  60. power = 303
  61. atom = 304
  62. listmaker = 305
  63. lambdef = 306
  64. trailer = 307
  65. subscriptlist = 308
  66. subscript = 309
  67. sliceop = 310
  68. exprlist = 311
  69. testlist = 312
  70. dictmaker = 313
  71. classdef = 314
  72. arglist = 315
  73. argument = 316
  74. list_iter = 317
  75. list_for = 318
  76. list_if = 319
  77. #--end constants--
  78.  
  79. sym_name = {}
  80. for _name, _value in globals().items():
  81.     if type(_value) is type(0):
  82.         sym_name[_value] = _name
  83.  
  84.  
  85. def main():
  86.     import sys
  87.     import token
  88.     if len(sys.argv) == 1:
  89.         sys.argv = sys.argv + ["Include/graminit.h", "Lib/symbol.py"]
  90.     token.main()
  91.  
  92. if __name__ == "__main__":
  93.     main()
  94.