Commit Graph

175 Commits

Author SHA1 Message Date
Akim Demaille
28f1e1546c C++: finish propagating the unsigned->signed conversion in locations
* data/skeletons/location.cc: Remove the u (for unsigned) suffix from
the initial line and column.
* NEWS: AFAICT, only C++ backends have their location types changed.
2019-10-29 09:15:25 +01:00
Yuichiro Kaneko
3945beb1d2 style: update comment in reader.c
rrhs and rlhs were removed by b2ed6e5826.

* src/reader.c (packgram): Update comment.
2019-10-23 08:32:06 +02:00
Akim Demaille
b47340982b TODO: more updates 2019-10-15 08:40:50 +02:00
Akim Demaille
ee35055b49 TODO: update 2019-10-15 07:28:33 +02:00
Paul Eggert
6373b90fc8 Port better to C++ platforms
* data/skeletons/yacc.c (YYPTRDIFF_T, YYPTRDIFF_MAXIMUM):
Default to long, not int.
(yy_lac_stack_realloc, yy_lac, yytnamerr, yyparse):
Avoid casts to YYPTRDIFF_T that were masking the problem.
2019-10-06 11:59:16 -07:00
Paul Eggert
beceb2fa93 Work around GCC 4.8 false alarms without casts
* data/skeletons/yacc.c (yyparse):
Initialize yyes_capacity with a signed expression.
* tests/local.at (AT_YYLEX_DEFINE(c)):
Use enum to avoid cast.
2019-10-06 11:59:16 -07:00
Akim Demaille
2713e7c4ff TODO: update
I no longer agree with that item, there are indeed two things to
report: lack of definition, and being useless.  We could have either
one without the other, they are not directly related.
2019-10-06 08:07:57 +02:00
Akim Demaille
32e5a91a91 yacc.c: work around warnings from G++ 4.8
input.c: In function 'int yyparse()':
input.c: error: conversion to 'long int' from 'long unsigned int'
                may change the sign of the result [-Werror=sign-conversion]
   yyes_capacity = sizeof yyesa / sizeof *yyes;
                                ^
cc1plus: all warnings being treated as errors

* data/skeletons/yacc.c: here.
2019-10-06 08:07:40 +02:00
Akim Demaille
3ca713abd0 api.token.raw: document it
* doc/bison.texi: here.
2019-09-14 10:09:08 +02:00
Akim Demaille
29c9cb3188 lr0: more debug traces
* src/lr0.c (kernel_check): New.
(new_itemsets, save_reductions): Add traces.
2019-06-09 11:11:12 +02:00
Akim Demaille
ec4d49e129 traces: add some colors
This is an experiment.  Maybe more styles will be used (in which case
a short-hand function will be useful), maybe it will be just reverted.
* data/bison-default.css (.traces0): New.
* src/lalr.c (lalr): Use it.
2019-06-09 08:36:01 +02:00
Akim Demaille
57290d63fd package: various fixes for syntax-check
* cfg.mk: Disable checks where needed (e.g., we do want to check the
behavior with tabs).
(sc_at_parser_check): Remove.  Unfortunately since
a11c144609 we no longer use the './'
prefix to run programs in the current directory.  That was so that we
could run Java programs like the other, although they are no run with
the `./` prefix (see 967a59d2c0).
As a consequence this sc check no longer makes sense.
However, since now AT_PARSER_CHECK passes the `./` prefix itself, this
sc-check was superfluous.
* examples/c/reccalc/scan.l: Use memcpy, not strncpy.
* src/ielr.c, src/reader.c: Obfuscate "lr(0)" so that the sc-check for
"space before paren" does not fire.
* tests/diagnostics.at: Avoid space-tab, use tab-tab.
2019-04-28 08:24:31 +02:00
Akim Demaille
f5a4e279bc build: use gettext-h
We were using the gnulib's gettext module with tricks in
bootstrap.conf to avoid useless files.  Instead, use gnulib's
gettext-h module.

* .travis.yml: Force Gettext 0.18.3 on Trusty.
* bootstrap.conf: Use gettext-h instead of gettext.
(excluded_files): Remove.
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.
2019-04-25 22:09:41 +02:00
Akim Demaille
a4d33cdf48 gnulib: let it use its own PO domain
See
https://www.gnu.org/software/gnulib/manual/html_node/Localization.html.

