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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=52567
@ -863,6 +863,15 @@ output_defines()
|
||||
register int c, i;
|
||||
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)
|
||||
{
|
||||
s = symbol_name[i];
|
||||
@ -894,9 +903,6 @@ output_defines()
|
||||
}
|
||||
}
|
||||
|
||||
++outline;
|
||||
fprintf(code_file, "#define YYERRCODE %d\n", symbol_value[1]);
|
||||
|
||||
if (dflag && unionized)
|
||||
{
|
||||
fclose(union_file);
|
||||
|
Loading…
Reference in New Issue
Block a user