Apparently the code to forestall Tk eating events was too aggressive (Tk user input...
[python/dscho.git] / Parser / parser.h
blobcf8d318697209a17a0aa0052c98c68ed53aeb184
1 #ifndef Py_PARSER_H
2 #define Py_PARSER_H
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
8 /* Parser interface */
10 #define MAXSTACK 500
12 typedef struct {
13 int s_state; /* State in current DFA */
14 dfa *s_dfa; /* Current DFA */
15 struct _node *s_parent; /* Where to add next node */
16 } stackentry;
18 typedef struct {
19 stackentry *s_top; /* Top entry */
20 stackentry s_base[MAXSTACK];/* Array of stack entries */
21 /* NB The stack grows down */
22 } stack;
24 typedef struct {
25 stack p_stack; /* Stack of parser states */
26 grammar *p_grammar; /* Grammar to use */
27 node *p_tree; /* Top of parse tree */
28 } parser_state;
30 parser_state *PyParser_New(grammar *g, int start);
31 void PyParser_Delete(parser_state *ps);
32 int PyParser_AddToken(parser_state *ps, int type, char *str, int lineno,
33 int *expected_ret);
34 void PyGrammar_AddAccelerators(grammar *g);
36 #ifdef __cplusplus
38 #endif
39 #endif /* !Py_PARSER_H */