mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 20:33:03 +00:00
* 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:
@@ -1,6 +1,6 @@
|
||||
/* Scan Bison Skeletons. -*- C -*-
|
||||
|
||||
Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of Bison, the GNU Compiler Compiler.
|
||||
|
||||
@@ -55,7 +55,7 @@ int skel_lex (void);
|
||||
else if (strcmp (filename, "@output_parser_name@") == 0)
|
||||
filename = parser_file_name;
|
||||
else
|
||||
abort ();
|
||||
fatal ("invalid token in skeleton: %s", yytext);
|
||||
}
|
||||
|
||||
XFREE (outname);
|
||||
@@ -74,7 +74,8 @@ int skel_lex (void);
|
||||
"@output_parser_name@" QPUTS (parser_file_name);
|
||||
"@output_header_name@" QPUTS (spec_defines_file);
|
||||
|
||||
"@" abort ();
|
||||
/* This pattern must not match more than the previous @ patterns. */
|
||||
@[^{}@\n]* fatal ("invalid @ in skeleton: %s", yytext);
|
||||
\n lineno++; ECHO;
|
||||
[^@\n]+ ECHO;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user