jpayne@69: /* Parser-tokenizer link interface */ jpayne@69: jpayne@69: #ifndef Py_LIMITED_API jpayne@69: #ifndef Py_PARSETOK_H jpayne@69: #define Py_PARSETOK_H jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: #include "grammar.h" /* grammar */ jpayne@69: #include "node.h" /* node */ jpayne@69: jpayne@69: typedef struct { jpayne@69: int error; jpayne@69: PyObject *filename; jpayne@69: int lineno; jpayne@69: int offset; jpayne@69: char *text; /* UTF-8-encoded string */ jpayne@69: int token; jpayne@69: int expected; jpayne@69: } perrdetail; jpayne@69: jpayne@69: #if 0 jpayne@69: #define PyPARSE_YIELD_IS_KEYWORD 0x0001 jpayne@69: #endif jpayne@69: jpayne@69: #define PyPARSE_DONT_IMPLY_DEDENT 0x0002 jpayne@69: jpayne@69: #if 0 jpayne@69: #define PyPARSE_WITH_IS_KEYWORD 0x0003 jpayne@69: #define PyPARSE_PRINT_IS_FUNCTION 0x0004 jpayne@69: #define PyPARSE_UNICODE_LITERALS 0x0008 jpayne@69: #endif jpayne@69: jpayne@69: #define PyPARSE_IGNORE_COOKIE 0x0010 jpayne@69: #define PyPARSE_BARRY_AS_BDFL 0x0020 jpayne@69: #define PyPARSE_TYPE_COMMENTS 0x0040 jpayne@69: #define PyPARSE_ASYNC_HACKS 0x0080 jpayne@69: jpayne@69: PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int, jpayne@69: perrdetail *); jpayne@69: PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int, jpayne@69: const char *, const char *, jpayne@69: perrdetail *); jpayne@69: jpayne@69: PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int, jpayne@69: perrdetail *, int); jpayne@69: PyAPI_FUNC(node *) PyParser_ParseFileFlags( jpayne@69: FILE *fp, jpayne@69: const char *filename, /* decoded from the filesystem encoding */ jpayne@69: const char *enc, jpayne@69: grammar *g, jpayne@69: int start, jpayne@69: const char *ps1, jpayne@69: const char *ps2, jpayne@69: perrdetail *err_ret, jpayne@69: int flags); jpayne@69: PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx( jpayne@69: FILE *fp, jpayne@69: const char *filename, /* decoded from the filesystem encoding */ jpayne@69: const char *enc, jpayne@69: grammar *g, jpayne@69: int start, jpayne@69: const char *ps1, jpayne@69: const char *ps2, jpayne@69: perrdetail *err_ret, jpayne@69: int *flags); jpayne@69: PyAPI_FUNC(node *) PyParser_ParseFileObject( jpayne@69: FILE *fp, jpayne@69: PyObject *filename, jpayne@69: const char *enc, jpayne@69: grammar *g, jpayne@69: int start, jpayne@69: const char *ps1, jpayne@69: const char *ps2, jpayne@69: perrdetail *err_ret, jpayne@69: int *flags); jpayne@69: jpayne@69: PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename( jpayne@69: const char *s, jpayne@69: const char *filename, /* decoded from the filesystem encoding */ jpayne@69: grammar *g, jpayne@69: int start, jpayne@69: perrdetail *err_ret, jpayne@69: int flags); jpayne@69: PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx( jpayne@69: const char *s, jpayne@69: const char *filename, /* decoded from the filesystem encoding */ jpayne@69: grammar *g, jpayne@69: int start, jpayne@69: perrdetail *err_ret, jpayne@69: int *flags); jpayne@69: PyAPI_FUNC(node *) PyParser_ParseStringObject( jpayne@69: const char *s, jpayne@69: PyObject *filename, jpayne@69: grammar *g, jpayne@69: int start, jpayne@69: perrdetail *err_ret, jpayne@69: int *flags); jpayne@69: jpayne@69: /* Note that the following functions are defined in pythonrun.c, jpayne@69: not in parsetok.c */ jpayne@69: PyAPI_FUNC(void) PyParser_SetError(perrdetail *); jpayne@69: PyAPI_FUNC(void) PyParser_ClearError(perrdetail *); jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: #endif /* !Py_PARSETOK_H */ jpayne@69: #endif /* !Py_LIMITED_API */