* data/yacc.c (YY_LOCATION_PRINT): New.

Define when we know YYLTYPE's structure, i.e., when the default
YYLLOC_DEFAULT is used.
* data/c.m4 (b4_yysymprint_generate): Use it.
* data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
value of the result.
(error_start_): Replace with...
(error_range_): this location array.
This allows to replace code relying on the implementation of
locations by portable code.
* data/yacc.c (yylerrsp): Replace with...
(yyerror_range): this.
Every time a token is popped, update yyerror_range[0], to have an
accurate location for the error token.
* data/glr.c (YY_LOCATION_PRINT): New.
(yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
deference a pointer.
* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
report the location in %printers.
* src/scan-skel.l: Instead of abort, report error messages to ease
understanding skeleton scanning failures.
This commit is contained in:
Akim Demaille
2004-09-20 09:32:55 +00:00
parent ecfe33e799
commit 3fc16193d9
7 changed files with 107 additions and 42 deletions

View File

@@ -197,7 +197,7 @@ m4_ifval([$6], [%union
%printer
{
]AT_LALR1_CC_IF([cdebug_ << $$;],
[fprintf (yyoutput, "%d@%d-%d", $$, RANGE (@$))])[;
[fprintf (yyoutput, "%d", $$)])[;
}
input line thing 'x' 'y'