Commit Graph

837 Commits

Author SHA1 Message Date
Akim Demaille
7ff6b7bbca doc: clarify that the push parser object can be reused
Suggested by Rici Lake.
https://lists.gnu.org/archive/html/bug-bison/2018-08/msg00033.html

* doc/bison.texi: Complete description of the first node in the main
@menu.
(Push Decl): Remove the 'experimental' warnings about push parser.
Clarify that the push parser object can be reused in several parses.
2018-08-19 21:02:17 +02:00
Akim Demaille
44e76d801f lalr1.cc: support compilation with disabled support for exceptions
Reported by Brooks Moses <bmoses@google.com>
http://lists.gnu.org/archive/html/bison-patches/2018-02/msg00000.html

* data/lalr1.cc (YY_EXCEPTIONS): New.
Use it to disable try/catch clauses.

* doc/bison.texi (C++ Parser Interface): Document it.

* configure.ac (CXXFLAGS_NO_EXCEPTIONS): New.
* tests/atlocal.in: Receive it.
* tests/local.at (AT_FULL_COMPILE, AT_LANG_COMPILE):
Accept a new argument, extra compiler flags.
* tests/calc.at: Run the C++ calculator with exception support disabled.
2018-08-19 17:47:59 +02:00
Akim Demaille
a1513c265b doc: fix the name of the GFDL section
Reported by dine <2500418497@qq.com>.
http://lists.gnu.org/archive/html/bug-bison/2016-10/msg00000.html

I mirrored what the Coreutils do.

* doc/bison.texi (Copying This Manual): Rename as...
(GNU Free Documentation License): this, since that the name we
used in the preamble.
2018-08-18 14:33:06 +02:00
Akim Demaille
425044a936 doc: clarify the destructor selection example
Reported by Gary L Peskin.
http://lists.gnu.org/archive/html/help-bison/2016-02/msg00000.html

* doc/bison.texi (Destructor Decl): here.
2018-08-18 14:15:21 +02:00
Akim Demaille
005ea24cbb doc: typed mid-rule actions
* doc/bison.texi (Mid-Rule Actions): Restructure to insert...
(Typed Mid-Rule Actions): this new section.
Move the manual translation of mid-rule actions into regular actions
to...
(Mid-Rule Action Translation): here.
2018-08-18 10:42:35 +02:00
Akim Demaille
b01b80836d tests: fix warnings in push mode
Fix warning with GCC 8, -DNDEBUG.

    422. push.at:83: testing Multiple impure instances ...
    input.y: In function 'main':
    input.c:1022:12: error: potential null pointer dereference [-Werror=null-dereference]
       if (!yyps->yynew && yyps->yyss != yyps->yyssa)
            ~~~~^~~~~~~

* data/yacc.c (pstate_delete): Do nothing if called on null pointer.
2018-08-15 19:40:15 +02:00
Akim Demaille
ef98967ada build: work around GCC warnings on Flex code
With GCC 7.3.0 and Flex 2.6.4, we get warnings on all the generated
scanners:

    examples/calc++/calc++-scanner.cc: In function 'void yyrestart(FILE*)':
    examples/calc++/calc++-scanner.cc:1611:20: error: potential null pointer dereference [-Werror=null-dereference]
     /* %endif */
      ~~~~~~~~~~~       ^
    examples/calc++/calc++-scanner.cc:1607:19: error: potential null pointer dereference [-Werror=null-dereference]
     /* %if-c-only */
      ~~~~~~~~~~~~~~~  ^
    examples/calc++/calc++-scanner.cc:1611:20: error: potential null pointer dereference [-Werror=null-dereference]
     /* %endif */
      ~~~~~~~~~~~       ^
    examples/calc++/calc++-scanner.cc:1607:19: error: potential null pointer dereference [-Werror=null-dereference]
     /* %if-c-only */
      ~~~~~~~~~~~~~~~  ^
    cc1plus: all warnings being treated as errors

Obviously the lines are incorrect, and the warnings are emitted twice.
Still, let's get rid of these warnings.

* doc/bison.texi, src/flex-scanner.h: Disable these warnings in code
generated by Flex.
2018-08-15 14:42:09 +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
f9a6b34147 doc: avoid type aliases
* doc/bison.texi (C++ Location Values): Use 'unsigned' instead of
'uint'.
2018-08-12 09:40:32 +02:00
Akim Demaille
48828e779f doc: remove the "experimental" warning for some features
Several features were flagged 'experimental' and waiting for user
feedback to 'stabilize', but i. AFAIK, no user ever reported anything
about them, ii. they'be been here long enough to prove they don't do
harm.

