Commit Graph

423 Commits

Author SHA1 Message Date
Akim Demaille
db8ab2be33 c++: api.location.type
This feature was introduced in 95a2de5695
(which is part of 2.5), but not documented.  Give it a proper name, and
make it public.

* data/c++.m4, data/lalr1.cc, data/glr.cc, data/java.m4: Use
api.location.type instead of location_type.
* src/muscle-tab.c (muscle_percent_variable_update): Map the latter to
the former.
* tests/local.at: Adjust.
* tests/calc.at: Use api.location.type.
Leave tests/java.at with location_type, at least for the time being,
to cover both names.
* doc/bison.texi: Document api.location.type.
(User Defined Location Type): New.
* NEWS: Update.
2012-10-09 15:59:18 +02:00
Akim Demaille
d3e4409ad1 lalr1.cc: document exception safety
* NEWS: here.
* doc/bison.texi (Destructor Decl, C++ Parser Interface): and there.
2012-10-06 19:53:45 +02:00
Akim Demaille
45fdfd8108 build: look for Perl in configure.
Bison uses "/usr/bin/perl" or "perl" in several places, and it does
not appear to be a problem.  But, at least to make it simpler to
change PERL on the make command line, check for perl in configure.

* configure.ac (PERL): New.
* doc/Doxyfile.in, doc/Makefile.am, tests/bison.in: Use it.
2012-10-05 09:34:52 +02:00
Akim Demaille
57f8bd8d18 doc: add missing documentation for --report
* doc/bison.texi (Bison Options): Document --report's "solved", "all",
and "none".
2012-10-03 08:47:37 +02:00
Akim Demaille
c9d5bcc938 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.
2012-10-01 11:18:22 +02:00
Akim Demaille
5a05f42ecf minor changes.
* NEWS: Word changes.
* doc/bison.texi: Spell check.
Fix minor issues.
* tests/headers.at: Comment and formatting changes.
2012-10-01 11:18:22 +02:00
Akim Demaille
76e5017732 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>.
2012-09-04 10:50:30 +02:00
Akim Demaille
cd735a8c6c also support $<foo>$ in the %initial-action
scan-code.l is already passing argument to b4_dollar_dollar for the
initial acton, but its definition (of b4_dollar_dollar) does not use
this argument.

Generalize this definition, and use it for the %initial-action too.

* data/c.m4 (b4_dollar_dollar_, b4_dollar_pushdef, b4_dollar_popdef):
Instead of expecting a pointer, require a value, and use ".".
Since they are now generic enough, move to...
* data/c-like.m4: this new file.
* data/c.m4, data/java.m4: Load it.
* data/glr.c, data/lalr1.cc, data/lalr1.java, data/yacc.c: Use
b4_dollar_pushdef for the %initial-action.
* tests/actions.at: Check that.
* data/Makefile.am: Adjust.
* NEWS, doc/bison.texi: Document.
2012-07-27 14:47:20 +02:00
Akim Demaille
4982f078bf support $<tag>$ in printers and destructors
* src/scan-code.l (SC_SYMBOL_ACTION): Accept $<tag>$, not just $$.
* data/c.m4 (b4_dollar_dollar_): New.
(b4_symbol_actions): Let b4_dollar_dollar use b4_dollar_dollar_.
* NEWS, doc/bison.texi: Document it.
* tests/actions.at: Check this for C and C++.
2012-07-26 18:30:43 +02:00
Akim Demaille
f9b8635172 doc: avoid problems with case insensitive file systems
makeinfo --html generates index.html, and the node "Index" will result
in Index.html.  On case insensitive file systems, such as on Mac OS X
by default, this results in a single, invalid, file (Texinfo 4.13).
See http://lists.gnu.org/archive/html/bug-texinfo/2012-07/msg00032.html

