Implement lexing, almost. Currently, throws NoMemory exception on error.
This commit is contained in:
@@ -4,13 +4,15 @@
|
||||
#include "Python.h"
|
||||
|
||||
static PyObject* pyliblex_init(PyObject* self, PyObject* args);
|
||||
static PyObject* pyliblex_add_definitions(PyObject* self, PyObject* args);
|
||||
static PyObject* pyliblex_add_definition(PyObject* self, PyObject* args);
|
||||
static PyObject* pyliblex_lex(PyObject* self, PyObject* args);
|
||||
static PyObject* pyliblex_test(PyObject* self, PyObject* args);
|
||||
|
||||
static const char module_docstring[] = "A wrapper around a homemade lexing library, liblex.";
|
||||
static PyMethodDef module_methods[] = {
|
||||
{"init", pyliblex_init, METH_VARARGS, "Initialize a liblex library object." },
|
||||
{"add_definition", pyliblex_add_definition, METH_VARARGS, "Add a regular expression definition." },
|
||||
{"lex", pyliblex_lex, METH_VARARGS, "Lex a string, converting it to tokens." },
|
||||
{"test", pyliblex_test, METH_VARARGS, "Tests whether the library is working." },
|
||||
{ NULL, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user