]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/python/Include/parsetok.h
/sys/lib/dist/mkfile: test for .git directory
[plan9front.git] / sys / src / cmd / python / Include / parsetok.h
1
2 /* Parser-tokenizer link interface */
3
4 #ifndef Py_PARSETOK_H
5 #define Py_PARSETOK_H
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9
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;
19
20 #if 0
21 #define PyPARSE_YIELD_IS_KEYWORD        0x0001
22 #endif
23
24 #define PyPARSE_DONT_IMPLY_DEDENT       0x0002
25
26 #define PyPARSE_WITH_IS_KEYWORD         0x0003
27
28 PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int,
29                                               perrdetail *);
30 PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int,
31                                              char *, char *, perrdetail *);
32
33 PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
34                                               perrdetail *, int);
35 PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *, grammar *,
36                                                  int, char *, char *,
37                                                  perrdetail *, int);
38
39 PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *,
40                                               const char *,
41                                               grammar *, int,
42                                               perrdetail *, int);
43
44 /* Note that he following function is defined in pythonrun.c not parsetok.c. */
45 PyAPI_FUNC(void) PyParser_SetError(perrdetail *);
46
47 #ifdef __cplusplus
48 }
49 #endif
50 #endif /* !Py_PARSETOK_H */