| 1 |
#ifndef Py_PARSER_H |
| 2 |
#define Py_PARSER_H |
| 3 |
#ifdef __cplusplus |
| 4 |
extern "C" { |
| 5 |
#endif |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
#define MAXSTACK 1500 |
| 11 |
|
| 12 |
typedef struct { |
| 13 |
int s_state; |
| 14 |
dfa *s_dfa; |
| 15 |
struct _node *s_parent; |
| 16 |
} stackentry; |
| 17 |
|
| 18 |
typedef struct { |
| 19 |
stackentry *s_top; |
| 20 |
stackentry s_base[MAXSTACK]; |
| 21 |
|
| 22 |
} stack; |
| 23 |
|
| 24 |
typedef struct { |
| 25 |
stack p_stack; |
| 26 |
grammar *p_grammar; |
| 27 |
node *p_tree; |
| 28 |
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD |
| 29 |
unsigned long p_flags; |
| 30 |
#endif |
| 31 |
} parser_state; |
| 32 |
|
| 33 |
parser_state *PyParser_New(grammar *g, int start); |
| 34 |
void PyParser_Delete(parser_state *ps); |
| 35 |
int PyParser_AddToken(parser_state *ps, int type, char *str, int lineno, int col_offset, |
| 36 |
int *expected_ret); |
| 37 |
void PyGrammar_AddAccelerators(grammar *g); |
| 38 |
|
| 39 |
#ifdef __cplusplus |
| 40 |
} |
| 41 |
#endif |
| 42 |
#endif |