Merge back to main trunk

This commit is contained in:
Guido van Rossum 1994-08-30 08:27:36 +00:00
parent 013142a95f
commit 1d5735e846
37 changed files with 681 additions and 831 deletions

View file

@ -5,7 +5,7 @@ extern "C" {
#endif
/***********************************************************
Copyright 1991, 1992, 1993 by Stichting Mathematisch Centrum,
Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum,
Amsterdam, The Netherlands.
All Rights Reserved
@ -32,25 +32,25 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#define MAXSTACK 500
typedef struct _stackentry {
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 _stack {
typedef struct {
stackentry *s_top; /* Top entry */
stackentry s_base[MAXSTACK];/* Array of stack entries */
/* NB The stack grows down */
} stack;
typedef struct {
struct _stack p_stack; /* Stack of parser states */
struct _grammar *p_grammar; /* Grammar to use */
struct _node *p_tree; /* Top of parse tree */
stack p_stack; /* Stack of parser states */
grammar *p_grammar; /* Grammar to use */
node *p_tree; /* Top of parse tree */
} parser_state;
parser_state *newparser PROTO((struct _grammar *g, int start));
parser_state *newparser PROTO((grammar *g, int start));
void delparser PROTO((parser_state *ps));
int addtoken PROTO((parser_state *ps, int type, char *str, int lineno));
void addaccelerators PROTO((grammar *g));