* bootstrap.conf: Create gnulib-po.
* Makefile.am, configure.ac: Use it.
* po/POTFILES.in: Remove files now in gnulib.
* src/main.c: Open the bison-gnulib domain.
2019-04-23 19:28:08 +02:00
Akim Demaille
deec7ca65c TODO: update
Let's prepare 3.4 with more or less what we have.  Schedule some
features for 3.5 and 3.6.  Remove obsolete stuff.
2019-04-23 18:25:30 +02:00
Akim Demaille
2ab70cf0c6 style: comment changes
* src/closure.h, src/closure.c, src/lalr.c: here.
2019-04-12 08:38:30 +02:00
Akim Demaille
40fc688765 examples: add a simple infix calculator in C
Currently we have no simple example: rpcalc in reverse Polish, mfcalc
has functions, and lexcalc is using lex.

* examples/c/calc/Makefile, examples/c/calc/calc.y,
* examples/c/calc/calc.test, examples/c/calc/local.mk: New.
2019-02-10 17:44:23 +01:00
Akim Demaille
83463dfbee style: rename LR0.* as lr0.*
Let's stick to lower case for file names.

* src/LR0.h, src/LR0.c: Rename as...
* src/lr0.h, src/lr0.c: these.
2019-01-26 16:21:35 +01:00
Akim Demaille
bb5e4b659b NEWS: update 2019-01-26 11:31:01 +01:00
Akim Demaille
7d545fd23f po: remove bitset/stats.c
* po/POTFILES.in: here.
2019-01-12 09:38:57 +01:00
Akim Demaille
f0d7f71a64 NEWS: update 2019-01-12 08:19:46 +01:00
Akim Demaille
2471733f1a package: bump copyrights to 2019 2019-01-05 14:58:05 +01:00
Akim Demaille
0dfad676e3 glr.cc: remove duplicate definition of YYLLOC_DEFAULT
It's already provided by glr.c.

* data/skeletons/glr.cc (b4_post_prologue): Here.
2019-01-02 08:02:23 +01:00
Akim Demaille
90a8537e62 glr.cc: support syntax_error exceptions
Kindly requested by Аскар Сафин (Askar Safin).
http://lists.gnu.org/archive/html/bug-bison/2018-12/msg00033.html

* data/skeletons/glr.c (b4_glr_cc_if): New.
Use it.
(yygetToken): Catch syntax_errors.
* data/skeletons/glr.cc (YY_EXCEPTIONS): New.
* tests/c++.at: Check it.
2018-12-31 07:48:09 +01:00
Akim Demaille
d68f05d75c style: s/non-terminal/nonterminal/
I personally prefer 'non terminal', or 'non-terminal', but
'nonterminal' is the common spelling.

* data/glr.c, src/parse-gram.y, src/symtab.c, src/symtab.h,
* tests/input.at, doc/refcard.tex: here.
2018-12-11 06:55:41 +01:00
Akim Demaille
b05aa7be2e style: rename error functions for clarity
* src/symtab.c (symbol_redeclaration, semantic_type_redeclaration)
(user_token_number_redeclaration):
Rename as...
(complain_symbol_redeclared, complain_semantic_type_redeclared)
(complain_user_token_number_redeclared):
this.
2018-12-11 06:55:35 +01:00
Akim Demaille
20b0746793 parser: improve the error message for symbol class redefinition
Currently our error messages include both "symbol redeclared" and
"symbol redefined", and they mean something different.  This is
obscure, let's make this clearer.

I think the idea between 'definition' vs. 'declaration' is that in the
case of the nonterminals, the actual definition is its set of rules,
so %nterm would be about declaration.  The case of %token is less
clear.

* src/symtab.c (complain_class_redefined): New.
(symbol_class_set): Use it.
Simplify the logic of this function to clearly skip its body when the
preconditions are not met.
* tests/input.at (Symbol class redefinition): New.
2018-12-11 06:53:25 +01:00
Akim Demaille
4ad877fdab TODO: update 2018-11-27 06:12:48 +01:00
Akim Demaille
351e3630bb NEWS: update 2018-11-06 13:26:41 +01:00
Akim Demaille
c45f86d286 doc: fix distcheck
The extracted example, simple.yy, does not use %require "3.2", so it
generates a stack.hh, which breaks distcheck.

* doc/bison.texi: Fix it.
2018-10-27 08:53:30 +02:00
Akim Demaille
7a45fc35bf yacc.c: fix warnings about integral types
Reported by Derek Clegg.
http://lists.gnu.org/archive/html/bug-bison/2018-10/msg00018.html

