Mercurial > cpython-lru_cache-weakref
annotate Parser/parser.h @ 24042:63fbbed10714 legacy-trunk
Simplify HTTPSConnection constructor.
See discussion in SF bug 458463.
| author | Jeremy Hylton <jeremy@alum.mit.edu> |
|---|---|
| date | Fri, 28 Jun 2002 23:38:14 +0000 |
| parents | eebae4f60d05 |
| children | bbf16fd024df |
| rev | line source |
|---|---|
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
1 #ifndef Py_PARSER_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
2 #define Py_PARSER_H |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
3 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
4 extern "C" { |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
5 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
6 |
| 145 | 7 |
| 6 | 8 /* Parser interface */ |
| 9 | |
|
1079
e4c6a0dd5c2b
* bltinmodule.c: added built-in function cmp(a, b)
Guido van Rossum <guido@python.org>
parents:
790
diff
changeset
|
10 #define MAXSTACK 500 |
| 6 | 11 |
|
1848
b724599401ff
Merge back to main trunk
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
12 typedef struct { |
| 6 | 13 int s_state; /* State in current DFA */ |
| 14 dfa *s_dfa; /* Current DFA */ | |
| 86 | 15 struct _node *s_parent; /* Where to add next node */ |
| 6 | 16 } stackentry; |
| 17 | |
|
1848
b724599401ff
Merge back to main trunk
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
18 typedef struct { |
| 6 | 19 stackentry *s_top; /* Top entry */ |
| 20 stackentry s_base[MAXSTACK];/* Array of stack entries */ | |
| 21 /* NB The stack grows down */ | |
| 22 } stack; | |
| 23 | |
| 24 typedef struct { | |
|
1848
b724599401ff
Merge back to main trunk
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
25 stack p_stack; /* Stack of parser states */ |
|
b724599401ff
Merge back to main trunk
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
26 grammar *p_grammar; /* Grammar to use */ |
|
b724599401ff
Merge back to main trunk
Guido van Rossum <guido@python.org>
parents:
1329
diff
changeset
|
27 node *p_tree; /* Top of parse tree */ |
|
22468
eebae4f60d05
Disable the parser hacks that enabled the "yield" keyword using a future
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents:
18609
diff
changeset
|
28 #if 0 /* future keyword */ |
|
18609
59446d0f8341
Preliminary support for "from __future__ import generators" to enable
Guido van Rossum <guido@python.org>
parents:
14375
diff
changeset
|
29 int p_generators; /* 1 if yield is a keyword */ |
|
22468
eebae4f60d05
Disable the parser hacks that enabled the "yield" keyword using a future
Neil Schemenauer <nascheme@enme.ucalgary.ca>
parents:
18609
diff
changeset
|
30 #endif |
| 6 | 31 } parser_state; |
| 32 | |
|
13447
a89f7f268de4
Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents:
13256
diff
changeset
|
33 parser_state *PyParser_New(grammar *g, int start); |
|
a89f7f268de4
Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents:
13256
diff
changeset
|
34 void PyParser_Delete(parser_state *ps); |
|
13539
feab677269e0
Create two new exceptions: IndentationError and TabError. These are
Fred Drake <fdrake@acm.org>
parents:
13447
diff
changeset
|
35 int PyParser_AddToken(parser_state *ps, int type, char *str, int lineno, |
|
feab677269e0
Create two new exceptions: IndentationError and TabError. These are
Fred Drake <fdrake@acm.org>
parents:
13447
diff
changeset
|
36 int *expected_ret); |
|
13447
a89f7f268de4
Nuke all remaining occurrences of Py_PROTO and Py_FPROTO.
Tim Peters <tim.peters@gmail.com>
parents:
13256
diff
changeset
|
37 void PyGrammar_AddAccelerators(grammar *g); |
|
1329
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
38 |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
39 #ifdef __cplusplus |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
40 } |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
41 #endif |
|
519c25039c6a
* Added support for X11 modules.
Guido van Rossum <guido@python.org>
parents:
1257
diff
changeset
|
42 #endif /* !Py_PARSER_H */ |
