Guido van Rossum | 4747887 | 1996-08-21 14:32:37 +0000 | [diff] [blame] | 1 | #! /usr/bin/env python |
Guido van Rossum | e7b146f | 2000-02-04 15:28:42 +0000 | [diff] [blame] | 2 | |
| 3 | """Non-terminal symbols of Python grammar (from "graminit.h").""" |
| 4 | |
Guido van Rossum | 4747887 | 1996-08-21 14:32:37 +0000 | [diff] [blame] | 5 | # 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 Rossum | f7a8b45 | 1997-10-22 20:54:50 +0000 | [diff] [blame] | 10 | # python Lib/symbol.py |
Guido van Rossum | b31c7f7 | 1993-11-11 10:31:23 +0000 | [diff] [blame] | 11 | |
Guido van Rossum | 4747887 | 1996-08-21 14:32:37 +0000 | [diff] [blame] | 12 | #--start constants-- |
Guido van Rossum | b31c7f7 | 1993-11-11 10:31:23 +0000 | [diff] [blame] | 13 | single_input = 256 |
| 14 | file_input = 257 |
| 15 | eval_input = 258 |
Anthony Baxter | c2a5a63 | 2004-08-02 06:10:11 +0000 | [diff] [blame] | 16 | decorator = 259 |
| 17 | decorators = 260 |
| 18 | funcdef = 261 |
| 19 | parameters = 262 |
Neal Norwitz | c150536 | 2006-12-28 06:47:50 +0000 | [diff] [blame] | 20 | typedargslist = 263 |
| 21 | tname = 264 |
| 22 | tfpdef = 265 |
| 23 | tfplist = 266 |
| 24 | varargslist = 267 |
| 25 | vname = 268 |
| 26 | vfpdef = 269 |
| 27 | vfplist = 270 |
| 28 | stmt = 271 |
| 29 | simple_stmt = 272 |
| 30 | small_stmt = 273 |
| 31 | expr_stmt = 274 |
| 32 | augassign = 275 |
| 33 | print_stmt = 276 |
| 34 | del_stmt = 277 |
| 35 | pass_stmt = 278 |
| 36 | flow_stmt = 279 |
| 37 | break_stmt = 280 |
| 38 | continue_stmt = 281 |
| 39 | return_stmt = 282 |
| 40 | yield_stmt = 283 |
| 41 | raise_stmt = 284 |
| 42 | import_stmt = 285 |
| 43 | import_name = 286 |
| 44 | import_from = 287 |
| 45 | import_as_name = 288 |
| 46 | dotted_as_name = 289 |
| 47 | import_as_names = 290 |
| 48 | dotted_as_names = 291 |
| 49 | dotted_name = 292 |
| 50 | global_stmt = 293 |
| 51 | assert_stmt = 294 |
| 52 | compound_stmt = 295 |
| 53 | if_stmt = 296 |
| 54 | while_stmt = 297 |
| 55 | for_stmt = 298 |
| 56 | try_stmt = 299 |
| 57 | with_stmt = 300 |
| 58 | with_var = 301 |
| 59 | except_clause = 302 |
| 60 | suite = 303 |
| 61 | testlist_safe = 304 |
| 62 | old_test = 305 |
| 63 | old_lambdef = 306 |
| 64 | test = 307 |
| 65 | or_test = 308 |
| 66 | and_test = 309 |
| 67 | not_test = 310 |
| 68 | comparison = 311 |
| 69 | comp_op = 312 |
| 70 | expr = 313 |
| 71 | xor_expr = 314 |
| 72 | and_expr = 315 |
| 73 | shift_expr = 316 |
| 74 | arith_expr = 317 |
| 75 | term = 318 |
| 76 | factor = 319 |
| 77 | power = 320 |
| 78 | atom = 321 |
| 79 | listmaker = 322 |
| 80 | testlist_gexp = 323 |
| 81 | lambdef = 324 |
| 82 | trailer = 325 |
| 83 | subscriptlist = 326 |
| 84 | subscript = 327 |
| 85 | sliceop = 328 |
| 86 | exprlist = 329 |
| 87 | testlist = 330 |
| 88 | dictsetmaker = 331 |
| 89 | classdef = 332 |
| 90 | arglist = 333 |
| 91 | argument = 334 |
| 92 | list_iter = 335 |
| 93 | list_for = 336 |
| 94 | list_if = 337 |
| 95 | gen_iter = 338 |
| 96 | gen_for = 339 |
| 97 | gen_if = 340 |
| 98 | testlist1 = 341 |
| 99 | encoding_decl = 342 |
| 100 | yield_expr = 343 |
Guido van Rossum | 4747887 | 1996-08-21 14:32:37 +0000 | [diff] [blame] | 101 | #--end constants-- |
Guido van Rossum | b31c7f7 | 1993-11-11 10:31:23 +0000 | [diff] [blame] | 102 | |
Guido van Rossum | b31c7f7 | 1993-11-11 10:31:23 +0000 | [diff] [blame] | 103 | sym_name = {} |
Fred Drake | dc1a072 | 1997-10-06 21:06:29 +0000 | [diff] [blame] | 104 | for _name, _value in globals().items(): |
| 105 | if type(_value) is type(0): |
Guido van Rossum | 45e2fbc | 1998-03-26 21:13:24 +0000 | [diff] [blame] | 106 | sym_name[_value] = _name |
Guido van Rossum | 4747887 | 1996-08-21 14:32:37 +0000 | [diff] [blame] | 107 | |
| 108 | |
| 109 | def main(): |
| 110 | import sys |
| 111 | import token |
| 112 | if len(sys.argv) == 1: |
Guido van Rossum | 45e2fbc | 1998-03-26 21:13:24 +0000 | [diff] [blame] | 113 | sys.argv = sys.argv + ["Include/graminit.h", "Lib/symbol.py"] |
Guido van Rossum | 4747887 | 1996-08-21 14:32:37 +0000 | [diff] [blame] | 114 | token.main() |
| 115 | |
| 116 | if __name__ == "__main__": |
| 117 | main() |