* doc/bison.texi (Index): Rename as...
(Index of Terms): this.
2012-07-24 13:30:49 +02:00
Akim Demaille
e6ae99fe75 doc: fix Texinfo command
* doc/bison.texi: In parens, use @pxref.
2012-07-18 09:17:31 +02:00
Akim Demaille
ad60e80f3d api.prefix: strengthen the tests and fix push-parsers.
* tests/calc.at: Check api.prefix in addition to %name-prefix.
* tests/headers.at: Check push parsers and pure interface.
* tests/local.at: Use YYLTYPE renamed.
* data/yacc.c (b4_declare_yyparse_push_): Handle api.prefix.
* doc/bison.texi: Style changes.
2012-07-05 12:41:15 +02:00
Akim Demaille
e358222ba8 api.prefix: improve the documentation for YYDEBUG.
* doc/bison.texi: Explain how api.prefix is applied to YYDEBUG.
2012-07-05 12:41:08 +02:00
Akim Demaille
4b3847c3c0 api.prefix.
* data/c.m4 (b4_api_prefix, b4_api_PREFIX): New.
(b4_prefix, b4_union_name, b4_token_enums, b4_declare_yylstype): Use them.
* data/glr.c, data/yacc.c, data/glr.cc, data/lalr1.cc: Use them to change
the prefix of exported preprocessor symbols.
* src/getargs.c (usage): Ditto.
* tests/headers.at (Several parsers): New.
* tests/local.at (AT_API_PREFIX): New.
AT_YYSTYPE, AT_YYLTYPE): Adjust.
* doc/bison.texi (Multiple Parsers): Move documentation of %name-prefix to...
(Table of Symbols): here.
(Multiple Parsers): Document api.prefix.
(%define Summary): Point to it.
Use @code for variable names.
(Bison Options): -p/--name-prefix are obsoleted.
* NEWS: Announce api.prefix.
2012-06-29 17:40:42 +02:00
Akim Demaille
258cddbc36 c++: do not export YYTOKEN_TABLE and YYERROR_VERBOSE.
* src/output.c (prepare_symbols): Do not define b4_token_table.
(prepare): Define b4_token_table_flag.
* data/bison.m4 (b4_token_table_if): New.
Arm it when error-verbose.
* data/glr.c, data/yacc.c (YYTOKEN_TABLE): Remove.
Use m4.
* data/lalr1.cc: Likewise.
(YYERROR_VERBOSE): Remove.
* NEWS, doc/bison.texi: Document this.
2012-06-27 10:03:21 +02:00
Akim Demaille
9bcffa0c13 maint: use *.texi.
This is more consistent with the other packages, and Automake-NG
supports only *.texi.

* doc/bison.texinfo: Rename as...
* doc/bison.texi: this.
* doc/Makefile.am, examples/calc++/Makefile.am: Adjust.
2012-06-26 16:55:23 +02:00
Akim Demaille
18ad57b384 news: condemn YYPARSE_PARAM and YYLEX_PARAM.
* NEWS: here.
(Bison 1.875): Add %parse-param and %lex-param.
* doc/bison.texinfo: Spello.
2012-06-21 15:19:43 +02:00
Jim Meyering
cbdb6d9145 maint: fix comment typos
Using http://github.com/lyda/misspell-check, massage its
output into sed commands to perform the suggested changes.
Initially, I filtered out the THRU->Through changes, because
that failed to retain capitalization in the grammar token.
Instead, do this manually, beforehand:

sed -i s/THRU/THROUGH/ tests/existing.at
git ls-files|misspellings -f -|perl -nl \
  -e '/^(.*?)\[(\d+)\]: (\w+) -> "(.*?)"$/ or next;' \
  -e '($file,$n,$l,$r)=($1,$2,$3,$4); $q="'\''"; $r=~s/$q/$q\\$q$q/g;'\
  -e 'print "sed -i $q${n}s!$l!$r!$q $file"'|bash
