| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Reported by Giorgos Pap.
<https://lists.gnu.org/r/bug-bison/2022-08/msg00002.html>
* examples/test: Discard "Picked up _JAVA_OPTIONS:" messages.
|
|
|
|
|
|
| |
* examples/c/glr/c++-types.y, tests/cxx-type.at (lineNum, colNum):
Rename as...
(line_num, col_num): these.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Suuggested by Frank Heckenbach.
<https://lists.gnu.org/r/bug-bison/2022-01/msg00000.html>
* doc/bison.texi (Location Type): Explain why location's "column" are
defined vaguely.
Show tab handling in ltcalc and calc++.
* examples/c/bistromathic/parse.y: Show tab handling.
* examples/c++/calc++/calc++.test,
* examples/c/bistromathic/bistromathic.test:
Check tab handling.
|
|
|
|
| |
Run "make update-copyright".
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Dennis Clarke
<https://lists.gnu.org/r/bug-bison/2021-10/msg00005.html>.
In particular
<https://lists.gnu.org/r/bug-bison/2021-10/msg00023.html>.
* doc/bison.texi, examples/c/glr/c++-types.y,
* examples/c/bistromathic/parse.y tests/testsuite.h:
Define _XOPEN_SOURCE to 600, to get a strdup that works on Solaris.
* tests/glr-regression.at: Use strdup freely.
|
|
|
|
|
| |
* examples/c/glr/c++-types.y: Use snake_case identifiers.
Prefer strdup to malloc+strcpy.
|
|
|
|
| |
* examples/c/glr/c++-types.test: Split in several small test cases.
|
|
|
|
|
|
|
|
|
|
|
| |
Let's use c++/glr to demonstrate custom error messages in C++ (not
just in glr2.cc).
* examples/c++/glr/c++-types.yy (report_syntax_error): New.
* examples/c++/glr/c++-types.test: Adjust.
* examples/c/bistromathic/parse.y: Comment changes.
* tests/local.at (AT_YYERROR_DEFINE(c++)): Use a nicer way to print
the lookakead's name.
|
|
|
|
|
|
|
| |
Follow the GNU Coding Style.
* doc/bison.texi, examples/c++/glr/c++-types.yy,
* examples/c/glr/c++-types.y, tests/cxx-type.at: s/stmtMerge/stmt_merge/g.
|
|
|
|
|
|
|
|
|
| |
Besides, for mysterious reasons, this fails on some environment.
Reported by Dagobert Michelsen.
<https://lists.gnu.org/archive/html/bug-bison/2021-08/msg00008.html>
* examples/c/lexcalc/lexcalc.test, examples/c/lexcalc/parse.y,
* examples/c/lexcalc/scan.l: Revert to a single-start example.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some cases readline emits a trailing spaces after the last
suggestion, which results in errors such as:
```
-( - atan cos exp ln number sin sqrt$
+( - atan cos exp ln number sin sqrt $
```
Reported by Christopher Nielsen <mascguy@github.com>.
<https://trac.macports.org/ticket/59927#comment:48>
<https://trac.macports.org/attachment/ticket/59927/bison-3.7.6-test-10.13.test-suite.log>
* examples/test (run): Add support for -t.
* examples/c/bistromathic/bistromathic.test: Use it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* examples/c++/Makefile, examples/c++/calc++/Makefile,
* examples/c++/glr/Makefile, examples/c/bistromathic/Makefile,
* examples/c/calc/Makefile, examples/c/glr/Makefile,
* examples/c/lexcalc/Makefile, examples/c/mfcalc/Makefile,
* examples/c/pushcalc/Makefile, examples/c/reccalc/Makefile,
* examples/c/rpcalc/Makefile, examples/d/calc/Makefile,
* examples/d/simple/Makefile, examples/java/calc/Makefile,
* examples/java/simple/Makefile:
Use --html to generate *.html directly.
No longer demonstrate --xml.
No longer show rules for xml to html.
Use --header, not --defines.
Use --graph without specifying the output file now that we
generate *.gv by default.
|
|
|
|
|
| |
* doc/bison.texi: Use @samp, not "...", around pieces of code.
* examples/d/calc/calc.y: Don't promote %union.
|
|
|
|
| |
* examples/d/calc/calc.y: Use the token constructors in the 'calc' example.
|
|
|
|
|
| |
* examples/d/calc/calc.y: Use a parser of type 'push' in the calc
example.
|
|
|
|
|
|
|
| |
* examples/c/bistromathic/parse.y, examples/c/glr/c++-types.y,
* examples/c/lexcalc/parse.y: Use const where appropriate.
Avoid `yy` prefixes where it does not make sense.
Avoid the `p` prefix for pointers.
|
|
|
|
|
|
| |
* examples/c/bistromathic/parse.y, examples/c/glr/c++-types.y,
* examples/c/lexcalc/parse.y: Don't use the private internal detail
`YY_LOCATION_PRINT`, use `YYLOCATION_PRINT`.
|
|
|
|
|
| |
* examples/c/bistromathic/parse.y (location_print): New.
Use it.
|
|
|
|
|
|
|
|
|
|
| |
That change was started in Bison 3.4. The announcement for 3.7 stated
that in Bison 3.8 we would use *.gv by default.
* src/files.c (compute_output_file_names): spec_graph_file defaults
too *.gv.
* doc/bison.texi, examples/c++/calc++/local.mk, tests/output.at:
Adjust.
|
|
|
|
| |
Also, fix a few http: URLs that were no longer working.
|
|
|
|
|
|
| |
* examples/local.mk (check-examples): New.
* tests/local.mk (check-tests): New.
* README-hacking.md: Document them.
|
|
|
|
| |
* examples/c/bistromathic/parse.y: Add missing calls to _.
|
|
|
|
|
|
|
|
| |
* data/skeletons/lalr1.d (YYLocation.step): New.
* examples/d/calc/calc.y (Lexer): Reduce scopes to avoid uninitialized
varibles.
Factor the handling of locations.
We don't need lenChars.
|
|
|
|
|
|
|
| |
The Symbol constructor does not use it, so it is easier to not use
Value at all.
* examples/d/calc/calc.y: Here.
|
|
|
|
|
|
|
| |
From Dlang v2.095.0 onwards, std.conv.parse reports the number of
consumed characters.
* examples/d/calc/calc.y: Here.
|
|
|
|
| |
* examples/d/simple/calc.y: Formatting changes.
|
|
|
|
|
|
|
| |
* examples/c++/glr/local.mk, examples/c/glr/local.mk (CLEANFILES):
Complete to fix distcheck.
* src/output.c (merger_output): Obfuscate to pacify syntax-check's
sc_space_before_open_paren.
|
|
|
|
| |
Run 'make update-copyright'.
|
|
|
|
|
|
|
|
|
|
| |
Gettext uses "catalog", not "catalogue".
* doc/bison.texi, examples/c/README.md,
* examples/c/bistromathic/Makefile,
* examples/c/bistromathic/README.md,
* examples/c/bistromathic/parse.y:
Spell check.
|
|
|
|
|
|
|
| |
* data/skeletons/glr2.cc: Add support for api.token.constructor.
* examples/c++/glr/c++-types.yy: Use it.
* examples/c++/glr/c++-types.test: Adjust expectations for error
messages.
|
|
|
|
| |
* examples/c++/glr/c++-types.yy: We need C++ 11 (we use shared_ptr).
|
|
|
|
|
|
|
|
|
|
| |
The locations are actually false: they should include the location of
the semicolon (we print statements), but they don't.
* examples/c++/glr/c++-types.test, examples/c++/glr/c++-types.yy,
* examples/c/glr/c++-types.test, examples/c/glr/c++-types.y,
* tests/cxx-type.at:
Fix locations and adjust expectations.
|
|
|
|
|
|
|
|
|
| |
Without the history, D should not support this option. Before the
removal, 'detailed' and 'verbose' options generated the same code.
* data/skeletons/lalr1.d: Here.
* doc/bison.texi: Adapt tests to use 'detailed' instead of 'verbose'.
* tests/calc.at: Document it.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we display the addresses of the semantic values. Instead,
print the values.
Add support for YY_USE across languages.
* data/skeletons/c.m4, data/skeletons/d.m4 (b4_use): New.
* data/skeletons/bison.m4 (b4_symbol_actions): Use b4_use to be
portable to D.
Add support for %printer, and use it.
* data/skeletons/d.m4: Instead of duplicating what's already in
c-like.m4, include it.
(b4_symbol_action): New.
Differs from the one in bison.m4 in that it uses yyval/yyloc instead
of *yyvaluep and *yylocationp.
* data/skeletons/lalr1.d (yy_symbol_print): Avoid calls to formatting,
just call write directly.
Use the %printer.
* examples/d/calc/calc.y: Specify a printer.
Enable traces when $YYDEBUG is set.
* tests/calc.at: Fix the use of %printer with D.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(Bison) Variants are extremely picky, which makes them both
annoying (lots of micro-details must be taken care of) and
precious (all the micro-details must be taken care of, in particular
object lifetime).
So (i) each time a semantic value is stored, it must be stored in a
place that exists, and (ii) each time a semantic value is discarded,
its place must have been emptied.
Example of (i)
- new (&yys.value ()) value_type (s->value ());
+ {]b4_variant_if([[
+ new (&yys.value ()) value_type ();
+ ]b4_symbol_variant([yy_accessing_symbol (s->yylrState)],
+ [yys.value ()], [copy], [s->value ()])], [[
+ new (&yys.value ()) value_type (s->value ());]])[
+ }
Example of (ii)
yyparser.yy_destroy_ ("Error: discarding",
- yytoken, &yylval]b4_locations_if([, &yylloc])[);
+ yytoken, &yylval]b4_locations_if([, &yylloc])[);]b4_variant_if([[
+ // Value type destructor.
+ ]b4_symbol_variant([[YYTRANSLATE (this->yychar)]], [[yylval]], [[template destroy]])])[
this->yychar = ]b4_namespace_ref[::]b4_parser_class[::token::]b4_symbol(empty, id)[;
However, in some places we must not be "pure". In particular:
glr_stack_item (const glr_stack_item& other) YY_NOEXCEPT YY_NOTHROW
: is_state_ (other.is_state_)
{
std::memcpy (raw_, other.raw_, union_size);
}
still must use memcpy, because the constructor would change pred, and
it must not. This constructor is used only when resizing the stack,
in which case pred (which is relative) must not be "adjusted".
The result works, but is messy. Its verbosity comes from at least two
factors:
- we don't have support for complete symbols (binding kind, value and
location), and we should at least try to have it. That simplified
lalr1.cc a lot.
- I have not tried to be smart and use 'move' when possible. As a
consequence many places have 'copy' and then 'destroy'. That kind
of clean up can be done once everything appears to be solid.
* data/skeletons/glr2.cc: Be more rigorous in object lifetime.
In particular, don't forget to discard the lookahead when we're done
with it.
Call variant routines where needed.
Deal with plenty of details.
(b4_call_merger): Add support for variants.
Use references in mergers, rather than pointers.
* examples/c++/glr/c++-types.yy: Exercise variants.
|
|
|
|
|
|
| |
* examples/c/glr/c++-types.y: Flush stdout so that the logs (on
stderr) and the effective output (on stdout) mix correctly.
While at it, be a bit more const-correct.
|
|
|
|
| |
* examples/c++/glr/c++-types.yy: Here.
|
|
|
|
|
| |
* examples/c/glr/c++-types.y: Add a space after the commas.
* examples/c/glr/c++-types.test: Adjust expectations.
|
|
|
|
|
|
|
|
|
| |
* examples/c/glr/c++-types.y (node_print): New.
Use YY_LOCATION_PRINT instead of duplicating it.
And actually use it in the action instead of badly duplicating it.
(main): Add proper option support.
* examples/c/glr/c++-types.test: Adjust expectations on locations.
* examples/c++/glr/c++-types.yy: Fix bad iteration.
|
|
|
|
|
|
|
| |
This will save us from generating the position.hh file.
* src/parse-gram.y: Claim we are 3.8.
* examples/c++/glr/c++-types.yy: Require 3.8.
|
|
|
|
|
|
|
|
|
|
|
| |
Reported by Jot Dot.
https://lists.gnu.org/r/help-bison/2020-12/msg00014.html
* data/skeletons/glr.c, data/skeletons/glr2.cc (b4_call_merger): Use
the symbol's slot, not its type.
* examples/c/glr/c++-types.y: Use explicit per-symbol typing together
with api.value.type=union.
(yylex): Use yytoken_kind_t.
|
|
|
|
|
|
| |
* examples/c++/glr/c++-types.yy: Formatting changes.
Remove unused support for '@'.
* examples/c/glr/c++-types.y: Ditto.
|
|
|
|
|
|
|
|
| |
* data/skeletons/README-D.txt: Remove, now useless and obsolete.
* data/skeletons/glr2.cc, examples/d/calc/calc.y,
* tests/calc.at, tests/d.at, tests/scanner.at (semanticVal): Replace
with...
(value): this.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We always refer to the triplet "kind, value, location". All of them
are nouns, and we support api.value.type and api.location.type. On
this regard, "semantic_type" was a poor choice. Make it "value_type".
The test suite was not updated to use value_type, on purpose, to
enforce backward compatibility.
* data/skeletons/c++.m4, data/skeletons/glr.cc, data/skeletons/glr2.cc,
* data/skeletons/variant.hh, doc/bison.texi: Define value_type rather
than semantic_type.
Add a backward compatibility typedef.
* examples/c++/glr/c++-types.yy: Migrate.
|
|
|
|
|
|
|
|
|
|
|
| |
The complete symbol approach in yylex removes the need for the methods
semanticVal, startPos and endPos, which were used when the values were
reported separately.
* data/skeletons/lalr1.d: Here.
* doc/bison.texi: Remove sections about the three methods.
* examples/d/calc/calc.y, examples/d/simple/calc.y: Remove the unused methods.
* tests/calc.at, tests/d.at, tests/scanner.at: Test it.
|
|
|
|
|
|
|
|
| |
* examples/c/glr/c++-types.y: Formatting changes.
* po/POTFILES.in: Add missing files.
* src/reader.c: Remove useless include.
* tests/calc.at: Avoid magic values for exit.
Obfuscate calls to error.
|
|
|
|
|
|
|
|
| |
* data/skeletons/d.m4 (b4_public_types_declare): Here.
* data/skeletons/lalr1.d: Adjust.
* doc/bison.texi: Document it.
* examples/d/calc/calc.y: Use it.
* tests/calc.at: Test it.
|
|
|
|
|
|
| |
* data/skeletons/d.m4: Here.
* data/skeletons/lalr1.d, examples/d/calc/calc.y, examples/d/simple/calc.y: Adjust.
* tests/calc.at, tests/d.at, tests/scanner.at: Test it.
|
|
|
|
|
|
|
| |
* data/skeletons/d.m4: Here.
* doc/bison.texi: Document it.
* examples/d/calc/calc.y: Adjust.
* tests/calc.at: Test it.
|
|
|
|
|
|
|
| |
* examples/d/calc/calc.y (start, end): Replace by this...
(location): new member variable in the Lexer class.
Use it.
* tests/calc.at: Use the defined location variable.
|