Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maint'
Browse files Browse the repository at this point in the history
* origin/maint: (46 commits)
  doc: minor style change
  maint: use gendocs's new -I option
  regen
  yacc.c: do not define location support when not using locations
  maint: be compilable with GCC 4.0
  tests: address a warning from GCC 4.4
  tests: don't use options that Clang does not support
  tests: restore the tests on -Werror
  regen
  parse-gram: update the Bison interface
  fix comment
  maint: post-release administrivia
  version 2.6.4
  regen
  2.6.4: botched 2.6.3
  maint: post-release administrivia
  version 2.6.3
  gnulib: update
  tests: check %no-lines
  NEWS: warnings with clang
  ...

Conflicts:
	NEWS
	TODO
	data/c.m4
	data/java.m4
	doc/Makefile.am
	src/getargs.c
	src/getargs.h
	src/output.c
	src/parse-gram.c
	src/parse-gram.h
	src/parse-gram.y
	src/reader.h
  • Loading branch information
akimd committed Oct 26, 2012
2 parents 6b1cbda + 71cb558 commit d0a3043
Show file tree
Hide file tree
Showing 26 changed files with 794 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .prev-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.6.2
2.6.4
97 changes: 56 additions & 41 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,61 @@ GNU Bison NEWS

* Noteworthy changes in release ?.? (????-??-??) [?]

** Changes in the format of error messages

This used to be the format of many error reports:

foo.y:5.10-24: result type clash on merge function 'merge': <t3> != <t2>
foo.y:4.13-27: previous declaration

It is now:

foo.y:5.10-25: result type clash on merge function 'merge': <t3> != <t2>
foo.y:4.13-27: previous declaration

** Exception safety (lalr1.cc)

The parse function now catches exceptions, uses the %destructors to
release memory (the lookahead symbol and the symbols pushed on the stack)
before re-throwing the exception.

This feature is somewhat experimental. User feedback would be
appreciated.

** New %define variable: api.location.type (glr.cc, lalr1.cc, lalr1.java)

The %define variable api.location.type defines the name of the type to use
for locations. When defined, Bison no longer generates the position.hh
and location.hh files, nor does the parser will include them: the user is
then responsible to define her type.

This can be used in programs with several parsers to factor their location
and position files: let one of them generate them, and the others just use
them.

This feature was actually introduced, but not documented, in Bison 2.5,
under the name "location_type" (which is maintained for backward
compatibility).

For consistency, lalr1.java's %define variables location_type and
position_type are deprecated in favor of api.location.type and
api.position.type.

** Graphviz improvements

The graphical presentation of the states is more readable: their shape is
now rectangular, the state number is clearly displayed, and the items are
numbered and left-justified.

The reductions are now explicitly represented as transitions to other
diamond shaped nodes.

* Noteworthy changes in release 2.6.4 (2012-10-23) [stable]

Bison 2.6.3's --version was incorrect. This release fixes this issue.

* Noteworthy changes in release 2.6.3 (2012-10-22) [stable]

** Bug fixes

Bugs and portability issues in the test suite have been fixed.
Expand All @@ -256,18 +311,6 @@ GNU Bison NEWS

All the generated headers are self-contained.

** Changes in the format of error messages

This used to be the format of many error reports:

foo.y:5.10-24: result type clash on merge function 'merge': <t3> != <t2>
foo.y:4.13-27: previous declaration

It is now:

foo.y:5.10-25: result type clash on merge function 'merge': <t3> != <t2>
foo.y:4.13-27: previous declaration

** Header guards (yacc.c, glr.c, glr.cc)

In order to avoid collisions, the header guards are now
Expand All @@ -279,15 +322,6 @@ GNU Bison NEWS

will use YY_CALC_LIB_PARSE_H_INCLUDED as guard.

** Exception safety (lalr1.cc)

The parse function now catches exceptions, uses the %destructors to
release memory (the lookahead symbol and the symbols pushed on the stack)
before re-throwing the exception.

This feature is somewhat experimental. User feedback would be
appreciated.

** Fix compiler warnings in the generated parser (yacc.c, glr.c)

The compilation of pure parsers (%define api.pure) can trigger GCC
Expand All @@ -305,25 +339,6 @@ GNU Bison NEWS
"function declared 'noreturn' should not return") have also been
addressed.

** New %define variable: api.location.type (glr.cc, lalr1.cc, lalr1.java)

The %define variable api.location.type defines the name of the type to use
for locations. When defined, Bison no longer generates the position.hh
and location.hh files, nor does the parser will include them: the user is
then responsible to define her type.

