diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2006-12-18 00:24:01 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2006-12-18 00:24:01 +0000 |
commit | 5912531faf421dc0ccf67f600667fb8051dc62a5 (patch) | |
tree | 054a27cdab6840aafc8b7e3aea4b1e59a4e7cc7e /parser.h | |
parent | 1654d59374622f7e3936c1480c6dd5a043f5d77b (diff) | |
download | perl-5912531faf421dc0ccf67f600667fb8051dc62a5.tar.gz |
move parser state into new parser object, PL_parser
p4raw-id: //depot/perl@29570
Diffstat (limited to 'parser.h')
-rw-r--r-- | parser.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/parser.h b/parser.h new file mode 100644 index 0000000000..51bcf88ccf --- /dev/null +++ b/parser.h @@ -0,0 +1,34 @@ +/* parser.h + * + * Copyright (c) 2006 Larry Wall and others + * + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. + * + * This file defines the layout of the parser object used by the parser + * and lexer (perly.c, toke,c). + */ + +typedef struct { + YYSTYPE val; /* semantic value */ + short state; + AV *comppad; /* value of PL_comppad when this value was created */ +#ifdef DEBUGGING + const char *name; /* token/rule name for -Dpv */ +#endif +} yy_stack_frame; + +typedef struct { + int yychar; /* The lookahead symbol. */ + YYSTYPE yylval; /* value of lookahead symbol, set by yylex() */ + + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + int stack_size; + int yylen; /* length of active reduction */ + yy_stack_frame *ps; /* current stack frame */ + yy_stack_frame stack[1]; /* will actually be as many as needed */ +} yy_parser; + + |