]> git.saurik.com Git - bison.git/log
bison.git
12 years agoMerge branch 'maint'
Akim Demaille [Thu, 4 Oct 2012 15:16:00 +0000 (17:16 +0200)] 
Merge branch 'maint'

* origin/maint:
  maint: word changes
  lalr1.cc: fix test suite portability
  maint: fix an erroneous include
  tests: check that headers are self contained
  doc: add missing documentation for --report

Conflicts:
NEWS
data/location.cc

12 years agoscan-skel: use the scanner to reject all invalid directives
Akim Demaille [Thu, 4 Oct 2012 13:36:00 +0000 (15:36 +0200)] 
scan-skel: use the scanner to reject all invalid directives

* src/scan-skel.l: Use a simpler and more consistent pattern escaping
scheme.
Catch all the invalid directives here by just removing the previous
catch-all-but-alphabetical rule.

12 years agoscan-skel: recognize the @directives directly in scanner
Theophile Ranquet [Thu, 4 Oct 2012 13:23:40 +0000 (15:23 +0200)] 
scan-skel: recognize the @directives directly in scanner

* src/scan-skel.l (at_directive, at_init): New.
(at_ptr): New, function pointer used to call the right at_directive
function (at_basename, etc.).
(outname): Rename as...
(out_name): this, for consistency with out_lineno.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoscan-skel: split @directive functions
Theophile Ranquet [Thu, 4 Oct 2012 13:12:56 +0000 (15:12 +0200)] 
scan-skel: split @directive functions

* src/scan-skel.l (at_directive_perform): Split as...
(at_basename, at_complain, at_output): these.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoerrors: support indented context info in m4 macros
Theophile Ranquet [Thu, 4 Oct 2012 10:35:42 +0000 (10:35 +0000)] 
errors: support indented context info in m4 macros

* TODO: Address the issue, so remove it.
* data/bison.m4: Use b4_error with [[note]] rather than a complain_at
for context information.
* src/complain.c (complain_args): Take an additional argument, an
indentation pointer, to allow the dispatching of context information.
* src/complain.h (complain_args): Adjust prototype.
* src/scan-skel.l (at_directive_perform): Recognize the new @note mark.
* tests/input.at: Adjust.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoerrors: factor b4_error @directives
Theophile Ranquet [Thu, 4 Oct 2012 10:35:41 +0000 (10:35 +0000)] 
errors: factor b4_error @directives

Instead of @complain, @warn, and @fatal, use a unique @complain
directive. This directive's first argument is "complain", "warn", etc.

* data/bison.m4 (m4_error): Here.
* src/scan-skel.l (at_directive_perform): Adjust.
(flag): Replace the switch by safer and more explicit if branches.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoerrors: pointerize complain_at_indent
Theophile Ranquet [Thu, 4 Oct 2012 10:35:40 +0000 (10:35 +0000)] 
errors: pointerize complain_at_indent

* src/complain.c (complain_at_indent): Rename as...
(complaint_indent): This, and take the location as a pointer.
* src/complain.h, src/muscle-tab.c, src/reader.c, src/scan-code.l,
src/symtab.c: Adjust.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agomaint: word changes
Akim Demaille [Thu, 4 Oct 2012 09:45:09 +0000 (11:45 +0200)] 
maint: word changes

* README-hacking (Typical errors): Improve wording.

12 years agolalr1.cc: fix test suite portability
Akim Demaille [Thu, 4 Oct 2012 07:07:42 +0000 (09:07 +0200)] 
lalr1.cc: fix test suite portability

Reported by Rob Vermaas' Hydra build farm on x86_64-darwin 10.2.0 with
G++ 4.6.3.

* tests/headers.at (Several parsers): Include AT_DATA_SOURCE_PROLOGUE
in the files to compile.
* data/location.cc: Do not include twice string and iostream (once
by position.hh, and then by location.hh).
* README-hacking (Typical errors): Some hints for other maintainers.

12 years agomaint: fix an erroneous include
Theophile Ranquet [Wed, 3 Oct 2012 15:26:56 +0000 (15:26 +0000)] 
maint: fix an erroneous include

This fixes test 130 (Several parsers).

* data/location.cc: Include <iostream> rather than <iosfwd> since
we really need << on strings for instance.
* NEWS: Document this.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agotests: check that headers are self contained
Akim Demaille [Wed, 3 Oct 2012 07:17:58 +0000 (09:17 +0200)] 
tests: check that headers are self contained

Reported by Alexandre Duret-Lutz.

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

12 years agodoc: add missing documentation for --report
Akim Demaille [Wed, 3 Oct 2012 06:43:10 +0000 (08:43 +0200)] 
doc: add missing documentation for --report

* doc/bison.texi (Bison Options): Document --report's "solved", "all",
and "none".

12 years agobuild: use gnulib's non-recursive-gnulib-prefix-hack
Akim Demaille [Mon, 1 Oct 2012 15:42:39 +0000 (17:42 +0200)] 
build: use gnulib's non-recursive-gnulib-prefix-hack

