parsetok.h 1.27 KB
Newer Older
1

Guido van Rossum's avatar
Guido van Rossum committed
2 3
/* Parser-tokenizer link interface */

4 5 6 7 8 9
#ifndef Py_PARSETOK_H
#define Py_PARSETOK_H
#ifdef __cplusplus
extern "C" {
#endif

10
typedef struct {
11
    int error;
12
    const char *filename;
13 14 15
    int lineno;
    int offset;
    char *text;
16 17
    int token;
    int expected;
18 19
} perrdetail;

20
#if 0
21
#define PyPARSE_YIELD_IS_KEYWORD	0x0001
22
#endif
23

24 25
#define PyPARSE_DONT_IMPLY_DEDENT	0x0002

26
PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int,
27
                                              perrdetail *);
28
PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int,
29
                                             char *, char *, perrdetail *);
30

31
PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
32
                                              perrdetail *, int);
33
PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *, grammar *,
34 35 36
						 int, char *, char *,
						 perrdetail *, int);

37 38
PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *,
					      const char *,
39 40
					      grammar *, int,
                                              perrdetail *, int);
41 42 43 44

/* Note that he following function is defined in pythonrun.c not parsetok.c. */
PyAPI_FUNC(void) PyParser_SetError(perrdetail *);

45 46 47 48
#ifdef __cplusplus
}
#endif
#endif /* !Py_PARSETOK_H */