blob: e3fff3422c78021f46ed35229b15054afafc1a29 [file] [log] [blame]
Benjamin Peterson90f5ba52010-03-11 22:53:45 +00001#! /usr/bin/env python3
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
Benjamin Peterson4905e802009-09-27 02:43:28 +000029testlist_star_expr = 272
30augassign = 273
31del_stmt = 274
32pass_stmt = 275
33flow_stmt = 276
34break_stmt = 277
35continue_stmt = 278
36return_stmt = 279
37yield_stmt = 280
38raise_stmt = 281
39import_stmt = 282
40import_name = 283
41import_from = 284
42import_as_name = 285
43dotted_as_name = 286
44import_as_names = 287
45dotted_as_names = 288
46dotted_name = 289
47global_stmt = 290
48nonlocal_stmt = 291
49assert_stmt = 292
50compound_stmt = 293
51if_stmt = 294
52while_stmt = 295
53for_stmt = 296
54try_stmt = 297
55with_stmt = 298
56with_item = 299
57except_clause = 300
58suite = 301
59test = 302
60test_nocond = 303
61lambdef = 304
62lambdef_nocond = 305
63or_test = 306
64and_test = 307
65not_test = 308
66comparison = 309
67comp_op = 310
68star_expr = 311
69expr = 312
70xor_expr = 313
71and_expr = 314
72shift_expr = 315
73arith_expr = 316
74term = 317
75factor = 318
76power = 319
77atom = 320
78testlist_comp = 321
79trailer = 322
80subscriptlist = 323
81subscript = 324
82sliceop = 325
83exprlist = 326
84testlist = 327
85dictorsetmaker = 328
86classdef = 329
87arglist = 330
88argument = 331
89comp_iter = 332
90comp_for = 333
91comp_if = 334
Georg Brandl39cf04b2007-08-31 07:58:27 +000092encoding_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()