1# This file describes the nodes of the AST in ast.py. The module is 2# generated by astgen.py. 3# The descriptions use the following special notation to describe 4# properties of the children: 5# * this child is not a node 6# ! this child is a sequence that contains nodes in it 7# & this child may be set to None 8# = ... a default value for the node constructor (optional args) 9# 10# If you add node types here, please be sure to update the list of 11# Node types in Doc/lib/asttable.tex. 12Module: doc*, node 13Stmt: nodes! 14Decorators: nodes! 15Function: decorators&, name*, argnames*, defaults!, flags*, doc*, code 16Lambda: argnames*, defaults!, flags*, code 17Class: name*, bases!, doc*, code, decorators& = None 18Pass: 19Break: 20Continue: 21For: assign, list, body, else_& 22While: test, body, else_& 23With: expr, vars&, body 24If: tests!, else_& 25IfExp: test, then, else_ 26Exec: expr, locals&, globals& 27From: modname*, names*, level* 28Import: names* 29Raise: expr1&, expr2&, expr3& 30TryFinally: body, final 31TryExcept: body, handlers!, else_& 32Return: value 33Yield: value 34Const: value* 35Print: nodes!, dest& 36Printnl: nodes!, dest& 37Discard: expr 38AugAssign: node, op*, expr 39Assign: nodes!, expr 40AssTuple: nodes! 41AssList: nodes! 42AssName: name*, flags* 43AssAttr: expr, attrname*, flags* 44ListComp: expr, quals! 45ListCompFor: assign, list, ifs! 46ListCompIf: test 47GenExpr: code 48GenExprInner: expr, quals! 49GenExprFor: assign, iter, ifs! 50GenExprIf: test 51List: nodes! 52Dict: items! 53Not: expr 54Compare: expr, ops! 55Name: name* 56Global: names* 57Backquote: expr 58Getattr: expr, attrname* 59CallFunc: node, args!, star_args& = None, dstar_args& = None 60Keyword: name*, expr 61Subscript: expr, flags*, subs! 62Ellipsis: 63Sliceobj: nodes! 64Slice: expr, flags*, lower&, upper& 65Assert: test, fail& 66Tuple: nodes! 67Or: nodes! 68And: nodes! 69Bitor: nodes! 70Bitxor: nodes! 71Bitand: nodes! 72LeftShift: (left, right) 73RightShift: (left, right) 74Add: (left, right) 75Sub: (left, right) 76Mul: (left, right) 77Div: (left, right) 78Mod: (left, right) 79Power: (left, right) 80FloorDiv: (left, right) 81UnaryAdd: expr 82UnarySub: expr 83Invert: expr 84 85init(Function): 86 self.varargs = self.kwargs = None 87 if flags & CO_VARARGS: 88 self.varargs = 1 89 if flags & CO_VARKEYWORDS: 90 self.kwargs = 1 91 92init(Lambda): 93 self.varargs = self.kwargs = None 94 if flags & CO_VARARGS: 95 self.varargs = 1 96 if flags & CO_VARKEYWORDS: 97 self.kwargs = 1 98 99init(GenExpr): 100 self.argnames = ['.0'] 101 self.varargs = self.kwargs = None 102 103init(GenExprFor): 104 self.is_outmost = False 105