Emit YYERRCODE into y.tab.h to help `lex' report scanning errors back to
Yacc. PR: 13562 Submitted by: W Gerald Hicks <wghicks@bellsouth.net>
This commit is contained in:
parent
d4e95b7b2f
commit
cbfe363a6d
@ -863,6 +863,15 @@ output_defines()
|
|||||||
register int c, i;
|
register int c, i;
|
||||||
register char *s;
|
register char *s;
|
||||||
|
|
||||||
|
++outline;
|
||||||
|
fprintf(code_file, "#define YYERRCODE %d\n", symbol_value[1]);
|
||||||
|
|
||||||
|
if(dflag)
|
||||||
|
{
|
||||||
|
fprintf(defines_file, "#ifndef YYERRCODE\n");
|
||||||
|
fprintf(defines_file, "#define YYERRCODE %d\n", symbol_value[1]);
|
||||||
|
fprintf(defines_file, "#endif\n\n");
|
||||||
|
}
|
||||||
for (i = 2; i < ntokens; ++i)
|
for (i = 2; i < ntokens; ++i)
|
||||||
{
|
{
|
||||||
s = symbol_name[i];
|
s = symbol_name[i];
|
||||||
@ -894,9 +903,6 @@ output_defines()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
++outline;
|
|
||||||
fprintf(code_file, "#define YYERRCODE %d\n", symbol_value[1]);
|
|
||||||
|
|
||||||
if (dflag && unionized)
|
if (dflag && unionized)
|
||||||
{
|
{
|
||||||
fclose(union_file);
|
fclose(union_file);
|
||||||
|
Loading…
Reference in New Issue
Block a user