* doc/bison.texi: No longer experimental: default %printer and
%destructor (typed: <*> and untyped: <>), %define api.value.type union
and variant, Java parsers, XML output, LR family (lr, ielr, lalr),
semantic predicates (%?).
2018-08-12 09:15:01 +02:00
Akim Demaille
ccc759e81a doc: -fcaret is enabled by default
* doc/bison.texi (Mid-Rule Action Translation): So no need to pass it.
2018-08-11 18:27:09 +02:00
Akim Demaille
d2e7bc1613 doc: fix Texinfo syntax error
* doc/bison.texi (Understanding): here.
2018-06-23 09:12:06 +02:00
Akim Demaille
70875b4873 doc: we now show the type of the symbols
* doc/bison.texi (Understanding Your Parser): Update the output
from Bison.
Use types in the example, and show them in the report.
* NEWS: Update.
2018-06-22 09:51:32 +02:00
Akim Demaille
f3bd6a25bf Replace ftp with https
Reported by Hans Åberg.

* README, cfg.mk, doc/bison.texi: here.
2018-05-29 07:28:02 +02:00
Akim Demaille
2e9e591889 Update copyright years
Run `make update-copyright`.
2018-05-12 18:18:41 +02:00
Nate Guerin
a6ec9ca2f1 Add a missing word in the documentation
Small patch adds the word 'to' to the documentation.
2018-05-12 18:13:37 +02:00
Akim Demaille
dbd1609311 style: don't use std::endl
* data/lalr1.cc, doc/bison.texi, etc/bench.pl.in, examples/variant.yy,
* tests/actions.at, tests/atlocal.in, tests/c++.at, tests/headers.at,
* tests/local.at, tests/types.at:
Don't use std::endl, it flushes uselessly, and is considered bad
style.
2018-05-08 12:35:06 +02:00
Paul Eggert
96748b2bf8 Capitalize "Polish" when it's a proper adjective 2017-09-22 09:10:04 -07:00
Akim Demaille
baa423bd59 doc: improve html and pdf rendering
* doc/bison.texi: Help html conversion to understand where the
function names end.
Beware of PDF width.
2015-03-03 16:58:13 +01:00
Akim Demaille
75fbe357c8 doc: fixes in the C++ part
Reported by Askar Safin.

http://lists.gnu.org/archive/html/bug-bison/2015-02/msg00018.html
http://lists.gnu.org/archive/html/bug-bison/2015-02/msg00019.html

* doc/bison.texi (Split Symbols): Fix access to token types.
yylval is a pointer, so use ->.
Fix coding style issues: space before paren.
2015-03-03 16:31:31 +01:00
Akim Demaille
559b30881d doc: minor fixes
* doc/bison.texi: Fix warnings about colon in reference names.
* data/bison.m4, src/files.h: Fix comments.
* doc/Doxyfile.in: update.
2015-01-16 10:52:17 +01:00
Akim Demaille
9a91e7f246 doc: liby's main arms the internationalization
Reported by Nicolas Bedon.
<https://lists.gnu.org/archive/html/bug-bison/2014-11/msg00005.html>

* doc/bison.texi (Yacc Library): Document the call the setlocale.
2015-01-12 11:37:24 +01:00
Akim Demaille
56351d4c7b c++: locations: complete the API and fix comments
There are no support for += between locations, and some comments are wrong.
Reported by Alexandre Duret-Lutz.

* data/location.cc: Fix.
* doc/bison.texi: Document.
* tests/c++.at: Check.
2015-01-05 18:32:23 +01:00
Akim Demaille
478c4a8f49 build: do not clean figure sources in make clean
"make clean && make" fails in in-tree builds.

* doc/local.mk (CLEANDIRS): Replace with...
(CLEANFILES): this safer list of files to clean.
2015-01-05 14:41:46 +01:00
Akim Demaille
a16074bb09 build: don't try to generate docs when cross-compiling
When cross-compiling don't run the generated bison to update the docs.
Reported by Aaro Koskinen.
<http://lists.gnu.org/archive/html/bison-patches/2014-03/msg00000.html>

* configure.ac (CROSS_COMPILING): New.
* doc/local.mk: Use it.
2015-01-05 12:27:27 +01:00
Akim Demaille
827bc59ca1 %union: fix the support for named %union
Bison supports a union tag, for obscure reasons.  But it does a poor
job at it, especially since Bison 3.0.
Reported by Stephen Cameron and Tobias Frost.