2012-06-05 09:17:43 +02:00
Akim Demaille
188867ac65 doc: fixes.
* doc/bison.texinfo: Fix errors spotted by syntax-check.
2012-05-23 14:24:30 +02:00
Akim Demaille
15cd62c2c1 doc: fix @xref.
* doc/bison.texinfo: here.
2012-05-04 14:53:48 +02:00
Akim Demaille
2ba031129a doc: fix some invalid @ref.
* doc/bison.texinfo: Fix incorrect @ref uses.
(cherry picked from commit e3fd1dcb8b)
2012-04-16 19:20:38 +02:00
Akim Demaille
68fff38a09 %printer: support both yyo and yyoutput.
lalr1.cc used to support yyo, but not yyoutput.  Support both,
but document only yyoutput (at least until there is some consensus
on this).

* data/c.m4 (yy_symbol_value_print): Also support yyo.
* data/glr.cc  (yy_symbol_value_print_): Support both yyo and yyoutput.
* data/lalr1.cc: Also support yyoutput.
* doc/bison.texinfo: Explicitly use yyoutput in the examples.
* examples/mfcalc/mfcalc.test: Test the -p option.
(cherry picked from commit c50263271d)

Conflicts:

	data/c.m4
	data/lalr1.cc
	doc/bison.texinfo
	etc/Makefile.am
2012-04-16 17:34:36 +02:00
Akim Demaille
56d60c1947 doc: mfcalc: demonstrate %printer.
* doc/bison.texinfo (Printer Decl): New.
Number mfcalc.y snippets so that they are output in
the proper order.
(The mfcalc Main): Use yydebug.
(Debugging): Simplify the text.
(Enabling Traces, Mfcalc Traces, The YYPRINT Macro): New.
(Table of Symbols): Document YYPRINT and YYFPRINTF.

(cherry picked from commit 93c150b666)

Conflicts:

	doc/bison.texinfo
2012-04-16 17:18:48 +02:00
Akim Demaille
34a41a93c7 doc: fix index.
http://lists.gnu.org/archive/html/bison-patches/2012-04/msg00006.html

* doc/bison.texinfo: Avoid using @def* variant with more
than the defined entity as main entity, as it results in
an incorrect index.  For instance, don't document
{return YYERROR;}, which results in a single index entry
"return YYERROR;", but rather as typed function whose
return type is "type", and whose argument list is ";".
2012-04-04 10:10:27 +02:00
Akim Demaille
4a11b85249 doc: fix documentation of YYERROR.
* doc/bison.texinfo (Table of Symbols): Fix the documentation
of YYERROR by copying that from "Action Features".
2012-04-04 10:10:27 +02:00
Akim Demaille
936c88d178 doc: c++: complete the location documentation.
* data/location.cc (position::initialize, location::initialize):
Also accept line and column, with default values.
* doc/bison.texinfo (C++ position, C++ location): New nodes.
Describe more thoroughly these classes.
Fix several Texinfo misuses.
2012-03-31 12:30:10 +02:00
Akim Demaille
84c1cdc71d doc: update the --verbose report format.
* doc/bison.texinfo (Understanding): Adjust to match the
current format.
(cherry picked from commit 29e20e22e0)
2012-03-19 11:13:27 +01:00
Akim Demaille
56da1e5288 doc: spell check.
* doc/bison.texinfo: here.
(cherry picked from commit 5a321748e2)

Conflicts:

	doc/bison.texinfo
2012-03-19 11:11:51 +01:00
Akim Demaille
0765d39396 doc: stmt, not stmnt.
* doc/bison.texinfo: s/stmnt/stmt/g.  This is a
much more common abbreviation for "statement".
(cherry picked from commit 0860e38311)
2012-03-19 11:11:09 +01:00
Akim Demaille
6528a99151 doc: save width.
* doc/bison.texinfo (Language and Grammar): Use the same
layout for an example in all the versions, i.e., keep
as general case what used to be used only for Info.
(cherry picked from commit 1d280c0999)
2012-03-19 11:10:50 +01:00
Akim Demaille
de6be119ca doc: reformat grammar snippets.
* doc/bison.texinfo: Convert the grammar examples to
use a narrower style.  This helps fitting into the
@smallbook constraints.
http://lists.gnu.org/archive/html/bison-patches/2012-03/msg00011.html
(cherry picked from commit 5e9b6624d7)

