summaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2013-06-26 10:36:42 +0000
committerkr.angelov <kr.angelov@gmail.com>2013-06-26 10:36:42 +0000
commitf4f76e46386e0888215eaf264e03e02a924dc7a7 (patch)
treee8e660067fa59ba9db45f1b09115a69155e33805 /src/runtime
parentd1410aba223edf235b83a70be0890b48fd07e585 (diff)
dummy compute function in the Python binding
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/python/pypgf.c14
1 files changed, 14 insertions, 0 deletions
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 */
};