It did not ensure that the name was not given several times.  An easy
way to do this is to make the %union tag be handled as a %define
variable, as they cannot be defined several times.

Since Bison 3.0, the synclines were wrongly placed, resulting in
invalid code.  Addressing this issue, because of the way the union tag
was stored (as a code muscle), would have been tedious.  Unless we
rather define the %union tag as a %percent variable, whose synclines
are easier to manipulate.

So replace the b4_union_name muscle by the api.value.union.name
%define variable, document, and check.

* data/bison.m4: Make sure that api.value.union.name has a keyword value.
* data/c++.m4: Make sure that api.value.union.name is not defined.
* data/c.m4 (b4_union_name): No longer use it, use api.value.union.name.
* doc/bison.texi (%define Summary): Document it.
* src/parse-gram.y (union_name): No longer define b4_uion_name, but
api.value.union.name.
* tests/input.at (Redefined %union name): New.
* tests/synclines.at (%union name syncline): New.
* tests/types.at: Check named %unions.
2015-01-04 18:00:51 +01:00
Akim Demaille
3209eb1c4c package: bump to 2015
Which also requires:

* gnulib: Update.
2015-01-04 17:49:13 +01:00
Akim Demaille
a3c3c6f242 doc: fix missing xref
Reported by xolodho.

* doc/bison.texi (Printer Decl): here.
2014-12-31 12:49:39 +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
Paul Eggert
957255b82c doc: specify documentation encoding
* doc/bison.texi: Add '@documentencoding UTF-8'; needed since the
manual contains UTF-8 characters.  This will cause the .info files
to contain UTF-8 quotes and the like, which should be OK nowadays.
Add @documentlanguage while we're at it.
2014-01-03 11:08:50 -08:00
Akim Demaille
265640d56e install: do not install yacc.1 when --disable-yacc
* configure.ac (ENABLE_YACC): New conditional.
(YACC_SCRIPT, YACC_LIBRARY): Remove.
* lib/local.mk, src/local.mk: Use the former instead of the latter.
* doc/local.mk: Use ENABLE_YACC to avoid installing yacc.1.
2013-10-22 17:34:22 +02:00
Akim Demaille
e4678430c2 diagnostics: "-Werror -Wno-error=foo" must not emit errors
Currently "-Werror -Wno-error=foo" still turns "foo" warnings into errors.
Reported by Alexandre Duret-Lutz.
See http://lists.gnu.org/archive/html/bug-bison/2013-09/msg00015.html.

* src/complain.c (errority, errority_flag): New.
(complain_init): Initialize the latter.
(warning_argmatch): Extract the loop iterating on the flag's bits.
Set and unset errority_flag here.
(warnings_argmatch): -Wno-error is not the same as -Wno-error=everything:
we must remember if category foo was explicitly turned in an error/warning
via -W(no-)error=foo.
(warning_severity): Use errority_flag.

* tests/input.at (Symbols): Just check --yacc, not -Wyacc, that's the
job of tests on -W.
(-Werror is not affected by -Wnone and -Wall): Rename as...
(-Werror combinations): this.
Tests more combinations of -W, -W(no-)error, and -W(no-)error=foo.
* tests/local.at (AT_BISON_CHECK_WARNINGS): Don't expect -Werror
to turn runs that issue warnings into runs with errors, as the
warnings might be enforced as warnings by -Wno-error=foo, in which
case -Werror does not change anything.

* doc/bison.texi (Bison Options): Try to be clearer about how
-W(no-)error and -W(no-)error=foo interact.
2013-10-16 14:56:09 +02:00
Akim Demaille
c4aa4ff541 build: ship the ASCII art figures
We don't ship the *.txt files that are used to build the info
file.
Reported by Colin Daley.

* doc/figs/example.txt: New.
* doc/local.mk (bison.info): Depend on the txt files.
And ship them.
2013-08-01 11:41:49 +02:00
Akim Demaille
b97bbbaed7 doc: prefer the ".gv" extension to ".dot"
See http://marc.info/?l=graphviz-devel&m=129418103126092 for the
motivation (basically, some word processor now uses *.dot).