Rather than adding casts, we should be more careful with types.  For
instance yystate should be a yytype_int16.  But currently we can't: it
is also used sometimes for storing other things that state numbers.

* data/yacc.c (yyparse): Add missing casts.
2018-10-23 09:08:57 +02:00
Akim Demaille
4b0efdeb28 c++: minor changes
* data/lalr1.cc: Fix oldish comment.
* data/stack.hh: Prefer typename for type names.
Use size() instead of duplicating it.
* examples/variant-11.yy, examples/variant.yy (yylex): Use int,
as this is the type of the semantic value.
2018-10-22 08:40:39 +02:00
Akim Demaille
c53d599df4 TODO: more 2018-09-18 13:21:39 +02:00
Akim Demaille
ed2c9a69d3 TODO: minor updates 2018-09-09 15:25:36 +02:00
Akim Demaille
c226d4ed48 style: doc: remove useless reference to 'int' in integral types
* doc/bison.texi: Prefer 'unsigned' to 'unsigned int'.  Likewise for
long and short.
2018-08-14 06:15:41 +02:00
Akim Demaille
2e9e591889 Update copyright years
Run `make update-copyright`.
2018-05-12 18:18:41 +02:00
Akim Demaille
3209eb1c4c package: bump to 2015
Which also requires:

* gnulib: Update.
2015-01-04 17:49:13 +01:00
Akim Demaille
fc51acddb4 package: bump to 2014
* AUTHORS, ChangeLog-2012, Makefile.am, NEWS, PACKAGING, README,
* README-alpha, README-hacking, THANKS, TODO, bootstrap.conf,
* build-aux/darwin11.4.0.valgrind, build-aux/local.mk,
* build-aux/update-b4-copyright,
* build-aux/update-package-copyright-year, cfg.mk, configure.ac,
* data/README, data/bison.m4, data/c++-skel.m4, data/c++.m4,
* data/c-like.m4, data/c-skel.m4, data/c.m4, data/glr.c, data/glr.cc,
* data/java-skel.m4, data/java.m4, data/lalr1.cc, data/lalr1.java,
* data/local.mk, data/location.cc, data/stack.hh, data/variant.hh,
* data/xslt/bison.xsl, data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl,
* data/xslt/xml2xhtml.xsl, data/yacc.c, djgpp/Makefile.maint,
* djgpp/README.in, djgpp/config.bat, djgpp/config.sed,
* djgpp/config.site, djgpp/config_h.sed, djgpp/djunpack.bat,
* djgpp/local.mk, djgpp/subpipe.c, djgpp/subpipe.h,
* djgpp/testsuite.sed, doc/bison.texi, doc/local.mk, doc/refcard.tex,
* etc/README, etc/bench.pl.in, etc/local.mk,
* examples/calc++/calc++.test, examples/calc++/local.mk,
* examples/extexi, examples/local.mk, examples/mfcalc/local.mk,
* examples/mfcalc/mfcalc.test, examples/rpcalc/local.mk,
* examples/rpcalc/rpcalc.test, examples/test, examples/variant.yy,
* lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
* lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
* lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
* lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
* lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
* lib/local.mk, lib/main.c, lib/timevar.c, lib/timevar.def,
* lib/timevar.h, lib/vbitset.c, lib/vbitset.h, lib/yyerror.c,
* m4/bison-i18n.m4, m4/c-working.m4, m4/cxx.m4, m4/flex.m4,
* m4/timevar.m4, src/AnnotationList.c, src/AnnotationList.h,
* src/InadequacyList.c, src/InadequacyList.h, src/LR0.c, src/LR0.h,
* src/Sbitset.c, src/Sbitset.h, src/assoc.c, src/assoc.h,
* src/closure.c, src/closure.h, src/complain.c, src/complain.h,
* src/conflicts.c, src/conflicts.h, src/derives.c, src/derives.h,
* src/files.c, src/files.h, src/flex-scanner.h, src/getargs.c,
* src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c,
* src/graphviz.h, src/ielr.c, src/ielr.h, src/lalr.c, src/lalr.h,
* src/local.mk, src/location.c, src/location.h, src/main.c,
* src/muscle-tab.c, src/muscle-tab.h, src/named-ref.c,
* src/named-ref.h, src/nullable.c, src/nullable.h, src/output.c,
* src/output.h, src/parse-gram.c, src/parse-gram.y, src/print-xml.c,
* src/print-xml.h, src/print.c, src/print.h, src/print_graph.c,
* src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
* src/reduce.h, src/relation.c, src/relation.h, src/scan-code.h,
* src/scan-code.l, src/scan-gram.h, src/scan-gram.l, src/scan-skel.h,
* src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
* src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
* src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
* tests/actions.at, tests/atlocal.in, tests/bison.in, tests/c++.at,
* tests/calc.at, tests/conflicts.at, tests/cxx-type.at,
* tests/existing.at, tests/glr-regression.at, tests/headers.at,
* tests/input.at, tests/java.at, tests/javapush.at, tests/local.at,
* tests/local.mk, tests/named-refs.at, tests/output.at, tests/push.at,
* tests/reduce.at, tests/regression.at, tests/sets.at,
* tests/skeletons.at, tests/synclines.at, tests/testsuite.at,
* tests/torture.at, tests/types.at:
here.
2014-02-03 15:27:02 +01:00
Akim Demaille
45eebca42d style: no longer use backquotes
* README, REFERENCES, TODO, configure.ac, data/README, data/bison.m4,
* data/c++.m4, data/c.m4, data/java.m4, data/lalr1.cc,
* data/lalr1.java, data/yacc.c, doc/local.mk, etc/bench.pl.in,
* src/conflicts.c, src/files.c, src/getargs.c, src/gram.h, src/lalr.c,
* src/location.c, src/location.h, src/muscle-tab.c, src/muscle-tab.h,
* src/output.c, src/parse-gram.c, src/parse-gram.y, src/print-xml.c,
* src/print.c, src/reader.c, src/reduce.c, src/scan-skel.l,
* src/symtab.h, src/system.h, src/tables.c:
Use single quotes, as currently recommended by the GNU Coding Standards.
2013-02-18 10:01:28 +01:00
Akim Demaille
c017f88fde options: don't accept "error=" for -f and -r
* src/getargs.c (warning_argmatch, warnings_argmatch, WARNINGS_ARGMATCH):
New.
Use them for -W/--warning.
They are copied from...
(flag_argmatch, flags_argmatch, FLAGS_ARGMATCH): these.
Simplify by removing the support for "error".
* tests/input.at (Invalid options): New.
* TODO (Laxism in Bison invocation arguments): Remove.
2013-02-14 15:00:51 +01:00
Theophile Ranquet
f29f8af3ed todo: update
Reformulate and give more details on my thoughts concerning the graphical
visualization, and add an entry about a bug in the options processing for
warnings as errors.

