]> git.saurik.com Git - bison.git/log
bison.git
12 years agomuscles: rename private functions/macros
Akim Demaille [Thu, 26 Jul 2012 09:23:55 +0000 (11:23 +0200)] 
muscles: rename private functions/macros

* src/muscle-tab.c (MUSCLE_COMMON_DECODE, muscle_string_decode)
(muscle_location_decode): Not related to muscles, rename as...
(COMMON_DECODE, string_decode, location_decode): these.

12 years agoobstack_escape: escape M4 characters
Akim Demaille [Thu, 26 Jul 2012 09:19:18 +0000 (11:19 +0200)] 
obstack_escape: escape M4 characters

* src/muscle-tab.h (MUSCLE_OBSTACK_SGROW): This is not related to
muscles, so move to, and rename as...
* src/system.h (obstack_escape): this.
Adjust dependencies.

12 years agoremove dead macro
Akim Demaille [Thu, 26 Jul 2012 10:16:54 +0000 (12:16 +0200)] 
remove dead macro

* src/system.h (DEFAULT_TMPDIR): Remove, unused.

12 years agomaint: style changes
Akim Demaille [Wed, 25 Jul 2012 15:57:57 +0000 (17:57 +0200)] 
maint: style changes

* src/scan-code.l: Remove useless braces.
Formatting changes.
Prefer NULL to 0.
* src/muscle-tab.c, src/system.h: Formatting changes.

12 years agodoc: avoid problems with case insensitive file systems
Akim Demaille [Tue, 24 Jul 2012 11:24:20 +0000 (13:24 +0200)] 
doc: avoid problems with case insensitive file systems

makeinfo --html generates index.html, and the node "Index" will result
in Index.html.  On case insensitive file systems, such as on Mac OS X
by default, this results in a single, invalid, file (Texinfo 4.13).
See http://lists.gnu.org/archive/html/bug-texinfo/2012-07/msg00032.html

* doc/bison.texi (Index): Rename as...
(Index of Terms): this.

12 years agoconfigure: fix botched quoting
Stefano Lattarini [Sat, 21 Jul 2012 15:24:23 +0000 (17:24 +0200)] 
configure: fix botched quoting

* configure.ac: In the AC_SUBST call on 'VALGRIND_PREBISON'.  Without
this change, when running ./configure, I see:

    ...
    checking for valgrind... valgrind
    ./configure: line 35221: -q: command not found
    checking for Java compiler... gcj -C -fsource=1.3 -ftarget=1.4
    ...

Copyright-paperwork-exempt: yes
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
12 years agoregen
Akim Demaille [Tue, 24 Jul 2012 06:55:26 +0000 (08:55 +0200)] 
regen

12 years agoyystype, yyltype: remove.
Akim Demaille [Tue, 24 Jul 2012 06:53:48 +0000 (08:53 +0200)] 
yystype, yyltype: remove.

* data/c.m4: here.
* NEWS: Doc it.

12 years agoregen
Akim Demaille [Sun, 22 Jul 2012 18:19:11 +0000 (20:19 +0200)] 
regen

12 years agoYYFAIL: remove.
Akim Demaille [Sun, 22 Jul 2012 18:17:54 +0000 (20:17 +0200)] 
YYFAIL: remove.

* data/lalr1.java, data/yacc.c, src/scan-code.l: Remove YYFAIL support.
* NEWS, TODO: Update.

12 years agotodo: update.
Akim Demaille [Sun, 22 Jul 2012 10:36:51 +0000 (12:36 +0200)] 
todo: update.

* TODO: obsolete items.

12 years agoregen.
Akim Demaille [Sun, 22 Jul 2012 18:09:19 +0000 (20:09 +0200)] 
regen.

12 years agospace changes.
Akim Demaille [Sun, 22 Jul 2012 18:08:29 +0000 (20:08 +0200)] 
space changes.

* data/bison.m4 (b4_symbol_action): Remove spurious eol in the output.

12 years agoparser: fix %printer usage.
Akim Demaille [Sun, 22 Jul 2012 16:48:56 +0000 (18:48 +0200)] 
parser: fix %printer usage.

* src/parse-gram.y: Instead of stderr, using yyo.

12 years agoparser: factor the handling of code_props
Akim Demaille [Sun, 22 Jul 2012 16:45:32 +0000 (18:45 +0200)] 
parser: factor the handling of code_props

* src/parse-gram.y: Now that %printer and %destructor are treated
equally, let...
(code_props_type): handle them.

12 years agoparser: factor handling of type tags
Akim Demaille [Sun, 22 Jul 2012 16:44:39 +0000 (18:44 +0200)] 
parser: factor handling of type tags