* doc/figs/example-reduce.dot: Rename as...
* doc/figs/example-reduce.gv: this.
* doc/figs/example-shift.dot: Rename as...
* doc/figs/example-shift.gv: this.
* doc/figs/example.dot: Rename as...
* doc/figs/example.gv: this.
* doc/local.mk: Adjust.
2013-08-01 11:20:13 +02:00
Akim Demaille
45c64fa627 java: rename YYMORE as YYPUSH_MORE for consistency with C
http://lists.gnu.org/archive/html/bison-patches/2013-06/msg00008.html

* data/lalr1.java, doc/bison.texi, tests/javapush.at:
s/YYMORE/YYPUSH_MORE.
2013-06-24 09:37:18 +02:00
Dennis Heimbigner
aa94def12d java: add push-parser support
* data/lalr1.java: Capture the declarations as m4 macros to avoid
duplication.  When push parsing, the declarations occur at the class
instance level rather than within the parse() function.

Change the way that the parser state is initialized.  For
push-parsing, the parse state declarations are moved to
"push_parse_initialize()", which is called on the first invocation of
"push_parse()". The %initial-action code is also inserted after the
invocation of "push_parse_initialize()".

The body of the parse loop is modified to return values at appropriate
points when doing push parsing.  In order to make push parsing work,
it is necessary to divide YYNEWSTATE into two states: YYNEWSTATE and
YYGETTOKEN. On the first call to push_parse(), the state is
YYNEWSTATE. On all later entries, the state is set to YYGETTOKEN. The
YYNEWSTATE switch arm falls through into YYGETTOKEN. YYGETTOKEN
indicates that a new token is potentially needed.  Normally, with a
pull parser, this new token would be obtained by calling "yylex()". In
the push parser, the value YYMORE is returned to the caller. On the
next call to push_parse(), the parser will return to the YYGETTOKEN
state and continue operation.

* tests/javapush.at: New test file for java push parsing.
* tests/testsuite.at: Use it.
* tests/local.mk: Adjust.
* doc/bison.texi (Java Push Parser Interface): New.

Signed-off-by: Akim Demaille <akim@lrde.epita.fr>
2013-06-13 10:38:14 +02:00
Akim Demaille
6ce4b4ff1b muscle: check more cases of %define variables with code values
* data/bison.m4 (b4_percent_define_check_kind): Fix overquotation.
(api.location.type, api.position.type): Check they have code values here.
* data/c++.m4 (api.location.type): No longer checked here.
(parser_class_name): Check it here.
* data/java.m4 (api.value.type, init_throws, lex_throws, parser_class_name)
(throws, annotations, extends, implements): Check they have code values.
* doc/bison.texi: Fix every incorrect occurrence of %define.
Document the additional syntax for %define: code values.
Document the additional syntax for -D/-F: string and code values.
* tests/calc.at, tests/headers.at, tests/input.at, tests/java.at,
* tests/local.at: Fix dependencies.
2013-04-18 17:19:30 +02:00
Akim Demaille
aba47f5624 muscle: check the kind of api.prefix, api.location.type
* data/bison.m4: Check api.prefix.
* data/c++.m4: Check api.location.type.
* doc/bison.texi: Fix uses of api.value.type, api.prefix, api.location.type.
Document {...} values for %define.
* src/parse-gram.y: Fix use of api.prefix.
* tests/calc.at: Fix uses of api.location.type.
* tests/input.at: Check api.prefix, and api.location.type.
2013-04-16 17:42:43 +02:00
Akim Demaille
c53b684889 muscle: enforce definition syntax for keyword variables
* src/muscle-tab.c (muscle_percent_define_get_kind)
(muscle_percent_define_check_kind): New.
(muscle_percent_define_default): Variables with a default value are
of "keyword" kind.
(muscle_percent_define_flag_if, muscle_percent_define_check_values):
Check that the variable is of keyword kind.
* data/bison.m4: Likewise, but in M4.  That is to say...
(b4_percent_define_default): Define the kind when the variable is undefined.
(b4_percent_define_check_kind): Use a better error message.
(_b4_percent_define_check_values, _b4_percent_define_check_values):
Former "enum" variables should be defined using the keyword syntax.
* doc/bison.texi: Update.
A couple of fixes.
* tests/input.at (%define keyword variables): New.
2013-04-15 10:57:19 +02:00
Akim Demaille
07e65a77aa muscle: factor the kind check in M4
* data/bison.m4 (b4_percent_define_check_kind): New.
Use it to check api.token.prefix.
* data/c++.m4: Check the kind of api.namespace.
* doc/bison.texi: Update a reference to former 'namespace' variable.
* tests/input.at ("%define" code variables): Check api.namespace.
2013-04-15 10:37:00 +02:00
Akim Demaille
630a021850 api.token.prefix: use code values
* data/bison.m4: Remove useless (and incorrect: m4_* instead of b4_*)
default assignment to api.token.prefix.
Check that api.token.prefix is assigned code.
* tests/input.at (%define code variables): New test.
* NEWS, doc/bison.texi, tests/c++.at, tests/calc.at,
* tests/java.at, tests/local.at: Adjust to use braces.
2013-04-11 15:54:46 +02:00
Akim Demaille
75ae829984 c++: fix several issues with locations
Reported by Daniel Frużyński.
http://lists.gnu.org/archive/html/bug-bison/2013-02/msg00000.html