Conflicts:

	doc/bison.texinfo
2012-03-19 11:06:35 +01:00
Akim Demaille
ea118b7262 doc: use only @example, not @smallexample.
* doc/bison.texinfo: Convert all @smallexamples into @examples.
Adjust layout where needed.
(cherry picked from commit c93f22fcf7)

Conflicts:

	doc/bison.texinfo
2012-03-19 11:04:50 +01:00
Akim Demaille
2c0f97066e doc: style changes.
* doc/bison.texinfo: Avoid line width issues with TeX.
Upgrade ancient messages.
Move some comments to better looking places.
Add more @group.
(Mfcalc Symbol Table): Reduce variable scopes.
Prefer size_t for sizes.
Prefer declarations with an initial value.
Fix a @group environment.
(cherry picked from commit aaaa2aaef4)

Conflicts:

	doc/bison.texinfo
2012-03-19 10:57:16 +01:00
Paul Eggert
d13d14ccb2 doc: minor fixes to "Understanding" section
* doc/bison.texinfo (Understanding): Minor wording fixes and
improvements.  Fixes problems reported in
<https://savannah.gnu.org/patch/?4306>.
(cherry picked from commit 35880c82dc)
2012-03-19 10:51:32 +01:00
Akim Demaille
ab8932bfd9 doc: fix environment issues.
* doc/bison.texinfo: Do not use @verbatim, in particular when
	we use @group inside.
	Use @quotation instead of @display for frequently asked questions,
	it looks much nicer.
(cherry picked from commit 71b52b1342)

Conflicts:

	doc/bison.texinfo
2012-02-23 17:57:31 +01:00
Akim Demaille
98842516e1 doc: stylistic improvements.
* doc/bison.texinfo: Prefer "continue" to empty loop bodies.
	Add some @group/@end group to avoid poor page breaks.
(cherry picked from commit d4fca42763)

Conflicts:

	doc/bison.texinfo
2012-02-19 18:29:05 +01:00
Akim Demaille
14f4455e43 maint: address sc_prohibit_doubled_word.
* data/yacc.c, doc/bison.texinfo: Reword to avoid having to
	disable that check.
	* cfg.mk: No longer skip this test.
(cherry picked from commit 762caaf639)

Conflicts:

	data/yacc.c
2012-02-19 18:26:01 +01:00
Akim Demaille
dd5611579b maint: avoid "magic number exit".
* cfg.mk (local-checks-to-skip): No longer skip it.
	* bootstrap.conf (gnulib_modules): Add sysexits.
	* doc/bison.texinfo, etc/bench.pl.in, src/parse-gram.y,
	* src/system.h, tests/calc.at, tests/named-refs.at: Use assert
	where appropriate instead of "if (...) exit".
	Use symbolic exit status elsewhere.

Conflicts:

	doc/bison.texinfo
	src/parse-gram.y
2012-02-19 10:21:06 +01:00
Akim Demaille
0802356481 maint: more silent-rules.
* doc/local.mk, src/local.mk, examples/calc++/Makefile.am: Use
	$(AM_V_GEN) and $(AM_V_at) where appropriate.
(cherry picked from commit f67c0a1c35)

Conflicts:

	doc/local.mk
	examples/calc++/Makefile.am
	src/local.mk
2012-01-31 09:41:25 +01:00
Jim Meyering
d6864e191b doc: correct typo: s/can not/cannot/
* doc/bison.texinfo (Bug Reports): s/can not/cannot/
And remove trailing blanks.
(cherry picked from commit 411614fac4)

Conflicts:

	doc/bison.texinfo
