Python-checkins
Threads by month
- ----- 2024 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
November 2005
- 30 participants
- 673 discussions
30 Nov '05
Author: martin.v.loewis
Date: Wed Nov 30 23:57:06 2005
New Revision: 41571
Modified:
python/branches/ast-objects/Parser/asdl_c.py
python/branches/ast-objects/Python/Python-ast.c
Log:
add missing INCREFs in ctor.
Modified: python/branches/ast-objects/Parser/asdl_c.py
==============================================================================
--- python/branches/ast-objects/Parser/asdl_c.py (original)
+++ python/branches/ast-objects/Parser/asdl_c.py Wed Nov 30 23:57:06 2005
@@ -213,8 +213,12 @@
emit("if (result == NULL)", 1)
emit("return NULL;", 2)
for argtype, argname, opt in args:
+ if argtype == "PyObject*":
+ emit("Py_INCREF(%s);" % argname, 1)
emit("result->%s = %s;" % (argname, argname), 1)
for argtype, argname, opt in attrs:
+ if argtype == "PyObject*":
+ emit("Py_INCREF(%s);" % argname, 1)
emit("result->_base.%s = %s;" % (argname, argname), 1)
emit("return (PyObject*)result;", 1)
emit("}")
Modified: python/branches/ast-objects/Python/Python-ast.c
==============================================================================
--- python/branches/ast-objects/Python/Python-ast.c (original)
+++ python/branches/ast-objects/Python/Python-ast.c Wed Nov 30 23:57:06 2005
@@ -54,6 +54,7 @@
struct _Module *result = PyObject_New(struct _Module, &Py_Module_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(body);
result->body = body;
return (PyObject*)result;
}
@@ -116,6 +117,7 @@
struct _Interactive *result = PyObject_New(struct _Interactive, &Py_Interactive_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(body);
result->body = body;
return (PyObject*)result;
}
@@ -178,6 +180,7 @@
struct _Expression *result = PyObject_New(struct _Expression, &Py_Expression_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(body);
result->body = body;
return (PyObject*)result;
}
@@ -240,6 +243,7 @@
struct _Suite *result = PyObject_New(struct _Suite, &Py_Suite_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(body);
result->body = body;
return (PyObject*)result;
}
@@ -348,9 +352,13 @@
struct _FunctionDef *result = PyObject_New(struct _FunctionDef, &Py_FunctionDef_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(name);
result->name = name;
+ Py_INCREF(args);
result->args = args;
+ Py_INCREF(body);
result->body = body;
+ Py_INCREF(decorators);
result->decorators = decorators;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -417,8 +425,11 @@
struct _ClassDef *result = PyObject_New(struct _ClassDef, &Py_ClassDef_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(name);
result->name = name;
+ Py_INCREF(bases);
result->bases = bases;
+ Py_INCREF(body);
result->body = body;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -484,6 +495,7 @@
struct _Return *result = PyObject_New(struct _Return, &Py_Return_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(value);
result->value = value;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -547,6 +559,7 @@
struct _Delete *result = PyObject_New(struct _Delete, &Py_Delete_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(targets);
result->targets = targets;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -610,7 +623,9 @@
struct _Assign *result = PyObject_New(struct _Assign, &Py_Assign_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(targets);
result->targets = targets;
+ Py_INCREF(value);
result->value = value;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -675,8 +690,11 @@
struct _AugAssign *result = PyObject_New(struct _AugAssign, &Py_AugAssign_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(target);
result->target = target;
+ Py_INCREF(op);
result->op = op;
+ Py_INCREF(value);
result->value = value;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -742,8 +760,11 @@
struct _Print *result = PyObject_New(struct _Print, &Py_Print_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(dest);
result->dest = dest;
+ Py_INCREF(values);
result->values = values;
+ Py_INCREF(nl);
result->nl = nl;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -810,9 +831,13 @@
struct _For *result = PyObject_New(struct _For, &Py_For_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(target);
result->target = target;
+ Py_INCREF(iter);
result->iter = iter;
+ Py_INCREF(body);
result->body = body;
+ Py_INCREF(orelse);
result->orelse = orelse;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -879,8 +904,11 @@
struct _While *result = PyObject_New(struct _While, &Py_While_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(test);
result->test = test;
+ Py_INCREF(body);
result->body = body;
+ Py_INCREF(orelse);
result->orelse = orelse;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -946,8 +974,11 @@
struct _If *result = PyObject_New(struct _If, &Py_If_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(test);
result->test = test;
+ Py_INCREF(body);
result->body = body;
+ Py_INCREF(orelse);
result->orelse = orelse;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1013,8 +1044,11 @@
struct _Raise *result = PyObject_New(struct _Raise, &Py_Raise_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(type);
result->type = type;
+ Py_INCREF(inst);
result->inst = inst;
+ Py_INCREF(tback);
result->tback = tback;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1081,8 +1115,11 @@
struct _TryExcept *result = PyObject_New(struct _TryExcept, &Py_TryExcept_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(body);
result->body = body;
+ Py_INCREF(handlers);
result->handlers = handlers;
+ Py_INCREF(orelse);
result->orelse = orelse;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1148,7 +1185,9 @@
struct _TryFinally *result = PyObject_New(struct _TryFinally, &Py_TryFinally_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(body);
result->body = body;
+ Py_INCREF(finalbody);
result->finalbody = finalbody;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1213,7 +1252,9 @@
struct _Assert *result = PyObject_New(struct _Assert, &Py_Assert_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(test);
result->test = test;
+ Py_INCREF(msg);
result->msg = msg;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1278,6 +1319,7 @@
struct _Import *result = PyObject_New(struct _Import, &Py_Import_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(names);
result->names = names;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1341,7 +1383,9 @@
struct _ImportFrom *result = PyObject_New(struct _ImportFrom, &Py_ImportFrom_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(module);
result->module = module;
+ Py_INCREF(names);
result->names = names;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1406,8 +1450,11 @@
struct _Exec *result = PyObject_New(struct _Exec, &Py_Exec_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(body);
result->body = body;
+ Py_INCREF(globals);
result->globals = globals;
+ Py_INCREF(locals);
result->locals = locals;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1473,6 +1520,7 @@
struct _Global *result = PyObject_New(struct _Global, &Py_Global_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(names);
result->names = names;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1536,6 +1584,7 @@
struct _Expr *result = PyObject_New(struct _Expr, &Py_Expr_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(value);
result->value = value;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1827,7 +1876,9 @@
struct _BoolOp *result = PyObject_New(struct _BoolOp, &Py_BoolOp_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(op);
result->op = op;
+ Py_INCREF(values);
result->values = values;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1892,8 +1943,11 @@
struct _BinOp *result = PyObject_New(struct _BinOp, &Py_BinOp_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(left);
result->left = left;
+ Py_INCREF(op);
result->op = op;
+ Py_INCREF(right);
result->right = right;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -1959,7 +2013,9 @@
struct _UnaryOp *result = PyObject_New(struct _UnaryOp, &Py_UnaryOp_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(op);
result->op = op;
+ Py_INCREF(operand);
result->operand = operand;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2024,7 +2080,9 @@
struct _Lambda *result = PyObject_New(struct _Lambda, &Py_Lambda_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(args);
result->args = args;
+ Py_INCREF(body);
result->body = body;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2089,7 +2147,9 @@
struct _Dict *result = PyObject_New(struct _Dict, &Py_Dict_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(keys);
result->keys = keys;
+ Py_INCREF(values);
result->values = values;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2154,7 +2214,9 @@
struct _ListComp *result = PyObject_New(struct _ListComp, &Py_ListComp_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(elt);
result->elt = elt;
+ Py_INCREF(generators);
result->generators = generators;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2219,7 +2281,9 @@
struct _GeneratorExp *result = PyObject_New(struct _GeneratorExp, &Py_GeneratorExp_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(elt);
result->elt = elt;
+ Py_INCREF(generators);
result->generators = generators;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2284,6 +2348,7 @@
struct _Yield *result = PyObject_New(struct _Yield, &Py_Yield_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(value);
result->value = value;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2347,8 +2412,11 @@
struct _Compare *result = PyObject_New(struct _Compare, &Py_Compare_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(left);
result->left = left;
+ Py_INCREF(ops);
result->ops = ops;
+ Py_INCREF(comparators);
result->comparators = comparators;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2415,10 +2483,15 @@
struct _Call *result = PyObject_New(struct _Call, &Py_Call_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(func);
result->func = func;
+ Py_INCREF(args);
result->args = args;
+ Py_INCREF(keywords);
result->keywords = keywords;
+ Py_INCREF(starargs);
result->starargs = starargs;
+ Py_INCREF(kwargs);
result->kwargs = kwargs;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2486,6 +2559,7 @@
struct _Repr *result = PyObject_New(struct _Repr, &Py_Repr_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(value);
result->value = value;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2549,6 +2623,7 @@
struct _Num *result = PyObject_New(struct _Num, &Py_Num_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(n);
result->n = n;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2612,6 +2687,7 @@
struct _Str *result = PyObject_New(struct _Str, &Py_Str_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(s);
result->s = s;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2675,8 +2751,11 @@
struct _Attribute *result = PyObject_New(struct _Attribute, &Py_Attribute_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(value);
result->value = value;
+ Py_INCREF(attr);
result->attr = attr;
+ Py_INCREF(ctx);
result->ctx = ctx;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2742,8 +2821,11 @@
struct _Subscript *result = PyObject_New(struct _Subscript, &Py_Subscript_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(value);
result->value = value;
+ Py_INCREF(slice);
result->slice = slice;
+ Py_INCREF(ctx);
result->ctx = ctx;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2809,7 +2891,9 @@
struct _Name *result = PyObject_New(struct _Name, &Py_Name_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(id);
result->id = id;
+ Py_INCREF(ctx);
result->ctx = ctx;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2874,7 +2958,9 @@
struct _List *result = PyObject_New(struct _List, &Py_List_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(elts);
result->elts = elts;
+ Py_INCREF(ctx);
result->ctx = ctx;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -2939,7 +3025,9 @@
struct _Tuple *result = PyObject_New(struct _Tuple, &Py_Tuple_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(elts);
result->elts = elts;
+ Py_INCREF(ctx);
result->ctx = ctx;
result->_base.lineno = lineno;
return (PyObject*)result;
@@ -3109,8 +3197,11 @@
struct _Slice *result = PyObject_New(struct _Slice, &Py_Slice_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(lower);
result->lower = lower;
+ Py_INCREF(upper);
result->upper = upper;
+ Py_INCREF(step);
result->step = step;
return (PyObject*)result;
}
@@ -3175,6 +3266,7 @@
struct _ExtSlice *result = PyObject_New(struct _ExtSlice, &Py_ExtSlice_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(dims);
result->dims = dims;
return (PyObject*)result;
}
@@ -3237,6 +3329,7 @@
struct _Index *result = PyObject_New(struct _Index, &Py_Index_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(value);
result->value = value;
return (PyObject*)result;
}
@@ -3299,8 +3392,11 @@
struct _comprehension *result = PyObject_New(struct _comprehension, &Py_comprehension_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(target);
result->target = target;
+ Py_INCREF(iter);
result->iter = iter;
+ Py_INCREF(ifs);
result->ifs = ifs;
return (PyObject*)result;
}
@@ -3365,8 +3461,11 @@
struct _excepthandler *result = PyObject_New(struct _excepthandler, &Py_excepthandler_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(type);
result->type = type;
+ Py_INCREF(name);
result->name = name;
+ Py_INCREF(body);
result->body = body;
return (PyObject*)result;
}
@@ -3432,9 +3531,13 @@
struct _arguments *result = PyObject_New(struct _arguments, &Py_arguments_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(args);
result->args = args;
+ Py_INCREF(vararg);
result->vararg = vararg;
+ Py_INCREF(kwarg);
result->kwarg = kwarg;
+ Py_INCREF(defaults);
result->defaults = defaults;
return (PyObject*)result;
}
@@ -3500,7 +3603,9 @@
struct _keyword *result = PyObject_New(struct _keyword, &Py_keyword_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(arg);
result->arg = arg;
+ Py_INCREF(value);
result->value = value;
return (PyObject*)result;
}
@@ -3564,7 +3669,9 @@
struct _alias *result = PyObject_New(struct _alias, &Py_alias_Type);
if (result == NULL)
return NULL;
+ Py_INCREF(name);
result->name = name;
+ Py_INCREF(asname);
result->asname = asname;
return (PyObject*)result;
}
1
0
Author: walter.doerwald
Date: Wed Nov 30 21:16:17 2005
New Revision: 41570
Modified:
python/trunk/PC/pyconfig.h
Log:
Fix typo.
Modified: python/trunk/PC/pyconfig.h
==============================================================================
--- python/trunk/PC/pyconfig.h (original)
+++ python/trunk/PC/pyconfig.h Wed Nov 30 21:16:17 2005
@@ -29,7 +29,7 @@
/* Visual Studio 2005 introduces deprecation warnings for
"insecure" and POSIX functions. The insecure functions should
- be replaces by *_s versions (according to Microsoft); the
+ be replaced by *_s versions (according to Microsoft); the
POSIX functions by _* versions (which, according to Microsoft,
would be ISO C conforming). Neither renaming is feasible, so
we just silence the warnings. */
1
0
commit of r41569 - in python/branches/ast-objects: Include Parser Python
by martin.v.loewis 30 Nov '05
by martin.v.loewis 30 Nov '05
30 Nov '05
Author: martin.v.loewis
Date: Wed Nov 30 20:40:40 2005
New Revision: 41569
Modified:
python/branches/ast-objects/Include/Python-ast.h
python/branches/ast-objects/Parser/asdl_c.py
python/branches/ast-objects/Python/Python-ast.c
Log:
Simplify the naming conventions, while still keeping it
namespace-safe.
Modified: python/branches/ast-objects/Include/Python-ast.h
==============================================================================
--- python/branches/ast-objects/Include/Python-ast.h (original)
+++ python/branches/ast-objects/Include/Python-ast.h Wed Nov 30 20:40:40 2005
@@ -1,518 +1,581 @@
/* File automatically generated by ./Parser/asdl_c.py */
+/* For convenience, this header provides several
+ macro, type and constant names which are not Py_-prefixed.
+ Therefore, the file should not be included in Python.h;
+ all symbols relevant to linkage are Py_-prefixed. */
PyAPI_DATA(PyTypeObject) Py_mod_Type;
-#define Py_mod_Check(op) PyObject_TypeCheck(op, &Py_mod_Type)
+#define mod_Check(op) PyObject_TypeCheck(op, &Py_mod_Type)
-struct Py_mod{
+struct _mod{
PyObject_HEAD
+ enum {Module_kind, Interactive_kind, Expression_kind, Suite_kind} _kind;
};
-PyAPI_DATA(PyTypeObject) Py_mod_Module_Type;
-#define Py_mod_Module_Check(op) PyObject_TypeCheck(op, &Py_mod_Module_Type)
+PyAPI_DATA(PyTypeObject) Py_Module_Type;
+#define Module_Check(op) PyObject_TypeCheck(op, &Py_Module_Type)
-struct Py_mod_Module{
- struct Py_mod _base;
+struct _Module{
+ struct _mod _base;
PyObject* body; /* stmt */
};
-PyObject *Py_mod_Module_New(PyObject*);
+PyObject *Py_Module_New(PyObject*);
+#define Module Py_Module_New
-PyAPI_DATA(PyTypeObject) Py_mod_Interactive_Type;
-#define Py_mod_Interactive_Check(op) PyObject_TypeCheck(op, &Py_mod_Interactive_Type)
+PyAPI_DATA(PyTypeObject) Py_Interactive_Type;
+#define Interactive_Check(op) PyObject_TypeCheck(op, &Py_Interactive_Type)
-struct Py_mod_Interactive{
- struct Py_mod _base;
+struct _Interactive{
+ struct _mod _base;
PyObject* body; /* stmt */
};
-PyObject *Py_mod_Interactive_New(PyObject*);
+PyObject *Py_Interactive_New(PyObject*);
+#define Interactive Py_Interactive_New
-PyAPI_DATA(PyTypeObject) Py_mod_Expression_Type;
-#define Py_mod_Expression_Check(op) PyObject_TypeCheck(op, &Py_mod_Expression_Type)
+PyAPI_DATA(PyTypeObject) Py_Expression_Type;
+#define Expression_Check(op) PyObject_TypeCheck(op, &Py_Expression_Type)
-struct Py_mod_Expression{
- struct Py_mod _base;
+struct _Expression{
+ struct _mod _base;
PyObject* body; /* expr */
};
-PyObject *Py_mod_Expression_New(PyObject*);
+PyObject *Py_Expression_New(PyObject*);
+#define Expression Py_Expression_New
-PyAPI_DATA(PyTypeObject) Py_mod_Suite_Type;
-#define Py_mod_Suite_Check(op) PyObject_TypeCheck(op, &Py_mod_Suite_Type)
+PyAPI_DATA(PyTypeObject) Py_Suite_Type;
+#define Suite_Check(op) PyObject_TypeCheck(op, &Py_Suite_Type)
-struct Py_mod_Suite{
- struct Py_mod _base;
+struct _Suite{
+ struct _mod _base;
PyObject* body; /* stmt */
};
-PyObject *Py_mod_Suite_New(PyObject*);
+PyObject *Py_Suite_New(PyObject*);
+#define Suite Py_Suite_New
PyAPI_DATA(PyTypeObject) Py_stmt_Type;
-#define Py_stmt_Check(op) PyObject_TypeCheck(op, &Py_stmt_Type)
+#define stmt_Check(op) PyObject_TypeCheck(op, &Py_stmt_Type)
-struct Py_stmt{
+struct _stmt{
PyObject_HEAD
+ enum {FunctionDef_kind, ClassDef_kind, Return_kind, Delete_kind,
+ Assign_kind, AugAssign_kind, Print_kind, For_kind, While_kind,
+ If_kind, Raise_kind, TryExcept_kind, TryFinally_kind,
+ Assert_kind, Import_kind, ImportFrom_kind, Exec_kind,
+ Global_kind, Expr_kind, Pass_kind, Break_kind, Continue_kind}
+ _kind;
int lineno;
};
-PyAPI_DATA(PyTypeObject) Py_stmt_FunctionDef_Type;
-#define Py_stmt_FunctionDef_Check(op) PyObject_TypeCheck(op, &Py_stmt_FunctionDef_Type)
+PyAPI_DATA(PyTypeObject) Py_FunctionDef_Type;
+#define FunctionDef_Check(op) PyObject_TypeCheck(op, &Py_FunctionDef_Type)
-struct Py_stmt_FunctionDef{
- struct Py_stmt _base;
+struct _FunctionDef{
+ struct _stmt _base;
PyObject* name; /* identifier */
PyObject* args; /* arguments */
PyObject* body; /* stmt */
PyObject* decorators; /* expr */
};
-PyObject *Py_stmt_FunctionDef_New(PyObject*, PyObject*, PyObject*, PyObject*,
- int);
+PyObject *Py_FunctionDef_New(PyObject*, PyObject*, PyObject*, PyObject*, int);
+#define FunctionDef Py_FunctionDef_New
-PyAPI_DATA(PyTypeObject) Py_stmt_ClassDef_Type;
-#define Py_stmt_ClassDef_Check(op) PyObject_TypeCheck(op, &Py_stmt_ClassDef_Type)
+PyAPI_DATA(PyTypeObject) Py_ClassDef_Type;
+#define ClassDef_Check(op) PyObject_TypeCheck(op, &Py_ClassDef_Type)
-struct Py_stmt_ClassDef{
- struct Py_stmt _base;
+struct _ClassDef{
+ struct _stmt _base;
PyObject* name; /* identifier */
PyObject* bases; /* expr */
PyObject* body; /* stmt */
};
-PyObject *Py_stmt_ClassDef_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_ClassDef_New(PyObject*, PyObject*, PyObject*, int);
+#define ClassDef Py_ClassDef_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Return_Type;
-#define Py_stmt_Return_Check(op) PyObject_TypeCheck(op, &Py_stmt_Return_Type)
+PyAPI_DATA(PyTypeObject) Py_Return_Type;
+#define Return_Check(op) PyObject_TypeCheck(op, &Py_Return_Type)
-struct Py_stmt_Return{
- struct Py_stmt _base;
+struct _Return{
+ struct _stmt _base;
PyObject* value; /* expr */
};
-PyObject *Py_stmt_Return_New(PyObject*, int);
+PyObject *Py_Return_New(PyObject*, int);
+#define Return Py_Return_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Delete_Type;
-#define Py_stmt_Delete_Check(op) PyObject_TypeCheck(op, &Py_stmt_Delete_Type)
+PyAPI_DATA(PyTypeObject) Py_Delete_Type;
+#define Delete_Check(op) PyObject_TypeCheck(op, &Py_Delete_Type)
-struct Py_stmt_Delete{
- struct Py_stmt _base;
+struct _Delete{
+ struct _stmt _base;
PyObject* targets; /* expr */
};
-PyObject *Py_stmt_Delete_New(PyObject*, int);
+PyObject *Py_Delete_New(PyObject*, int);
+#define Delete Py_Delete_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Assign_Type;
-#define Py_stmt_Assign_Check(op) PyObject_TypeCheck(op, &Py_stmt_Assign_Type)
+PyAPI_DATA(PyTypeObject) Py_Assign_Type;
+#define Assign_Check(op) PyObject_TypeCheck(op, &Py_Assign_Type)
-struct Py_stmt_Assign{
- struct Py_stmt _base;
+struct _Assign{
+ struct _stmt _base;
PyObject* targets; /* expr */
PyObject* value; /* expr */
};
-PyObject *Py_stmt_Assign_New(PyObject*, PyObject*, int);
+PyObject *Py_Assign_New(PyObject*, PyObject*, int);
+#define Assign Py_Assign_New
-PyAPI_DATA(PyTypeObject) Py_stmt_AugAssign_Type;
-#define Py_stmt_AugAssign_Check(op) PyObject_TypeCheck(op, &Py_stmt_AugAssign_Type)
+PyAPI_DATA(PyTypeObject) Py_AugAssign_Type;
+#define AugAssign_Check(op) PyObject_TypeCheck(op, &Py_AugAssign_Type)
-struct Py_stmt_AugAssign{
- struct Py_stmt _base;
+struct _AugAssign{
+ struct _stmt _base;
PyObject* target; /* expr */
PyObject* op; /* operator */
PyObject* value; /* expr */
};
-PyObject *Py_stmt_AugAssign_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_AugAssign_New(PyObject*, PyObject*, PyObject*, int);
+#define AugAssign Py_AugAssign_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Print_Type;
-#define Py_stmt_Print_Check(op) PyObject_TypeCheck(op, &Py_stmt_Print_Type)
+PyAPI_DATA(PyTypeObject) Py_Print_Type;
+#define Print_Check(op) PyObject_TypeCheck(op, &Py_Print_Type)
-struct Py_stmt_Print{
- struct Py_stmt _base;
+struct _Print{
+ struct _stmt _base;
PyObject* dest; /* expr */
PyObject* values; /* expr */
PyObject* nl; /* bool */
};
-PyObject *Py_stmt_Print_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_Print_New(PyObject*, PyObject*, PyObject*, int);
+#define Print Py_Print_New
-PyAPI_DATA(PyTypeObject) Py_stmt_For_Type;
-#define Py_stmt_For_Check(op) PyObject_TypeCheck(op, &Py_stmt_For_Type)
+PyAPI_DATA(PyTypeObject) Py_For_Type;
+#define For_Check(op) PyObject_TypeCheck(op, &Py_For_Type)
-struct Py_stmt_For{
- struct Py_stmt _base;
+struct _For{
+ struct _stmt _base;
PyObject* target; /* expr */
PyObject* iter; /* expr */
PyObject* body; /* stmt */
PyObject* orelse; /* stmt */
};
-PyObject *Py_stmt_For_New(PyObject*, PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_For_New(PyObject*, PyObject*, PyObject*, PyObject*, int);
+#define For Py_For_New
-PyAPI_DATA(PyTypeObject) Py_stmt_While_Type;
-#define Py_stmt_While_Check(op) PyObject_TypeCheck(op, &Py_stmt_While_Type)
+PyAPI_DATA(PyTypeObject) Py_While_Type;
+#define While_Check(op) PyObject_TypeCheck(op, &Py_While_Type)
-struct Py_stmt_While{
- struct Py_stmt _base;
+struct _While{
+ struct _stmt _base;
PyObject* test; /* expr */
PyObject* body; /* stmt */
PyObject* orelse; /* stmt */
};
-PyObject *Py_stmt_While_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_While_New(PyObject*, PyObject*, PyObject*, int);
+#define While Py_While_New
-PyAPI_DATA(PyTypeObject) Py_stmt_If_Type;
-#define Py_stmt_If_Check(op) PyObject_TypeCheck(op, &Py_stmt_If_Type)
+PyAPI_DATA(PyTypeObject) Py_If_Type;
+#define If_Check(op) PyObject_TypeCheck(op, &Py_If_Type)
-struct Py_stmt_If{
- struct Py_stmt _base;
+struct _If{
+ struct _stmt _base;
PyObject* test; /* expr */
PyObject* body; /* stmt */
PyObject* orelse; /* stmt */
};
-PyObject *Py_stmt_If_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_If_New(PyObject*, PyObject*, PyObject*, int);
+#define If Py_If_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Raise_Type;
-#define Py_stmt_Raise_Check(op) PyObject_TypeCheck(op, &Py_stmt_Raise_Type)
+PyAPI_DATA(PyTypeObject) Py_Raise_Type;
+#define Raise_Check(op) PyObject_TypeCheck(op, &Py_Raise_Type)
-struct Py_stmt_Raise{
- struct Py_stmt _base;
+struct _Raise{
+ struct _stmt _base;
PyObject* type; /* expr */
PyObject* inst; /* expr */
PyObject* tback; /* expr */
};
-PyObject *Py_stmt_Raise_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_Raise_New(PyObject*, PyObject*, PyObject*, int);
+#define Raise Py_Raise_New
-PyAPI_DATA(PyTypeObject) Py_stmt_TryExcept_Type;
-#define Py_stmt_TryExcept_Check(op) PyObject_TypeCheck(op, &Py_stmt_TryExcept_Type)
+PyAPI_DATA(PyTypeObject) Py_TryExcept_Type;
+#define TryExcept_Check(op) PyObject_TypeCheck(op, &Py_TryExcept_Type)
-struct Py_stmt_TryExcept{
- struct Py_stmt _base;
+struct _TryExcept{
+ struct _stmt _base;
PyObject* body; /* stmt */
PyObject* handlers; /* excepthandler */
PyObject* orelse; /* stmt */
};
-PyObject *Py_stmt_TryExcept_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_TryExcept_New(PyObject*, PyObject*, PyObject*, int);
+#define TryExcept Py_TryExcept_New
-PyAPI_DATA(PyTypeObject) Py_stmt_TryFinally_Type;
-#define Py_stmt_TryFinally_Check(op) PyObject_TypeCheck(op, &Py_stmt_TryFinally_Type)
+PyAPI_DATA(PyTypeObject) Py_TryFinally_Type;
+#define TryFinally_Check(op) PyObject_TypeCheck(op, &Py_TryFinally_Type)
-struct Py_stmt_TryFinally{
- struct Py_stmt _base;
+struct _TryFinally{
+ struct _stmt _base;
PyObject* body; /* stmt */
PyObject* finalbody; /* stmt */
};
-PyObject *Py_stmt_TryFinally_New(PyObject*, PyObject*, int);
+PyObject *Py_TryFinally_New(PyObject*, PyObject*, int);
+#define TryFinally Py_TryFinally_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Assert_Type;
-#define Py_stmt_Assert_Check(op) PyObject_TypeCheck(op, &Py_stmt_Assert_Type)
+PyAPI_DATA(PyTypeObject) Py_Assert_Type;
+#define Assert_Check(op) PyObject_TypeCheck(op, &Py_Assert_Type)
-struct Py_stmt_Assert{
- struct Py_stmt _base;
+struct _Assert{
+ struct _stmt _base;
PyObject* test; /* expr */
PyObject* msg; /* expr */
};
-PyObject *Py_stmt_Assert_New(PyObject*, PyObject*, int);
+PyObject *Py_Assert_New(PyObject*, PyObject*, int);
+#define Assert Py_Assert_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Import_Type;
-#define Py_stmt_Import_Check(op) PyObject_TypeCheck(op, &Py_stmt_Import_Type)
+PyAPI_DATA(PyTypeObject) Py_Import_Type;
+#define Import_Check(op) PyObject_TypeCheck(op, &Py_Import_Type)
-struct Py_stmt_Import{
- struct Py_stmt _base;
+struct _Import{
+ struct _stmt _base;
PyObject* names; /* alias */
};
-PyObject *Py_stmt_Import_New(PyObject*, int);
+PyObject *Py_Import_New(PyObject*, int);
+#define Import Py_Import_New
-PyAPI_DATA(PyTypeObject) Py_stmt_ImportFrom_Type;
-#define Py_stmt_ImportFrom_Check(op) PyObject_TypeCheck(op, &Py_stmt_ImportFrom_Type)
+PyAPI_DATA(PyTypeObject) Py_ImportFrom_Type;
+#define ImportFrom_Check(op) PyObject_TypeCheck(op, &Py_ImportFrom_Type)
-struct Py_stmt_ImportFrom{
- struct Py_stmt _base;
+struct _ImportFrom{
+ struct _stmt _base;
PyObject* module; /* identifier */
PyObject* names; /* alias */
};
-PyObject *Py_stmt_ImportFrom_New(PyObject*, PyObject*, int);
+PyObject *Py_ImportFrom_New(PyObject*, PyObject*, int);
+#define ImportFrom Py_ImportFrom_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Exec_Type;
-#define Py_stmt_Exec_Check(op) PyObject_TypeCheck(op, &Py_stmt_Exec_Type)
+PyAPI_DATA(PyTypeObject) Py_Exec_Type;
+#define Exec_Check(op) PyObject_TypeCheck(op, &Py_Exec_Type)
-struct Py_stmt_Exec{
- struct Py_stmt _base;
+struct _Exec{
+ struct _stmt _base;
PyObject* body; /* expr */
PyObject* globals; /* expr */
PyObject* locals; /* expr */
};
-PyObject *Py_stmt_Exec_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_Exec_New(PyObject*, PyObject*, PyObject*, int);
+#define Exec Py_Exec_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Global_Type;
-#define Py_stmt_Global_Check(op) PyObject_TypeCheck(op, &Py_stmt_Global_Type)
+PyAPI_DATA(PyTypeObject) Py_Global_Type;
+#define Global_Check(op) PyObject_TypeCheck(op, &Py_Global_Type)
-struct Py_stmt_Global{
- struct Py_stmt _base;
+struct _Global{
+ struct _stmt _base;
PyObject* names; /* identifier */
};
-PyObject *Py_stmt_Global_New(PyObject*, int);
+PyObject *Py_Global_New(PyObject*, int);
+#define Global Py_Global_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Expr_Type;
-#define Py_stmt_Expr_Check(op) PyObject_TypeCheck(op, &Py_stmt_Expr_Type)
+PyAPI_DATA(PyTypeObject) Py_Expr_Type;
+#define Expr_Check(op) PyObject_TypeCheck(op, &Py_Expr_Type)
-struct Py_stmt_Expr{
- struct Py_stmt _base;
+struct _Expr{
+ struct _stmt _base;
PyObject* value; /* expr */
};
-PyObject *Py_stmt_Expr_New(PyObject*, int);
+PyObject *Py_Expr_New(PyObject*, int);
+#define Expr Py_Expr_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Pass_Type;
-#define Py_stmt_Pass_Check(op) PyObject_TypeCheck(op, &Py_stmt_Pass_Type)
+PyAPI_DATA(PyTypeObject) Py_Pass_Type;
+#define Pass_Check(op) PyObject_TypeCheck(op, &Py_Pass_Type)
-struct Py_stmt_Pass{
- struct Py_stmt _base;
+struct _Pass{
+ struct _stmt _base;
};
-PyObject *Py_stmt_Pass_New(int);
+PyObject *Py_Pass_New(int);
+#define Pass Py_Pass_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Break_Type;
-#define Py_stmt_Break_Check(op) PyObject_TypeCheck(op, &Py_stmt_Break_Type)
+PyAPI_DATA(PyTypeObject) Py_Break_Type;
+#define Break_Check(op) PyObject_TypeCheck(op, &Py_Break_Type)
-struct Py_stmt_Break{
- struct Py_stmt _base;
+struct _Break{
+ struct _stmt _base;
};
-PyObject *Py_stmt_Break_New(int);
+PyObject *Py_Break_New(int);
+#define Break Py_Break_New
-PyAPI_DATA(PyTypeObject) Py_stmt_Continue_Type;
-#define Py_stmt_Continue_Check(op) PyObject_TypeCheck(op, &Py_stmt_Continue_Type)
+PyAPI_DATA(PyTypeObject) Py_Continue_Type;
+#define Continue_Check(op) PyObject_TypeCheck(op, &Py_Continue_Type)
-struct Py_stmt_Continue{
- struct Py_stmt _base;
+struct _Continue{
+ struct _stmt _base;
};
-PyObject *Py_stmt_Continue_New(int);
+PyObject *Py_Continue_New(int);
+#define Continue Py_Continue_New
PyAPI_DATA(PyTypeObject) Py_expr_Type;
-#define Py_expr_Check(op) PyObject_TypeCheck(op, &Py_expr_Type)
+#define expr_Check(op) PyObject_TypeCheck(op, &Py_expr_Type)
-struct Py_expr{
+struct _expr{
PyObject_HEAD
+ enum {BoolOp_kind, BinOp_kind, UnaryOp_kind, Lambda_kind, Dict_kind,
+ ListComp_kind, GeneratorExp_kind, Yield_kind, Compare_kind,
+ Call_kind, Repr_kind, Num_kind, Str_kind, Attribute_kind,
+ Subscript_kind, Name_kind, List_kind, Tuple_kind} _kind;
int lineno;
};
-PyAPI_DATA(PyTypeObject) Py_expr_BoolOp_Type;
-#define Py_expr_BoolOp_Check(op) PyObject_TypeCheck(op, &Py_expr_BoolOp_Type)
+PyAPI_DATA(PyTypeObject) Py_BoolOp_Type;
+#define BoolOp_Check(op) PyObject_TypeCheck(op, &Py_BoolOp_Type)
-struct Py_expr_BoolOp{
- struct Py_expr _base;
+struct _BoolOp{
+ struct _expr _base;
PyObject* op; /* boolop */
PyObject* values; /* expr */
};
-PyObject *Py_expr_BoolOp_New(PyObject*, PyObject*, int);
+PyObject *Py_BoolOp_New(PyObject*, PyObject*, int);
+#define BoolOp Py_BoolOp_New
-PyAPI_DATA(PyTypeObject) Py_expr_BinOp_Type;
-#define Py_expr_BinOp_Check(op) PyObject_TypeCheck(op, &Py_expr_BinOp_Type)
+PyAPI_DATA(PyTypeObject) Py_BinOp_Type;
+#define BinOp_Check(op) PyObject_TypeCheck(op, &Py_BinOp_Type)
-struct Py_expr_BinOp{
- struct Py_expr _base;
+struct _BinOp{
+ struct _expr _base;
PyObject* left; /* expr */
PyObject* op; /* operator */
PyObject* right; /* expr */
};
-PyObject *Py_expr_BinOp_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_BinOp_New(PyObject*, PyObject*, PyObject*, int);
+#define BinOp Py_BinOp_New
-PyAPI_DATA(PyTypeObject) Py_expr_UnaryOp_Type;
-#define Py_expr_UnaryOp_Check(op) PyObject_TypeCheck(op, &Py_expr_UnaryOp_Type)
+PyAPI_DATA(PyTypeObject) Py_UnaryOp_Type;
+#define UnaryOp_Check(op) PyObject_TypeCheck(op, &Py_UnaryOp_Type)
-struct Py_expr_UnaryOp{
- struct Py_expr _base;
+struct _UnaryOp{
+ struct _expr _base;
PyObject* op; /* unaryop */
PyObject* operand; /* expr */
};
-PyObject *Py_expr_UnaryOp_New(PyObject*, PyObject*, int);
+PyObject *Py_UnaryOp_New(PyObject*, PyObject*, int);
+#define UnaryOp Py_UnaryOp_New
-PyAPI_DATA(PyTypeObject) Py_expr_Lambda_Type;
-#define Py_expr_Lambda_Check(op) PyObject_TypeCheck(op, &Py_expr_Lambda_Type)
+PyAPI_DATA(PyTypeObject) Py_Lambda_Type;
+#define Lambda_Check(op) PyObject_TypeCheck(op, &Py_Lambda_Type)
-struct Py_expr_Lambda{
- struct Py_expr _base;
+struct _Lambda{
+ struct _expr _base;
PyObject* args; /* arguments */
PyObject* body; /* expr */
};
-PyObject *Py_expr_Lambda_New(PyObject*, PyObject*, int);
+PyObject *Py_Lambda_New(PyObject*, PyObject*, int);
+#define Lambda Py_Lambda_New
-PyAPI_DATA(PyTypeObject) Py_expr_Dict_Type;
-#define Py_expr_Dict_Check(op) PyObject_TypeCheck(op, &Py_expr_Dict_Type)
+PyAPI_DATA(PyTypeObject) Py_Dict_Type;
+#define Dict_Check(op) PyObject_TypeCheck(op, &Py_Dict_Type)
-struct Py_expr_Dict{
- struct Py_expr _base;
+struct _Dict{
+ struct _expr _base;
PyObject* keys; /* expr */
PyObject* values; /* expr */
};
-PyObject *Py_expr_Dict_New(PyObject*, PyObject*, int);
+PyObject *Py_Dict_New(PyObject*, PyObject*, int);
+#define Dict Py_Dict_New
-PyAPI_DATA(PyTypeObject) Py_expr_ListComp_Type;
-#define Py_expr_ListComp_Check(op) PyObject_TypeCheck(op, &Py_expr_ListComp_Type)
+PyAPI_DATA(PyTypeObject) Py_ListComp_Type;
+#define ListComp_Check(op) PyObject_TypeCheck(op, &Py_ListComp_Type)
-struct Py_expr_ListComp{
- struct Py_expr _base;
+struct _ListComp{
+ struct _expr _base;
PyObject* elt; /* expr */
PyObject* generators; /* comprehension */
};
-PyObject *Py_expr_ListComp_New(PyObject*, PyObject*, int);
+PyObject *Py_ListComp_New(PyObject*, PyObject*, int);
+#define ListComp Py_ListComp_New
-PyAPI_DATA(PyTypeObject) Py_expr_GeneratorExp_Type;
-#define Py_expr_GeneratorExp_Check(op) PyObject_TypeCheck(op, &Py_expr_GeneratorExp_Type)
+PyAPI_DATA(PyTypeObject) Py_GeneratorExp_Type;
+#define GeneratorExp_Check(op) PyObject_TypeCheck(op, &Py_GeneratorExp_Type)
-struct Py_expr_GeneratorExp{
- struct Py_expr _base;
+struct _GeneratorExp{
+ struct _expr _base;
PyObject* elt; /* expr */
PyObject* generators; /* comprehension */
};
-PyObject *Py_expr_GeneratorExp_New(PyObject*, PyObject*, int);
+PyObject *Py_GeneratorExp_New(PyObject*, PyObject*, int);
+#define GeneratorExp Py_GeneratorExp_New
-PyAPI_DATA(PyTypeObject) Py_expr_Yield_Type;
-#define Py_expr_Yield_Check(op) PyObject_TypeCheck(op, &Py_expr_Yield_Type)
+PyAPI_DATA(PyTypeObject) Py_Yield_Type;
+#define Yield_Check(op) PyObject_TypeCheck(op, &Py_Yield_Type)
-struct Py_expr_Yield{
- struct Py_expr _base;
+struct _Yield{
+ struct _expr _base;
PyObject* value; /* expr */
};
-PyObject *Py_expr_Yield_New(PyObject*, int);
+PyObject *Py_Yield_New(PyObject*, int);
+#define Yield Py_Yield_New
-PyAPI_DATA(PyTypeObject) Py_expr_Compare_Type;
-#define Py_expr_Compare_Check(op) PyObject_TypeCheck(op, &Py_expr_Compare_Type)
+PyAPI_DATA(PyTypeObject) Py_Compare_Type;
+#define Compare_Check(op) PyObject_TypeCheck(op, &Py_Compare_Type)
-struct Py_expr_Compare{
- struct Py_expr _base;
+struct _Compare{
+ struct _expr _base;
PyObject* left; /* expr */
PyObject* ops; /* cmpop */
PyObject* comparators; /* expr */
};
-PyObject *Py_expr_Compare_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_Compare_New(PyObject*, PyObject*, PyObject*, int);
+#define Compare Py_Compare_New
-PyAPI_DATA(PyTypeObject) Py_expr_Call_Type;
-#define Py_expr_Call_Check(op) PyObject_TypeCheck(op, &Py_expr_Call_Type)
+PyAPI_DATA(PyTypeObject) Py_Call_Type;
+#define Call_Check(op) PyObject_TypeCheck(op, &Py_Call_Type)
-struct Py_expr_Call{
- struct Py_expr _base;
+struct _Call{
+ struct _expr _base;
PyObject* func; /* expr */
PyObject* args; /* expr */
PyObject* keywords; /* keyword */
PyObject* starargs; /* expr */
PyObject* kwargs; /* expr */
};
-PyObject *Py_expr_Call_New(PyObject*, PyObject*, PyObject*, PyObject*,
- PyObject*, int);
+PyObject *Py_Call_New(PyObject*, PyObject*, PyObject*, PyObject*, PyObject*,
+ int);
+#define Call Py_Call_New
-PyAPI_DATA(PyTypeObject) Py_expr_Repr_Type;
-#define Py_expr_Repr_Check(op) PyObject_TypeCheck(op, &Py_expr_Repr_Type)
+PyAPI_DATA(PyTypeObject) Py_Repr_Type;
+#define Repr_Check(op) PyObject_TypeCheck(op, &Py_Repr_Type)
-struct Py_expr_Repr{
- struct Py_expr _base;
+struct _Repr{
+ struct _expr _base;
PyObject* value; /* expr */
};
-PyObject *Py_expr_Repr_New(PyObject*, int);
+PyObject *Py_Repr_New(PyObject*, int);
+#define Repr Py_Repr_New
-PyAPI_DATA(PyTypeObject) Py_expr_Num_Type;
-#define Py_expr_Num_Check(op) PyObject_TypeCheck(op, &Py_expr_Num_Type)
+PyAPI_DATA(PyTypeObject) Py_Num_Type;
+#define Num_Check(op) PyObject_TypeCheck(op, &Py_Num_Type)
-struct Py_expr_Num{
- struct Py_expr _base;
+struct _Num{
+ struct _expr _base;
PyObject* n; /* object */
};
-PyObject *Py_expr_Num_New(PyObject*, int);
+PyObject *Py_Num_New(PyObject*, int);
+#define Num Py_Num_New
-PyAPI_DATA(PyTypeObject) Py_expr_Str_Type;
-#define Py_expr_Str_Check(op) PyObject_TypeCheck(op, &Py_expr_Str_Type)
+PyAPI_DATA(PyTypeObject) Py_Str_Type;
+#define Str_Check(op) PyObject_TypeCheck(op, &Py_Str_Type)
-struct Py_expr_Str{
- struct Py_expr _base;
+struct _Str{
+ struct _expr _base;
PyObject* s; /* string */
};
-PyObject *Py_expr_Str_New(PyObject*, int);
+PyObject *Py_Str_New(PyObject*, int);
+#define Str Py_Str_New
-PyAPI_DATA(PyTypeObject) Py_expr_Attribute_Type;
-#define Py_expr_Attribute_Check(op) PyObject_TypeCheck(op, &Py_expr_Attribute_Type)
+PyAPI_DATA(PyTypeObject) Py_Attribute_Type;
+#define Attribute_Check(op) PyObject_TypeCheck(op, &Py_Attribute_Type)
-struct Py_expr_Attribute{
- struct Py_expr _base;
+struct _Attribute{
+ struct _expr _base;
PyObject* value; /* expr */
PyObject* attr; /* identifier */
PyObject* ctx; /* expr_context */
};
-PyObject *Py_expr_Attribute_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_Attribute_New(PyObject*, PyObject*, PyObject*, int);
+#define Attribute Py_Attribute_New
-PyAPI_DATA(PyTypeObject) Py_expr_Subscript_Type;
-#define Py_expr_Subscript_Check(op) PyObject_TypeCheck(op, &Py_expr_Subscript_Type)
+PyAPI_DATA(PyTypeObject) Py_Subscript_Type;
+#define Subscript_Check(op) PyObject_TypeCheck(op, &Py_Subscript_Type)
-struct Py_expr_Subscript{
- struct Py_expr _base;
+struct _Subscript{
+ struct _expr _base;
PyObject* value; /* expr */
PyObject* slice; /* slice */
PyObject* ctx; /* expr_context */
};
-PyObject *Py_expr_Subscript_New(PyObject*, PyObject*, PyObject*, int);
+PyObject *Py_Subscript_New(PyObject*, PyObject*, PyObject*, int);
+#define Subscript Py_Subscript_New
-PyAPI_DATA(PyTypeObject) Py_expr_Name_Type;
-#define Py_expr_Name_Check(op) PyObject_TypeCheck(op, &Py_expr_Name_Type)
+PyAPI_DATA(PyTypeObject) Py_Name_Type;
+#define Name_Check(op) PyObject_TypeCheck(op, &Py_Name_Type)
-struct Py_expr_Name{
- struct Py_expr _base;
+struct _Name{
+ struct _expr _base;
PyObject* id; /* identifier */
PyObject* ctx; /* expr_context */
};
-PyObject *Py_expr_Name_New(PyObject*, PyObject*, int);
+PyObject *Py_Name_New(PyObject*, PyObject*, int);
+#define Name Py_Name_New
-PyAPI_DATA(PyTypeObject) Py_expr_List_Type;
-#define Py_expr_List_Check(op) PyObject_TypeCheck(op, &Py_expr_List_Type)
+PyAPI_DATA(PyTypeObject) Py_List_Type;
+#define List_Check(op) PyObject_TypeCheck(op, &Py_List_Type)
-struct Py_expr_List{
- struct Py_expr _base;
+struct _List{
+ struct _expr _base;
PyObject* elts; /* expr */
PyObject* ctx; /* expr_context */
};
-PyObject *Py_expr_List_New(PyObject*, PyObject*, int);
+PyObject *Py_List_New(PyObject*, PyObject*, int);
+#define List Py_List_New
-PyAPI_DATA(PyTypeObject) Py_expr_Tuple_Type;
-#define Py_expr_Tuple_Check(op) PyObject_TypeCheck(op, &Py_expr_Tuple_Type)
+PyAPI_DATA(PyTypeObject) Py_Tuple_Type;
+#define Tuple_Check(op) PyObject_TypeCheck(op, &Py_Tuple_Type)
-struct Py_expr_Tuple{
- struct Py_expr _base;
+struct _Tuple{
+ struct _expr _base;
PyObject* elts; /* expr */
PyObject* ctx; /* expr_context */
};
-PyObject *Py_expr_Tuple_New(PyObject*, PyObject*, int);
+PyObject *Py_Tuple_New(PyObject*, PyObject*, int);
+#define Tuple Py_Tuple_New
PyAPI_DATA(PyTypeObject) Py_slice_Type;
-#define Py_slice_Check(op) PyObject_TypeCheck(op, &Py_slice_Type)
+#define slice_Check(op) PyObject_TypeCheck(op, &Py_slice_Type)
-struct Py_slice{
+struct _slice{
PyObject_HEAD
+ enum {Ellipsis_kind, Slice_kind, ExtSlice_kind, Index_kind} _kind;
};
-PyAPI_DATA(PyTypeObject) Py_slice_Ellipsis_Type;
-#define Py_slice_Ellipsis_Check(op) PyObject_TypeCheck(op, &Py_slice_Ellipsis_Type)
+PyAPI_DATA(PyTypeObject) Py_Ellipsis_Type;
+#define Ellipsis_Check(op) PyObject_TypeCheck(op, &Py_Ellipsis_Type)
-struct Py_slice_Ellipsis{
- struct Py_slice _base;
+struct _Ellipsis{
+ struct _slice _base;
};
-PyObject *Py_slice_Ellipsis_New(void);
+PyObject *Py_Ellipsis_New(void);
+#define Ellipsis Py_Ellipsis_New
-PyAPI_DATA(PyTypeObject) Py_slice_Slice_Type;
-#define Py_slice_Slice_Check(op) PyObject_TypeCheck(op, &Py_slice_Slice_Type)
+PyAPI_DATA(PyTypeObject) Py_Slice_Type;
+#define Slice_Check(op) PyObject_TypeCheck(op, &Py_Slice_Type)
-struct Py_slice_Slice{
- struct Py_slice _base;
+struct _Slice{
+ struct _slice _base;
PyObject* lower; /* expr */
PyObject* upper; /* expr */
PyObject* step; /* expr */
};
-PyObject *Py_slice_Slice_New(PyObject*, PyObject*, PyObject*);
+PyObject *Py_Slice_New(PyObject*, PyObject*, PyObject*);
+#define Slice Py_Slice_New
-PyAPI_DATA(PyTypeObject) Py_slice_ExtSlice_Type;
-#define Py_slice_ExtSlice_Check(op) PyObject_TypeCheck(op, &Py_slice_ExtSlice_Type)
+PyAPI_DATA(PyTypeObject) Py_ExtSlice_Type;
+#define ExtSlice_Check(op) PyObject_TypeCheck(op, &Py_ExtSlice_Type)
-struct Py_slice_ExtSlice{
- struct Py_slice _base;
+struct _ExtSlice{
+ struct _slice _base;
PyObject* dims; /* slice */
};
-PyObject *Py_slice_ExtSlice_New(PyObject*);
+PyObject *Py_ExtSlice_New(PyObject*);
+#define ExtSlice Py_ExtSlice_New
-PyAPI_DATA(PyTypeObject) Py_slice_Index_Type;
-#define Py_slice_Index_Check(op) PyObject_TypeCheck(op, &Py_slice_Index_Type)
+PyAPI_DATA(PyTypeObject) Py_Index_Type;
+#define Index_Check(op) PyObject_TypeCheck(op, &Py_Index_Type)
-struct Py_slice_Index{
- struct Py_slice _base;
+struct _Index{
+ struct _slice _base;
PyObject* value; /* expr */
};
-PyObject *Py_slice_Index_New(PyObject*);
+PyObject *Py_Index_New(PyObject*);
+#define Index Py_Index_New
PyAPI_DATA(PyTypeObject) Py_comprehension_Type;
-#define Py_comprehension_Check(op) PyObject_TypeCheck(op, &Py_comprehension_Type)
+#define comprehension_Check(op) PyObject_TypeCheck(op, &Py_comprehension_Type)
-struct Py_comprehension {
+struct _comprehension {
PyObject_HEAD
PyObject* target; /* expr */
PyObject* iter; /* expr */
@@ -521,9 +584,9 @@
PyObject *Py_comprehension_New(PyObject*, PyObject*, PyObject*);
PyAPI_DATA(PyTypeObject) Py_excepthandler_Type;
-#define Py_excepthandler_Check(op) PyObject_TypeCheck(op, &Py_excepthandler_Type)
+#define excepthandler_Check(op) PyObject_TypeCheck(op, &Py_excepthandler_Type)
-struct Py_excepthandler {
+struct _excepthandler {
PyObject_HEAD
PyObject* type; /* expr */
PyObject* name; /* expr */
@@ -532,9 +595,9 @@
PyObject *Py_excepthandler_New(PyObject*, PyObject*, PyObject*);
PyAPI_DATA(PyTypeObject) Py_arguments_Type;
-#define Py_arguments_Check(op) PyObject_TypeCheck(op, &Py_arguments_Type)
+#define arguments_Check(op) PyObject_TypeCheck(op, &Py_arguments_Type)
-struct Py_arguments {
+struct _arguments {
PyObject_HEAD
PyObject* args; /* expr */
PyObject* vararg; /* identifier */
@@ -544,9 +607,9 @@
PyObject *Py_arguments_New(PyObject*, PyObject*, PyObject*, PyObject*);
PyAPI_DATA(PyTypeObject) Py_keyword_Type;
-#define Py_keyword_Check(op) PyObject_TypeCheck(op, &Py_keyword_Type)
+#define keyword_Check(op) PyObject_TypeCheck(op, &Py_keyword_Type)
-struct Py_keyword {
+struct _keyword {
PyObject_HEAD
PyObject* arg; /* identifier */
PyObject* value; /* expr */
@@ -554,9 +617,9 @@
PyObject *Py_keyword_New(PyObject*, PyObject*);
PyAPI_DATA(PyTypeObject) Py_alias_Type;
-#define Py_alias_Check(op) PyObject_TypeCheck(op, &Py_alias_Type)
+#define alias_Check(op) PyObject_TypeCheck(op, &Py_alias_Type)
-struct Py_alias {
+struct _alias {
PyObject_HEAD
PyObject* name; /* identifier */
PyObject* asname; /* identifier */
Modified: python/branches/ast-objects/Parser/asdl_c.py
==============================================================================
--- python/branches/ast-objects/Parser/asdl_c.py (original)
+++ python/branches/ast-objects/Parser/asdl_c.py Wed Nov 30 20:40:40 2005
@@ -132,7 +132,7 @@
def emit_check(self, t, depth):
self.emit("PyAPI_DATA(PyTypeObject) Py_%s_Type;" % t, depth)
- self.emit("#define Py_%s_Check(op) PyObject_TypeCheck(op, &Py_%s_Type)" % (t, t),
+ self.emit("#define %s_Check(op) PyObject_TypeCheck(op, &Py_%s_Type)" % (t, t),
depth, reflow=False)
self.emit("",depth)
@@ -151,8 +151,10 @@
def emit(s, depth=depth):
self.emit(s % sys._getframe(1).f_locals, depth)
self.emit_check(name, depth)
- emit("struct Py_%s{" % name)
+ emit("struct _%s{" % name)
emit("PyObject_HEAD", depth + 1)
+ names = [t.name.value+"_kind" for t in sum.types]
+ emit("enum {%s} _kind;" % ", ".join(names), depth+1)
for field in sum.attributes:
type = str(field.type)
assert type in asdl.builtin_types, type
@@ -163,18 +165,20 @@
self.visitConstructor(name, t, sum.attributes, depth)
def visitConstructor(self, name, cons, attrs, depth):
- self.emit_check("%s_%s" % (name, cons.name), depth)
- self.emit("struct Py_%s_%s{" % (name, cons.name), depth)
- self.emit("struct Py_%s _base;" % name, depth+1)
+ self.emit_check(cons.name, depth)
+ self.emit("struct _%s{" % cons.name, depth)
+ self.emit("struct _%s _base;" % name, depth+1)
field_types = []
for f in cons.fields:
field_types.append(get_c_type(f.type))
self.visit(f, depth + 1)
for f in attrs:
field_types.append(get_c_type(f.type))
- self.emit("};" % cons.name, depth)
+ self.emit("};", depth)
args = ", ".join(field_types) or "void"
- self.emit("PyObject *Py_%s_%s_New(%s);" % (name, cons.name, args), depth)
+ self.emit("PyObject *Py_%s_New(%s);" % (cons.name, args), depth)
+ # for convenience
+ self.emit("#define %s Py_%s_New" % (cons.name, cons.name), depth)
self.emit("", depth)
def visitField(self, field, depth):
@@ -183,7 +187,7 @@
def visitProduct(self, product, name, depth):
self.emit_check(str(name), depth)
- self.emit("struct Py_%(name)s {" % locals(), depth)
+ self.emit("struct _%(name)s {" % locals(), depth)
self.emit("PyObject_HEAD", depth+1)
field_types = []
for f in product.fields:
@@ -205,7 +209,7 @@
emit("PyObject*")
emit("Py_%s_New(%s)" % (name, argstr))
emit("{")
- emit("struct Py_%s *result = PyObject_New(struct Py_%s, &Py_%s_Type);" % (name, name, name), 1, 0)
+ emit("struct _%s *result = PyObject_New(struct _%s, &Py_%s_Type);" % (name, name, name), 1, 0)
emit("if (result == NULL)", 1)
emit("return NULL;", 2)
for argtype, argname, opt in args:
@@ -222,7 +226,7 @@
emit("static void")
emit("%s_dealloc(PyObject* _self)" % name)
emit("{")
- emit("struct Py_%s *self = (struct Py_%s*)_self;" % (name, name), 1)
+ emit("struct _%s *self = (struct _%s*)_self;" % (name, name), 1)
for argtype, argname, opt in fields:
if argtype == "PyObject*":
emit("Py_DECREF(self->%s);" % argname, 1)
@@ -244,7 +248,7 @@
emit("PyObject_HEAD_INIT(NULL)")
emit("0,\t\t/*ob_size*/")
emit('"%s",\t\t/*tp_name*/' % name)
- emit("sizeof(struct Py_%s),\t/*tp_basicsize*/" % name)
+ emit("sizeof(struct _%s),\t/*tp_basicsize*/" % name)
null("itemsize")
emit("%s_dealloc,\t\t/*tp_dealloc*/" % name)
null("print")
@@ -262,6 +266,7 @@
"dict", "descr_get", "descr_set", "dictoffset",
"init", "alloc", "new", "free", "is_gc"):
null(m)
+ depth = 0
emit("};")
emit("")
@@ -281,12 +286,11 @@
self.emit_type(str(name))
def visitConstructor(self, cons, name, attrs):
- name = "%s_%s" % (name, cons.name)
args = self.get_args(cons.fields)
attrs = self.get_args(attrs)
- self.emit_ctor(name, args, attrs)
- self.emit_dealloc(name, args, attrs)
- self.emit_type(name)
+ self.emit_ctor(cons.name, args, attrs)
+ self.emit_dealloc(cons.name, args, attrs)
+ self.emit_type(cons.name)
class InitVisitor(TraversalVisitor):
def visitModule(self, mod):
@@ -308,7 +312,7 @@
self.emit_init(name)
def visitConstructor(self, cons, name, attrs):
- self.emit_init("%s_%s" % (name, cons.name), name)
+ self.emit_init(cons.name, name)
def emit_init(self, name, base = None):
if base:
@@ -336,6 +340,10 @@
p = "%s-ast.h" % mod.name
f = open(p, "wb")
print >> f, auto_gen_msg
+ print >> f, "/* For convenience, this header provides several"
+ print >> f, " macro, type and constant names which are not Py_-prefixed."
+ print >> f, " Therefore, the file should not be included in Python.h;"
+ print >> f, " all symbols relevant to linkage are Py_-prefixed. */"
c = HeaderVisitor(f)
c.visit(mod)
f.close()
Modified: python/branches/ast-objects/Python/Python-ast.c
==============================================================================
--- python/branches/ast-objects/Python/Python-ast.c (original)
+++ python/branches/ast-objects/Python/Python-ast.c Wed Nov 30 20:40:40 2005
@@ -8,7 +8,7 @@
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"mod", /*tp_name*/
- sizeof(struct Py_mod), /*tp_basicsize*/
+ sizeof(struct _mod), /*tp_basicsize*/
0, /* tp_itemsize */
mod_dealloc, /*tp_dealloc*/
0, /* tp_print */
@@ -46,12 +46,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_mod_Module_New(PyObject* body)
+Py_Module_New(PyObject* body)
{
- struct Py_mod_Module *result = PyObject_New(struct Py_mod_Module, &Py_mod_Module_Type);
+ struct _Module *result = PyObject_New(struct _Module, &Py_Module_Type);
if (result == NULL)
return NULL;
result->body = body;
@@ -59,20 +59,20 @@
}
static void
-mod_Module_dealloc(PyObject* _self)
+Module_dealloc(PyObject* _self)
{
- struct Py_mod_Module *self = (struct Py_mod_Module*)_self;
+ struct _Module *self = (struct _Module*)_self;
Py_DECREF(self->body);
PyObject_Del(self);
}
-PyTypeObject Py_mod_Module_Type = {
+PyTypeObject Py_Module_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "mod_Module", /*tp_name*/
- sizeof(struct Py_mod_Module), /*tp_basicsize*/
+ "Module", /*tp_name*/
+ sizeof(struct _Module), /*tp_basicsize*/
0, /* tp_itemsize */
- mod_Module_dealloc, /*tp_dealloc*/
+ Module_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -108,12 +108,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_mod_Interactive_New(PyObject* body)
+Py_Interactive_New(PyObject* body)
{
- struct Py_mod_Interactive *result = PyObject_New(struct Py_mod_Interactive, &Py_mod_Interactive_Type);
+ struct _Interactive *result = PyObject_New(struct _Interactive, &Py_Interactive_Type);
if (result == NULL)
return NULL;
result->body = body;
@@ -121,20 +121,20 @@
}
static void
-mod_Interactive_dealloc(PyObject* _self)
+Interactive_dealloc(PyObject* _self)
{
- struct Py_mod_Interactive *self = (struct Py_mod_Interactive*)_self;
+ struct _Interactive *self = (struct _Interactive*)_self;
Py_DECREF(self->body);
PyObject_Del(self);
}
-PyTypeObject Py_mod_Interactive_Type = {
+PyTypeObject Py_Interactive_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "mod_Interactive", /*tp_name*/
- sizeof(struct Py_mod_Interactive), /*tp_basicsize*/
+ "Interactive", /*tp_name*/
+ sizeof(struct _Interactive), /*tp_basicsize*/
0, /* tp_itemsize */
- mod_Interactive_dealloc, /*tp_dealloc*/
+ Interactive_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -170,12 +170,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_mod_Expression_New(PyObject* body)
+Py_Expression_New(PyObject* body)
{
- struct Py_mod_Expression *result = PyObject_New(struct Py_mod_Expression, &Py_mod_Expression_Type);
+ struct _Expression *result = PyObject_New(struct _Expression, &Py_Expression_Type);
if (result == NULL)
return NULL;
result->body = body;
@@ -183,20 +183,20 @@
}
static void
-mod_Expression_dealloc(PyObject* _self)
+Expression_dealloc(PyObject* _self)
{
- struct Py_mod_Expression *self = (struct Py_mod_Expression*)_self;
+ struct _Expression *self = (struct _Expression*)_self;
Py_DECREF(self->body);
PyObject_Del(self);
}
-PyTypeObject Py_mod_Expression_Type = {
+PyTypeObject Py_Expression_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "mod_Expression", /*tp_name*/
- sizeof(struct Py_mod_Expression), /*tp_basicsize*/
+ "Expression", /*tp_name*/
+ sizeof(struct _Expression), /*tp_basicsize*/
0, /* tp_itemsize */
- mod_Expression_dealloc, /*tp_dealloc*/
+ Expression_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -232,12 +232,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_mod_Suite_New(PyObject* body)
+Py_Suite_New(PyObject* body)
{
- struct Py_mod_Suite *result = PyObject_New(struct Py_mod_Suite, &Py_mod_Suite_Type);
+ struct _Suite *result = PyObject_New(struct _Suite, &Py_Suite_Type);
if (result == NULL)
return NULL;
result->body = body;
@@ -245,20 +245,20 @@
}
static void
-mod_Suite_dealloc(PyObject* _self)
+Suite_dealloc(PyObject* _self)
{
- struct Py_mod_Suite *self = (struct Py_mod_Suite*)_self;
+ struct _Suite *self = (struct _Suite*)_self;
Py_DECREF(self->body);
PyObject_Del(self);
}
-PyTypeObject Py_mod_Suite_Type = {
+PyTypeObject Py_Suite_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "mod_Suite", /*tp_name*/
- sizeof(struct Py_mod_Suite), /*tp_basicsize*/
+ "Suite", /*tp_name*/
+ sizeof(struct _Suite), /*tp_basicsize*/
0, /* tp_itemsize */
- mod_Suite_dealloc, /*tp_dealloc*/
+ Suite_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -294,14 +294,14 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
#define stmt_dealloc 0
PyTypeObject Py_stmt_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"stmt", /*tp_name*/
- sizeof(struct Py_stmt), /*tp_basicsize*/
+ sizeof(struct _stmt), /*tp_basicsize*/
0, /* tp_itemsize */
stmt_dealloc, /*tp_dealloc*/
0, /* tp_print */
@@ -339,13 +339,13 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_FunctionDef_New(PyObject* name, PyObject* args, PyObject* body,
- PyObject* decorators, int lineno)
+Py_FunctionDef_New(PyObject* name, PyObject* args, PyObject* body, PyObject*
+ decorators, int lineno)
{
- struct Py_stmt_FunctionDef *result = PyObject_New(struct Py_stmt_FunctionDef, &Py_stmt_FunctionDef_Type);
+ struct _FunctionDef *result = PyObject_New(struct _FunctionDef, &Py_FunctionDef_Type);
if (result == NULL)
return NULL;
result->name = name;
@@ -357,9 +357,9 @@
}
static void
-stmt_FunctionDef_dealloc(PyObject* _self)
+FunctionDef_dealloc(PyObject* _self)
{
- struct Py_stmt_FunctionDef *self = (struct Py_stmt_FunctionDef*)_self;
+ struct _FunctionDef *self = (struct _FunctionDef*)_self;
Py_DECREF(self->name);
Py_DECREF(self->args);
Py_DECREF(self->body);
@@ -367,13 +367,13 @@
PyObject_Del(self);
}
-PyTypeObject Py_stmt_FunctionDef_Type = {
+PyTypeObject Py_FunctionDef_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_FunctionDef", /*tp_name*/
- sizeof(struct Py_stmt_FunctionDef), /*tp_basicsize*/
+ "FunctionDef", /*tp_name*/
+ sizeof(struct _FunctionDef), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_FunctionDef_dealloc, /*tp_dealloc*/
+ FunctionDef_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -409,13 +409,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_ClassDef_New(PyObject* name, PyObject* bases, PyObject* body, int
- lineno)
+Py_ClassDef_New(PyObject* name, PyObject* bases, PyObject* body, int lineno)
{
- struct Py_stmt_ClassDef *result = PyObject_New(struct Py_stmt_ClassDef, &Py_stmt_ClassDef_Type);
+ struct _ClassDef *result = PyObject_New(struct _ClassDef, &Py_ClassDef_Type);
if (result == NULL)
return NULL;
result->name = name;
@@ -426,22 +425,22 @@
}
static void
-stmt_ClassDef_dealloc(PyObject* _self)
+ClassDef_dealloc(PyObject* _self)
{
- struct Py_stmt_ClassDef *self = (struct Py_stmt_ClassDef*)_self;
+ struct _ClassDef *self = (struct _ClassDef*)_self;
Py_DECREF(self->name);
Py_DECREF(self->bases);
Py_DECREF(self->body);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_ClassDef_Type = {
+PyTypeObject Py_ClassDef_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_ClassDef", /*tp_name*/
- sizeof(struct Py_stmt_ClassDef), /*tp_basicsize*/
+ "ClassDef", /*tp_name*/
+ sizeof(struct _ClassDef), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_ClassDef_dealloc, /*tp_dealloc*/
+ ClassDef_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -477,12 +476,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Return_New(PyObject* value, int lineno)
+Py_Return_New(PyObject* value, int lineno)
{
- struct Py_stmt_Return *result = PyObject_New(struct Py_stmt_Return, &Py_stmt_Return_Type);
+ struct _Return *result = PyObject_New(struct _Return, &Py_Return_Type);
if (result == NULL)
return NULL;
result->value = value;
@@ -491,20 +490,20 @@
}
static void
-stmt_Return_dealloc(PyObject* _self)
+Return_dealloc(PyObject* _self)
{
- struct Py_stmt_Return *self = (struct Py_stmt_Return*)_self;
+ struct _Return *self = (struct _Return*)_self;
Py_DECREF(self->value);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Return_Type = {
+PyTypeObject Py_Return_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Return", /*tp_name*/
- sizeof(struct Py_stmt_Return), /*tp_basicsize*/
+ "Return", /*tp_name*/
+ sizeof(struct _Return), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Return_dealloc, /*tp_dealloc*/
+ Return_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -540,12 +539,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Delete_New(PyObject* targets, int lineno)
+Py_Delete_New(PyObject* targets, int lineno)
{
- struct Py_stmt_Delete *result = PyObject_New(struct Py_stmt_Delete, &Py_stmt_Delete_Type);
+ struct _Delete *result = PyObject_New(struct _Delete, &Py_Delete_Type);
if (result == NULL)
return NULL;
result->targets = targets;
@@ -554,20 +553,20 @@
}
static void
-stmt_Delete_dealloc(PyObject* _self)
+Delete_dealloc(PyObject* _self)
{
- struct Py_stmt_Delete *self = (struct Py_stmt_Delete*)_self;
+ struct _Delete *self = (struct _Delete*)_self;
Py_DECREF(self->targets);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Delete_Type = {
+PyTypeObject Py_Delete_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Delete", /*tp_name*/
- sizeof(struct Py_stmt_Delete), /*tp_basicsize*/
+ "Delete", /*tp_name*/
+ sizeof(struct _Delete), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Delete_dealloc, /*tp_dealloc*/
+ Delete_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -603,12 +602,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Assign_New(PyObject* targets, PyObject* value, int lineno)
+Py_Assign_New(PyObject* targets, PyObject* value, int lineno)
{
- struct Py_stmt_Assign *result = PyObject_New(struct Py_stmt_Assign, &Py_stmt_Assign_Type);
+ struct _Assign *result = PyObject_New(struct _Assign, &Py_Assign_Type);
if (result == NULL)
return NULL;
result->targets = targets;
@@ -618,21 +617,21 @@
}
static void
-stmt_Assign_dealloc(PyObject* _self)
+Assign_dealloc(PyObject* _self)
{
- struct Py_stmt_Assign *self = (struct Py_stmt_Assign*)_self;
+ struct _Assign *self = (struct _Assign*)_self;
Py_DECREF(self->targets);
Py_DECREF(self->value);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Assign_Type = {
+PyTypeObject Py_Assign_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Assign", /*tp_name*/
- sizeof(struct Py_stmt_Assign), /*tp_basicsize*/
+ "Assign", /*tp_name*/
+ sizeof(struct _Assign), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Assign_dealloc, /*tp_dealloc*/
+ Assign_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -668,13 +667,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_AugAssign_New(PyObject* target, PyObject* op, PyObject* value, int
- lineno)
+Py_AugAssign_New(PyObject* target, PyObject* op, PyObject* value, int lineno)
{
- struct Py_stmt_AugAssign *result = PyObject_New(struct Py_stmt_AugAssign, &Py_stmt_AugAssign_Type);
+ struct _AugAssign *result = PyObject_New(struct _AugAssign, &Py_AugAssign_Type);
if (result == NULL)
return NULL;
result->target = target;
@@ -685,22 +683,22 @@
}
static void
-stmt_AugAssign_dealloc(PyObject* _self)
+AugAssign_dealloc(PyObject* _self)
{
- struct Py_stmt_AugAssign *self = (struct Py_stmt_AugAssign*)_self;
+ struct _AugAssign *self = (struct _AugAssign*)_self;
Py_DECREF(self->target);
Py_DECREF(self->op);
Py_DECREF(self->value);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_AugAssign_Type = {
+PyTypeObject Py_AugAssign_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_AugAssign", /*tp_name*/
- sizeof(struct Py_stmt_AugAssign), /*tp_basicsize*/
+ "AugAssign", /*tp_name*/
+ sizeof(struct _AugAssign), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_AugAssign_dealloc, /*tp_dealloc*/
+ AugAssign_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -736,12 +734,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Print_New(PyObject* dest, PyObject* values, PyObject* nl, int lineno)
+Py_Print_New(PyObject* dest, PyObject* values, PyObject* nl, int lineno)
{
- struct Py_stmt_Print *result = PyObject_New(struct Py_stmt_Print, &Py_stmt_Print_Type);
+ struct _Print *result = PyObject_New(struct _Print, &Py_Print_Type);
if (result == NULL)
return NULL;
result->dest = dest;
@@ -752,22 +750,22 @@
}
static void
-stmt_Print_dealloc(PyObject* _self)
+Print_dealloc(PyObject* _self)
{
- struct Py_stmt_Print *self = (struct Py_stmt_Print*)_self;
+ struct _Print *self = (struct _Print*)_self;
Py_DECREF(self->dest);
Py_DECREF(self->values);
Py_DECREF(self->nl);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Print_Type = {
+PyTypeObject Py_Print_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Print", /*tp_name*/
- sizeof(struct Py_stmt_Print), /*tp_basicsize*/
+ "Print", /*tp_name*/
+ sizeof(struct _Print), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Print_dealloc, /*tp_dealloc*/
+ Print_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -803,13 +801,13 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_For_New(PyObject* target, PyObject* iter, PyObject* body, PyObject*
- orelse, int lineno)
+Py_For_New(PyObject* target, PyObject* iter, PyObject* body, PyObject* orelse,
+ int lineno)
{
- struct Py_stmt_For *result = PyObject_New(struct Py_stmt_For, &Py_stmt_For_Type);
+ struct _For *result = PyObject_New(struct _For, &Py_For_Type);
if (result == NULL)
return NULL;
result->target = target;
@@ -821,9 +819,9 @@
}
static void
-stmt_For_dealloc(PyObject* _self)
+For_dealloc(PyObject* _self)
{
- struct Py_stmt_For *self = (struct Py_stmt_For*)_self;
+ struct _For *self = (struct _For*)_self;
Py_DECREF(self->target);
Py_DECREF(self->iter);
Py_DECREF(self->body);
@@ -831,13 +829,13 @@
PyObject_Del(self);
}
-PyTypeObject Py_stmt_For_Type = {
+PyTypeObject Py_For_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_For", /*tp_name*/
- sizeof(struct Py_stmt_For), /*tp_basicsize*/
+ "For", /*tp_name*/
+ sizeof(struct _For), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_For_dealloc, /*tp_dealloc*/
+ For_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -873,12 +871,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_While_New(PyObject* test, PyObject* body, PyObject* orelse, int lineno)
+Py_While_New(PyObject* test, PyObject* body, PyObject* orelse, int lineno)
{
- struct Py_stmt_While *result = PyObject_New(struct Py_stmt_While, &Py_stmt_While_Type);
+ struct _While *result = PyObject_New(struct _While, &Py_While_Type);
if (result == NULL)
return NULL;
result->test = test;
@@ -889,22 +887,22 @@
}
static void
-stmt_While_dealloc(PyObject* _self)
+While_dealloc(PyObject* _self)
{
- struct Py_stmt_While *self = (struct Py_stmt_While*)_self;
+ struct _While *self = (struct _While*)_self;
Py_DECREF(self->test);
Py_DECREF(self->body);
Py_DECREF(self->orelse);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_While_Type = {
+PyTypeObject Py_While_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_While", /*tp_name*/
- sizeof(struct Py_stmt_While), /*tp_basicsize*/
+ "While", /*tp_name*/
+ sizeof(struct _While), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_While_dealloc, /*tp_dealloc*/
+ While_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -940,12 +938,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_If_New(PyObject* test, PyObject* body, PyObject* orelse, int lineno)
+Py_If_New(PyObject* test, PyObject* body, PyObject* orelse, int lineno)
{
- struct Py_stmt_If *result = PyObject_New(struct Py_stmt_If, &Py_stmt_If_Type);
+ struct _If *result = PyObject_New(struct _If, &Py_If_Type);
if (result == NULL)
return NULL;
result->test = test;
@@ -956,22 +954,22 @@
}
static void
-stmt_If_dealloc(PyObject* _self)
+If_dealloc(PyObject* _self)
{
- struct Py_stmt_If *self = (struct Py_stmt_If*)_self;
+ struct _If *self = (struct _If*)_self;
Py_DECREF(self->test);
Py_DECREF(self->body);
Py_DECREF(self->orelse);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_If_Type = {
+PyTypeObject Py_If_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_If", /*tp_name*/
- sizeof(struct Py_stmt_If), /*tp_basicsize*/
+ "If", /*tp_name*/
+ sizeof(struct _If), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_If_dealloc, /*tp_dealloc*/
+ If_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1007,12 +1005,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Raise_New(PyObject* type, PyObject* inst, PyObject* tback, int lineno)
+Py_Raise_New(PyObject* type, PyObject* inst, PyObject* tback, int lineno)
{
- struct Py_stmt_Raise *result = PyObject_New(struct Py_stmt_Raise, &Py_stmt_Raise_Type);
+ struct _Raise *result = PyObject_New(struct _Raise, &Py_Raise_Type);
if (result == NULL)
return NULL;
result->type = type;
@@ -1023,22 +1021,22 @@
}
static void
-stmt_Raise_dealloc(PyObject* _self)
+Raise_dealloc(PyObject* _self)
{
- struct Py_stmt_Raise *self = (struct Py_stmt_Raise*)_self;
+ struct _Raise *self = (struct _Raise*)_self;
Py_DECREF(self->type);
Py_DECREF(self->inst);
Py_DECREF(self->tback);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Raise_Type = {
+PyTypeObject Py_Raise_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Raise", /*tp_name*/
- sizeof(struct Py_stmt_Raise), /*tp_basicsize*/
+ "Raise", /*tp_name*/
+ sizeof(struct _Raise), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Raise_dealloc, /*tp_dealloc*/
+ Raise_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1074,13 +1072,13 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_TryExcept_New(PyObject* body, PyObject* handlers, PyObject* orelse, int
- lineno)
+Py_TryExcept_New(PyObject* body, PyObject* handlers, PyObject* orelse, int
+ lineno)
{
- struct Py_stmt_TryExcept *result = PyObject_New(struct Py_stmt_TryExcept, &Py_stmt_TryExcept_Type);
+ struct _TryExcept *result = PyObject_New(struct _TryExcept, &Py_TryExcept_Type);
if (result == NULL)
return NULL;
result->body = body;
@@ -1091,22 +1089,22 @@
}
static void
-stmt_TryExcept_dealloc(PyObject* _self)
+TryExcept_dealloc(PyObject* _self)
{
- struct Py_stmt_TryExcept *self = (struct Py_stmt_TryExcept*)_self;
+ struct _TryExcept *self = (struct _TryExcept*)_self;
Py_DECREF(self->body);
Py_DECREF(self->handlers);
Py_DECREF(self->orelse);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_TryExcept_Type = {
+PyTypeObject Py_TryExcept_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_TryExcept", /*tp_name*/
- sizeof(struct Py_stmt_TryExcept), /*tp_basicsize*/
+ "TryExcept", /*tp_name*/
+ sizeof(struct _TryExcept), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_TryExcept_dealloc, /*tp_dealloc*/
+ TryExcept_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1142,12 +1140,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_TryFinally_New(PyObject* body, PyObject* finalbody, int lineno)
+Py_TryFinally_New(PyObject* body, PyObject* finalbody, int lineno)
{
- struct Py_stmt_TryFinally *result = PyObject_New(struct Py_stmt_TryFinally, &Py_stmt_TryFinally_Type);
+ struct _TryFinally *result = PyObject_New(struct _TryFinally, &Py_TryFinally_Type);
if (result == NULL)
return NULL;
result->body = body;
@@ -1157,21 +1155,21 @@
}
static void
-stmt_TryFinally_dealloc(PyObject* _self)
+TryFinally_dealloc(PyObject* _self)
{
- struct Py_stmt_TryFinally *self = (struct Py_stmt_TryFinally*)_self;
+ struct _TryFinally *self = (struct _TryFinally*)_self;
Py_DECREF(self->body);
Py_DECREF(self->finalbody);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_TryFinally_Type = {
+PyTypeObject Py_TryFinally_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_TryFinally", /*tp_name*/
- sizeof(struct Py_stmt_TryFinally), /*tp_basicsize*/
+ "TryFinally", /*tp_name*/
+ sizeof(struct _TryFinally), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_TryFinally_dealloc, /*tp_dealloc*/
+ TryFinally_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1207,12 +1205,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Assert_New(PyObject* test, PyObject* msg, int lineno)
+Py_Assert_New(PyObject* test, PyObject* msg, int lineno)
{
- struct Py_stmt_Assert *result = PyObject_New(struct Py_stmt_Assert, &Py_stmt_Assert_Type);
+ struct _Assert *result = PyObject_New(struct _Assert, &Py_Assert_Type);
if (result == NULL)
return NULL;
result->test = test;
@@ -1222,21 +1220,21 @@
}
static void
-stmt_Assert_dealloc(PyObject* _self)
+Assert_dealloc(PyObject* _self)
{
- struct Py_stmt_Assert *self = (struct Py_stmt_Assert*)_self;
+ struct _Assert *self = (struct _Assert*)_self;
Py_DECREF(self->test);
Py_DECREF(self->msg);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Assert_Type = {
+PyTypeObject Py_Assert_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Assert", /*tp_name*/
- sizeof(struct Py_stmt_Assert), /*tp_basicsize*/
+ "Assert", /*tp_name*/
+ sizeof(struct _Assert), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Assert_dealloc, /*tp_dealloc*/
+ Assert_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1272,12 +1270,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Import_New(PyObject* names, int lineno)
+Py_Import_New(PyObject* names, int lineno)
{
- struct Py_stmt_Import *result = PyObject_New(struct Py_stmt_Import, &Py_stmt_Import_Type);
+ struct _Import *result = PyObject_New(struct _Import, &Py_Import_Type);
if (result == NULL)
return NULL;
result->names = names;
@@ -1286,20 +1284,20 @@
}
static void
-stmt_Import_dealloc(PyObject* _self)
+Import_dealloc(PyObject* _self)
{
- struct Py_stmt_Import *self = (struct Py_stmt_Import*)_self;
+ struct _Import *self = (struct _Import*)_self;
Py_DECREF(self->names);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Import_Type = {
+PyTypeObject Py_Import_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Import", /*tp_name*/
- sizeof(struct Py_stmt_Import), /*tp_basicsize*/
+ "Import", /*tp_name*/
+ sizeof(struct _Import), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Import_dealloc, /*tp_dealloc*/
+ Import_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1335,12 +1333,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_ImportFrom_New(PyObject* module, PyObject* names, int lineno)
+Py_ImportFrom_New(PyObject* module, PyObject* names, int lineno)
{
- struct Py_stmt_ImportFrom *result = PyObject_New(struct Py_stmt_ImportFrom, &Py_stmt_ImportFrom_Type);
+ struct _ImportFrom *result = PyObject_New(struct _ImportFrom, &Py_ImportFrom_Type);
if (result == NULL)
return NULL;
result->module = module;
@@ -1350,21 +1348,21 @@
}
static void
-stmt_ImportFrom_dealloc(PyObject* _self)
+ImportFrom_dealloc(PyObject* _self)
{
- struct Py_stmt_ImportFrom *self = (struct Py_stmt_ImportFrom*)_self;
+ struct _ImportFrom *self = (struct _ImportFrom*)_self;
Py_DECREF(self->module);
Py_DECREF(self->names);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_ImportFrom_Type = {
+PyTypeObject Py_ImportFrom_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_ImportFrom", /*tp_name*/
- sizeof(struct Py_stmt_ImportFrom), /*tp_basicsize*/
+ "ImportFrom", /*tp_name*/
+ sizeof(struct _ImportFrom), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_ImportFrom_dealloc, /*tp_dealloc*/
+ ImportFrom_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1400,13 +1398,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Exec_New(PyObject* body, PyObject* globals, PyObject* locals, int
- lineno)
+Py_Exec_New(PyObject* body, PyObject* globals, PyObject* locals, int lineno)
{
- struct Py_stmt_Exec *result = PyObject_New(struct Py_stmt_Exec, &Py_stmt_Exec_Type);
+ struct _Exec *result = PyObject_New(struct _Exec, &Py_Exec_Type);
if (result == NULL)
return NULL;
result->body = body;
@@ -1417,22 +1414,22 @@
}
static void
-stmt_Exec_dealloc(PyObject* _self)
+Exec_dealloc(PyObject* _self)
{
- struct Py_stmt_Exec *self = (struct Py_stmt_Exec*)_self;
+ struct _Exec *self = (struct _Exec*)_self;
Py_DECREF(self->body);
Py_DECREF(self->globals);
Py_DECREF(self->locals);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Exec_Type = {
+PyTypeObject Py_Exec_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Exec", /*tp_name*/
- sizeof(struct Py_stmt_Exec), /*tp_basicsize*/
+ "Exec", /*tp_name*/
+ sizeof(struct _Exec), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Exec_dealloc, /*tp_dealloc*/
+ Exec_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1468,12 +1465,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Global_New(PyObject* names, int lineno)
+Py_Global_New(PyObject* names, int lineno)
{
- struct Py_stmt_Global *result = PyObject_New(struct Py_stmt_Global, &Py_stmt_Global_Type);
+ struct _Global *result = PyObject_New(struct _Global, &Py_Global_Type);
if (result == NULL)
return NULL;
result->names = names;
@@ -1482,20 +1479,20 @@
}
static void
-stmt_Global_dealloc(PyObject* _self)
+Global_dealloc(PyObject* _self)
{
- struct Py_stmt_Global *self = (struct Py_stmt_Global*)_self;
+ struct _Global *self = (struct _Global*)_self;
Py_DECREF(self->names);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Global_Type = {
+PyTypeObject Py_Global_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Global", /*tp_name*/
- sizeof(struct Py_stmt_Global), /*tp_basicsize*/
+ "Global", /*tp_name*/
+ sizeof(struct _Global), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Global_dealloc, /*tp_dealloc*/
+ Global_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1531,12 +1528,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Expr_New(PyObject* value, int lineno)
+Py_Expr_New(PyObject* value, int lineno)
{
- struct Py_stmt_Expr *result = PyObject_New(struct Py_stmt_Expr, &Py_stmt_Expr_Type);
+ struct _Expr *result = PyObject_New(struct _Expr, &Py_Expr_Type);
if (result == NULL)
return NULL;
result->value = value;
@@ -1545,20 +1542,20 @@
}
static void
-stmt_Expr_dealloc(PyObject* _self)
+Expr_dealloc(PyObject* _self)
{
- struct Py_stmt_Expr *self = (struct Py_stmt_Expr*)_self;
+ struct _Expr *self = (struct _Expr*)_self;
Py_DECREF(self->value);
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Expr_Type = {
+PyTypeObject Py_Expr_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Expr", /*tp_name*/
- sizeof(struct Py_stmt_Expr), /*tp_basicsize*/
+ "Expr", /*tp_name*/
+ sizeof(struct _Expr), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Expr_dealloc, /*tp_dealloc*/
+ Expr_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1594,12 +1591,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Pass_New(int lineno)
+Py_Pass_New(int lineno)
{
- struct Py_stmt_Pass *result = PyObject_New(struct Py_stmt_Pass, &Py_stmt_Pass_Type);
+ struct _Pass *result = PyObject_New(struct _Pass, &Py_Pass_Type);
if (result == NULL)
return NULL;
result->_base.lineno = lineno;
@@ -1607,19 +1604,19 @@
}
static void
-stmt_Pass_dealloc(PyObject* _self)
+Pass_dealloc(PyObject* _self)
{
- struct Py_stmt_Pass *self = (struct Py_stmt_Pass*)_self;
+ struct _Pass *self = (struct _Pass*)_self;
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Pass_Type = {
+PyTypeObject Py_Pass_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Pass", /*tp_name*/
- sizeof(struct Py_stmt_Pass), /*tp_basicsize*/
+ "Pass", /*tp_name*/
+ sizeof(struct _Pass), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Pass_dealloc, /*tp_dealloc*/
+ Pass_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1655,12 +1652,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Break_New(int lineno)
+Py_Break_New(int lineno)
{
- struct Py_stmt_Break *result = PyObject_New(struct Py_stmt_Break, &Py_stmt_Break_Type);
+ struct _Break *result = PyObject_New(struct _Break, &Py_Break_Type);
if (result == NULL)
return NULL;
result->_base.lineno = lineno;
@@ -1668,19 +1665,19 @@
}
static void
-stmt_Break_dealloc(PyObject* _self)
+Break_dealloc(PyObject* _self)
{
- struct Py_stmt_Break *self = (struct Py_stmt_Break*)_self;
+ struct _Break *self = (struct _Break*)_self;
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Break_Type = {
+PyTypeObject Py_Break_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Break", /*tp_name*/
- sizeof(struct Py_stmt_Break), /*tp_basicsize*/
+ "Break", /*tp_name*/
+ sizeof(struct _Break), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Break_dealloc, /*tp_dealloc*/
+ Break_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1716,12 +1713,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_stmt_Continue_New(int lineno)
+Py_Continue_New(int lineno)
{
- struct Py_stmt_Continue *result = PyObject_New(struct Py_stmt_Continue, &Py_stmt_Continue_Type);
+ struct _Continue *result = PyObject_New(struct _Continue, &Py_Continue_Type);
if (result == NULL)
return NULL;
result->_base.lineno = lineno;
@@ -1729,19 +1726,19 @@
}
static void
-stmt_Continue_dealloc(PyObject* _self)
+Continue_dealloc(PyObject* _self)
{
- struct Py_stmt_Continue *self = (struct Py_stmt_Continue*)_self;
+ struct _Continue *self = (struct _Continue*)_self;
PyObject_Del(self);
}
-PyTypeObject Py_stmt_Continue_Type = {
+PyTypeObject Py_Continue_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "stmt_Continue", /*tp_name*/
- sizeof(struct Py_stmt_Continue), /*tp_basicsize*/
+ "Continue", /*tp_name*/
+ sizeof(struct _Continue), /*tp_basicsize*/
0, /* tp_itemsize */
- stmt_Continue_dealloc, /*tp_dealloc*/
+ Continue_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1777,14 +1774,14 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
#define expr_dealloc 0
PyTypeObject Py_expr_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"expr", /*tp_name*/
- sizeof(struct Py_expr), /*tp_basicsize*/
+ sizeof(struct _expr), /*tp_basicsize*/
0, /* tp_itemsize */
expr_dealloc, /*tp_dealloc*/
0, /* tp_print */
@@ -1822,12 +1819,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_BoolOp_New(PyObject* op, PyObject* values, int lineno)
+Py_BoolOp_New(PyObject* op, PyObject* values, int lineno)
{
- struct Py_expr_BoolOp *result = PyObject_New(struct Py_expr_BoolOp, &Py_expr_BoolOp_Type);
+ struct _BoolOp *result = PyObject_New(struct _BoolOp, &Py_BoolOp_Type);
if (result == NULL)
return NULL;
result->op = op;
@@ -1837,21 +1834,21 @@
}
static void
-expr_BoolOp_dealloc(PyObject* _self)
+BoolOp_dealloc(PyObject* _self)
{
- struct Py_expr_BoolOp *self = (struct Py_expr_BoolOp*)_self;
+ struct _BoolOp *self = (struct _BoolOp*)_self;
Py_DECREF(self->op);
Py_DECREF(self->values);
PyObject_Del(self);
}
-PyTypeObject Py_expr_BoolOp_Type = {
+PyTypeObject Py_BoolOp_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_BoolOp", /*tp_name*/
- sizeof(struct Py_expr_BoolOp), /*tp_basicsize*/
+ "BoolOp", /*tp_name*/
+ sizeof(struct _BoolOp), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_BoolOp_dealloc, /*tp_dealloc*/
+ BoolOp_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1887,12 +1884,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_BinOp_New(PyObject* left, PyObject* op, PyObject* right, int lineno)
+Py_BinOp_New(PyObject* left, PyObject* op, PyObject* right, int lineno)
{
- struct Py_expr_BinOp *result = PyObject_New(struct Py_expr_BinOp, &Py_expr_BinOp_Type);
+ struct _BinOp *result = PyObject_New(struct _BinOp, &Py_BinOp_Type);
if (result == NULL)
return NULL;
result->left = left;
@@ -1903,22 +1900,22 @@
}
static void
-expr_BinOp_dealloc(PyObject* _self)
+BinOp_dealloc(PyObject* _self)
{
- struct Py_expr_BinOp *self = (struct Py_expr_BinOp*)_self;
+ struct _BinOp *self = (struct _BinOp*)_self;
Py_DECREF(self->left);
Py_DECREF(self->op);
Py_DECREF(self->right);
PyObject_Del(self);
}
-PyTypeObject Py_expr_BinOp_Type = {
+PyTypeObject Py_BinOp_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_BinOp", /*tp_name*/
- sizeof(struct Py_expr_BinOp), /*tp_basicsize*/
+ "BinOp", /*tp_name*/
+ sizeof(struct _BinOp), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_BinOp_dealloc, /*tp_dealloc*/
+ BinOp_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -1954,12 +1951,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_UnaryOp_New(PyObject* op, PyObject* operand, int lineno)
+Py_UnaryOp_New(PyObject* op, PyObject* operand, int lineno)
{
- struct Py_expr_UnaryOp *result = PyObject_New(struct Py_expr_UnaryOp, &Py_expr_UnaryOp_Type);
+ struct _UnaryOp *result = PyObject_New(struct _UnaryOp, &Py_UnaryOp_Type);
if (result == NULL)
return NULL;
result->op = op;
@@ -1969,21 +1966,21 @@
}
static void
-expr_UnaryOp_dealloc(PyObject* _self)
+UnaryOp_dealloc(PyObject* _self)
{
- struct Py_expr_UnaryOp *self = (struct Py_expr_UnaryOp*)_self;
+ struct _UnaryOp *self = (struct _UnaryOp*)_self;
Py_DECREF(self->op);
Py_DECREF(self->operand);
PyObject_Del(self);
}
-PyTypeObject Py_expr_UnaryOp_Type = {
+PyTypeObject Py_UnaryOp_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_UnaryOp", /*tp_name*/
- sizeof(struct Py_expr_UnaryOp), /*tp_basicsize*/
+ "UnaryOp", /*tp_name*/
+ sizeof(struct _UnaryOp), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_UnaryOp_dealloc, /*tp_dealloc*/
+ UnaryOp_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2019,12 +2016,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Lambda_New(PyObject* args, PyObject* body, int lineno)
+Py_Lambda_New(PyObject* args, PyObject* body, int lineno)
{
- struct Py_expr_Lambda *result = PyObject_New(struct Py_expr_Lambda, &Py_expr_Lambda_Type);
+ struct _Lambda *result = PyObject_New(struct _Lambda, &Py_Lambda_Type);
if (result == NULL)
return NULL;
result->args = args;
@@ -2034,21 +2031,21 @@
}
static void
-expr_Lambda_dealloc(PyObject* _self)
+Lambda_dealloc(PyObject* _self)
{
- struct Py_expr_Lambda *self = (struct Py_expr_Lambda*)_self;
+ struct _Lambda *self = (struct _Lambda*)_self;
Py_DECREF(self->args);
Py_DECREF(self->body);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Lambda_Type = {
+PyTypeObject Py_Lambda_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Lambda", /*tp_name*/
- sizeof(struct Py_expr_Lambda), /*tp_basicsize*/
+ "Lambda", /*tp_name*/
+ sizeof(struct _Lambda), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Lambda_dealloc, /*tp_dealloc*/
+ Lambda_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2084,12 +2081,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Dict_New(PyObject* keys, PyObject* values, int lineno)
+Py_Dict_New(PyObject* keys, PyObject* values, int lineno)
{
- struct Py_expr_Dict *result = PyObject_New(struct Py_expr_Dict, &Py_expr_Dict_Type);
+ struct _Dict *result = PyObject_New(struct _Dict, &Py_Dict_Type);
if (result == NULL)
return NULL;
result->keys = keys;
@@ -2099,21 +2096,21 @@
}
static void
-expr_Dict_dealloc(PyObject* _self)
+Dict_dealloc(PyObject* _self)
{
- struct Py_expr_Dict *self = (struct Py_expr_Dict*)_self;
+ struct _Dict *self = (struct _Dict*)_self;
Py_DECREF(self->keys);
Py_DECREF(self->values);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Dict_Type = {
+PyTypeObject Py_Dict_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Dict", /*tp_name*/
- sizeof(struct Py_expr_Dict), /*tp_basicsize*/
+ "Dict", /*tp_name*/
+ sizeof(struct _Dict), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Dict_dealloc, /*tp_dealloc*/
+ Dict_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2149,12 +2146,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_ListComp_New(PyObject* elt, PyObject* generators, int lineno)
+Py_ListComp_New(PyObject* elt, PyObject* generators, int lineno)
{
- struct Py_expr_ListComp *result = PyObject_New(struct Py_expr_ListComp, &Py_expr_ListComp_Type);
+ struct _ListComp *result = PyObject_New(struct _ListComp, &Py_ListComp_Type);
if (result == NULL)
return NULL;
result->elt = elt;
@@ -2164,21 +2161,21 @@
}
static void
-expr_ListComp_dealloc(PyObject* _self)
+ListComp_dealloc(PyObject* _self)
{
- struct Py_expr_ListComp *self = (struct Py_expr_ListComp*)_self;
+ struct _ListComp *self = (struct _ListComp*)_self;
Py_DECREF(self->elt);
Py_DECREF(self->generators);
PyObject_Del(self);
}
-PyTypeObject Py_expr_ListComp_Type = {
+PyTypeObject Py_ListComp_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_ListComp", /*tp_name*/
- sizeof(struct Py_expr_ListComp), /*tp_basicsize*/
+ "ListComp", /*tp_name*/
+ sizeof(struct _ListComp), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_ListComp_dealloc, /*tp_dealloc*/
+ ListComp_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2214,12 +2211,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_GeneratorExp_New(PyObject* elt, PyObject* generators, int lineno)
+Py_GeneratorExp_New(PyObject* elt, PyObject* generators, int lineno)
{
- struct Py_expr_GeneratorExp *result = PyObject_New(struct Py_expr_GeneratorExp, &Py_expr_GeneratorExp_Type);
+ struct _GeneratorExp *result = PyObject_New(struct _GeneratorExp, &Py_GeneratorExp_Type);
if (result == NULL)
return NULL;
result->elt = elt;
@@ -2229,21 +2226,21 @@
}
static void
-expr_GeneratorExp_dealloc(PyObject* _self)
+GeneratorExp_dealloc(PyObject* _self)
{
- struct Py_expr_GeneratorExp *self = (struct Py_expr_GeneratorExp*)_self;
+ struct _GeneratorExp *self = (struct _GeneratorExp*)_self;
Py_DECREF(self->elt);
Py_DECREF(self->generators);
PyObject_Del(self);
}
-PyTypeObject Py_expr_GeneratorExp_Type = {
+PyTypeObject Py_GeneratorExp_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_GeneratorExp", /*tp_name*/
- sizeof(struct Py_expr_GeneratorExp), /*tp_basicsize*/
+ "GeneratorExp", /*tp_name*/
+ sizeof(struct _GeneratorExp), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_GeneratorExp_dealloc, /*tp_dealloc*/
+ GeneratorExp_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2279,12 +2276,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Yield_New(PyObject* value, int lineno)
+Py_Yield_New(PyObject* value, int lineno)
{
- struct Py_expr_Yield *result = PyObject_New(struct Py_expr_Yield, &Py_expr_Yield_Type);
+ struct _Yield *result = PyObject_New(struct _Yield, &Py_Yield_Type);
if (result == NULL)
return NULL;
result->value = value;
@@ -2293,20 +2290,20 @@
}
static void
-expr_Yield_dealloc(PyObject* _self)
+Yield_dealloc(PyObject* _self)
{
- struct Py_expr_Yield *self = (struct Py_expr_Yield*)_self;
+ struct _Yield *self = (struct _Yield*)_self;
Py_DECREF(self->value);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Yield_Type = {
+PyTypeObject Py_Yield_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Yield", /*tp_name*/
- sizeof(struct Py_expr_Yield), /*tp_basicsize*/
+ "Yield", /*tp_name*/
+ sizeof(struct _Yield), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Yield_dealloc, /*tp_dealloc*/
+ Yield_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2342,13 +2339,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Compare_New(PyObject* left, PyObject* ops, PyObject* comparators, int
- lineno)
+Py_Compare_New(PyObject* left, PyObject* ops, PyObject* comparators, int lineno)
{
- struct Py_expr_Compare *result = PyObject_New(struct Py_expr_Compare, &Py_expr_Compare_Type);
+ struct _Compare *result = PyObject_New(struct _Compare, &Py_Compare_Type);
if (result == NULL)
return NULL;
result->left = left;
@@ -2359,22 +2355,22 @@
}
static void
-expr_Compare_dealloc(PyObject* _self)
+Compare_dealloc(PyObject* _self)
{
- struct Py_expr_Compare *self = (struct Py_expr_Compare*)_self;
+ struct _Compare *self = (struct _Compare*)_self;
Py_DECREF(self->left);
Py_DECREF(self->ops);
Py_DECREF(self->comparators);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Compare_Type = {
+PyTypeObject Py_Compare_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Compare", /*tp_name*/
- sizeof(struct Py_expr_Compare), /*tp_basicsize*/
+ "Compare", /*tp_name*/
+ sizeof(struct _Compare), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Compare_dealloc, /*tp_dealloc*/
+ Compare_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2410,13 +2406,13 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Call_New(PyObject* func, PyObject* args, PyObject* keywords, PyObject*
- starargs, PyObject* kwargs, int lineno)
+Py_Call_New(PyObject* func, PyObject* args, PyObject* keywords, PyObject*
+ starargs, PyObject* kwargs, int lineno)
{
- struct Py_expr_Call *result = PyObject_New(struct Py_expr_Call, &Py_expr_Call_Type);
+ struct _Call *result = PyObject_New(struct _Call, &Py_Call_Type);
if (result == NULL)
return NULL;
result->func = func;
@@ -2429,9 +2425,9 @@
}
static void
-expr_Call_dealloc(PyObject* _self)
+Call_dealloc(PyObject* _self)
{
- struct Py_expr_Call *self = (struct Py_expr_Call*)_self;
+ struct _Call *self = (struct _Call*)_self;
Py_DECREF(self->func);
Py_DECREF(self->args);
Py_DECREF(self->keywords);
@@ -2440,13 +2436,13 @@
PyObject_Del(self);
}
-PyTypeObject Py_expr_Call_Type = {
+PyTypeObject Py_Call_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Call", /*tp_name*/
- sizeof(struct Py_expr_Call), /*tp_basicsize*/
+ "Call", /*tp_name*/
+ sizeof(struct _Call), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Call_dealloc, /*tp_dealloc*/
+ Call_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2482,12 +2478,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Repr_New(PyObject* value, int lineno)
+Py_Repr_New(PyObject* value, int lineno)
{
- struct Py_expr_Repr *result = PyObject_New(struct Py_expr_Repr, &Py_expr_Repr_Type);
+ struct _Repr *result = PyObject_New(struct _Repr, &Py_Repr_Type);
if (result == NULL)
return NULL;
result->value = value;
@@ -2496,20 +2492,20 @@
}
static void
-expr_Repr_dealloc(PyObject* _self)
+Repr_dealloc(PyObject* _self)
{
- struct Py_expr_Repr *self = (struct Py_expr_Repr*)_self;
+ struct _Repr *self = (struct _Repr*)_self;
Py_DECREF(self->value);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Repr_Type = {
+PyTypeObject Py_Repr_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Repr", /*tp_name*/
- sizeof(struct Py_expr_Repr), /*tp_basicsize*/
+ "Repr", /*tp_name*/
+ sizeof(struct _Repr), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Repr_dealloc, /*tp_dealloc*/
+ Repr_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2545,12 +2541,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Num_New(PyObject* n, int lineno)
+Py_Num_New(PyObject* n, int lineno)
{
- struct Py_expr_Num *result = PyObject_New(struct Py_expr_Num, &Py_expr_Num_Type);
+ struct _Num *result = PyObject_New(struct _Num, &Py_Num_Type);
if (result == NULL)
return NULL;
result->n = n;
@@ -2559,20 +2555,20 @@
}
static void
-expr_Num_dealloc(PyObject* _self)
+Num_dealloc(PyObject* _self)
{
- struct Py_expr_Num *self = (struct Py_expr_Num*)_self;
+ struct _Num *self = (struct _Num*)_self;
Py_DECREF(self->n);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Num_Type = {
+PyTypeObject Py_Num_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Num", /*tp_name*/
- sizeof(struct Py_expr_Num), /*tp_basicsize*/
+ "Num", /*tp_name*/
+ sizeof(struct _Num), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Num_dealloc, /*tp_dealloc*/
+ Num_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2608,12 +2604,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Str_New(PyObject* s, int lineno)
+Py_Str_New(PyObject* s, int lineno)
{
- struct Py_expr_Str *result = PyObject_New(struct Py_expr_Str, &Py_expr_Str_Type);
+ struct _Str *result = PyObject_New(struct _Str, &Py_Str_Type);
if (result == NULL)
return NULL;
result->s = s;
@@ -2622,20 +2618,20 @@
}
static void
-expr_Str_dealloc(PyObject* _self)
+Str_dealloc(PyObject* _self)
{
- struct Py_expr_Str *self = (struct Py_expr_Str*)_self;
+ struct _Str *self = (struct _Str*)_self;
Py_DECREF(self->s);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Str_Type = {
+PyTypeObject Py_Str_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Str", /*tp_name*/
- sizeof(struct Py_expr_Str), /*tp_basicsize*/
+ "Str", /*tp_name*/
+ sizeof(struct _Str), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Str_dealloc, /*tp_dealloc*/
+ Str_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2671,13 +2667,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Attribute_New(PyObject* value, PyObject* attr, PyObject* ctx, int
- lineno)
+Py_Attribute_New(PyObject* value, PyObject* attr, PyObject* ctx, int lineno)
{
- struct Py_expr_Attribute *result = PyObject_New(struct Py_expr_Attribute, &Py_expr_Attribute_Type);
+ struct _Attribute *result = PyObject_New(struct _Attribute, &Py_Attribute_Type);
if (result == NULL)
return NULL;
result->value = value;
@@ -2688,22 +2683,22 @@
}
static void
-expr_Attribute_dealloc(PyObject* _self)
+Attribute_dealloc(PyObject* _self)
{
- struct Py_expr_Attribute *self = (struct Py_expr_Attribute*)_self;
+ struct _Attribute *self = (struct _Attribute*)_self;
Py_DECREF(self->value);
Py_DECREF(self->attr);
Py_DECREF(self->ctx);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Attribute_Type = {
+PyTypeObject Py_Attribute_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Attribute", /*tp_name*/
- sizeof(struct Py_expr_Attribute), /*tp_basicsize*/
+ "Attribute", /*tp_name*/
+ sizeof(struct _Attribute), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Attribute_dealloc, /*tp_dealloc*/
+ Attribute_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2739,13 +2734,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Subscript_New(PyObject* value, PyObject* slice, PyObject* ctx, int
- lineno)
+Py_Subscript_New(PyObject* value, PyObject* slice, PyObject* ctx, int lineno)
{
- struct Py_expr_Subscript *result = PyObject_New(struct Py_expr_Subscript, &Py_expr_Subscript_Type);
+ struct _Subscript *result = PyObject_New(struct _Subscript, &Py_Subscript_Type);
if (result == NULL)
return NULL;
result->value = value;
@@ -2756,22 +2750,22 @@
}
static void
-expr_Subscript_dealloc(PyObject* _self)
+Subscript_dealloc(PyObject* _self)
{
- struct Py_expr_Subscript *self = (struct Py_expr_Subscript*)_self;
+ struct _Subscript *self = (struct _Subscript*)_self;
Py_DECREF(self->value);
Py_DECREF(self->slice);
Py_DECREF(self->ctx);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Subscript_Type = {
+PyTypeObject Py_Subscript_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Subscript", /*tp_name*/
- sizeof(struct Py_expr_Subscript), /*tp_basicsize*/
+ "Subscript", /*tp_name*/
+ sizeof(struct _Subscript), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Subscript_dealloc, /*tp_dealloc*/
+ Subscript_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2807,12 +2801,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Name_New(PyObject* id, PyObject* ctx, int lineno)
+Py_Name_New(PyObject* id, PyObject* ctx, int lineno)
{
- struct Py_expr_Name *result = PyObject_New(struct Py_expr_Name, &Py_expr_Name_Type);
+ struct _Name *result = PyObject_New(struct _Name, &Py_Name_Type);
if (result == NULL)
return NULL;
result->id = id;
@@ -2822,21 +2816,21 @@
}
static void
-expr_Name_dealloc(PyObject* _self)
+Name_dealloc(PyObject* _self)
{
- struct Py_expr_Name *self = (struct Py_expr_Name*)_self;
+ struct _Name *self = (struct _Name*)_self;
Py_DECREF(self->id);
Py_DECREF(self->ctx);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Name_Type = {
+PyTypeObject Py_Name_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Name", /*tp_name*/
- sizeof(struct Py_expr_Name), /*tp_basicsize*/
+ "Name", /*tp_name*/
+ sizeof(struct _Name), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Name_dealloc, /*tp_dealloc*/
+ Name_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2872,12 +2866,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_List_New(PyObject* elts, PyObject* ctx, int lineno)
+Py_List_New(PyObject* elts, PyObject* ctx, int lineno)
{
- struct Py_expr_List *result = PyObject_New(struct Py_expr_List, &Py_expr_List_Type);
+ struct _List *result = PyObject_New(struct _List, &Py_List_Type);
if (result == NULL)
return NULL;
result->elts = elts;
@@ -2887,21 +2881,21 @@
}
static void
-expr_List_dealloc(PyObject* _self)
+List_dealloc(PyObject* _self)
{
- struct Py_expr_List *self = (struct Py_expr_List*)_self;
+ struct _List *self = (struct _List*)_self;
Py_DECREF(self->elts);
Py_DECREF(self->ctx);
PyObject_Del(self);
}
-PyTypeObject Py_expr_List_Type = {
+PyTypeObject Py_List_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_List", /*tp_name*/
- sizeof(struct Py_expr_List), /*tp_basicsize*/
+ "List", /*tp_name*/
+ sizeof(struct _List), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_List_dealloc, /*tp_dealloc*/
+ List_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -2937,12 +2931,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_expr_Tuple_New(PyObject* elts, PyObject* ctx, int lineno)
+Py_Tuple_New(PyObject* elts, PyObject* ctx, int lineno)
{
- struct Py_expr_Tuple *result = PyObject_New(struct Py_expr_Tuple, &Py_expr_Tuple_Type);
+ struct _Tuple *result = PyObject_New(struct _Tuple, &Py_Tuple_Type);
if (result == NULL)
return NULL;
result->elts = elts;
@@ -2952,21 +2946,21 @@
}
static void
-expr_Tuple_dealloc(PyObject* _self)
+Tuple_dealloc(PyObject* _self)
{
- struct Py_expr_Tuple *self = (struct Py_expr_Tuple*)_self;
+ struct _Tuple *self = (struct _Tuple*)_self;
Py_DECREF(self->elts);
Py_DECREF(self->ctx);
PyObject_Del(self);
}
-PyTypeObject Py_expr_Tuple_Type = {
+PyTypeObject Py_Tuple_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "expr_Tuple", /*tp_name*/
- sizeof(struct Py_expr_Tuple), /*tp_basicsize*/
+ "Tuple", /*tp_name*/
+ sizeof(struct _Tuple), /*tp_basicsize*/
0, /* tp_itemsize */
- expr_Tuple_dealloc, /*tp_dealloc*/
+ Tuple_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -3002,14 +2996,14 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
#define slice_dealloc 0
PyTypeObject Py_slice_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"slice", /*tp_name*/
- sizeof(struct Py_slice), /*tp_basicsize*/
+ sizeof(struct _slice), /*tp_basicsize*/
0, /* tp_itemsize */
slice_dealloc, /*tp_dealloc*/
0, /* tp_print */
@@ -3047,31 +3041,31 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_slice_Ellipsis_New()
+Py_Ellipsis_New()
{
- struct Py_slice_Ellipsis *result = PyObject_New(struct Py_slice_Ellipsis, &Py_slice_Ellipsis_Type);
+ struct _Ellipsis *result = PyObject_New(struct _Ellipsis, &Py_Ellipsis_Type);
if (result == NULL)
return NULL;
return (PyObject*)result;
}
static void
-slice_Ellipsis_dealloc(PyObject* _self)
+Ellipsis_dealloc(PyObject* _self)
{
- struct Py_slice_Ellipsis *self = (struct Py_slice_Ellipsis*)_self;
+ struct _Ellipsis *self = (struct _Ellipsis*)_self;
PyObject_Del(self);
}
-PyTypeObject Py_slice_Ellipsis_Type = {
+PyTypeObject Py_Ellipsis_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "slice_Ellipsis", /*tp_name*/
- sizeof(struct Py_slice_Ellipsis), /*tp_basicsize*/
+ "Ellipsis", /*tp_name*/
+ sizeof(struct _Ellipsis), /*tp_basicsize*/
0, /* tp_itemsize */
- slice_Ellipsis_dealloc, /*tp_dealloc*/
+ Ellipsis_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -3107,12 +3101,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_slice_Slice_New(PyObject* lower, PyObject* upper, PyObject* step)
+Py_Slice_New(PyObject* lower, PyObject* upper, PyObject* step)
{
- struct Py_slice_Slice *result = PyObject_New(struct Py_slice_Slice, &Py_slice_Slice_Type);
+ struct _Slice *result = PyObject_New(struct _Slice, &Py_Slice_Type);
if (result == NULL)
return NULL;
result->lower = lower;
@@ -3122,22 +3116,22 @@
}
static void
-slice_Slice_dealloc(PyObject* _self)
+Slice_dealloc(PyObject* _self)
{
- struct Py_slice_Slice *self = (struct Py_slice_Slice*)_self;
+ struct _Slice *self = (struct _Slice*)_self;
Py_DECREF(self->lower);
Py_DECREF(self->upper);
Py_DECREF(self->step);
PyObject_Del(self);
}
-PyTypeObject Py_slice_Slice_Type = {
+PyTypeObject Py_Slice_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "slice_Slice", /*tp_name*/
- sizeof(struct Py_slice_Slice), /*tp_basicsize*/
+ "Slice", /*tp_name*/
+ sizeof(struct _Slice), /*tp_basicsize*/
0, /* tp_itemsize */
- slice_Slice_dealloc, /*tp_dealloc*/
+ Slice_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -3173,12 +3167,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_slice_ExtSlice_New(PyObject* dims)
+Py_ExtSlice_New(PyObject* dims)
{
- struct Py_slice_ExtSlice *result = PyObject_New(struct Py_slice_ExtSlice, &Py_slice_ExtSlice_Type);
+ struct _ExtSlice *result = PyObject_New(struct _ExtSlice, &Py_ExtSlice_Type);
if (result == NULL)
return NULL;
result->dims = dims;
@@ -3186,20 +3180,20 @@
}
static void
-slice_ExtSlice_dealloc(PyObject* _self)
+ExtSlice_dealloc(PyObject* _self)
{
- struct Py_slice_ExtSlice *self = (struct Py_slice_ExtSlice*)_self;
+ struct _ExtSlice *self = (struct _ExtSlice*)_self;
Py_DECREF(self->dims);
PyObject_Del(self);
}
-PyTypeObject Py_slice_ExtSlice_Type = {
+PyTypeObject Py_ExtSlice_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "slice_ExtSlice", /*tp_name*/
- sizeof(struct Py_slice_ExtSlice), /*tp_basicsize*/
+ "ExtSlice", /*tp_name*/
+ sizeof(struct _ExtSlice), /*tp_basicsize*/
0, /* tp_itemsize */
- slice_ExtSlice_dealloc, /*tp_dealloc*/
+ ExtSlice_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -3235,12 +3229,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
-Py_slice_Index_New(PyObject* value)
+Py_Index_New(PyObject* value)
{
- struct Py_slice_Index *result = PyObject_New(struct Py_slice_Index, &Py_slice_Index_Type);
+ struct _Index *result = PyObject_New(struct _Index, &Py_Index_Type);
if (result == NULL)
return NULL;
result->value = value;
@@ -3248,20 +3242,20 @@
}
static void
-slice_Index_dealloc(PyObject* _self)
+Index_dealloc(PyObject* _self)
{
- struct Py_slice_Index *self = (struct Py_slice_Index*)_self;
+ struct _Index *self = (struct _Index*)_self;
Py_DECREF(self->value);
PyObject_Del(self);
}
-PyTypeObject Py_slice_Index_Type = {
+PyTypeObject Py_Index_Type = {
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
- "slice_Index", /*tp_name*/
- sizeof(struct Py_slice_Index), /*tp_basicsize*/
+ "Index", /*tp_name*/
+ sizeof(struct _Index), /*tp_basicsize*/
0, /* tp_itemsize */
- slice_Index_dealloc, /*tp_dealloc*/
+ Index_dealloc, /*tp_dealloc*/
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
@@ -3297,12 +3291,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
Py_comprehension_New(PyObject* target, PyObject* iter, PyObject* ifs)
{
- struct Py_comprehension *result = PyObject_New(struct Py_comprehension, &Py_comprehension_Type);
+ struct _comprehension *result = PyObject_New(struct _comprehension, &Py_comprehension_Type);
if (result == NULL)
return NULL;
result->target = target;
@@ -3314,7 +3308,7 @@
static void
comprehension_dealloc(PyObject* _self)
{
- struct Py_comprehension *self = (struct Py_comprehension*)_self;
+ struct _comprehension *self = (struct _comprehension*)_self;
Py_DECREF(self->target);
Py_DECREF(self->iter);
Py_DECREF(self->ifs);
@@ -3325,7 +3319,7 @@
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"comprehension", /*tp_name*/
- sizeof(struct Py_comprehension), /*tp_basicsize*/
+ sizeof(struct _comprehension), /*tp_basicsize*/
0, /* tp_itemsize */
comprehension_dealloc, /*tp_dealloc*/
0, /* tp_print */
@@ -3363,12 +3357,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
Py_excepthandler_New(PyObject* type, PyObject* name, PyObject* body)
{
- struct Py_excepthandler *result = PyObject_New(struct Py_excepthandler, &Py_excepthandler_Type);
+ struct _excepthandler *result = PyObject_New(struct _excepthandler, &Py_excepthandler_Type);
if (result == NULL)
return NULL;
result->type = type;
@@ -3380,7 +3374,7 @@
static void
excepthandler_dealloc(PyObject* _self)
{
- struct Py_excepthandler *self = (struct Py_excepthandler*)_self;
+ struct _excepthandler *self = (struct _excepthandler*)_self;
Py_DECREF(self->type);
Py_DECREF(self->name);
Py_DECREF(self->body);
@@ -3391,7 +3385,7 @@
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"excepthandler", /*tp_name*/
- sizeof(struct Py_excepthandler), /*tp_basicsize*/
+ sizeof(struct _excepthandler), /*tp_basicsize*/
0, /* tp_itemsize */
excepthandler_dealloc, /*tp_dealloc*/
0, /* tp_print */
@@ -3429,13 +3423,13 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
Py_arguments_New(PyObject* args, PyObject* vararg, PyObject* kwarg, PyObject*
defaults)
{
- struct Py_arguments *result = PyObject_New(struct Py_arguments, &Py_arguments_Type);
+ struct _arguments *result = PyObject_New(struct _arguments, &Py_arguments_Type);
if (result == NULL)
return NULL;
result->args = args;
@@ -3448,7 +3442,7 @@
static void
arguments_dealloc(PyObject* _self)
{
- struct Py_arguments *self = (struct Py_arguments*)_self;
+ struct _arguments *self = (struct _arguments*)_self;
Py_DECREF(self->args);
Py_DECREF(self->vararg);
Py_DECREF(self->kwarg);
@@ -3460,7 +3454,7 @@
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"arguments", /*tp_name*/
- sizeof(struct Py_arguments), /*tp_basicsize*/
+ sizeof(struct _arguments), /*tp_basicsize*/
0, /* tp_itemsize */
arguments_dealloc, /*tp_dealloc*/
0, /* tp_print */
@@ -3498,12 +3492,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
Py_keyword_New(PyObject* arg, PyObject* value)
{
- struct Py_keyword *result = PyObject_New(struct Py_keyword, &Py_keyword_Type);
+ struct _keyword *result = PyObject_New(struct _keyword, &Py_keyword_Type);
if (result == NULL)
return NULL;
result->arg = arg;
@@ -3514,7 +3508,7 @@
static void
keyword_dealloc(PyObject* _self)
{
- struct Py_keyword *self = (struct Py_keyword*)_self;
+ struct _keyword *self = (struct _keyword*)_self;
Py_DECREF(self->arg);
Py_DECREF(self->value);
PyObject_Del(self);
@@ -3524,7 +3518,7 @@
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"keyword", /*tp_name*/
- sizeof(struct Py_keyword), /*tp_basicsize*/
+ sizeof(struct _keyword), /*tp_basicsize*/
0, /* tp_itemsize */
keyword_dealloc, /*tp_dealloc*/
0, /* tp_print */
@@ -3562,12 +3556,12 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
PyObject*
Py_alias_New(PyObject* name, PyObject* asname)
{
- struct Py_alias *result = PyObject_New(struct Py_alias, &Py_alias_Type);
+ struct _alias *result = PyObject_New(struct _alias, &Py_alias_Type);
if (result == NULL)
return NULL;
result->name = name;
@@ -3578,7 +3572,7 @@
static void
alias_dealloc(PyObject* _self)
{
- struct Py_alias *self = (struct Py_alias*)_self;
+ struct _alias *self = (struct _alias*)_self;
Py_DECREF(self->name);
Py_DECREF(self->asname);
PyObject_Del(self);
@@ -3588,7 +3582,7 @@
PyObject_HEAD_INIT(NULL)
0, /*ob_size*/
"alias", /*tp_name*/
- sizeof(struct Py_alias), /*tp_basicsize*/
+ sizeof(struct _alias), /*tp_basicsize*/
0, /* tp_itemsize */
alias_dealloc, /*tp_dealloc*/
0, /* tp_print */
@@ -3626,162 +3620,162 @@
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
- };
-
+};
+
void init_ast(void)
{
if (PyType_Ready(&Py_mod_Type) < 0)
return;
- Py_mod_Module_Type.tp_base = &Py_mod_Type;
- if (PyType_Ready(&Py_mod_Module_Type) < 0)
+ Py_Module_Type.tp_base = &Py_mod_Type;
+ if (PyType_Ready(&Py_Module_Type) < 0)
return;
- Py_mod_Interactive_Type.tp_base = &Py_mod_Type;
- if (PyType_Ready(&Py_mod_Interactive_Type) < 0)
+ Py_Interactive_Type.tp_base = &Py_mod_Type;
+ if (PyType_Ready(&Py_Interactive_Type) < 0)
return;
- Py_mod_Expression_Type.tp_base = &Py_mod_Type;
- if (PyType_Ready(&Py_mod_Expression_Type) < 0)
+ Py_Expression_Type.tp_base = &Py_mod_Type;
+ if (PyType_Ready(&Py_Expression_Type) < 0)
return;
- Py_mod_Suite_Type.tp_base = &Py_mod_Type;
- if (PyType_Ready(&Py_mod_Suite_Type) < 0)
+ Py_Suite_Type.tp_base = &Py_mod_Type;
+ if (PyType_Ready(&Py_Suite_Type) < 0)
return;
if (PyType_Ready(&Py_stmt_Type) < 0)
return;
- Py_stmt_FunctionDef_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_FunctionDef_Type) < 0)
+ Py_FunctionDef_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_FunctionDef_Type) < 0)
return;
- Py_stmt_ClassDef_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_ClassDef_Type) < 0)
+ Py_ClassDef_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_ClassDef_Type) < 0)
return;
- Py_stmt_Return_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Return_Type) < 0)
+ Py_Return_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Return_Type) < 0)
return;
- Py_stmt_Delete_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Delete_Type) < 0)
+ Py_Delete_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Delete_Type) < 0)
return;
- Py_stmt_Assign_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Assign_Type) < 0)
+ Py_Assign_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Assign_Type) < 0)
return;
- Py_stmt_AugAssign_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_AugAssign_Type) < 0)
+ Py_AugAssign_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_AugAssign_Type) < 0)
return;
- Py_stmt_Print_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Print_Type) < 0)
+ Py_Print_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Print_Type) < 0)
return;
- Py_stmt_For_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_For_Type) < 0)
+ Py_For_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_For_Type) < 0)
return;
- Py_stmt_While_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_While_Type) < 0)
+ Py_While_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_While_Type) < 0)
return;
- Py_stmt_If_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_If_Type) < 0)
+ Py_If_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_If_Type) < 0)
return;
- Py_stmt_Raise_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Raise_Type) < 0)
+ Py_Raise_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Raise_Type) < 0)
return;
- Py_stmt_TryExcept_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_TryExcept_Type) < 0)
+ Py_TryExcept_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_TryExcept_Type) < 0)
return;
- Py_stmt_TryFinally_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_TryFinally_Type) < 0)
+ Py_TryFinally_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_TryFinally_Type) < 0)
return;
- Py_stmt_Assert_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Assert_Type) < 0)
+ Py_Assert_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Assert_Type) < 0)
return;
- Py_stmt_Import_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Import_Type) < 0)
+ Py_Import_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Import_Type) < 0)
return;
- Py_stmt_ImportFrom_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_ImportFrom_Type) < 0)
+ Py_ImportFrom_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_ImportFrom_Type) < 0)
return;
- Py_stmt_Exec_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Exec_Type) < 0)
+ Py_Exec_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Exec_Type) < 0)
return;
- Py_stmt_Global_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Global_Type) < 0)
+ Py_Global_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Global_Type) < 0)
return;
- Py_stmt_Expr_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Expr_Type) < 0)
+ Py_Expr_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Expr_Type) < 0)
return;
- Py_stmt_Pass_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Pass_Type) < 0)
+ Py_Pass_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Pass_Type) < 0)
return;
- Py_stmt_Break_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Break_Type) < 0)
+ Py_Break_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Break_Type) < 0)
return;
- Py_stmt_Continue_Type.tp_base = &Py_stmt_Type;
- if (PyType_Ready(&Py_stmt_Continue_Type) < 0)
+ Py_Continue_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_Continue_Type) < 0)
return;
if (PyType_Ready(&Py_expr_Type) < 0)
return;
- Py_expr_BoolOp_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_BoolOp_Type) < 0)
+ Py_BoolOp_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_BoolOp_Type) < 0)
return;
- Py_expr_BinOp_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_BinOp_Type) < 0)
+ Py_BinOp_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_BinOp_Type) < 0)
return;
- Py_expr_UnaryOp_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_UnaryOp_Type) < 0)
+ Py_UnaryOp_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_UnaryOp_Type) < 0)
return;
- Py_expr_Lambda_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Lambda_Type) < 0)
+ Py_Lambda_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Lambda_Type) < 0)
return;
- Py_expr_Dict_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Dict_Type) < 0)
+ Py_Dict_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Dict_Type) < 0)
return;
- Py_expr_ListComp_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_ListComp_Type) < 0)
+ Py_ListComp_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_ListComp_Type) < 0)
return;
- Py_expr_GeneratorExp_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_GeneratorExp_Type) < 0)
+ Py_GeneratorExp_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_GeneratorExp_Type) < 0)
return;
- Py_expr_Yield_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Yield_Type) < 0)
+ Py_Yield_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Yield_Type) < 0)
return;
- Py_expr_Compare_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Compare_Type) < 0)
+ Py_Compare_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Compare_Type) < 0)
return;
- Py_expr_Call_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Call_Type) < 0)
+ Py_Call_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Call_Type) < 0)
return;
- Py_expr_Repr_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Repr_Type) < 0)
+ Py_Repr_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Repr_Type) < 0)
return;
- Py_expr_Num_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Num_Type) < 0)
+ Py_Num_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Num_Type) < 0)
return;
- Py_expr_Str_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Str_Type) < 0)
+ Py_Str_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Str_Type) < 0)
return;
- Py_expr_Attribute_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Attribute_Type) < 0)
+ Py_Attribute_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Attribute_Type) < 0)
return;
- Py_expr_Subscript_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Subscript_Type) < 0)
+ Py_Subscript_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Subscript_Type) < 0)
return;
- Py_expr_Name_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Name_Type) < 0)
+ Py_Name_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Name_Type) < 0)
return;
- Py_expr_List_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_List_Type) < 0)
+ Py_List_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_List_Type) < 0)
return;
- Py_expr_Tuple_Type.tp_base = &Py_expr_Type;
- if (PyType_Ready(&Py_expr_Tuple_Type) < 0)
+ Py_Tuple_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_Tuple_Type) < 0)
return;
if (PyType_Ready(&Py_slice_Type) < 0)
return;
- Py_slice_Ellipsis_Type.tp_base = &Py_slice_Type;
- if (PyType_Ready(&Py_slice_Ellipsis_Type) < 0)
+ Py_Ellipsis_Type.tp_base = &Py_slice_Type;
+ if (PyType_Ready(&Py_Ellipsis_Type) < 0)
return;
- Py_slice_Slice_Type.tp_base = &Py_slice_Type;
- if (PyType_Ready(&Py_slice_Slice_Type) < 0)
+ Py_Slice_Type.tp_base = &Py_slice_Type;
+ if (PyType_Ready(&Py_Slice_Type) < 0)
return;
- Py_slice_ExtSlice_Type.tp_base = &Py_slice_Type;
- if (PyType_Ready(&Py_slice_ExtSlice_Type) < 0)
+ Py_ExtSlice_Type.tp_base = &Py_slice_Type;
+ if (PyType_Ready(&Py_ExtSlice_Type) < 0)
return;
- Py_slice_Index_Type.tp_base = &Py_slice_Type;
- if (PyType_Ready(&Py_slice_Index_Type) < 0)
+ Py_Index_Type.tp_base = &Py_slice_Type;
+ if (PyType_Ready(&Py_Index_Type) < 0)
return;
if (PyType_Ready(&Py_comprehension_Type) < 0)
return;
1
0
commit of r41568 - in python/branches/ast-objects: . Include Parser Python
by martin.v.loewis 30 Nov '05
by martin.v.loewis 30 Nov '05
30 Nov '05
Author: martin.v.loewis
Date: Wed Nov 30 20:11:25 2005
New Revision: 41568
Removed:
python/branches/ast-objects/Include/asdl.h
python/branches/ast-objects/Python/asdl.c
Modified:
python/branches/ast-objects/Include/Python-ast.h
python/branches/ast-objects/Makefile.pre.in
python/branches/ast-objects/Parser/asdl_c.py
python/branches/ast-objects/Python/Python-ast.c
Log:
Convert asdl_c.py to generate PyObjects.
Modified: python/branches/ast-objects/Include/Python-ast.h
==============================================================================
--- python/branches/ast-objects/Include/Python-ast.h (original)
+++ python/branches/ast-objects/Include/Python-ast.h Wed Nov 30 20:11:25 2005
@@ -1,408 +1,565 @@
/* File automatically generated by ./Parser/asdl_c.py */
-#include "asdl.h"
+PyAPI_DATA(PyTypeObject) Py_mod_Type;
+#define Py_mod_Check(op) PyObject_TypeCheck(op, &Py_mod_Type)
-typedef struct _mod *mod_ty;
+struct Py_mod{
+ PyObject_HEAD
+};
+
+PyAPI_DATA(PyTypeObject) Py_mod_Module_Type;
+#define Py_mod_Module_Check(op) PyObject_TypeCheck(op, &Py_mod_Module_Type)
+
+struct Py_mod_Module{
+ struct Py_mod _base;
+ PyObject* body; /* stmt */
+};
+PyObject *Py_mod_Module_New(PyObject*);
+
+PyAPI_DATA(PyTypeObject) Py_mod_Interactive_Type;
+#define Py_mod_Interactive_Check(op) PyObject_TypeCheck(op, &Py_mod_Interactive_Type)
-typedef struct _stmt *stmt_ty;
+struct Py_mod_Interactive{
+ struct Py_mod _base;
+ PyObject* body; /* stmt */
+};
+PyObject *Py_mod_Interactive_New(PyObject*);
-typedef struct _expr *expr_ty;
+PyAPI_DATA(PyTypeObject) Py_mod_Expression_Type;
+#define Py_mod_Expression_Check(op) PyObject_TypeCheck(op, &Py_mod_Expression_Type)
+
+struct Py_mod_Expression{
+ struct Py_mod _base;
+ PyObject* body; /* expr */
+};
+PyObject *Py_mod_Expression_New(PyObject*);
+
+PyAPI_DATA(PyTypeObject) Py_mod_Suite_Type;
+#define Py_mod_Suite_Check(op) PyObject_TypeCheck(op, &Py_mod_Suite_Type)
+
+struct Py_mod_Suite{
+ struct Py_mod _base;
+ PyObject* body; /* stmt */
+};
+PyObject *Py_mod_Suite_New(PyObject*);
-typedef enum _expr_context { Load=1, Store=2, Del=3, AugLoad=4, AugStore=5,
- Param=6 } expr_context_ty;
-
-typedef struct _slice *slice_ty;
-
-typedef enum _boolop { And=1, Or=2 } boolop_ty;
-
-typedef enum _operator { Add=1, Sub=2, Mult=3, Div=4, Mod=5, Pow=6, LShift=7,
- RShift=8, BitOr=9, BitXor=10, BitAnd=11, FloorDiv=12 }
- operator_ty;
-
-typedef enum _unaryop { Invert=1, Not=2, UAdd=3, USub=4 } unaryop_ty;
-
-typedef enum _cmpop { Eq=1, NotEq=2, Lt=3, LtE=4, Gt=5, GtE=6, Is=7, IsNot=8,
- In=9, NotIn=10 } cmpop_ty;
-
-typedef struct _comprehension *comprehension_ty;
-
-typedef struct _excepthandler *excepthandler_ty;
-
-typedef struct _arguments *arguments_ty;
-
-typedef struct _keyword *keyword_ty;
-
-typedef struct _alias *alias_ty;
-
-
-struct _mod {
- enum { Module_kind=1, Interactive_kind=2, Expression_kind=3,
- Suite_kind=4 } kind;
- union {
- struct {
- asdl_seq *body;
- } Module;
-
- struct {
- asdl_seq *body;
- } Interactive;
-
- struct {
- expr_ty body;
- } Expression;
-
- struct {
- asdl_seq *body;
- } Suite;
-
- } v;
-};
-
-struct _stmt {
- enum { FunctionDef_kind=1, ClassDef_kind=2, Return_kind=3,
- Delete_kind=4, Assign_kind=5, AugAssign_kind=6, Print_kind=7,
- For_kind=8, While_kind=9, If_kind=10, Raise_kind=11,
- TryExcept_kind=12, TryFinally_kind=13, Assert_kind=14,
- Import_kind=15, ImportFrom_kind=16, Exec_kind=17,
- Global_kind=18, Expr_kind=19, Pass_kind=20, Break_kind=21,
- Continue_kind=22 } kind;
- union {
- struct {
- identifier name;
- arguments_ty args;
- asdl_seq *body;
- asdl_seq *decorators;
- } FunctionDef;
-
- struct {
- identifier name;
- asdl_seq *bases;
- asdl_seq *body;
- } ClassDef;
-
- struct {
- expr_ty value;
- } Return;
-
- struct {
- asdl_seq *targets;
- } Delete;
-
- struct {
- asdl_seq *targets;
- expr_ty value;
- } Assign;
-
- struct {
- expr_ty target;
- operator_ty op;
- expr_ty value;
- } AugAssign;
-
- struct {
- expr_ty dest;
- asdl_seq *values;
- bool nl;
- } Print;
-
- struct {
- expr_ty target;
- expr_ty iter;
- asdl_seq *body;
- asdl_seq *orelse;
- } For;
-
- struct {
- expr_ty test;
- asdl_seq *body;
- asdl_seq *orelse;
- } While;
-
- struct {
- expr_ty test;
- asdl_seq *body;
- asdl_seq *orelse;
- } If;
-
- struct {
- expr_ty type;
- expr_ty inst;
- expr_ty tback;
- } Raise;
-
- struct {
- asdl_seq *body;
- asdl_seq *handlers;
- asdl_seq *orelse;
- } TryExcept;
-
- struct {
- asdl_seq *body;
- asdl_seq *finalbody;
- } TryFinally;
-
- struct {
- expr_ty test;
- expr_ty msg;
- } Assert;
-
- struct {
- asdl_seq *names;
- } Import;
-
- struct {
- identifier module;
- asdl_seq *names;
- } ImportFrom;
-
- struct {
- expr_ty body;
- expr_ty globals;
- expr_ty locals;
- } Exec;
-
- struct {
- asdl_seq *names;
- } Global;
-
- struct {
- expr_ty value;
- } Expr;
-
- } v;
+PyAPI_DATA(PyTypeObject) Py_stmt_Type;
+#define Py_stmt_Check(op) PyObject_TypeCheck(op, &Py_stmt_Type)
+
+struct Py_stmt{
+ PyObject_HEAD
int lineno;
};
-struct _expr {
- enum { BoolOp_kind=1, BinOp_kind=2, UnaryOp_kind=3, Lambda_kind=4,
- Dict_kind=5, ListComp_kind=6, GeneratorExp_kind=7, Yield_kind=8,
- Compare_kind=9, Call_kind=10, Repr_kind=11, Num_kind=12,
- Str_kind=13, Attribute_kind=14, Subscript_kind=15, Name_kind=16,
- List_kind=17, Tuple_kind=18 } kind;
- union {
- struct {
- boolop_ty op;
- asdl_seq *values;
- } BoolOp;
-
- struct {
- expr_ty left;
- operator_ty op;
- expr_ty right;
- } BinOp;
-
- struct {
- unaryop_ty op;
- expr_ty operand;
- } UnaryOp;
-
- struct {
- arguments_ty args;
- expr_ty body;
- } Lambda;
-
- struct {
- asdl_seq *keys;
- asdl_seq *values;
- } Dict;
-
- struct {
- expr_ty elt;
- asdl_seq *generators;
- } ListComp;
-
- struct {
- expr_ty elt;
- asdl_seq *generators;
- } GeneratorExp;
-
- struct {
- expr_ty value;
- } Yield;
-
- struct {
- expr_ty left;
- asdl_seq *ops;
- asdl_seq *comparators;
- } Compare;
-
- struct {
- expr_ty func;
- asdl_seq *args;
- asdl_seq *keywords;
- expr_ty starargs;
- expr_ty kwargs;
- } Call;
-
- struct {
- expr_ty value;
- } Repr;
-
- struct {
- object n;
- } Num;
-
- struct {
- string s;
- } Str;
-
- struct {
- expr_ty value;
- identifier attr;
- expr_context_ty ctx;
- } Attribute;
-
- struct {
- expr_ty value;
- slice_ty slice;
- expr_context_ty ctx;
- } Subscript;
-
- struct {
- identifier id;
- expr_context_ty ctx;
- } Name;
-
- struct {
- asdl_seq *elts;
- expr_context_ty ctx;
- } List;
-
- struct {
- asdl_seq *elts;
- expr_context_ty ctx;
- } Tuple;
-
- } v;
+PyAPI_DATA(PyTypeObject) Py_stmt_FunctionDef_Type;
+#define Py_stmt_FunctionDef_Check(op) PyObject_TypeCheck(op, &Py_stmt_FunctionDef_Type)
+
+struct Py_stmt_FunctionDef{
+ struct Py_stmt _base;
+ PyObject* name; /* identifier */
+ PyObject* args; /* arguments */
+ PyObject* body; /* stmt */
+ PyObject* decorators; /* expr */
+};
+PyObject *Py_stmt_FunctionDef_New(PyObject*, PyObject*, PyObject*, PyObject*,
+ int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_ClassDef_Type;
+#define Py_stmt_ClassDef_Check(op) PyObject_TypeCheck(op, &Py_stmt_ClassDef_Type)
+
+struct Py_stmt_ClassDef{
+ struct Py_stmt _base;
+ PyObject* name; /* identifier */
+ PyObject* bases; /* expr */
+ PyObject* body; /* stmt */
+};
+PyObject *Py_stmt_ClassDef_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Return_Type;
+#define Py_stmt_Return_Check(op) PyObject_TypeCheck(op, &Py_stmt_Return_Type)
+
+struct Py_stmt_Return{
+ struct Py_stmt _base;
+ PyObject* value; /* expr */
+};
+PyObject *Py_stmt_Return_New(PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Delete_Type;
+#define Py_stmt_Delete_Check(op) PyObject_TypeCheck(op, &Py_stmt_Delete_Type)
+
+struct Py_stmt_Delete{
+ struct Py_stmt _base;
+ PyObject* targets; /* expr */
+};
+PyObject *Py_stmt_Delete_New(PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Assign_Type;
+#define Py_stmt_Assign_Check(op) PyObject_TypeCheck(op, &Py_stmt_Assign_Type)
+
+struct Py_stmt_Assign{
+ struct Py_stmt _base;
+ PyObject* targets; /* expr */
+ PyObject* value; /* expr */
+};
+PyObject *Py_stmt_Assign_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_AugAssign_Type;
+#define Py_stmt_AugAssign_Check(op) PyObject_TypeCheck(op, &Py_stmt_AugAssign_Type)
+
+struct Py_stmt_AugAssign{
+ struct Py_stmt _base;
+ PyObject* target; /* expr */
+ PyObject* op; /* operator */
+ PyObject* value; /* expr */
+};
+PyObject *Py_stmt_AugAssign_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Print_Type;
+#define Py_stmt_Print_Check(op) PyObject_TypeCheck(op, &Py_stmt_Print_Type)
+
+struct Py_stmt_Print{
+ struct Py_stmt _base;
+ PyObject* dest; /* expr */
+ PyObject* values; /* expr */
+ PyObject* nl; /* bool */
+};
+PyObject *Py_stmt_Print_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_For_Type;
+#define Py_stmt_For_Check(op) PyObject_TypeCheck(op, &Py_stmt_For_Type)
+
+struct Py_stmt_For{
+ struct Py_stmt _base;
+ PyObject* target; /* expr */
+ PyObject* iter; /* expr */
+ PyObject* body; /* stmt */
+ PyObject* orelse; /* stmt */
+};
+PyObject *Py_stmt_For_New(PyObject*, PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_While_Type;
+#define Py_stmt_While_Check(op) PyObject_TypeCheck(op, &Py_stmt_While_Type)
+
+struct Py_stmt_While{
+ struct Py_stmt _base;
+ PyObject* test; /* expr */
+ PyObject* body; /* stmt */
+ PyObject* orelse; /* stmt */
+};
+PyObject *Py_stmt_While_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_If_Type;
+#define Py_stmt_If_Check(op) PyObject_TypeCheck(op, &Py_stmt_If_Type)
+
+struct Py_stmt_If{
+ struct Py_stmt _base;
+ PyObject* test; /* expr */
+ PyObject* body; /* stmt */
+ PyObject* orelse; /* stmt */
+};
+PyObject *Py_stmt_If_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Raise_Type;
+#define Py_stmt_Raise_Check(op) PyObject_TypeCheck(op, &Py_stmt_Raise_Type)
+
+struct Py_stmt_Raise{
+ struct Py_stmt _base;
+ PyObject* type; /* expr */
+ PyObject* inst; /* expr */
+ PyObject* tback; /* expr */
+};
+PyObject *Py_stmt_Raise_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_TryExcept_Type;
+#define Py_stmt_TryExcept_Check(op) PyObject_TypeCheck(op, &Py_stmt_TryExcept_Type)
+
+struct Py_stmt_TryExcept{
+ struct Py_stmt _base;
+ PyObject* body; /* stmt */
+ PyObject* handlers; /* excepthandler */
+ PyObject* orelse; /* stmt */
+};
+PyObject *Py_stmt_TryExcept_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_TryFinally_Type;
+#define Py_stmt_TryFinally_Check(op) PyObject_TypeCheck(op, &Py_stmt_TryFinally_Type)
+
+struct Py_stmt_TryFinally{
+ struct Py_stmt _base;
+ PyObject* body; /* stmt */
+ PyObject* finalbody; /* stmt */
+};
+PyObject *Py_stmt_TryFinally_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Assert_Type;
+#define Py_stmt_Assert_Check(op) PyObject_TypeCheck(op, &Py_stmt_Assert_Type)
+
+struct Py_stmt_Assert{
+ struct Py_stmt _base;
+ PyObject* test; /* expr */
+ PyObject* msg; /* expr */
+};
+PyObject *Py_stmt_Assert_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Import_Type;
+#define Py_stmt_Import_Check(op) PyObject_TypeCheck(op, &Py_stmt_Import_Type)
+
+struct Py_stmt_Import{
+ struct Py_stmt _base;
+ PyObject* names; /* alias */
+};
+PyObject *Py_stmt_Import_New(PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_ImportFrom_Type;
+#define Py_stmt_ImportFrom_Check(op) PyObject_TypeCheck(op, &Py_stmt_ImportFrom_Type)
+
+struct Py_stmt_ImportFrom{
+ struct Py_stmt _base;
+ PyObject* module; /* identifier */
+ PyObject* names; /* alias */
+};
+PyObject *Py_stmt_ImportFrom_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Exec_Type;
+#define Py_stmt_Exec_Check(op) PyObject_TypeCheck(op, &Py_stmt_Exec_Type)
+
+struct Py_stmt_Exec{
+ struct Py_stmt _base;
+ PyObject* body; /* expr */
+ PyObject* globals; /* expr */
+ PyObject* locals; /* expr */
+};
+PyObject *Py_stmt_Exec_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Global_Type;
+#define Py_stmt_Global_Check(op) PyObject_TypeCheck(op, &Py_stmt_Global_Type)
+
+struct Py_stmt_Global{
+ struct Py_stmt _base;
+ PyObject* names; /* identifier */
+};
+PyObject *Py_stmt_Global_New(PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Expr_Type;
+#define Py_stmt_Expr_Check(op) PyObject_TypeCheck(op, &Py_stmt_Expr_Type)
+
+struct Py_stmt_Expr{
+ struct Py_stmt _base;
+ PyObject* value; /* expr */
+};
+PyObject *Py_stmt_Expr_New(PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Pass_Type;
+#define Py_stmt_Pass_Check(op) PyObject_TypeCheck(op, &Py_stmt_Pass_Type)
+
+struct Py_stmt_Pass{
+ struct Py_stmt _base;
+};
+PyObject *Py_stmt_Pass_New(int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Break_Type;
+#define Py_stmt_Break_Check(op) PyObject_TypeCheck(op, &Py_stmt_Break_Type)
+
+struct Py_stmt_Break{
+ struct Py_stmt _base;
+};
+PyObject *Py_stmt_Break_New(int);
+
+PyAPI_DATA(PyTypeObject) Py_stmt_Continue_Type;
+#define Py_stmt_Continue_Check(op) PyObject_TypeCheck(op, &Py_stmt_Continue_Type)
+
+struct Py_stmt_Continue{
+ struct Py_stmt _base;
+};
+PyObject *Py_stmt_Continue_New(int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Type;
+#define Py_expr_Check(op) PyObject_TypeCheck(op, &Py_expr_Type)
+
+struct Py_expr{
+ PyObject_HEAD
int lineno;
};
-struct _slice {
- enum { Ellipsis_kind=1, Slice_kind=2, ExtSlice_kind=3, Index_kind=4 }
- kind;
- union {
- struct {
- expr_ty lower;
- expr_ty upper;
- expr_ty step;
- } Slice;
-
- struct {
- asdl_seq *dims;
- } ExtSlice;
-
- struct {
- expr_ty value;
- } Index;
-
- } v;
-};
-
-struct _comprehension {
- expr_ty target;
- expr_ty iter;
- asdl_seq *ifs;
-};
-
-struct _excepthandler {
- expr_ty type;
- expr_ty name;
- asdl_seq *body;
-};
-
-struct _arguments {
- asdl_seq *args;
- identifier vararg;
- identifier kwarg;
- asdl_seq *defaults;
-};
-
-struct _keyword {
- identifier arg;
- expr_ty value;
-};
-
-struct _alias {
- identifier name;
- identifier asname;
-};
-
-
-mod_ty Module(asdl_seq * body);
-mod_ty Interactive(asdl_seq * body);
-mod_ty Expression(expr_ty body);
-mod_ty Suite(asdl_seq * body);
-stmt_ty FunctionDef(identifier name, arguments_ty args, asdl_seq * body,
- asdl_seq * decorators, int lineno);
-stmt_ty ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, int
- lineno);
-stmt_ty Return(expr_ty value, int lineno);
-stmt_ty Delete(asdl_seq * targets, int lineno);
-stmt_ty Assign(asdl_seq * targets, expr_ty value, int lineno);
-stmt_ty AugAssign(expr_ty target, operator_ty op, expr_ty value, int lineno);
-stmt_ty Print(expr_ty dest, asdl_seq * values, bool nl, int lineno);
-stmt_ty For(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse,
- int lineno);
-stmt_ty While(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno);
-stmt_ty If(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno);
-stmt_ty Raise(expr_ty type, expr_ty inst, expr_ty tback, int lineno);
-stmt_ty TryExcept(asdl_seq * body, asdl_seq * handlers, asdl_seq * orelse, int
- lineno);
-stmt_ty TryFinally(asdl_seq * body, asdl_seq * finalbody, int lineno);
-stmt_ty Assert(expr_ty test, expr_ty msg, int lineno);
-stmt_ty Import(asdl_seq * names, int lineno);
-stmt_ty ImportFrom(identifier module, asdl_seq * names, int lineno);
-stmt_ty Exec(expr_ty body, expr_ty globals, expr_ty locals, int lineno);
-stmt_ty Global(asdl_seq * names, int lineno);
-stmt_ty Expr(expr_ty value, int lineno);
-stmt_ty Pass(int lineno);
-stmt_ty Break(int lineno);
-stmt_ty Continue(int lineno);
-expr_ty BoolOp(boolop_ty op, asdl_seq * values, int lineno);
-expr_ty BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno);
-expr_ty UnaryOp(unaryop_ty op, expr_ty operand, int lineno);
-expr_ty Lambda(arguments_ty args, expr_ty body, int lineno);
-expr_ty Dict(asdl_seq * keys, asdl_seq * values, int lineno);
-expr_ty ListComp(expr_ty elt, asdl_seq * generators, int lineno);
-expr_ty GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno);
-expr_ty Yield(expr_ty value, int lineno);
-expr_ty Compare(expr_ty left, asdl_seq * ops, asdl_seq * comparators, int
- lineno);
-expr_ty Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, expr_ty
- starargs, expr_ty kwargs, int lineno);
-expr_ty Repr(expr_ty value, int lineno);
-expr_ty Num(object n, int lineno);
-expr_ty Str(string s, int lineno);
-expr_ty Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int
- lineno);
-expr_ty Subscript(expr_ty value, slice_ty slice, expr_context_ty ctx, int
- lineno);
-expr_ty Name(identifier id, expr_context_ty ctx, int lineno);
-expr_ty List(asdl_seq * elts, expr_context_ty ctx, int lineno);
-expr_ty Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno);
-slice_ty Ellipsis(void);
-slice_ty Slice(expr_ty lower, expr_ty upper, expr_ty step);
-slice_ty ExtSlice(asdl_seq * dims);
-slice_ty Index(expr_ty value);
-comprehension_ty comprehension(expr_ty target, expr_ty iter, asdl_seq * ifs);
-excepthandler_ty excepthandler(expr_ty type, expr_ty name, asdl_seq * body);
-arguments_ty arguments(asdl_seq * args, identifier vararg, identifier kwarg,
- asdl_seq * defaults);
-keyword_ty keyword(identifier arg, expr_ty value);
-alias_ty alias(identifier name, identifier asname);
-
-void free_mod(mod_ty);
-void free_stmt(stmt_ty);
-void free_expr(expr_ty);
-void free_expr_context(expr_context_ty);
-void free_slice(slice_ty);
-void free_boolop(boolop_ty);
-void free_operator(operator_ty);
-void free_unaryop(unaryop_ty);
-void free_cmpop(cmpop_ty);
-void free_comprehension(comprehension_ty);
-void free_excepthandler(excepthandler_ty);
-void free_arguments(arguments_ty);
-void free_keyword(keyword_ty);
-void free_alias(alias_ty);
+PyAPI_DATA(PyTypeObject) Py_expr_BoolOp_Type;
+#define Py_expr_BoolOp_Check(op) PyObject_TypeCheck(op, &Py_expr_BoolOp_Type)
+
+struct Py_expr_BoolOp{
+ struct Py_expr _base;
+ PyObject* op; /* boolop */
+ PyObject* values; /* expr */
+};
+PyObject *Py_expr_BoolOp_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_BinOp_Type;
+#define Py_expr_BinOp_Check(op) PyObject_TypeCheck(op, &Py_expr_BinOp_Type)
+
+struct Py_expr_BinOp{
+ struct Py_expr _base;
+ PyObject* left; /* expr */
+ PyObject* op; /* operator */
+ PyObject* right; /* expr */
+};
+PyObject *Py_expr_BinOp_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_UnaryOp_Type;
+#define Py_expr_UnaryOp_Check(op) PyObject_TypeCheck(op, &Py_expr_UnaryOp_Type)
+
+struct Py_expr_UnaryOp{
+ struct Py_expr _base;
+ PyObject* op; /* unaryop */
+ PyObject* operand; /* expr */
+};
+PyObject *Py_expr_UnaryOp_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Lambda_Type;
+#define Py_expr_Lambda_Check(op) PyObject_TypeCheck(op, &Py_expr_Lambda_Type)
+
+struct Py_expr_Lambda{
+ struct Py_expr _base;
+ PyObject* args; /* arguments */
+ PyObject* body; /* expr */
+};
+PyObject *Py_expr_Lambda_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Dict_Type;
+#define Py_expr_Dict_Check(op) PyObject_TypeCheck(op, &Py_expr_Dict_Type)
+
+struct Py_expr_Dict{
+ struct Py_expr _base;
+ PyObject* keys; /* expr */
+ PyObject* values; /* expr */
+};
+PyObject *Py_expr_Dict_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_ListComp_Type;
+#define Py_expr_ListComp_Check(op) PyObject_TypeCheck(op, &Py_expr_ListComp_Type)
+
+struct Py_expr_ListComp{
+ struct Py_expr _base;
+ PyObject* elt; /* expr */
+ PyObject* generators; /* comprehension */
+};
+PyObject *Py_expr_ListComp_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_GeneratorExp_Type;
+#define Py_expr_GeneratorExp_Check(op) PyObject_TypeCheck(op, &Py_expr_GeneratorExp_Type)
+
+struct Py_expr_GeneratorExp{
+ struct Py_expr _base;
+ PyObject* elt; /* expr */
+ PyObject* generators; /* comprehension */
+};
+PyObject *Py_expr_GeneratorExp_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Yield_Type;
+#define Py_expr_Yield_Check(op) PyObject_TypeCheck(op, &Py_expr_Yield_Type)
+
+struct Py_expr_Yield{
+ struct Py_expr _base;
+ PyObject* value; /* expr */
+};
+PyObject *Py_expr_Yield_New(PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Compare_Type;
+#define Py_expr_Compare_Check(op) PyObject_TypeCheck(op, &Py_expr_Compare_Type)
+
+struct Py_expr_Compare{
+ struct Py_expr _base;
+ PyObject* left; /* expr */
+ PyObject* ops; /* cmpop */
+ PyObject* comparators; /* expr */
+};
+PyObject *Py_expr_Compare_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Call_Type;
+#define Py_expr_Call_Check(op) PyObject_TypeCheck(op, &Py_expr_Call_Type)
+
+struct Py_expr_Call{
+ struct Py_expr _base;
+ PyObject* func; /* expr */
+ PyObject* args; /* expr */
+ PyObject* keywords; /* keyword */
+ PyObject* starargs; /* expr */
+ PyObject* kwargs; /* expr */
+};
+PyObject *Py_expr_Call_New(PyObject*, PyObject*, PyObject*, PyObject*,
+ PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Repr_Type;
+#define Py_expr_Repr_Check(op) PyObject_TypeCheck(op, &Py_expr_Repr_Type)
+
+struct Py_expr_Repr{
+ struct Py_expr _base;
+ PyObject* value; /* expr */
+};
+PyObject *Py_expr_Repr_New(PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Num_Type;
+#define Py_expr_Num_Check(op) PyObject_TypeCheck(op, &Py_expr_Num_Type)
+
+struct Py_expr_Num{
+ struct Py_expr _base;
+ PyObject* n; /* object */
+};
+PyObject *Py_expr_Num_New(PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Str_Type;
+#define Py_expr_Str_Check(op) PyObject_TypeCheck(op, &Py_expr_Str_Type)
+
+struct Py_expr_Str{
+ struct Py_expr _base;
+ PyObject* s; /* string */
+};
+PyObject *Py_expr_Str_New(PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Attribute_Type;
+#define Py_expr_Attribute_Check(op) PyObject_TypeCheck(op, &Py_expr_Attribute_Type)
+
+struct Py_expr_Attribute{
+ struct Py_expr _base;
+ PyObject* value; /* expr */
+ PyObject* attr; /* identifier */
+ PyObject* ctx; /* expr_context */
+};
+PyObject *Py_expr_Attribute_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Subscript_Type;
+#define Py_expr_Subscript_Check(op) PyObject_TypeCheck(op, &Py_expr_Subscript_Type)
+
+struct Py_expr_Subscript{
+ struct Py_expr _base;
+ PyObject* value; /* expr */
+ PyObject* slice; /* slice */
+ PyObject* ctx; /* expr_context */
+};
+PyObject *Py_expr_Subscript_New(PyObject*, PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Name_Type;
+#define Py_expr_Name_Check(op) PyObject_TypeCheck(op, &Py_expr_Name_Type)
+
+struct Py_expr_Name{
+ struct Py_expr _base;
+ PyObject* id; /* identifier */
+ PyObject* ctx; /* expr_context */
+};
+PyObject *Py_expr_Name_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_List_Type;
+#define Py_expr_List_Check(op) PyObject_TypeCheck(op, &Py_expr_List_Type)
+
+struct Py_expr_List{
+ struct Py_expr _base;
+ PyObject* elts; /* expr */
+ PyObject* ctx; /* expr_context */
+};
+PyObject *Py_expr_List_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_expr_Tuple_Type;
+#define Py_expr_Tuple_Check(op) PyObject_TypeCheck(op, &Py_expr_Tuple_Type)
+
+struct Py_expr_Tuple{
+ struct Py_expr _base;
+ PyObject* elts; /* expr */
+ PyObject* ctx; /* expr_context */
+};
+PyObject *Py_expr_Tuple_New(PyObject*, PyObject*, int);
+
+PyAPI_DATA(PyTypeObject) Py_slice_Type;
+#define Py_slice_Check(op) PyObject_TypeCheck(op, &Py_slice_Type)
+
+struct Py_slice{
+ PyObject_HEAD
+};
+
+PyAPI_DATA(PyTypeObject) Py_slice_Ellipsis_Type;
+#define Py_slice_Ellipsis_Check(op) PyObject_TypeCheck(op, &Py_slice_Ellipsis_Type)
+
+struct Py_slice_Ellipsis{
+ struct Py_slice _base;
+};
+PyObject *Py_slice_Ellipsis_New(void);
+
+PyAPI_DATA(PyTypeObject) Py_slice_Slice_Type;
+#define Py_slice_Slice_Check(op) PyObject_TypeCheck(op, &Py_slice_Slice_Type)
+
+struct Py_slice_Slice{
+ struct Py_slice _base;
+ PyObject* lower; /* expr */
+ PyObject* upper; /* expr */
+ PyObject* step; /* expr */
+};
+PyObject *Py_slice_Slice_New(PyObject*, PyObject*, PyObject*);
+
+PyAPI_DATA(PyTypeObject) Py_slice_ExtSlice_Type;
+#define Py_slice_ExtSlice_Check(op) PyObject_TypeCheck(op, &Py_slice_ExtSlice_Type)
+
+struct Py_slice_ExtSlice{
+ struct Py_slice _base;
+ PyObject* dims; /* slice */
+};
+PyObject *Py_slice_ExtSlice_New(PyObject*);
+
+PyAPI_DATA(PyTypeObject) Py_slice_Index_Type;
+#define Py_slice_Index_Check(op) PyObject_TypeCheck(op, &Py_slice_Index_Type)
+
+struct Py_slice_Index{
+ struct Py_slice _base;
+ PyObject* value; /* expr */
+};
+PyObject *Py_slice_Index_New(PyObject*);
+
+PyAPI_DATA(PyTypeObject) Py_comprehension_Type;
+#define Py_comprehension_Check(op) PyObject_TypeCheck(op, &Py_comprehension_Type)
+
+struct Py_comprehension {
+ PyObject_HEAD
+ PyObject* target; /* expr */
+ PyObject* iter; /* expr */
+ PyObject* ifs; /* expr */
+};
+PyObject *Py_comprehension_New(PyObject*, PyObject*, PyObject*);
+
+PyAPI_DATA(PyTypeObject) Py_excepthandler_Type;
+#define Py_excepthandler_Check(op) PyObject_TypeCheck(op, &Py_excepthandler_Type)
+
+struct Py_excepthandler {
+ PyObject_HEAD
+ PyObject* type; /* expr */
+ PyObject* name; /* expr */
+ PyObject* body; /* stmt */
+};
+PyObject *Py_excepthandler_New(PyObject*, PyObject*, PyObject*);
+
+PyAPI_DATA(PyTypeObject) Py_arguments_Type;
+#define Py_arguments_Check(op) PyObject_TypeCheck(op, &Py_arguments_Type)
+
+struct Py_arguments {
+ PyObject_HEAD
+ PyObject* args; /* expr */
+ PyObject* vararg; /* identifier */
+ PyObject* kwarg; /* identifier */
+ PyObject* defaults; /* expr */
+};
+PyObject *Py_arguments_New(PyObject*, PyObject*, PyObject*, PyObject*);
+
+PyAPI_DATA(PyTypeObject) Py_keyword_Type;
+#define Py_keyword_Check(op) PyObject_TypeCheck(op, &Py_keyword_Type)
+
+struct Py_keyword {
+ PyObject_HEAD
+ PyObject* arg; /* identifier */
+ PyObject* value; /* expr */
+};
+PyObject *Py_keyword_New(PyObject*, PyObject*);
+
+PyAPI_DATA(PyTypeObject) Py_alias_Type;
+#define Py_alias_Check(op) PyObject_TypeCheck(op, &Py_alias_Type)
+
+struct Py_alias {
+ PyObject_HEAD
+ PyObject* name; /* identifier */
+ PyObject* asname; /* identifier */
+};
+PyObject *Py_alias_New(PyObject*, PyObject*);
Deleted: /python/branches/ast-objects/Include/asdl.h
==============================================================================
--- /python/branches/ast-objects/Include/asdl.h Wed Nov 30 20:11:25 2005
+++ (empty file)
@@ -1,47 +0,0 @@
-#ifndef Py_ASDL_H
-#define Py_ASDL_H
-
-typedef PyObject * identifier;
-typedef PyObject * string;
-typedef PyObject * object;
-
-typedef enum {false, true} bool;
-
-/* It would be nice if the code generated by asdl_c.py was completely
- independent of Python, but it is a goal the requires too much work
- at this stage. So, for example, I'll represent identifiers as
- interned Python strings.
-*/
-
-/* XXX A sequence should be typed so that its use can be typechecked. */
-
-/* XXX We shouldn't pay for offset when we don't need APPEND. */
-
-typedef struct {
- int size;
- int offset;
- void *elements[1];
-} asdl_seq;
-
-asdl_seq *asdl_seq_new(int size);
-void asdl_seq_free(asdl_seq *);
-
-#ifdef Py_DEBUG
-#define asdl_seq_GET(S, I) (S)->elements[(I)]
-#define asdl_seq_SET(S, I, V) { \
- int _asdl_i = (I); \
- assert((S) && _asdl_i < (S)->size); \
- (S)->elements[_asdl_i] = (V); \
-}
-#define asdl_seq_APPEND(S, V) { \
- assert((S) && (S)->offset < (S)->size); \
- (S)->elements[(S)->offset++] = (V); \
-}
-#else
-#define asdl_seq_GET(S, I) (S)->elements[(I)]
-#define asdl_seq_SET(S, I, V) (S)->elements[I] = (V)
-#define asdl_seq_APPEND(S, V) (S)->elements[(S)->offset++] = (V)
-#endif
-#define asdl_seq_LEN(S) ((S) == NULL ? 0 : (S)->size)
-
-#endif /* !Py_ASDL_H */
Modified: python/branches/ast-objects/Makefile.pre.in
==============================================================================
--- python/branches/ast-objects/Makefile.pre.in (original)
+++ python/branches/ast-objects/Makefile.pre.in Wed Nov 30 20:11:25 2005
@@ -230,7 +230,6 @@
# Python
PYTHON_OBJS= \
Python/Python-ast.o \
- Python/asdl.o \
Python/ast.o \
Python/bltinmodule.o \
Python/exceptions.o \
@@ -490,7 +489,6 @@
PYTHON_HEADERS= \
Include/Python.h \
Include/Python-ast.h \
- Include/asdl.h \
Include/abstract.h \
Include/boolobject.h \
Include/bufferobject.h \
Modified: python/branches/ast-objects/Parser/asdl_c.py
==============================================================================
--- python/branches/ast-objects/Parser/asdl_c.py (original)
+++ python/branches/ast-objects/Parser/asdl_c.py Wed Nov 30 20:11:25 2005
@@ -14,16 +14,14 @@
def get_c_type(name):
"""Return a string for the C name of the type.
- This function special cases the default types provided by asdl:
- identifier, string, int, bool.
+ This function special cases int; everything else is PyObject*:
"""
- # XXX ack! need to figure out where Id is useful and where string
if isinstance(name, asdl.Id):
name = name.value
- if name in asdl.builtin_types:
+ if name in ("int"):
return name
else:
- return "%s_ty" % name
+ return "PyObject*"
def reflow_lines(s, depth):
"""Reflow the line s indented depth tabs.
@@ -96,46 +94,48 @@
line = (" " * TABSIZE * depth) + line + "\n"
self.file.write(line)
-class TypeDefVisitor(EmitVisitor):
+class TraversalVisitor(EmitVisitor):
+
def visitModule(self, mod):
for dfn in mod.dfns:
self.visit(dfn)
- def visitType(self, type, depth=0):
- self.visit(type.value, type.name, depth)
+ def visitType(self, type):
+ self.visit(type.value, type.name)
- def visitSum(self, sum, name, depth):
+ def visitSum(self, sum, name):
if is_simple(sum):
- self.simple_sum(sum, name, depth)
+ pass # XXX
else:
- self.sum_with_constructors(sum, name, depth)
+ for t in sum.types:
+ self.visit(t, name, sum.attributes)
- def simple_sum(self, sum, name, depth):
- enum = []
- for i in range(len(sum.types)):
- type = sum.types[i]
- enum.append("%s=%d" % (type.name, i + 1))
- enums = ", ".join(enum)
- ctype = get_c_type(name)
- s = "typedef enum _%s { %s } %s;" % (name, enums, ctype)
- self.emit(s, depth)
- self.emit("", depth)
+ def get_args(self, fields):
+ """Return list of C argument into, one for each field.
- def sum_with_constructors(self, sum, name, depth):
- ctype = get_c_type(name)
- s = "typedef struct _%(name)s *%(ctype)s;" % locals()
- self.emit(s, depth)
- self.emit("", depth)
+ Argument info is 3-tuple of a C type, variable name, and flag
+ that is true if type can be NULL.
+ """
+ args = []
+ for i,f in enumerate(fields):
+ if f.name is None:
+ name = "name%d" % i
+ else:
+ name = f.name
+ ctype = get_c_type(f.type)
+ args.append((ctype, name, f.opt or f.seq))
+ return args
- def visitProduct(self, product, name, depth):
- ctype = get_c_type(name)
- s = "typedef struct _%(name)s *%(ctype)s;" % locals()
- self.emit(s, depth)
- self.emit("", depth)
-class StructVisitor(EmitVisitor):
+class HeaderVisitor(EmitVisitor):
"""Visitor to generate typdefs for AST."""
+ def emit_check(self, t, depth):
+ self.emit("PyAPI_DATA(PyTypeObject) Py_%s_Type;" % t, depth)
+ self.emit("#define Py_%s_Check(op) PyObject_TypeCheck(op, &Py_%s_Type)" % (t, t),
+ depth, reflow=False)
+ self.emit("",depth)
+
def visitModule(self, mod):
for dfn in mod.dfns:
self.visit(dfn)
@@ -150,483 +150,171 @@
def sum_with_constructors(self, sum, name, depth):
def emit(s, depth=depth):
self.emit(s % sys._getframe(1).f_locals, depth)
- enum = []
- for i in range(len(sum.types)):
- type = sum.types[i]
- enum.append("%s_kind=%d" % (type.name, i + 1))
-
- emit("struct _%(name)s {")
- emit("enum { " + ", ".join(enum) + " } kind;", depth + 1)
- emit("union {", depth + 1)
- for t in sum.types:
- self.visit(t, depth + 2)
- emit("} v;", depth + 1)
+ self.emit_check(name, depth)
+ emit("struct Py_%s{" % name)
+ emit("PyObject_HEAD", depth + 1)
for field in sum.attributes:
- # rudimentary attribute handling
type = str(field.type)
assert type in asdl.builtin_types, type
- emit("%s %s;" % (type, field.name), depth + 1);
+ emit("%s %s;" % (type, field.name), depth + 1)
emit("};")
emit("")
+ for t in sum.types:
+ self.visitConstructor(name, t, sum.attributes, depth)
- def visitConstructor(self, cons, depth):
- if cons.fields:
- self.emit("struct {", depth)
- for f in cons.fields:
- self.visit(f, depth + 1)
- self.emit("} %s;" % cons.name, depth)
- self.emit("", depth)
- else:
- # XXX not sure what I want here, nothing is probably fine
- pass
+ def visitConstructor(self, name, cons, attrs, depth):
+ self.emit_check("%s_%s" % (name, cons.name), depth)
+ self.emit("struct Py_%s_%s{" % (name, cons.name), depth)
+ self.emit("struct Py_%s _base;" % name, depth+1)
+ field_types = []
+ for f in cons.fields:
+ field_types.append(get_c_type(f.type))
+ self.visit(f, depth + 1)
+ for f in attrs:
+ field_types.append(get_c_type(f.type))
+ self.emit("};" % cons.name, depth)
+ args = ", ".join(field_types) or "void"
+ self.emit("PyObject *Py_%s_%s_New(%s);" % (name, cons.name, args), depth)
+ self.emit("", depth)
def visitField(self, field, depth):
- # XXX need to lookup field.type, because it might be something
- # like a builtin...
ctype = get_c_type(field.type)
- name = field.name
- if field.seq:
- self.emit("asdl_seq *%(name)s;" % locals(), depth)
- else:
- self.emit("%(ctype)s %(name)s;" % locals(), depth)
+ self.emit("%s %s; /* %s */" % (ctype, field.name, field.type), depth)
def visitProduct(self, product, name, depth):
- self.emit("struct _%(name)s {" % locals(), depth)
+ self.emit_check(str(name), depth)
+ self.emit("struct Py_%(name)s {" % locals(), depth)
+ self.emit("PyObject_HEAD", depth+1)
+ field_types = []
for f in product.fields:
+ field_types.append(get_c_type(f.type))
self.visit(f, depth + 1)
self.emit("};", depth)
+ self.emit("PyObject *Py_%s_New(%s);" % (name, ", ".join(field_types)), depth)
self.emit("", depth)
-class PrototypeVisitor(EmitVisitor):
- """Generate function prototypes for the .h file"""
-
- def visitModule(self, mod):
- for dfn in mod.dfns:
- self.visit(dfn)
-
- def visitType(self, type):
- self.visit(type.value, type.name)
-
- def visitSum(self, sum, name):
- if is_simple(sum):
- pass # XXX
- else:
- for t in sum.types:
- self.visit(t, name, sum.attributes)
-
- def get_args(self, fields):
- """Return list of C argument into, one for each field.
-
- Argument info is 3-tuple of a C type, variable name, and flag
- that is true if type can be NULL.
- """
- args = []
- unnamed = {}
- for f in fields:
- if f.name is None:
- name = f.type
- c = unnamed[name] = unnamed.get(name, 0) + 1
- if c > 1:
- name = "name%d" % (c - 1)
- else:
- name = f.name
- # XXX should extend get_c_type() to handle this
- if f.seq:
- ctype = "asdl_seq *"
- else:
- ctype = get_c_type(f.type)
- args.append((ctype, name, f.opt or f.seq))
- return args
-
- def visitConstructor(self, cons, type, attrs):
- args = self.get_args(cons.fields)
- attrs = self.get_args(attrs)
- ctype = get_c_type(type)
- self.emit_function(cons.name, ctype, args, attrs)
-
- def emit_function(self, name, ctype, args, attrs, union=1):
- args = args + attrs
- if args:
- argstr = ", ".join(["%s %s" % (atype, aname)
- for atype, aname, opt in args])
- else:
- argstr = "void"
- self.emit("%s %s(%s);" % (ctype, name, argstr), 0)
-
- def visitProduct(self, prod, name):
- self.emit_function(name, get_c_type(name),
- self.get_args(prod.fields), [], union=0)
-
-class FunctionVisitor(PrototypeVisitor):
+class FunctionVisitor(TraversalVisitor):
"""Visitor to generate constructor functions for AST."""
- def emit_function(self, name, ctype, args, attrs, union=1):
+ def emit_ctor(self, name, args, attrs):
def emit(s, depth=0, reflow=1):
self.emit(s, depth, reflow)
argstr = ", ".join(["%s %s" % (atype, aname)
for atype, aname, opt in args + attrs])
- self.emit("%s" % ctype, 0)
- emit("%s(%s)" % (name, argstr))
+
+ emit("PyObject*")
+ emit("Py_%s_New(%s)" % (name, argstr))
emit("{")
- emit("%s p;" % ctype, 1)
- for argtype, argname, opt in args:
- # XXX hack alert: false is allowed for a bool
- if not opt and not argtype == "bool":
- emit("if (!%s) {" % argname, 1)
- emit("PyErr_SetString(PyExc_ValueError,", 2)
- msg = "field %s is required for %s" % (argname, name)
- emit(' "%s");' % msg,
- 2, reflow=0)
- emit('return NULL;', 2)
- emit('}', 1)
-
- emit("p = (%s)malloc(sizeof(*p));" % ctype, 1)
- emit("if (!p) {", 1)
- emit("PyErr_NoMemory();", 2)
+ emit("struct Py_%s *result = PyObject_New(struct Py_%s, &Py_%s_Type);" % (name, name, name), 1, 0)
+ emit("if (result == NULL)", 1)
emit("return NULL;", 2)
- emit("}", 1)
- if union:
- self.emit_body_union(name, args, attrs)
- else:
- self.emit_body_struct(name, args, attrs)
- emit("return p;", 1)
+ for argtype, argname, opt in args:
+ emit("result->%s = %s;" % (argname, argname), 1)
+ for argtype, argname, opt in attrs:
+ emit("result->_base.%s = %s;" % (argname, argname), 1)
+ emit("return (PyObject*)result;", 1)
emit("}")
emit("")
- def emit_body_union(self, name, args, attrs):
+ def emit_dealloc(self, name, fields, attrs):
def emit(s, depth=0, reflow=1):
self.emit(s, depth, reflow)
- emit("p->kind = %s_kind;" % name, 1)
- for argtype, argname, opt in args:
- emit("p->v.%s.%s = %s;" % (name, argname, argname), 1)
+ emit("static void")
+ emit("%s_dealloc(PyObject* _self)" % name)
+ emit("{")
+ emit("struct Py_%s *self = (struct Py_%s*)_self;" % (name, name), 1)
+ for argtype, argname, opt in fields:
+ if argtype == "PyObject*":
+ emit("Py_DECREF(self->%s);" % argname, 1)
for argtype, argname, opt in attrs:
- emit("p->%s = %s;" % (argname, argname), 1)
-
- def emit_body_struct(self, name, args, attrs):
- def emit(s, depth=0, reflow=1):
- self.emit(s, depth, reflow)
- for argtype, argname, opt in args:
- emit("p->%s = %s;" % (argname, argname), 1)
- assert not attrs
-
-class PickleVisitor(EmitVisitor):
-
- def visitModule(self, mod):
- for dfn in mod.dfns:
- self.visit(dfn)
-
- def visitType(self, type):
- self.visit(type.value, type.name)
-
- def visitSum(self, sum, name):
- pass
-
- def visitProduct(self, sum, name):
- pass
-
- def visitConstructor(self, cons, name):
- pass
-
- def visitField(self, sum):
- pass
-
-class MarshalPrototypeVisitor(PickleVisitor):
-
- def prototype(self, sum, name):
- ctype = get_c_type(name)
- self.emit("static int marshal_write_%s(PyObject **, int *, %s);"
- % (name, ctype), 0)
-
- visitProduct = visitSum = prototype
-
-class FreePrototypeVisitor(PickleVisitor):
-
- def prototype(self, sum, name):
- ctype = get_c_type(name)
- self.emit("void free_%s(%s);" % (name, ctype), 0)
-
- visitProduct = visitSum = prototype
-
-_SPECIALIZED_SEQUENCES = ('stmt', 'expr')
-
-def find_sequence(fields, doing_specialization):
- """Return True if any field uses a sequence."""
- for f in fields:
- if f.seq:
- if not doing_specialization:
- return True
- if str(f.type) not in _SPECIALIZED_SEQUENCES:
- return True
- return False
-
-def has_sequence(types, doing_specialization):
- for t in types:
- if find_sequence(t.fields, doing_specialization):
- return True
- return False
-
-
-class StaticVisitor(PickleVisitor):
- CODE = '''Very simple, always emit this static code. Overide CODE'''
-
- def visit(self, object):
- self.emit(self.CODE, 0, reflow=False)
-
-class FreeUtilVisitor(StaticVisitor):
-
- CODE = '''static void
-free_seq_exprs(asdl_seq *seq)
-{
- int i, n;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_expr((expr_ty)asdl_seq_GET(seq, i));
- asdl_seq_free(seq);
-}
-
-static void
-free_seq_stmts(asdl_seq *seq)
-{
- int i, n;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_stmt((stmt_ty)asdl_seq_GET(seq, i));
- asdl_seq_free(seq);
-}
-'''
-
-class FreeVisitor(PickleVisitor):
-
- def func_begin(self, name, has_seq):
- ctype = get_c_type(name)
- self.emit("void", 0)
- self.emit("free_%s(%s o)" % (name, ctype), 0)
- self.emit("{", 0)
- if has_seq:
- self.emit("int i, n;", 1)
- self.emit("asdl_seq *seq;", 1)
- self.emit('', 0)
- self.emit('if (!o)', 1)
- self.emit('return;', 2)
- self.emit('', 0)
-
- def func_end(self):
- self.emit("}", 0)
- self.emit("", 0)
-
- def visitSum(self, sum, name):
- has_seq = has_sequence(sum.types, True)
- self.func_begin(name, has_seq)
- if not is_simple(sum):
- self.emit("switch (o->kind) {", 1)
- for i in range(len(sum.types)):
- t = sum.types[i]
- self.visitConstructor(t, i + 1, name)
- self.emit("}", 1)
- self.emit("", 0)
- self.emit("free(o);", 1)
- self.func_end()
+ if argtype == "PyObject*":
+ emit("Py_DECREF(self->_base.%s);" % argname, 1)
+ emit("PyObject_Del(self);", 1)
+ emit("}")
+ emit("")
- def visitProduct(self, prod, name):
- self.func_begin(name, find_sequence(prod.fields, True))
- for field in prod.fields:
- self.visitField(field, name, 1, True)
- self.emit("", 0)
- self.emit("free(o);", 1)
- self.func_end()
+ def emit_type(self, name):
+ depth = 0
+ def emit(s=1):
+ self.emit(s, depth)
+ def null(thing):
+ emit("0,\t\t/* tp_%s */" % thing)
+ emit("PyTypeObject Py_%s_Type = {" % name)
+ depth = 1
+ emit("PyObject_HEAD_INIT(NULL)")
+ emit("0,\t\t/*ob_size*/")
+ emit('"%s",\t\t/*tp_name*/' % name)
+ emit("sizeof(struct Py_%s),\t/*tp_basicsize*/" % name)
+ null("itemsize")
+ emit("%s_dealloc,\t\t/*tp_dealloc*/" % name)
+ null("print")
+ null("getattr")
+ null("setattr")
+ for m in ("compare", "repr", "as_number",
+ "as_sequence", "as_mapping", "hash", "call",
+ "str", "getattro", "setattro", "as_buffer"):
+ null(m)
- def visitConstructor(self, cons, enum, name):
- self.emit("case %s_kind:" % cons.name, 1)
- for f in cons.fields:
- self.visitField(f, cons.name, 2, False)
- self.emit("break;", 2)
-
- def visitField(self, field, name, depth, product):
- def emit(s, d):
- self.emit(s, depth + d)
- if product:
- value = "o->%s" % field.name
- else:
- value = "o->v.%s.%s" % (name, field.name)
- if field.seq:
- self.emitSeq(field, value, depth, emit)
-
- # XXX need to know the simple types in advance, so that we
- # don't call free_TYPE() for them.
-
- elif field.opt:
- emit("if (%s) {" % value, 0)
- self.free(field, value, depth + 1)
- emit("}", 0)
- else:
- self.free(field, value, depth)
+ emit("Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,\t\t/*tp_flags*/")
+ for m in ("doc", "traverse", "clear", "richcompare",
+ "weaklistoffset", "iter", "iternext",
+ "methods", "members", "getset", "base",
+ "dict", "descr_get", "descr_set", "dictoffset",
+ "init", "alloc", "new", "free", "is_gc"):
+ null(m)
+ emit("};")
+ emit("")
- def emitSeq(self, field, value, depth, emit):
- # specialize for freeing sequences of statements and expressions
- if str(field.type) in _SPECIALIZED_SEQUENCES:
- c_code = "free_seq_%ss(%s);" % (field.type, value)
- emit(c_code, 0)
- else:
- emit("seq = %s;" % value, 0)
- emit("n = asdl_seq_LEN(seq);", 0)
- emit("for (i = 0; i < n; i++)", 0)
- self.free(field, "asdl_seq_GET(seq, i)", depth + 1)
- emit("asdl_seq_free(seq);", 0)
-
- def free(self, field, value, depth):
- if str(field.type) in ("identifier", "string", "object"):
- ctype = get_c_type(field.type)
- self.emit("Py_DECREF((%s)%s);" % (ctype, value), depth)
- elif str(field.type) == "bool":
- return
+ def visitSum(self, sum, name):
+ if is_simple(sum):
+ pass # XXX
else:
- ctype = get_c_type(field.type)
- self.emit("free_%s((%s)%s);" % (field.type, ctype, value), depth)
+ self.emit("#define %s_dealloc 0" % name, 0)
+ self.emit_type(name)
+ for t in sum.types:
+ self.visit(t, name, sum.attributes)
+ def visitProduct(self, prod, name):
+ args = self.get_args(prod.fields)
+ self.emit_ctor(str(name), args, [])
+ self.emit_dealloc(str(name), args, [])
+ self.emit_type(str(name))
-class MarshalUtilVisitor(StaticVisitor):
+ def visitConstructor(self, cons, name, attrs):
+ name = "%s_%s" % (name, cons.name)
+ args = self.get_args(cons.fields)
+ attrs = self.get_args(attrs)
+ self.emit_ctor(name, args, attrs)
+ self.emit_dealloc(name, args, attrs)
+ self.emit_type(name)
- CODE = '''
-#define CHECKSIZE(BUF, OFF, MIN) { \\
- int need = *(OFF) + MIN; \\
- if (need >= PyString_GET_SIZE(*(BUF))) { \\
- int newsize = PyString_GET_SIZE(*(BUF)) * 2; \\
- if (newsize < need) \\
- newsize = need; \\
- if (_PyString_Resize((BUF), newsize) < 0) \\
- return 0; \\
- } \\
-}
-
-static int
-marshal_write_int(PyObject **buf, int *offset, int x)
-{
- char *s;
-
- CHECKSIZE(buf, offset, 4)
- s = PyString_AS_STRING(*buf) + (*offset);
- s[0] = (x & 0xff);
- s[1] = (x >> 8) & 0xff;
- s[2] = (x >> 16) & 0xff;
- s[3] = (x >> 24) & 0xff;
- *offset += 4;
- return 1;
-}
-
-static int
-marshal_write_bool(PyObject **buf, int *offset, bool b)
-{
- if (b)
- marshal_write_int(buf, offset, 1);
- else
- marshal_write_int(buf, offset, 0);
- return 1;
-}
-
-static int
-marshal_write_identifier(PyObject **buf, int *offset, identifier id)
-{
- int l = PyString_GET_SIZE(id);
- marshal_write_int(buf, offset, l);
- CHECKSIZE(buf, offset, l);
- memcpy(PyString_AS_STRING(*buf) + *offset,
- PyString_AS_STRING(id), l);
- *offset += l;
- return 1;
-}
-
-static int
-marshal_write_string(PyObject **buf, int *offset, string s)
-{
- int len = PyString_GET_SIZE(s);
- marshal_write_int(buf, offset, len);
- CHECKSIZE(buf, offset, len);
- memcpy(PyString_AS_STRING(*buf) + *offset,
- PyString_AS_STRING(s), len);
- *offset += len;
- return 1;
-}
-
-static int
-marshal_write_object(PyObject **buf, int *offset, object s)
-{
- /* XXX */
- return 0;
-}
-'''
-
-class MarshalFunctionVisitor(PickleVisitor):
-
- def func_begin(self, name, has_seq):
- ctype = get_c_type(name)
- self.emit("static int", 0)
- self.emit("marshal_write_%s(PyObject **buf, int *off, %s o)" %
- (name, ctype), 0)
+class InitVisitor(TraversalVisitor):
+ def visitModule(self, mod):
+ self.emit("void init_ast(void)", 0)
self.emit("{", 0)
- if has_seq:
- self.emit("int i;", 1)
-
- def func_end(self):
- self.emit("return 1;", 1)
+ for dfn in mod.dfns:
+ self.visit(dfn)
self.emit("}", 0)
- self.emit("", 0)
-
+
def visitSum(self, sum, name):
- self.func_begin(name, has_sequence(sum.types, False))
- simple = is_simple(sum)
- if simple:
- self.emit("switch (o) {", 1)
+ if is_simple(sum):
+ pass # XXX
else:
- self.emit("switch (o->kind) {", 1)
- for i in range(len(sum.types)):
- t = sum.types[i]
- self.visitConstructor(t, i + 1, name, simple)
- self.emit("}", 1)
- self.func_end()
+ self.emit_init(name)
+ for t in sum.types:
+ self.visit(t, name, sum.attributes)
def visitProduct(self, prod, name):
- self.func_begin(name, find_sequence(prod.fields, False))
- for field in prod.fields:
- self.visitField(field, name, 1, 1)
- self.func_end()
-
- def visitConstructor(self, cons, enum, name, simple):
- if simple:
- self.emit("case %s:" % cons.name, 1)
- self.emit("marshal_write_int(buf, off, %d);" % enum, 2);
- self.emit("break;", 2)
- else:
- self.emit("case %s_kind:" % cons.name, 1)
- self.emit("marshal_write_int(buf, off, %d);" % enum, 2)
- for f in cons.fields:
- self.visitField(f, cons.name, 2, 0)
- self.emit("break;", 2)
-
- def visitField(self, field, name, depth, product):
- def emit(s, d):
- self.emit(s, depth + d)
- if product:
- value = "o->%s" % field.name
- else:
- value = "o->v.%s.%s" % (name, field.name)
- if field.seq:
- emit("marshal_write_int(buf, off, asdl_seq_LEN(%s));" % value, 0)
- emit("for (i = 0; i < asdl_seq_LEN(%s); i++) {" % value, 0)
- emit("void *elt = asdl_seq_GET(%s, i);" % value, 1);
- ctype = get_c_type(field.type);
- emit("marshal_write_%s(buf, off, (%s)elt);" % (field.type,
- ctype), 1)
- emit("}", 0)
- elif field.opt:
- emit("if (%s) {" % value, 0)
- emit("marshal_write_int(buf, off, 1);", 1)
- emit("marshal_write_%s(buf, off, %s);" % (field.type, value), 1)
- emit("}", 0)
- emit("else {", 0)
- emit("marshal_write_int(buf, off, 0);", 1)
- emit("}", 0)
- else:
- emit("marshal_write_%s(buf, off, %s);" % (field.type, value), 0)
+ self.emit_init(name)
+
+ def visitConstructor(self, cons, name, attrs):
+ self.emit_init("%s_%s" % (name, cons.name), name)
+
+ def emit_init(self, name, base = None):
+ if base:
+ self.emit("Py_%s_Type.tp_base = &Py_%s_Type;" % (name, base), 1)
+ self.emit("if (PyType_Ready(&Py_%s_Type) < 0)" % name, 1)
+ self.emit("return;", 2)
class ChainOfVisitors:
def __init__(self, *visitors):
@@ -648,12 +336,7 @@
p = "%s-ast.h" % mod.name
f = open(p, "wb")
print >> f, auto_gen_msg
- print >> f, '#include "asdl.h"\n'
- c = ChainOfVisitors(TypeDefVisitor(f),
- StructVisitor(f),
- PrototypeVisitor(f),
- FreePrototypeVisitor(f),
- )
+ c = HeaderVisitor(f)
c.visit(mod)
f.close()
@@ -666,12 +349,8 @@
print >> f, '#include "Python.h"'
print >> f, '#include "%s-ast.h"' % mod.name
print >> f
- v = ChainOfVisitors(MarshalPrototypeVisitor(f),
- FunctionVisitor(f),
- FreeUtilVisitor(f),
- FreeVisitor(f),
- MarshalUtilVisitor(f),
- MarshalFunctionVisitor(f),
+ v = ChainOfVisitors(FunctionVisitor(f),
+ InitVisitor(f),
)
v.visit(mod)
f.close()
Modified: python/branches/ast-objects/Python/Python-ast.c
==============================================================================
--- python/branches/ast-objects/Python/Python-ast.c (original)
+++ python/branches/ast-objects/Python/Python-ast.c Wed Nov 30 20:11:25 2005
@@ -3,2360 +3,3795 @@
#include "Python.h"
#include "Python-ast.h"
-static int marshal_write_mod(PyObject **, int *, mod_ty);
-static int marshal_write_stmt(PyObject **, int *, stmt_ty);
-static int marshal_write_expr(PyObject **, int *, expr_ty);
-static int marshal_write_expr_context(PyObject **, int *, expr_context_ty);
-static int marshal_write_slice(PyObject **, int *, slice_ty);
-static int marshal_write_boolop(PyObject **, int *, boolop_ty);
-static int marshal_write_operator(PyObject **, int *, operator_ty);
-static int marshal_write_unaryop(PyObject **, int *, unaryop_ty);
-static int marshal_write_cmpop(PyObject **, int *, cmpop_ty);
-static int marshal_write_comprehension(PyObject **, int *, comprehension_ty);
-static int marshal_write_excepthandler(PyObject **, int *, excepthandler_ty);
-static int marshal_write_arguments(PyObject **, int *, arguments_ty);
-static int marshal_write_keyword(PyObject **, int *, keyword_ty);
-static int marshal_write_alias(PyObject **, int *, alias_ty);
-
-mod_ty
-Module(asdl_seq * body)
-{
- mod_ty p;
- p = (mod_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Module_kind;
- p->v.Module.body = body;
- return p;
-}
-
-mod_ty
-Interactive(asdl_seq * body)
-{
- mod_ty p;
- p = (mod_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Interactive_kind;
- p->v.Interactive.body = body;
- return p;
-}
-
-mod_ty
-Expression(expr_ty body)
-{
- mod_ty p;
- if (!body) {
- PyErr_SetString(PyExc_ValueError,
- "field body is required for Expression");
- return NULL;
- }
- p = (mod_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Expression_kind;
- p->v.Expression.body = body;
- return p;
-}
-
-mod_ty
-Suite(asdl_seq * body)
-{
- mod_ty p;
- p = (mod_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Suite_kind;
- p->v.Suite.body = body;
- return p;
-}
-
-stmt_ty
-FunctionDef(identifier name, arguments_ty args, asdl_seq * body, asdl_seq *
- decorators, int lineno)
-{
- stmt_ty p;
- if (!name) {
- PyErr_SetString(PyExc_ValueError,
- "field name is required for FunctionDef");
- return NULL;
- }
- if (!args) {
- PyErr_SetString(PyExc_ValueError,
- "field args is required for FunctionDef");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = FunctionDef_kind;
- p->v.FunctionDef.name = name;
- p->v.FunctionDef.args = args;
- p->v.FunctionDef.body = body;
- p->v.FunctionDef.decorators = decorators;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-ClassDef(identifier name, asdl_seq * bases, asdl_seq * body, int lineno)
-{
- stmt_ty p;
- if (!name) {
- PyErr_SetString(PyExc_ValueError,
- "field name is required for ClassDef");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = ClassDef_kind;
- p->v.ClassDef.name = name;
- p->v.ClassDef.bases = bases;
- p->v.ClassDef.body = body;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Return(expr_ty value, int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Return_kind;
- p->v.Return.value = value;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Delete(asdl_seq * targets, int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Delete_kind;
- p->v.Delete.targets = targets;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Assign(asdl_seq * targets, expr_ty value, int lineno)
-{
- stmt_ty p;
- if (!value) {
- PyErr_SetString(PyExc_ValueError,
- "field value is required for Assign");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Assign_kind;
- p->v.Assign.targets = targets;
- p->v.Assign.value = value;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-AugAssign(expr_ty target, operator_ty op, expr_ty value, int lineno)
-{
- stmt_ty p;
- if (!target) {
- PyErr_SetString(PyExc_ValueError,
- "field target is required for AugAssign");
- return NULL;
- }
- if (!op) {
- PyErr_SetString(PyExc_ValueError,
- "field op is required for AugAssign");
- return NULL;
- }
- if (!value) {
- PyErr_SetString(PyExc_ValueError,
- "field value is required for AugAssign");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = AugAssign_kind;
- p->v.AugAssign.target = target;
- p->v.AugAssign.op = op;
- p->v.AugAssign.value = value;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Print(expr_ty dest, asdl_seq * values, bool nl, int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Print_kind;
- p->v.Print.dest = dest;
- p->v.Print.values = values;
- p->v.Print.nl = nl;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-For(expr_ty target, expr_ty iter, asdl_seq * body, asdl_seq * orelse, int
- lineno)
-{
- stmt_ty p;
- if (!target) {
- PyErr_SetString(PyExc_ValueError,
- "field target is required for For");
- return NULL;
- }
- if (!iter) {
- PyErr_SetString(PyExc_ValueError,
- "field iter is required for For");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = For_kind;
- p->v.For.target = target;
- p->v.For.iter = iter;
- p->v.For.body = body;
- p->v.For.orelse = orelse;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-While(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno)
-{
- stmt_ty p;
- if (!test) {
- PyErr_SetString(PyExc_ValueError,
- "field test is required for While");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = While_kind;
- p->v.While.test = test;
- p->v.While.body = body;
- p->v.While.orelse = orelse;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-If(expr_ty test, asdl_seq * body, asdl_seq * orelse, int lineno)
-{
- stmt_ty p;
- if (!test) {
- PyErr_SetString(PyExc_ValueError,
- "field test is required for If");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = If_kind;
- p->v.If.test = test;
- p->v.If.body = body;
- p->v.If.orelse = orelse;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Raise(expr_ty type, expr_ty inst, expr_ty tback, int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Raise_kind;
- p->v.Raise.type = type;
- p->v.Raise.inst = inst;
- p->v.Raise.tback = tback;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-TryExcept(asdl_seq * body, asdl_seq * handlers, asdl_seq * orelse, int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = TryExcept_kind;
- p->v.TryExcept.body = body;
- p->v.TryExcept.handlers = handlers;
- p->v.TryExcept.orelse = orelse;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-TryFinally(asdl_seq * body, asdl_seq * finalbody, int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = TryFinally_kind;
- p->v.TryFinally.body = body;
- p->v.TryFinally.finalbody = finalbody;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Assert(expr_ty test, expr_ty msg, int lineno)
-{
- stmt_ty p;
- if (!test) {
- PyErr_SetString(PyExc_ValueError,
- "field test is required for Assert");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Assert_kind;
- p->v.Assert.test = test;
- p->v.Assert.msg = msg;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Import(asdl_seq * names, int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Import_kind;
- p->v.Import.names = names;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-ImportFrom(identifier module, asdl_seq * names, int lineno)
-{
- stmt_ty p;
- if (!module) {
- PyErr_SetString(PyExc_ValueError,
- "field module is required for ImportFrom");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = ImportFrom_kind;
- p->v.ImportFrom.module = module;
- p->v.ImportFrom.names = names;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Exec(expr_ty body, expr_ty globals, expr_ty locals, int lineno)
-{
- stmt_ty p;
- if (!body) {
- PyErr_SetString(PyExc_ValueError,
- "field body is required for Exec");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Exec_kind;
- p->v.Exec.body = body;
- p->v.Exec.globals = globals;
- p->v.Exec.locals = locals;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Global(asdl_seq * names, int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Global_kind;
- p->v.Global.names = names;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Expr(expr_ty value, int lineno)
-{
- stmt_ty p;
- if (!value) {
- PyErr_SetString(PyExc_ValueError,
- "field value is required for Expr");
- return NULL;
- }
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Expr_kind;
- p->v.Expr.value = value;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Pass(int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Pass_kind;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Break(int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Break_kind;
- p->lineno = lineno;
- return p;
-}
-
-stmt_ty
-Continue(int lineno)
-{
- stmt_ty p;
- p = (stmt_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Continue_kind;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-BoolOp(boolop_ty op, asdl_seq * values, int lineno)
-{
- expr_ty p;
- if (!op) {
- PyErr_SetString(PyExc_ValueError,
- "field op is required for BoolOp");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = BoolOp_kind;
- p->v.BoolOp.op = op;
- p->v.BoolOp.values = values;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-BinOp(expr_ty left, operator_ty op, expr_ty right, int lineno)
-{
- expr_ty p;
- if (!left) {
- PyErr_SetString(PyExc_ValueError,
- "field left is required for BinOp");
- return NULL;
- }
- if (!op) {
- PyErr_SetString(PyExc_ValueError,
- "field op is required for BinOp");
- return NULL;
- }
- if (!right) {
- PyErr_SetString(PyExc_ValueError,
- "field right is required for BinOp");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = BinOp_kind;
- p->v.BinOp.left = left;
- p->v.BinOp.op = op;
- p->v.BinOp.right = right;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-UnaryOp(unaryop_ty op, expr_ty operand, int lineno)
-{
- expr_ty p;
- if (!op) {
- PyErr_SetString(PyExc_ValueError,
- "field op is required for UnaryOp");
- return NULL;
- }
- if (!operand) {
- PyErr_SetString(PyExc_ValueError,
- "field operand is required for UnaryOp");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = UnaryOp_kind;
- p->v.UnaryOp.op = op;
- p->v.UnaryOp.operand = operand;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Lambda(arguments_ty args, expr_ty body, int lineno)
-{
- expr_ty p;
- if (!args) {
- PyErr_SetString(PyExc_ValueError,
- "field args is required for Lambda");
- return NULL;
- }
- if (!body) {
- PyErr_SetString(PyExc_ValueError,
- "field body is required for Lambda");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Lambda_kind;
- p->v.Lambda.args = args;
- p->v.Lambda.body = body;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Dict(asdl_seq * keys, asdl_seq * values, int lineno)
-{
- expr_ty p;
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Dict_kind;
- p->v.Dict.keys = keys;
- p->v.Dict.values = values;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-ListComp(expr_ty elt, asdl_seq * generators, int lineno)
-{
- expr_ty p;
- if (!elt) {
- PyErr_SetString(PyExc_ValueError,
- "field elt is required for ListComp");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = ListComp_kind;
- p->v.ListComp.elt = elt;
- p->v.ListComp.generators = generators;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-GeneratorExp(expr_ty elt, asdl_seq * generators, int lineno)
-{
- expr_ty p;
- if (!elt) {
- PyErr_SetString(PyExc_ValueError,
- "field elt is required for GeneratorExp");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = GeneratorExp_kind;
- p->v.GeneratorExp.elt = elt;
- p->v.GeneratorExp.generators = generators;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Yield(expr_ty value, int lineno)
-{
- expr_ty p;
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Yield_kind;
- p->v.Yield.value = value;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Compare(expr_ty left, asdl_seq * ops, asdl_seq * comparators, int lineno)
-{
- expr_ty p;
- if (!left) {
- PyErr_SetString(PyExc_ValueError,
- "field left is required for Compare");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Compare_kind;
- p->v.Compare.left = left;
- p->v.Compare.ops = ops;
- p->v.Compare.comparators = comparators;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, expr_ty starargs,
- expr_ty kwargs, int lineno)
-{
- expr_ty p;
- if (!func) {
- PyErr_SetString(PyExc_ValueError,
- "field func is required for Call");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Call_kind;
- p->v.Call.func = func;
- p->v.Call.args = args;
- p->v.Call.keywords = keywords;
- p->v.Call.starargs = starargs;
- p->v.Call.kwargs = kwargs;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Repr(expr_ty value, int lineno)
-{
- expr_ty p;
- if (!value) {
- PyErr_SetString(PyExc_ValueError,
- "field value is required for Repr");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Repr_kind;
- p->v.Repr.value = value;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Num(object n, int lineno)
-{
- expr_ty p;
- if (!n) {
- PyErr_SetString(PyExc_ValueError,
- "field n is required for Num");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Num_kind;
- p->v.Num.n = n;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Str(string s, int lineno)
-{
- expr_ty p;
- if (!s) {
- PyErr_SetString(PyExc_ValueError,
- "field s is required for Str");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Str_kind;
- p->v.Str.s = s;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Attribute(expr_ty value, identifier attr, expr_context_ty ctx, int lineno)
-{
- expr_ty p;
- if (!value) {
- PyErr_SetString(PyExc_ValueError,
- "field value is required for Attribute");
- return NULL;
- }
- if (!attr) {
- PyErr_SetString(PyExc_ValueError,
- "field attr is required for Attribute");
- return NULL;
- }
- if (!ctx) {
- PyErr_SetString(PyExc_ValueError,
- "field ctx is required for Attribute");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Attribute_kind;
- p->v.Attribute.value = value;
- p->v.Attribute.attr = attr;
- p->v.Attribute.ctx = ctx;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Subscript(expr_ty value, slice_ty slice, expr_context_ty ctx, int lineno)
-{
- expr_ty p;
- if (!value) {
- PyErr_SetString(PyExc_ValueError,
- "field value is required for Subscript");
- return NULL;
- }
- if (!slice) {
- PyErr_SetString(PyExc_ValueError,
- "field slice is required for Subscript");
- return NULL;
- }
- if (!ctx) {
- PyErr_SetString(PyExc_ValueError,
- "field ctx is required for Subscript");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Subscript_kind;
- p->v.Subscript.value = value;
- p->v.Subscript.slice = slice;
- p->v.Subscript.ctx = ctx;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Name(identifier id, expr_context_ty ctx, int lineno)
-{
- expr_ty p;
- if (!id) {
- PyErr_SetString(PyExc_ValueError,
- "field id is required for Name");
- return NULL;
- }
- if (!ctx) {
- PyErr_SetString(PyExc_ValueError,
- "field ctx is required for Name");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Name_kind;
- p->v.Name.id = id;
- p->v.Name.ctx = ctx;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-List(asdl_seq * elts, expr_context_ty ctx, int lineno)
-{
- expr_ty p;
- if (!ctx) {
- PyErr_SetString(PyExc_ValueError,
- "field ctx is required for List");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = List_kind;
- p->v.List.elts = elts;
- p->v.List.ctx = ctx;
- p->lineno = lineno;
- return p;
-}
-
-expr_ty
-Tuple(asdl_seq * elts, expr_context_ty ctx, int lineno)
-{
- expr_ty p;
- if (!ctx) {
- PyErr_SetString(PyExc_ValueError,
- "field ctx is required for Tuple");
- return NULL;
- }
- p = (expr_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Tuple_kind;
- p->v.Tuple.elts = elts;
- p->v.Tuple.ctx = ctx;
- p->lineno = lineno;
- return p;
-}
-
-slice_ty
-Ellipsis()
-{
- slice_ty p;
- p = (slice_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Ellipsis_kind;
- return p;
-}
-
-slice_ty
-Slice(expr_ty lower, expr_ty upper, expr_ty step)
-{
- slice_ty p;
- p = (slice_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Slice_kind;
- p->v.Slice.lower = lower;
- p->v.Slice.upper = upper;
- p->v.Slice.step = step;
- return p;
-}
-
-slice_ty
-ExtSlice(asdl_seq * dims)
-{
- slice_ty p;
- p = (slice_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = ExtSlice_kind;
- p->v.ExtSlice.dims = dims;
- return p;
-}
-
-slice_ty
-Index(expr_ty value)
-{
- slice_ty p;
- if (!value) {
- PyErr_SetString(PyExc_ValueError,
- "field value is required for Index");
- return NULL;
- }
- p = (slice_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->kind = Index_kind;
- p->v.Index.value = value;
- return p;
-}
-
-comprehension_ty
-comprehension(expr_ty target, expr_ty iter, asdl_seq * ifs)
-{
- comprehension_ty p;
- if (!target) {
- PyErr_SetString(PyExc_ValueError,
- "field target is required for comprehension");
- return NULL;
- }
- if (!iter) {
- PyErr_SetString(PyExc_ValueError,
- "field iter is required for comprehension");
- return NULL;
- }
- p = (comprehension_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->target = target;
- p->iter = iter;
- p->ifs = ifs;
- return p;
-}
-
-excepthandler_ty
-excepthandler(expr_ty type, expr_ty name, asdl_seq * body)
-{
- excepthandler_ty p;
- p = (excepthandler_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->type = type;
- p->name = name;
- p->body = body;
- return p;
-}
-
-arguments_ty
-arguments(asdl_seq * args, identifier vararg, identifier kwarg, asdl_seq *
- defaults)
-{
- arguments_ty p;
- p = (arguments_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->args = args;
- p->vararg = vararg;
- p->kwarg = kwarg;
- p->defaults = defaults;
- return p;
-}
-
-keyword_ty
-keyword(identifier arg, expr_ty value)
-{
- keyword_ty p;
- if (!arg) {
- PyErr_SetString(PyExc_ValueError,
- "field arg is required for keyword");
- return NULL;
- }
- if (!value) {
- PyErr_SetString(PyExc_ValueError,
- "field value is required for keyword");
- return NULL;
- }
- p = (keyword_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->arg = arg;
- p->value = value;
- return p;
-}
-
-alias_ty
-alias(identifier name, identifier asname)
-{
- alias_ty p;
- if (!name) {
- PyErr_SetString(PyExc_ValueError,
- "field name is required for alias");
- return NULL;
- }
- p = (alias_ty)malloc(sizeof(*p));
- if (!p) {
- PyErr_NoMemory();
- return NULL;
- }
- p->name = name;
- p->asname = asname;
- return p;
-}
-
-
-static void
-free_seq_exprs(asdl_seq *seq)
-{
- int i, n;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_expr((expr_ty)asdl_seq_GET(seq, i));
- asdl_seq_free(seq);
-}
-
-static void
-free_seq_stmts(asdl_seq *seq)
-{
- int i, n;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_stmt((stmt_ty)asdl_seq_GET(seq, i));
- asdl_seq_free(seq);
-}
-
-
-void
-free_mod(mod_ty o)
-{
- if (!o)
- return;
-
- switch (o->kind) {
- case Module_kind:
- free_seq_stmts(o->v.Module.body);
- break;
- case Interactive_kind:
- free_seq_stmts(o->v.Interactive.body);
- break;
- case Expression_kind:
- free_expr((expr_ty)o->v.Expression.body);
- break;
- case Suite_kind:
- free_seq_stmts(o->v.Suite.body);
- break;
- }
-
- free(o);
-}
-
-void
-free_stmt(stmt_ty o)
-{
- int i, n;
- asdl_seq *seq;
-
- if (!o)
- return;
-
- switch (o->kind) {
- case FunctionDef_kind:
- Py_DECREF((identifier)o->v.FunctionDef.name);
- free_arguments((arguments_ty)o->v.FunctionDef.args);
- free_seq_stmts(o->v.FunctionDef.body);
- free_seq_exprs(o->v.FunctionDef.decorators);
- break;
- case ClassDef_kind:
- Py_DECREF((identifier)o->v.ClassDef.name);
- free_seq_exprs(o->v.ClassDef.bases);
- free_seq_stmts(o->v.ClassDef.body);
- break;
- case Return_kind:
- if (o->v.Return.value) {
- free_expr((expr_ty)o->v.Return.value);
- }
- break;
- case Delete_kind:
- free_seq_exprs(o->v.Delete.targets);
- break;
- case Assign_kind:
- free_seq_exprs(o->v.Assign.targets);
- free_expr((expr_ty)o->v.Assign.value);
- break;
- case AugAssign_kind:
- free_expr((expr_ty)o->v.AugAssign.target);
- free_operator((operator_ty)o->v.AugAssign.op);
- free_expr((expr_ty)o->v.AugAssign.value);
- break;
- case Print_kind:
- if (o->v.Print.dest) {
- free_expr((expr_ty)o->v.Print.dest);
- }
- free_seq_exprs(o->v.Print.values);
- break;
- case For_kind:
- free_expr((expr_ty)o->v.For.target);
- free_expr((expr_ty)o->v.For.iter);
- free_seq_stmts(o->v.For.body);
- free_seq_stmts(o->v.For.orelse);
- break;
- case While_kind:
- free_expr((expr_ty)o->v.While.test);
- free_seq_stmts(o->v.While.body);
- free_seq_stmts(o->v.While.orelse);
- break;
- case If_kind:
- free_expr((expr_ty)o->v.If.test);
- free_seq_stmts(o->v.If.body);
- free_seq_stmts(o->v.If.orelse);
- break;
- case Raise_kind:
- if (o->v.Raise.type) {
- free_expr((expr_ty)o->v.Raise.type);
- }
- if (o->v.Raise.inst) {
- free_expr((expr_ty)o->v.Raise.inst);
- }
- if (o->v.Raise.tback) {
- free_expr((expr_ty)o->v.Raise.tback);
- }
- break;
- case TryExcept_kind:
- free_seq_stmts(o->v.TryExcept.body);
- seq = o->v.TryExcept.handlers;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_excepthandler((excepthandler_ty)asdl_seq_GET(seq,
- i));
- asdl_seq_free(seq);
- free_seq_stmts(o->v.TryExcept.orelse);
- break;
- case TryFinally_kind:
- free_seq_stmts(o->v.TryFinally.body);
- free_seq_stmts(o->v.TryFinally.finalbody);
- break;
- case Assert_kind:
- free_expr((expr_ty)o->v.Assert.test);
- if (o->v.Assert.msg) {
- free_expr((expr_ty)o->v.Assert.msg);
- }
- break;
- case Import_kind:
- seq = o->v.Import.names;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_alias((alias_ty)asdl_seq_GET(seq, i));
- asdl_seq_free(seq);
- break;
- case ImportFrom_kind:
- Py_DECREF((identifier)o->v.ImportFrom.module);
- seq = o->v.ImportFrom.names;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_alias((alias_ty)asdl_seq_GET(seq, i));
- asdl_seq_free(seq);
- break;
- case Exec_kind:
- free_expr((expr_ty)o->v.Exec.body);
- if (o->v.Exec.globals) {
- free_expr((expr_ty)o->v.Exec.globals);
- }
- if (o->v.Exec.locals) {
- free_expr((expr_ty)o->v.Exec.locals);
- }
- break;
- case Global_kind:
- seq = o->v.Global.names;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- Py_DECREF((identifier)asdl_seq_GET(seq, i));
- asdl_seq_free(seq);
- break;
- case Expr_kind:
- free_expr((expr_ty)o->v.Expr.value);
- break;
- case Pass_kind:
- break;
- case Break_kind:
- break;
- case Continue_kind:
- break;
- }
-
- free(o);
-}
-
-void
-free_expr(expr_ty o)
-{
- int i, n;
- asdl_seq *seq;
-
- if (!o)
- return;
-
- switch (o->kind) {
- case BoolOp_kind:
- free_boolop((boolop_ty)o->v.BoolOp.op);
- free_seq_exprs(o->v.BoolOp.values);
- break;
- case BinOp_kind:
- free_expr((expr_ty)o->v.BinOp.left);
- free_operator((operator_ty)o->v.BinOp.op);
- free_expr((expr_ty)o->v.BinOp.right);
- break;
- case UnaryOp_kind:
- free_unaryop((unaryop_ty)o->v.UnaryOp.op);
- free_expr((expr_ty)o->v.UnaryOp.operand);
- break;
- case Lambda_kind:
- free_arguments((arguments_ty)o->v.Lambda.args);
- free_expr((expr_ty)o->v.Lambda.body);
- break;
- case Dict_kind:
- free_seq_exprs(o->v.Dict.keys);
- free_seq_exprs(o->v.Dict.values);
- break;
- case ListComp_kind:
- free_expr((expr_ty)o->v.ListComp.elt);
- seq = o->v.ListComp.generators;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_comprehension((comprehension_ty)asdl_seq_GET(seq,
- i));
- asdl_seq_free(seq);
- break;
- case GeneratorExp_kind:
- free_expr((expr_ty)o->v.GeneratorExp.elt);
- seq = o->v.GeneratorExp.generators;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_comprehension((comprehension_ty)asdl_seq_GET(seq,
- i));
- asdl_seq_free(seq);
- break;
- case Yield_kind:
- if (o->v.Yield.value) {
- free_expr((expr_ty)o->v.Yield.value);
- }
- break;
- case Compare_kind:
- free_expr((expr_ty)o->v.Compare.left);
- seq = o->v.Compare.ops;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_cmpop((cmpop_ty)asdl_seq_GET(seq, i));
- asdl_seq_free(seq);
- free_seq_exprs(o->v.Compare.comparators);
- break;
- case Call_kind:
- free_expr((expr_ty)o->v.Call.func);
- free_seq_exprs(o->v.Call.args);
- seq = o->v.Call.keywords;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_keyword((keyword_ty)asdl_seq_GET(seq, i));
- asdl_seq_free(seq);
- if (o->v.Call.starargs) {
- free_expr((expr_ty)o->v.Call.starargs);
- }
- if (o->v.Call.kwargs) {
- free_expr((expr_ty)o->v.Call.kwargs);
- }
- break;
- case Repr_kind:
- free_expr((expr_ty)o->v.Repr.value);
- break;
- case Num_kind:
- Py_DECREF((object)o->v.Num.n);
- break;
- case Str_kind:
- Py_DECREF((string)o->v.Str.s);
- break;
- case Attribute_kind:
- free_expr((expr_ty)o->v.Attribute.value);
- Py_DECREF((identifier)o->v.Attribute.attr);
- free_expr_context((expr_context_ty)o->v.Attribute.ctx);
- break;
- case Subscript_kind:
- free_expr((expr_ty)o->v.Subscript.value);
- free_slice((slice_ty)o->v.Subscript.slice);
- free_expr_context((expr_context_ty)o->v.Subscript.ctx);
- break;
- case Name_kind:
- Py_DECREF((identifier)o->v.Name.id);
- free_expr_context((expr_context_ty)o->v.Name.ctx);
- break;
- case List_kind:
- free_seq_exprs(o->v.List.elts);
- free_expr_context((expr_context_ty)o->v.List.ctx);
- break;
- case Tuple_kind:
- free_seq_exprs(o->v.Tuple.elts);
- free_expr_context((expr_context_ty)o->v.Tuple.ctx);
- break;
- }
-
- free(o);
-}
-
-void
-free_expr_context(expr_context_ty o)
-{
- if (!o)
- return;
-
-}
-
-void
-free_slice(slice_ty o)
-{
- int i, n;
- asdl_seq *seq;
-
- if (!o)
- return;
-
- switch (o->kind) {
- case Ellipsis_kind:
- break;
- case Slice_kind:
- if (o->v.Slice.lower) {
- free_expr((expr_ty)o->v.Slice.lower);
- }
- if (o->v.Slice.upper) {
- free_expr((expr_ty)o->v.Slice.upper);
- }
- if (o->v.Slice.step) {
- free_expr((expr_ty)o->v.Slice.step);
- }
- break;
- case ExtSlice_kind:
- seq = o->v.ExtSlice.dims;
- n = asdl_seq_LEN(seq);
- for (i = 0; i < n; i++)
- free_slice((slice_ty)asdl_seq_GET(seq, i));
- asdl_seq_free(seq);
- break;
- case Index_kind:
- free_expr((expr_ty)o->v.Index.value);
- break;
- }
-
- free(o);
-}
-
-void
-free_boolop(boolop_ty o)
-{
- if (!o)
- return;
-
-}
-
-void
-free_operator(operator_ty o)
-{
- if (!o)
- return;
-
-}
-
-void
-free_unaryop(unaryop_ty o)
-{
- if (!o)
- return;
-
-}
-
-void
-free_cmpop(cmpop_ty o)
-{
- if (!o)
- return;
-
-}
-
-void
-free_comprehension(comprehension_ty o)
-{
- if (!o)
- return;
-
- free_expr((expr_ty)o->target);
- free_expr((expr_ty)o->iter);
- free_seq_exprs(o->ifs);
-
- free(o);
-}
-
-void
-free_excepthandler(excepthandler_ty o)
-{
- if (!o)
- return;
-
- if (o->type) {
- free_expr((expr_ty)o->type);
- }
- if (o->name) {
- free_expr((expr_ty)o->name);
- }
- free_seq_stmts(o->body);
-
- free(o);
-}
-
-void
-free_arguments(arguments_ty o)
-{
- if (!o)
- return;
-
- free_seq_exprs(o->args);
- if (o->vararg) {
- Py_DECREF((identifier)o->vararg);
- }
- if (o->kwarg) {
- Py_DECREF((identifier)o->kwarg);
- }
- free_seq_exprs(o->defaults);
-
- free(o);
-}
-
-void
-free_keyword(keyword_ty o)
-{
- if (!o)
- return;
-
- Py_DECREF((identifier)o->arg);
- free_expr((expr_ty)o->value);
-
- free(o);
-}
-
-void
-free_alias(alias_ty o)
-{
- if (!o)
- return;
-
- Py_DECREF((identifier)o->name);
- if (o->asname) {
- Py_DECREF((identifier)o->asname);
- }
-
- free(o);
-}
-
-
-
-#define CHECKSIZE(BUF, OFF, MIN) { \
- int need = *(OFF) + MIN; \
- if (need >= PyString_GET_SIZE(*(BUF))) { \
- int newsize = PyString_GET_SIZE(*(BUF)) * 2; \
- if (newsize < need) \
- newsize = need; \
- if (_PyString_Resize((BUF), newsize) < 0) \
- return 0; \
- } \
-}
-
-static int
-marshal_write_int(PyObject **buf, int *offset, int x)
-{
- char *s;
-
- CHECKSIZE(buf, offset, 4)
- s = PyString_AS_STRING(*buf) + (*offset);
- s[0] = (x & 0xff);
- s[1] = (x >> 8) & 0xff;
- s[2] = (x >> 16) & 0xff;
- s[3] = (x >> 24) & 0xff;
- *offset += 4;
- return 1;
-}
-
-static int
-marshal_write_bool(PyObject **buf, int *offset, bool b)
-{
- if (b)
- marshal_write_int(buf, offset, 1);
- else
- marshal_write_int(buf, offset, 0);
- return 1;
-}
-
-static int
-marshal_write_identifier(PyObject **buf, int *offset, identifier id)
-{
- int l = PyString_GET_SIZE(id);
- marshal_write_int(buf, offset, l);
- CHECKSIZE(buf, offset, l);
- memcpy(PyString_AS_STRING(*buf) + *offset,
- PyString_AS_STRING(id), l);
- *offset += l;
- return 1;
-}
-
-static int
-marshal_write_string(PyObject **buf, int *offset, string s)
-{
- int len = PyString_GET_SIZE(s);
- marshal_write_int(buf, offset, len);
- CHECKSIZE(buf, offset, len);
- memcpy(PyString_AS_STRING(*buf) + *offset,
- PyString_AS_STRING(s), len);
- *offset += len;
- return 1;
-}
-
-static int
-marshal_write_object(PyObject **buf, int *offset, object s)
-{
- /* XXX */
- return 0;
-}
-
-
-static int
-marshal_write_mod(PyObject **buf, int *off, mod_ty o)
-{
- int i;
- switch (o->kind) {
- case Module_kind:
- marshal_write_int(buf, off, 1);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Module.body));
- for (i = 0; i < asdl_seq_LEN(o->v.Module.body); i++) {
- void *elt = asdl_seq_GET(o->v.Module.body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- break;
- case Interactive_kind:
- marshal_write_int(buf, off, 2);
- marshal_write_int(buf, off,
- asdl_seq_LEN(o->v.Interactive.body));
- for (i = 0; i < asdl_seq_LEN(o->v.Interactive.body); i++) {
- void *elt = asdl_seq_GET(o->v.Interactive.body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- break;
- case Expression_kind:
- marshal_write_int(buf, off, 3);
- marshal_write_expr(buf, off, o->v.Expression.body);
- break;
- case Suite_kind:
- marshal_write_int(buf, off, 4);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Suite.body));
- for (i = 0; i < asdl_seq_LEN(o->v.Suite.body); i++) {
- void *elt = asdl_seq_GET(o->v.Suite.body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- break;
- }
- return 1;
-}
-
-static int
-marshal_write_stmt(PyObject **buf, int *off, stmt_ty o)
-{
- int i;
- switch (o->kind) {
- case FunctionDef_kind:
- marshal_write_int(buf, off, 1);
- marshal_write_identifier(buf, off, o->v.FunctionDef.name);
- marshal_write_arguments(buf, off, o->v.FunctionDef.args);
- marshal_write_int(buf, off,
- asdl_seq_LEN(o->v.FunctionDef.body));
- for (i = 0; i < asdl_seq_LEN(o->v.FunctionDef.body); i++) {
- void *elt = asdl_seq_GET(o->v.FunctionDef.body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- marshal_write_int(buf, off,
- asdl_seq_LEN(o->v.FunctionDef.decorators));
- for (i = 0; i < asdl_seq_LEN(o->v.FunctionDef.decorators); i++)
- {
- void *elt = asdl_seq_GET(o->v.FunctionDef.decorators,
- i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- break;
- case ClassDef_kind:
- marshal_write_int(buf, off, 2);
- marshal_write_identifier(buf, off, o->v.ClassDef.name);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.ClassDef.bases));
- for (i = 0; i < asdl_seq_LEN(o->v.ClassDef.bases); i++) {
- void *elt = asdl_seq_GET(o->v.ClassDef.bases, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.ClassDef.body));
- for (i = 0; i < asdl_seq_LEN(o->v.ClassDef.body); i++) {
- void *elt = asdl_seq_GET(o->v.ClassDef.body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- break;
- case Return_kind:
- marshal_write_int(buf, off, 3);
- if (o->v.Return.value) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Return.value);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- break;
- case Delete_kind:
- marshal_write_int(buf, off, 4);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Delete.targets));
- for (i = 0; i < asdl_seq_LEN(o->v.Delete.targets); i++) {
- void *elt = asdl_seq_GET(o->v.Delete.targets, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- break;
- case Assign_kind:
- marshal_write_int(buf, off, 5);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Assign.targets));
- for (i = 0; i < asdl_seq_LEN(o->v.Assign.targets); i++) {
- void *elt = asdl_seq_GET(o->v.Assign.targets, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- marshal_write_expr(buf, off, o->v.Assign.value);
- break;
- case AugAssign_kind:
- marshal_write_int(buf, off, 6);
- marshal_write_expr(buf, off, o->v.AugAssign.target);
- marshal_write_operator(buf, off, o->v.AugAssign.op);
- marshal_write_expr(buf, off, o->v.AugAssign.value);
- break;
- case Print_kind:
- marshal_write_int(buf, off, 7);
- if (o->v.Print.dest) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Print.dest);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Print.values));
- for (i = 0; i < asdl_seq_LEN(o->v.Print.values); i++) {
- void *elt = asdl_seq_GET(o->v.Print.values, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- marshal_write_bool(buf, off, o->v.Print.nl);
- break;
- case For_kind:
- marshal_write_int(buf, off, 8);
- marshal_write_expr(buf, off, o->v.For.target);
- marshal_write_expr(buf, off, o->v.For.iter);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.For.body));
- for (i = 0; i < asdl_seq_LEN(o->v.For.body); i++) {
- void *elt = asdl_seq_GET(o->v.For.body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.For.orelse));
- for (i = 0; i < asdl_seq_LEN(o->v.For.orelse); i++) {
- void *elt = asdl_seq_GET(o->v.For.orelse, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- break;
- case While_kind:
- marshal_write_int(buf, off, 9);
- marshal_write_expr(buf, off, o->v.While.test);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.While.body));
- for (i = 0; i < asdl_seq_LEN(o->v.While.body); i++) {
- void *elt = asdl_seq_GET(o->v.While.body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.While.orelse));
- for (i = 0; i < asdl_seq_LEN(o->v.While.orelse); i++) {
- void *elt = asdl_seq_GET(o->v.While.orelse, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- break;
- case If_kind:
- marshal_write_int(buf, off, 10);
- marshal_write_expr(buf, off, o->v.If.test);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.If.body));
- for (i = 0; i < asdl_seq_LEN(o->v.If.body); i++) {
- void *elt = asdl_seq_GET(o->v.If.body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.If.orelse));
- for (i = 0; i < asdl_seq_LEN(o->v.If.orelse); i++) {
- void *elt = asdl_seq_GET(o->v.If.orelse, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- break;
- case Raise_kind:
- marshal_write_int(buf, off, 11);
- if (o->v.Raise.type) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Raise.type);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- if (o->v.Raise.inst) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Raise.inst);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- if (o->v.Raise.tback) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Raise.tback);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- break;
- case TryExcept_kind:
- marshal_write_int(buf, off, 12);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.TryExcept.body));
- for (i = 0; i < asdl_seq_LEN(o->v.TryExcept.body); i++) {
- void *elt = asdl_seq_GET(o->v.TryExcept.body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- marshal_write_int(buf, off,
- asdl_seq_LEN(o->v.TryExcept.handlers));
- for (i = 0; i < asdl_seq_LEN(o->v.TryExcept.handlers); i++) {
- void *elt = asdl_seq_GET(o->v.TryExcept.handlers, i);
- marshal_write_excepthandler(buf, off,
- (excepthandler_ty)elt);
- }
- marshal_write_int(buf, off,
- asdl_seq_LEN(o->v.TryExcept.orelse));
- for (i = 0; i < asdl_seq_LEN(o->v.TryExcept.orelse); i++) {
- void *elt = asdl_seq_GET(o->v.TryExcept.orelse, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- break;
- case TryFinally_kind:
- marshal_write_int(buf, off, 13);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.TryFinally.body));
- for (i = 0; i < asdl_seq_LEN(o->v.TryFinally.body); i++) {
- void *elt = asdl_seq_GET(o->v.TryFinally.body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- marshal_write_int(buf, off,
- asdl_seq_LEN(o->v.TryFinally.finalbody));
- for (i = 0; i < asdl_seq_LEN(o->v.TryFinally.finalbody); i++) {
- void *elt = asdl_seq_GET(o->v.TryFinally.finalbody, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- break;
- case Assert_kind:
- marshal_write_int(buf, off, 14);
- marshal_write_expr(buf, off, o->v.Assert.test);
- if (o->v.Assert.msg) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Assert.msg);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- break;
- case Import_kind:
- marshal_write_int(buf, off, 15);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Import.names));
- for (i = 0; i < asdl_seq_LEN(o->v.Import.names); i++) {
- void *elt = asdl_seq_GET(o->v.Import.names, i);
- marshal_write_alias(buf, off, (alias_ty)elt);
- }
- break;
- case ImportFrom_kind:
- marshal_write_int(buf, off, 16);
- marshal_write_identifier(buf, off, o->v.ImportFrom.module);
- marshal_write_int(buf, off,
- asdl_seq_LEN(o->v.ImportFrom.names));
- for (i = 0; i < asdl_seq_LEN(o->v.ImportFrom.names); i++) {
- void *elt = asdl_seq_GET(o->v.ImportFrom.names, i);
- marshal_write_alias(buf, off, (alias_ty)elt);
- }
- break;
- case Exec_kind:
- marshal_write_int(buf, off, 17);
- marshal_write_expr(buf, off, o->v.Exec.body);
- if (o->v.Exec.globals) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Exec.globals);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- if (o->v.Exec.locals) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Exec.locals);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- break;
- case Global_kind:
- marshal_write_int(buf, off, 18);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Global.names));
- for (i = 0; i < asdl_seq_LEN(o->v.Global.names); i++) {
- void *elt = asdl_seq_GET(o->v.Global.names, i);
- marshal_write_identifier(buf, off, (identifier)elt);
- }
- break;
- case Expr_kind:
- marshal_write_int(buf, off, 19);
- marshal_write_expr(buf, off, o->v.Expr.value);
- break;
- case Pass_kind:
- marshal_write_int(buf, off, 20);
- break;
- case Break_kind:
- marshal_write_int(buf, off, 21);
- break;
- case Continue_kind:
- marshal_write_int(buf, off, 22);
- break;
- }
- return 1;
-}
-
-static int
-marshal_write_expr(PyObject **buf, int *off, expr_ty o)
-{
- int i;
- switch (o->kind) {
- case BoolOp_kind:
- marshal_write_int(buf, off, 1);
- marshal_write_boolop(buf, off, o->v.BoolOp.op);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.BoolOp.values));
- for (i = 0; i < asdl_seq_LEN(o->v.BoolOp.values); i++) {
- void *elt = asdl_seq_GET(o->v.BoolOp.values, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- break;
- case BinOp_kind:
- marshal_write_int(buf, off, 2);
- marshal_write_expr(buf, off, o->v.BinOp.left);
- marshal_write_operator(buf, off, o->v.BinOp.op);
- marshal_write_expr(buf, off, o->v.BinOp.right);
- break;
- case UnaryOp_kind:
- marshal_write_int(buf, off, 3);
- marshal_write_unaryop(buf, off, o->v.UnaryOp.op);
- marshal_write_expr(buf, off, o->v.UnaryOp.operand);
- break;
- case Lambda_kind:
- marshal_write_int(buf, off, 4);
- marshal_write_arguments(buf, off, o->v.Lambda.args);
- marshal_write_expr(buf, off, o->v.Lambda.body);
- break;
- case Dict_kind:
- marshal_write_int(buf, off, 5);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Dict.keys));
- for (i = 0; i < asdl_seq_LEN(o->v.Dict.keys); i++) {
- void *elt = asdl_seq_GET(o->v.Dict.keys, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Dict.values));
- for (i = 0; i < asdl_seq_LEN(o->v.Dict.values); i++) {
- void *elt = asdl_seq_GET(o->v.Dict.values, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- break;
- case ListComp_kind:
- marshal_write_int(buf, off, 6);
- marshal_write_expr(buf, off, o->v.ListComp.elt);
- marshal_write_int(buf, off,
- asdl_seq_LEN(o->v.ListComp.generators));
- for (i = 0; i < asdl_seq_LEN(o->v.ListComp.generators); i++) {
- void *elt = asdl_seq_GET(o->v.ListComp.generators, i);
- marshal_write_comprehension(buf, off,
- (comprehension_ty)elt);
- }
- break;
- case GeneratorExp_kind:
- marshal_write_int(buf, off, 7);
- marshal_write_expr(buf, off, o->v.GeneratorExp.elt);
- marshal_write_int(buf, off,
- asdl_seq_LEN(o->v.GeneratorExp.generators));
- for (i = 0; i < asdl_seq_LEN(o->v.GeneratorExp.generators);
- i++) {
- void *elt = asdl_seq_GET(o->v.GeneratorExp.generators,
- i);
- marshal_write_comprehension(buf, off,
- (comprehension_ty)elt);
- }
- break;
- case Yield_kind:
- marshal_write_int(buf, off, 8);
- if (o->v.Yield.value) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Yield.value);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- break;
- case Compare_kind:
- marshal_write_int(buf, off, 9);
- marshal_write_expr(buf, off, o->v.Compare.left);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Compare.ops));
- for (i = 0; i < asdl_seq_LEN(o->v.Compare.ops); i++) {
- void *elt = asdl_seq_GET(o->v.Compare.ops, i);
- marshal_write_cmpop(buf, off, (cmpop_ty)elt);
- }
- marshal_write_int(buf, off,
- asdl_seq_LEN(o->v.Compare.comparators));
- for (i = 0; i < asdl_seq_LEN(o->v.Compare.comparators); i++) {
- void *elt = asdl_seq_GET(o->v.Compare.comparators, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- break;
- case Call_kind:
- marshal_write_int(buf, off, 10);
- marshal_write_expr(buf, off, o->v.Call.func);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Call.args));
- for (i = 0; i < asdl_seq_LEN(o->v.Call.args); i++) {
- void *elt = asdl_seq_GET(o->v.Call.args, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Call.keywords));
- for (i = 0; i < asdl_seq_LEN(o->v.Call.keywords); i++) {
- void *elt = asdl_seq_GET(o->v.Call.keywords, i);
- marshal_write_keyword(buf, off, (keyword_ty)elt);
- }
- if (o->v.Call.starargs) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Call.starargs);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- if (o->v.Call.kwargs) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Call.kwargs);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- break;
- case Repr_kind:
- marshal_write_int(buf, off, 11);
- marshal_write_expr(buf, off, o->v.Repr.value);
- break;
- case Num_kind:
- marshal_write_int(buf, off, 12);
- marshal_write_object(buf, off, o->v.Num.n);
- break;
- case Str_kind:
- marshal_write_int(buf, off, 13);
- marshal_write_string(buf, off, o->v.Str.s);
- break;
- case Attribute_kind:
- marshal_write_int(buf, off, 14);
- marshal_write_expr(buf, off, o->v.Attribute.value);
- marshal_write_identifier(buf, off, o->v.Attribute.attr);
- marshal_write_expr_context(buf, off, o->v.Attribute.ctx);
- break;
- case Subscript_kind:
- marshal_write_int(buf, off, 15);
- marshal_write_expr(buf, off, o->v.Subscript.value);
- marshal_write_slice(buf, off, o->v.Subscript.slice);
- marshal_write_expr_context(buf, off, o->v.Subscript.ctx);
- break;
- case Name_kind:
- marshal_write_int(buf, off, 16);
- marshal_write_identifier(buf, off, o->v.Name.id);
- marshal_write_expr_context(buf, off, o->v.Name.ctx);
- break;
- case List_kind:
- marshal_write_int(buf, off, 17);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.List.elts));
- for (i = 0; i < asdl_seq_LEN(o->v.List.elts); i++) {
- void *elt = asdl_seq_GET(o->v.List.elts, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- marshal_write_expr_context(buf, off, o->v.List.ctx);
- break;
- case Tuple_kind:
- marshal_write_int(buf, off, 18);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.Tuple.elts));
- for (i = 0; i < asdl_seq_LEN(o->v.Tuple.elts); i++) {
- void *elt = asdl_seq_GET(o->v.Tuple.elts, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- marshal_write_expr_context(buf, off, o->v.Tuple.ctx);
- break;
- }
- return 1;
-}
-
-static int
-marshal_write_expr_context(PyObject **buf, int *off, expr_context_ty o)
-{
- switch (o) {
- case Load:
- marshal_write_int(buf, off, 1);
- break;
- case Store:
- marshal_write_int(buf, off, 2);
- break;
- case Del:
- marshal_write_int(buf, off, 3);
- break;
- case AugLoad:
- marshal_write_int(buf, off, 4);
- break;
- case AugStore:
- marshal_write_int(buf, off, 5);
- break;
- case Param:
- marshal_write_int(buf, off, 6);
- break;
- }
- return 1;
-}
-
-static int
-marshal_write_slice(PyObject **buf, int *off, slice_ty o)
-{
- int i;
- switch (o->kind) {
- case Ellipsis_kind:
- marshal_write_int(buf, off, 1);
- break;
- case Slice_kind:
- marshal_write_int(buf, off, 2);
- if (o->v.Slice.lower) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Slice.lower);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- if (o->v.Slice.upper) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Slice.upper);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- if (o->v.Slice.step) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->v.Slice.step);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- break;
- case ExtSlice_kind:
- marshal_write_int(buf, off, 3);
- marshal_write_int(buf, off, asdl_seq_LEN(o->v.ExtSlice.dims));
- for (i = 0; i < asdl_seq_LEN(o->v.ExtSlice.dims); i++) {
- void *elt = asdl_seq_GET(o->v.ExtSlice.dims, i);
- marshal_write_slice(buf, off, (slice_ty)elt);
- }
- break;
- case Index_kind:
- marshal_write_int(buf, off, 4);
- marshal_write_expr(buf, off, o->v.Index.value);
- break;
- }
- return 1;
-}
-
-static int
-marshal_write_boolop(PyObject **buf, int *off, boolop_ty o)
-{
- switch (o) {
- case And:
- marshal_write_int(buf, off, 1);
- break;
- case Or:
- marshal_write_int(buf, off, 2);
- break;
- }
- return 1;
-}
-
-static int
-marshal_write_operator(PyObject **buf, int *off, operator_ty o)
-{
- switch (o) {
- case Add:
- marshal_write_int(buf, off, 1);
- break;
- case Sub:
- marshal_write_int(buf, off, 2);
- break;
- case Mult:
- marshal_write_int(buf, off, 3);
- break;
- case Div:
- marshal_write_int(buf, off, 4);
- break;
- case Mod:
- marshal_write_int(buf, off, 5);
- break;
- case Pow:
- marshal_write_int(buf, off, 6);
- break;
- case LShift:
- marshal_write_int(buf, off, 7);
- break;
- case RShift:
- marshal_write_int(buf, off, 8);
- break;
- case BitOr:
- marshal_write_int(buf, off, 9);
- break;
- case BitXor:
- marshal_write_int(buf, off, 10);
- break;
- case BitAnd:
- marshal_write_int(buf, off, 11);
- break;
- case FloorDiv:
- marshal_write_int(buf, off, 12);
- break;
- }
- return 1;
-}
-
-static int
-marshal_write_unaryop(PyObject **buf, int *off, unaryop_ty o)
-{
- switch (o) {
- case Invert:
- marshal_write_int(buf, off, 1);
- break;
- case Not:
- marshal_write_int(buf, off, 2);
- break;
- case UAdd:
- marshal_write_int(buf, off, 3);
- break;
- case USub:
- marshal_write_int(buf, off, 4);
- break;
- }
- return 1;
-}
-
-static int
-marshal_write_cmpop(PyObject **buf, int *off, cmpop_ty o)
-{
- switch (o) {
- case Eq:
- marshal_write_int(buf, off, 1);
- break;
- case NotEq:
- marshal_write_int(buf, off, 2);
- break;
- case Lt:
- marshal_write_int(buf, off, 3);
- break;
- case LtE:
- marshal_write_int(buf, off, 4);
- break;
- case Gt:
- marshal_write_int(buf, off, 5);
- break;
- case GtE:
- marshal_write_int(buf, off, 6);
- break;
- case Is:
- marshal_write_int(buf, off, 7);
- break;
- case IsNot:
- marshal_write_int(buf, off, 8);
- break;
- case In:
- marshal_write_int(buf, off, 9);
- break;
- case NotIn:
- marshal_write_int(buf, off, 10);
- break;
- }
- return 1;
-}
-
-static int
-marshal_write_comprehension(PyObject **buf, int *off, comprehension_ty o)
-{
- int i;
- marshal_write_expr(buf, off, o->target);
- marshal_write_expr(buf, off, o->iter);
- marshal_write_int(buf, off, asdl_seq_LEN(o->ifs));
- for (i = 0; i < asdl_seq_LEN(o->ifs); i++) {
- void *elt = asdl_seq_GET(o->ifs, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- return 1;
-}
-
-static int
-marshal_write_excepthandler(PyObject **buf, int *off, excepthandler_ty o)
-{
- int i;
- if (o->type) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->type);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- if (o->name) {
- marshal_write_int(buf, off, 1);
- marshal_write_expr(buf, off, o->name);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- marshal_write_int(buf, off, asdl_seq_LEN(o->body));
- for (i = 0; i < asdl_seq_LEN(o->body); i++) {
- void *elt = asdl_seq_GET(o->body, i);
- marshal_write_stmt(buf, off, (stmt_ty)elt);
- }
- return 1;
-}
-
-static int
-marshal_write_arguments(PyObject **buf, int *off, arguments_ty o)
-{
- int i;
- marshal_write_int(buf, off, asdl_seq_LEN(o->args));
- for (i = 0; i < asdl_seq_LEN(o->args); i++) {
- void *elt = asdl_seq_GET(o->args, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- if (o->vararg) {
- marshal_write_int(buf, off, 1);
- marshal_write_identifier(buf, off, o->vararg);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- if (o->kwarg) {
- marshal_write_int(buf, off, 1);
- marshal_write_identifier(buf, off, o->kwarg);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- marshal_write_int(buf, off, asdl_seq_LEN(o->defaults));
- for (i = 0; i < asdl_seq_LEN(o->defaults); i++) {
- void *elt = asdl_seq_GET(o->defaults, i);
- marshal_write_expr(buf, off, (expr_ty)elt);
- }
- return 1;
-}
-
-static int
-marshal_write_keyword(PyObject **buf, int *off, keyword_ty o)
-{
- marshal_write_identifier(buf, off, o->arg);
- marshal_write_expr(buf, off, o->value);
- return 1;
-}
-
-static int
-marshal_write_alias(PyObject **buf, int *off, alias_ty o)
-{
- marshal_write_identifier(buf, off, o->name);
- if (o->asname) {
- marshal_write_int(buf, off, 1);
- marshal_write_identifier(buf, off, o->asname);
- }
- else {
- marshal_write_int(buf, off, 0);
- }
- return 1;
+#define mod_dealloc 0
+PyTypeObject Py_mod_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "mod", /*tp_name*/
+ sizeof(struct Py_mod), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ mod_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_mod_Module_New(PyObject* body)
+{
+ struct Py_mod_Module *result = PyObject_New(struct Py_mod_Module, &Py_mod_Module_Type);
+ if (result == NULL)
+ return NULL;
+ result->body = body;
+ return (PyObject*)result;
+}
+
+static void
+mod_Module_dealloc(PyObject* _self)
+{
+ struct Py_mod_Module *self = (struct Py_mod_Module*)_self;
+ Py_DECREF(self->body);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_mod_Module_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "mod_Module", /*tp_name*/
+ sizeof(struct Py_mod_Module), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ mod_Module_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_mod_Interactive_New(PyObject* body)
+{
+ struct Py_mod_Interactive *result = PyObject_New(struct Py_mod_Interactive, &Py_mod_Interactive_Type);
+ if (result == NULL)
+ return NULL;
+ result->body = body;
+ return (PyObject*)result;
+}
+
+static void
+mod_Interactive_dealloc(PyObject* _self)
+{
+ struct Py_mod_Interactive *self = (struct Py_mod_Interactive*)_self;
+ Py_DECREF(self->body);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_mod_Interactive_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "mod_Interactive", /*tp_name*/
+ sizeof(struct Py_mod_Interactive), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ mod_Interactive_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_mod_Expression_New(PyObject* body)
+{
+ struct Py_mod_Expression *result = PyObject_New(struct Py_mod_Expression, &Py_mod_Expression_Type);
+ if (result == NULL)
+ return NULL;
+ result->body = body;
+ return (PyObject*)result;
+}
+
+static void
+mod_Expression_dealloc(PyObject* _self)
+{
+ struct Py_mod_Expression *self = (struct Py_mod_Expression*)_self;
+ Py_DECREF(self->body);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_mod_Expression_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "mod_Expression", /*tp_name*/
+ sizeof(struct Py_mod_Expression), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ mod_Expression_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_mod_Suite_New(PyObject* body)
+{
+ struct Py_mod_Suite *result = PyObject_New(struct Py_mod_Suite, &Py_mod_Suite_Type);
+ if (result == NULL)
+ return NULL;
+ result->body = body;
+ return (PyObject*)result;
+}
+
+static void
+mod_Suite_dealloc(PyObject* _self)
+{
+ struct Py_mod_Suite *self = (struct Py_mod_Suite*)_self;
+ Py_DECREF(self->body);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_mod_Suite_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "mod_Suite", /*tp_name*/
+ sizeof(struct Py_mod_Suite), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ mod_Suite_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+#define stmt_dealloc 0
+PyTypeObject Py_stmt_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt", /*tp_name*/
+ sizeof(struct Py_stmt), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_FunctionDef_New(PyObject* name, PyObject* args, PyObject* body,
+ PyObject* decorators, int lineno)
+{
+ struct Py_stmt_FunctionDef *result = PyObject_New(struct Py_stmt_FunctionDef, &Py_stmt_FunctionDef_Type);
+ if (result == NULL)
+ return NULL;
+ result->name = name;
+ result->args = args;
+ result->body = body;
+ result->decorators = decorators;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_FunctionDef_dealloc(PyObject* _self)
+{
+ struct Py_stmt_FunctionDef *self = (struct Py_stmt_FunctionDef*)_self;
+ Py_DECREF(self->name);
+ Py_DECREF(self->args);
+ Py_DECREF(self->body);
+ Py_DECREF(self->decorators);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_FunctionDef_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_FunctionDef", /*tp_name*/
+ sizeof(struct Py_stmt_FunctionDef), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_FunctionDef_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_ClassDef_New(PyObject* name, PyObject* bases, PyObject* body, int
+ lineno)
+{
+ struct Py_stmt_ClassDef *result = PyObject_New(struct Py_stmt_ClassDef, &Py_stmt_ClassDef_Type);
+ if (result == NULL)
+ return NULL;
+ result->name = name;
+ result->bases = bases;
+ result->body = body;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_ClassDef_dealloc(PyObject* _self)
+{
+ struct Py_stmt_ClassDef *self = (struct Py_stmt_ClassDef*)_self;
+ Py_DECREF(self->name);
+ Py_DECREF(self->bases);
+ Py_DECREF(self->body);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_ClassDef_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_ClassDef", /*tp_name*/
+ sizeof(struct Py_stmt_ClassDef), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_ClassDef_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Return_New(PyObject* value, int lineno)
+{
+ struct Py_stmt_Return *result = PyObject_New(struct Py_stmt_Return, &Py_stmt_Return_Type);
+ if (result == NULL)
+ return NULL;
+ result->value = value;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Return_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Return *self = (struct Py_stmt_Return*)_self;
+ Py_DECREF(self->value);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Return_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Return", /*tp_name*/
+ sizeof(struct Py_stmt_Return), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Return_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Delete_New(PyObject* targets, int lineno)
+{
+ struct Py_stmt_Delete *result = PyObject_New(struct Py_stmt_Delete, &Py_stmt_Delete_Type);
+ if (result == NULL)
+ return NULL;
+ result->targets = targets;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Delete_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Delete *self = (struct Py_stmt_Delete*)_self;
+ Py_DECREF(self->targets);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Delete_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Delete", /*tp_name*/
+ sizeof(struct Py_stmt_Delete), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Delete_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Assign_New(PyObject* targets, PyObject* value, int lineno)
+{
+ struct Py_stmt_Assign *result = PyObject_New(struct Py_stmt_Assign, &Py_stmt_Assign_Type);
+ if (result == NULL)
+ return NULL;
+ result->targets = targets;
+ result->value = value;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Assign_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Assign *self = (struct Py_stmt_Assign*)_self;
+ Py_DECREF(self->targets);
+ Py_DECREF(self->value);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Assign_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Assign", /*tp_name*/
+ sizeof(struct Py_stmt_Assign), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Assign_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_AugAssign_New(PyObject* target, PyObject* op, PyObject* value, int
+ lineno)
+{
+ struct Py_stmt_AugAssign *result = PyObject_New(struct Py_stmt_AugAssign, &Py_stmt_AugAssign_Type);
+ if (result == NULL)
+ return NULL;
+ result->target = target;
+ result->op = op;
+ result->value = value;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_AugAssign_dealloc(PyObject* _self)
+{
+ struct Py_stmt_AugAssign *self = (struct Py_stmt_AugAssign*)_self;
+ Py_DECREF(self->target);
+ Py_DECREF(self->op);
+ Py_DECREF(self->value);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_AugAssign_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_AugAssign", /*tp_name*/
+ sizeof(struct Py_stmt_AugAssign), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_AugAssign_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Print_New(PyObject* dest, PyObject* values, PyObject* nl, int lineno)
+{
+ struct Py_stmt_Print *result = PyObject_New(struct Py_stmt_Print, &Py_stmt_Print_Type);
+ if (result == NULL)
+ return NULL;
+ result->dest = dest;
+ result->values = values;
+ result->nl = nl;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Print_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Print *self = (struct Py_stmt_Print*)_self;
+ Py_DECREF(self->dest);
+ Py_DECREF(self->values);
+ Py_DECREF(self->nl);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Print_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Print", /*tp_name*/
+ sizeof(struct Py_stmt_Print), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Print_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_For_New(PyObject* target, PyObject* iter, PyObject* body, PyObject*
+ orelse, int lineno)
+{
+ struct Py_stmt_For *result = PyObject_New(struct Py_stmt_For, &Py_stmt_For_Type);
+ if (result == NULL)
+ return NULL;
+ result->target = target;
+ result->iter = iter;
+ result->body = body;
+ result->orelse = orelse;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_For_dealloc(PyObject* _self)
+{
+ struct Py_stmt_For *self = (struct Py_stmt_For*)_self;
+ Py_DECREF(self->target);
+ Py_DECREF(self->iter);
+ Py_DECREF(self->body);
+ Py_DECREF(self->orelse);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_For_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_For", /*tp_name*/
+ sizeof(struct Py_stmt_For), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_For_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_While_New(PyObject* test, PyObject* body, PyObject* orelse, int lineno)
+{
+ struct Py_stmt_While *result = PyObject_New(struct Py_stmt_While, &Py_stmt_While_Type);
+ if (result == NULL)
+ return NULL;
+ result->test = test;
+ result->body = body;
+ result->orelse = orelse;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_While_dealloc(PyObject* _self)
+{
+ struct Py_stmt_While *self = (struct Py_stmt_While*)_self;
+ Py_DECREF(self->test);
+ Py_DECREF(self->body);
+ Py_DECREF(self->orelse);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_While_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_While", /*tp_name*/
+ sizeof(struct Py_stmt_While), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_While_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_If_New(PyObject* test, PyObject* body, PyObject* orelse, int lineno)
+{
+ struct Py_stmt_If *result = PyObject_New(struct Py_stmt_If, &Py_stmt_If_Type);
+ if (result == NULL)
+ return NULL;
+ result->test = test;
+ result->body = body;
+ result->orelse = orelse;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_If_dealloc(PyObject* _self)
+{
+ struct Py_stmt_If *self = (struct Py_stmt_If*)_self;
+ Py_DECREF(self->test);
+ Py_DECREF(self->body);
+ Py_DECREF(self->orelse);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_If_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_If", /*tp_name*/
+ sizeof(struct Py_stmt_If), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_If_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Raise_New(PyObject* type, PyObject* inst, PyObject* tback, int lineno)
+{
+ struct Py_stmt_Raise *result = PyObject_New(struct Py_stmt_Raise, &Py_stmt_Raise_Type);
+ if (result == NULL)
+ return NULL;
+ result->type = type;
+ result->inst = inst;
+ result->tback = tback;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Raise_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Raise *self = (struct Py_stmt_Raise*)_self;
+ Py_DECREF(self->type);
+ Py_DECREF(self->inst);
+ Py_DECREF(self->tback);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Raise_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Raise", /*tp_name*/
+ sizeof(struct Py_stmt_Raise), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Raise_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_TryExcept_New(PyObject* body, PyObject* handlers, PyObject* orelse, int
+ lineno)
+{
+ struct Py_stmt_TryExcept *result = PyObject_New(struct Py_stmt_TryExcept, &Py_stmt_TryExcept_Type);
+ if (result == NULL)
+ return NULL;
+ result->body = body;
+ result->handlers = handlers;
+ result->orelse = orelse;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_TryExcept_dealloc(PyObject* _self)
+{
+ struct Py_stmt_TryExcept *self = (struct Py_stmt_TryExcept*)_self;
+ Py_DECREF(self->body);
+ Py_DECREF(self->handlers);
+ Py_DECREF(self->orelse);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_TryExcept_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_TryExcept", /*tp_name*/
+ sizeof(struct Py_stmt_TryExcept), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_TryExcept_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_TryFinally_New(PyObject* body, PyObject* finalbody, int lineno)
+{
+ struct Py_stmt_TryFinally *result = PyObject_New(struct Py_stmt_TryFinally, &Py_stmt_TryFinally_Type);
+ if (result == NULL)
+ return NULL;
+ result->body = body;
+ result->finalbody = finalbody;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_TryFinally_dealloc(PyObject* _self)
+{
+ struct Py_stmt_TryFinally *self = (struct Py_stmt_TryFinally*)_self;
+ Py_DECREF(self->body);
+ Py_DECREF(self->finalbody);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_TryFinally_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_TryFinally", /*tp_name*/
+ sizeof(struct Py_stmt_TryFinally), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_TryFinally_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Assert_New(PyObject* test, PyObject* msg, int lineno)
+{
+ struct Py_stmt_Assert *result = PyObject_New(struct Py_stmt_Assert, &Py_stmt_Assert_Type);
+ if (result == NULL)
+ return NULL;
+ result->test = test;
+ result->msg = msg;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Assert_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Assert *self = (struct Py_stmt_Assert*)_self;
+ Py_DECREF(self->test);
+ Py_DECREF(self->msg);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Assert_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Assert", /*tp_name*/
+ sizeof(struct Py_stmt_Assert), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Assert_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Import_New(PyObject* names, int lineno)
+{
+ struct Py_stmt_Import *result = PyObject_New(struct Py_stmt_Import, &Py_stmt_Import_Type);
+ if (result == NULL)
+ return NULL;
+ result->names = names;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Import_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Import *self = (struct Py_stmt_Import*)_self;
+ Py_DECREF(self->names);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Import_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Import", /*tp_name*/
+ sizeof(struct Py_stmt_Import), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Import_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_ImportFrom_New(PyObject* module, PyObject* names, int lineno)
+{
+ struct Py_stmt_ImportFrom *result = PyObject_New(struct Py_stmt_ImportFrom, &Py_stmt_ImportFrom_Type);
+ if (result == NULL)
+ return NULL;
+ result->module = module;
+ result->names = names;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_ImportFrom_dealloc(PyObject* _self)
+{
+ struct Py_stmt_ImportFrom *self = (struct Py_stmt_ImportFrom*)_self;
+ Py_DECREF(self->module);
+ Py_DECREF(self->names);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_ImportFrom_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_ImportFrom", /*tp_name*/
+ sizeof(struct Py_stmt_ImportFrom), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_ImportFrom_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Exec_New(PyObject* body, PyObject* globals, PyObject* locals, int
+ lineno)
+{
+ struct Py_stmt_Exec *result = PyObject_New(struct Py_stmt_Exec, &Py_stmt_Exec_Type);
+ if (result == NULL)
+ return NULL;
+ result->body = body;
+ result->globals = globals;
+ result->locals = locals;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Exec_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Exec *self = (struct Py_stmt_Exec*)_self;
+ Py_DECREF(self->body);
+ Py_DECREF(self->globals);
+ Py_DECREF(self->locals);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Exec_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Exec", /*tp_name*/
+ sizeof(struct Py_stmt_Exec), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Exec_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Global_New(PyObject* names, int lineno)
+{
+ struct Py_stmt_Global *result = PyObject_New(struct Py_stmt_Global, &Py_stmt_Global_Type);
+ if (result == NULL)
+ return NULL;
+ result->names = names;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Global_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Global *self = (struct Py_stmt_Global*)_self;
+ Py_DECREF(self->names);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Global_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Global", /*tp_name*/
+ sizeof(struct Py_stmt_Global), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Global_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Expr_New(PyObject* value, int lineno)
+{
+ struct Py_stmt_Expr *result = PyObject_New(struct Py_stmt_Expr, &Py_stmt_Expr_Type);
+ if (result == NULL)
+ return NULL;
+ result->value = value;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Expr_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Expr *self = (struct Py_stmt_Expr*)_self;
+ Py_DECREF(self->value);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Expr_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Expr", /*tp_name*/
+ sizeof(struct Py_stmt_Expr), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Expr_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Pass_New(int lineno)
+{
+ struct Py_stmt_Pass *result = PyObject_New(struct Py_stmt_Pass, &Py_stmt_Pass_Type);
+ if (result == NULL)
+ return NULL;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Pass_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Pass *self = (struct Py_stmt_Pass*)_self;
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Pass_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Pass", /*tp_name*/
+ sizeof(struct Py_stmt_Pass), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Pass_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Break_New(int lineno)
+{
+ struct Py_stmt_Break *result = PyObject_New(struct Py_stmt_Break, &Py_stmt_Break_Type);
+ if (result == NULL)
+ return NULL;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Break_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Break *self = (struct Py_stmt_Break*)_self;
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Break_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Break", /*tp_name*/
+ sizeof(struct Py_stmt_Break), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Break_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_stmt_Continue_New(int lineno)
+{
+ struct Py_stmt_Continue *result = PyObject_New(struct Py_stmt_Continue, &Py_stmt_Continue_Type);
+ if (result == NULL)
+ return NULL;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+stmt_Continue_dealloc(PyObject* _self)
+{
+ struct Py_stmt_Continue *self = (struct Py_stmt_Continue*)_self;
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_stmt_Continue_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "stmt_Continue", /*tp_name*/
+ sizeof(struct Py_stmt_Continue), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ stmt_Continue_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+#define expr_dealloc 0
+PyTypeObject Py_expr_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr", /*tp_name*/
+ sizeof(struct Py_expr), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_BoolOp_New(PyObject* op, PyObject* values, int lineno)
+{
+ struct Py_expr_BoolOp *result = PyObject_New(struct Py_expr_BoolOp, &Py_expr_BoolOp_Type);
+ if (result == NULL)
+ return NULL;
+ result->op = op;
+ result->values = values;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_BoolOp_dealloc(PyObject* _self)
+{
+ struct Py_expr_BoolOp *self = (struct Py_expr_BoolOp*)_self;
+ Py_DECREF(self->op);
+ Py_DECREF(self->values);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_BoolOp_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_BoolOp", /*tp_name*/
+ sizeof(struct Py_expr_BoolOp), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_BoolOp_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_BinOp_New(PyObject* left, PyObject* op, PyObject* right, int lineno)
+{
+ struct Py_expr_BinOp *result = PyObject_New(struct Py_expr_BinOp, &Py_expr_BinOp_Type);
+ if (result == NULL)
+ return NULL;
+ result->left = left;
+ result->op = op;
+ result->right = right;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_BinOp_dealloc(PyObject* _self)
+{
+ struct Py_expr_BinOp *self = (struct Py_expr_BinOp*)_self;
+ Py_DECREF(self->left);
+ Py_DECREF(self->op);
+ Py_DECREF(self->right);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_BinOp_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_BinOp", /*tp_name*/
+ sizeof(struct Py_expr_BinOp), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_BinOp_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_UnaryOp_New(PyObject* op, PyObject* operand, int lineno)
+{
+ struct Py_expr_UnaryOp *result = PyObject_New(struct Py_expr_UnaryOp, &Py_expr_UnaryOp_Type);
+ if (result == NULL)
+ return NULL;
+ result->op = op;
+ result->operand = operand;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_UnaryOp_dealloc(PyObject* _self)
+{
+ struct Py_expr_UnaryOp *self = (struct Py_expr_UnaryOp*)_self;
+ Py_DECREF(self->op);
+ Py_DECREF(self->operand);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_UnaryOp_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_UnaryOp", /*tp_name*/
+ sizeof(struct Py_expr_UnaryOp), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_UnaryOp_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Lambda_New(PyObject* args, PyObject* body, int lineno)
+{
+ struct Py_expr_Lambda *result = PyObject_New(struct Py_expr_Lambda, &Py_expr_Lambda_Type);
+ if (result == NULL)
+ return NULL;
+ result->args = args;
+ result->body = body;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Lambda_dealloc(PyObject* _self)
+{
+ struct Py_expr_Lambda *self = (struct Py_expr_Lambda*)_self;
+ Py_DECREF(self->args);
+ Py_DECREF(self->body);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Lambda_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Lambda", /*tp_name*/
+ sizeof(struct Py_expr_Lambda), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Lambda_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Dict_New(PyObject* keys, PyObject* values, int lineno)
+{
+ struct Py_expr_Dict *result = PyObject_New(struct Py_expr_Dict, &Py_expr_Dict_Type);
+ if (result == NULL)
+ return NULL;
+ result->keys = keys;
+ result->values = values;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Dict_dealloc(PyObject* _self)
+{
+ struct Py_expr_Dict *self = (struct Py_expr_Dict*)_self;
+ Py_DECREF(self->keys);
+ Py_DECREF(self->values);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Dict_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Dict", /*tp_name*/
+ sizeof(struct Py_expr_Dict), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Dict_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_ListComp_New(PyObject* elt, PyObject* generators, int lineno)
+{
+ struct Py_expr_ListComp *result = PyObject_New(struct Py_expr_ListComp, &Py_expr_ListComp_Type);
+ if (result == NULL)
+ return NULL;
+ result->elt = elt;
+ result->generators = generators;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_ListComp_dealloc(PyObject* _self)
+{
+ struct Py_expr_ListComp *self = (struct Py_expr_ListComp*)_self;
+ Py_DECREF(self->elt);
+ Py_DECREF(self->generators);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_ListComp_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_ListComp", /*tp_name*/
+ sizeof(struct Py_expr_ListComp), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_ListComp_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_GeneratorExp_New(PyObject* elt, PyObject* generators, int lineno)
+{
+ struct Py_expr_GeneratorExp *result = PyObject_New(struct Py_expr_GeneratorExp, &Py_expr_GeneratorExp_Type);
+ if (result == NULL)
+ return NULL;
+ result->elt = elt;
+ result->generators = generators;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_GeneratorExp_dealloc(PyObject* _self)
+{
+ struct Py_expr_GeneratorExp *self = (struct Py_expr_GeneratorExp*)_self;
+ Py_DECREF(self->elt);
+ Py_DECREF(self->generators);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_GeneratorExp_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_GeneratorExp", /*tp_name*/
+ sizeof(struct Py_expr_GeneratorExp), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_GeneratorExp_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Yield_New(PyObject* value, int lineno)
+{
+ struct Py_expr_Yield *result = PyObject_New(struct Py_expr_Yield, &Py_expr_Yield_Type);
+ if (result == NULL)
+ return NULL;
+ result->value = value;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Yield_dealloc(PyObject* _self)
+{
+ struct Py_expr_Yield *self = (struct Py_expr_Yield*)_self;
+ Py_DECREF(self->value);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Yield_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Yield", /*tp_name*/
+ sizeof(struct Py_expr_Yield), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Yield_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Compare_New(PyObject* left, PyObject* ops, PyObject* comparators, int
+ lineno)
+{
+ struct Py_expr_Compare *result = PyObject_New(struct Py_expr_Compare, &Py_expr_Compare_Type);
+ if (result == NULL)
+ return NULL;
+ result->left = left;
+ result->ops = ops;
+ result->comparators = comparators;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Compare_dealloc(PyObject* _self)
+{
+ struct Py_expr_Compare *self = (struct Py_expr_Compare*)_self;
+ Py_DECREF(self->left);
+ Py_DECREF(self->ops);
+ Py_DECREF(self->comparators);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Compare_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Compare", /*tp_name*/
+ sizeof(struct Py_expr_Compare), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Compare_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Call_New(PyObject* func, PyObject* args, PyObject* keywords, PyObject*
+ starargs, PyObject* kwargs, int lineno)
+{
+ struct Py_expr_Call *result = PyObject_New(struct Py_expr_Call, &Py_expr_Call_Type);
+ if (result == NULL)
+ return NULL;
+ result->func = func;
+ result->args = args;
+ result->keywords = keywords;
+ result->starargs = starargs;
+ result->kwargs = kwargs;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Call_dealloc(PyObject* _self)
+{
+ struct Py_expr_Call *self = (struct Py_expr_Call*)_self;
+ Py_DECREF(self->func);
+ Py_DECREF(self->args);
+ Py_DECREF(self->keywords);
+ Py_DECREF(self->starargs);
+ Py_DECREF(self->kwargs);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Call_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Call", /*tp_name*/
+ sizeof(struct Py_expr_Call), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Call_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Repr_New(PyObject* value, int lineno)
+{
+ struct Py_expr_Repr *result = PyObject_New(struct Py_expr_Repr, &Py_expr_Repr_Type);
+ if (result == NULL)
+ return NULL;
+ result->value = value;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Repr_dealloc(PyObject* _self)
+{
+ struct Py_expr_Repr *self = (struct Py_expr_Repr*)_self;
+ Py_DECREF(self->value);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Repr_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Repr", /*tp_name*/
+ sizeof(struct Py_expr_Repr), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Repr_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Num_New(PyObject* n, int lineno)
+{
+ struct Py_expr_Num *result = PyObject_New(struct Py_expr_Num, &Py_expr_Num_Type);
+ if (result == NULL)
+ return NULL;
+ result->n = n;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Num_dealloc(PyObject* _self)
+{
+ struct Py_expr_Num *self = (struct Py_expr_Num*)_self;
+ Py_DECREF(self->n);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Num_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Num", /*tp_name*/
+ sizeof(struct Py_expr_Num), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Num_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Str_New(PyObject* s, int lineno)
+{
+ struct Py_expr_Str *result = PyObject_New(struct Py_expr_Str, &Py_expr_Str_Type);
+ if (result == NULL)
+ return NULL;
+ result->s = s;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Str_dealloc(PyObject* _self)
+{
+ struct Py_expr_Str *self = (struct Py_expr_Str*)_self;
+ Py_DECREF(self->s);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Str_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Str", /*tp_name*/
+ sizeof(struct Py_expr_Str), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Str_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Attribute_New(PyObject* value, PyObject* attr, PyObject* ctx, int
+ lineno)
+{
+ struct Py_expr_Attribute *result = PyObject_New(struct Py_expr_Attribute, &Py_expr_Attribute_Type);
+ if (result == NULL)
+ return NULL;
+ result->value = value;
+ result->attr = attr;
+ result->ctx = ctx;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Attribute_dealloc(PyObject* _self)
+{
+ struct Py_expr_Attribute *self = (struct Py_expr_Attribute*)_self;
+ Py_DECREF(self->value);
+ Py_DECREF(self->attr);
+ Py_DECREF(self->ctx);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Attribute_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Attribute", /*tp_name*/
+ sizeof(struct Py_expr_Attribute), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Attribute_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Subscript_New(PyObject* value, PyObject* slice, PyObject* ctx, int
+ lineno)
+{
+ struct Py_expr_Subscript *result = PyObject_New(struct Py_expr_Subscript, &Py_expr_Subscript_Type);
+ if (result == NULL)
+ return NULL;
+ result->value = value;
+ result->slice = slice;
+ result->ctx = ctx;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Subscript_dealloc(PyObject* _self)
+{
+ struct Py_expr_Subscript *self = (struct Py_expr_Subscript*)_self;
+ Py_DECREF(self->value);
+ Py_DECREF(self->slice);
+ Py_DECREF(self->ctx);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Subscript_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Subscript", /*tp_name*/
+ sizeof(struct Py_expr_Subscript), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Subscript_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Name_New(PyObject* id, PyObject* ctx, int lineno)
+{
+ struct Py_expr_Name *result = PyObject_New(struct Py_expr_Name, &Py_expr_Name_Type);
+ if (result == NULL)
+ return NULL;
+ result->id = id;
+ result->ctx = ctx;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Name_dealloc(PyObject* _self)
+{
+ struct Py_expr_Name *self = (struct Py_expr_Name*)_self;
+ Py_DECREF(self->id);
+ Py_DECREF(self->ctx);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Name_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Name", /*tp_name*/
+ sizeof(struct Py_expr_Name), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Name_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_List_New(PyObject* elts, PyObject* ctx, int lineno)
+{
+ struct Py_expr_List *result = PyObject_New(struct Py_expr_List, &Py_expr_List_Type);
+ if (result == NULL)
+ return NULL;
+ result->elts = elts;
+ result->ctx = ctx;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_List_dealloc(PyObject* _self)
+{
+ struct Py_expr_List *self = (struct Py_expr_List*)_self;
+ Py_DECREF(self->elts);
+ Py_DECREF(self->ctx);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_List_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_List", /*tp_name*/
+ sizeof(struct Py_expr_List), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_List_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_expr_Tuple_New(PyObject* elts, PyObject* ctx, int lineno)
+{
+ struct Py_expr_Tuple *result = PyObject_New(struct Py_expr_Tuple, &Py_expr_Tuple_Type);
+ if (result == NULL)
+ return NULL;
+ result->elts = elts;
+ result->ctx = ctx;
+ result->_base.lineno = lineno;
+ return (PyObject*)result;
+}
+
+static void
+expr_Tuple_dealloc(PyObject* _self)
+{
+ struct Py_expr_Tuple *self = (struct Py_expr_Tuple*)_self;
+ Py_DECREF(self->elts);
+ Py_DECREF(self->ctx);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_expr_Tuple_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "expr_Tuple", /*tp_name*/
+ sizeof(struct Py_expr_Tuple), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ expr_Tuple_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+#define slice_dealloc 0
+PyTypeObject Py_slice_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "slice", /*tp_name*/
+ sizeof(struct Py_slice), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ slice_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_slice_Ellipsis_New()
+{
+ struct Py_slice_Ellipsis *result = PyObject_New(struct Py_slice_Ellipsis, &Py_slice_Ellipsis_Type);
+ if (result == NULL)
+ return NULL;
+ return (PyObject*)result;
+}
+
+static void
+slice_Ellipsis_dealloc(PyObject* _self)
+{
+ struct Py_slice_Ellipsis *self = (struct Py_slice_Ellipsis*)_self;
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_slice_Ellipsis_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "slice_Ellipsis", /*tp_name*/
+ sizeof(struct Py_slice_Ellipsis), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ slice_Ellipsis_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_slice_Slice_New(PyObject* lower, PyObject* upper, PyObject* step)
+{
+ struct Py_slice_Slice *result = PyObject_New(struct Py_slice_Slice, &Py_slice_Slice_Type);
+ if (result == NULL)
+ return NULL;
+ result->lower = lower;
+ result->upper = upper;
+ result->step = step;
+ return (PyObject*)result;
+}
+
+static void
+slice_Slice_dealloc(PyObject* _self)
+{
+ struct Py_slice_Slice *self = (struct Py_slice_Slice*)_self;
+ Py_DECREF(self->lower);
+ Py_DECREF(self->upper);
+ Py_DECREF(self->step);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_slice_Slice_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "slice_Slice", /*tp_name*/
+ sizeof(struct Py_slice_Slice), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ slice_Slice_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_slice_ExtSlice_New(PyObject* dims)
+{
+ struct Py_slice_ExtSlice *result = PyObject_New(struct Py_slice_ExtSlice, &Py_slice_ExtSlice_Type);
+ if (result == NULL)
+ return NULL;
+ result->dims = dims;
+ return (PyObject*)result;
+}
+
+static void
+slice_ExtSlice_dealloc(PyObject* _self)
+{
+ struct Py_slice_ExtSlice *self = (struct Py_slice_ExtSlice*)_self;
+ Py_DECREF(self->dims);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_slice_ExtSlice_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "slice_ExtSlice", /*tp_name*/
+ sizeof(struct Py_slice_ExtSlice), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ slice_ExtSlice_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_slice_Index_New(PyObject* value)
+{
+ struct Py_slice_Index *result = PyObject_New(struct Py_slice_Index, &Py_slice_Index_Type);
+ if (result == NULL)
+ return NULL;
+ result->value = value;
+ return (PyObject*)result;
+}
+
+static void
+slice_Index_dealloc(PyObject* _self)
+{
+ struct Py_slice_Index *self = (struct Py_slice_Index*)_self;
+ Py_DECREF(self->value);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_slice_Index_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "slice_Index", /*tp_name*/
+ sizeof(struct Py_slice_Index), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ slice_Index_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_comprehension_New(PyObject* target, PyObject* iter, PyObject* ifs)
+{
+ struct Py_comprehension *result = PyObject_New(struct Py_comprehension, &Py_comprehension_Type);
+ if (result == NULL)
+ return NULL;
+ result->target = target;
+ result->iter = iter;
+ result->ifs = ifs;
+ return (PyObject*)result;
+}
+
+static void
+comprehension_dealloc(PyObject* _self)
+{
+ struct Py_comprehension *self = (struct Py_comprehension*)_self;
+ Py_DECREF(self->target);
+ Py_DECREF(self->iter);
+ Py_DECREF(self->ifs);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_comprehension_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "comprehension", /*tp_name*/
+ sizeof(struct Py_comprehension), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ comprehension_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_excepthandler_New(PyObject* type, PyObject* name, PyObject* body)
+{
+ struct Py_excepthandler *result = PyObject_New(struct Py_excepthandler, &Py_excepthandler_Type);
+ if (result == NULL)
+ return NULL;
+ result->type = type;
+ result->name = name;
+ result->body = body;
+ return (PyObject*)result;
}
+static void
+excepthandler_dealloc(PyObject* _self)
+{
+ struct Py_excepthandler *self = (struct Py_excepthandler*)_self;
+ Py_DECREF(self->type);
+ Py_DECREF(self->name);
+ Py_DECREF(self->body);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_excepthandler_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "excepthandler", /*tp_name*/
+ sizeof(struct Py_excepthandler), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ excepthandler_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_arguments_New(PyObject* args, PyObject* vararg, PyObject* kwarg, PyObject*
+ defaults)
+{
+ struct Py_arguments *result = PyObject_New(struct Py_arguments, &Py_arguments_Type);
+ if (result == NULL)
+ return NULL;
+ result->args = args;
+ result->vararg = vararg;
+ result->kwarg = kwarg;
+ result->defaults = defaults;
+ return (PyObject*)result;
+}
+
+static void
+arguments_dealloc(PyObject* _self)
+{
+ struct Py_arguments *self = (struct Py_arguments*)_self;
+ Py_DECREF(self->args);
+ Py_DECREF(self->vararg);
+ Py_DECREF(self->kwarg);
+ Py_DECREF(self->defaults);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_arguments_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "arguments", /*tp_name*/
+ sizeof(struct Py_arguments), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ arguments_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_keyword_New(PyObject* arg, PyObject* value)
+{
+ struct Py_keyword *result = PyObject_New(struct Py_keyword, &Py_keyword_Type);
+ if (result == NULL)
+ return NULL;
+ result->arg = arg;
+ result->value = value;
+ return (PyObject*)result;
+}
+
+static void
+keyword_dealloc(PyObject* _self)
+{
+ struct Py_keyword *self = (struct Py_keyword*)_self;
+ Py_DECREF(self->arg);
+ Py_DECREF(self->value);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_keyword_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "keyword", /*tp_name*/
+ sizeof(struct Py_keyword), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ keyword_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+PyObject*
+Py_alias_New(PyObject* name, PyObject* asname)
+{
+ struct Py_alias *result = PyObject_New(struct Py_alias, &Py_alias_Type);
+ if (result == NULL)
+ return NULL;
+ result->name = name;
+ result->asname = asname;
+ return (PyObject*)result;
+}
+
+static void
+alias_dealloc(PyObject* _self)
+{
+ struct Py_alias *self = (struct Py_alias*)_self;
+ Py_DECREF(self->name);
+ Py_DECREF(self->asname);
+ PyObject_Del(self);
+}
+
+PyTypeObject Py_alias_Type = {
+ PyObject_HEAD_INIT(NULL)
+ 0, /*ob_size*/
+ "alias", /*tp_name*/
+ sizeof(struct Py_alias), /*tp_basicsize*/
+ 0, /* tp_itemsize */
+ alias_dealloc, /*tp_dealloc*/
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
+ 0, /* tp_as_number */
+ 0, /* tp_as_sequence */
+ 0, /* tp_as_mapping */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ 0, /* tp_methods */
+ 0, /* tp_members */
+ 0, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
+ 0, /* tp_descr_get */
+ 0, /* tp_descr_set */
+ 0, /* tp_dictoffset */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ 0, /* tp_new */
+ 0, /* tp_free */
+ 0, /* tp_is_gc */
+ };
+
+
+void init_ast(void)
+{
+ if (PyType_Ready(&Py_mod_Type) < 0)
+ return;
+ Py_mod_Module_Type.tp_base = &Py_mod_Type;
+ if (PyType_Ready(&Py_mod_Module_Type) < 0)
+ return;
+ Py_mod_Interactive_Type.tp_base = &Py_mod_Type;
+ if (PyType_Ready(&Py_mod_Interactive_Type) < 0)
+ return;
+ Py_mod_Expression_Type.tp_base = &Py_mod_Type;
+ if (PyType_Ready(&Py_mod_Expression_Type) < 0)
+ return;
+ Py_mod_Suite_Type.tp_base = &Py_mod_Type;
+ if (PyType_Ready(&Py_mod_Suite_Type) < 0)
+ return;
+ if (PyType_Ready(&Py_stmt_Type) < 0)
+ return;
+ Py_stmt_FunctionDef_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_FunctionDef_Type) < 0)
+ return;
+ Py_stmt_ClassDef_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_ClassDef_Type) < 0)
+ return;
+ Py_stmt_Return_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Return_Type) < 0)
+ return;
+ Py_stmt_Delete_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Delete_Type) < 0)
+ return;
+ Py_stmt_Assign_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Assign_Type) < 0)
+ return;
+ Py_stmt_AugAssign_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_AugAssign_Type) < 0)
+ return;
+ Py_stmt_Print_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Print_Type) < 0)
+ return;
+ Py_stmt_For_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_For_Type) < 0)
+ return;
+ Py_stmt_While_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_While_Type) < 0)
+ return;
+ Py_stmt_If_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_If_Type) < 0)
+ return;
+ Py_stmt_Raise_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Raise_Type) < 0)
+ return;
+ Py_stmt_TryExcept_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_TryExcept_Type) < 0)
+ return;
+ Py_stmt_TryFinally_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_TryFinally_Type) < 0)
+ return;
+ Py_stmt_Assert_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Assert_Type) < 0)
+ return;
+ Py_stmt_Import_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Import_Type) < 0)
+ return;
+ Py_stmt_ImportFrom_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_ImportFrom_Type) < 0)
+ return;
+ Py_stmt_Exec_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Exec_Type) < 0)
+ return;
+ Py_stmt_Global_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Global_Type) < 0)
+ return;
+ Py_stmt_Expr_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Expr_Type) < 0)
+ return;
+ Py_stmt_Pass_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Pass_Type) < 0)
+ return;
+ Py_stmt_Break_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Break_Type) < 0)
+ return;
+ Py_stmt_Continue_Type.tp_base = &Py_stmt_Type;
+ if (PyType_Ready(&Py_stmt_Continue_Type) < 0)
+ return;
+ if (PyType_Ready(&Py_expr_Type) < 0)
+ return;
+ Py_expr_BoolOp_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_BoolOp_Type) < 0)
+ return;
+ Py_expr_BinOp_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_BinOp_Type) < 0)
+ return;
+ Py_expr_UnaryOp_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_UnaryOp_Type) < 0)
+ return;
+ Py_expr_Lambda_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Lambda_Type) < 0)
+ return;
+ Py_expr_Dict_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Dict_Type) < 0)
+ return;
+ Py_expr_ListComp_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_ListComp_Type) < 0)
+ return;
+ Py_expr_GeneratorExp_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_GeneratorExp_Type) < 0)
+ return;
+ Py_expr_Yield_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Yield_Type) < 0)
+ return;
+ Py_expr_Compare_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Compare_Type) < 0)
+ return;
+ Py_expr_Call_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Call_Type) < 0)
+ return;
+ Py_expr_Repr_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Repr_Type) < 0)
+ return;
+ Py_expr_Num_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Num_Type) < 0)
+ return;
+ Py_expr_Str_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Str_Type) < 0)
+ return;
+ Py_expr_Attribute_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Attribute_Type) < 0)
+ return;
+ Py_expr_Subscript_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Subscript_Type) < 0)
+ return;
+ Py_expr_Name_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Name_Type) < 0)
+ return;
+ Py_expr_List_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_List_Type) < 0)
+ return;
+ Py_expr_Tuple_Type.tp_base = &Py_expr_Type;
+ if (PyType_Ready(&Py_expr_Tuple_Type) < 0)
+ return;
+ if (PyType_Ready(&Py_slice_Type) < 0)
+ return;
+ Py_slice_Ellipsis_Type.tp_base = &Py_slice_Type;
+ if (PyType_Ready(&Py_slice_Ellipsis_Type) < 0)
+ return;
+ Py_slice_Slice_Type.tp_base = &Py_slice_Type;
+ if (PyType_Ready(&Py_slice_Slice_Type) < 0)
+ return;
+ Py_slice_ExtSlice_Type.tp_base = &Py_slice_Type;
+ if (PyType_Ready(&Py_slice_ExtSlice_Type) < 0)
+ return;
+ Py_slice_Index_Type.tp_base = &Py_slice_Type;
+ if (PyType_Ready(&Py_slice_Index_Type) < 0)
+ return;
+ if (PyType_Ready(&Py_comprehension_Type) < 0)
+ return;
+ if (PyType_Ready(&Py_excepthandler_Type) < 0)
+ return;
+ if (PyType_Ready(&Py_arguments_Type) < 0)
+ return;
+ if (PyType_Ready(&Py_keyword_Type) < 0)
+ return;
+ if (PyType_Ready(&Py_alias_Type) < 0)
+ return;
+}
Deleted: /python/branches/ast-objects/Python/asdl.c
==============================================================================
--- /python/branches/ast-objects/Python/asdl.c Wed Nov 30 20:11:25 2005
+++ (empty file)
@@ -1,26 +0,0 @@
-#include "Python.h"
-#include "asdl.h"
-
-asdl_seq *
-asdl_seq_new(int size)
-{
- asdl_seq *seq = NULL;
- size_t n = sizeof(asdl_seq) +
- (size ? (sizeof(void *) * (size - 1)) : 0);
-
- seq = (asdl_seq *)PyObject_Malloc(n);
- if (!seq) {
- PyErr_NoMemory();
- return NULL;
- }
- memset(seq, 0, n);
- seq->size = size;
- return seq;
-}
-
-void
-asdl_seq_free(asdl_seq *seq)
-{
- PyObject_Free(seq);
-}
-
1
0
Author: martin.v.loewis
Date: Wed Nov 30 10:41:29 2005
New Revision: 41567
Added:
python/branches/ast-objects/
- copied from r41566, python/trunk/
Log:
Branch to experiment with a PyObject* AST.
1
0
commit of r41566 - in python/branches/release24-maint: Lib Lib/test Mac/Tools/IDE Tools/msi
by fred.drake 30 Nov '05
by fred.drake 30 Nov '05
30 Nov '05
Author: fred.drake
Date: Wed Nov 30 08:36:01 2005
New Revision: 41566
Modified:
python/branches/release24-maint/Lib/pydoc.py
python/branches/release24-maint/Lib/test/test_dircache.py
python/branches/release24-maint/Lib/test/test_threadsignals.py
python/branches/release24-maint/Lib/trace.py
python/branches/release24-maint/Mac/Tools/IDE/Wsocket.py
python/branches/release24-maint/Tools/msi/uisample.py
Log:
fix recurring typo: occured --> occurred
(already fixed in Python trunk)
Modified: python/branches/release24-maint/Lib/pydoc.py
==============================================================================
--- python/branches/release24-maint/Lib/pydoc.py (original)
+++ python/branches/release24-maint/Lib/pydoc.py Wed Nov 30 08:36:01 2005
@@ -264,7 +264,7 @@
# Did the error occur before or after the module was found?
(exc, value, tb) = info = sys.exc_info()
if path in sys.modules:
- # An error occured while executing the imported module.
+ # An error occurred while executing the imported module.
raise ErrorDuringImport(sys.modules[path].__file__, info)
elif exc is SyntaxError:
# A SyntaxError occurred before we could execute the module.
Modified: python/branches/release24-maint/Lib/test/test_dircache.py
==============================================================================
--- python/branches/release24-maint/Lib/test/test_dircache.py (original)
+++ python/branches/release24-maint/Lib/test/test_dircache.py Wed Nov 30 08:36:01 2005
@@ -46,7 +46,7 @@
if sys.platform[:3] not in ('win', 'os2'):
# Sadly, dircache has the same granularity as stat.mtime, and so
- # can't notice any changes that occured within 1 sec of the last
+ # can't notice any changes that occurred within 1 sec of the last
# time it examined a directory.
time.sleep(1)
self.writeTemp("test1")
Modified: python/branches/release24-maint/Lib/test/test_threadsignals.py
==============================================================================
--- python/branches/release24-maint/Lib/test/test_threadsignals.py (original)
+++ python/branches/release24-maint/Lib/test/test_threadsignals.py Wed Nov 30 08:36:01 2005
@@ -21,7 +21,7 @@
return usr1, usr2, alrm
-# The signal handler. Just note that the signal occured and
+# The signal handler. Just note that the signal occurred and
# from who.
def handle_signals(sig,frame):
signal_blackboard[sig]['tripped'] += 1
Modified: python/branches/release24-maint/Lib/trace.py
==============================================================================
--- python/branches/release24-maint/Lib/trace.py (original)
+++ python/branches/release24-maint/Lib/trace.py Wed Nov 30 08:36:01 2005
@@ -133,7 +133,7 @@
# the ignore list
n = len(mod)
# (will not overflow since if the first n characters are the
- # same and the name has not already occured, then the size
+ # same and the name has not already occurred, then the size
# of "name" is greater than that of "mod")
if mod == modulename[:n] and modulename[n] == '.':
self._ignore[modulename] = 1
Modified: python/branches/release24-maint/Mac/Tools/IDE/Wsocket.py
==============================================================================
--- python/branches/release24-maint/Mac/Tools/IDE/Wsocket.py (original)
+++ python/branches/release24-maint/Mac/Tools/IDE/Wsocket.py Wed Nov 30 08:36:01 2005
@@ -163,7 +163,7 @@
def settotal(int total): gets called when the connection knows the data size
def setcurrent(int current): gets called when some new data has arrived
def done(): gets called when the transaction is complete
- def error(type, value, tb): gets called wheneven an error occured
+ def error(type, value, tb): gets called wheneven an error occurred
"""
def __init__(self, settotal_func, setcurrent_func, done_func, error_func):
Modified: python/branches/release24-maint/Tools/msi/uisample.py
==============================================================================
--- python/branches/release24-maint/Tools/msi/uisample.py (original)
+++ python/branches/release24-maint/Tools/msi/uisample.py Wed Nov 30 08:36:01 2005
@@ -1393,7 +1393,7 @@
(1932, u'The Windows Installer service cannot update the protected Windows file [2]. {{Package version: [3], OS Protected version: [4], SFP Error: [5]}}'),
(1933, u'The Windows Installer service cannot update one or more protected Windows files. {{SFP Error: [2]. List of protected files:\\r\\n[3]}}'),
(1934, u'User installations are disabled via policy on the machine.'),
-(1935, u'An error occured during the installation of assembly component [2]. HRESULT: [3]. {{assembly interface: [4], function: [5], assembly name: [6]}}'),
+(1935, u'An error occurred during the installation of assembly component [2]. HRESULT: [3]. {{assembly interface: [4], function: [5], assembly name: [6]}}'),
]
tables=['AdminExecuteSequence', 'AdminUISequence', 'AdvtExecuteSequence', 'BBControl', 'Billboard', 'Binary', 'CheckBox', 'Property', 'ComboBox', 'Control', 'ListBox', 'ActionText', 'ControlCondition', 'ControlEvent', 'Dialog', 'EventMapping', 'InstallExecuteSequence', 'InstallUISequence', 'ListView', 'RadioButton', 'TextStyle', 'UIText', '_Validation', 'Error']
1
0
Author: fred.drake
Date: Wed Nov 30 08:34:04 2005
New Revision: 41565
Modified:
python/branches/release24-maint/Lib/test/test_cmd_line.py
Log:
fix indentation; this could not have passed
Modified: python/branches/release24-maint/Lib/test/test_cmd_line.py
==============================================================================
--- python/branches/release24-maint/Lib/test/test_cmd_line.py (original)
+++ python/branches/release24-maint/Lib/test/test_cmd_line.py Wed Nov 30 08:34:04 2005
@@ -12,14 +12,14 @@
outfp.close()
return data
- def exit_code(self, cmd_line):
- return subprocess.call([sys.executable, cmd_line], stderr=subprocess.PIPE)
+ def exit_code(self, cmd_line):
+ return subprocess.call([sys.executable, cmd_line], stderr=subprocess.PIPE)
def test_directories(self):
if sys.platform == 'win32':
# Exit code for "python .", Error 13: permission denied = 2
expected_exit_code = 2
- else:
+ else:
# Linux has no problem with "python .", Exit code = 0
expected_exit_code = 0
self.assertEqual(self.exit_code('.'), expected_exit_code)
1
0
Author: andrew.kuchling
Date: Wed Nov 30 02:14:48 2005
New Revision: 41564
Removed:
python/trunk/Doc/howto/sorting.tex
Log:
Remove sorting HOWTO, after converting it to a wiki page at http://wiki.python.org/moin/HowTo/Sorting
Deleted: /python/trunk/Doc/howto/sorting.tex
==============================================================================
--- /python/trunk/Doc/howto/sorting.tex Wed Nov 30 02:14:48 2005
+++ (empty file)
@@ -1,266 +0,0 @@
-\documentclass{howto}
-
-\title{Sorting Mini-HOWTO}
-
-% Increment the release number whenever significant changes are made.
-% The author and/or editor can define 'significant' however they like.
-\release{0.01}
-
-\author{Andrew Dalke}
-\authoraddress{\email{dalke(a)bioreason.com}}
-
-\begin{document}
-\maketitle
-
-\begin{abstract}
-\noindent
-This document is a little tutorial
-showing a half dozen ways to sort a list with the built-in
-\method{sort()} method.
-
-This document is available from the Python HOWTO page at
-\url{http://www.python.org/doc/howto}.
-\end{abstract}
-
-\tableofcontents
-
-Python lists have a built-in \method{sort()} method. There are many
-ways to use it to sort a list and there doesn't appear to be a single,
-central place in the various manuals describing them, so I'll do so
-here.
-
-\section{Sorting basic data types}
-
-A simple ascending sort is easy; just call the \method{sort()} method of a list.
-
-\begin{verbatim}
->>> a = [5, 2, 3, 1, 4]
->>> a.sort()
->>> print a
-[1, 2, 3, 4, 5]
-\end{verbatim}
-
-Sort takes an optional function which can be called for doing the
-comparisons. The default sort routine is equivalent to
-
-\begin{verbatim}
->>> a = [5, 2, 3, 1, 4]
->>> a.sort(cmp)
->>> print a
-[1, 2, 3, 4, 5]
-\end{verbatim}
-
-where \function{cmp} is the built-in function which compares two objects, \code{x} and
-\code{y}, and returns -1, 0 or 1 depending on whether $x<y$, $x==y$, or $x>y$. During
-the course of the sort the relationships must stay the same for the
-final list to make sense.
-
-If you want, you can define your own function for the comparison. For
-integers (and numbers in general) we can do:
-
-\begin{verbatim}
->>> def numeric_compare(x, y):
->>> return x-y
->>>
->>> a = [5, 2, 3, 1, 4]
->>> a.sort(numeric_compare)
->>> print a
-[1, 2, 3, 4, 5]
-\end{verbatim}
-
-By the way, this function won't work if result of the subtraction
-is out of range, as in \code{sys.maxint - (-1)}.
-
-Or, if you don't want to define a new named function you can create an
-anonymous one using \keyword{lambda}, as in:
-
-\begin{verbatim}
->>> a = [5, 2, 3, 1, 4]
->>> a.sort(lambda x, y: x-y)
->>> print a
-[1, 2, 3, 4, 5]
-\end{verbatim}
-
-If you want the numbers sorted in reverse you can do
-
-\begin{verbatim}
->>> a = [5, 2, 3, 1, 4]
->>> def reverse_numeric(x, y):
->>> return y-x
->>>
->>> a.sort(reverse_numeric)
->>> print a
-[5, 4, 3, 2, 1]
-\end{verbatim}
-
-(a more general implementation could return \code{cmp(y,x)} or \code{-cmp(x,y)}).
-
-However, it's faster if Python doesn't have to call a function for
-every comparison, so if you want a reverse-sorted list of basic data
-types, do the forward sort first, then use the \method{reverse()} method.
-
-\begin{verbatim}
->>> a = [5, 2, 3, 1, 4]
->>> a.sort()
->>> a.reverse()
->>> print a
-[5, 4, 3, 2, 1]
-\end{verbatim}
-
-Here's a case-insensitive string comparison using a \keyword{lambda} function:
-
-\begin{verbatim}
->>> a = "This is a test string from Andrew".split()
->>> a.sort(lambda x, y: cmp(x.lower(), y.lower()))
->>> print a
-['a', 'Andrew', 'from', 'is', 'string', 'test', 'This']
-\end{verbatim}
-
-This goes through the overhead of converting a word to lower case
-every time it must be compared. At times it may be faster to compute
-these once and use those values, and the following example shows how.
-
-\begin{verbatim}
->>> words = string.split("This is a test string from Andrew.")
->>> offsets = []
->>> for i in range(len(words)):
->>> offsets.append( (string.lower(words[i]), i) )
->>>
->>> offsets.sort()
->>> new_words = []
->>> for dontcare, i in offsets:
->>> new_words.append(words[i])
->>>
->>> print new_words
-\end{verbatim}
-
-The \code{offsets} list is initialized to a tuple of the lower-case string
-and its position in the \code{words} list. It is then sorted. Python's
-sort method sorts tuples by comparing terms; given \code{x} and \code{y}, compare
-\code{x[0]} to \code{y[0]}, then \code{x[1]} to \code{y[1]}, etc. until there is a difference.
-
-The result is that the \code{offsets} list is ordered by its first
-term, and the second term can be used to figure out where the original
-data was stored. (The \code{for} loop assigns \code{dontcare} and
-\code{i} to the two fields of each term in the list, but we only need the
-index value.)
-
-Another way to implement this is to store the original data as the
-second term in the \code{offsets} list, as in:
-
-\begin{verbatim}
->>> words = string.split("This is a test string from Andrew.")
->>> offsets = []
->>> for word in words:
->>> offsets.append( (string.lower(word), word) )
->>>
->>> offsets.sort()
->>> new_words = []
->>> for word in offsets:
->>> new_words.append(word[1])
->>>
->>> print new_words
-\end{verbatim}
-
-This isn't always appropriate because the second terms in the list
-(the word, in this example) will be compared when the first terms are
-the same. If this happens many times, then there will be the unneeded
-performance hit of comparing the two objects. This can be a large
-cost if most terms are the same and the objects define their own
-\method{__cmp__} method, but there will still be some overhead to determine if
-\method{__cmp__} is defined.
-
-Still, for large lists, or for lists where the comparison information
-is expensive to calculate, the last two examples are likely to be the
-fastest way to sort a list. It will not work on weakly sorted data,
-like complex numbers, but if you don't know what that means, you
-probably don't need to worry about it.
-
-\section{Comparing classes}
-
-The comparison for two basic data types, like ints to ints or string to
-string, is built into Python and makes sense. There is a default way
-to compare class instances, but the default manner isn't usually very
-useful. You can define your own comparison with the \method{__cmp__} method,
-as in:
-
-\begin{verbatim}
->>> class Spam:
->>> def __init__(self, spam, eggs):
->>> self.spam = spam
->>> self.eggs = eggs
->>> def __cmp__(self, other):
->>> return cmp(self.spam+self.eggs, other.spam+other.eggs)
->>> def __str__(self):
->>> return str(self.spam + self.eggs)
->>>
->>> a = [Spam(1, 4), Spam(9, 3), Spam(4,6)]
->>> a.sort()
->>> for spam in a:
->>> print str(spam)
-5
-10
-12
-\end{verbatim}
-
-Sometimes you may want to sort by a specific attribute of a class. If
-appropriate you should just define the \method{__cmp__} method to compare
-those values, but you cannot do this if you want to compare between
-different attributes at different times. Instead, you'll need to go
-back to passing a comparison function to sort, as in:
-
-\begin{verbatim}
->>> a = [Spam(1, 4), Spam(9, 3), Spam(4,6)]
->>> a.sort(lambda x, y: cmp(x.eggs, y.eggs))
->>> for spam in a:
->>> print spam.eggs, str(spam)
-3 12
-4 5
-6 10
-\end{verbatim}
-
-If you want to compare two arbitrary attributes (and aren't overly
-concerned about performance) you can even define your own comparison
-function object. This uses the ability of a class instance to emulate
-an function by defining the \method{__call__} method, as in:
-
-\begin{verbatim}
->>> class CmpAttr:
->>> def __init__(self, attr):
->>> self.attr = attr
->>> def __call__(self, x, y):
->>> return cmp(getattr(x, self.attr), getattr(y, self.attr))
->>>
->>> a = [Spam(1, 4), Spam(9, 3), Spam(4,6)]
->>> a.sort(CmpAttr("spam")) # sort by the "spam" attribute
->>> for spam in a:
->>> print spam.spam, spam.eggs, str(spam)
-1 4 5
-4 6 10
-9 3 12
-
->>> a.sort(CmpAttr("eggs")) # re-sort by the "eggs" attribute
->>> for spam in a:
->>> print spam.spam, spam.eggs, str(spam)
-9 3 12
-1 4 5
-4 6 10
-\end{verbatim}
-
-Of course, if you want a faster sort you can extract the attributes
-into an intermediate list and sort that list.
-
-
-So, there you have it; about a half-dozen different ways to define how
-to sort a list:
-\begin{itemize}
- \item sort using the default method
- \item sort using a comparison function
- \item reverse sort not using a comparison function
- \item sort on an intermediate list (two forms)
- \item sort using class defined __cmp__ method
- \item sort using a sort function object
-\end{itemize}
-
-\end{document}
-% LocalWords: maxint
1
0
Author: martin.v.loewis
Date: Tue Nov 29 18:09:13 2005
New Revision: 41563
Modified:
python/trunk/PC/pyconfig.h
Log:
Silence VS2005 warnings about deprecated functions.
Modified: python/trunk/PC/pyconfig.h
==============================================================================
--- python/trunk/PC/pyconfig.h (original)
+++ python/trunk/PC/pyconfig.h Tue Nov 29 18:09:13 2005
@@ -27,6 +27,16 @@
*/
+/* Visual Studio 2005 introduces deprecation warnings for
+ "insecure" and POSIX functions. The insecure functions should
+ be replaces by *_s versions (according to Microsoft); the
+ POSIX functions by _* versions (which, according to Microsoft,
+ would be ISO C conforming). Neither renaming is feasible, so
+ we just silence the warnings. */
+
+#define _CRT_SECURE_NO_DEPRECATE 1
+#define _CRT_NONSTDC_NO_DEPRECATE 1
+
#include <io.h>
#define HAVE_SYS_UTIME_H
#define HAVE_HYPOT
1
0
Author: martin.v.loewis
Date: Tue Nov 29 18:08:24 2005
New Revision: 41562
Modified:
python/trunk/PC/winsound.c
Log:
Limit x86 machine instructions and Win95 support to _M_IX86.
Modified: python/trunk/PC/winsound.c
==============================================================================
--- python/trunk/PC/winsound.c (original)
+++ python/trunk/PC/winsound.c Tue Nov 29 18:08:24 2005
@@ -145,6 +145,7 @@
return NULL;
}
}
+#ifdef _M_IX86
else if (whichOS == Win9X) {
int speaker_state;
/* Force timer into oscillator mode via timer control port. */
@@ -169,6 +170,7 @@
/* Restore speaker control to original state. */
_outp(0x61, speaker_state);
}
+#endif /* _M_IX86 */
else {
assert(!"winsound's whichOS has insane value");
}
1
0