blob: 1b773d05de54f455ab247f5da8ccee8d2508d5a1 [file] [log] [blame]
Guido van Rossum47478871996-08-21 14:32:37 +00001#! /usr/bin/env python
Guido van Rossume7b146f2000-02-04 15:28:42 +00002
3"""Non-terminal symbols of Python grammar (from "graminit.h")."""
4
Guido van Rossum47478871996-08-21 14:32:37 +00005# 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#
Guido van Rossumf7a8b451997-10-22 20:54:50 +000010# python Lib/symbol.py
Guido van Rossumb31c7f71993-11-11 10:31:23 +000011
Guido van Rossum47478871996-08-21 14:32:37 +000012#--start constants--
Guido van Rossumb31c7f71993-11-11 10:31:23 +000013single_input = 256
14file_input = 257
15eval_input = 258
Anthony Baxterc2a5a632004-08-02 06:10:11 +000016decorator = 259
17decorators = 260
Georg Brandl39cf04b2007-08-31 07:58:27 +000018decorated = 261
Guido van Rossumd59da4b2007-05-22 18:11:13 +000019funcdef = 262
20parameters = 263
21typedargslist = 264
Georg Brandl39cf04b2007-08-31 07:58:27 +000022tfpdef = 265
23varargslist = 266
24vfpdef = 267
25stmt = 268
26simple_stmt = 269
27small_stmt = 270
28expr_stmt = 271
29augassign = 272
30del_stmt = 273
31pass_stmt = 274
32flow_stmt = 275
33break_stmt = 276
34continue_stmt = 277
35return_stmt = 278
36yield_stmt = 279
37raise_stmt = 280
38import_stmt = 281
39import_name = 282
40import_from = 283
41import_as_name = 284
42dotted_as_name = 285
43import_as_names = 286
44dotted_as_names = 287
45dotted_name = 288
46global_stmt = 289
47nonlocal_stmt = 290
48assert_stmt = 291
49compound_stmt = 292
50if_stmt = 293
51while_stmt = 294
52for_stmt = 295
53try_stmt = 296
54with_stmt = 297
55with_var = 298
56except_clause = 299
57suite = 300
58test = 301
59test_nocond = 302
60lambdef = 303
61lambdef_nocond = 304
62or_test = 305
63and_test = 306
64not_test = 307
65comparison = 308
66comp_op = 309
67star_expr = 310
68expr = 311
69xor_expr = 312
70and_expr = 313
71shift_expr = 314
72arith_expr = 315
73term = 316
74factor = 317
75power = 318
76atom = 319
77testlist_comp = 320
78trailer = 321
79subscriptlist = 322
80subscript = 323
81sliceop = 324
82exprlist = 325
83testlist = 326
84dictorsetmaker = 327
85classdef = 328
86arglist = 329
87argument = 330
88comp_iter = 331
89comp_for = 332
90comp_if = 333
91testlist1 = 334
92encoding_decl = 335
93yield_expr = 336
Guido van Rossum47478871996-08-21 14:32:37 +000094#--end constants--
Guido van Rossumb31c7f71993-11-11 10:31:23 +000095
Guido van Rossumb31c7f71993-11-11 10:31:23 +000096sym_name = {}
Guido van Rossumcc2b0162007-02-11 06:12:03 +000097for _name, _value in list(globals().items()):
Fred Drakedc1a0721997-10-06 21:06:29 +000098 if type(_value) is type(0):
Guido van Rossum45e2fbc1998-03-26 21:13:24 +000099 sym_name[_value] = _name
Guido van Rossum47478871996-08-21 14:32:37 +0000100
101
102def main():
103 import sys
104 import token
105 if len(sys.argv) == 1:
Guido van Rossum45e2fbc1998-03-26 21:13:24 +0000106 sys.argv = sys.argv + ["Include/graminit.h", "Lib/symbol.py"]
Guido van Rossum47478871996-08-21 14:32:37 +0000107 token.main()
108
109if __name__ == "__main__":
110 main()