Blocked revisions 71253 via svnmerge
[python/dscho.git] / Include / parsetok.h
blobaf805705db8c34d281808c5e784586f942dc8761
2 /* Parser-tokenizer link interface */
4 #ifndef Py_PARSETOK_H
5 #define Py_PARSETOK_H
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
10 typedef struct {
11 int error;
12 const char *filename;
13 int lineno;
14 int offset;
15 char *text;
16 int token;
17 int expected;
18 } perrdetail;
20 #if 0
21 #define PyPARSE_YIELD_IS_KEYWORD 0x0001
22 #endif
24 #define PyPARSE_DONT_IMPLY_DEDENT 0x0002
26 #if 0
27 #define PyPARSE_WITH_IS_KEYWORD 0x0003
28 #define PyPARSE_PRINT_IS_FUNCTION 0x0004
29 #define PyPARSE_UNICODE_LITERALS 0x0008
30 #endif
32 #define PyPARSE_IGNORE_COOKIE 0x0010
33 #define PyPARSE_BARRY_AS_BDFL 0x0020
35 PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int,
36 perrdetail *);
37 PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int,
38 char *, char *, perrdetail *);
40 PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
41 perrdetail *, int);
42 PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *,
43 const char*, grammar *,
44 int, char *, char *,
45 perrdetail *, int);
46 PyAPI_FUNC(node *) PyParser_ParseFileFlagsEx(FILE *, const char *,
47 const char*, grammar *,
48 int, char *, char *,
49 perrdetail *, int *);
51 PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *,
52 const char *,
53 grammar *, int,
54 perrdetail *, int);
55 PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilenameEx(const char *,
56 const char *,
57 grammar *, int,
58 perrdetail *, int *);
60 /* Note that he following function is defined in pythonrun.c not parsetok.c. */
61 PyAPI_FUNC(void) PyParser_SetError(perrdetail *);
63 #ifdef __cplusplus
65 #endif
66 #endif /* !Py_PARSETOK_H */