blob: b78856685e985347441d44b3e2584ffefc013132 [file] [log] [blame]
Guido van Rossumf70e43a1991-02-19 12:39:46 +00001
Guido van Rossum85a5fbb1990-10-14 12:07:46 +00002/* Parser-tokenizer link interface */
3
Fred Drake5eb6d4e2000-07-08 23:37:28 +00004#ifndef Py_PARSETOK_H
5#define Py_PARSETOK_H
6#ifdef __cplusplus
7extern "C" {
8#endif
9
Guido van Rossumb6775db1994-08-01 11:34:53 +000010typedef struct {
Fred Drake5eb6d4e2000-07-08 23:37:28 +000011 int error;
Martin v. Löwis95292d62002-12-11 14:04:59 +000012 const char *filename;
Fred Drake5eb6d4e2000-07-08 23:37:28 +000013 int lineno;
14 int offset;
15 char *text;
Fred Drake85f36392000-07-11 17:53:00 +000016 int token;
17 int expected;
Guido van Rossumb6775db1994-08-01 11:34:53 +000018} perrdetail;
19
Neil Schemenauerc24ea082002-03-22 23:53:36 +000020#if 0
Tim Petersfe2127d2001-07-16 05:37:24 +000021#define PyPARSE_YIELD_IS_KEYWORD 0x0001
Neil Schemenauerc24ea082002-03-22 23:53:36 +000022#endif
Tim Petersfe2127d2001-07-16 05:37:24 +000023
Guido van Rossum4b499dd32003-02-13 22:07:59 +000024#define PyPARSE_DONT_IMPLY_DEDENT 0x0002
25
Martin v. Löwis95292d62002-12-11 14:04:59 +000026PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int,
Fred Drake5eb6d4e2000-07-08 23:37:28 +000027 perrdetail *);
Martin v. Löwis95292d62002-12-11 14:04:59 +000028PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int,
Fred Drake5eb6d4e2000-07-08 23:37:28 +000029 char *, char *, perrdetail *);
Guido van Rossuma3309961993-07-28 09:05:47 +000030
Martin v. Löwis95292d62002-12-11 14:04:59 +000031PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int,
Tim Petersfe2127d2001-07-16 05:37:24 +000032 perrdetail *, int);
Martin v. Löwis95292d62002-12-11 14:04:59 +000033PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *, grammar *,
Tim Petersfe2127d2001-07-16 05:37:24 +000034 int, char *, char *,
35 perrdetail *, int);
36
Martin v. Löwis95292d62002-12-11 14:04:59 +000037PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *,
38 const char *,
Thomas Heller6b17abf2002-07-09 09:23:27 +000039 grammar *, int,
40 perrdetail *, int);
Guido van Rossumd3ab37f2003-04-17 14:55:42 +000041
42/* Note that he following function is defined in pythonrun.c not parsetok.c. */
43PyAPI_FUNC(void) PyParser_SetError(perrdetail *);
44
Guido van Rossuma3309961993-07-28 09:05:47 +000045#ifdef __cplusplus
46}
47#endif
48#endif /* !Py_PARSETOK_H */