2001-08-29 15:08:02 -03:00
|
|
|
# This file describes the nodes of the AST in ast.py. The module is
|
|
|
|
# generated by astgen.py.
|
|
|
|
# The descriptions use the following special notation to describe
|
|
|
|
# properties of the children:
|
|
|
|
# * this child is not a node
|
|
|
|
# ! this child is a sequence that contains nodes in it
|
|
|
|
# & this child may be set to None
|
|
|
|
# = ... a default value for the node constructor (optional args)
|
2005-11-22 11:01:13 -04:00
|
|
|
#
|
|
|
|
# If you add node types here, please be sure to update the list of
|
|
|
|
# Node types in Doc/lib/asttable.tex.
|
2001-08-29 15:08:02 -03:00
|
|
|
Module: doc*, node
|
|
|
|
Stmt: nodes!
|
2004-08-02 03:10:11 -03:00
|
|
|
Decorators: nodes!
|
|
|
|
Function: decorators&, name*, argnames*, defaults!, flags*, doc*, code
|
2001-08-29 15:08:02 -03:00
|
|
|
Lambda: argnames*, defaults!, flags*, code
|
2008-02-25 14:06:00 -04:00
|
|
|
Class: name*, bases!, doc*, code, decorators& = None
|
2000-10-25 14:59:17 -03:00
|
|
|
Pass:
|
|
|
|
Break:
|
|
|
|
Continue:
|
2001-08-29 15:08:02 -03:00
|
|
|
For: assign, list, body, else_&
|
|
|
|
While: test, body, else_&
|
2006-02-27 18:32:47 -04:00
|
|
|
With: expr, vars&, body
|
2001-08-29 15:08:02 -03:00
|
|
|
If: tests!, else_&
|
2006-03-03 14:11:37 -04:00
|
|
|
IfExp: test, then, else_
|
2001-08-29 15:08:02 -03:00
|
|
|
Exec: expr, locals&, globals&
|
2006-03-03 14:11:37 -04:00
|
|
|
From: modname*, names*, level*
|
2001-08-29 15:08:02 -03:00
|
|
|
Import: names*
|
|
|
|
Raise: expr1&, expr2&, expr3&
|
2000-10-25 14:59:17 -03:00
|
|
|
TryFinally: body, final
|
2001-08-29 15:08:02 -03:00
|
|
|
TryExcept: body, handlers!, else_&
|
2000-10-25 14:59:17 -03:00
|
|
|
Return: value
|
2001-08-14 15:57:43 -03:00
|
|
|
Yield: value
|
2001-08-29 15:08:02 -03:00
|
|
|
Const: value*
|
|
|
|
Print: nodes!, dest&
|
|
|
|
Printnl: nodes!, dest&
|
2000-10-25 14:59:17 -03:00
|
|
|
Discard: expr
|
2001-08-29 15:08:02 -03:00
|
|
|
AugAssign: node, op*, expr
|
|
|
|
Assign: nodes!, expr
|
|
|
|
AssTuple: nodes!
|
|
|
|
AssList: nodes!
|
|
|
|
AssName: name*, flags*
|
|
|
|
AssAttr: expr, attrname*, flags*
|
|
|
|
ListComp: expr, quals!
|
|
|
|
ListCompFor: assign, list, ifs!
|
2000-10-25 14:59:17 -03:00
|
|
|
ListCompIf: test
|
2006-02-27 18:32:47 -04:00
|
|
|
GenExpr: code
|
2004-05-19 05:20:33 -03:00
|
|
|
GenExprInner: expr, quals!
|
|
|
|
GenExprFor: assign, iter, ifs!
|
|
|
|
GenExprIf: test
|
2001-08-29 15:08:02 -03:00
|
|
|
List: nodes!
|
|
|
|
Dict: items!
|
2000-10-25 14:59:17 -03:00
|
|
|
Not: expr
|
2001-08-29 15:08:02 -03:00
|
|
|
Compare: expr, ops!
|
|
|
|
Name: name*
|
2001-09-14 19:40:36 -03:00
|
|
|
Global: names*
|
2000-10-25 14:59:17 -03:00
|
|
|
Backquote: expr
|
2001-08-29 15:08:02 -03:00
|
|
|
Getattr: expr, attrname*
|
|
|
|
CallFunc: node, args!, star_args& = None, dstar_args& = None
|
|
|
|
Keyword: name*, expr
|
|
|
|
Subscript: expr, flags*, subs!
|
2000-10-25 14:59:17 -03:00
|
|
|
Ellipsis:
|
2001-08-29 15:08:02 -03:00
|
|
|
Sliceobj: nodes!
|
|
|
|
Slice: expr, flags*, lower&, upper&
|
|
|
|
Assert: test, fail&
|
|
|
|
Tuple: nodes!
|
|
|
|
Or: nodes!
|
|
|
|
And: nodes!
|
|
|
|
Bitor: nodes!
|
|
|
|
Bitxor: nodes!
|
|
|
|
Bitand: nodes!
|
2000-10-25 14:59:17 -03:00
|
|
|
LeftShift: (left, right)
|
|
|
|
RightShift: (left, right)
|
|
|
|
Add: (left, right)
|
|
|
|
Sub: (left, right)
|
|
|
|
Mul: (left, right)
|
|
|
|
Div: (left, right)
|
|
|
|
Mod: (left, right)
|
|
|
|
Power: (left, right)
|
2001-08-29 15:08:02 -03:00
|
|
|
FloorDiv: (left, right)
|
2000-10-25 14:59:17 -03:00
|
|
|
UnaryAdd: expr
|
|
|
|
UnarySub: expr
|
|
|
|
Invert: expr
|
|
|
|
|
|
|
|
init(Function):
|
|
|
|
self.varargs = self.kwargs = None
|
|
|
|
if flags & CO_VARARGS:
|
|
|
|
self.varargs = 1
|
|
|
|
if flags & CO_VARKEYWORDS:
|
|
|
|
self.kwargs = 1
|
|
|
|
|
|
|
|
init(Lambda):
|
|
|
|
self.varargs = self.kwargs = None
|
|
|
|
if flags & CO_VARARGS:
|
|
|
|
self.varargs = 1
|
|
|
|
if flags & CO_VARKEYWORDS:
|
|
|
|
self.kwargs = 1
|
2004-05-19 05:20:33 -03:00
|
|
|
|
|
|
|
init(GenExpr):
|
2008-02-25 14:06:00 -04:00
|
|
|
self.argnames = ['.0']
|
2004-05-19 05:20:33 -03:00
|
|
|
self.varargs = self.kwargs = None
|
|
|
|
|
|
|
|
init(GenExprFor):
|
|
|
|
self.is_outmost = False
|