* data/location.cc (position::columns, position::lines): Check for
underflow.
Fix some weird function signatures.
(location): Accept signed integers as arguments where appropriate.
Add operator- and operator+=.
* doc/bison.texi (C++ position, C++ location): Various fixes
and completion.
* tests/c++.at (C++ Locations): New tests.
2013-04-11 12:50:59 +02:00
Akim Demaille
435575cb5e api.value.type: use keyword/brace values
Suggested by Joel E. Denny.
http://lists.gnu.org/archive/html/bison-patches/2013-03/msg00016.html

* data/bison.m4 (b4_percent_define_get_kind): New.
(b4_variant_flag): Check that api.value.type is defined as the 'variant'
keyword value.
* data/c.m4 (_b4_value_type_setup_keyword): New.
(b4_value_type_setup): Use it to simplify reading.
Use b4_define_silent.
Decode api.value.type, including its type.
(b4_value_type_define): Likewise.
* data/c++.m4 (b4_value_type_declare): Adjust the decoding of api.value.type,
taking its kind into account.
* doc/bison.texi: Adjust all the examples to the new syntax.
* NEWS: Ditto.
* tests/types.at: Adjust
2013-04-09 16:59:06 +02:00
Akim Demaille
1fa19a7697 api.value.type: diagnose guaranteed failure with --yacc
Instead of generating invalid C code, generate an error when --yacc and
'%define api.value.type union' are used together.

* data/bison.m4: Issue an error in this case.
* tests/types.at (%yacc vs. %define api.value.type union): New, check this
error.
* doc/bison.texi (Type Generation): Document it.
* tests/output.at: Check that '-o y.tab.c' and '-y' behave equally
wrt generated file names.
* NEWS (Use of YACC='bison -y'): New.
Promote the use of 'bison -o y.tab.c'.
2013-04-09 14:07:52 +02:00
Akim Demaille
d1a07886ee doc: style changes
* doc/bison.texi (Destructor Decl, Printer Decl): Group series of %token
and %type together.
2013-04-09 14:07:52 +02:00
Akim Demaille
71846502ae doc: display locations in error as recommended by GNU Coding Standards
* doc/bison.texi (Actions and Locations): here.
2013-04-09 14:07:52 +02:00
Akim Demaille
90b89dadb2 doc: api.value.type union
* doc/bison.texi (Type Generation): New section.
(Multi-function Calc): Convert to use api.value.type=union.
2013-04-09 14:07:51 +02:00
Akim Demaille
e4d49586b6 doc: move the section about "%union" where types are discussed
* doc/bison.texi (Union Decl): Move to...
(Defining Language Semantics): here.
2013-04-09 14:07:51 +02:00
Akim Demaille
21e3a2b56c doc: deprecate #define YYSTYPE in favor of %define api.value.type
* doc/bison.texi: Convert examples with YYSTYPE to use api.value.type.
Deprecate YYSTYPE.
2013-04-09 14:07:51 +02:00
Akim Demaille
6574576cfb api.value.type: implement proper support, check, and document
* data/c.m4 (b4_symbol_type_register, b4_type_define_tag)
(b4_symbol_value_union, b4_value_type_setup_union)
(b4_value_type_setup_variant, b4_value_type_setup):
New.
(b4_value_type_define): Use it to set up properly the type.
Handle the various possible values of api.value.type.
* data/c++.m4 (b4_value_type_declare): Likewise.
* data/lalr1.cc (b4_value_type_setup_variant): Redefine.

* tests/types.at: New.
Exercise all the C/C++ skeletons with different types of
api.value.type values.
* tests/local.mk, tests/testsuite.at: Use it.

* doc/bison.texi (%define Summary): Document api.value.type.
* NEWS: Advertise it, together with api.token.constructor.
2013-04-09 14:07:51 +02:00