* TODO: Here.
2013-02-01 14:44:23 +01:00
Akim Demaille
15c14fdfb9 maint: update todo
* TODO: Remove fixed items.
2013-01-28 17:46:13 +01:00
Akim Demaille
7d6bad1959 maint: update copyright years
Suggested by Stefano Lattarini.
Run "make update-copyright".
2013-01-12 16:14:16 +01:00
Akim Demaille
b8a8cc42c6 todo: remove erroneous task
* tests/input.at: Check that there are no warnings about stray $ and @
in the epilogue.
* TODO: Remove the correponding task.
2012-12-31 16:32:12 +01:00
Akim Demaille
d0a304384f Merge remote-tracking branch 'origin/maint'
* 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
2012-10-26 16:58:55 +02:00
Theophile Ranquet
fc4fdd623e graphs: documentation
Note that 'make web-manual' fails.

* NEWS: Document these changes.
* doc/Makefile.am: Adjust to generate example files.
* doc/bison.texi: Add a Graphviz section after "Understanding::", the section
describing the .output file, because these are similar.
* doc/figs/example-reduce.dot, doc/figs/example-reduce.txt,
doc/figs/example-shift.dot, doc/figs/example-shift.txt: New, minimal
examples to illustrate the documentation.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
2012-10-18 17:03:30 +02:00
Theophile Ranquet
c6c8de1609 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>
2012-10-04 17:13:38 +02:00
Akim Demaille
1048a1c901 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>
2012-09-27 12:19:09 +02:00
Akim Demaille
51c994d8f0 TODO: lalr1.cc master vs maint
* TODO: here.
2012-09-21 09:16:11 +02:00
Akim Demaille
e4c0985b5c 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.
2012-09-03 16:23:15 +02:00