This can be used in programs with several parsers to factor their location
and position files: let one of them generate them, and the others just use
them.

This feature was actually introduced, but not documented, in Bison 2.5,
under the name "location_type" (which is maintained for backward
compatibility).

For consistency, lalr1.java's %define variables location_type and
position_type are deprecated in favor of api.location.type and
api.position.type.

* Noteworthy changes in release 2.6.2 (2012-08-03) [stable]

** Bug fixes
Expand Down Expand Up @@ -380,7 +395,7 @@ GNU Bison NEWS

* Noteworthy changes in release 2.6 (2012-07-19) [stable]

** Future changes:
** Future changes

The next major release of Bison will drop support for the following
deprecated features. Please report disagreements to bug-bison@gnu.org.
Expand Down
25 changes: 13 additions & 12 deletions README-hacking
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ These requirements do not apply when building from a distribution tarball.

** Requirements

We've opted to keep only the highest-level sources in the repository.
This eases our maintenance burden, (fewer merges etc.), but imposes more
We've opted to keep only the highest-level sources in the repository. This
eases our maintenance burden, (fewer merges etc.), but imposes more
requirements on anyone wishing to build from the just-checked-out sources.
For example, you have to use the latest stable versions of the maintainer
tools we depend upon, including:

- Automake <http://www.gnu.org/software/automake/>
- Autoconf <http://www.gnu.org/software/autoconf/>
- Automake <http://www.gnu.org/software/automake/>
- Flex <http://www.gnu.org/software/flex/>
- Gettext <http://www.gnu.org/software/gettext/>
- Graphviz <http://www.graphviz.org>
- Gzip <http://www.gnu.org/software/gzip/>
- Perl <http://www.cpan.org/>
- Rsync <http://samba.anu.edu.au/rsync/>
Expand All @@ -68,16 +69,16 @@ tools we depend upon, including:
Valgrind <http://valgrind.org/> is also highly recommended, if it supports
your architecture.

Bison is written using Bison grammars, so there are bootstrapping
issues. The bootstrap script attempts to discover when the C code
generated from the grammars is out of date, and to bootstrap with an
out-of-date version of the C code, but the process is not foolproof.
Also, you may run into similar problems yourself if you modify Bison.
Bison is written using Bison grammars, so there are bootstrapping issues.
The bootstrap script attempts to discover when the C code generated from the
grammars is out of date, and to bootstrap with an out-of-date version of the
C code, but the process is not foolproof. Also, you may run into similar
problems yourself if you modify Bison.

Only building the initial full source tree will be a bit painful.
Later, after synchronizing from the repository a plain 'make' should
be sufficient. Note, however, that when gnulib is updated, running
'./bootstrap' again might be needed.
Only building the initial full source tree will be a bit painful. Later,
after synchronizing from the repository a plain 'make' should be sufficient.
Note, however, that when gnulib is updated, running './bootstrap' again
might be needed.

** First checkout

Expand Down
12 changes: 12 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
* Short term
** Graphviz display code thoughts
The code for the --graph option is over two files: print_graph, and
graphviz. I believe this is because Bison used to also produce VCG graphs,
but since this is no longer true, maybe we could consider these files for
fusion.

Little effort factoring seems to have been given to factoring in these files,
and their print-xml and print counterpart. We would very much like to re-use
the pretty format of states from .output in the .dot

Also, the underscore in print_graph.[ch] isn't very fitting considering
the dashes in the other filenames.

** push-parser
Check it too when checking the different kinds of parsers. And be
Expand Down
1 change: 1 addition & 0 deletions cfg.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ regen: _version

# Used in maint.mk's web-manual rule
manual_title = The Yacc-compatible Parser Generator
gendocs_options_ = -I $(abs_top_srcdir)/doc -I $(abs_top_builddir)/doc

# It's useful to run maintainer-*check* targets during development, but we
# don't want to wait on a recompile because of an update to $(VERSION). Thus,
Expand Down
17 changes: 17 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,18 @@ if test "$enable_gcc_warnings" = yes; then
warn_cxx='-Wnoexcept'

