mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-18 16:53:02 +00:00
* src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
Add support for --trace=skeleton. * src/scan-skel.l: %option debug. Scan strings of non-@ or n instead of character by character. (scan_skel): Handle trace_skeleton. (QPUTS): New. (@output_parser_name@, @output_header_name@): ``Restore'' their support (used to be M4 macros). * data/yacc.c: Quote larger chunks, a la glr.c. * data/lalr1.cc: Likewise. The header guards are no longer available, so use some other string than `YYLSP_NEEDED'.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
%option nodefault noyywrap nounput never-interactive
|
||||
%option nodefault noyywrap nounput never-interactive debug
|
||||
%option prefix="skel_" outfile="lex.yy.c"
|
||||
|
||||
%{
|
||||
@@ -30,6 +30,9 @@
|
||||
|
||||
int skel_lex (void);
|
||||
|
||||
#define QPUTS(String) \
|
||||
fputs (quotearg_style (c_quoting_style, (String)), yyout);
|
||||
|
||||
%}
|
||||
%%
|
||||
|
||||
@@ -63,11 +66,13 @@ int skel_lex (void);
|
||||
"@}" fputc (']', yyout);
|
||||
|
||||
"@oline@" fprintf (yyout, "%d", lineno);
|
||||
"@ofile@" fputs (quotearg_style (c_quoting_style, outname), yyout);
|
||||
"@ofile@" QPUTS (outname);
|
||||
"@output_parser_name@" QPUTS (parser_file_name);
|
||||
"@output_header_name@" QPUTS (spec_defines_file);
|
||||
|
||||
"@" abort ();
|
||||
\n lineno++; ECHO;
|
||||
. ECHO;
|
||||
[^@\n]+ ECHO;
|
||||
|
||||
<<EOF>> xfclose (yyout); free (outname); return EOF;
|
||||
%%
|
||||
@@ -82,8 +87,8 @@ void
|
||||
scan_skel (FILE *in)
|
||||
{
|
||||
skel_in = in;
|
||||
skel__flex_debug = trace_flag & trace_skeleton;
|
||||
skel_lex ();
|
||||
|
||||
/* Reclaim Flex's buffers. */
|
||||
yy_delete_buffer (YY_CURRENT_BUFFER);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user