* src/parse-gram.y: Now that <*> and <> are processed like regular
tags, let...
(tag): handle them.

12 years agoregen.
Akim Demaille [Sun, 22 Jul 2012 16:33:11 +0000 (18:33 +0200)] 
regen.

12 years agosimplify the handling of <> and <*>'s code_props.
Akim Demaille [Sun, 22 Jul 2012 15:51:25 +0000 (17:51 +0200)] 
simplify the handling of <> and <*>'s code_props.

Currently they are treated in separated variables, contrary to other
<TYPE> code_props.  This duplicates code (and messages for translators)
uselessly, as demonstrated by the fact that thanks to this patch, now
useless <*> and <> code_props are reported like the others.

* src/parse-gram.y (generic_symlist_item): Treat "<*>" and "<>" as regular
type tags.
* src/symlist.h, src/symlist.c (symbol_list_default_tagged_new)
(symbol_list_default_tagless_new,SYMLIST_DEFAULT_TAGGED)
(SYMLIST_DEFAULT_TAGLESS): Remove.
* src/symtab.h, src/symtab.c (default_tagged_code_props)
(default_tagless_code_props, default_tagged_code_props_set)
(default_tagless_code_props_set): Remove.
(symbol_code_props_get): Default to <*> or <>'s code_props.

* tests/actions.at: Complete expected errors: there are new warnings.
* tests/input.at: Likewise.
(Useless printers or destructors): Extend.

12 years agoallow modification on retrieved code_props.
Akim Demaille [Sun, 22 Jul 2012 15:46:34 +0000 (17:46 +0200)] 
allow modification on retrieved code_props.

The logic to compute the %printer or %destructor to used (i.e., a
code_props) is implemented twice: one, of course, in
symbol_code_props_get, and another time in symbol_check_defined to
record the fact that a code_props is used (so that we can reported
unused ones).  Let the former use the latter.

I would probably use "mutable" in C++ and keep these guys const,
but this is C.  And casting away constness triggers warnings.

* src/scan-code.h, src/scan-code.l (code_props_none): Is not const.
* src/symtab.h, src/symtab.c (symbol_code_props_get): The symbol
is not const.
(symbol_check_defined): Use it.

12 years agomaint: regen.
Akim Demaille [Sun, 22 Jul 2012 14:54:30 +0000 (16:54 +0200)] 
maint: regen.

12 years agomaint: fix bison's own header guards.
Akim Demaille [Sun, 22 Jul 2012 15:11:39 +0000 (17:11 +0200)] 
maint: fix bison's own header guards.

Because I'm using a VPATH build with an absolute srcdir, I have
GRAM__USERS_AKIM_SRC_GNU_BISON_SRC_PARSE_GRAM_H.  Before, I was using
a relative srcdir, and had GRAM_______SRC_PARSE_GRAM_H (coming from
../../).  Let it be GRAM_SRC_PARSE_GRAM_H.

* tests/bison.in: Do not depend on the value of $top_srcdir for
Bison itself.
If we were to use relative paths from .c to .y, we would not have
this problem.

12 years agomaint: add missing const.
Akim Demaille [Sun, 22 Jul 2012 14:41:00 +0000 (16:41 +0200)] 
maint: add missing const.

* src/symtab.h, src/symtab.c (symbol_print): here.

12 years agostyle changes.
Akim Demaille [Sun, 22 Jul 2012 10:28:31 +0000 (12:28 +0200)] 
style changes.

* src/parse-gram.y, src/symtab.c: Space changes.
* src/symtab.h: Comment changes.

12 years agoautoconf: update.
Akim Demaille [Sun, 22 Jul 2012 09:53:31 +0000 (11:53 +0200)] 
autoconf: update.

* submodules/autoconf: here.
No significant changes for our use of m4sugar.m4.

12 years agooutput: no longer use b4_tokens.
Akim Demaille [Sun, 22 Jul 2012 07:11:42 +0000 (09:11 +0200)] 
output: no longer use b4_tokens.

* data/glr.c, data/glr.cc, data/lalr1.cc, data/lalr1.java, data/yacc.c:
Since the previous commit, b4_tokens_define and the like no longer need
b4_tokens.
* src/output.c (token_definitions_output): Remove.

12 years agooutput: use the token list to define the yytokentype
Akim Demaille [Sun, 22 Jul 2012 07:11:37 +0000 (09:11 +0200)] 
output: use the token list to define the yytokentype

