mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-14 14:53:03 +00:00
* src/output.c (output_parser): Compute the `#line' lines when
there are. * src/Makefile.am (bison.simple): Be a simple copy of bison.s1. Suggested by Hans Aberg.
This commit is contained in:
@@ -1,3 +1,10 @@
|
|||||||
|
2000-12-19 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
|
* src/output.c (output_parser): Compute the `#line' lines when
|
||||||
|
there are.
|
||||||
|
* src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
|
||||||
|
Suggested by Hans Aberg.
|
||||||
|
|
||||||
2000-12-19 Akim Demaille <akim@epita.fr>
|
2000-12-19 Akim Demaille <akim@epita.fr>
|
||||||
|
|
||||||
Let the handling of the skeleton files be local to the procedures
|
Let the handling of the skeleton files be local to the procedures
|
||||||
|
|||||||
1
THANKS
1
THANKS
@@ -1,5 +1,6 @@
|
|||||||
Daniel Hagerty hag@gnu.org
|
Daniel Hagerty hag@gnu.org
|
||||||
David J. MacKenzie djm@gnu.org
|
David J. MacKenzie djm@gnu.org
|
||||||
|
Hans Aberg haberg@matematik.su.se
|
||||||
Jesse Thilo jthilo@gnu.org
|
Jesse Thilo jthilo@gnu.org
|
||||||
Jim Meyering meyering@gnu.org
|
Jim Meyering meyering@gnu.org
|
||||||
Laurent Mascherpa laurent.mascherpa@epita.fr
|
Laurent Mascherpa laurent.mascherpa@epita.fr
|
||||||
|
|||||||
@@ -4,4 +4,3 @@ ChangeLog
|
|||||||
Makefile
|
Makefile
|
||||||
Makefile.in
|
Makefile.in
|
||||||
bison
|
bison
|
||||||
bison.simple
|
|
||||||
|
|||||||
@@ -29,11 +29,7 @@ data_DATA = bison.simple bison.hairy
|
|||||||
|
|
||||||
EXTRA_DIST = bison.s1 bison.hairy build.com bison.cld vmshlp.mar
|
EXTRA_DIST = bison.s1 bison.hairy build.com bison.cld vmshlp.mar
|
||||||
|
|
||||||
bison.simple: bison.s1 Makefile
|
bison.simple: bison.s1
|
||||||
sed -e "s/@bison_version@/$(VERSION)/" $(srcdir)/bison.s1 | \
|
cp $(srcdir)/bison.s1 $@
|
||||||
awk '\
|
|
||||||
/^#line/ { printf "#line %d \"$(datadir)/bison.simple\"\n", NR+1; next }\
|
|
||||||
{ print }' >$@t
|
|
||||||
mv $@t $@
|
|
||||||
|
|
||||||
DISTCLEANFILES = bison.simple
|
DISTCLEANFILES = bison.simple
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
|
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
|
||||||
#line
|
#line
|
||||||
/* This file comes from bison-@bison_version@. */
|
|
||||||
|
|
||||||
/* Skeleton output parser for bison,
|
/* Skeleton output parser for bison,
|
||||||
Copyright 1984, 1989, 1990, 2000 Free Software Foundation, Inc.
|
Copyright 1984, 1989, 1990, 2000 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
|
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
|
||||||
#line
|
#line
|
||||||
/* This file comes from bison-@bison_version@. */
|
|
||||||
|
|
||||||
/* Skeleton output parser for bison,
|
/* Skeleton output parser for bison,
|
||||||
Copyright 1984, 1989, 1990, 2000 Free Software Foundation, Inc.
|
Copyright 1984, 1989, 1990, 2000 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
|||||||
67
src/output.c
67
src/output.c
@@ -1161,53 +1161,57 @@ static void
|
|||||||
output_parser (void)
|
output_parser (void)
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
static int number_of_dollar_signs = 0;
|
|
||||||
FILE *fskel;
|
FILE *fskel;
|
||||||
|
size_t line;
|
||||||
|
const char *skeleton = NULL;
|
||||||
|
int number_of_dollar_signs = 0;
|
||||||
|
|
||||||
if (pure_parser)
|
if (pure_parser)
|
||||||
obstack_grow_literal_string (&table_obstack, "#define YYPURE 1\n\n");
|
obstack_grow_literal_string (&table_obstack, "#define YYPURE 1\n\n");
|
||||||
|
|
||||||
/* Loop over lines in the standard parser file. */
|
/* Loop over lines in the standard parser file. */
|
||||||
if (semantic_parser)
|
if (semantic_parser)
|
||||||
fskel = xfopen (skeleton_find ("BISON_HAIRY", BISON_HAIRY), "r");
|
skeleton = skeleton_find ("BISON_HAIRY", BISON_HAIRY);
|
||||||
else
|
else
|
||||||
fskel = xfopen (skeleton_find ("BISON_SIMPLE", BISON_SIMPLE), "r");
|
skeleton = skeleton_find ("BISON_SIMPLE", BISON_SIMPLE);
|
||||||
|
fskel = xfopen (skeleton, "r");
|
||||||
|
|
||||||
|
/* Set LINE to 2, not 1: `#line LINENUM' -- Here LINENUM is a
|
||||||
|
decimal integer constant. This specifies that the line number of
|
||||||
|
the *following* line of input, in its original source file, was
|
||||||
|
LINENUM. */
|
||||||
|
line = 2;
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
int is_sync_line = 0;
|
||||||
int write_line = 1;
|
int write_line = 1;
|
||||||
|
|
||||||
c = getc (fskel);
|
c = getc (fskel);
|
||||||
|
|
||||||
/* See if the line starts with `#line.
|
/* See if the line starts with `#line'. */
|
||||||
If so, set write_line to 0. */
|
if (c == '#')
|
||||||
if (no_lines_flag)
|
if ((c = getc (fskel)) == 'l')
|
||||||
if (c == '#')
|
if ((c = getc (fskel)) == 'i')
|
||||||
{
|
if ((c = getc (fskel)) == 'n')
|
||||||
c = getc (fskel);
|
if ((c = getc (fskel)) == 'e')
|
||||||
if (c == 'l')
|
is_sync_line = 1;
|
||||||
{
|
else
|
||||||
c = getc (fskel);
|
obstack_grow_literal_string (&table_obstack, "#lin");
|
||||||
if (c == 'i')
|
|
||||||
{
|
|
||||||
c = getc (fskel);
|
|
||||||
if (c == 'n')
|
|
||||||
{
|
|
||||||
c = getc (fskel);
|
|
||||||
if (c == 'e')
|
|
||||||
write_line = 0;
|
|
||||||
else
|
|
||||||
obstack_grow_literal_string (&table_obstack, "#lin");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
obstack_grow_literal_string (&table_obstack, "#li");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
obstack_grow_literal_string (&table_obstack, "#l");
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
obstack_grow_literal_string (&table_obstack, "#");
|
obstack_grow_literal_string (&table_obstack, "#li");
|
||||||
}
|
else
|
||||||
|
obstack_grow_literal_string (&table_obstack, "#l");
|
||||||
|
else
|
||||||
|
obstack_grow_literal_string (&table_obstack, "#");
|
||||||
|
|
||||||
|
/* If was a `#line' line, either compute it, or drop it. */
|
||||||
|
if (is_sync_line && !no_lines_flag)
|
||||||
|
obstack_fgrow2 (&table_obstack, "#line %d %s\n",
|
||||||
|
line, quotearg_style (c_quoting_style, skeleton));
|
||||||
|
|
||||||
|
if (is_sync_line)
|
||||||
|
write_line = 0;
|
||||||
|
|
||||||
/* now write out the line... */
|
/* now write out the line... */
|
||||||
for (; c != '\n' && c != EOF; c = getc (fskel))
|
for (; c != '\n' && c != EOF; c = getc (fskel))
|
||||||
@@ -1234,6 +1238,7 @@ output_parser (void)
|
|||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
break;
|
break;
|
||||||
obstack_1grow (&table_obstack, c);
|
obstack_1grow (&table_obstack, c);
|
||||||
|
line++;
|
||||||
}
|
}
|
||||||
assert (number_of_dollar_signs == 1);
|
assert (number_of_dollar_signs == 1);
|
||||||
xfclose (fskel);
|
xfclose (fskel);
|
||||||
|
|||||||
Reference in New Issue
Block a user