New batch from Fred

This commit is contained in:
Guido van Rossum 1996-08-21 14:32:37 +00:00
parent 3a1fbb4c70
commit 4747887880
6 changed files with 1192 additions and 470 deletions

View file

@ -1,5 +1,18 @@
# Non-terminal symbols of Python grammar (from "graminit.h")
#! /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:
#
# PYTHONPATH=Lib:Modules ./python Lib/symbol.py
#
# (this path allows the import of string.py, token.py, and regexmodule.so
# for a site with no installation in place)
#--start constants--
single_input = 256
file_input = 257
eval_input = 258
@ -23,39 +36,40 @@ raise_stmt = 275
import_stmt = 276
dotted_name = 277
global_stmt = 278
access_stmt = 279
accesstype = 280
exec_stmt = 281
compound_stmt = 282
if_stmt = 283
while_stmt = 284
for_stmt = 285
try_stmt = 286
except_clause = 287
suite = 288
test = 289
and_test = 290
not_test = 291
comparison = 292
comp_op = 293
expr = 294
xor_expr = 295
and_expr = 296
shift_expr = 297
arith_expr = 298
term = 299
factor = 300
power = 301
atom = 302
lambdef = 303
trailer = 304
subscript = 305
exec_stmt = 279
compound_stmt = 280
if_stmt = 281
while_stmt = 282
for_stmt = 283
try_stmt = 284
except_clause = 285
suite = 286
test = 287
and_test = 288
not_test = 289
comparison = 290
comp_op = 291
expr = 292
xor_expr = 293
and_expr = 294
shift_expr = 295
arith_expr = 296
term = 297
factor = 298
power = 299
atom = 300
lambdef = 301
trailer = 302
subscriptlist = 303
subscript = 304
sliceop = 305
exprlist = 306
testlist = 307
dictmaker = 308
classdef = 309
arglist = 310
argument = 311
#--end constants--
names = dir()
sym_name = {}
@ -63,3 +77,17 @@ for name in names:
number = eval(name)
if type(number) is type(0):
sym_name[number] = 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()
#
# end of file