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