forked from GitHub/gf-core
dummy compute function in the Python binding
This commit is contained in:
@@ -1546,6 +1546,17 @@ PGF_generate(PGFObject* self, PyObject *args, PyObject *keywds)
|
|||||||
return pyres;
|
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[] = {
|
static PyGetSetDef PGF_getseters[] = {
|
||||||
{"abstractName",
|
{"abstractName",
|
||||||
(getter)PGF_getAbstractName, NULL,
|
(getter)PGF_getAbstractName, NULL,
|
||||||
@@ -1581,6 +1592,9 @@ static PyMethodDef PGF_methods[] = {
|
|||||||
{"generate", (PyCFunction)PGF_generate, METH_VARARGS | METH_KEYWORDS,
|
{"generate", (PyCFunction)PGF_generate, METH_VARARGS | METH_KEYWORDS,
|
||||||
"Generates abstract syntax trees of given category in decreasing probability order"
|
"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 */
|
{NULL} /* Sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user