Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 1 | |
Guido van Rossum | 85a5fbb | 1990-10-14 12:07:46 +0000 | [diff] [blame] | 2 | /* Parser-tokenizer link interface */ |
| 3 | |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 4 | #ifndef Py_PARSETOK_H |
| 5 | #define Py_PARSETOK_H |
| 6 | #ifdef __cplusplus |
| 7 | extern "C" { |
| 8 | #endif |
| 9 | |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 10 | typedef struct { |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 11 | int error; |
Martin v. Löwis | 95292d6 | 2002-12-11 14:04:59 +0000 | [diff] [blame] | 12 | const char *filename; |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 13 | int lineno; |
| 14 | int offset; |
| 15 | char *text; |
Fred Drake | 85f3639 | 2000-07-11 17:53:00 +0000 | [diff] [blame] | 16 | int token; |
| 17 | int expected; |
Guido van Rossum | b6775db | 1994-08-01 11:34:53 +0000 | [diff] [blame] | 18 | } perrdetail; |
| 19 | |
Neil Schemenauer | c24ea08 | 2002-03-22 23:53:36 +0000 | [diff] [blame] | 20 | #if 0 |
Tim Peters | fe2127d | 2001-07-16 05:37:24 +0000 | [diff] [blame] | 21 | #define PyPARSE_YIELD_IS_KEYWORD 0x0001 |
Neil Schemenauer | c24ea08 | 2002-03-22 23:53:36 +0000 | [diff] [blame] | 22 | #endif |
Tim Peters | fe2127d | 2001-07-16 05:37:24 +0000 | [diff] [blame] | 23 | |
Guido van Rossum | 4b499dd3 | 2003-02-13 22:07:59 +0000 | [diff] [blame^] | 24 | #define PyPARSE_DONT_IMPLY_DEDENT 0x0002 |
| 25 | |
Martin v. Löwis | 95292d6 | 2002-12-11 14:04:59 +0000 | [diff] [blame] | 26 | PyAPI_FUNC(node *) PyParser_ParseString(const char *, grammar *, int, |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 27 | perrdetail *); |
Martin v. Löwis | 95292d6 | 2002-12-11 14:04:59 +0000 | [diff] [blame] | 28 | PyAPI_FUNC(node *) PyParser_ParseFile (FILE *, const char *, grammar *, int, |
Fred Drake | 5eb6d4e | 2000-07-08 23:37:28 +0000 | [diff] [blame] | 29 | char *, char *, perrdetail *); |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 30 | |
Martin v. Löwis | 95292d6 | 2002-12-11 14:04:59 +0000 | [diff] [blame] | 31 | PyAPI_FUNC(node *) PyParser_ParseStringFlags(const char *, grammar *, int, |
Tim Peters | fe2127d | 2001-07-16 05:37:24 +0000 | [diff] [blame] | 32 | perrdetail *, int); |
Martin v. Löwis | 95292d6 | 2002-12-11 14:04:59 +0000 | [diff] [blame] | 33 | PyAPI_FUNC(node *) PyParser_ParseFileFlags(FILE *, const char *, grammar *, |
Tim Peters | fe2127d | 2001-07-16 05:37:24 +0000 | [diff] [blame] | 34 | int, char *, char *, |
| 35 | perrdetail *, int); |
| 36 | |
Martin v. Löwis | 95292d6 | 2002-12-11 14:04:59 +0000 | [diff] [blame] | 37 | PyAPI_FUNC(node *) PyParser_ParseStringFlagsFilename(const char *, |
| 38 | const char *, |
Thomas Heller | 6b17abf | 2002-07-09 09:23:27 +0000 | [diff] [blame] | 39 | grammar *, int, |
| 40 | perrdetail *, int); |
Guido van Rossum | a330996 | 1993-07-28 09:05:47 +0000 | [diff] [blame] | 41 | #ifdef __cplusplus |
| 42 | } |
| 43 | #endif |
| 44 | #endif /* !Py_PARSETOK_H */ |