Suggested by Jim Meyering.

* etc/prefix-gnulib-mk: Remove, as it is now provided by...
* bootstrap.conf (modules): the non-recursive-gnulib-prefix-hack module.
* build-aux/.gitignore, configure.ac, m4/.gitignore: Adjust.

12 years agowarnings: simplify the m4 interface
Akim Demaille [Mon, 1 Oct 2012 14:47:50 +0000 (16:47 +0200)] 
warnings: simplify the m4 interface

* data/bison.m4 (error_at): Replace...
(error): this.
(b4_warn, b4_complain, b4_fatal): Bounce to their _at equivalent,
with empty location.
* src/scan-skel.l (at_directive_perform): Simplify accordingly.

12 years agowarnings: separate flags_argmatch
Theophile Ranquet [Mon, 1 Oct 2012 15:01:03 +0000 (15:01 +0000)] 
warnings: separate flags_argmatch

This function is now a mere iterator that calls flag_argmatch,
a new function, that matches a single option parameter.

* src/getargs.c (flag_argmatch): New, taken from...
(flags_argmatch): Here.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agowarnings: refactoring
Theophile Ranquet [Mon, 1 Oct 2012 15:01:02 +0000 (15:01 +0000)] 
warnings: refactoring

The code here was too confusing, this seems more natural.

* src/complain.c (error_message): Move the indentation check and the category
output to complains. Also, no longer take a 'warnings' argument.
(complains): Factor calls to error_message.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoformatting changes
Theophile Ranquet [Mon, 1 Oct 2012 15:01:01 +0000 (15:01 +0000)] 
formatting changes

* src/complain.c: Here.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agowarnings: organize variadic complaints call
Theophile Ranquet [Mon, 1 Oct 2012 15:01:00 +0000 (15:01 +0000)] 
warnings: organize variadic complaints call

Move the dispatch of variadic complains to complain.c, rather than do
it in a scanner.

* src/complain.h, src/complain.c (complain_args): New.
* src/scan-skel.l (at_directive_perform): Use it.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agowarnings: fusion of complain and complain_at
Theophile Ranquet [Mon, 1 Oct 2012 13:44:20 +0000 (13:44 +0000)] 
warnings: fusion of complain and complain_at

These functions are very similar, and keeping them seperate makes
future improvements difficult, so merge them.

This impacts 89 calls.

* src/bootstrap.conf: Adjust.
* src/complain.c (complain, complain_at): Merge into...
(complain): this.
(complain_args): Adjust.
* src/complain.h, src/conflicts.c, src/files.c, src/getargs.c,
* src/gram.c, src/location.c, src/muscle-tab.c, src/parse-gram.y,
* src/reader.c, src/reduce.c, src/scan-code.l, src/scan-gram.l,
* src/scan-skel.l, src/symlist.c, src/symtab.c:
Adjust.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agowarnings: remove spurious suffixes on context
Theophile Ranquet [Mon, 1 Oct 2012 13:44:19 +0000 (13:44 +0000)] 
warnings: remove spurious suffixes on context

Rectify a bug that introduced suffixes out of place.

