View | Details | Raw Unified | Return to bug 13562
Collapse All | Expand All

(-)src/usr.bin/yacc/output.c (-3 / +9 lines)
Lines 863-868 Link Here
863
    register int c, i;
863
    register int c, i;
864
    register char *s;
864
    register char *s;
865
865
866
    ++outline;
867
    fprintf(code_file, "#define YYERRCODE %d\n", symbol_value[1]);
868
869
    if(dflag)
870
    {
871
        fprintf(defines_file, "#ifndef YYERRCODE\n");
872
        fprintf(defines_file, "#define YYERRCODE %d\n", symbol_value[1]);
873
        fprintf(defines_file, "#endif\n\n");
874
    }
866
    for (i = 2; i < ntokens; ++i)
875
    for (i = 2; i < ntokens; ++i)
867
    {
876
    {
868
	s = symbol_name[i];
877
	s = symbol_name[i];
Lines 893-901 Link Here
893
	    if (dflag) fprintf(defines_file, " %d\n", symbol_value[i]);
902
	    if (dflag) fprintf(defines_file, " %d\n", symbol_value[i]);
894
	}
903
	}
895
    }
904
    }
896
897
    ++outline;
898
    fprintf(code_file, "#define YYERRCODE %d\n", symbol_value[1]);
899
905
900
    if (dflag && unionized)
906
    if (dflag && unionized)
901
    {
907
    {
(-)src/usr.bin/yacc/skeleton.c (-8 / +11 lines)
Lines 67-76 Link Here
67
    "#define yyclearin (yychar=(YYEMPTY))",
67
    "#define yyclearin (yychar=(YYEMPTY))",
68
    "#define yyerrok (yyerrflag=0)",
68
    "#define yyerrok (yyerrflag=0)",
69
    "#define YYRECOVERING() (yyerrflag!=0)",
69
    "#define YYRECOVERING() (yyerrflag!=0)",
70
#if 0
71
    "extern int yylex();",
72
    "extern int yyparse();",
73
#endif
74
    "static int yygrowstack();",
70
    "static int yygrowstack();",
75
    0
71
    0
76
};
72
};
Lines 163-174 Link Here
163
    "#define YYACCEPT goto yyaccept",
159
    "#define YYACCEPT goto yyaccept",
164
    "#define YYERROR goto yyerrlab",
160
    "#define YYERROR goto yyerrlab",
165
    "",
161
    "",
166
    "int",
162
    "#ifndef YYPARSE_PARAM",
167
    "#if defined(__cplusplus) || __STDC__",
163
    "#define YYPARSE_PARAM",
168
    "yyparse(void)",
164
    "#define YYPARSE_PARAM_DECL",
169
    "#else",
165
    "#else",
170
    "yyparse()",
166
    "#ifndef YYPARSE_PARAM_TYPE",
167
    "#define YYPARSE_PARAM_TYPE void *",
168
    "#endif",
169
    "#define YYPARSE_PARAM_DECL YYPARSE_PARAM_TYPE YYPARSE_PARAM;",
171
    "#endif",
170
    "#endif",
171
    "",
172
    "int",
173
    "yyparse (YYPARSE_PARAM)",
174
    "    YYPARSE_PARAM_DECL",
172
    "{",
175
    "{",
173
    "    register int yym, yyn, yystate;",
176
    "    register int yym, yyn, yystate;",
174
    "#if YYDEBUG",
177
    "#if YYDEBUG",

Return to bug 13562