Commit Graph

707 Commits

Author SHA1 Message Date
Josh Soref
b89b6517f2 spelling: troubleshooting 2018-10-05 07:01:06 +02:00
Josh Soref
cd45c269e2 spelling: transparent 2018-10-05 07:01:06 +02:00
Josh Soref
8c3eae0d44 spelling: diagnostics 2018-10-05 07:01:04 +02:00
Josh Soref
23a37cc1c5 spelling: detailed 2018-10-05 07:01:04 +02:00
Akim Demaille
2d07940325 doc: clean up the C++ section
* doc/bison.texi: Minor fixes in typography.
It is no longer require to pass --defines for C++ (it was addressed
long ago).
No longer refer to the `variant` define variable, it was replaced by
`api.value.type variant`.
Prefer nullptr to 0 for the null pointer.
Use deftypeop for constructors.
(Complete Symbols): Give the expected signature of yylex.
Don't document the symbol_type constructors, as we want users to focus
on make_TOKEN.
Also show the case without locations.
2018-09-26 21:49:20 +02:00
Akim Demaille
154bc7ddac doc: work around Flex's use of 'register'
The CI uses an old version of Flex.
See 65fa634cdc.

* doc/bison.texi (calc++/scanner.ll): Here.
2018-09-22 19:40:37 +02:00
Akim Demaille
878dc0a172 news: c++: move semantics 2018-09-22 14:52:13 +02:00
Akim Demaille
3eb9042a30 c++: introduce api.value.automove
Based on work by Frank Heckenbach.
See http://lists.gnu.org/archive/html/bug-bison/2018-04/msg00000.html
and http://lists.gnu.org/archive/html/bug-bison/2018-09/msg00019.html.

* data/lalr1.cc (b4_rhs_value): Use YY_MOVE api.rhs.automove is set.
* doc/bison.texi (%define Summary): Document api.rhs.automove.
* examples/variant-11.yy: Use it.

* tests/local.at (AT_AUTOMOVE_IF): New.
* tests/c++.at (Variants): Check move semantics.
2018-09-22 09:49:46 +02:00
Akim Demaille
857be0e10f doc: fix typo
Introduced in the previous commit.

* doc/bison.texi: here.
2018-09-19 22:13:57 +02:00
Akim Demaille
bbfa419b89 style: use midrule only, not mid-rule
The code was already using midrule only, never mid_rule.  This is
simpler to remember, and matches a similar change we made from
look-ahead to lookahead.

* NEWS, doc/bison.texi, src/reader.c, src/scan-code.h, src/scan-code.l
* tests/actions.at, tests/c++.at, tests/existing.at: here.
2018-09-19 22:09:53 +02:00
Paul Eggert
f475105c2f doc: document older compiler issues
* doc/bison.texi (Compiler Requirements for GLR):
Rename from Compiler Requirements.
(I can't build Bison): Add FAQ for older compilers.
2018-09-18 13:17:46 -07:00
Akim Demaille
65fa634cdc doc: work around Flex's use of 'register'
The CI uses an old version of Flex.

* doc/bison.texi (calc++/scanner.ll): Here.
2018-09-18 13:21:38 +02:00
Akim Demaille
ce99bc67b8 doc: formatting changes
* doc/bison.texi: No changes in the output.
2018-09-15 07:20:49 +02:00
Akim Demaille
e1c33f04d1 build: work around warnings in Flex
See ea0db44fed.  We also need to disable
the warning in the examples (but don't want to clutter the
documentation with such details).

* doc/bison.texi (scanner.ll): Disable Clang's -Wdocumentation.
While at it, hide the other kludges.
2018-09-08 12:13:29 +02:00
Akim Demaille
ea0db44fed build: work around warnings in Flex 2.5.35
That's the version on Ubuntu Precise.
See also 1dac131ec4.

* src/flex-scanner.h: Disable -Wdocumentation.
* doc/bison.texi: Turn off a warning triggered by Flex 2.6.4.
2018-09-08 07:53:08 +02:00
Akim Demaille
de64159e7f examples: calc++: a Makefile and a README
* examples/calc++/Makefile, examples/calc++/README: New.
* examples/calc++/local.mk: Ship and install them.
* doc/bison.texi: Formatting changes.
2018-08-25 08:49:26 +02:00
Akim Demaille
b4e9eaefd5 examples: calc++: minor improvements
* doc/bison.texi (A Complete C++ Example): Prefer throw exceptions
from the scanner.
Show the invalid characters.
Since the scanner sends exceptions, it no longer needs to report
errors, so we can get rid of the driver's routine to report error,
do it in yyerror.
Use @group/@end group to improve rendering.
2018-08-24 19:40:36 +02:00
Akim Demaille
1a968edcb8 examples: calc++: make sure the file name in location is set
Reported by Hans Åberg.
http://lists.gnu.org/archive/html/bug-bison/2018-08/msg00039.html

* doc/bison.texi (A Complete C++ Example): Move the token's location
from the scanner to the driver.
2018-08-24 19:24:37 +02:00
Akim Demaille
82fa282a1b examples: calc++: remove prefixes
This example uses the calcxx_ prefix for each class.  That's uselessly
heavy.

* doc/bison.texi (A Complete C++ Example): Simplify the class names.
Since now 'driver' denotes the class, use 'drv' for the values.
Formatting changes.
2018-08-24 19:24:34 +02:00
Akim Demaille
3fda8335bf examples: shorten the name of the calc++ files
* doc/bison.texi: Turn the calc++- prefix into calc++/.
* examples/extexi (%file_wanted): Replace with
(&file_wanted): this.
* examples/calc++/local.mk: Adjust.
2018-08-23 13:37:52 +02:00
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