blob: d9f01e081a75958feca12d09aa8802bed1479a47 [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#
Éric Araujoe1886bf2011-11-29 16:45:34 +010010# ./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
Yury Selivanov01098122015-05-27 11:08:19 -040019async_funcdef = 262
20funcdef = 263
21parameters = 264
22typedargslist = 265
23tfpdef = 266
24varargslist = 267
25vfpdef = 268
26stmt = 269
27simple_stmt = 270
28small_stmt = 271
29expr_stmt = 272
Yury Selivanovf8cb8a12016-09-08 20:50:03 -070030annassign = 273
31testlist_star_expr = 274
32augassign = 275
33del_stmt = 276
34pass_stmt = 277
35flow_stmt = 278
36break_stmt = 279
37continue_stmt = 280
38return_stmt = 281
39yield_stmt = 282
40raise_stmt = 283
41import_stmt = 284
42import_name = 285
43import_from = 286
44import_as_name = 287
45dotted_as_name = 288
46import_as_names = 289
47dotted_as_names = 290
48dotted_name = 291
49global_stmt = 292
50nonlocal_stmt = 293
51assert_stmt = 294
52compound_stmt = 295
53async_stmt = 296
54if_stmt = 297
55while_stmt = 298
56for_stmt = 299
57try_stmt = 300
58with_stmt = 301
59with_item = 302
60except_clause = 303
61suite = 304
62test = 305
63test_nocond = 306
64lambdef = 307
65lambdef_nocond = 308
66or_test = 309
67and_test = 310
68not_test = 311
69comparison = 312
70comp_op = 313
71star_expr = 314
72expr = 315
73xor_expr = 316
74and_expr = 317
75shift_expr = 318
76arith_expr = 319
77term = 320
78factor = 321
79power = 322
80atom_expr = 323
81atom = 324
82testlist_comp = 325
83trailer = 326
84subscriptlist = 327
85subscript = 328
86sliceop = 329
87exprlist = 330
88testlist = 331
89dictorsetmaker = 332
90classdef = 333
91arglist = 334
92argument = 335
93comp_iter = 336
94comp_for = 337
95comp_if = 338
96encoding_decl = 339
97yield_expr = 340
98yield_arg = 341
Guido van Rossum47478871996-08-21 14:32:37 +000099#--end constants--
Guido van Rossumb31c7f71993-11-11 10:31:23 +0000100
Guido van Rossumb31c7f71993-11-11 10:31:23 +0000101sym_name = {}
Guido van Rossumcc2b0162007-02-11 06:12:03 +0000102for _name, _value in list(globals().items()):
Fred Drakedc1a0721997-10-06 21:06:29 +0000103 if type(_value) is type(0):
Guido van Rossum45e2fbc1998-03-26 21:13:24 +0000104 sym_name[_value] = _name
Guido van Rossum47478871996-08-21 14:32:37 +0000105
106
Benjamin Peterson2fdedff2013-02-05 10:13:22 -0500107def _main():
Guido van Rossum47478871996-08-21 14:32:37 +0000108 import sys
109 import token
110 if len(sys.argv) == 1:
Guido van Rossum45e2fbc1998-03-26 21:13:24 +0000111 sys.argv = sys.argv + ["Include/graminit.h", "Lib/symbol.py"]
Benjamin Peterson003472a2013-02-05 10:11:13 -0500112 token._main()
Guido van Rossum47478871996-08-21 14:32:37 +0000113
114if __name__ == "__main__":
Benjamin Peterson2fdedff2013-02-05 10:13:22 -0500115 _main()