AC_LANG_PUSH([C])
# Clang supports many of GCC's -W options, but only issues warnings
# on the ones it does not recognize. In that case, gl_WARN_ADD
# thinks the option is supported, and unknown options are then added
# to CFLAGS. But then, when -Werror is added in the test suite for
# instance, the warning about the unknown option turns into an
# error.
#
# This should be addressed by gnulib's gl_WARN_ADD, but in the
# meanwhile, turn warnings about unknown options into errors in
# CFLAGS, and restore CFLAGS after the tests.
save_CFLAGS=$CFLAGS
gl_WARN_ADD([-Werror=unknown-warning-option], [CFLAGS])
for i in $warn_common $warn_c;
do
gl_WARN_ADD([$i], [WARN_CFLAGS])
Expand All @@ -83,9 +95,12 @@ if test "$enable_gcc_warnings" = yes; then
# Warnings for the test suite only.
gl_WARN_ADD([-Wundef], [WARN_CFLAGS_TEST])
gl_WARN_ADD([-pedantic], [WARN_CFLAGS_TEST])
CFLAGS=$save_CFLAGS
AC_LANG_POP([C])

AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
gl_WARN_ADD([-Werror=unknown-warning-option], [CXXFLAGS])
for i in $warn_common $warn_cxx;
do
gl_WARN_ADD([$i], [WARN_CXXFLAGS])
Expand All @@ -96,6 +111,7 @@ if test "$enable_gcc_warnings" = yes; then
# Warnings for the test suite only.
gl_WARN_ADD([-Wundef], [WARN_CXXFLAGS_TEST])
gl_WARN_ADD([-pedantic], [WARN_CXXFLAGS_TEST])
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
fi

Expand All @@ -118,6 +134,7 @@ AC_SUBST([YACC_SCRIPT])
AC_SUBST([YACC_LIBRARY])

# Checks for programs.
AM_MISSING_PROG([DOT], [dot])
AC_PROG_LEX
$LEX_IS_FLEX || AC_MSG_ERROR([Flex is required])
AC_PROG_YACC
Expand Down
2 changes: 1 addition & 1 deletion data/c.m4
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ m4_define([b4_YYDEBUG_define],
# endif
# else /* ! defined YYDEBUG */
# define ]b4_api_PREFIX[DEBUG ]b4_parse_trace_if([1], [0])[
# endif /* ! defined ]b4_api_PREFIX[DEBUG */
# endif /* ! defined YYDEBUG */
#endif /* ! defined ]b4_api_PREFIX[DEBUG */]])[]dnl
])

Expand Down
2 changes: 1 addition & 1 deletion data/java.m4
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ m4_define([b4_init_throws], [b4_percent_define_get([[init_throws]])])
b4_percent_define_default([[api.location.type]], [Location])
m4_define([b4_location_type], [b4_percent_define_get([[api.location.type]])])

b4_percent_define_default([[api.position.type]], [Position])])
b4_percent_define_default([[api.position.type]], [Position])
m4_define([b4_position_type], [b4_percent_define_get([[api.position.type]])])


Expand Down
26 changes: 15 additions & 11 deletions data/xslt/xml2dot.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@
<xsl:call-template name="escape">
<xsl:with-param name="subject" select="$filename"/>
</xsl:call-template>
<xsl:text>"&#10;{&#10;</xsl:text>
<xsl:text>&#10;{
node [fontname = courier, shape = box, colorscheme = paired6]
edge [fontname = courier]

</xsl:text>
<xsl:apply-templates select="state"/>
<xsl:text>}&#10;</xsl:text>
</xsl:template>
Expand Down Expand Up @@ -124,20 +128,20 @@
<xsl:with-param name="dst" select="@state"/>
<xsl:with-param name="style">
<xsl:choose>
<xsl:when test="@symbol = 'error'">
<xsl:text>dotted</xsl:text>
</xsl:when>
<xsl:when test="@type = 'shift'">
<xsl:text>solid</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>dashed</xsl:text>
</xsl:otherwise>
<xsl:when test="@symbol = 'error'">
<xsl:text>dotted</xsl:text>
</xsl:when>
<xsl:when test="@type = 'shift'">
<xsl:text>solid</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>dashed</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="label">
<xsl:if test="not(@symbol = 'error')">
<xsl:value-of select="@symbol"/>
<xsl:value-of select="@symbol"/>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
Expand Down
8 changes: 2 additions & 6 deletions data/yacc.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,18 +685,14 @@ while (0)
# else
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif
#endif]], [[


/* This macro is provided for backward compatibility. */

#endif]],
[[/* This macro is provided for backward compatibility. */
#ifndef YY_LOCATION_PRINT
# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
#endif]])[


/* YYLEX -- calling `yylex' with the right arguments. */

#ifdef YYLEX_PARAM
# define YYLEX yylex (]b4_pure_if([&yylval[]b4_locations_if([, &yylloc]), ])[YYLEX_PARAM)
#else
Expand Down
Loading

0 comments on commit d0a3043

Please sign in to comment.