[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Version 1.75-1 ignoring --no-lines flag
From: |
Akim Demaille |
Subject: |
Re: Version 1.75-1 ignoring --no-lines flag |
Date: |
06 Nov 2002 15:10:53 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Honest Recruiter) |
>>>>> "Jim" == Jim Kent <address@hidden> writes:
| Jim> I just upgraded my cygwin tools to the latest version, which uses
| Jim> bison version 1.75-1 on a Win2K PC. When I run bison 1.75-1 with
| Jim> this command: bison --no-lines parser.yy
|
| Jim> on the attached .yy file, the resulting parser.tab.cc file
| Jim> contains many #line directives. --no-lines is supposed to
| Jim> suppress the output of #line directives.
|
| Jim> Executing the same command with version 1-35.1 of bison produces
| Jim> the expected result.
|
| Thanks, this is a known issue. For my own education, could tell me
| why you'd need this option?
I'm installing the following patch. Thanks!
Index: ChangeLog
from Akim Demaille <address@hidden>
Restore --no-lines.
Reported by Jim Kent.
* data/c.m4 (b4_syncline): New.
* data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
* src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
* src/output.c (user_actions_output): Likewise.
(prepare): Define 'b4_synclines_flag'.
* src/muscle_tab.c (muscle_init): Don't define b4_linef.
Index: NEWS
===================================================================
RCS file: /cvsroot/bison/bison/NEWS,v
retrieving revision 1.68
diff -u -u -r1.68 NEWS
--- NEWS 6 Nov 2002 08:08:45 -0000 1.68
+++ NEWS 6 Nov 2002 14:09:20 -0000
@@ -6,6 +6,8 @@
* Bison now parses C99 lexical constructs like digraphs, UCNs, and
backslash-newline within C escape sequences, as POSIX now requires.
+* --no-line works properly.
+
Changes in version 1.75a, 2002-10-24:
* Bison can no longer be built by a K&R C compiler; it requires C89 or
Index: THANKS
===================================================================
RCS file: /cvsroot/bison/bison/THANKS,v
retrieving revision 1.52
diff -u -u -r1.52 THANKS
--- THANKS 24 Oct 2002 10:01:52 -0000 1.52
+++ THANKS 6 Nov 2002 14:09:20 -0000
@@ -25,6 +25,7 @@
Hans Aberg address@hidden
Jan Nieuwenhuizen address@hidden
Jesse Thilo address@hidden
+Jim Kent address@hidden
Jim Meyering address@hidden
Juan Manuel Guerrero address@hidden
Kees Zeelenberg address@hidden
Index: TODO
===================================================================
RCS file: /cvsroot/bison/bison/TODO,v
retrieving revision 1.85
diff -u -u -r1.85 TODO
--- TODO 6 Nov 2002 08:08:45 -0000 1.85
+++ TODO 6 Nov 2002 14:09:21 -0000
@@ -155,21 +155,11 @@
Show reductions. []
* Broken options ?
-** %no-lines [ok]
** %no-parser []
-** %pure-parser []
** %token-table []
-** Options which could use parse_dquoted_param ().
-Maybe transferred in lex.c.
-*** %skeleton [ok]
-*** %output []
-*** %file-prefix []
-*** %name-prefix []
-
** Skeleton strategy. []
Must we keep %no-parser?
%token-table?
-*** New skeletons. []
* src/print_graph.c
Find the best graph parameters. []
Index: data/c.m4
===================================================================
RCS file: /cvsroot/bison/bison/data/c.m4,v
retrieving revision 1.14
diff -u -u -r1.14 c.m4
--- data/c.m4 3 Nov 2002 16:41:57 -0000 1.14
+++ data/c.m4 6 Nov 2002 14:09:23 -0000
@@ -300,3 +300,15 @@
m4_define([b4_c_arg],
[$2])
+
+
+## ----------- ##
+## Synclines. ##
+## ----------- ##
+
+
+# b4_syncline(LINE, FILE)
+# -----------------------
+m4_define([b4_syncline],
+[m4_if(b4_synclines_flag, 1,
+ [[#]line $1 "$2"])])
Index: data/glr.c
===================================================================
RCS file: /cvsroot/bison/bison/data/glr.c,v
retrieving revision 1.27
diff -u -u -r1.27 glr.c
--- data/glr.c 3 Nov 2002 16:41:57 -0000 1.27
+++ data/glr.c 6 Nov 2002 14:09:24 -0000
@@ -195,10 +195,10 @@
#ifndef YYSTYPE
]m4_ifdef([b4_stype],
-[#line b4_stype_line "b4_filename"
+[b4_syncline([b4_stype_line], [b4_filename])
typedef union b4_stype yystype;
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"],
+b4_syncline([__oline__], [__ofile__])],
[typedef int yystype;])[
# define YYSTYPE yystype
# define YYSTYPE_IS_TRIVIAL 1
@@ -228,7 +228,7 @@
]b4_post_prologue[
]/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
[
#if ! defined (__cplusplus)
typedef char bool;
@@ -656,7 +656,7 @@
# undef yyclearin
# undef YYRECOVERING
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
}
@@ -1906,10 +1906,10 @@
#ifndef YYSTYPE
m4_ifdef([b4_stype],
-[#line b4_stype_line "b4_filename"
+[b4_syncline([b4_stype_line], [b4_filename])
typedef union b4_stype yystype;
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"],
+b4_syncline([__oline__], [__ofile__])],
[typedef int yystype;])
# define YYSTYPE yystype
#endif
Index: data/lalr1.cc
===================================================================
RCS file: /cvsroot/bison/bison/data/lalr1.cc,v
retrieving revision 1.12
diff -u -u -r1.12 lalr1.cc
--- data/lalr1.cc 24 Oct 2002 11:40:27 -0000 1.12
+++ data/lalr1.cc 6 Nov 2002 14:09:24 -0000
@@ -129,7 +129,7 @@
b4_pre_prologue
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
/* Enabling traces. */
#ifndef YYDEBUG
@@ -143,10 +143,10 @@
#ifndef YYSTYPE
m4_ifdef([b4_stype],
-[#line b4_stype_line "b4_filename"
+[b4_syncline([b4_stype_line], [b4_filename])
typedef union b4_stype yystype;
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"],
+b4_syncline([__oline__], [__ofile__])],
[typedef int yystype;])
# define YYSTYPE yystype
#endif
@@ -155,7 +155,7 @@
b4_post_prologue
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
#ifndef YYLLOC_DEFAULT
# define YYLLOC_DEFAULT(Current, Rhs, N) \
Current.last_line = Rhs[[N]].last_line; \
@@ -463,7 +463,7 @@
}
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
state_stack_.pop (len_);
semantic_stack_.pop (len_);
Index: data/yacc.c
===================================================================
RCS file: /cvsroot/bison/bison/data/yacc.c,v
retrieving revision 1.28
diff -u -u -r1.28 yacc.c
--- data/yacc.c 3 Nov 2002 16:41:57 -0000 1.28
+++ data/yacc.c 6 Nov 2002 14:09:25 -0000
@@ -165,9 +165,9 @@
[m4_pushdef([b4_dollar_dollar], [yyvalue.$6])dnl
m4_pushdef([b4_at_dollar], [yylocation])dnl
case $4: /* $3 */
-#line $2 "$1"
+b4_syncline([$2], [$1])
$5;
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
break;
m4_popdef([b4_at_dollar])dnl
m4_popdef([b4_dollar_dollar])dnl
@@ -229,10 +229,10 @@
#ifndef YYSTYPE
m4_ifdef([b4_stype],
-[#line b4_stype_line "b4_filename"
+[b4_syncline([b4_stype_line], [b4_filename])
typedef union b4_stype yystype;
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"],
+b4_syncline([__oline__], [__ofile__])],
[typedef int yystype;])
# define YYSTYPE yystype
# define YYSTYPE_IS_TRIVIAL 1
@@ -254,7 +254,7 @@
b4_post_prologue
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
#if ! defined (yyoverflow) || YYERROR_VERBOSE
@@ -1053,7 +1053,7 @@
}
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
[ yyvsp -= yylen;
yyssp -= yylen;
@@ -1290,10 +1290,10 @@
#ifndef YYSTYPE
m4_ifdef([b4_stype],
-[#line b4_stype_line "b4_filename"
+[b4_syncline([b4_stype_line], [b4_filename])
typedef union b4_stype yystype;
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"],
+b4_syncline([__oline__], [__ofile__])],
[typedef int yystype;])
# define YYSTYPE yystype
#endif
Index: src/muscle_tab.c
===================================================================
RCS file: /cvsroot/bison/bison/src/muscle_tab.c,v
retrieving revision 1.25
diff -u -u -r1.25 muscle_tab.c
--- src/muscle_tab.c 22 Oct 2002 04:39:05 -0000 1.25
+++ src/muscle_tab.c 6 Nov 2002 14:09:25 -0000
@@ -65,12 +65,6 @@
/* Version and input file. */
MUSCLE_INSERT_STRING ("version", VERSION);
MUSCLE_INSERT_STRING ("filename", infile);
-
- /* FIXME: there should probably be no default here, only in the
- skeletons. */
-
- /* Default #line formatting. */
- MUSCLE_INSERT_STRING ("linef", "#line %d %s\n");
}
Index: src/output.c
===================================================================
RCS file: /cvsroot/bison/bison/src/output.c,v
retrieving revision 1.205
diff -u -u -r1.205 output.c
--- src/output.c 6 Nov 2002 08:08:46 -0000 1.205
+++ src/output.c 6 Nov 2002 14:09:26 -0000
@@ -276,11 +276,10 @@
{
fprintf (out, " case %d:\n", r + 1);
- if (!no_lines_flag)
- fprintf (out, muscle_find ("linef"),
- rules[r].action_location.first_line,
- quotearg_style (c_quoting_style,
- rules[r].action_location.file));
+ fprintf (out, "]b4_syncline([[%d]], [[%s]])[\n",
+ rules[r].action_location.first_line,
+ quotearg_style (escape_quoting_style,
+ rules[r].action_location.file));
fprintf (out, " %s\n break;\n\n",
rules[r].action);
}
@@ -566,11 +565,12 @@
prepare (void)
{
/* Flags. */
- MUSCLE_INSERT_INT ("locations_flag", locations_flag);
+ MUSCLE_INSERT_INT ("debug", debug_flag);
MUSCLE_INSERT_INT ("defines_flag", defines_flag);
MUSCLE_INSERT_INT ("error_verbose", error_verbose);
+ MUSCLE_INSERT_INT ("locations_flag", locations_flag);
MUSCLE_INSERT_INT ("pure", pure_parser);
- MUSCLE_INSERT_INT ("debug", debug_flag);
+ MUSCLE_INSERT_INT ("synclines_flag", !no_lines_flag);
/* FIXME: This is wrong: the muscles should decide whether they hold
a copy or not, but the situation is too obscure currently. */
Index: src/reader.c
===================================================================
RCS file: /cvsroot/bison/bison/src/reader.c,v
retrieving revision 1.217
diff -u -u -r1.217 reader.c
--- src/reader.c 6 Nov 2002 08:08:46 -0000 1.217
+++ src/reader.c 6 Nov 2002 14:09:26 -0000
@@ -69,13 +69,9 @@
struct obstack *oout =
!typed ? &pre_prologue_obstack : &post_prologue_obstack;
- if (!no_lines_flag)
- {
- obstack_fgrow2 (oout, muscle_find ("linef"),
- location.first_line,
- quotearg_style (c_quoting_style,
- location.file));
- }
+ obstack_fgrow2 (oout, "]b4_syncline([[%d]], [[%s]])[\n",
+ location.first_line,
+ quotearg_style (escape_quoting_style, location.file));
obstack_sgrow (oout, prologue);
}
@@ -89,13 +85,9 @@
void
epilogue_set (const char *epilogue, location_t location)
{
- if (!no_lines_flag)
- {
- obstack_fgrow2 (&muscle_obstack, muscle_find ("linef"),
- location.first_line,
- quotearg_style (c_quoting_style,
- location.file));
- }
+ obstack_fgrow2 (&muscle_obstack, "]b4_syncline([[%d]], [[%s]])[\n",
+ location.first_line,
+ quotearg_style (escape_quoting_style, location.file));
obstack_sgrow (&muscle_obstack, epilogue);
obstack_1grow (&muscle_obstack, 0);
muscle_insert ("epilogue", obstack_finish (&muscle_obstack));
- Re: Version 1.75-1 ignoring --no-lines flag,
Akim Demaille <=