For push mode, add pull wrappers around yypush_parse.

* data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
(yypull_parse): New function wrapping yypush_parse.
(yyparse): New #define wrapping yypull_parse.
* tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
is declared.
* tests/headers.at (export YYLTYPE): Make yylex global.  For push mode,
prototype yylex in the module that calls yyparse, and don't prototype
yyparse there.  Otherwise, the yyparse expansion won't compile.
* tests/input.at (Torturing the Scanner): Likewise.
This commit is contained in:
Joel E. Denny
2006-12-25 18:21:52 +00:00
parent 94ebeba53f
commit c3d503425f
5 changed files with 88 additions and 14 deletions

View File

@@ -94,7 +94,9 @@ AT_DATA_GRAMMAR([input.y],
#include <stdio.h>
#include <stdlib.h>
static int
int my_lex (void);
int
my_lex (void)
{
return EOF;
@@ -118,7 +120,11 @@ AT_DATA([caller.c],
[[#include "input.h"
YYLTYPE *my_llocp = &my_lloc;
#ifndef YYPUSH_DECLS
int my_parse (void);
#else
int my_lex (void);
#endif
int
main (void)