source: vendor/python/2.5/Parser/Python.asdl@ 3951

Last change on this file since 3951 was 3225, checked in by bird, 19 years ago

Python 2.5

File size: 4.2 KB
Line 
1-- ASDL's five builtin types are identifier, int, string, object, bool
2
3module Python version "$Revision: 43614 $"
4{
5 mod = Module(stmt* body)
6 | Interactive(stmt* body)
7 | Expression(expr body)
8
9 -- not really an actual node but useful in Jython's typesystem.
10 | Suite(stmt* body)
11
12 stmt = FunctionDef(identifier name, arguments args,
13 stmt* body, expr* decorators)
14 | ClassDef(identifier name, expr* bases, stmt* body)
15 | Return(expr? value)
16
17 | Delete(expr* targets)
18 | Assign(expr* targets, expr value)
19 | AugAssign(expr target, operator op, expr value)
20
21 -- not sure if bool is allowed, can always use int
22 | Print(expr? dest, expr* values, bool nl)
23
24 -- use 'orelse' because else is a keyword in target languages
25 | For(expr target, expr iter, stmt* body, stmt* orelse)
26 | While(expr test, stmt* body, stmt* orelse)
27 | If(expr test, stmt* body, stmt* orelse)
28 | With(expr context_expr, expr? optional_vars, stmt* body)
29
30 -- 'type' is a bad name
31 | Raise(expr? type, expr? inst, expr? tback)
32 | TryExcept(stmt* body, excepthandler* handlers, stmt* orelse)
33 | TryFinally(stmt* body, stmt* finalbody)
34 | Assert(expr test, expr? msg)
35
36 | Import(alias* names)
37 | ImportFrom(identifier module, alias* names, int? level)
38
39 -- Doesn't capture requirement that locals must be
40 -- defined if globals is
41 -- still supports use as a function!
42 | Exec(expr body, expr? globals, expr? locals)
43
44 | Global(identifier* names)
45 | Expr(expr value)
46 | Pass | Break | Continue
47
48 -- XXX Jython will be different
49 -- col_offset is the byte offset in the utf8 string the parser uses
50 attributes (int lineno, int col_offset)
51
52 -- BoolOp() can use left & right?