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 |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 16 | funcdef = 259 |
| 17 | parameters = 260 |
| 18 | varargslist = 261 |
| 19 | fpdef = 262 |
| 20 | fplist = 263 |
| 21 | stmt = 264 |
| 22 | simple_stmt = 265 |
| 23 | small_stmt = 266 |
| 24 | expr_stmt = 267 |
Thomas Wouters | 3405262 | 2000-08-24 21:08:39 +0000 | [diff] [blame] | 25 | augassign = 268 |
| 26 | print_stmt = 269 |
| 27 | del_stmt = 270 |
| 28 | pass_stmt = 271 |
| 29 | flow_stmt = 272 |
| 30 | break_stmt = 273 |
| 31 | continue_stmt = 274 |
| 32 | return_stmt = 275 |
Guido van Rossum | 6e735c9 | 2001-07-13 18:05:46 +0000 | [diff] [blame] | 33 | yield_stmt = 276 |
| 34 | raise_stmt = 277 |
| 35 | import_stmt = 278 |
| 36 | import_as_name = 279 |
| 37 | dotted_as_name = 280 |
| 38 | dotted_name = 281 |
| 39 | global_stmt = 282 |
| 40 | exec_stmt = 283 |
| 41 | assert_stmt = 284 |
| 42 | compound_stmt = 285 |
| 43 | if_stmt = 286 |
| 44 | while_stmt = 287 |
| 45 | for_stmt = 288 |
| 46 | try_stmt = 289 |
| 47 | except_clause = 290 |
| 48 | suite = 291 |
| 49 | test = 292 |
| 50 | and_test = 293 |
| 51 | not_test = 294 |
| 52 | comparison = 295 |
| 53 | comp_op = 296 |
| 54 | expr = 297 |
| 55 | xor_expr = 298 |
| 56 | and_expr = 299 |
| 57 | shift_expr = 300 |
| 58 | arith_expr = 301 |
| 59 | term = 302 |
| 60 | factor = 303 |
| 61 | power = 304 |
| 62 | atom = 305 |
| 63 | listmaker = 306 |
| 64 | lambdef = 307 |
| 65 | trailer = 308 |
| 66 | subscriptlist = 309 |
| 67 | subscript = 310 |
| 68 | sliceop = 311 |
| 69 | exprlist = 312 |
| 70 | testlist = 313 |
Jeremy Hylton | 4bf1fb6 | 2001-10-17 13:13:04 +0000 | [diff] [blame] | 71 | testlist_safe = 314 |
| 72 | dictmaker = 315 |
| 73 | classdef = 316 |
| 74 | arglist = 317 |
| 75 | argument = 318 |
| 76 | list_iter = 319 |
| 77 | list_for = 320 |
| 78 | list_if = 321 |
Michael W. Hudson | adf1606 | 2002-10-03 09:42:01 +0000 | [diff] [blame] | 79 | testlist1 = 322 |
| 80 | encoding_decl = 323 |
Guido van Rossum | 4747887 | 1996-08-21 14:32:37 +0000 | [diff] [blame] | 81 | #--end constants-- |
Guido van Rossum | b31c7f7 | 1993-11-11 10:31:23 +0000 | [diff] [blame] | 82 | |
Guido van Rossum | b31c7f7 | 1993-11-11 10:31:23 +0000 | [diff] [blame] | 83 | sym_name = {} |
Fred Drake | dc1a072 | 1997-10-06 21:06:29 +0000 | [diff] [blame] | 84 | for _name, _value in globals().items(): |
| 85 | if type(_value) is type(0): |
Guido van Rossum | 45e2fbc | 1998-03-26 21:13:24 +0000 | [diff] [blame] | 86 | sym_name[_value] = _name |
Guido van Rossum | 4747887 | 1996-08-21 14:32:37 +0000 | [diff] [blame] | 87 | |
| 88 | |
| 89 | def main(): |
| 90 | import sys |
| 91 | import token |
| 92 | if len(sys.argv) == 1: |
Guido van Rossum | 45e2fbc | 1998-03-26 21:13:24 +0000 | [diff] [blame] | 93 | sys.argv = sys.argv + ["Include/graminit.h", "Lib/symbol.py"] |
Guido van Rossum | 4747887 | 1996-08-21 14:32:37 +0000 | [diff] [blame] | 94 | token.main() |
| 95 | |
| 96 | if __name__ == "__main__": |
| 97 | main() |