* src/complainc.c (complains): Handle all three special warning bits.
* src/scan-code.l (show_sub_message): Remove useless argument.
* tests/named-refs.at: Adjust.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Mon, 1 Oct 2012 12:00:23 +0000 (14:00 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  headers: move CPP guards into YY_*_INCLUDED to avoid collisions
  minor changes.

Conflicts:
doc/bison.texi
tests/headers.at

12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Fri, 28 Sep 2012 13:28:46 +0000 (15:28 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  gnulib: update
  errors: indent "user token number redeclaration" context

Conflicts:
src/symtab.c

12 years agoheaders: move CPP guards into YY_*_INCLUDED to avoid collisions
Akim Demaille [Thu, 27 Sep 2012 07:43:49 +0000 (09:43 +0200)] 
headers: move CPP guards into YY_*_INCLUDED to avoid collisions

See <http://lists.gnu.org/archive/html/bug-bison/2012-09/msg00016.html>.

* data/c.m4 (b4_cpp_guard): Prepend YY_ and append _INCLUDED.
* tests/headers.at: Adjust.
* NEWS, doc/bison.texi: Document.

12 years agominor changes.
Akim Demaille [Thu, 27 Sep 2012 07:42:57 +0000 (09:42 +0200)] 
minor changes.

* NEWS: Word changes.
* doc/bison.texi: Spell check.
Fix minor issues.
* tests/headers.at: Comment and formatting changes.

12 years agognulib: update
Akim Demaille [Fri, 28 Sep 2012 13:04:57 +0000 (15:04 +0200)] 
gnulib: update

12 years agoerrors: indent "user token number redeclaration" context
Theophile Ranquet [Fri, 28 Sep 2012 12:12:59 +0000 (12:12 +0000)] 
errors: indent "user token number redeclaration" context

This is the continuation of the work on the readability of errors
context.

* src/symtab.c (user_token_number_redeclaration): Use
complain_at_indent to output with increased indentation level.
* tests/input:at: Apply this change.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoerrors: don't display "warnings treated as errors"
Theophile Ranquet [Thu, 27 Sep 2012 10:52:47 +0000 (10:52 +0000)] 
errors: don't display "warnings treated as errors"

This line doesn't add any meaningful information anymore, the appended
[-Werror=CATEGORY] is enough.  It is actually more insightful, as it
allows to distinguish warnings treated as errors from those that
aren't.  This line is also removed by gcc 4.8.

* src/complain.c (set_warnings_issued): The only action left was
checking if the error bit corresponding to the warning issued was set,
and that function was only called once. Therefore, remove it, and do
its job directly in the caller...
(complains): here.
* src/complains.h: Adjust.
* tests/input.at: Adjust.
* NEWS: Document this change.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoerrors: change output, and improve -y coherence
Akim Demaille [Thu, 27 Sep 2012 10:19:09 +0000 (12:19 +0200)] 
errors: change output, and improve -y coherence

The prefix of warnings treated as errors is now "error: ". Also, their
suffix now reflects the changes in the Werror option format.

An output for -Werror=other used to be:
  bison: warnings being treated as errors
  input.y:1.1: warning: stray ',' treated as white space [-Wother]

It is now:
  bison: warnings being treated as errors
  input.y:1.1: error: stray ',' treated as white space [-Werror=other]

The line "warnings being treated as errors" no longer adds any info,
it will be removed in a forthcoming change.

* NEWS: Add entry "Enhancement of the -Werror"
* doc/bison.texi: Move the warnings-as-error to a new bullet.
* src/complain.c (complains): Refactor, change the prefix of warnings
that are treated as errors.
(warnings_print_categories): Support for [-Werror=CATEGORY] display
* src/getargc.c (getargs): -y implies -Werror=yacc
* tests/input.at: Update expected --yacc output for coherence.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoerrors: introduce the -Werror=CATEGORY option
Theophile Ranquet [Thu, 27 Sep 2012 10:52:45 +0000 (10:52 +0000)] 
errors: introduce the -Werror=CATEGORY option

This new option is a lot more flexible than the previous one. Its
details will be discussed in the NEWS and info file, in a forthcoming
change.

If no category is specified (ie: used as simply "-Werror"), the
functionality is the same as before.

* src/complain.c (errors_flag): New variable.
(set_warning_issued): Accept warning categories as an argument.
* src/complain.h (Wall): Better definition.
* src/getargs.c (flags_argmatch): Support for the new format.
(usage): Update -Werror to -Werror[=CATEGORY] format.

* src/complain.c (errors_flag): New variable.
(set_warning_issued): Accept warning categories as an argument.
* src/complain.h (Wall): Better definition.
* src/getargs.c (flags_argmatch): Support for the new format.
(usage): Update -Werror to -Werror=[CATEGORY] format.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoMerge branch 'maint'
Akim Demaille [Wed, 26 Sep 2012 12:35:47 +0000 (14:35 +0200)] 
Merge branch 'maint'

* maint:
  warnings: introduce -Wdeprecated in the usage info
  errors: prefix the output with "error: "
  errors: indent "invalid value for %define" context
  errors: indent "%define var" redefinition context
  errors: indent "symbol redeclaration" context
  errors: indent "result type clash" error context

Conflicts:
src/complain.c
src/muscle-tab.c
src/reader.c
src/symtab.c
tests/conflicts.at
tests/input.at
tests/named-refs.at
tests/output.at
tests/skeletons.at

12 years agowarnings: introduce -Wdeprecated in the usage info
Theophile Ranquet [Wed, 26 Sep 2012 09:49:23 +0000 (11:49 +0200)] 
warnings: introduce -Wdeprecated in the usage info

The deprecated warning, introduced some time ago, was not displayed in
the usage message. This patch addresses the issue.

* src/getargs.c (usage): Insert here.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoregen
Akim Demaille [Wed, 26 Sep 2012 10:20:44 +0000 (12:20 +0200)] 
regen

12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Wed, 26 Sep 2012 10:19:15 +0000 (12:19 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  regen
  yacc: fix handling of CPP guards when no header is generated
  gnulib: update

12 years agoerrors: prefix the output with "error: "
Theophile Ranquet [Wed, 26 Sep 2012 09:49:22 +0000 (11:49 +0200)] 
errors: prefix the output with "error: "

This improves readability. This is also what gcc does.

* NEWS: Document this change.
* src/complain.c (complain_at): Prefix all errors with "error: ".
(complain_at_indent, warn_at_indent): Do not prefix the context
information of errors, which are basically just indented errors.
* tests/conflicts.at, tests/glr-regression.at, tests/input.at,
tests/named-refs.at, tests/output.at, tests/push.at,
tests/regression.at, tests/skeletons.at: Apply this change.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoerrors: indent "invalid value for %define" context
Theophile Ranquet [Wed, 26 Sep 2012 09:49:21 +0000 (11:49 +0200)] 
errors: indent "invalid value for %define" context

This is the continuation of the work on the readability of errors
    context.

For example, what used to be:
  input.y:1.9-29: invalid value for %define variable 'foo' : 'bar'
  input.y:1.9-29: accepted value: 'most'

is now:
  input.y:1.9-29: invalid value for %define variable 'foo' : 'bar'
  input.y:1.9-29:     accepted value: 'most'

* src/muscle-tab.c (muscle_percent_define_check_values): Use
complain_at_indent to output with increased indentation level.
* tests/input:at: Apply this change.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoerrors: indent "%define var" redefinition context
Theophile Ranquet [Wed, 26 Sep 2012 09:49:20 +0000 (11:49 +0200)] 
errors: indent "%define var" redefinition context

This is the continuation of the work on the readability of errors
context.

For example, what used to be:
  input.y:2.9-11: %define variable 'var' redefined
  input.y:1.9-11: previous definition

is now:
  input.y:2.9-11: %define variable 'var' redefined
  input.y:1.9-11:     previous definition

* src/muscle-tab.c (muscle_percent_define_insert): Use
complain_at_indent to output with increased indentation level.
* tests/input.at: Apply this change.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoerrors: indent "symbol redeclaration" context
Theophile Ranquet [Wed, 26 Sep 2012 09:49:19 +0000 (11:49 +0200)] 
errors: indent "symbol redeclaration" context

This is the continuation of the work on the readability of errors
context.

For example, what used to be:
  input.y:5.10-24: %printer redeclaration for <field2>
  input.y:3.11-25: previous declaration

is now:
  input.y:5.10-24: %printer redeclaration for <field2>
  input.y:3.11-25:     previous declaration

* NEWS: Document this change.
* src/symtab.c (symbol_redeclaration, semantic_type_redeclaration,
user_token_number_redeclaration, default_tagged_destructor_set,
default_tagless_destructor_set, default_tagged_printer_set,
default_tagless_printer_set): Use complain_at_indent to
output with increased indentation level.
* tests/input.at: Apply this change.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agoerrors: indent "result type clash" error context
Theophile Ranquet [Wed, 26 Sep 2012 09:49:18 +0000 (11:49 +0200)] 
errors: indent "result type clash" error context

This used to be the format of the error report:

  input.y:6.5-10: result type clash on merge function 'merge': [...]
  input.y:2.4-9: previous declaration

In order to distinguish the actual error from the context provided, we
rather this new output:

  input.y:6.5-10: result type clash on merge function 'merge': [...]
  input.y:2.4-9:     previous declaration

Another patch will introduce an "error: " prefix to all non-indented
lines, giving yet better readability to the reports.

* src/complain.h (SUB_INDENT): Move to here.
* src/reader.c (record_merge_function_type): Use complain_at_indent to
output with increased indentation level.
* src/scan-code.l (SUB_INDENT): Remove from here.
* tests/glr-regression.at: Apply this change.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
12 years agowarnings: use the regular interface for s/r and r/r conflicts
Akim Demaille [Fri, 21 Sep 2012 15:21:01 +0000 (17:21 +0200)] 
warnings: use the regular interface for s/r and r/r conflicts

The current routines used to display s/r and r/r conflicts are both
inconvenient from the programmer point of view (they do not use the
warning infrastructure) and for the user (the messages are rather
terse, not necessarily pleasant to read, and because they don't use
the same routines, they look different).

It was due to the belief (dating back to the initial checked-in
version of Bison) that, at some point, POSIX Yacc mandated the format
for these messages.  Today, the Open Group's manual page for Yacc,
<http://pubs.opengroup.org/onlinepubs/009695399/utilities/yacc.html>,
explicitly states that the format of these messages is unspecified.
See commit be7280480c175bed203883f524c7dcd6cf37c13d and
<http://lists.gnu.org/archive/html/bison-patches/2002-12/msg00027.html>.

For a discussion on the chosen warning format, see
http://lists.gnu.org/archive/html/bison-patches/2012-09/msg00039.html

In an effort to factor the handling of errors and warnings, use the
Bison warning routines to report these messages.

* src/conflicts.c (conflicts_print): Rewrite with clearer sections
about S/R and then R/R conflicts.
(conflict_report): Remove, inlined in its sole
caller...
(conflicts_output): here.
* tests/conflicts.at, tests/existing.at, tests/glr-regression.at,
* tests/reduce.at, tests/regression.at: Adjust the expected results.
* NEWS: Update.

12 years agoregen
Akim Demaille [Fri, 21 Sep 2012 11:35:28 +0000 (13:35 +0200)] 
regen

12 years agoyacc: fix handling of CPP guards when no header is generated
Akim Demaille [Fri, 21 Sep 2012 09:10:37 +0000 (11:10 +0200)] 
yacc: fix handling of CPP guards when no header is generated

When no header was to be generated, Bison would issue:

  /* In a future release of Bison, this section will be replaced
     by #include "".  */
  #ifndef YY_
  # define YY_

It now properly generates nothing.

* data/c.m4 (b4_cpp_guard_open, b4_cpp_guard_close): Issue nothing when
the file name is empty.
* data/yacc.c: Do not generate the above comment when there is no header
to generate.
* NEWS: Update.

12 years agognulib: update
Akim Demaille [Thu, 20 Sep 2012 15:04:55 +0000 (17:04 +0200)] 
gnulib: update

12 years agoconflicts: refactor the counting routines
Akim Demaille [Fri, 21 Sep 2012 13:44:47 +0000 (15:44 +0200)] 
conflicts: refactor the counting routines

* src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Rename as...
(count_sr_conflicts, count_rr_conflicts): these.
Use size_t for counts.
(count_sr_conflicts, count_rr_conflicts): New.
Use them.

12 years ago%expect-rr is for GLR only
Akim Demaille [Fri, 21 Sep 2012 13:19:12 +0000 (15:19 +0200)] 
%expect-rr is for GLR only

* src/conflicts.c (conflicts_print): Complain about %expect-rr if not
in GLR mode, regardless of the number of reduce/reduce conflicts.
* tests/conflicts.at (%expect-rr non GLR): New test.
* NEWS: Update.

12 years agoTODO: lalr1.cc master vs maint
Akim Demaille [Thu, 20 Sep 2012 15:17:02 +0000 (17:17 +0200)] 
TODO: lalr1.cc master vs maint

* TODO: here.

12 years agoc++: coding style fixes
Akim Demaille [Thu, 20 Sep 2012 15:16:36 +0000 (17:16 +0200)] 
c++: coding style fixes

* data/lalr1.cc, tests/c++.at: Formatting changes.

12 years agoRevert "introduced a GCC-like -Werror=type"
Akim Demaille [Fri, 21 Sep 2012 07:15:45 +0000 (09:15 +0200)] 
Revert "introduced a GCC-like -Werror=type"

This reverts commit 981c53e257f1974854edc4f6ad0e88c7f18e2bea.

12 years agoRevert "made previous commit less hairy"
Akim Demaille [Fri, 21 Sep 2012 07:15:37 +0000 (09:15 +0200)] 
Revert "made previous commit less hairy"

This reverts commit fd01e1d05ea3e627033d148b5400b99a18ac7ba3.

12 years agoRevert "new Werror report format fixed in a test"
Akim Demaille [Fri, 21 Sep 2012 07:15:25 +0000 (09:15 +0200)] 
Revert "new Werror report format fixed in a test"

This reverts commit 41511178a71ebaf81bde7ffc682c575537af45cb.

12 years agonew Werror report format fixed in a test
Theophile Ranquet [Fri, 21 Sep 2012 03:04:43 +0000 (05:04 +0200)] 
new Werror report format fixed in a test

* tests/input.at : replaced [-Wyacc] with [-Werror=yacc]

todo: fix the other failed test of the suite, tests/conflicts.at:1554

12 years agomade previous commit less hairy
Theophile Ranquet [Fri, 21 Sep 2012 03:00:32 +0000 (05:00 +0200)] 
made previous commit less hairy

* src/getargs.c : here

12 years agointroduced a GCC-like -Werror=type
Theophile Ranquet [Thu, 20 Sep 2012 10:21:28 +0000 (12:21 +0200)] 
introduced a GCC-like -Werror=type

* src/complain.h : errors_flag variable
* src/complain.c : actual stuff happens here
* src/conflits.c : differentiated SR and RR conflicts
* src/getargs.c : flags_argmatch recognizes the new -Werror format

12 years agoregen
Akim Demaille [Tue, 4 Sep 2012 16:53:45 +0000 (18:53 +0200)] 
regen

12 years agoMerge remote-tracking branch 'origin/maint'
Akim Demaille [Tue, 4 Sep 2012 16:51:55 +0000 (18:51 +0200)] 
Merge remote-tracking branch 'origin/maint'

* origin/maint:
  maint: remove useless file
  update files to ignore
  remove useless include
  use locale-indep. c_is* functions for parsing, not isspace, isprint etc
  gnulib: update
  --help: include a place to report translation issues
  tests: style changes
  tests: fix push-pull test
  yacc.c: style changes

Conflicts:
src/system.h

12 years agomaint: remove useless file
Akim Demaille [Tue, 4 Sep 2012 08:58:23 +0000 (10:58 +0200)] 
maint: remove useless file

* externals/bootstrap.cfg: Remove.
This file was used by a specific build system.
It was added to the master repository by accident.

12 years agoupdate files to ignore
Akim Demaille [Tue, 4 Sep 2012 08:48:26 +0000 (10:48 +0200)] 
update files to ignore

* doc/.gitignore: Don't ignore split info files as we don't split our
info file.
See <http://lists.gnu.org/archive/html/bug-bison/2012-08/msg00006.html>.

12 years agoremove useless include
Akim Demaille [Tue, 4 Sep 2012 07:49:17 +0000 (09:49 +0200)] 
remove useless include

* src/system.h: Don't include sys/types.h.
Reported by Eric Blake,
<http://lists.gnu.org/archive/html/bug-bison/2012-09/msg00002.html>.
(FUNCTION_PRINT): Remove, unused.

12 years agouse locale-indep. c_is* functions for parsing, not isspace, isprint etc
Jim Meyering [Sun, 5 Aug 2012 11:28:01 +0000 (13:28 +0200)] 
use locale-indep. c_is* functions for parsing, not isspace, isprint etc

* src/parse-gram.y: Include "c-ctype.h".
(add_param): Parse with c_isspace, not isspace.
* src/parse-gram.c: Likewise.
* src/scan-gram.l: Include c-ctype.h, not ctype.h.
(SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER): Use c_isspace and c_isprint,
not ctype.h's locale-dependent functions.

12 years agognulib: update
Akim Demaille [Mon, 3 Sep 2012 08:56:54 +0000 (10:56 +0200)] 
gnulib: update

12 years ago--help: include a place to report translation issues
Akim Demaille [Fri, 31 Aug 2012 16:18:13 +0000 (18:18 +0200)] 
--help: include a place to report translation issues

http://lists.gnu.org/archive/html/bug-bison/2012-08/msg00007.html
shows that it is useful to help users report translation issues.
While at it, include other informative bits that the coreutils shows.

* src/getargs.c (usage): Report more URLs where the user can
refer to.
Mostly copied/pasted from coreutils' emit_ancillary_info function.

12 years agonews: style changes
Akim Demaille [Wed, 22 Aug 2012 10:31:41 +0000 (12:31 +0200)] 
news: style changes

* NEWS: Minor improvements.

12 years agouse -Wdeprecated for obsolete %define variable names
Akim Demaille [Mon, 20 Aug 2012 07:54:40 +0000 (09:54 +0200)] 
use -Wdeprecated for obsolete %define variable names

* src/muscle-tab.c (muscle_percent_variable_update): Here.
* tests/input.at (%define backward compatibility): Update expectations.

12 years agointroduce -Wdeprecated
Akim Demaille [Mon, 20 Aug 2012 07:29:05 +0000 (09:29 +0200)] 
introduce -Wdeprecated

GCC seems to be using "deprecated" consistently over "obsoleted", so
use -Wdeprecated rather than -Wobsolete.

* src/complain.h (warnings): Add Wdeprecated.
* src/complain.c (warnings_print_categories): Adjust.
* src/getargs.c: Likewise.
* doc/bison.texi: Document it.

* src/scan-code.l: Use this category for the trailing ';' support.
* tests/actions.at: Adjust expected output.

12 years agoundefined but unused is a warning
Akim Demaille [Wed, 15 Aug 2012 07:44:34 +0000 (09:44 +0200)] 
undefined but unused is a warning

* src/symtab.c (symbol_check_defined): Undeclared symbols are only
a warning.
* tests/input.at (Undeclared symbols used for a printer or destructor):
Rename as...
(Undefined symbols): this, and check this case.
* NEWS: Doc it.

12 years agoglr.cc: %defines is no longer mandatory
Akim Demaille [Wed, 15 Aug 2012 06:46:54 +0000 (08:46 +0200)] 
glr.cc: %defines is no longer mandatory

* data/glr.cc: No longer require %defines.
When it is not given, define the position and location classes instead
of including their headers.
(b4_shared_declarations): Use the original parse-params.
* data/glr.c (b4_shared_declarations): Define only if undefined.
* tests/actions.at, tests/calc.at: No longer force the use of %defines
for glr.cc.
* NEWS: Doc it.

12 years agotodo: check push parsers
Akim Demaille [Mon, 3 Sep 2012 14:19:00 +0000 (16:19 +0200)] 
todo: check push parsers

12 years agostyle: remove useless C++ provisio
Akim Demaille [Mon, 20 Aug 2012 07:15:01 +0000 (09:15 +0200)] 
style: remove useless C++ provisio

* src/complain.h: here.

12 years agoparser: style changes
Akim Demaille [Mon, 20 Aug 2012 07:09:43 +0000 (09:09 +0200)] 
parser: style changes

* src/parse-gram.y: Avoid deprecated directives.

12 years agodoc: address a fixme
Akim Demaille [Mon, 20 Aug 2012 07:09:04 +0000 (09:09 +0200)] 
doc: address a fixme

* doc/bison.texi (Calc++ Parser): Add a cross-reference.

12 years agostyle changes
Akim Demaille [Tue, 14 Aug 2012 08:04:27 +0000 (10:04 +0200)] 
style changes

* data/glr.cc, tests/actions.at: Fix comments.
* src/symtab.h, src/symtab.c: Fix indentation/comments.
* src/symlist.c: Fix indentation.

12 years agotests: style changes
Akim Demaille [Wed, 22 Aug 2012 12:26:26 +0000 (14:26 +0200)] 
tests: style changes

* tests/torture.at (AT_DATA_STACK_TORTURE): M4 style changes to
improve readability.
Fix an assertion which, because of a <= instead of ==, did not check
new_status as visibly meant.
(get_args): New.

12 years agotests: fix push-pull test
Akim Demaille [Wed, 22 Aug 2012 11:48:55 +0000 (13:48 +0200)] 
tests: fix push-pull test

* tests/torture.at: %push-pull-parser is no longer supported.

12 years agoyacc.c: style changes
Akim Demaille [Fri, 31 Aug 2012 15:50:31 +0000 (17:50 +0200)] 
yacc.c: style changes

* data/yacc.c: (yytoken): Define with initial value.

12 years agorefactoring: define variables with a value
Akim Demaille [Sat, 11 Aug 2012 07:44:17 +0000 (09:44 +0200)] 
refactoring: define variables with a value

* src/muscle-tab.c: Where possible, fuse definition and initial assignment.

12 years agominor refactoring: shorten variable names
Akim Demaille [Sat, 11 Aug 2012 07:16:08 +0000 (09:16 +0200)] 
minor refactoring: shorten variable names

* src/scan-skel.l (at_directive_argc, at_directive_argv)
(AT_DIRECTIVE_ARGC_MAX): Rename as...
(argc, argv, ARGC_MAX): these, as there is no possible confusion.
(flags): New.
(QPUTS): Remove, inline its only use.

12 years agoobstacks: simplifications
Akim Demaille [Sat, 11 Aug 2012 07:02:19 +0000 (09:02 +0200)] 
obstacks: simplifications

* src/system.h (obstack_finish0): New.
Use it to simplify several uses.
* src/muscle-tab.h (MUSCLE_INSERTF): New.
* src/muscle-tab.c: Use obstack_printf where simpler.

12 years agominor refactoring in user code scanning
Akim Demaille [Fri, 10 Aug 2012 08:11:32 +0000 (10:11 +0200)] 
minor refactoring in user code scanning

* src/scan-code.l (show_sub_message, show_sub_messages): Instead of a
Boolean, take a "warnings" argument.
Avoid storing printf-like format strings in a variable, so that GCC
can check them.

12 years agominor refactoring in user code scanning
Akim Demaille [Fri, 10 Aug 2012 08:02:16 +0000 (10:02 +0200)] 
minor refactoring in user code scanning

* src/scan-code.l (show_sub_message): New, extracted from...
(show_sub_messages): here.

12 years agotests: strengthen the trailing spaces check
Akim Demaille [Fri, 3 Aug 2012 09:16:03 +0000 (11:16 +0200)] 
tests: strengthen the trailing spaces check

* tests/calc.at: here.
* data/glr.c: Fix accordingly.

12 years agoregen
Akim Demaille [Fri, 3 Aug 2012 09:09:22 +0000 (11:09 +0200)] 
regen

12 years agoMerge branch 'maint'
Akim Demaille [Fri, 3 Aug 2012 08:52:55 +0000 (10:52 +0200)] 
Merge branch 'maint'

* origin/maint:
  maint: post-release administrivia
  version 2.6.2
  NEWS: update.
  yacc: remove trailing end of line at end of file
  thanks: fix a contributor name
  gnulib: update
  tests: synch line -> syncline, for consistency
  tests: synclines: style changes
  tests: synclines: fix perl invocation
  regen
  c++: trailing end-of-lines in %parse-param
  tests: simplify

Conflicts:
cfg.mk
data/glr.cc
data/yacc.c
src/parse-gram.c
src/parse-gram.h
src/parse-gram.y

12 years agoregen
Akim Demaille [Fri, 3 Aug 2012 06:13:11 +0000 (08:13 +0200)] 
regen

12 years agoremove support for lint
Akim Demaille [Fri, 3 Aug 2012 06:03:03 +0000 (08:03 +0200)] 
remove support for lint

Basically revert commit 12ce2df60d16961eaa03a5aa009eeaa645e4e1cb.
http://lists.gnu.org/archive/html/bison-patches/2012-08/msg00004.html

* data/c.m4, data/glr.c, data/yacc.c (YYID): Remove.
No longer use ARGSUSED.
* src/getargs.c: Restore simpler inclusion of getopt.h (anyway, since
then we now use gnulib which certainly protects us from such issues).

12 years agoskeletons: renamings after knr removal
Akim Demaille [Thu, 2 Aug 2012 13:13:00 +0000 (15:13 +0200)] 
skeletons: renamings after knr removal

* data/c.m4 (b4_yydestruct_generate, b4_yy_symbol_print_generate):
Rename as...
(b4_yydestruct_define, b4_yy_symbol_print_define): these, for consistency.
* data/glr.c, data/glr.cc, data/yacc.c: Adjust.

12 years agomaint: post-release administrivia
Akim Demaille [Fri, 3 Aug 2012 07:52:05 +0000 (09:52 +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.2 v2.6.2
Akim Demaille [Fri, 3 Aug 2012 07:43:02 +0000 (09:43 +0200)] 
version 2.6.2

* NEWS: Record release date.

12 years agoc++: fix a comment
Akim Demaille [Thu, 2 Aug 2012 12:19:40 +0000 (14:19 +0200)] 
c++: fix a comment

* data/c++.m4: Be sure to attach a ';' to its declaration, otherwise
it appears in the preceding comment.

12 years agoskeletons: simplify after knr removal
Akim Demaille [Thu, 2 Aug 2012 12:11:07 +0000 (14:11 +0200)] 
skeletons: simplify after knr removal

* data/c.m4 (b4_yydestruct_generate, b4_yy_symbol_print_generate):
They no longer need an argument, it has a single possible value.
* data/glr.c, data/yacc.c: Adjust.

12 years agoskeletons: renamings after knr removal
Akim Demaille [Thu, 2 Aug 2012 12:11:04 +0000 (14:11 +0200)] 
skeletons: renamings after knr removal

* data/c.m4 (b4_c_comment_, b4_c_args, b4_c_function_def)
(b4_c_function_decl, b4_c_formals, b4_c_call, b4_c_arg): Rename as...
(b4_comment, b4_args, b4_function_define, b4_function_declare,
b4_formals, b4_function_call, b4_arg): these.
* data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c: Adjust.

12 years agoskeletons: b4_args -> b4_join to prepare forthcoming changes
Akim Demaille [Thu, 2 Aug 2012 12:24:15 +0000 (14:24 +0200)] 
skeletons: b4_args -> b4_join to prepare forthcoming changes

* data/bison.m4 (b4_args, _b4_args): Rename as...
(b4_join, _b4_join): these.
* data/c++.m4, data/lalr1.cc, data/variant.hh: Adjust.

12 years agoregen
Akim Demaille [Thu, 2 Aug 2012 11:55:39 +0000 (13:55 +0200)] 
regen

12 years agoYYPARSE_PARAM: drop support
Akim Demaille [Thu, 2 Aug 2012 09:59:12 +0000 (11:59 +0200)] 
YYPARSE_PARAM: drop support

* data/yacc.c: No longer support it.
* doc/bison.texi, tests/headers.at: Adjust.
* NEWS: Document.

12 years agoskeletons: remove K&R C support
Akim Demaille [Thu, 2 Aug 2012 06:49:21 +0000 (08:49 +0200)] 
skeletons: remove K&R C support

* data/c.m4 (b4_c_modern, b4_c_knr_formal_names, b4_c_knr_formal_decls)
(b4_c_knr_formal_decl, b4_c_formal_names, b4_c_formal_decls)
(b4_c_formal_decl): Remove.
(b4_c_ansi_formal_names, b4_c_ansi_formal_decls, b4_c_ansi_formal_decl):
Rename as...
(b4_c_formal_names, b4_c_formal_decls, b4_c_formal_decl):
these.
* data/glr.c, data/glr.cc, data/yacc.c: Adjust.

12 years agoNEWS: update.
Akim Demaille [Thu, 2 Aug 2012 11:51:17 +0000 (13:51 +0200)] 
NEWS: update.

* NEWS: Catch up with the other changes from 2.6.1.

12 years agoyacc: remove trailing end of line at end of file
Akim Demaille [Thu, 2 Aug 2012 10:01:54 +0000 (12:01 +0200)] 
yacc: remove trailing end of line at end of file

There are still spurious spaces at the end of some lines.  But this is
addressed in the master branch, and I am reluctant to try to backport
this.

* data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: here.
* tests/calc.at (AT_CHECK_SPACES): New.
Use it.
Be sure not to introduce trailing empty lines in the *.y files.
* NEWS: Doc it.
* cfg.mk (syntax-check): Remove the exception.

12 years agothanks: fix a contributor name
Akim Demaille [Thu, 2 Aug 2012 06:29:18 +0000 (08:29 +0200)] 
thanks: fix a contributor name

* THANKS: On his request.

12 years agognulib: update
Akim Demaille [Wed, 1 Aug 2012 07:59:49 +0000 (09:59 +0200)] 
gnulib: update

12 years agotests: synch line -> syncline, for consistency
Akim Demaille [Wed, 1 Aug 2012 06:27:28 +0000 (08:27 +0200)] 
tests: synch line -> syncline, for consistency

* tests/synclines.at: Do it, as "syncline" is used consistently
everywhere else in Bison.

12 years agotests: synclines: style changes
Akim Demaille [Wed, 1 Aug 2012 07:30:27 +0000 (09:30 +0200)] 
tests: synclines: style changes

* tests/synclines.at (AT_TEST_SYNCLINE): Rename as...
(AT_TEST): this.
Use pushdef/popdef.
Formatting changes.
Use '+' instead of '*' where appropriate.

12 years agotests: synclines: fix perl invocation
Akim Demaille [Wed, 1 Aug 2012 07:30:23 +0000 (09:30 +0200)] 
tests: synclines: fix perl invocation

Reported by Summum Bonum.

* tests/synclines.at: Fix Perl invocation: its -f is not like sed's.