2012-01-23 11:24:48 +01:00
Jim Meyering
10c4beb7ea maint: get gpl-3.0 from gnulib
* bootstrap.conf (gnulib_modules): Add gpl-3.0.
* doc/gpl-3.0.texi: Remove from version control, now that
we get it via gnulib.
* doc/.gitignore: Ignore it.
(cherry picked from commit b87414a05e)
2012-01-22 12:57:40 +01:00
Jim Meyering
2d48e62447 maint: get fdl.texi from gnulib
* bootstrap.conf (gnulib_modules): Add fdl.
* doc/fdl.texi: Remove file.
2012-01-15 10:58:35 +01:00
Jim Meyering
8cc3c80e8a maint: spell "file system" as two separate words
* doc/Doxyfile.in: Spell it "file system", to avoid a
"make syntax-check" failure.
2012-01-15 10:58:14 +01:00
Akim Demaille
c932d6135c maint: run "make update-copyright". 2012-01-13 11:48:14 +01:00
Joel E. Denny
8348436580 doc: clean up references to `Locations Overview'.
* doc/bison.texinfo (Locations Overview): Rename node to...
(Locations): ... this, which is its section name.  Update menus to
match that and not to use the title `Tracking Locations', which is
a different section.
2011-05-29 22:32:56 -04:00
Joel E. Denny
7404cdf3a1 doc: clean up references to `Tracking Locations'.
* doc/bison.texinfo (Locations): Rename node to...
(Tracking Locations): ... this, which is its section name, and
update all cross references.  The trouble is that there is another
node about locations.  Its section name is `Locations', which was
easily confused with the node name of this node.  Moreover, its
node name is `Locations Overview', which was mistakenly used to
label some cross references to this node.
2011-05-29 22:32:56 -04:00
Joel E. Denny
ce24f7f59b doc: clean up `Named References' a little.
* doc/bison.texinfo (Named References): Rename section to match
the node name, and update all cross references.  Don't use the
acronyms RHS and LHS given that we don't expand them anywhere in
the manual.  Try to use @samp and @code properly.  Mention that
named references are experimental as we've already stated in NEWS.
(Destructor Decl): Expand the only remaining use of RHS or LHS.
2011-05-29 22:32:32 -04:00
Joel E. Denny
7d31f09289 doc: motivate named references.
Suggested by Hans Aberg at
<http://lists.gnu.org/archive/html/bug-bison/2011-05/msg00008.html>.
* doc/bison.texinfo (Named References): Explain briefly how
they're better than the traditional positional references.
2011-05-29 20:52:42 -04:00
Joel E. Denny
908c8647de doc: discuss named references after locations.
Reported by Hans Aberg at
<http://lists.gnu.org/archive/html/bug-bison/2011-05/msg00008.html>.
* NEWS (2.5.1): Document.
* doc/bison.texinfo (Named References): Because it discusses
locations in addition to semantic values, move this subsection out
of the section `Defining Language Semantics', where locations have
not yet been introduced, to be a new section after the following
section, `Tracking Locations'.
2011-05-29 20:52:00 -04:00
Joel E. Denny
a898435b25 gnulib, autoconf: update.
* README-hacking (Updating a submodule): Give advice on how to
determine the versions of gnulib and autoconf to which we should
update.
(Release Procedure): Note that submodules should be updated.
* bootstrap.conf (gnulib_modules): Rename pipe to spawn-pipe as
suggested in updated gnulib NEWS.
* gnulib: Choose a stable snapshot according to advice in Bison's
README-hacking.
* po/POTFILES.in (lib/pipe.c): Rename to...
(lib/spawn-pipe.c): ... this.
* src/output.c: Update to include spawn-pipe.h.
* submodules/autoconf: Update to latest for improvement in m4.m4
that excludes M4 with buggy strstr.  The only other changes to
files that we use are copyright updates.
2011-04-16 14:59:32 -04:00