mirror of
https://github.com/python/cpython.git
synced 2024-11-26 11:24:40 +08:00
90c3d9b995
svn+ssh://pythondev@svn.python.org/python/trunk ........ r60965 | eric.smith | 2008-02-22 18:43:17 +0100 (Fri, 22 Feb 2008) | 1 line Tests for bin() builtin. These need to get merged into py3k, which has no tests for bin. ........ r60968 | raymond.hettinger | 2008-02-22 20:50:06 +0100 (Fri, 22 Feb 2008) | 1 line Document itertools.product(). ........ r60969 | raymond.hettinger | 2008-02-23 03:20:41 +0100 (Sat, 23 Feb 2008) | 9 lines Improve the implementation of itertools.product() * Fix-up issues pointed-out by Neal Norwitz. * Add extensive comments. * The lz->result variable is now a tuple instead of a list. * Use fast macro getitem/setitem calls so most code is in-line. * Re-use the result tuple if available (modify in-place instead of copy). ........ r60972 | raymond.hettinger | 2008-02-23 05:03:50 +0100 (Sat, 23 Feb 2008) | 1 line Add more comments ........ r60973 | raymond.hettinger | 2008-02-23 11:04:15 +0100 (Sat, 23 Feb 2008) | 1 line Add recipe using itertools.product(). ........ r60974 | facundo.batista | 2008-02-23 13:01:13 +0100 (Sat, 23 Feb 2008) | 6 lines Issue 1881. Increased the stack limit from 500 to 1500. Also added a test for this (and because of this test you'll see in stderr a message that parser.c sends before raising MemoryError). Thanks Ralf Schmitt. ........ r60975 | facundo.batista | 2008-02-23 13:27:17 +0100 (Sat, 23 Feb 2008) | 4 lines Issue 1776581. Minor corrections to smtplib, and two small tests. Thanks Alan McIntyre. ........ r60976 | facundo.batista | 2008-02-23 13:46:10 +0100 (Sat, 23 Feb 2008) | 5 lines Issue 1781. Now ConfigParser.add_section does not let you add a DEFAULT section any more, because it duplicated sections with the rest of the machinery. Thanks Tim Lesher and Manuel Kaufmann. ........
43 lines
1.0 KiB
C
43 lines
1.0 KiB
C
#ifndef Py_PARSER_H
|
|
#define Py_PARSER_H
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
|
|
/* Parser interface */
|
|
|
|
#define MAXSTACK 1500
|
|
|
|
typedef struct {
|
|
int s_state; /* State in current DFA */
|
|
dfa *s_dfa; /* Current DFA */
|
|
struct _node *s_parent; /* Where to add next node */
|
|
} stackentry;
|
|
|
|
typedef struct {
|
|
stackentry *s_top; /* Top entry */
|
|
stackentry s_base[MAXSTACK];/* Array of stack entries */
|
|
/* NB The stack grows down */
|
|
} stack;
|
|
|
|
typedef struct {
|
|
stack p_stack; /* Stack of parser states */
|
|
grammar *p_grammar; /* Grammar to use */
|
|
node *p_tree; /* Top of parse tree */
|
|
#ifdef PY_PARSER_REQUIRES_FUTURE_KEYWORD
|
|
unsigned long p_flags; /* see co_flags in Include/code.h */
|
|
#endif
|
|
} parser_state;
|
|
|
|
parser_state *PyParser_New(grammar *g, int start);
|
|
void PyParser_Delete(parser_state *ps);
|
|
int PyParser_AddToken(parser_state *ps, int type, char *str, int lineno, int col_offset,
|
|
int *expected_ret);
|
|
void PyGrammar_AddAccelerators(grammar *g);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif /* !Py_PARSER_H */
|