diff --git a/usr.bin/yacc/skeleton.c b/usr.bin/yacc/skeleton.c index f3d6dd0d3630..90235cb0e937 100644 --- a/usr.bin/yacc/skeleton.c +++ b/usr.bin/yacc/skeleton.c @@ -67,10 +67,6 @@ char *banner[] = "#define yyclearin (yychar=(YYEMPTY))", "#define yyerrok (yyerrflag=0)", "#define YYRECOVERING() (yyerrflag!=0)", -#if 0 - "extern int yylex();", - "extern int yyparse();", -#endif "static int yygrowstack();", 0 }; @@ -163,12 +159,19 @@ char *body[] = "#define YYACCEPT goto yyaccept", "#define YYERROR goto yyerrlab", "", - "int", - "#if defined(__cplusplus) || __STDC__", - "yyparse(void)", + "#ifndef YYPARSE_PARAM", + "#define YYPARSE_PARAM", + "#define YYPARSE_PARAM_DECL", "#else", - "yyparse()", + "#ifndef YYPARSE_PARAM_TYPE", + "#define YYPARSE_PARAM_TYPE void *", "#endif", + "#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;", + "#endif", + "", + "int", + "yyparse (YYPARSE_PARAM)", + " YYPARSE_PARAM_DECL", "{", " register int yym, yyn, yystate;", "#if YYDEBUG",