-/* File automatically generated by ../Parser/asdl_c.py */
+/* File automatically generated by ./Parser/asdl_c.py */
#include "asdl.h"
void free_arguments(arguments_ty);
void free_keyword(keyword_ty);
void free_alias(alias_ty);
-int marshal_write_mod(PyObject **, int *, mod_ty);
-int marshal_write_stmt(PyObject **, int *, stmt_ty);
-int marshal_write_expr(PyObject **, int *, expr_ty);
-int marshal_write_expr_context(PyObject **, int *, expr_context_ty);
-int marshal_write_slice(PyObject **, int *, slice_ty);
-int marshal_write_boolop(PyObject **, int *, boolop_ty);
-int marshal_write_operator(PyObject **, int *, operator_ty);
-int marshal_write_unaryop(PyObject **, int *, unaryop_ty);
-int marshal_write_cmpop(PyObject **, int *, cmpop_ty);
-int marshal_write_comprehension(PyObject **, int *, comprehension_ty);
-int marshal_write_excepthandler(PyObject **, int *, excepthandler_ty);
-int marshal_write_arguments(PyObject **, int *, arguments_ty);
-int marshal_write_keyword(PyObject **, int *, keyword_ty);
-int marshal_write_alias(PyObject **, int *, alias_ty);
def prototype(self, sum, name):
ctype = get_c_type(name)
- self.emit("int marshal_write_%s(PyObject **, int *, %s);"
+ self.emit("static int marshal_write_%s(PyObject **, int *, %s);"
% (name, ctype), 0)
visitProduct = visitSum = prototype
def func_begin(self, name, has_seq):
ctype = get_c_type(name)
- self.emit("int", 0)
+ self.emit("static int", 0)
self.emit("marshal_write_%s(PyObject **buf, int *off, %s o)" %
(name, ctype), 0)
self.emit("{", 0)
StructVisitor(f),
PrototypeVisitor(f),
FreePrototypeVisitor(f),
- MarshalPrototypeVisitor(f),
)
c.visit(mod)
f.close()
print >> f, '#include "Python.h"'
print >> f, '#include "%s-ast.h"' % mod.name
print >> f
- v = ChainOfVisitors(FunctionVisitor(f),
+ v = ChainOfVisitors(MarshalPrototypeVisitor(f),
+ FunctionVisitor(f),
StaticVisitor(f),
FreeVisitor(f),
MarshalFunctionVisitor(f),
#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)
{
free(o);
}
-int
+static int
marshal_write_mod(PyObject **buf, int *off, mod_ty o)
{
int i;
return 1;
}
-int
+static int
marshal_write_stmt(PyObject **buf, int *off, stmt_ty o)
{
int i;
return 1;
}
-int
+static int
marshal_write_expr(PyObject **buf, int *off, expr_ty o)
{
int i;
return 1;
}
-int
+static int
marshal_write_expr_context(PyObject **buf, int *off, expr_context_ty o)
{
switch (o) {
return 1;
}
-int
+static int
marshal_write_slice(PyObject **buf, int *off, slice_ty o)
{
int i;
return 1;
}
-int
+static int
marshal_write_boolop(PyObject **buf, int *off, boolop_ty o)
{
switch (o) {
return 1;
}
-int
+static int
marshal_write_operator(PyObject **buf, int *off, operator_ty o)
{
switch (o) {
return 1;
}
-int
+static int
marshal_write_unaryop(PyObject **buf, int *off, unaryop_ty o)
{
switch (o) {
return 1;
}
-int
+static int
marshal_write_cmpop(PyObject **buf, int *off, cmpop_ty o)
{
switch (o) {
return 1;
}
-int
+static int
marshal_write_comprehension(PyObject **buf, int *off, comprehension_ty o)
{
int i;
return 1;
}
-int
+static int
marshal_write_excepthandler(PyObject **buf, int *off, excepthandler_ty o)
{
int i;
return 1;
}
-int
+static int
marshal_write_arguments(PyObject **buf, int *off, arguments_ty o)
{
int i;
return 1;
}
-int
+static int
marshal_write_keyword(PyObject **buf, int *off, keyword_ty o)
{
marshal_write_identifier(buf, off, o->arg);
return 1;
}
-int
+static int
marshal_write_alias(PyObject **buf, int *off, alias_ty o)
{
marshal_write_identifier(buf, off, o->name);