mirror of
https://github.com/python/cpython.git
synced 2024-12-01 11:15:56 +01:00
354433a59d
(Code contributed by Jiwon Seo.) The documentation portion of the patch is being re-worked and will be checked-in soon. Likewise, PEP 289 will be updated to reflect Guido's rationale for the design decisions on binding behavior (as described in in his patch comments and in discussions on python-dev). The test file, test_genexps.py, is written in doctest format and is meant to exercise all aspects of the the patch. Further additions are welcome from everyone. Please stress test this new feature as much as possible before the alpha release.
102 lines
1.8 KiB
Python
Executable File
102 lines
1.8 KiB
Python
Executable File
#! /usr/bin/env python
|
|
|
|
"""Non-terminal symbols of Python grammar (from "graminit.h")."""
|
|
|
|
# This file is automatically generated; please don't muck it up!
|
|
#
|
|
# To update the symbols in this file, 'cd' to the top directory of
|
|
# the python source tree after building the interpreter and run:
|
|
#
|
|
# python Lib/symbol.py
|
|
|
|
#--start constants--
|
|
single_input = 256
|
|
file_input = 257
|
|
eval_input = 258
|
|
funcdef = 259
|
|
parameters = 260
|
|
varargslist = 261
|
|
fpdef = 262
|
|
fplist = 263
|
|
stmt = 264
|
|
simple_stmt = 265
|
|
small_stmt = 266
|
|
expr_stmt = 267
|
|
augassign = 268
|
|
print_stmt = 269
|
|
del_stmt = 270
|
|
pass_stmt = 271
|
|
flow_stmt = 272
|
|
break_stmt = 273
|
|
continue_stmt = 274
|
|
return_stmt = 275
|
|
yield_stmt = 276
|
|
raise_stmt = 277
|
|
import_stmt = 278
|
|
import_as_name = 279
|
|
dotted_as_name = 280
|
|
dotted_name = 281
|
|
global_stmt = 282
|
|
exec_stmt = 283
|
|
assert_stmt = 284
|
|
compound_stmt = 285
|
|
if_stmt = 286
|
|
while_stmt = 287
|
|
for_stmt = 288
|
|
try_stmt = 289
|
|
except_clause = 290
|
|
suite = 291
|
|
test = 292
|
|
and_test = 293
|
|
not_test = 294
|
|
comparison = 295
|
|
comp_op = 296
|
|
expr = 297
|
|
xor_expr = 298
|
|
and_expr = 299
|
|
shift_expr = 300
|
|
arith_expr = 301
|
|
term = 302
|
|
factor = 303
|
|
power = 304
|
|
atom = 305
|
|
listmaker = 306
|
|
testlist_gexp = 307
|
|
lambdef = 308
|
|
trailer = 309
|
|
subscriptlist = 310
|
|
subscript = 311
|
|
sliceop = 312
|
|
exprlist = 313
|
|
testlist = 314
|
|
testlist_safe = 315
|
|
dictmaker = 316
|
|
classdef = 317
|
|
arglist = 318
|
|
argument = 319
|
|
list_iter = 320
|
|
list_for = 321
|
|
list_if = 322
|
|
gen_iter = 323
|
|
gen_for = 324
|
|
gen_if = 325
|
|
testlist1 = 326
|
|
encoding_decl = 327
|
|
#--end constants--
|
|
|
|
sym_name = {}
|
|
for _name, _value in globals().items():
|
|
if type(_value) is type(0):
|
|
sym_name[_value] = _name
|
|
|
|
|
|
def main():
|
|
import sys
|
|
import token
|
|
if len(sys.argv) == 1:
|
|
sys.argv = sys.argv + ["Include/graminit.h", "Lib/symbol.py"]
|
|
token.main()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|