From f4f76e46386e0888215eaf264e03e02a924dc7a7 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 26 Jun 2013 10:36:42 +0000 Subject: [PATCH] dummy compute function in the Python binding --- src/runtime/python/pypgf.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/runtime/python/pypgf.c b/src/runtime/python/pypgf.c index 1c7cd5edc..ea7621afc 100644 --- a/src/runtime/python/pypgf.c +++ b/src/runtime/python/pypgf.c @@ -1546,6 +1546,17 @@ PGF_generate(PGFObject* self, PyObject *args, PyObject *keywds) return pyres; } +static ExprObject* +PGF_compute(PGFObject* self, PyObject *args) +{ + ExprObject* py_expr = NULL; + if (!PyArg_ParseTuple(args, "O!", &pgf_ExprType, &py_expr)) + return NULL; + + Py_INCREF(py_expr); + return py_expr; +} + static PyGetSetDef PGF_getseters[] = { {"abstractName", (getter)PGF_getAbstractName, NULL, @@ -1581,6 +1592,9 @@ static PyMethodDef PGF_methods[] = { {"generate", (PyCFunction)PGF_generate, METH_VARARGS | METH_KEYWORDS, "Generates abstract syntax trees of given category in decreasing probability order" }, + {"compute", (PyCFunction)PGF_compute, METH_VARARGS, + "Computes the normal form of an abstract syntax tree" + }, {NULL} /* Sentinel */ };