There are currently two systems used to pass information about tokens to
m4: the original one, and another, which is used for instance for
printers and destructors, variants etc.  Move to using only the latter.

* data/bison.m4 (b4_symbol_map, b4_token_visible_if)
(b4_token_has_definition, b4_any_token_visible_if, b4_token_format): New.
* data/c++.m4, data/c.m4, data/glr.c, data/java.m4: Adjust to use them.

12 years agotests: fix VPATH issue
Akim Demaille [Fri, 20 Jul 2012 16:18:47 +0000 (18:18 +0200)] 
tests: fix VPATH issue

* examples/test: With an absolute VPATH build, "../" is incorrect.

12 years agonews: fix typo.
Akim Demaille [Fri, 20 Jul 2012 08:00:51 +0000 (10:00 +0200)] 
news: fix typo.

* NEWS: here.
Reported by Ben Pfaff.

12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Thu, 19 Jul 2012 15:32:01 +0000 (17:32 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  maint: update gnu-web-doc-update.
  maint: post-release administrivia
  version 2.6
  maint: prepare for release 2.6
  maint: post-release administrivia
  version 2.5.91
  maint: prepare NEWS.
  maint: fix spaces.
  tests: adjust to case where the C compiler is actually a C++ compiler
  tests: fix dependencies
  doc: fix Texinfo command
  maint: Valgrind on OS X.
  tests: be sure that backups are safe.
  maint: dead comment.
  tests: refactor for legibility.
  tests: refactor the bison invocations.
  maint: fix syntax-check ignore patterns.
  gnulib: update
  gnulib: update.
  gnulib: update

Conflicts:
build-aux/Makefile.am
cfg.mk
tests/Makefile.am

12 years agomaint: update gnu-web-doc-update.
Akim Demaille [Thu, 19 Jul 2012 14:24:33 +0000 (16:24 +0200)] 
maint: update gnu-web-doc-update.

* gnulib: here.

12 years agomaint: post-release administrivia
Akim Demaille [Thu, 19 Jul 2012 13:38:29 +0000 (15:38 +0200)] 
maint: post-release administrivia

* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.

12 years agoversion 2.6 v2.6
Akim Demaille [Thu, 19 Jul 2012 13:24:23 +0000 (15:24 +0200)] 
version 2.6

* NEWS: Record release date.

12 years agomaint: prepare for release 2.6
Akim Demaille [Thu, 19 Jul 2012 13:20:20 +0000 (15:20 +0200)] 
maint: prepare for release 2.6

* NEWS: here.

12 years agomaint: post-release administrivia
Akim Demaille [Wed, 18 Jul 2012 16:33:25 +0000 (18:33 +0200)] 
maint: post-release administrivia

* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.

12 years agoversion 2.5.91
Akim Demaille [Wed, 18 Jul 2012 16:19:32 +0000 (18:19 +0200)] 
version 2.5.91

* NEWS: Record release date.

12 years agomaint: prepare NEWS.
Akim Demaille [Wed, 18 Jul 2012 16:19:12 +0000 (18:19 +0200)] 
maint: prepare NEWS.

12 years agomaint: fix spaces.
Akim Demaille [Wed, 18 Jul 2012 15:56:30 +0000 (17:56 +0200)] 
maint: fix spaces.

* build-aux/Makefile.am: here.

12 years agotests: adjust to case where the C compiler is actually a C++ compiler
Akim Demaille [Tue, 17 Jul 2012 13:20:11 +0000 (15:20 +0200)] 
tests: adjust to case where the C compiler is actually a C++ compiler

* tests/atlocal.in (CC_IS_CXX): New.
* tests/headers.at (Several parsers): Use it.

12 years agotests: fix dependencies
Akim Demaille [Tue, 17 Jul 2012 13:19:37 +0000 (15:19 +0200)] 
tests: fix dependencies

* tests/Makefile.am: we need atconfig and atlocal to be up to date
when calling testsuite.

12 years agodoc: fix Texinfo command
Akim Demaille [Tue, 17 Jul 2012 13:11:47 +0000 (15:11 +0200)] 
doc: fix Texinfo command

* doc/bison.texi: In parens, use @pxref.

12 years agomaint: Valgrind on OS X.
Akim Demaille [Tue, 17 Jul 2012 08:45:00 +0000 (10:45 +0200)] 
maint: Valgrind on OS X.

* configure.ac (VALGRIND_PREBISON): New.
* tests/Makefile.am (maintainer-check-valgrind): Use it.
* etc/darwin11.4.0.supp: New.
* configure.ac, etc/Makefile.am: Use it.
* configure.ac: Disable Valgrind on Mac OS X.
* README-hacking: Explain why.

12 years agotests: be sure that backups are safe.
Akim Demaille [Tue, 17 Jul 2012 12:25:26 +0000 (14:25 +0200)] 
tests: be sure that backups are safe.

* tests/local.at (at_save_special_files): here.

12 years agomaint: dead comment.
Akim Demaille [Tue, 17 Jul 2012 12:08:53 +0000 (14:08 +0200)] 
maint: dead comment.

* etc/README: here.

12 years agotests: refactor for legibility.
Akim Demaille [Tue, 17 Jul 2012 11:40:26 +0000 (13:40 +0200)] 
tests: refactor for legibility.

* tests/local.at (AT_BISON_CHECK_WARNINGS, AT_BISON_CHECK_WARNINGS_):
New.

12 years agotests: refactor the bison invocations.
Akim Demaille [Tue, 17 Jul 2012 10:45:29 +0000 (12:45 +0200)] 
tests: refactor the bison invocations.

* tests/local.at (m4_null_if, AT_BISON_CHECK_): New.

12 years agomaint: fix syntax-check ignore patterns.
Akim Demaille [Tue, 17 Jul 2012 08:35:58 +0000 (10:35 +0200)] 
maint: fix syntax-check ignore patterns.

* cfg.mk: here.

12 years agognulib: update
Akim Demaille [Tue, 17 Jul 2012 07:49:57 +0000 (09:49 +0200)] 
gnulib: update

12 years agognulib: update.
Akim Demaille [Mon, 16 Jul 2012 18:40:18 +0000 (20:40 +0200)] 
gnulib: update.

* gnulib: Update so that gitlog-to-changelog support --srcdir.
* Makefile.am: Use it.

12 years agognulib: update
Akim Demaille [Fri, 6 Jul 2012 13:03:27 +0000 (15:03 +0200)] 
gnulib: update

* bootstrap, build-aux/.gitignore, gnulib, m4/.gitignore: update.

12 years agomaint: minor fixes
Akim Demaille [Fri, 6 Jul 2012 09:15:24 +0000 (11:15 +0200)] 
maint: minor fixes

* NEWS: restore missing entry.
* cfg.mk: Adjust to *.texinfo -> *.texi.
* src/symtab.c: Spaces fixes.

12 years agotests: address g++-4.8 warnings.
Akim Demaille [Fri, 6 Jul 2012 09:07:32 +0000 (11:07 +0200)] 
tests: address g++-4.8 warnings.

list.yy: In function 'yy::parser::symbol_type yylex()':
list.yy:107:29: error: typedef 'token' locally defined but not used
  [-Werror=unused-local-typedefs]
   typedef yy::parser::token token;
                             ^

* tests/c++.at (AT_CHECK_VARIANTS): here.

12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Fri, 6 Jul 2012 08:58:26 +0000 (10:58 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  maint: update release instructions
  maint: post-release administrivia
  version 2.5.90
  build: fix gen-ChangeLog call.
  gnulib: update.
  tests: fix SKIP_IF for Java.
  api.prefix: incompatible with %name-prefix.
  api.prefix: strengthen the tests and fix push-parsers.
  skeletons: style changes.
  NEWS: minor changes.
  api.prefix: improve the documentation for YYDEBUG.
  gnulib: update.

Conflicts:
NEWS
cfg.mk
data/bison.m4
doc/bison.texi
m4/.gitignore
tests/calc.at
tests/headers.at

12 years agomaint: update release instructions
Akim Demaille [Fri, 6 Jul 2012 08:14:49 +0000 (10:14 +0200)] 
maint: update release instructions

* README-hacking: here.

12 years agomaint: post-release administrivia
Akim Demaille [Thu, 5 Jul 2012 14:29:06 +0000 (16:29 +0200)] 
maint: post-release administrivia

* NEWS: Add header line for next release.
* .prev-version: Record previous version.
* cfg.mk (old_NEWS_hash): Auto-update.

12 years agoversion 2.5.90
Akim Demaille [Thu, 5 Jul 2012 14:20:44 +0000 (16:20 +0200)] 
version 2.5.90

* NEWS: Record release date.

12 years agobuild: fix gen-ChangeLog call.
Akim Demaille [Thu, 5 Jul 2012 14:09:17 +0000 (16:09 +0200)] 
build: fix gen-ChangeLog call.

* Makefile.am: Be sure to catch errors, and fix option name

12 years agognulib: update.
Akim Demaille [Thu, 5 Jul 2012 13:24:34 +0000 (15:24 +0200)] 
gnulib: update.

* gnulib/build-aux/do-release-commit-and-tag: Fix.

12 years agotests: fix SKIP_IF for Java.
Akim Demaille [Thu, 5 Jul 2012 12:27:09 +0000 (14:27 +0200)] 
tests: fix SKIP_IF for Java.

* tests/local.at (AT_JAVA_COMPILE): here.

12 years agoapi.prefix: incompatible with %name-prefix.
Akim Demaille [Thu, 5 Jul 2012 10:33:42 +0000 (12:33 +0200)] 
api.prefix: incompatible with %name-prefix.

* data/bison.m4: Make it incompatible.
* tests/input.at: Check that it is.

12 years agoapi.prefix: strengthen the tests and fix push-parsers.
Akim Demaille [Thu, 5 Jul 2012 10:33:37 +0000 (12:33 +0200)] 
api.prefix: strengthen the tests and fix push-parsers.

* tests/calc.at: Check api.prefix in addition to %name-prefix.
* tests/headers.at: Check push parsers and pure interface.
* tests/local.at: Use YYLTYPE renamed.
* data/yacc.c (b4_declare_yyparse_push_): Handle api.prefix.
* doc/bison.texi: Style changes.

12 years agoskeletons: style changes.
Akim Demaille [Thu, 5 Jul 2012 09:11:38 +0000 (11:11 +0200)] 
skeletons: style changes.

* data/bison.m4: Define default values after having defined
the support macros.
Kill a dead comment.

12 years agoNEWS: minor changes.
Akim Demaille [Thu, 5 Jul 2012 08:30:47 +0000 (10:30 +0200)] 
NEWS: minor changes.

* NEWS: style changes.

12 years agoapi.prefix: improve the documentation for YYDEBUG.
Akim Demaille [Thu, 5 Jul 2012 08:30:09 +0000 (10:30 +0200)] 
api.prefix: improve the documentation for YYDEBUG.

* doc/bison.texi: Explain how api.prefix is applied to YYDEBUG.

12 years agognulib: update.
Akim Demaille [Thu, 5 Jul 2012 07:37:20 +0000 (09:37 +0200)] 
gnulib: update.

* bootstrap, gnulib: Update.
* cfg.mk (syntax-check): Don't check "error" usage in bison.texi.

12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Wed, 4 Jul 2012 15:14:35 +0000 (17:14 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  tests: headers.at: strengthen.
  glr.cc: do not override C++ definitions by C macros.
  YYLLOC_DEFAULT: factor, and don't export it in headers.
  api.prefix: do not use #define to handle YYSTYPE_IS_TRIVIAL etc.
  tests: portability fixes.
  c++: fewer #includes in the headers.
  glr.cc: formatting changes.
  tests: more logs.
  api.prefix: also rename YYDEBUG.

Conflicts:
data/c.m4
data/glr.c
data/glr.cc
data/lalr1.cc
data/yacc.c

12 years agotests: headers.at: strengthen.
Akim Demaille [Wed, 4 Jul 2012 10:04:19 +0000 (12:04 +0200)] 
tests: headers.at: strengthen.

* tests/headers.at (Several headers): Be stricter when checking
the exported macros.

12 years agoglr.cc: do not override C++ definitions by C macros.
Akim Demaille [Wed, 4 Jul 2012 10:00:24 +0000 (12:00 +0200)] 
glr.cc: do not override C++ definitions by C macros.

* data/glr.c: here.
* data/glr.cc: Fix overquotation.
* tests/headers.at: Comment changes.

12 years agoYYLLOC_DEFAULT: factor, and don't export it in headers.
Akim Demaille [Wed, 4 Jul 2012 09:41:06 +0000 (11:41 +0200)] 
YYLLOC_DEFAULT: factor, and don't export it in headers.

* data/c++.m4, data/c.m4 (b4_yylloc_default_define): New.
* data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c: Use it.
* data/glr.cc: Do not define YYLLOC_DEFAULT in the header file,
but in the implementation one.

12 years agoapi.prefix: do not use #define to handle YYSTYPE_IS_TRIVIAL etc.
Akim Demaille [Wed, 4 Jul 2012 09:04:52 +0000 (11:04 +0200)] 
api.prefix: do not use #define to handle YYSTYPE_IS_TRIVIAL etc.

The following mixture is insane:

  #define YYSTYPE_IS_TRIVIAL PREFIX_STYPE_IS_TRIVIAL
  #if (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)

since, of course YYSTYPE_IS_TRIVIAL is defined.  Instead we could
define YYSTYPE_IS_TRIVIAL as PREFIX_STYPE_IS_TRIVIAL only when the
later is defined, but let's avoid stacking CPP on top of M4: rather, use

  #if (defined PREFIX_STYPE_IS_TRIVIAL && PREFIX_STYPE_IS_TRIVIAL)

* data/glr.c, data/yacc.c: Use YYSTYPE_IS_TRIVIAL, YYSTYPE_IS_DECLARED,
YYLTYPE_IS_TRIVIAL and YYLTYPE_IS_DECLARED under their api.prefix-renamed
name.

12 years agotests: portability fixes.
Akim Demaille [Wed, 4 Jul 2012 10:04:07 +0000 (12:04 +0200)] 
tests: portability fixes.

Reported by Hydra.

* tests/headers.at (Several headers): Be sure to include config.h
in the files to compile.

12 years agoc++: fewer #includes in the headers.
Akim Demaille [Wed, 4 Jul 2012 07:57:40 +0000 (09:57 +0200)] 
c++: fewer #includes in the headers.

* data/lalr1.cc: Define YY_NULL in the *.cc file, it is not needed
in the header.
* data/location.cc: iosfwd suffices.

12 years agoglr.cc: formatting changes.
Akim Demaille [Mon, 2 Jul 2012 12:55:54 +0000 (14:55 +0200)] 
glr.cc: formatting changes.

* data/glr.cc: here.

12 years agotests: more logs.
Akim Demaille [Mon, 2 Jul 2012 10:11:51 +0000 (12:11 +0200)] 
tests: more logs.

* tests/headers.at (Several parsers): Here.

12 years agoapi.prefix: also rename YYDEBUG.
Akim Demaille [Mon, 2 Jul 2012 12:56:22 +0000 (14:56 +0200)] 
api.prefix: also rename YYDEBUG.

The testsuite in master has shown weird errors for the "Mulitple
Parsers" tests: the caller of p5.parse() received some apparently
random value, while tracing p5.parse() showed that the function was
consistently returning 0.

It happens when mixing several parser headers, some generated without
%debug, others with.  In particular the C++ parser was generated with
%debug, i.e., with:

  #ifndef YYDEBUG
  # define YYDEBUG 1
  #endif

and compiled separatedly.  Yet, its header was included after the one
of another parser, this time without %debug, i.e., with

  #ifndef YYDEBUG
  # define YYDEBUG 0
  #endif

in its header.  As a result, the parser was compiled with YYDEBUG set,
but its header was used without.  Since the layout of the objects are
then completely different, boom.

Therefore, do not change the value of YYDEBUG.  Rather, use it as a
default value for <API.PREFIX>DEBUG.

* data/c.m4 (b4_YYDEBUG_define): New.
(b4_declare_yydebug): Rename as...
(b4_yydebug_declare): this, for consistency.
* data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c: Use it.
* NEWS: Document it.

12 years agoformatting changes.
Akim Demaille [Mon, 2 Jul 2012 08:28:36 +0000 (10:28 +0200)] 
formatting changes.

* data/lalr1.cc: here.

12 years agoNEWS: spell fixes.
Akim Demaille [Mon, 2 Jul 2012 07:58:56 +0000 (09:58 +0200)] 
NEWS: spell fixes.

* NEWS: here.
Reported by Stefano Lattarini.

12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Mon, 2 Jul 2012 07:55:43 +0000 (09:55 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  NEWS: spell check.
  api.prefix.

Conflicts:
data/c.m4
data/glr.cc
data/lalr1.cc
doc/bison.texi

12 years agoNEWS: spell check.
Akim Demaille [Mon, 2 Jul 2012 07:26:22 +0000 (09:26 +0200)] 
NEWS: spell check.

* NEWS: here.

12 years agoapi.prefix.
Akim Demaille [Tue, 26 Jun 2012 08:09:10 +0000 (10:09 +0200)] 
api.prefix.

* data/c.m4 (b4_api_prefix, b4_api_PREFIX): New.
(b4_prefix, b4_union_name, b4_token_enums, b4_declare_yylstype): Use them.
* data/glr.c, data/yacc.c, data/glr.cc, data/lalr1.cc: Use them to change
the prefix of exported preprocessor symbols.
* src/getargs.c (usage): Ditto.
* tests/headers.at (Several parsers): New.
* tests/local.at (AT_API_PREFIX): New.
AT_YYSTYPE, AT_YYLTYPE): Adjust.
* doc/bison.texi (Multiple Parsers): Move documentation of %name-prefix to...
(Table of Symbols): here.
(Multiple Parsers): Document api.prefix.
(%define Summary): Point to it.
Use @code for variable names.
(Bison Options): -p/--name-prefix are obsoleted.
* NEWS: Announce api.prefix.

12 years agowarnings: display warnings categories
Victor Santet [Fri, 29 Jun 2012 14:23:42 +0000 (16:23 +0200)] 
warnings: display warnings categories

* src/complain.c (error_message): Call 'warnings_print_categories'.
* src/gram.c (grammar_rules_useless_report): Display itself warning
category.
* tests/actions.at, tests/conflicts.at, tests/existing.at,
tests/input.at, tests/named-refs.at, tests/output.at, tests/reduce.at,
tests/regression.at, tests/skeletons.at: Adjust.
* NEWS: Document this.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agowarnings: be ready to print warnings categories
Victor Santet [Fri, 29 Jun 2012 13:22:09 +0000 (15:22 +0200)] 
warnings: be ready to print warnings categories

A function to print warnings categories, like -Wyacc, -Wother, etc.

* src/complain.h, src/complain.c (print_warning_categories): New function.
* src/output.c (ARRAY_CARDINALITY): Move it to file 'src/system.h'.
* src/complain.h (enum warnings): New value, 'silent', "complain"
must not display the warning type.

12 years agomaint: prepare forthcoming changes
Akim Demaille [Fri, 29 Jun 2012 13:58:59 +0000 (15:58 +0200)] 
maint: prepare forthcoming changes

* src/gram.c (rule_rhs_print): Do not print new line anymore.
(rule_print): Make it static.
* src/closure.c, src/derives.c, src/gram.c: Adjust.

12 years agostyle changes
Victor Santet [Fri, 29 Jun 2012 13:22:12 +0000 (15:22 +0200)] 
style changes

* src/complain.c, src/reader.c, src/reduce.c, src/main.c:
Fix indentation.
Simplify a bit.

12 years agoregen.
Akim Demaille [Thu, 28 Jun 2012 15:18:51 +0000 (17:18 +0200)] 
regen.

12 years agowarnings: factoring: complaints
Victor Santet [Thu, 28 Jun 2012 14:44:21 +0000 (16:44 +0200)] 
warnings: factoring: complaints

* src/complain.c (error_message): Accept warning categories (an integer) as
argument.
Location is a 'const location *' instead of 'location *'.
(ERROR_MESSAGE): Delete it.
* src/complain.c, src/complain.h (complains): New function.
(complain, complain_at, complain_at_indent): Generic functions for
complaints. Call 'complains'.
(warn_at, warn_at_indent, warn, yacc_at, midrule_value_at)
(fatal_at, fatal): Delete them. Adjust dependencies.
* src/complain.h (enum warnings): New fields 'complaint' and 'fatal'.
* bootstrap.conf (XGETTEXT_OPTIONS): Adjust.

12 years agowarnings: move them to complain.c.
Victor Santet [Thu, 28 Jun 2012 14:44:20 +0000 (16:44 +0200)] 
warnings: move them to complain.c.

* src/getargs.h, src/getargs.c (warnings, warnings_flags): Move to...
* src/complain.h, src/complain.c: Here.

12 years agowarnings: rename the categories
Victor Santet [Thu, 28 Jun 2012 14:44:19 +0000 (16:44 +0200)] 
warnings: rename the categories

Forthcoming changes will use the warning categories much more often,
so shortening them will improve readability.

* src/complain.c, src/complain.h, src/conflicts.c,
* src/getargs.c, src/getargs.h, src/gram.c (enum warnings):
s/warnings_/W/g.

12 years agofix merge.
Akim Demaille [Thu, 28 Jun 2012 14:59:47 +0000 (16:59 +0200)] 
fix merge.

* data/bison.m4: Use b4_error_verbose_if after it was defined.

12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Thu, 28 Jun 2012 13:29:18 +0000 (15:29 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  tests: use the generalized default yylex.
  tests: AT_YYERROR_DEFINE: prepare for list of ints.
  skeletons: no longer define YYLSP_NEEDED.
  c++: do not export YYTOKEN_TABLE and YYERROR_VERBOSE.

Conflicts:
data/c.m4
data/glr.cc
data/lalr1.cc
doc/bison.texi
tests/regression.at

12 years agotests: use the generalized default yylex.
Akim Demaille [Thu, 28 Jun 2012 12:54:45 +0000 (14:54 +0200)] 
tests: use the generalized default yylex.

* tests/actions.at, tests/glr-regression.at, tests/regression.at: here.

12 years agotests: AT_YYERROR_DEFINE: prepare for list of ints.
Akim Demaille [Thu, 28 Jun 2012 12:20:17 +0000 (14:20 +0200)] 
tests: AT_YYERROR_DEFINE: prepare for list of ints.

* tests/local.at (AT_YYERROR_DEFINE): Don't add quotes, check their
presence to detect char/int types.
* tests/actions.at, tests/conflicts.at, tests/glr-regression.at,
* tests/push.at, tests/regression.at: Adjust.

12 years agoskeletons: no longer define YYLSP_NEEDED.
Akim Demaille [Mon, 25 Jun 2012 14:55:11 +0000 (16:55 +0200)] 
skeletons: no longer define YYLSP_NEEDED.

* data/c.m4, data/glr.cc: here.
* NEWS, TODO: Adjust.

12 years agoc++: do not export YYTOKEN_TABLE and YYERROR_VERBOSE.
Akim Demaille [Mon, 25 Jun 2012 14:52:30 +0000 (16:52 +0200)] 
c++: do not export YYTOKEN_TABLE and YYERROR_VERBOSE.

* src/output.c (prepare_symbols): Do not define b4_token_table.
(prepare): Define b4_token_table_flag.
* data/bison.m4 (b4_token_table_if): New.
Arm it when error-verbose.
* data/glr.c, data/yacc.c (YYTOKEN_TABLE): Remove.
Use m4.
* data/lalr1.cc: Likewise.
(YYERROR_VERBOSE): Remove.
* NEWS, doc/bison.texi: Document this.

12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Tue, 26 Jun 2012 15:13:36 +0000 (17:13 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  maint: use *.texi.

Conflicts:
doc/Makefile.am
examples/calc++/Makefile.am

12 years agomaint: use *.texi.
Akim Demaille [Tue, 26 Jun 2012 14:55:23 +0000 (16:55 +0200)] 
maint: use *.texi.

This is more consistent with the other packages, and Automake-NG
supports only *.texi.

* doc/bison.texinfo: Rename as...
* doc/bison.texi: this.
* doc/Makefile.am, examples/calc++/Makefile.am: Adjust.

12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Tue, 26 Jun 2012 14:43:22 +0000 (16:43 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  tests: do not output m4 set up.
  tests: use the generic yyerror function.
  tests: use assert instead of plain abort.
  tests: improve the generic yylex implementation.
  tests: generalize the compilation macros.
  tests: fix confusion between api.prefix and name-prefix.
  maint: gitignores.
  yacc: work around the ylwrap limitation.

Conflicts:
NEWS
tests/local.at

12 years agowarnings: raise warning for useless printers or destructors
Victor Santet [Thu, 14 Jun 2012 12:20:07 +0000 (14:20 +0200)] 
warnings: raise warning for useless printers or destructors

* src/scan-code.h (code_props): Add field 'is_used'.
(CODE_PROPS_NONE_INIT): Adjust.
* src/scan-code.l (code_props_plain_init, code_props_symbol_action_init)
(code_props_rule_action_init): Instead of implementing several
times the initialization of the code_props structures,
use code_props_none_init.
* src/symtab.c (symbol_check_defined): If a symbol does not have a
destructor (resp. printer) but has a type which has a destructor (resp.
printer), then set field 'is_used' to true.
(semantic_type_check_defined): If a type has a destructor (resp. printer)
but all symbols of this type have already a destructor (resp. printer),
then raise a warning.
* tests/input.at (Useless printers or destructors): New.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agotests: do not output m4 set up.
Akim Demaille [Tue, 26 Jun 2012 12:05:56 +0000 (14:05 +0200)] 
tests: do not output m4 set up.

* tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
Use a diversion to avoid outputting comments etc.
Removes 17k lines from testsuite (10% of the number of lines).

12 years agotests: use the generic yyerror function.
Akim Demaille [Tue, 26 Jun 2012 09:54:13 +0000 (11:54 +0200)] 
tests: use the generic yyerror function.

* tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Factor.
Use AT_YYERROR_DEFINE.
Therefore, instead of using stdout, use and check stderr.
* tests/glr-regression.at (Uninitialized location when reporting ambiguity):
Use AT_YYERROR_DEFINE.

12 years agotests: use assert instead of plain abort.
Akim Demaille [Tue, 26 Jun 2012 08:20:35 +0000 (10:20 +0200)] 
tests: use assert instead of plain abort.

* tests/actions.at, tests/calc.at, tests/conflicts.at,
* tests/cxx-type.at, tests/glr-regression.at, tests/input.at,
* tests/named-refs.at, tests/regression.at, tests/torture.at,
* tests/local.at:
Prefer assert to abort.