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'.
+2002-11-06 Akim Demaille <akim@epita.fr>
+
+ 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'.
+
2002-11-06 Akim Demaille <akim@epita.fr>
* src/main.c (main): Free `infile'.
* 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
Hans Aberg haberg@matematik.su.se
Jan Nieuwenhuizen janneke@gnu.org
Jesse Thilo jthilo@gnu.org
+Jim Kent jkent@arch.sel.sony.com
Jim Meyering jim@meyering.net
Juan Manuel Guerrero ST001906@HRZ1.HRZ.TU-Darmstadt.De
Kees Zeelenberg kzlg@users.sourceforge.net
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. []
m4_define([b4_c_arg],
[$2])
+
+
+## ----------- ##
+## Synclines. ##
+## ----------- ##
+
+
+# b4_syncline(LINE, FILE)
+# -----------------------
+m4_define([b4_syncline],
+[m4_if(b4_synclines_flag, 1,
+ [[#]line $1 "$2"])])
#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
]b4_post_prologue[
]/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
[
#if ! defined (__cplusplus)
typedef char bool;
# undef yyclearin
# undef YYRECOVERING
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
}
\f
#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
b4_pre_prologue
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
/* Enabling traces. */
#ifndef YYDEBUG
#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
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; \
}
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
state_stack_.pop (len_);
semantic_stack_.pop (len_);
[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
#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
b4_post_prologue
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
#if ! defined (yyoverflow) || YYERROR_VERBOSE
}
/* Line __line__ of __file__. */
-#line __oline__ "__ofile__"
+b4_syncline([__oline__], [__ofile__])
\f
[ yyvsp -= yylen;
yyssp -= yylen;
#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
/* 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");
}
{
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);
}
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. */
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);
}
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));