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)
|
|
|
|
Module: doc*, node
|
|
|
|
Stmt: nodes!
|
|
|
|
Function: name*, argnames*, defaults!, flags*, doc*, code
|
|
|
|
Lambda: argnames*, defaults!, flags*, code
|
|
|
|
Class: name*, bases!, doc*, code
|
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_&
|
|
|
|
If: tests!, else_&
|
|
|
|
Exec: expr, locals&, globals&
|
|
|
|
From: modname*, names*
|
|
|
|
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
|
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
|