1ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
2ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh/* Parser-tokenizer link interface */
3ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
4ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#ifndef Py_PARSETOK_H
5ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#define Py_PARSETOK_H
6ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#ifdef __cplusplus
7ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsiehextern "C" {
8ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#endif
9ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
10ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsiehtypedef struct {
11ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh    int error;
12ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh    const char *filename;
13ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh    int lineno;
14ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh    int offset;
15ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh    char *text;
16ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh    int token;
17ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh    int expected;
18ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh} perrdetail;
19ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
20ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#if 0
21ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#define PyPARSE_YIELD_IS_KEYWORD	0x0001
22ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#endif
23ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
24ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#define PyPARSE_DONT_IMPLY_DEDENT	0x0002
25ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
26ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#if 0
27ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#define PyPARSE_WITH_IS_KEYWORD		0x0003
28ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#endif
29ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
30ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#define PyPARSE_PRINT_IS_FUNCTION       0x0004
31ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#define PyPARSE_UNICODE_LITERALS        0x0008
32ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
33ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
34ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
35ffab958fd8d42ed7227d83007350e61555a1fa36Andrew HsiehPyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int,
36ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh                                              perrdetail *);
37ffab958fd8d42ed7227d83007350e61555a1fa36Andrew HsiehPyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int,
38ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh                                             char *, char *, perrdetail *);
39ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
40ffab958fd8d42ed7227d83007350e61555a1fa36Andrew HsiehPyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
41ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh                                              perrdetail *, int);
42ffab958fd8d42ed7227d83007350e61555a1fa36Andrew HsiehPyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *, grammar *,
43ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh						 int, char *, char *,
44ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh						 perrdetail *, int);
45ffab958fd8d42ed7227d83007350e61555a1fa36Andrew HsiehPyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(FILE *, const char *, grammar *,
46ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh						 int, char *, char *,
47ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh						 perrdetail *, int *);
48ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
49ffab958fd8d42ed7227d83007350e61555a1fa36Andrew HsiehPyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *,
50ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh					      const char *,
51ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh					      grammar *, int,
52ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh                                              perrdetail *, int);
53ffab958fd8d42ed7227d83007350e61555a1fa36Andrew HsiehPyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(const char *,
54ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh					      const char *,
55ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh					      grammar *, int,
56ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh                                              perrdetail *, int *);
57ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
58ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh/* Note that he following function is defined in pythonrun.c not parsetok.c. */
59ffab958fd8d42ed7227d83007350e61555a1fa36Andrew HsiehPyAPI_FUNC(void) PyParser_SetError(perrdetail *);
60ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh
61ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#ifdef __cplusplus
62ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh}
63ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#endif
64ffab958fd8d42ed7227d83007350e61555a1fa36Andrew Hsieh#endif /* !Py_PARSETOK_H */
65