* data/push.c (YYPUSH_MORE): Make it an enum instead.

(yypushparse): Use YYPUSH_MORE instead of the mystery constant.
Adjust white space and comments to match GNU style better.
This commit is contained in:
Paul Eggert
2006-09-21 17:45:21 +00:00
parent c63d3e90b3
commit 01e972b3f5
2 changed files with 66 additions and 63 deletions

View File

@@ -1,3 +1,9 @@
2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
* data/push.c (YYPUSH_MORE): Make it an enum instead.
(yypushparse): Use YYPUSH_MORE instead of the mystery constant.
Adjust white space and comments to match GNU style better.
2006-09-20 Bob Rossi <bob@brasko.net> 2006-09-20 Bob Rossi <bob@brasko.net>
* data/push.c (yyresult_get): Remove function. * data/push.c (yyresult_get): Remove function.

View File

@@ -973,7 +973,7 @@ yysyntax_error (char *yyresult, int yystate, int yychar)
]b4_push_if([ ]b4_push_if([
struct yypvars; struct yypvars;
#define YYPUSH_MORE 4 enum { YYPUSH_MORE = 4 };
]b4_c_function_decl([yychar_set], [void], [[struct yypvars *YYPVARS], [YYPVARS]], [[int yychar], [yychar]])[ ]b4_c_function_decl([yychar_set], [void], [[struct yypvars *YYPVARS], [YYPVARS]], [[int yychar], [yychar]])[
]b4_c_function_decl([yylval_set], [void], [[struct yypvars *YYPVARS], [YYPVARS]], [[YYSTYPE yylval], [yylval]])[ ]b4_c_function_decl([yylval_set], [void], [[struct yypvars *YYPVARS], [YYPVARS]], [[YYSTYPE yylval], [yylval]])[
#ifdef YYLTYPE_IS_TRIVIAL #ifdef YYLTYPE_IS_TRIVIAL
@@ -1060,13 +1060,11 @@ m4_define([b4_declare_yyparse_variables],
int yynew;]b4_locations_if([YYLTYPE yyloc;])[ int yynew;]b4_locations_if([YYLTYPE yyloc;])[
}; };
/* Init the parser data structure. Use malloc, should perhaps use a /* Initialize the parser data structure. */
system dependent equivalent function. */
void * void *
yypvarsinit (void) yypvarsinit (void)
{ {
struct yypvars *pv; struct yypvars *pv = (struct yypvars *) malloc (sizeof *pv);
pv= (struct yypvars *) malloc(sizeof(struct yypvars));
pv->yystate = 0; pv->yystate = 0;
pv->yyresult = -1; pv->yyresult = -1;
pv->yyerrstatus = 0; pv->yyerrstatus = 0;
@@ -1098,7 +1096,6 @@ yypvarsinit (void)
pv->yynew = 1; pv->yynew = 1;
]b4_locations_if([ pv->yylsp = pv->yyls;])[ ]b4_locations_if([ pv->yylsp = pv->yyls;])[
/* Init parser variables */
return (void *) pv; return (void *) pv;
} }
@@ -1383,7 +1380,7 @@ yybackup:
{ {
]b4_push_if([ ]b4_push_if([
YYDPRINTF ((stderr, "Return for a new token:\n")); YYDPRINTF ((stderr, "Return for a new token:\n"));
yyresult= 4; yyresult = YYPUSH_MORE;
/* Initialize the locals to the current context. */ /* Initialize the locals to the current context. */
pv->yychar = yychar; pv->yychar = yychar;
pv->yylval = yylval; pv->yylval = yylval;
@@ -1781,7 +1778,7 @@ typedef struct YYLTYPE
#endif #endif
]b4_push_if([struct ]b4_prefix[pvars; ]b4_push_if([struct ]b4_prefix[pvars;
#define YYPUSH_MORE 4])[ enum { YYPUSH_MORE = 4 };])[
]b4_pure_if([], ]b4_pure_if([],
[extern YYLTYPE b4_prefix[]lloc;]) [extern YYLTYPE b4_prefix[]lloc;])
)dnl b4_locations_if )dnl b4_locations_if