profile
viewpoint
Akim Demaille akimd Faveod Paris, France

akimd/bison 61

GNU Bison

akimd/boost.m4 2

M4 macros to use Boost with the autotools

akimd/jagger 2

Assignment: Java implementation of Tigger

akimd/a2ps 1

GNU a2ps

akimd/arel-extensions 1

Extending Arel

akimd/CppCoreGuidelines 1

The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++

akimd/io 1

Io programming language

akimd/tini 1

A tiny but valid `init` for containers

akimd/urbi 1

Robotic programming language

push eventakimd/bison

Akim Demaille

commit sha defaa971aecf647cf6a4c90dd873868b23be50ca

avoid useless actions in examples and tests * tests/glr-regression.at, tests/java.at, tests/torture.at, * examples/c/lexcalc/parse.y, examples/c/reccalc/parse.y: here. * src/parse-gram.y: Likewise. Style changes.

view details

Akim Demaille

commit sha f28c1e30e7ad038cc18d960ab11e83b65709740f

regen

view details

Akim Demaille

commit sha f7022e06ae635661cd6f290b4ead6e11291d9558

diagnostics: report useless actions In order for the useless chain productions to work properly, there should not be actions that make explicit the default behavior. * src/scan-code.l (strspacecmp, useless_default_action): New. (translate_action): Report useless actions. * src/reader.c (grammar_rule_check_and_complete): Don't trigger this warning when generating explicit actions for C++. * tests/actions.at (Useless default actions): New.

view details

Akim Demaille

commit sha 7eca84566d6d9db5c9f01f0ade7ab9f0ea5a31fc

doc: document -Wuseless-action * doc/bison.texi, src/getargs.c, NEWS: here.

view details

push time in 7 minutes

push eventakimd/bison

Akim Demaille

commit sha 44cdc0f001268a93ede62a94062becdd0cc73860

gnulib: update

view details

Akim Demaille

commit sha ad32ec64c8f3edccfb7f44606bbb85f97b10bb16

style: pacify syntax-check * cfg.mk: No need to translate *.md files. * data/skeletons/glr.c, data/skeletons/yacc.c: Fix space issues.

view details

Akim Demaille

commit sha 7d9839c4a8d38deddf62a9340c6a56d50a296646

version 3.4.91 * NEWS: Record release date.

view details

Akim Demaille

commit sha 98f19578aa2ee259e3503ae710ef84c20e171d87

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

Akim Demaille

commit sha b92f064e9bf0cb4fdf725d462d019141e3c6b6f0

doc: more details about the test suite * README-hacking.md: here.

view details

Akim Demaille

commit sha 28369ecb5d4184f4bed8cccd9e8e018a3d985c75

tests: avoid creating files whose name collide with standard headers Having a file named "exception" is risky: the compiler might use that file in #include. Reported by 马俊 <majun123@whu.edu.cn>. * tests/local.at (AT_SKIP_IF_EXCEPTION_SUPPORT_IS_POOR): Generate 'exceptions', not 'exception'.

view details

Akim Demaille

commit sha 2f7097d1b1414fe8ac28e128c1e12b440f54b2f2

yacc.c, glr.c: fix crash when reporting errors in consistent states The current code for yysyntax_error for %define parse.error verbose is fishy (given that YYEMPTY is -2, invalid argument for yytname[]): static int yysyntax_error ([...]) { YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); [...] if (yytoken != YYEMPTY) A nearby comment reports The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". So it _is_ possible to call yysyntax_error with yytoken == YYEMPTY, albeit quite difficult when meaning to, so virtually impossible by accident (after all, there was never a bug report about this). I failed to produce a test case, but Joel E. Denny provided me with one (added to the test suite below). The yacc.c skeleton fails on this, and once fixed dies on a second problem. The glr.c skeleton was also dying, but immediately of this second problem. Indeed we were not allocating space for the error message's final \0. This was hidden by the fact that we only had error messages with at least an unexpected token displayed, so with at least one "%s" in the format string, whose size (2) was included (incorrectly) in the final size of the message (where the %s have been replaced by the actual content). * data/skeletons/glr.c, data/skeletons/yacc.c (yysyntax_error): Do not invoke yytnamerr on YYEMPTY. Clarify the computation of the length of the _final_ error message, with the NUL terminator but without the '%s's. * tests/conflicts.at (Syntax error in consistent error state): New, contributed by Joel E. Denny.

view details

Akim Demaille

commit sha 24c5214ae840b1b3b5f98a29d5967779cc9a5b5a

glr: remove useless casts Reported by GCC's -Wuseless-cast. * data/skeletons/glr.c: Don't cast to yybool, it's useless.

view details

Akim Demaille

commit sha 9471a5ffe95b519fe386a067513d65237253c582

glr: style change * data/skeletons/glr.c (YYDPRINTF): Expand into an empty statement, instead of nothing. Simplify callers.

view details

Akim Demaille

commit sha a4bf7cdf9ebd2250df98aadb907f31fc88a5434e

c++: remove useless cast about yyeof_ Reported by Frank Heckenbach. https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00016.html * data/skeletons/c++.m4 (b4_yytranslate_define): Don't use yyeof_ as if it had two different types. It is used once against the input argument, which is the value returned by yylex, which is an "external token number", typically an int. It is also used as output type, an "internal symbol number". It turns out that in both cases we mean "0", but let's keep yyeof_ only for the case "internal symbol number", i.e., _after_ conversion by yytranslate. This frees us from one cast.

view details

Akim Demaille

commit sha 6a61b6b17ead27f659083cf5ce2faa5f63911ff6

c++: improve typing * data/skeletons/lalr1.cc (yysyntax_error_): symbol_type::type_get returns a symbol_number_type (which is indeed an int).

view details

Akim Demaille

commit sha 6f92a7f664470b87d65a9800fc50baa067308fc9

c++, d, java: remove yyerrcode It is not used at all. We will remove it also from yacc.c, but later (see TODO). * data/skeletons/lalr1.cc, data/skeletons/lalr1.d, * data/skeletons/lalr1.java (yyerrcode_): Remove.

view details

Akim Demaille

commit sha 869028a66dabe6f25bcb23e433a9095921d642b0

d, java: get rid of a useless table * data/skeletons/lalr1.d, data/skeletons/lalr1.java (yytoken_number_): Remove, useless. Was used in ancient C skeletons to support YYPRINT, long obsoleted by %printer.

view details

Akim Demaille

commit sha 9b4f0970feba29cc3e4b04a313dd5c8ee743873c

d, java: improve yytranslate and neighbors * data/skeletons/lalr1.d, data/skeletons/lalr1.java: Don't expose yyuser_token_number_max_ and yyundef_token_. Do as in C++: scope them into yytranslate_, and only when api.token.raw is not defined. (yyterror_): Rename as... (yy_error_token_): this. * data/skeletons/lalr1.d (token_number_type): New. Use it. Can't be done in the Java backend, as Java does not have type aliases.

view details

Akim Demaille

commit sha 94f70bd861a8a701826880afe9fbb09fb56612c8

c++: clean a few issues wrt special tokens The C++ implementation of LAC did not skip the $undefined token, probably because it was not exposed. Expose it, and use clearer names. * data/skeletons/c++.m4: Don't define undef_token_ in yytranslate_, but... * data/skeletons/lalr1.cc (yy_undef_token_): here. Use a more precise type to define yy_undef_token_ and yy_error_token_. Unfortunately we move from a compile-time value defined via an enum to a static const member. Eventually we should make it constexpr. Make LAC implementation more alike yacc.c's one.

view details

Akim Demaille

commit sha 478cb5cf12fb6ac0f3b34077fed70a29c5eefca8

c++: remove useless cast about user_token_number_max_ Reported by Frank Heckenbach. https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00016.html The cast is needed when yytranslate_'s argument type is token_type, i.e., when api.token.constructor is defined. 373. types.at:138: testing lalr1.cc api.value.type=variant api.token.constructor ... ======== Testing with C++ standard flags: '' ../../tests/types.at:138: bison --color=no -fno-caret -o test.cc test.y ../../tests/types.at:138: $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS -o test test.cc $LIBS stderr: test.cc:966:16: error: result of comparison of constant 257 with expression of type 'yy::parser::token_type' (aka 'yy::parser::token::yytokentype') is always true [-Werror,-Wtautological-constant-out-of-range-compare] else if (t <= user_token_number_max_) ~ ^ ~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. It is because it is expected that when api.token.constructor is defined, only symbol constructors will be used, that yytranslate_ then takes a token_type. But it is wrong: we still allow literal characters in this case, as demonstrated by test 373 for instance. %define api.value.type variant %define api.token.constructor %token <std::pair<int, int>> '1' '2'; [...] static yy::parser::symbol_type yylex () { static char const input[] = "12"; int res = input[toknum++]; typedef yy::parser::symbol_type symbol; if (res) return symbol (res, std::make_pair (res - '0', res - '0' + 1)); else return symbol (res); } So let yytranslate_ always take an int, which makes the cast truly useless. * data/skeletons/c++.m4, data/skeletons/lalr1.cc (yytranslate_): here.

view details

Akim Demaille

commit sha 8c87a62308a2b60adca823f10e3693cd9c221b90

c++: get rid of symbol_type::token () It is not used. And its implementation was wrong when api.token.raw was defined, as it was still mapping to the external token numbers, instead of the internal ones. Besides it was provided only when api.token.constructor is defined, yet always declared. * data/skeletons/c++.m4 (by_type::token): Remove, useless.

view details

Akim Demaille

commit sha 8b53f4e022eff4c54ce1916aefec8a04cad6be97

glr.c: style changes * data/skeletons/glr.c (yysplitStack): Reduce scopes. * tests/atlocal.in: Formatting changes.

view details

Akim Demaille

commit sha 9e9e49224fb4a7fae7b98205e1165fbfcea2453f

diagnostics: style changes * src/complain.h, src/complain.c: Comment changes. * src/scan-skel.l: Reduce scopes. * data/skeletons/bison.m4: Factor diagnostic functions.

view details

Akim Demaille

commit sha f8d82ff03900c109efb57634299d7d180ce60987

warnings: enable -Wuseless-cast, and eliminate warnings Prompted by Frank Heckenbach. https://lists.gnu.org/archive/html/bug-bison/2019-11/msg00016.html. * configure.ac (warn_cxx): Add -Wuseless-cast. * data/skeletons/c.m4 (b4_attribute_define): Define YY_IGNORE_USELESS_CAST_BEGIN and YY_IGNORE_USELESS_CAST_END. * data/skeletons/glr.c (YY_FPRINTF): New, replaces YYFPRINTF, wrapped with YY_IGNORE_USELESS_CAST_BEGIN and YY_IGNORE_USELESS_CAST_END. (YY_DPRINTF): Likewise. * tests/actions.at: Remove useless cast. * tests/headers.at: Adjust.

view details

push time in 34 minutes

push eventakimd/bison

Akim Demaille

commit sha d9d37a11963f969a84865f1196ce018adf63085b

i18n: don't push too hard for '…' Suggested by Paul Eggert. * src/location.c (ellipsis): Clarify comment for translators.

view details

Akim Demaille

commit sha 59cb1f421cfa273b8d638d099981714371e3b191

d: comment changes * data/skeletons/lalr1.d: Here.

view details

Akim Demaille

commit sha c483b6593fba38b4b1637e946f496eb0c8edfdb2

tests: refactor the handling of Perl Let's make a difference between places where Perl is required for the test (AT_PERL_REQUIRE), and the places where it's used to run the test, but it's not not to run the test (AT_PERL_CHECK). * tests/local.at (AT_REQUIRE): New. (AT_PERL_CHECK, AT_PERL_REQUIRE): New. Use them where appropriate. * tests/local.mk ($(TESTSUITE)): Beware not to start the line with '-pi' if Perl is empty, as Make understands this as "it's ok to fail". Which it is not.

view details

Akim Demaille

commit sha 8631f35bf90942f0bbd7009d149ecf6f3fb1e398

tests: factor the generation of files without the final eol AFAICT Autotest 2.69 still does not support AT_DATA without the final eol. * tests/local.at (AT_DATA_NO_FINAL_EOL): New. * tests/input.at: Use it.

view details

Akim Demaille

commit sha ab3621678a582e7bde46482cf970ffb6b1ef154d

tests: use a portable 'truncate' implementation Suggested by Paul Eggert. https://lists.gnu.org/archive/html/bison-patches/2019-10/msg00044.html * tests/local.at (AT_DATA_NO_FINAL_EOL): Use dd instead of perl.

view details

Akim Demaille

commit sha 2a0185b69323756acacf0e88ae5071c5993ce041

tests: avoid $(...) Reported by Paul Eggert. * tests/local.at (AT_DATA_NO_FINAL_EOL): here.

view details

Akim Demaille

commit sha a428a9fa6c9701cf65932fef68eeeccf683ac945

yacc: style changes * data/skeletons/yacc.c: Move call to lac discard to clarify the shifting of the token. Like in lalr1.cc.

view details

Akim Demaille

commit sha d563a0170965a82f6c7d9d4021c47e86db3cde17

glr: style changes * data/skeletons/glr.c (yytnamerr): here. (yyprocessOneStack): Initialize variables.

view details

Akim Demaille

commit sha e5cbac98b66ddb61fbbadfc77ffcfcd87ea3cb71

yacc: rename types for states * data/skeletons/yacc.c (yy_state_num): Rename as... (yy_state_t): this. (yy_state_fast_t): New. Use it.

view details

Akim Demaille

commit sha ee35055b490dc01faaa7310f4ed84dda0031c26c

TODO: update

view details

Akim Demaille

commit sha b47340982b38e5583b444454e5b6035cb33e1d9c

TODO: more updates

view details

Paul Eggert

commit sha 68cc2631a4dddc7e1ee091278874bbd11195da9b

autoconf:update

view details

Paul Eggert

commit sha 08dd5e9feb9690d80fe920252d169232e4b183a0

gnulib:update

view details

Paul Eggert

commit sha 7a557ee7fe7d18400a161c696a8ad32d374caf5e

c: improve port of stdint.h usage to pre-C99 Oracle Solaris Studio 12.3 (Sun C 5.12 2011/11/16) by default does not conform to C99; it defines __STDC_VERSION__ to be 199409L, so the Bison code does not include <stdint.h> (not required by C89 amendment 1) even though this compiler does have <stdint.h>. On this platform <limits.h> defines INT_LEAST8_MAX (POSIX allows this) so the skeleton got confused and thought that <stdint.h> had been included even though it wasn’t. * data/skeletons/c.m4 (b4_c99_int_type_define) [!__PTRDIFF_MAX__]: Always include <limits.h>. (YY_STDINT_H): Define when <stdint.h> was included. All uses of expressions like ‘defined INT_LEAST8_MAX’ changed to ‘defined YY_STDINT_H’, since Sun C 5.12 <limits.h> defines macros like INT_LEAST8_MAX but does not declare types like int_least8_t.

view details

Paul Eggert

commit sha 83c9051a64e70b07904a0f6abe7988f75e59884e

c: port YY_ATTRIBUTE_UNUSED to Sun C 5.12 Sun C 5.12 defines __SUNPRO_C to 0x5120 but diagnoses ‘__attribute__ ((__unused__))’. Change the ifdefs to use the same method as Gnulib in this area. * data/skeletons/c.m4 (YY_ATTRIBUTE): Remove, since not all attributes were added in the same compiler version. (YY_ATTRIBUTE_PURE, YY_ATTRIBUTE_UNUSED): Use specific GCC version for each attribute. Pay no attention to __SUNPRO_C. * tests/headers.at (Several parsers): Tighten tests accordingly.

view details

Paul Eggert

commit sha 15c1b913cf0831cba7c1e57d656134e4a630dee2

bison: check version numbers more carefully * src/parse-gram.y: Include intprops.h. (handle_require): Don’t indulge in undefined behavior if the major or minor number is out of range. Instead, check that the resulting value is nonnegative, fits in int, and that the minor number is less than 100. Also, check that a number was parsed.

view details

Paul Eggert

commit sha 052215a138ab6a4091d59ba95565e2d0cef5f35f

bison: check for int overflow when scanning * src/scan-gram.l: Include errno.h, for errno. (scan_integer, handle_syncline): Check for integer overflow. * tests/input.at (too-large.y): Adjust to match new diagnostics.

view details

Paul Eggert

commit sha 8a4ec5d4e4decd58a151b68ab0288b0925124dc0

bison: check for int overflow in token numbers * src/symtab.c: Include intprops.h (symbol_user_token_number_set): Don’t allow user_token_number == INT_MAX because too much other code adds 1 to the user token number. (symbols_token_translations_init): Complain on integer overflow instead of indulging in undefined behavior.

view details

Paul Eggert

commit sha 071f43d5b757dd4a1914847759419ba7fb968be3

tests: port to Solaris 10 sed As documented in the Autoconf manual, Solaris 10 sed rejects script labels contianing more than 7 characters. POSIX requires support for at least 8 characters, but we might as well be portable to Solaris 10 which is still supported. * tests/local.at (AT_SETS_CHECK): Use only the first 7 characters in sed labels.

view details

Paul Eggert

commit sha 5c2c9fcb17a912835a9b0632d4e8d1a5e79fc2da

tests: port to Solaris 10 grep * tests/scanner.at (Token numbers: $1): Use $EGREP, not grep -E.

view details

push time in an hour

push eventakimd/bison

Akim Demaille

commit sha 6c666b1df574a663dff2497effdbb58d573060b0

reader: get ready to create several initial rules * src/reader.c (create_start_rule): New. Use it.

view details

Akim Demaille

commit sha b31c26625d8e260f3a879107b6b88eb34eccb9bc

parser: expose a list of symbols * src/parse-gram.y (%type): Also use current_class. (symbol_decl.1): Rename as... (symbols.1): this.

view details

Akim Demaille

commit sha 9823e7c4ebb6f65d8c698407d89a192f9d51ec52

regen

view details

Akim Demaille

commit sha 4d3b3b8f82ee7337dda2544cc6573e68fdaeb1ef

multistart: turn start symbols into rules on $accept Now that the parser can read several start symbols, let's process them, and create the corresponding rules. * src/parse-gram.y (grammar_declaration): Accept a list of start symbols. * src/reader.h, src/reader.c (grammar_start_symbol_set): Rename as... (grammar_start_symbols_set): this. * src/reader.h, src/reader.c (start_flag): Replace with... (start_symbols): this. * src/reader.c (grammar_start_symbols_set): Build a list of start symbols. (switching_token, create_start_rules): New. (check_and_convert_grammar): Use them to turn the list of start symbols into a set of rules. * src/reduce.c (nonterminals_reduce): Don't complain about $accept, it's an internal detail. (reduce_grammar): Complain about all the start symbols that don't derive sentences. * src/symtab.c (startsymbol, startsymbol_loc): Remove, replaced by start_symbols. symbols_pack): Move the check about the start symbols to... * src/symlist.c (check_start_symbols): here. Adjust to multiple start symbols. * tests/reduce.at (Empty Language): Generalize into... (Bad start symbols): this.

view details

Akim Demaille

commit sha 755dbb01a0262cb388e5f3e487a76baea7a4be16

regen

view details

Akim Demaille

commit sha 766350fde56590ec53a8f4840717cf6c932d94f3

multistart: adjust computation of initial core and adjust reports Currently the core of the initial state is limited to the single rule on $accept. * src/lr0.c (generate_states): There may now be several rules on $accept. * src/graphviz.c (conclude_red): Recognize "final" transitions by the fact that we reduce to "$accept". * src/print.c (print_reduction): Likewise. * src/print-xml.c (print_reduction): Likewise.

view details

Akim Demaille

commit sha 3d821b516f1689372854a888fd9bddc22040af38

multistart: also check the HTML report We don't actually have checks for HTML, so let's do it for multistart. * tests/report.at: here.

view details

Akim Demaille

commit sha 8e953a3f4266264c7414890a06e2ff6435bdc2a2

multistart: pass the list of start symbols to the backend * src/output.c (start_symbols_output): New. (muscles_output): Use it.

view details

Akim Demaille

commit sha 4bd143bccf3381b643dddda67805128c171f1cb4

multistart: equip yacc.c * data/skeletons/yacc.c: Add support for multiple start symbols.

view details

Akim Demaille

commit sha e38c0662ca26d33dc5081642a9f80d6c403a414e

multistart: toy with it in lexcalc * examples/c/lexcalc/parse.y: Define several start symbols. * examples/c/lexcalc/lexcalc.test: Check support.

view details

Akim Demaille

commit sha 332d07fe2270e3d529c3ae5ab1bd062b8bcf2609

todo: more

view details

Akim Demaille

commit sha b0428d5633b1d55078d6292ae46a73e6e54a51ff

multistart: skip the checking for all the generated rules So far we were not checking the generated rule 0 at all. Now there can be several of them. Instead of not checking at all, let's be more selective on the check to run on them. * src/reader.c (grammar_rule_check_and_complete): Don't check for value usage for generated rules, it is ok to have a valued start symbol, in which case it is ok for the generated rule ("accept: start $end {}") to not use $1. (packgram): Call grammar_rule_check_and_complete for all the rules.

view details

Akim Demaille

commit sha 0f608132b6a408ab989f418472a42e80e0c03908

WIP: multistart: generate action to get the parse result

view details

Akim Demaille

commit sha 2dbe3a005c0065bef5db54bc1da56c24dc0880d5

WIP: multistart: use b4_accept instead of action post-processing

view details

push time in a day

push eventakimd/bison

Akim Demaille

commit sha b4d18c7fc61fcdb23936958363611cc1517c9c40

version 3.6.90 * NEWS: Record release date.

view details

Akim Demaille

commit sha 7c0d36b7604cdace3034ed884d8ca94f1025344b

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

Akim Demaille

commit sha 964fb2aa6f610db61c2af717f036dcada52b8766

examples: include the generated header * examples/c/bistromathic/parse.y, examples/c/lexcalc/parse.y, * examples/c/reccalc/parse.y: here. Add some comments. * src/parse-gram.y (api_version): Pull out of handle_require. Bump to 3.7.

view details

Akim Demaille

commit sha 5f95583da77a92430faea6563c36c0d86dd73eeb

regen

view details

Akim Demaille

commit sha 238692ad77e7bdceaadc400e391783397855bb87

doc: more details about symbols in m4 * data/README.md: here. * README-hacking.md (Vocabulary): More.

view details

Akim Demaille

commit sha 49f1e5f42813f9d8bccedac9e5108b59ae71e8b7

style: update comments in the skeletons * data/skeletons/c++.m4, data/skeletons/glr.c, data/skeletons/lalr1.d, * data/skeletons/lalr1.java, data/skeletons/yacc.c: Be more accurate about yychar and yytoken. Don't name local variables as if they were members.

view details

Akim Demaille

commit sha 0820f16ca8a140f2ef8261a9ab42301a7358cec2

style: update comments * src/reader.c: action_obstack was removed in 2002... * src/parse-gram.y: Better names. * src/scan-code.h: More comments.

view details

Akim Demaille

commit sha 9afdf03f9f1410376335aba9d78d14061171fe4a

WIP: news: be more detailed

view details

push time in a day

PR opened akimd/bison

Multiple start symbols
+2492 -488

0 comment

34 changed files

pr created time in a day

push eventakimd/bison

Akim Demaille

commit sha 3dd8f2305a0a9acebed25d548d1daf398399ed0a

cex: use the bullet in HTML * data/xslt/xml2xhtml.xsl: here.

view details

Vincent Imbimbo

commit sha 69e3b405d98a5a95eb2a3ab0ff98c22829f7600e

cex: fix reporting of null nonterminals I implemented this to print A ::= [ ], but A ::= [ %empty ] might be clearer. * src/parse-simulation.c (nullable_closure): Don't generate null nonterminal derivations as leaves. * src/derivation.c (derivation_print_impl): Don't print seperator spaces for null nonterminal. * tests/counterexample.at: Update test results.

view details

Akim Demaille

commit sha 0f120354b623b10dc7e130f931348a030839cd75

cex: don't display twice unifying examples if there is no color It makes no sense, and is actually confusing, to display twice the same example with no visible difference. * src/complain.h, src/complain.c (is_styled): New. * src/counterexample.c (print_counterexample): Display the unified example a second time only if it makes a difference. * tests/conflicts.at, tests/counterexample.at, tests/report.at: Adjust. * tests/diagnostics.at: Make sure we do display the unifying examples twice when colors are enabled. And check those colors.

view details

Akim Demaille

commit sha b65bd16e45d5ce1a9404cd46ea3b32256e2e477d

cex: display all the S/R conflicts, not just one per (state, rule) Before this commit, on %% exp : "if" exp "then" exp | "if" exp "then" exp "else" exp | exp "+" exp | "num" we used to not display the third counterexample below: Shift/reduce conflict on token "+": Example exp "+" exp . "+" exp First derivation exp ::=[ exp ::=[ exp "+" exp . ] "+" exp ] Second derivation exp ::=[ exp "+" exp ::=[ exp . "+" exp ] ] Shift/reduce conflict on token "else": Example "if" exp "then" "if" exp "then" exp . "else" exp First derivation exp ::=[ "if" exp "then" exp ::=[ "if" exp "then" exp . ] "else" exp ] Second derivation exp ::=[ "if" exp "then" exp ::=[ "if" exp "then" exp . "else" exp ] ] Shift/reduce conflict on token "+": Example "if" exp "then" exp . "+" exp First derivation exp ::=[ exp ::=[ "if" exp "then" exp . ] "+" exp ] Second derivation exp ::=[ "if" exp "then" exp ::=[ exp . "+" exp ] ] Shift/reduce conflict on token "+": Example "if" exp "then" exp "else" exp . "+" exp First derivation exp ::=[ exp ::=[ "if" exp "then" exp "else" exp . ] "+" exp ] Second derivation exp ::=[ "if" exp "then" exp "else" exp ::=[ exp . "+" exp ] ] * src/counterexample.c (counterexample_report_state): Don't stop of the first conflicts. * tests/conflicts.at, tests/counterexample.at, tests/diagnostics.at, * tests/report.at: Adjust.

view details

Akim Demaille

commit sha c4b1a2b68ff03d886e096a95c2918be350ff0271

doc: use dot/'•' rather than point/'.' AFAICT, "dotted rule" is a more frequent synonym of "item" than "pointed rule". So let's migrate to using "dot" only. * doc/bison.texi: Use dot/'•' rather than point/'.'. * src/print-xml.c (print_core): Use dot rather than point. This is not backward compatible, but AFAICT, we don't have actual user of the XML output (but ourselves). So... * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl, * data/xslt/xml2xhtml.xsl, tests/report.at: ... adjust.

view details

Akim Demaille

commit sha 670c7e7a75ba5ef69083cdbc92efa99a5d1a7107

don't use strlen to compute visual width * src/output.c (prepare_symbol_names): Use mbswidth.

view details

Akim Demaille

commit sha 3be228f64c22fd5d49a761acb29a9e6da5505169

style: clean up ielr * src/AnnotationList.c, src/ielr.c: Fix include order. Prefer `res` to `result`. Reduce scopes. Be free of the oldish 76 cols limitation when it clutters too much the code. Denest when possible (we're starving for horizontal width).

view details

Akim Demaille

commit sha 1001f484167ad6f4dbdcb2f724ce99492f9606fe

style: clean up nullable * src/nullable.c: Reduce scopes. Prefer `r` to `rules_ruleno`, which is truly an ugly name.

view details

Akim Demaille

commit sha 8f44164443e8cc04f7931cd5fdb39a0cc48b39a4

style: factor the access to a rule from its items * src/counterexample.c (item_rule): Move to... * src/counterexample.h: here. * src/AnnotationList.c, src/counterexample.c, src/ielr.c: Use it.

view details

Akim Demaille

commit sha cf6d8d0631d6d4c82a00843b1fe3d6b13e7ff436

ielr: fix crash on memory management Reported by Dwight Guth. https://lists.gnu.org/r/bug-bison/2020-06/msg00037.html * src/AnnotationList.c (AnnotationList__computePredecessorAnnotations): Beware that SBITSET__FOR_EACH nests _two_ for-loops, so "break" does not actually break out of it. That was the only occurrence in the code. * src/Sbitset.h (SBITSET__FOR_EACH): Warn passersby.

view details

Akim Demaille

commit sha eeafc706e87dab7e84d0056c852e4579e6c3cf53

c++: by default, use const std::string for file names Reported by Martin Blais and Yuriy Solodkyy. https://lists.gnu.org/r/help-bison/2020-05/msg00011.html https://lists.gnu.org/r/bug-bison/2020-06/msg00038.html While at it, modernize filename_type as api.filename.type and document it properly. * data/skeletons/c++.m4 (filename_type): Rename as... (api.filename.type): this. Default to const std::string. * data/skeletons/location.cc (position, location): Expose the filename_type type. Use api.filename.type. * doc/bison.texi (%define Summary): Document api.filename.type. (C++ Location Values): Document position::filename_type. * src/muscle-tab.c (muscle_percent_variable_update): Ensure backward compatibility. * tests/c++.at: Check that using const file names is ok. tests/input.at: Check backward compat.

view details

Akim Demaille

commit sha 4efb2f7bd27d496e2aacb8867b53f7d22d8dfeda

doc: parse.assert in C++ requires RTTI * doc/bison.texi (%define Summary): Say it.

view details

Akim Demaille

commit sha 0895858d8e0d1fa66c6dd0d2e45416488d7de513

style: use 'nonterminal' consistently * doc/bison.texi: Formatting changes. * src/gram.h, src/gram.c (nvars): Rename as... (nnterms): this. Adjust dependencies. (section): New. Use it. Replace "non terminal" and "non-terminal" by "nonterminal".

view details

Akim Demaille

commit sha d796e11f8f7d459408824f0d2c8174e3f4715f84

news: fixes Reported by Jacob L. Mandelson. * NEWS: here.

view details

Akim Demaille

commit sha feb0bb0a598b6ea222e62532e67facae873b5988

style: rename endtoken as eoftoken * src/symtab.h, src/symtab.c (endtoken): Rename as... (eoftoken): this. Adjust dependencies.

view details

Akim Demaille

commit sha 0e5cbd38b24e83c0f223e2d1d37b8aa27aac0073

style: shift/reduce, not shift-reduce * src/reader.c: here.

view details

Akim Demaille

commit sha e0b0a67b863ba3f1e3cc5f8c5ae33f9614de86e7

java: rename package as api.package * data/skeletons/lalr1.java: here. * doc/bison.texi: Update. * src/muscle-tab.c: Ensure backward compat. * tests/java.at: Check it.

view details

Akim Demaille

commit sha 160df55c569ccb13aaa13eb6e87e427f9a6cdc30

doc: overhaul of the readmes * README-hacking.md (Working from the Repository): Make it first to make it easier to find the instructions to build from the repo. (Implementation Notes): New. * README: Provide more links.

view details

Akim Demaille

commit sha 1ae4f1d3291b22466a20d1a2cce88b750ffbfb31

tests: don't use $VERBOSE It is used by the test suite itself, which results in this test failing. * tests/c++.at: Use $DEBUG, not $VERBOSE.

view details

Akim Demaille

commit sha 2b518d621f515faca9b76c37720c4d82de142795

bench: make it easy to edit the generated files * etc/bench.pl.in (&compile): Generate rules that compile the generated files independently of the source files.

view details

push time in a day

created tagakimd/bison

tagv3.6.90

GNU Bison

created time in 3 days

push eventakimd/bison

Akim Demaille

commit sha d7f7fcd9c7ca64d312196b081aa09def3a518979

dot: also use a dot in the output * src/print-graph.c (print_core): Use a dot instead of a point. * doc/figs/example-reduce.gv, doc/figs/example-reduce.txt, * doc/figs/example-shift.gv, doc/figs/example-shift.txt, * doc/figs/example.gv: Update. * tests/output.at, tests/report.at: Adjust.

view details

Akim Demaille

commit sha 526ef45f306ed85ae22411e2564a66e5e39c9778

news: update

view details

Akim Demaille

commit sha 156e548341c24975c8c84d4013ab53bc990401fb

cex: give more details about -Wcex and -rcex * data/bison-default.css: Cobalt does not seem to be supported. * doc/bison.texi (Counterexamples): A new section. (Understanding): Show the counterexamples as it shows in the report: with its items. (Bison Options): Document -Wcex and -rcex.

view details

Akim Demaille

commit sha 203f7230ecc01a62537c1356ccc61924c4f7b3d1

gnulib: update

view details

Akim Demaille

commit sha d309bd9f9f58355c653502f587cfbe070330933b

package: fix syntax-check errors * examples/c/bistromathic/bistromathic.test, po/POTFILES.in: here.

view details

Akim Demaille

commit sha 3e6e51cf5c932453ce5614865c5729abac15ec39

news: update

view details

push time in 3 days

push eventakimd/bison

Akim Demaille

commit sha 21f769057019837b165463535da6888941e36c4e

doc: use color in the cex examples * doc/bison.texi: here. And use smallexample when it no longer fits in PDF.

view details

Akim Demaille

commit sha 5234c8390f74670ad7b4dd12b98ab951e6720b2c

doc: clarify that the pcontext interface is *.c only Reported by Rici Lake. https://lists.gnu.org/r/bug-bison/2020-06/msg00054.html * doc/bison.texi (Syntax Error Reporting Function): Make it clear that this is not exported. Remove C++ details that landed in the C doc.

view details

Akim Demaille

commit sha 84ef175287fcfcf088c6b1618c26795c646f6cd2

news, todo: update

view details

Akim Demaille

commit sha 413908e5a4da281611d071bdb1b3607374f9ceac

news: formatting changes

view details

Akim Demaille

commit sha 0fd542c3e012bc507e3fcddcc9e38fb648498a29

doc: improve a sentence * doc/bison.texi: here.

view details

push time in 5 days

create barnchakimd/bison

branch : glr2_cc

created branch time in 5 days

delete branch akimd/bison

delete branch : counterexamples

delete time in 6 days

push eventakimd/bison

Akim Demaille

commit sha ed9a821caa16021ed25c3f6f3033c341912fea65

doc: update Doxygen template file * doc/Doxyfile.in: here.

view details

Vincent Imbimbo

commit sha 1247d94ba67edfe8297c903f3f38a1c0218a7902

doc: cex documentation * NEWS, doc/bison.texi: Add documentation for conflict counterexample generation.

view details

Akim Demaille

commit sha edb39c29a2465043f4a0e63f6b4e45486b9273bd

doc: repair the references to the Bibliography In commit c80cdf2db2b302db4137fabd4ae11e578fa51fca ("doc: simplify uses of @ref", Jan 27 2020, released in Bison 3.6), I broke the references to the Bibliography. For instance: For a more detailed exposition of the mysterious behavior in LALR parsers -and the benefits of IELR, @pxref{Bibliography,,Denny 2008 March}, and -@ref{Bibliography,,Denny 2010 November}. +and the benefits of IELR, @pxref{Bibliography}, and +@ref{Bibliography}. which results in "see Bibliography" twice, instead of the more precise reference. * doc/bison.texi (@pcite, @tcite): New. Use them instead of @ref to Bibliography. Cite only the first author (that's what we did for the other entries).

view details

push time in 7 days

delete branch akimd/bison

delete branch : yypstate-clear

delete time in 7 days

PR merged akimd/bison

yypstate_clear (ATTENTION push parser users)

Push parser users should pay special attention to these changes, and provide feedback.

If you are used to code such as

yypstate *ps = yypstate_new ();
for (int i = 1; i < argc; ++i)
  yypull_parse (ps);
yypstate_delete (ps);

you will have to make it

yypstate *ps = yypstate_new ();
for (int i = 1; i < argc; ++i)
  {
    yypstate_clear (ps);
    yypull_parse (ps);
  }
yypstate_delete (ps);

IMHO, the previous design was flawed, as it prevented introspecting the parser state to see what happened. Besides, if the initial stacks were too smalls, and had been enlarged, in the later runs we are back to using the "small" stacks.

These changes allowed to fix undesirable behaviors in autocompletion. But I also expect we will want more means to study the state stack in the future, so we should really preserve our parser state.

In the future, we could also not clear the stack at the end of parsing, but in yypstate_clear and yypstate_delete. This could have some impact on when users expect the destructors are called, so that's a whole new chapter.

+160 -138

0 comment

8 changed files

akimd

pr closed time in 7 days

push eventakimd/bison

Akim Demaille

commit sha ec207d1bb2fb934b68d6a70c386d4d4c3b00e891

yacc.c: simplify yypull_parse Currently yypull_parse takes a yypstate* as argument, and accepts it to be NULL. This does not seem to make a lot of sense: rather it is its callers that should do that. I believe this is historical: yypull_parse was introduced first (c3d503425f8014b432601a33b3398446d63b5963), with yyparse being a macro. So yyparse could hardly deal with memory allocation properly. In 7172e23e8ffb95b8cafee24c4f36c46ca709507f that yyparse was turned into a genuine function. At that point, it should have allocated its own yypstate*, which would have left yypull_parse deal with only one single non-null ypstate* argument. Fortunately, it is nowhere documented that it is valid to pass NULL to yypull_parse. It is now forbidden. * data/skeletons/yacc.c (yypull_parse): Don't allocate a yypstate. Needs a location to issue the error message. (yyparse): Allocate the yypstate.

view details

Akim Demaille

commit sha 2491de1eeffb7ae24fc05f64a91d751387be9596

yacc.c: style changes in push mode * data/skeletons/yacc.c: here.

view details

Akim Demaille

commit sha 29520abb3b00fff35889ea08634621cec03a5130

yacc.c: declare and initialize and the same time In order to factor the code of push and pull parsers, the declaration of the parser's state variable was common (being local variable in pull parsers, and struct members in push parsers). This result in rather poor style in pull parser, with first variable declarations, and then their initializations. The initialization is about to differ between push and pull parsers, so it is no longer worth keeping both cases together. * data/skeletons/yacc.c (b4_declare_parser_state_variables): Accept an argument, and when it is set, initialize the variables. Adjust dependencies.

view details

Akim Demaille

commit sha b91566edd1a0f3f3a17f0700c42fbc339f3837b5

regen

view details

Akim Demaille

commit sha ed10c308fa116cac083297499095e6382fdbd256

yacc.c: simplify initialization of push parsers The previous commit ("yacc.c: declare and initialize and the same time") made b4_initialize_parser_state_variables useless. * data/skeletons/yacc.c (b4_initialize_parser_state_variables): Inline into... (yypstate_clear): here.

view details

Akim Demaille

commit sha 7c609859ee3fd7c40c7685df7b811a50a4071ace

bistromathic: don't display undefined locations Currently, completion when there is a syntax error shows broken locations. * examples/c/bistromathic/parse.y (expected_tokens): Initialize the location. * examples/c/bistromathic/bistromathic.test: Check that.

view details

Akim Demaille

commit sha 330552ea499ca474f65967160e9d4e50265f9631

yacc.c: push: don't clear the parser state when accepting/rejecting Currently when a push parser finishes its parsing (i.e., it did not return YYPUSH_MORE), it also clears its state. It is therefore impossible to see if it had parse errors. In the context of autocompletion, because error recovery might have fired, the parser is actually already in a different state. For instance on `(1 + + <TAB>` in the bistromathic, because there's a `exp: "(" error ")"` recovery rule, `1 + +` tokens have already been popped, replaced by `error`, and autocompletions think we are ready for the closing ")". So here, we would like to see if there was a syntax error, yet `yynerrs` was cleared. In the case of a successful parse, we still have a problem: if error recovery succeeded, we won't know it, since, again, `yynerrs` is clearer. It seems much more natural to leave the parser state available for analysis when there is a failure. To reuse the parser, we should either: 1. provide an explicit means to reinitialize a parser state for future parses. 2. automatically reset the parser state when it is used in a new parse. Option 2 requires to check whether we need to reinitialize the parser each time we call `yypush_parse`, i.e., each time we give a new token. This seems expensive compared to Option 1, but benchmarks revealed no difference. Option 1 is incompatible with the documentation ("After `yypush_parse` returns a status other than `YYPUSH_MORE`, the parser instance `yyps` may be reused for a new parse."). So Option 2 wins, reusing the private `yynew` member to record that a parse was finished, and therefore that the state must reset in the next call to `yypull_parse`. While at it, this implementation now reuses the previously enlarged stacks from one parse to another. * data/skeletons/yacc.c (yypstate_new): Set up the stacks in their initial configurations (setting their bottom to the stack array), and use yypstate_clear to reset them (moving their top to their bottom). (yypstate_delete): Adjust. (yypush_parse): At the beginning, clear yypstate if needed, and at the end, record when yypstate needs to be clearer. * examples/c/bistromathic/parse.y (expected_tokens): Do not propose autocompletion when there are parse errors. * examples/c/bistromathic/bistromathic.test: Check that case.

view details

push time in 7 days

push eventakimd/bison

Akim Demaille

commit sha 330552ea499ca474f65967160e9d4e50265f9631

yacc.c: push: don't clear the parser state when accepting/rejecting Currently when a push parser finishes its parsing (i.e., it did not return YYPUSH_MORE), it also clears its state. It is therefore impossible to see if it had parse errors. In the context of autocompletion, because error recovery might have fired, the parser is actually already in a different state. For instance on `(1 + + <TAB>` in the bistromathic, because there's a `exp: "(" error ")"` recovery rule, `1 + +` tokens have already been popped, replaced by `error`, and autocompletions think we are ready for the closing ")". So here, we would like to see if there was a syntax error, yet `yynerrs` was cleared. In the case of a successful parse, we still have a problem: if error recovery succeeded, we won't know it, since, again, `yynerrs` is clearer. It seems much more natural to leave the parser state available for analysis when there is a failure. To reuse the parser, we should either: 1. provide an explicit means to reinitialize a parser state for future parses. 2. automatically reset the parser state when it is used in a new parse. Option 2 requires to check whether we need to reinitialize the parser each time we call `yypush_parse`, i.e., each time we give a new token. This seems expensive compared to Option 1, but benchmarks revealed no difference. Option 1 is incompatible with the documentation ("After `yypush_parse` returns a status other than `YYPUSH_MORE`, the parser instance `yyps` may be reused for a new parse."). So Option 2 wins, reusing the private `yynew` member to record that a parse was finished, and therefore that the state must reset in the next call to `yypull_parse`. While at it, this implementation now reuses the previously enlarged stacks from one parse to another. * data/skeletons/yacc.c (yypstate_new): Set up the stacks in their initial configurations (setting their bottom to the stack array), and use yypstate_clear to reset them (moving their top to their bottom). (yypstate_delete): Adjust. (yypush_parse): At the beginning, clear yypstate if needed, and at the end, record when yypstate needs to be clearer. * examples/c/bistromathic/parse.y (expected_tokens): Do not propose autocompletion when there are parse errors. * examples/c/bistromathic/bistromathic.test: Check that case.

view details

push time in 7 days

push eventakimd/bison

Akim Demaille

commit sha 2b518d621f515faca9b76c37720c4d82de142795

bench: make it easy to edit the generated files * etc/bench.pl.in (&compile): Generate rules that compile the generated files independently of the source files.

view details

Akim Demaille

commit sha cd6ef1e7d7ce905263a9d347a9f0cbaf284312f7

bench: simplify the `rand` target * etc/bench.pl.in: There is no need to recompile the bench cases themselves.

view details

Akim Demaille

commit sha 688b3404a2c880279b30f4f967ec56ef58d6d8e5

doc: tidy the text files * etc/README: Rename/reformat as... * etc/README.md: this. And ship it.

view details

push time in 8 days

push eventakimd/bison

Akim Demaille

commit sha 2b518d621f515faca9b76c37720c4d82de142795

bench: make it easy to edit the generated files * etc/bench.pl.in (&compile): Generate rules that compile the generated files independently of the source files.

view details

Akim Demaille

commit sha cd6ef1e7d7ce905263a9d347a9f0cbaf284312f7

bench: simplify the `rand` target * etc/bench.pl.in: There is no need to recompile the bench cases themselves.

view details

Akim Demaille

commit sha 688b3404a2c880279b30f4f967ec56ef58d6d8e5

doc: tidy the text files * etc/README: Rename/reformat as... * etc/README.md: this. And ship it.

view details

Akim Demaille

commit sha ec207d1bb2fb934b68d6a70c386d4d4c3b00e891

yacc.c: simplify yypull_parse Currently yypull_parse takes a yypstate* as argument, and accepts it to be NULL. This does not seem to make a lot of sense: rather it is its callers that should do that. I believe this is historical: yypull_parse was introduced first (c3d503425f8014b432601a33b3398446d63b5963), with yyparse being a macro. So yyparse could hardly deal with memory allocation properly. In 7172e23e8ffb95b8cafee24c4f36c46ca709507f that yyparse was turned into a genuine function. At that point, it should have allocated its own yypstate*, which would have left yypull_parse deal with only one single non-null ypstate* argument. Fortunately, it is nowhere documented that it is valid to pass NULL to yypull_parse. It is now forbidden. * data/skeletons/yacc.c (yypull_parse): Don't allocate a yypstate. Needs a location to issue the error message. (yyparse): Allocate the yypstate.

view details

Akim Demaille

commit sha 2491de1eeffb7ae24fc05f64a91d751387be9596

yacc.c: style changes in push mode * data/skeletons/yacc.c: here.

view details

Akim Demaille

commit sha 29520abb3b00fff35889ea08634621cec03a5130

yacc.c: declare and initialize and the same time In order to factor the code of push and pull parsers, the declaration of the parser's state variable was common (being local variable in pull parsers, and struct members in push parsers). This result in rather poor style in pull parser, with first variable declarations, and then their initializations. The initialization is about to differ between push and pull parsers, so it is no longer worth keeping both cases together. * data/skeletons/yacc.c (b4_declare_parser_state_variables): Accept an argument, and when it is set, initialize the variables. Adjust dependencies.

view details

Akim Demaille

commit sha b91566edd1a0f3f3a17f0700c42fbc339f3837b5

regen

view details

Akim Demaille

commit sha ed10c308fa116cac083297499095e6382fdbd256

yacc.c: simplify initialization of push parsers The previous commit ("yacc.c: declare and initialize and the same time") made b4_initialize_parser_state_variables useless. * data/skeletons/yacc.c (b4_initialize_parser_state_variables): Inline into... (yypstate_clear): here.

view details

Akim Demaille

commit sha 7c609859ee3fd7c40c7685df7b811a50a4071ace

bistromathic: don't display undefined locations Currently, completion when there is a syntax error shows broken locations. * examples/c/bistromathic/parse.y (expected_tokens): Initialize the location. * examples/c/bistromathic/bistromathic.test: Check that.

view details

Akim Demaille

commit sha 6848d96ca375732e8947fe9b4c9e092a28d85612

yacc.c: push: don't clear the parser state when accepting/rejecting Currently when a push parser finishes its parsing (i.e., it did not return YYPUSH_MORE), it also clears its state. It is therefore impossible to see if it had parse errors. In the context of autocompletion, because error recovery might have fired, the parser is actually already in a different state. For instance on `(1 + + <TAB>` in the bistromathic, because there's a `exp: "(" error ")"` recovery rule, `1 + +` tokens have already been popped, replaced by `error`, and autocompletions think we are ready for the closing ")". So here, we would like to see if there was a syntax error, yet `yynerrs` was cleared. In the case of a successful parse, we still have a problem: if error recovery succeeded, we won't know it, since, again, `yynerrs` is clearer. It seems much more natural to leave the parser state available for analysis when there is a failure. To reuse the parser, we should either: 1. provide an explicit means to reinitialize a parser state for future parses. 2. automatically reset the parser state when it is used in a new parse. Option 2 requires to check whether we need to reinitialize the parser each time we call `yypush_parse`, i.e., each time we give a new token. This seems expensive compared to Option 1, but I benchmarks revealed no difference. Option 1 is incompatible with the documentation ("After `yypush_parse` returns a status other than `YYPUSH_MORE`, the parser instance `yyps` may be reused for a new parse.") So Option 2 wins, reusing the private `yynew` member to record that a parse was finished, and therefore that the state must reset in the next call to `yypull_parse`. While at it, this implementation now reuses the previously enlarged stacks from one parse to another. * data/skeletons/yacc.c (yypstate_new): Set up the stacks in their initial configurations (setting their bottom to the stack array), and use yypstate_clear to reset them (moving their top to their bottom). (yypstate_delete): Adjust. (yypush_parse): At the beginning, clear yypstate if needed, and at the end, record when yypstate needs to be clearer. * examples/c/bistromathic/parse.y (expected_tokens): Do not propose autocompletion when there are parse errors. * examples/c/bistromathic/bistromathic.test: Check that case.

view details

push time in 8 days

push eventakimd/bison

Akim Demaille

commit sha f4690ec1f16b1f01b8b21bc2221683c081859a23

bench: make it easy to edit the generated files * etc/bench.pl.in (&compile): Generate rules that compile the generated files.

view details

Akim Demaille

commit sha 472058722dad0fa1be71582808c79b69a16d8983

bench: simplify the `rand` target * etc/bench.pl.in: There is no need to recompile the bench cases themselves.

view details

Akim Demaille

commit sha 974731b4681cab39097a6fd11acb7a4a549c62ff

doc: tidy the text files * etc/README: Rename/reformat as... * etc/README.md: this. And ship it.

view details

push time in 8 days

push eventakimd/bison

Akim Demaille

commit sha 1ae4f1d3291b22466a20d1a2cce88b750ffbfb31

tests: don't use $VERBOSE It is used by the test suite itself, which results in this test failing. * tests/c++.at: Use $DEBUG, not $VERBOSE.

view details

Akim Demaille

commit sha f4690ec1f16b1f01b8b21bc2221683c081859a23

bench: make it easy to edit the generated files * etc/bench.pl.in (&compile): Generate rules that compile the generated files.

view details

Akim Demaille

commit sha 472058722dad0fa1be71582808c79b69a16d8983

bench: simplify the `rand` target * etc/bench.pl.in: There is no need to recompile the bench cases themselves.

view details

Akim Demaille

commit sha 382ffe11df0a1f078be4d9876dec2bdcee85a4bd

doc: tidy the text files * etc/README: Rename/reformat as... * etc/README.md: this. And ship it.

view details

Akim Demaille

commit sha cf3dc64a9198b1613943739958aa6f675f908015

yacc.c: simplify yypull_parse Currently yypull_parse takes a yypstate* as argument, and accepts it to be NULL. This does not seem to make a lot of sense: rather it is its callers that should do that. I believe this is historical: yypull_parse was introduced first (c3d503425f8014b432601a33b3398446d63b5963), with yyparse being a macro. So yyparse could hardly deal with memory allocation properly. In 7172e23e8ffb95b8cafee24c4f36c46ca709507f that yyparse was turned into a genuine function. At that point, it should have allocated its own yypstate*, which would have left yypull_parse deal with only one single non-null ypstate* argument. Fortunately, it is nowhere documented that it is valid to pass NULL to yypull_parse. It is now forbidden. * data/skeletons/yacc.c (yypull_parse): Don't allocate a yypstate. Needs a location to issue the error message. (yyparse): Allocate the yypstate.

view details

Akim Demaille

commit sha 4eaf0c2d711d51d446feb439f185b30d1011b6de

yacc.c: style changes in push mode * data/skeletons/yacc.c: here.

view details

Akim Demaille

commit sha bbc9d0948e8587e5ce83a92440798774bf9a4b1d

yacc.c: declare and initialize and the same time In order to factor the code of push and pull parsers, the declaration of the parser's state variable was common (being local variable in pull parsers, and struct members in push parsers). This result in rather poor style in pull parser, with first variable declarations, and then their initializations. The initialization is about to differ between push and pull parsers, so it is no longer worth keeping both cases together. * data/skeletons/yacc.c (b4_declare_parser_state_variables): Accept an argument, and when it is set, initialize the variables. Adjust dependencies.

view details

Akim Demaille

commit sha bcaa0121237d5e5a9f157861c053d0b0acefb121

regen

view details

Akim Demaille

commit sha b40dc7ef9ff0c52bc1aa2c89de2734222d2c30a2

yacc.c: simplify initialization of push parsers The previous commit ("yacc.c: declare and initialize and the same time") made b4_initialize_parser_state_variables useless. * data/skeletons/yacc.c (b4_initialize_parser_state_variables): Inline into... (yypstate_clear): here.

view details

Akim Demaille

commit sha 540f6b2041fa7c9f21fd20ad0772c9a868a77927

bistromathic: don't display undefined locations Currently, completion when there is a syntax error shows broken locations. * examples/c/bistromathic/parse.y (expected_tokens): Initialize the location. * examples/c/bistromathic/bistromathic.test: Check that.

view details

Akim Demaille

commit sha 776f507bf855a00f40dca5abc3c4775040bf9023

yacc.c: push: don't clear the parser state when accepting/rejecting Currently when a push parser finishes its parsing (i.e., it did not return YYPUSH_MORE), it also clears its state. It is therefore impossible to see if it had parse errors. In the context of autocompletion, because error recovery might have fired, the parser is actually already in a different state. For instance on `(1 + + <TAB>` in the bistromathic, because there's a `exp: "(" error ")"` recovery rule, `1 + +` tokens have already been popped, replaced by `error`, and autocompletions think we are ready for the closing ")". So here, we would like to see if there was a syntax error, yet yynerrs was cleared. In the case of a successful parse, we still have a problem: if error recovery succeeded, we won't know it, since, again, yynerrs is clearer. It seems much more natural to leave the parser state available for analysis when there is a failure. And to provide an explicit means to reinitialize a parser state for future parses. Note that it also makes it easier to reuse the previously enlarged stacks from one parse to another. * data/skeletons/yacc.c (yypstate_clear): Make it public, non static. (yypstate_new): Set up the stacks in their initial configurations (setting their bottom to the stack array), and use yypstate_clear to reset them (moving their top to their bottom). (yypstate_delete): Adjust. (yypush_parse): Stop clearing the parser instance when parsing is finished. * doc/bison.texi (yypstate_clear): Document. Make it clear it must be called before parsing again. * tests/torture.at: Adjust. * examples/c/bistromathic/parse.y (expected_tokens): Do not propose autocompletion when there are parse errors. * examples/c/bistromathic/bistromathic.test: Check that case.

view details

Akim Demaille

commit sha ed914f65450bf08e0eff072090290bebd4c8144f

wip

view details

push time in 8 days

push eventakimd/bison

Akim Demaille

commit sha 1ae4f1d3291b22466a20d1a2cce88b750ffbfb31

tests: don't use $VERBOSE It is used by the test suite itself, which results in this test failing. * tests/c++.at: Use $DEBUG, not $VERBOSE.

view details

push time in 8 days

PR opened akimd/bison

`yypstate_clear` (ATTENTION push parser users)

Push parser users should pay special attention to these changes, and provide feedback.

If you are used to code such as

yypstate *ps = yypstate_new ();
for (int i = 1; i < argc; ++i)
  yypull_parse (ps);
yypstate_delete (ps);

you will have to make it

yypstate *ps = yypstate_new ();
for (int i = 1; i < argc; ++i)
  {
    yypstate_clear (ps);
    yypull_parse (ps);
  }
yypstate_delete (ps);

IMHO, the previous design was flawed, as it prevented introspecting the parser state to see what happened. Besides, if the initial stacks were too smalls, and had been enlarged, in the later runs we are back to using the "small" stacks.

These changes allowed to fix undesirable behaviors in autocompletion. But I also expect we will want more means to study the state stack in the future, so we should really preserve our parser state.

In the future, we could also not clear the stack at the end of parsing, but in yypstate_clear and yypstate_delete. This could have some impact on when users expect the destructors are called, so that's a whole new chapter.

+170 -151

0 comment

9 changed files

pr created time in 9 days

create barnchakimd/bison

branch : yypstate-clear

created branch time in 9 days

push eventakimd/bison

Akim Demaille

commit sha 160df55c569ccb13aaa13eb6e87e427f9a6cdc30

doc: overhaul of the readmes * README-hacking.md (Working from the Repository): Make it first to make it easier to find the instructions to build from the repo. (Implementation Notes): New. * README: Provide more links.

view details

push time in 9 days

push eventakimd/bison

Akim Demaille

commit sha 5eaba642f37e7db0eca7b0d7e692b46b19872ab9

wip

view details

push time in 9 days

push eventakimd/bison

Akim Demaille

commit sha 6a617b42e0e3f055cbfaac7b4bcb9869c54857e9

wip

view details

push time in 9 days

push eventakimd/bison

Akim Demaille

commit sha 0e288f55ef73bc1ad91606500b4a2977b9fc5fcc

wip

view details

push time in 9 days

push eventakimd/bison

Akim Demaille

commit sha d796e11f8f7d459408824f0d2c8174e3f4715f84

news: fixes Reported by Jacob L. Mandelson. * NEWS: here.

view details

Akim Demaille

commit sha feb0bb0a598b6ea222e62532e67facae873b5988

style: rename endtoken as eoftoken * src/symtab.h, src/symtab.c (endtoken): Rename as... (eoftoken): this. Adjust dependencies.

view details

Akim Demaille

commit sha 0e5cbd38b24e83c0f223e2d1d37b8aa27aac0073

style: shift/reduce, not shift-reduce * src/reader.c: here.

view details

Akim Demaille

commit sha e0b0a67b863ba3f1e3cc5f8c5ae33f9614de86e7

java: rename package as api.package * data/skeletons/lalr1.java: here. * doc/bison.texi: Update. * src/muscle-tab.c: Ensure backward compat. * tests/java.at: Check it.

view details

Akim Demaille

commit sha ed03a00f914f70a646ca8048833d640deb34be42

doc: make it easier to find the instructions to build from the repo * README-hacking.md (Working from the Repository): Make it first.

view details

push time in 9 days

pull request commentnitnelave/bison

glr.cc: catch up with master

Hi Valentin,

I've merged again with master (there were changes about the interaction between glr.c and glr.cc). There are still some problems with some warnings (-Wformat and -Wshadow) but we can handle this afterwards.

Please, prepare a PR where you submit this skeleton as glr2.cc. I believe we will be able to release 3.7 RSN, and I would like to include your glr.cc in 3.8. Maybe it will stay as glr2.cc for a few releases until we're really happy with the result.

This PR could be a single squashed commit, that would be fine with me. I don't see how you could build a readable sequence of commits with all these merges :)

Cheers!

akimd

comment created time in 9 days

push eventakimd/bison

Akim Demaille

commit sha 8ece778cb869846dbc44fa0fd516a174798c0233

c++: fix printing of state number on streams Avoid this kind of display: LAC: checking lookahead identifier: R4 R3 G^B S5 * data/skeletons/lalr1.cc: Convert state_t to int before printing it.

view details

Akim Demaille

commit sha 12f4091de4d0147354bad7a7fdca62d02014d410

tests: show logs * examples/c/bistromathic/bistromathic.test, examples/test: here.

view details

Vincent Imbimbo

commit sha 6a1a681fd2cf99e29a6133b8cae02b5d7233373b

style: decouple different uses of item_number item_number is used for elements of ritem as well as indices into ritem which is fairly confusing. Introduce item_index to represent indices into ritem. * src/gram.h (item_index): Introduce it for ritem indices. * src/closure.h, src/closure.c, src/ielr.c, src/lr0.c, * src/print-graph.c, src/state.h, src/state.h: Replace uses of item_number with item_index where appropriate.

view details

Akim Demaille

commit sha 518dc6ca26d6ff9db850f5905a5b8795597f9601

style: make item_index a truly different type from item_number See previous commit. * src/gram.h (item_index): Make it unsigned. Fix remaiming issues.

view details

Akim Demaille

commit sha bb311cfbed533efda6761d76f111933ff4986db8

gnulib: update

view details

Akim Demaille

commit sha 52ce2a008bb32e686151c3c58739ff4fcd17f83d

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html Besides, none of the C examples were compiled with the warning flags. * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. GCC's warn_unused_result is not silenced by a cast to void, so we have to "use" scanf's result. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 Flex generated code produces too many warnings, including things such as, with ICC: examples/c/lexcalc/scan.c(1088): error #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem) 2259 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 2260 ^ 2261 2262 I am tired of trying to fix Flex's output. The project does not seem maintained. We ought to avoid it. So, for the time being, don't try to enable warnings with Flex. * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

Akim Demaille

commit sha 742910838e68a40b0144bed3ee8a2802709d1c42

lists: fix various issues with the use of gnulib's list First, we should avoid code such as gl_list_iterator_t it = gl_list_iterator (deriv->children); derivation *child = NULL; while (gl_list_iterator_next (&it, (const void **) &child, NULL)) { derivation_print (child, f); because of -Wstrict-aliasing (whose job is to catch type-punning issues). See https://lists.gnu.org/r/bug-bison/2020-05/msg00039.html. Rather we need gl_list_iterator_t it = gl_list_iterator (deriv->children); const void **p = NULL; while (gl_list_iterator_next (&it, &p, NULL)) { derivation *child = (derivation *) p; derivation_print (child, f); Second, list iterators actually have destructors. Even though they are noop in the case of linked-lists, we should use them. Let's address both issues with typed wrappers (such as derivation_list_next) that take care of both issues, and besides allow to scope the iterators within the loop: derivation *child; for (gl_list_iterator_t it = gl_list_iterator (deriv->children); derivation_list_next (&it, &child); ) { derivation_print (child, f); * src/derivation.h, src/derivation.c (derivation_list_next): New. Use it where appropriate. * src/counterexample.c (search_state_list_next): New. Use it where appropriate. * src/parse-simulation.h, src/parse-simulation.c * src/state-item.h (state_item_list_next): New. Use it where appropriate.

view details

Akim Demaille

commit sha 03a6b439f6873305aa563c03cfbcc08c0aadebb1

style: fix includes * src/fixits.c: Follow our usual pattern. * src/scan-code.l, src/scan-gram.l, src/scan-skel.l: Prefer "" to include src/ headers. * README-hacking.md: Document the pattern.

view details

Akim Demaille

commit sha de5be4a693dfab791bb389e77944ed49b49ef0ce

doc: using asan * README-hacking.md: here.

view details

Akim Demaille

commit sha 94f7606db6f8e3d6c1cc71be6be304e16ba06a66

build: check -Wstrict-aliasing * configure.ac (warn_common): Add -Wstrict-aliasing.

view details

Akim Demaille

commit sha 0535d2a608b02c157bdb54221a35e86a310ae9e7

version 3.6.3 * NEWS: Record release date.

view details

Akim Demaille

commit sha 508ac09939960eac8d30afab6e252469afe18714

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

Akim Demaille

commit sha 7e16bd2cae4f6762449927b2ca3159f44724a3ee

Merge maint into HEAD * upstream/maint: maint: post-release administrivia version 3.6.3 build: check -Wmissing-prototypes tests: show logs c++: fix printing of state number on streams

view details

Akim Demaille

commit sha ae03b1678514ae323a9355ffa62fde96a85ab2a9

warnings: fix -Wmissing-prototypes issues * src/counterexample.c, src/lssi.c, src/parse-simulation.c, * src/state-item.c: Here.

view details

Akim Demaille

commit sha b1327c56f7f940f13886a1b6561a5132fa0a43b3

examples: fix missing includes * examples/c/bistromathic/parse.y: Use abort rather than assert so that the "unused result" warning is silenced even with -DNDEBUG.

view details

Akim Demaille

commit sha 2101b0e210e03e1d07d0a6711ed4c8df0f9430ae

CI: use GCC10 on ppc too We were still using GCC9, because GCC10 was failing. * .travis.yml (PPC64le): Use GCC10. While at it, use -O2 instead of -O3: it's certainly nicer for the CPUs, and allows to test different sets of compiler flags (we use -O3 in several other configurations).

view details

Akim Demaille

commit sha 39be113b1faaddc1cd925478cfdbe8d7d6573a36

all: show the rules in comments before the user actions For instance, in the case of Bison's own parser: - case 40: + case 40: /* grammar_declaration: "%code" "identifier" "{...}" */ { muscle_percent_code_grow ((yyvsp[-1].ID), (yylsp[-1]), translate_code_braceless ((yyvsp[0].BRACED_CODE), (yylsp[0])), (yylsp[0])); code_scanner_last_string_free (); } break; * data/skeletons/c.m4: Modified. * data/skeletons/d.m4: Modified. * data/skeletons/java.m4: Modified. * src/output.c (output_escaped): New. (quoted_output): Use it, and rename as... (output_quoted): this. Adjust dependencies. (rule_output): New. (user_actions_output): Use it. * data/skeletons/c.m4, data/skeletons/d.m4, data/skeletons/java.m4 (b4_case): Add support for $3, an optional comment.

view details

Akim Demaille

commit sha 421662ec88797e249ae1eced9e1e1f05ffaf0abe

style: fix syntax-check issues * src/counterexample.c, src/files.c, src/files.h, src/lssi.c, * src/state-item.c: here.

view details

Akim Demaille

commit sha 1ccb4be02b07c3acf7e94a8b84d3178b91d26f55

cex: reformat the s/r and r/r reports In Bison we refer to "shift/reduce" conflicts, not "shift-reduce" (in Bison 3.6.3 186 occurrences vs 15). Enforce consistency on this. Instead of "spending" a second line for each conflict to report the lookaheads, put that on the same line as the type of conflict. Also, prefer "token" to "symbol". Maybe we should even prefer "lookahead". While at it, enable internationalization, with plurals where appropriate. As a consequence, instead of Shift-Reduce Conflict: 6: 3 b: . %empty 6: 6 d: c . A On Symbol: A display Shift/reduce conflict on token A: 6: 3 b: . %empty 6: 6 d: c . A * NEWS, doc/bison.texi, src/conflicts.c: Spell it "shift/reduce", not "shift-reduce". * src/counterexample.c (counterexample_report_shift_reduce) (counterexample_report_reduce_reduce): Reformat and internationalize output. * tests/counterexample.at: Adjust expectations.

view details

Akim Demaille

commit sha 296e2f90ab3315732e25ce38687954646f5a86e1

cex: enforce case for tokens/nonterminals It's unfortunate that the traditions between formal language theory and Yacc differs, but here, tokens should be upper case, and nonterminals should be lower case. * tests/counterexample.at: Comply with this.

view details

push time in 9 days

push eventakimd/bison

Akim Demaille

commit sha cf6d8d0631d6d4c82a00843b1fe3d6b13e7ff436

ielr: fix crash on memory management Reported by Dwight Guth. https://lists.gnu.org/r/bug-bison/2020-06/msg00037.html * src/AnnotationList.c (AnnotationList__computePredecessorAnnotations): Beware that SBITSET__FOR_EACH nests _two_ for-loops, so "break" does not actually break out of it. That was the only occurrence in the code. * src/Sbitset.h (SBITSET__FOR_EACH): Warn passersby.

view details

Akim Demaille

commit sha eeafc706e87dab7e84d0056c852e4579e6c3cf53

c++: by default, use const std::string for file names Reported by Martin Blais and Yuriy Solodkyy. https://lists.gnu.org/r/help-bison/2020-05/msg00011.html https://lists.gnu.org/r/bug-bison/2020-06/msg00038.html While at it, modernize filename_type as api.filename.type and document it properly. * data/skeletons/c++.m4 (filename_type): Rename as... (api.filename.type): this. Default to const std::string. * data/skeletons/location.cc (position, location): Expose the filename_type type. Use api.filename.type. * doc/bison.texi (%define Summary): Document api.filename.type. (C++ Location Values): Document position::filename_type. * src/muscle-tab.c (muscle_percent_variable_update): Ensure backward compatibility. * tests/c++.at: Check that using const file names is ok. tests/input.at: Check backward compat.

view details

Akim Demaille

commit sha 4efb2f7bd27d496e2aacb8867b53f7d22d8dfeda

doc: parse.assert in C++ requires RTTI * doc/bison.texi (%define Summary): Say it.

view details

Akim Demaille

commit sha 0895858d8e0d1fa66c6dd0d2e45416488d7de513

style: use 'nonterminal' consistently * doc/bison.texi: Formatting changes. * src/gram.h, src/gram.c (nvars): Rename as... (nnterms): this. Adjust dependencies. (section): New. Use it. Replace "non terminal" and "non-terminal" by "nonterminal".

view details

push time in 10 days

push eventakimd/bison

Akim Demaille

commit sha f6dd943633dee9cbc4d4fb09f2157ae5a13968a0

ielr: fix crash on memory management Reported by Dwight Guth. https://lists.gnu.org/r/bug-bison/2020-06/msg00037.html * src/AnnotationList.c (AnnotationList__computePredecessorAnnotations): Beware that SBITSET__FOR_EACH nests _two_ for-loops, so "break" does not actually break out of it. That was the only occurrence in the code. * src/Sbitset.h (SBITSET__FOR_EACH): Warn passersby.

view details

push time in 11 days

push eventakimd/bison

Akim Demaille

commit sha 0b20ac71941e4c6bf92c1b3a88d4be658a8b1ec0

ielr: fix crash on memory management Reported by Dwight Guth. https://lists.gnu.org/r/bug-bison/2020-06/msg00037.html * src/AnnotationList.c (AnnotationList__computePredecessorAnnotations): Beware that SBITSET__FOR_EACH nests _two_ for-loops, so "break" does not actually break out of it. That was the only occurrence in the code. * src/Sbitset.h (SBITSET__FOR_EACH): Warn passerbys.

view details

push time in 11 days

push eventakimd/bison

Akim Demaille

commit sha efb65daa36db3e918ace73c8a500373340867fbe

c++: get rid of global_tokens_and_yystype This was a hack to make it easier for people to migrate from yacc.c to lalr1.cc and from glr.c to glr.cc: when set, YYSTYPE and YYLTYPE were `#defined`. It was never documented (just mentioned in NEWS for Bison 2.2, 2006-05-19), but was used to simplify the test suite. Stop that: adjust the test suite to the skeletons, not the converse. In C++ use yy::parser::semantic_type, yy::parser::location_type, and yy::parser::token::MY_TOKEN, instead of YYSTYPE, YYLTYPE and MY_TOKEN. * data/skeletons/glr.cc, data/skeletons/lalr1.cc: Remove its support. * tests/actions.at, tests/c++.at, tests/calc.at: Adjust.

view details

Akim Demaille

commit sha 9e75066819b51fa33cfe1438f55b017e080f0181

cex: style changes * src/counterexample.c: Simplify a bit. * src/parse-simulation.c, src/parse-simulation.h: Enforce coding style.

view details

Akim Demaille

commit sha 3dd8f2305a0a9acebed25d548d1daf398399ed0a

cex: use the bullet in HTML * data/xslt/xml2xhtml.xsl: here.

view details

Vincent Imbimbo

commit sha 69e3b405d98a5a95eb2a3ab0ff98c22829f7600e

cex: fix reporting of null nonterminals I implemented this to print A ::= [ ], but A ::= [ %empty ] might be clearer. * src/parse-simulation.c (nullable_closure): Don't generate null nonterminal derivations as leaves. * src/derivation.c (derivation_print_impl): Don't print seperator spaces for null nonterminal. * tests/counterexample.at: Update test results.

view details

Akim Demaille

commit sha 0f120354b623b10dc7e130f931348a030839cd75

cex: don't display twice unifying examples if there is no color It makes no sense, and is actually confusing, to display twice the same example with no visible difference. * src/complain.h, src/complain.c (is_styled): New. * src/counterexample.c (print_counterexample): Display the unified example a second time only if it makes a difference. * tests/conflicts.at, tests/counterexample.at, tests/report.at: Adjust. * tests/diagnostics.at: Make sure we do display the unifying examples twice when colors are enabled. And check those colors.

view details

Akim Demaille

commit sha b65bd16e45d5ce1a9404cd46ea3b32256e2e477d

cex: display all the S/R conflicts, not just one per (state, rule) Before this commit, on %% exp : "if" exp "then" exp | "if" exp "then" exp "else" exp | exp "+" exp | "num" we used to not display the third counterexample below: Shift/reduce conflict on token "+": Example exp "+" exp . "+" exp First derivation exp ::=[ exp ::=[ exp "+" exp . ] "+" exp ] Second derivation exp ::=[ exp "+" exp ::=[ exp . "+" exp ] ] Shift/reduce conflict on token "else": Example "if" exp "then" "if" exp "then" exp . "else" exp First derivation exp ::=[ "if" exp "then" exp ::=[ "if" exp "then" exp . ] "else" exp ] Second derivation exp ::=[ "if" exp "then" exp ::=[ "if" exp "then" exp . "else" exp ] ] Shift/reduce conflict on token "+": Example "if" exp "then" exp . "+" exp First derivation exp ::=[ exp ::=[ "if" exp "then" exp . ] "+" exp ] Second derivation exp ::=[ "if" exp "then" exp ::=[ exp . "+" exp ] ] Shift/reduce conflict on token "+": Example "if" exp "then" exp "else" exp . "+" exp First derivation exp ::=[ exp ::=[ "if" exp "then" exp "else" exp . ] "+" exp ] Second derivation exp ::=[ "if" exp "then" exp "else" exp ::=[ exp . "+" exp ] ] * src/counterexample.c (counterexample_report_state): Don't stop of the first conflicts. * tests/conflicts.at, tests/counterexample.at, tests/diagnostics.at, * tests/report.at: Adjust.

view details

Akim Demaille

commit sha c4b1a2b68ff03d886e096a95c2918be350ff0271

doc: use dot/'•' rather than point/'.' AFAICT, "dotted rule" is a more frequent synonym of "item" than "pointed rule". So let's migrate to using "dot" only. * doc/bison.texi: Use dot/'•' rather than point/'.'. * src/print-xml.c (print_core): Use dot rather than point. This is not backward compatible, but AFAICT, we don't have actual user of the XML output (but ourselves). So... * data/xslt/xml2dot.xsl, data/xslt/xml2text.xsl, * data/xslt/xml2xhtml.xsl, tests/report.at: ... adjust.

view details

Akim Demaille

commit sha 670c7e7a75ba5ef69083cdbc92efa99a5d1a7107

don't use strlen to compute visual width * src/output.c (prepare_symbol_names): Use mbswidth.

view details

Akim Demaille

commit sha 3be228f64c22fd5d49a761acb29a9e6da5505169

style: clean up ielr * src/AnnotationList.c, src/ielr.c: Fix include order. Prefer `res` to `result`. Reduce scopes. Be free of the oldish 76 cols limitation when it clutters too much the code. Denest when possible (we're starving for horizontal width).

view details

Akim Demaille

commit sha 1001f484167ad6f4dbdcb2f724ce99492f9606fe

style: clean up nullable * src/nullable.c: Reduce scopes. Prefer `r` to `rules_ruleno`, which is truly an ugly name.

view details

Akim Demaille

commit sha 8f44164443e8cc04f7931cd5fdb39a0cc48b39a4

style: factor the access to a rule from its items * src/counterexample.c (item_rule): Move to... * src/counterexample.h: here. * src/AnnotationList.c, src/counterexample.c, src/ielr.c: Use it.

view details

push time in 11 days

push eventakimd/bison

Akim Demaille

commit sha c662b23735ae59a9e38dcef5ad88e185334235e7

Merge 'maint' * upstream/maint: maint: post-release administrivia version 3.6.4 glr.cc: don't leak glr.c/glr.cc scaffolding to the user Some fixes were needed to adjust to recent changes in glr.cc and glr.c. * data/skeletons/glr.cc: Stop messing with the user's epilogue to insert glr.cc code. We need that code to be inserted _before_ the user's epilogue, not after. So define b4_glr_cc_pre_epilogue. * data/skeletons/glr.c: Use it.

view details

Akim Demaille

commit sha 1c3189734ce46ecb8eb469344a6ce936be53e535

style: more uses of const * src/print.c, src/state.h, src/state.c: here.

view details

Akim Demaille

commit sha 5edac5e15aada80057991cfd8afe0ec894ffbcb1

cex: add an argument to the reporting functions to specify the stream * src/conflicts.c (find_state_item_number, report_state_counterexamples): Move to... * src/counterexample.h, src/counterexample.c (find_state_item_number) (counterexample_report_state): this. Add support for `out` as an argument. (counterexample_report_reduce_reduce, counterexample_report_shift_reduce): Accept an `out` argument, and be static.

view details

Akim Demaille

commit sha 9206b15c4e0c85a46154c3553b1b3a298723c92a

cex: make sure traces go to stderr * src/parse-simulation.h, src/parse-simulation.c (print_parse_state): here.

view details

Akim Demaille

commit sha 22f62414f907d5825db2576df6a506dab7080b03

cex: don't report the items Showing the items (with the state numbers) is really something we should restrict to the report. * src/counterexample.c (counterexample_report_shift_reduce) (counterexample_report_reduce_reduce): Don't show the pointed rules, we will do that in the report. * tests/counterexample.at: Adjust.

view details

Akim Demaille

commit sha 35c0fe6789cc95d252e593190abec3754850c7a7

cex: indent the diagnostics to highlight the structure Instead of Shift/reduce conflict on token D: Example A a • D First derivation s ::=[ A a a ::=[ b ::=[ c ::=[ • ] ] ] d ::=[ D ] ] Example A a • D Second derivation s ::=[ A a d ::=[ • D ] ] display Shift/reduce conflict on token D: Example A a • D First derivation s ::=[ A a a ::=[ b ::=[ c ::=[ • ] ] ] d ::=[ D ] ] Example A a • D Second derivation s ::=[ A a d ::=[ • D ] ] * src/counterexample.c (print_counterexample): Indent. * tests/counterexample.at: Adjust.

view details

Akim Demaille

commit sha d4f854e5b2d6b10b50dee40831c4e107d76cc254

cex: also include the counterexamples in the report The report is the best place to show the details about counterexamples, since we have the state right under the nose. For instance: State 7 1 exp: exp . "⊕" exp 2 | exp . "+" exp 2 | exp "+" exp . [$end, "+", "⊕"] 3 | exp . "+" exp 3 | exp "+" exp . [$end, "+", "⊕"] "⊕" shift, and go to state 6 $end reduce using rule 2 (exp) $end [reduce using rule 3 (exp)] "+" reduce using rule 2 (exp) "+" [reduce using rule 3 (exp)] "⊕" [reduce using rule 2 (exp)] "⊕" [reduce using rule 3 (exp)] $default reduce using rule 2 (exp) Conflict between rule 2 and token "+" resolved as reduce (%left "+"). Shift/reduce conflict on token "⊕": 2 exp: exp "+" exp . 1 exp: exp . "⊕" exp Example exp "+" exp • "⊕" exp First derivation exp ::=[ exp ::=[ exp "+" exp • ] "⊕" exp ] Example exp "+" exp • "⊕" exp Second derivation exp ::=[ exp "+" exp ::=[ exp • "⊕" exp ] ] Reduce/reduce conflict on tokens $end, "+", "⊕": 2 exp: exp "+" exp . 3 exp: exp "+" exp . Example exp "+" exp • First derivation exp ::=[ exp "+" exp • ] Example exp "+" exp • Second derivation exp ::=[ exp "+" exp • ] Shift/reduce conflict on token "⊕": 3 exp: exp "+" exp . 1 exp: exp . "⊕" exp Example exp "+" exp • "⊕" exp First derivation exp ::=[ exp ::=[ exp "+" exp • ] "⊕" exp ] Example exp "+" exp • "⊕" exp Second derivation exp ::=[ exp "+" exp ::=[ exp • "⊕" exp ] ] * src/conflicts.h, src/conflicts.c (has_conflicts): New. * src/counterexample.h, src/counterexample.c (print_counterexample): Add a `prefix` argument. (counterexample_report_shift_reduce) (counterexample_report_reduce_reduce): Show the items when there's a prefix. * src/state-item.h, src/state-item.c (print_state_item): Add a `prefix` argument. * src/derivation.h, src/derivation.c (derivation_print) (derivation_print_leaves): Add a prefix argument. * src/print.c (print_state): When -Wcex is enabled, show the conflicts. * tests/report.at: Adjust.

view details

Akim Demaille

commit sha c35e829a762ef62b83a7843507ffbae847353a08

cex: also include in the report on --report=counterexamples And let --report=all include the counterexamples. * src/getargs.h, src/getargs.c (report_cex): New. * src/main.c: Compute counterexamples when -rcex is specified. * src/print.c: Include the counterexamples when -rcex is specified. * tests/conflicts.at, tests/existing.at, tests/local.at: Adjust.

view details

Akim Demaille

commit sha e077bf1ebcdcd91de5de8944be3bf3c35a00b1fe

cex: don't assume the terminal supports "•" Use of print_unicode_char suggested by Bruno Haible. https://lists.gnu.org/r/bug-gettext/2020-06/msg00012.html * src/gram.h (print_dot_fallback, print_dot): New. * src/gram.c, src/derivation.c: Use it. * tests/counterexample.at, tests/report.at: Adjust the test suite. * .travis.yml, README-hacking.md: Adjust.

view details

Akim Demaille

commit sha efb65daa36db3e918ace73c8a500373340867fbe

c++: get rid of global_tokens_and_yystype This was a hack to make it easier for people to migrate from yacc.c to lalr1.cc and from glr.c to glr.cc: when set, YYSTYPE and YYLTYPE were `#defined`. It was never documented (just mentioned in NEWS for Bison 2.2, 2006-05-19), but was used to simplify the test suite. Stop that: adjust the test suite to the skeletons, not the converse. In C++ use yy::parser::semantic_type, yy::parser::location_type, and yy::parser::token::MY_TOKEN, instead of YYSTYPE, YYLTYPE and MY_TOKEN. * data/skeletons/glr.cc, data/skeletons/lalr1.cc: Remove its support. * tests/actions.at, tests/c++.at, tests/calc.at: Adjust.

view details

Akim Demaille

commit sha 9e75066819b51fa33cfe1438f55b017e080f0181

cex: style changes * src/counterexample.c: Simplify a bit. * src/parse-simulation.c, src/parse-simulation.h: Enforce coding style.

view details

Akim Demaille

commit sha 3dd8f2305a0a9acebed25d548d1daf398399ed0a

cex: use the bullet in HTML * data/xslt/xml2xhtml.xsl: here.

view details

Vincent Imbimbo

commit sha 69e3b405d98a5a95eb2a3ab0ff98c22829f7600e

cex: fix reporting of null nonterminals I implemented this to print A ::= [ ], but A ::= [ %empty ] might be clearer. * src/parse-simulation.c (nullable_closure): Don't generate null nonterminal derivations as leaves. * src/derivation.c (derivation_print_impl): Don't print seperator spaces for null nonterminal. * tests/counterexample.at: Update test results.

view details

Akim Demaille

commit sha 0f120354b623b10dc7e130f931348a030839cd75

cex: don't display twice unifying examples if there is no color It makes no sense, and is actually confusing, to display twice the same example with no visible difference. * src/complain.h, src/complain.c (is_styled): New. * src/counterexample.c (print_counterexample): Display the unified example a second time only if it makes a difference. * tests/conflicts.at, tests/counterexample.at, tests/report.at: Adjust. * tests/diagnostics.at: Make sure we do display the unifying examples twice when colors are enabled. And check those colors.

view details

Akim Demaille

commit sha f69939fd12e204bbf7f655f2a22cea8f425d4f00

cex: display all the conflicts, not just one per state Currently we show at most one S/R counterexample and one R/R counterexample per state. There's no reason for this. * src/counterexample.c (counterexample_report_state): Don't stop of the first conflicts. * tests/conflicts.at, tests/counterexample.at, tests/diagnostics.at, * tests/report.at: Adjust.

view details

push time in 14 days

push eventakimd/bison

Akim Demaille

commit sha e5aa254f687165e3cc4cee1a4beb1b504ccd6041

cex: use the bullet in HTML * data/xslt/xml2xhtml.xsl: here.

view details

Akim Demaille

commit sha f60a4cf815f473fc7eebcde351a5ee05bf38e4b0

style: reorder and comment * src/reader.h: here.

view details

Akim Demaille

commit sha 428f0a8974bbc9d394ed65f2bfa1f90fffde3885

style: clarify the way state kernels (aka cores) are built Use state_list_append in a more natural way. * src/lr0.c (generate_states): Here.

view details

Akim Demaille

commit sha ca86cc6d2982674369b43e4da6356b7214fa9bb5

doc: more details about symbols in m4 * data/README.md: here.

view details

Akim Demaille

commit sha a833a006af63bb2505f01cc72320a76c42386202

gram: more debugging information * src/gram.c (ritem_print): Show indices in ritem.

view details

Akim Demaille

commit sha bf833a507ea9008b330ae7677e62f787fd80256d

reader: get ready to create several initial rules * src/reader.c (create_start_rule): New. Use it.

view details

Akim Demaille

commit sha 7d6e278a068c38f609b19c186725cc72a492ebf9

parser: expose a list of symbols * src/parse-gram.y (%type): Also use current_class. (symbol_decl.1): Rename as... (symbols.1): this.

view details

Akim Demaille

commit sha 101569f8dc1fdbada1525ebe53cbca1e308de0c6

regen

view details

Akim Demaille

commit sha 9b4de07c1036545ebd9e0ee7f974bf7d737f31a3

parser: accept several start symbols * src/parse-gram.y (grammar_declaration): Accept a list of start symbols. * src/reader.h, src/reader.c (grammar_start_symbol_set): Rename as... (grammar_start_symbols_set): this.

view details

Akim Demaille

commit sha 5ed8f326fb5b37dd4dd8667f03abbbd916d9180d

multistart: turn start symbols into rules on $accept Now that the parser can read several start symbols, let's process them, and create the corresponding rules. * src/reader.h, src/reader.c (start_flag): Replace with... (start_symbols): this. * src/reader.c (grammar_start_symbols_set): Build a list of start symbols. (switching_token, create_start_rules): New. (check_and_convert_grammar): Use them to turn the list of start symbols into a set of rules. * src/reduce.c (nonterminals_reduce): Don't complain about $accept, it's an internal detail. (reduce_grammar): Complain about all the start symbols that don't derive sentences. * src/symtab.c (startsymbol, startsymbol_loc): Remove, replaced by start_symbols. symbols_pack): Move the check about the start symbols to... * src/symlist.c (check_start_symbols): here. Adjust to multiple start symbols. * tests/reduce.at (Empty Language): Generalize into... (Bad start symbols): this.

view details

Akim Demaille

commit sha 06fb7c8f1180ead624db291fbcbf45bf0e86d279

regen

view details

Akim Demaille

commit sha abaf3470aefa137bc260b713fd2d1f2261755924

multistart: adjust computation of initial core and adjust reports Currently the core of the initial state is limited to the single rule on $accept. * src/lr0.c (generate_states): There may now be several rules on $accept. * src/graphviz.c (conclude_red): Recognize "final" transitions by the fact that we reduce to "$accept". * src/print.c (print_reduction): Likewise. * src/print-xml.c (print_reduction): Likewise.

view details

Akim Demaille

commit sha a23ed4211927e225f224a4efaddf05f4ea6a1345

multistart: also check the HTML report We don't actually have checks for HTML, so let's do it for multistart. * tests/report.at: here.

view details

Akim Demaille

commit sha 29565ad7b96081c832c4e7968fe5678cdd2f1c67

multistart: pass the list of start symbols to the backend * src/output.c (start_symbols_output): New. (muscles_output): Use it.

view details

Akim Demaille

commit sha 63ca7339ad840ce45e00eafbfd4cbd717fadea96

multistart: equip yacc.c * data/skeletons/yacc.c: Add support for multiple start symbols.

view details

Akim Demaille

commit sha 8d61ec54a80c28092ed43db671f25f56fd4855a0

multistart: toy with it in lexcalc * examples/c/lexcalc/parse.y: Define several start symbols. * examples/c/lexcalc/lexcalc.test: Check support.

view details

push time in 16 days

create barnchakimd/bison

branch : multistart

created branch time in 17 days

pull request commentmarcandre/packable

skip packing on non seekable streams

I'm not use to work on Gems, I have absolutely no idea how one runs the test suite. Great for the release, thanks a lot!

akimd

comment created time in 21 days

pull request commentmarcandre/packable

skip packing on non seekable streams

I apologize, I have left a mistake: frozen is actually spelled freeze.

akimd

comment created time in 21 days

Pull request review commentmarcandre/packable

skip packing on non seekable streams

 def self.included(base) #:nodoc:         base.alias_method_chain :each, :packing       end +      # Methods supported by seekable streams.+      SEEKABLE_API = %i[pos pos= seek rewind].frozen++      # Check whether can seek without errors.+      def seekable?+        if @seekable.nil?

Ok.

akimd

comment created time in 21 days

push eventakimd/packable

Akim Demaille

commit sha 83aaa1c434d4a93c84dea362cfb168387b49405b

skip packing on non seekable streams I believe this is closely related to https://github.com/marcandre/packable/pull/12: not all the streams are seekable. Unfortunately not all the non-tty streams are seekable too, pipes are a problem. So instead of checking if the stream is not a tty, let's use minitar's seekable? test.

view details

push time in 21 days

push eventakimd/packable

Akim Demaille

commit sha 159fe7141074e8755537b867ecbc2aba145f2940

skip packing on non seekable streams I believe this is closely related to https://github.com/marcandre/packable/pull/12: not all the streams are seekable. Unfortunately not all the non-tty streams are seekable too, pipes are a problem. So instead of checking if the stream is not a tty, let's use minitar's seekable? test.

view details

push time in 21 days

push eventakimd/packable

Akim Demaille

commit sha 34ef49d6df6e2f1ae566f0a44dcee8444327e908

skip packing on non seekable streams I believe this is closely related to https://github.com/marcandre/packable/pull/12: not all the streams are seekable. Unfortunately not all the non-tty streams are seekable too, pipes are a problem. So instead of checking if the stream is not a tty, let's use minitar's seekable? test.

view details

push time in 21 days

pull request commentmarcandre/packable

skip packing on non seekable streams

I think I took care of your concerns. Cheers!

akimd

comment created time in 21 days

push eventakimd/packable

Akim Demaille

commit sha 7ba5016cfbd0387536cba24880f898e4d0b65000

skip packing on non seekable streams I believe this is closely related to https://github.com/marcandre/packable/pull/12: not all the streams are seekable. Unfortunately not all the non-tty streams are seekable too, pipes are a problem. So instead of checking if the stream is not a tty, let's use minitar's seekable? test.

view details

push time in 21 days

PR opened marcandre/packable

skip packing on non seekable streams

I believe this is closely related to https://github.com/marcandre/packable/pull/12: not all the streams are seekable. Unfortunately not all the non-tty streams are seekable too, pipes are a problem.

So instead of checking if the stream is not a tty, let's use minitar's seekable? test.

This fixes the issue for our use case.

Cheers!

+17 -3

0 comment

1 changed file

pr created time in 21 days

push eventakimd/packable

Akim Demaille

commit sha 9b0a2185ddfa076950f964f5cdeec1c8c72aff18

skip packing on non seekable streams I believe this is closely related to https://github.com/marcandre/packable/pull/12: not all the streams are seekable. Unfortunately not all the non-tty streams are seekable too, pipes are a problem. So instead of checking if the stream is not a tty, let's use minitar's seekable? test.

view details

push time in 21 days

fork akimd/packable

Extensive pack and unpack capabilities

fork in 21 days

delete branch akimd/bison

delete branch : cex-in-reports

delete time in 21 days

push eventakimd/bison

Akim Demaille

commit sha 3f4ffea6f2a0fddd70cfd467de686d9abb860269

glr.cc: don't leak glr.c/glr.cc scaffolding to the user Until we have a decent reimplementation of glr.cc, we have to use tricks to shoehorn C++ symbols to the C engine of glr.c. Some of them are done via #define. Unfortunately in Bison 3.6 some of these we done in the header file, which broke valid user code. Reported by Egor Pugin. https://lists.gnu.org/r/bug-bison/2020-06/msg00003.html * data/skeletons/glr.cc: Stop playing tricks with b4_pre_epilogue. (b4_glr_cc_setup, b4_glr_cc_cleanup): New. Much cleaner way to instal glr.cc's scaffolding around glr.c. * data/skeletons/glr.c: Adjust to use them.

view details

Akim Demaille

commit sha 2a069f22c651245e7d5572c5da1b70908767c015

version 3.6.4 * NEWS: Record release date.

view details

Akim Demaille

commit sha 627fecb19e86ae3fc9390ded8f46c7cddc439129

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

Akim Demaille

commit sha c662b23735ae59a9e38dcef5ad88e185334235e7

Merge 'maint' * upstream/maint: maint: post-release administrivia version 3.6.4 glr.cc: don't leak glr.c/glr.cc scaffolding to the user Some fixes were needed to adjust to recent changes in glr.cc and glr.c. * data/skeletons/glr.cc: Stop messing with the user's epilogue to insert glr.cc code. We need that code to be inserted _before_ the user's epilogue, not after. So define b4_glr_cc_pre_epilogue. * data/skeletons/glr.c: Use it.

view details

Akim Demaille

commit sha 1c3189734ce46ecb8eb469344a6ce936be53e535

style: more uses of const * src/print.c, src/state.h, src/state.c: here.

view details

Akim Demaille

commit sha 5edac5e15aada80057991cfd8afe0ec894ffbcb1

cex: add an argument to the reporting functions to specify the stream * src/conflicts.c (find_state_item_number, report_state_counterexamples): Move to... * src/counterexample.h, src/counterexample.c (find_state_item_number) (counterexample_report_state): this. Add support for `out` as an argument. (counterexample_report_reduce_reduce, counterexample_report_shift_reduce): Accept an `out` argument, and be static.

view details

Akim Demaille

commit sha 9206b15c4e0c85a46154c3553b1b3a298723c92a

cex: make sure traces go to stderr * src/parse-simulation.h, src/parse-simulation.c (print_parse_state): here.

view details

Akim Demaille

commit sha 22f62414f907d5825db2576df6a506dab7080b03

cex: don't report the items Showing the items (with the state numbers) is really something we should restrict to the report. * src/counterexample.c (counterexample_report_shift_reduce) (counterexample_report_reduce_reduce): Don't show the pointed rules, we will do that in the report. * tests/counterexample.at: Adjust.

view details

Akim Demaille

commit sha 35c0fe6789cc95d252e593190abec3754850c7a7

cex: indent the diagnostics to highlight the structure Instead of Shift/reduce conflict on token D: Example A a • D First derivation s ::=[ A a a ::=[ b ::=[ c ::=[ • ] ] ] d ::=[ D ] ] Example A a • D Second derivation s ::=[ A a d ::=[ • D ] ] display Shift/reduce conflict on token D: Example A a • D First derivation s ::=[ A a a ::=[ b ::=[ c ::=[ • ] ] ] d ::=[ D ] ] Example A a • D Second derivation s ::=[ A a d ::=[ • D ] ] * src/counterexample.c (print_counterexample): Indent. * tests/counterexample.at: Adjust.

view details

Akim Demaille

commit sha d4f854e5b2d6b10b50dee40831c4e107d76cc254

cex: also include the counterexamples in the report The report is the best place to show the details about counterexamples, since we have the state right under the nose. For instance: State 7 1 exp: exp . "⊕" exp 2 | exp . "+" exp 2 | exp "+" exp . [$end, "+", "⊕"] 3 | exp . "+" exp 3 | exp "+" exp . [$end, "+", "⊕"] "⊕" shift, and go to state 6 $end reduce using rule 2 (exp) $end [reduce using rule 3 (exp)] "+" reduce using rule 2 (exp) "+" [reduce using rule 3 (exp)] "⊕" [reduce using rule 2 (exp)] "⊕" [reduce using rule 3 (exp)] $default reduce using rule 2 (exp) Conflict between rule 2 and token "+" resolved as reduce (%left "+"). Shift/reduce conflict on token "⊕": 2 exp: exp "+" exp . 1 exp: exp . "⊕" exp Example exp "+" exp • "⊕" exp First derivation exp ::=[ exp ::=[ exp "+" exp • ] "⊕" exp ] Example exp "+" exp • "⊕" exp Second derivation exp ::=[ exp "+" exp ::=[ exp • "⊕" exp ] ] Reduce/reduce conflict on tokens $end, "+", "⊕": 2 exp: exp "+" exp . 3 exp: exp "+" exp . Example exp "+" exp • First derivation exp ::=[ exp "+" exp • ] Example exp "+" exp • Second derivation exp ::=[ exp "+" exp • ] Shift/reduce conflict on token "⊕": 3 exp: exp "+" exp . 1 exp: exp . "⊕" exp Example exp "+" exp • "⊕" exp First derivation exp ::=[ exp ::=[ exp "+" exp • ] "⊕" exp ] Example exp "+" exp • "⊕" exp Second derivation exp ::=[ exp "+" exp ::=[ exp • "⊕" exp ] ] * src/conflicts.h, src/conflicts.c (has_conflicts): New. * src/counterexample.h, src/counterexample.c (print_counterexample): Add a `prefix` argument. (counterexample_report_shift_reduce) (counterexample_report_reduce_reduce): Show the items when there's a prefix. * src/state-item.h, src/state-item.c (print_state_item): Add a `prefix` argument. * src/derivation.h, src/derivation.c (derivation_print) (derivation_print_leaves): Add a prefix argument. * src/print.c (print_state): When -Wcex is enabled, show the conflicts. * tests/report.at: Adjust.

view details

Akim Demaille

commit sha c35e829a762ef62b83a7843507ffbae847353a08

cex: also include in the report on --report=counterexamples And let --report=all include the counterexamples. * src/getargs.h, src/getargs.c (report_cex): New. * src/main.c: Compute counterexamples when -rcex is specified. * src/print.c: Include the counterexamples when -rcex is specified. * tests/conflicts.at, tests/existing.at, tests/local.at: Adjust.

view details

Akim Demaille

commit sha e077bf1ebcdcd91de5de8944be3bf3c35a00b1fe

cex: don't assume the terminal supports "•" Use of print_unicode_char suggested by Bruno Haible. https://lists.gnu.org/r/bug-gettext/2020-06/msg00012.html * src/gram.h (print_dot_fallback, print_dot): New. * src/gram.c, src/derivation.c: Use it. * tests/counterexample.at, tests/report.at: Adjust the test suite. * .travis.yml, README-hacking.md: Adjust.

view details

push time in 21 days

PR merged akimd/bison

Counterexamples in reports

This series of commits (https://github.com/akimd/bison/pull/40) changes the way the counterexamples are shown in the diagnostics, and introduces them in the reports.

In the terminal, we go from

Shift/reduce conflict on token B:
1:    7 a: A .
1:    5 b: . B
Example              A • B C
First derivation     s ::=[ a ::=[ A • ] bc ::=[ B C ] ]
Example              A • B C
Second derivation    s ::=[ ac ::=[ A ac ::=[ b ::=[ • B ] ] C ] ]

to

Shift/reduce conflict on token B:
  Example              A . B C
  First derivation     s ::=[ a ::=[ A . ] bc ::=[ B C ] ]
  Example              A . B C
  Second derivation    s ::=[ ac ::=[ A ac ::=[ b ::=[ . B ] ] C ] ]

In the reports, we go from

1 exp: exp . OP exp
1    | exp OP exp .  [$end, OP]

OP  shift, and go to state 4

OP        [reduce using rule 1 (exp)]
$default  reduce using rule 1 (exp)

to

1 exp: exp . OP exp
1    | exp OP exp .  [$end, OP]

OP  shift, and go to state 4

OP        [reduce using rule 1 (exp)]
$default  reduce using rule 1 (exp)

Shift/reduce conflict on token OP:
    1 exp: exp OP exp .
    1 exp: exp . OP exp
  Example                  exp OP exp . OP exp
  First derivation         exp ::=[ exp ::=[ exp OP exp . ] OP exp ]
  Example                  exp OP exp . OP exp
  Second derivation        exp ::=[ exp OP exp ::=[ exp . OP exp ] ]

I would very much like to have comments about this series.

The last commit, which relies on the internationalization of "." to get "•", is unpleasing: I much prefer "•", of course, but so far we never required the support of anything but ASCII. I would like to avoid this, but so far, I don't have any good solution. Maybe someone will provide a better alternative (https://lists.gnu.org/r/bug-gettext/2020-06/msg00011.html).

+610 -393

0 comment

37 changed files

akimd

pr closed time in 21 days

push eventakimd/bison

Akim Demaille

commit sha e077bf1ebcdcd91de5de8944be3bf3c35a00b1fe

cex: don't assume the terminal supports "•" Use of print_unicode_char suggested by Bruno Haible. https://lists.gnu.org/r/bug-gettext/2020-06/msg00012.html * src/gram.h (print_dot_fallback, print_dot): New. * src/gram.c, src/derivation.c: Use it. * tests/counterexample.at, tests/report.at: Adjust the test suite. * .travis.yml, README-hacking.md: Adjust.

view details

push time in 21 days

push eventakimd/bison

Akim Demaille

commit sha b296474b1b88dc8eba6fb6b344cf3327c9fa3932

cex: factor the definition of "•" Use of print_unicode_char suggested by Bruno Haible. https://lists.gnu.org/r/bug-gettext/2020-06/msg00012.html * src/gram.h (print_dot_fallback, print_dot): New. * src/gram.c, src/derivation.c: Use it. * tests/counterexample.at, tests/report.at: Adjust the test suite. * .travis.yml, README-hacking.md: Adjust.

view details

push time in 21 days

push eventakimd/bison

Akim Demaille

commit sha 3f4ffea6f2a0fddd70cfd467de686d9abb860269

glr.cc: don't leak glr.c/glr.cc scaffolding to the user Until we have a decent reimplementation of glr.cc, we have to use tricks to shoehorn C++ symbols to the C engine of glr.c. Some of them are done via #define. Unfortunately in Bison 3.6 some of these we done in the header file, which broke valid user code. Reported by Egor Pugin. https://lists.gnu.org/r/bug-bison/2020-06/msg00003.html * data/skeletons/glr.cc: Stop playing tricks with b4_pre_epilogue. (b4_glr_cc_setup, b4_glr_cc_cleanup): New. Much cleaner way to instal glr.cc's scaffolding around glr.c. * data/skeletons/glr.c: Adjust to use them.

view details

Akim Demaille

commit sha 2a069f22c651245e7d5572c5da1b70908767c015

version 3.6.4 * NEWS: Record release date.

view details

Akim Demaille

commit sha 627fecb19e86ae3fc9390ded8f46c7cddc439129

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

Akim Demaille

commit sha c662b23735ae59a9e38dcef5ad88e185334235e7

Merge 'maint' * upstream/maint: maint: post-release administrivia version 3.6.4 glr.cc: don't leak glr.c/glr.cc scaffolding to the user Some fixes were needed to adjust to recent changes in glr.cc and glr.c. * data/skeletons/glr.cc: Stop messing with the user's epilogue to insert glr.cc code. We need that code to be inserted _before_ the user's epilogue, not after. So define b4_glr_cc_pre_epilogue. * data/skeletons/glr.c: Use it.

view details

Akim Demaille

commit sha 1c3189734ce46ecb8eb469344a6ce936be53e535

style: more uses of const * src/print.c, src/state.h, src/state.c: here.

view details

Akim Demaille

commit sha 5edac5e15aada80057991cfd8afe0ec894ffbcb1

cex: add an argument to the reporting functions to specify the stream * src/conflicts.c (find_state_item_number, report_state_counterexamples): Move to... * src/counterexample.h, src/counterexample.c (find_state_item_number) (counterexample_report_state): this. Add support for `out` as an argument. (counterexample_report_reduce_reduce, counterexample_report_shift_reduce): Accept an `out` argument, and be static.

view details

Akim Demaille

commit sha 9206b15c4e0c85a46154c3553b1b3a298723c92a

cex: make sure traces go to stderr * src/parse-simulation.h, src/parse-simulation.c (print_parse_state): here.

view details

Akim Demaille

commit sha 22f62414f907d5825db2576df6a506dab7080b03

cex: don't report the items Showing the items (with the state numbers) is really something we should restrict to the report. * src/counterexample.c (counterexample_report_shift_reduce) (counterexample_report_reduce_reduce): Don't show the pointed rules, we will do that in the report. * tests/counterexample.at: Adjust.

view details

Akim Demaille

commit sha 35c0fe6789cc95d252e593190abec3754850c7a7

cex: indent the diagnostics to highlight the structure Instead of Shift/reduce conflict on token D: Example A a • D First derivation s ::=[ A a a ::=[ b ::=[ c ::=[ • ] ] ] d ::=[ D ] ] Example A a • D Second derivation s ::=[ A a d ::=[ • D ] ] display Shift/reduce conflict on token D: Example A a • D First derivation s ::=[ A a a ::=[ b ::=[ c ::=[ • ] ] ] d ::=[ D ] ] Example A a • D Second derivation s ::=[ A a d ::=[ • D ] ] * src/counterexample.c (print_counterexample): Indent. * tests/counterexample.at: Adjust.

view details

Akim Demaille

commit sha d4f854e5b2d6b10b50dee40831c4e107d76cc254

cex: also include the counterexamples in the report The report is the best place to show the details about counterexamples, since we have the state right under the nose. For instance: State 7 1 exp: exp . "⊕" exp 2 | exp . "+" exp 2 | exp "+" exp . [$end, "+", "⊕"] 3 | exp . "+" exp 3 | exp "+" exp . [$end, "+", "⊕"] "⊕" shift, and go to state 6 $end reduce using rule 2 (exp) $end [reduce using rule 3 (exp)] "+" reduce using rule 2 (exp) "+" [reduce using rule 3 (exp)] "⊕" [reduce using rule 2 (exp)] "⊕" [reduce using rule 3 (exp)] $default reduce using rule 2 (exp) Conflict between rule 2 and token "+" resolved as reduce (%left "+"). Shift/reduce conflict on token "⊕": 2 exp: exp "+" exp . 1 exp: exp . "⊕" exp Example exp "+" exp • "⊕" exp First derivation exp ::=[ exp ::=[ exp "+" exp • ] "⊕" exp ] Example exp "+" exp • "⊕" exp Second derivation exp ::=[ exp "+" exp ::=[ exp • "⊕" exp ] ] Reduce/reduce conflict on tokens $end, "+", "⊕": 2 exp: exp "+" exp . 3 exp: exp "+" exp . Example exp "+" exp • First derivation exp ::=[ exp "+" exp • ] Example exp "+" exp • Second derivation exp ::=[ exp "+" exp • ] Shift/reduce conflict on token "⊕": 3 exp: exp "+" exp . 1 exp: exp . "⊕" exp Example exp "+" exp • "⊕" exp First derivation exp ::=[ exp ::=[ exp "+" exp • ] "⊕" exp ] Example exp "+" exp • "⊕" exp Second derivation exp ::=[ exp "+" exp ::=[ exp • "⊕" exp ] ] * src/conflicts.h, src/conflicts.c (has_conflicts): New. * src/counterexample.h, src/counterexample.c (print_counterexample): Add a `prefix` argument. (counterexample_report_shift_reduce) (counterexample_report_reduce_reduce): Show the items when there's a prefix. * src/state-item.h, src/state-item.c (print_state_item): Add a `prefix` argument. * src/derivation.h, src/derivation.c (derivation_print) (derivation_print_leaves): Add a prefix argument. * src/print.c (print_state): When -Wcex is enabled, show the conflicts. * tests/report.at: Adjust.

view details

Akim Demaille

commit sha c35e829a762ef62b83a7843507ffbae847353a08

cex: also include in the report on --report=counterexamples And let --report=all include the counterexamples. * src/getargs.h, src/getargs.c (report_cex): New. * src/main.c: Compute counterexamples when -rcex is specified. * src/print.c: Include the counterexamples when -rcex is specified. * tests/conflicts.at, tests/existing.at, tests/local.at: Adjust.

view details

Akim Demaille

commit sha 48f023458f233a88ad0a9b448ecd550119f73bae

cex: factor the definition of "•" Use of print_unicode_char suggested by Bruno Haible. https://lists.gnu.org/r/bug-gettext/2020-06/msg00012.html * src/gram.h (print_dot_fallback, print_dot): New. * src/gram.c, src/derivation.c: Use it. * tests/counterexample.at, tests/report.at: Adjust the test suite.

view details

push time in 21 days

push eventakimd/bison

Akim Demaille

commit sha 251e1b137fd752be2907703c83de8fa52fd137f2

reports: the column width differs from the byte count From "number" shift, and go to state 1 "Ñùṃéℝô" shift, and go to state 2 to "number" shift, and go to state 1 "Ñùṃéℝô" shift, and go to state 2 * src/print.c: Use mbswidth, not strlen, to compute visual columns. * tests/report.at: Adjust.

view details

Akim Demaille

commit sha 3f4ffea6f2a0fddd70cfd467de686d9abb860269

glr.cc: don't leak glr.c/glr.cc scaffolding to the user Until we have a decent reimplementation of glr.cc, we have to use tricks to shoehorn C++ symbols to the C engine of glr.c. Some of them are done via #define. Unfortunately in Bison 3.6 some of these we done in the header file, which broke valid user code. Reported by Egor Pugin. https://lists.gnu.org/r/bug-bison/2020-06/msg00003.html * data/skeletons/glr.cc: Stop playing tricks with b4_pre_epilogue. (b4_glr_cc_setup, b4_glr_cc_cleanup): New. Much cleaner way to instal glr.cc's scaffolding around glr.c. * data/skeletons/glr.c: Adjust to use them.

view details

Akim Demaille

commit sha 2a069f22c651245e7d5572c5da1b70908767c015

version 3.6.4 * NEWS: Record release date.

view details

Akim Demaille

commit sha 627fecb19e86ae3fc9390ded8f46c7cddc439129

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

Akim Demaille

commit sha 163c0a08ffb716e1c7125390409aa25c5ea297f4

Merge 'maint' * upstream/maint: maint: post-release administrivia version 3.6.4 glr.cc: don't leak glr.c/glr.cc scaffolding to the user

view details

push time in 21 days

push eventakimd/bison

Akim Demaille

commit sha 3f4ffea6f2a0fddd70cfd467de686d9abb860269

glr.cc: don't leak glr.c/glr.cc scaffolding to the user Until we have a decent reimplementation of glr.cc, we have to use tricks to shoehorn C++ symbols to the C engine of glr.c. Some of them are done via #define. Unfortunately in Bison 3.6 some of these we done in the header file, which broke valid user code. Reported by Egor Pugin. https://lists.gnu.org/r/bug-bison/2020-06/msg00003.html * data/skeletons/glr.cc: Stop playing tricks with b4_pre_epilogue. (b4_glr_cc_setup, b4_glr_cc_cleanup): New. Much cleaner way to instal glr.cc's scaffolding around glr.c. * data/skeletons/glr.c: Adjust to use them.

view details

Akim Demaille

commit sha 2a069f22c651245e7d5572c5da1b70908767c015

version 3.6.4 * NEWS: Record release date.

view details

Akim Demaille

commit sha 627fecb19e86ae3fc9390ded8f46c7cddc439129

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

push time in 21 days

created tagakimd/bison

tagv3.6.4

GNU Bison

created time in 21 days

push eventakimd/bison

Akim Demaille

commit sha 8be7f88dde3a230c31714297da9821dec07c38d0

cex: factor the definition of "•" Use of print_unicode_char suggested by Bruno Haible. https://lists.gnu.org/r/bug-gettext/2020-06/msg00012.html * src/gram.h (print_dot_fallback, print_dot): New. * src/gram.c, src/derivation.c: Use it. * tests/counterexample.at, tests/report.at: Adjust the test suite.

view details

push time in 23 days

PR opened akimd/bison

Counterexamples in reports
+436 -304

0 comment

26 changed files

pr created time in 23 days

create barnchakimd/bison

branch : cex-in-reports

created branch time in 23 days

delete branch akimd/bison

delete branch : fix-width

delete time in 24 days

PR merged akimd/bison

Fix reports

I was working on integrating Vincent's counterexamples into the reports when I noticed that our reports were truly ugly when UTF-8 was used in string aliases.

I have always had problems with the way bison escapes the user's strings (which resulted in people not being able to trust the aliases, something which error=detailed fixed in 3.6), but that was really yet another sign that

we should not toy with the user's spelling of her strings

So this batch revises the way Bison parses strings. Instead of interpreting them (i.e., resolving the escapes), it keeps them the way they are, but it does check for their validity (so it will reject \777 for instance).

Only when the string must be interpreted (e.g., for %output) do we unquote the strings.

The news entry reads:

*** String aliases are faithfully propagated

Bison used to interpret user strings (i.e., decoding backslash escapes) when reading them, and to escape them (i.e., issue non-printable characters as backslash escapes, taking the locale into account) when outputting them. As a consequence non-ASCII strings (say in UTF-8) ended up "ciphered" as sequences of backslash escapes. This happened not only in the generated sources (where the compiler will reinterpret them), but also in all the generated reports (text, xml, html, dot, etc.). Reports were therefore not readable when string aliases were not pure ASCII. Worse yet: the output depended on the user's locale.

Now Bison faithfully treats the string aliases exactly the way the user spelled them. This fixes all the aforementioned problems. However, now,string aliases semantically equivalent but syntactically different (e.g.,"A", "\x41", "\101") are considered to be different.

+1127 -296

0 comment

19 changed files

akimd

pr closed time in 24 days

push eventakimd/bison

Akim Demaille

commit sha 1998606a904f0155079beda7a76489ff6940a7b6

regen

view details

Akim Demaille

commit sha c857ed4f72b83c561bfd42e5ff6c129ddb2017ee

style: prefer 'FOO ()' to 'FOO' for function-like macros * src/flex-scanner.h (STRING_GROW, STRING_FINISH, STRING_FREE): Make them function-like macros. Adjust dependencies.

view details

Akim Demaille

commit sha e088b4f90fb59c28bd2c0666a5f78f8c0c97b639

style: reduce scopes * src/scan-gram.l (STRING_GROW_ESCAPE): Move the static_assert about type sizes here.

view details

Akim Demaille

commit sha b7fbfd050ecfa8f94fa8ef987db21b93b440458b

style: introduce & use STRING_1GROW * src/flex-scanner.h (STRING_1GROW): New. * src/scan-gram.l, src/scan-skel.l: Use it.

view details

Akim Demaille

commit sha cef13e11f50e38331965acf3d783b41b9b06b983

style: factor common bits about string scanning * src/scan-gram.l: here.

view details

Akim Demaille

commit sha 5d5e1df1dcb3ea64f1599bc339dcb8b48add68df

tests: check reports with conflicts and UTF-8 This is to record the current state of the report, which escapes the UTF-8 characters (as parse.error="verbose" does), but shouldn't (as parse.error="detailed" does). * tests/report.at: here.

view details

Akim Demaille

commit sha 5855da47227b020bf603fd6b291cba641c06fcff

parser: keep string aliases as the user wrote it Currently our scanner decodes all the escapes in the strings, and we later reescape the strings when we emit them. This is troublesome, as we do not respect the user input. For instance, when the user writes in UTF-8, we destroy her string when we write it back. And this shows everywhere: in the reports we show the escaped string instead of the actual alias: 0 $accept: . exp $end 1 exp: . exp "\342\212\225" exp 2 | . exp "+" exp 3 | . exp "+" exp 4 | . "number" 5 | . "\303\221\303\271\341\271\203\303\251\342\204\235\303\264" "number" shift, and go to state 1 "\303\221\303\271\341\271\203\303\251\342\204\235\303\264" shift, and go to state 2 This commit preserves the user's exact spelling of the string aliases, instead of interpreting the escapes and then reescaping. The report now shows: 0 $accept: . exp $end 1 exp: . exp "⊕" exp 2 | . exp "+" exp 3 | . exp "+" exp 4 | . "number" 5 | . "Ñùṃéℝô" "number" shift, and go to state 1 "Ñùṃéℝô" shift, and go to state 2 Likewise, the XML (and therefore HTML) outputs are fixed. * src/scan-gram.l (STRING, TSTRING): Do not interpret the escapes in the resulting string. * src/parse-gram.y (unquote, parser_init, parser_free, unquote_free) (handle_defines, handle_language, obstack_for_unquote): New. Use them to unquote where needed. * tests/regression.at, tests/report.at: Update.

view details

Akim Demaille

commit sha e4d33cf57914b3718762183bcc9237fc03f3c1fe

regen

view details

Akim Demaille

commit sha efbcadeca72dc339802e1760db7f8336bd20f514

reports: don't escape the labels Currently we use "quotearg" to escape the strings output in Dot. As a result, if the user's locale is C for instance, all the non-ASCII are escaped. Unfortunately graphviz does not interpret this style of escaping. For instance: 5 -> 2 [style=solid label="\"\303\221\303\271\341\271\203\303\251\342\204\235\303\264\""] was displayed as a sequence of numbers. We now output: 5 -> 2 [style=solid label="\"Ñùṃéℝô\""] independently of the user's locale. * src/system.h (obstack_backslash): New. * src/graphviz.h, src/graphviz.c (escape): Remove, use obstack_backslash instead. * src/print-graph.c: Likewise. * tests/report.at: Adjust.

view details

Akim Demaille

commit sha 251e1b137fd752be2907703c83de8fa52fd137f2

reports: the column width differs from the byte count From "number" shift, and go to state 1 "Ñùṃéℝô" shift, and go to state 2 to "number" shift, and go to state 1 "Ñùṃéℝô" shift, and go to state 2 * src/print.c: Use mbswidth, not strlen, to compute visual columns. * tests/report.at: Adjust.

view details

push time in 24 days

PR opened akimd/bison

Fix reports

I was working on integrating Vincent's counterexamples into the reports when I noticed that our reports were truly ugly when UTF-8 was used in string aliases.

I have always had problems with the way bison escapes the user's strings (which resulted in people not being able to trust the aliases, something which error=detailed fixed in 3.6), but that was really yet another sign that

we should not toy with the user's spelling of her strings

So this batch revises the way Bison parses strings. Instead of interpreting them (i.e., resolving the escapes), it keeps them the way they are, but it does check for their validity (so it will reject \777 for instance).

Only when the string must be interpreted (e.g., for %output) do we unquote the strings.

The news entry reads:

*** String aliases are faithfully propagated

Bison used to interpret user strings (i.e., decoding backslash escapes) when reading them, and to escape them (i.e., issue non-printable characters as backslash escapes, taking the locale into account) when outputting them. As a consequence non-ASCII strings (say in UTF-8) ended up "ciphered" as sequences of backslash escapes. This happened not only in the generated sources (where the compiler will reinterpret them), but also in all the generated reports (text, xml, html, dot, etc.). Reports were therefore not readable when string aliases were not pure ASCII. Worse yet: the output depended on the user's locale.

Now Bison faithfully treats the string aliases exactly the way the user spelled them. This fixes all the aforementioned problems. However, now,string aliases semantically equivalent but syntactically different (e.g.,"A", "\x41", "\101") are considered to be different.

+1127 -296

0 comment

19 changed files

pr created time in 24 days

create barnchakimd/bison

branch : fix-width

created branch time in 24 days

push eventakimd/bison

Akim Demaille

commit sha c857ed4f72b83c561bfd42e5ff6c129ddb2017ee

style: prefer 'FOO ()' to 'FOO' for function-like macros * src/flex-scanner.h (STRING_GROW, STRING_FINISH, STRING_FREE): Make them function-like macros. Adjust dependencies.

view details

Akim Demaille

commit sha e088b4f90fb59c28bd2c0666a5f78f8c0c97b639

style: reduce scopes * src/scan-gram.l (STRING_GROW_ESCAPE): Move the static_assert about type sizes here.

view details

Akim Demaille

commit sha b7fbfd050ecfa8f94fa8ef987db21b93b440458b

style: introduce & use STRING_1GROW * src/flex-scanner.h (STRING_1GROW): New. * src/scan-gram.l, src/scan-skel.l: Use it.

view details

Akim Demaille

commit sha cef13e11f50e38331965acf3d783b41b9b06b983

style: factor common bits about string scanning * src/scan-gram.l: here.

view details

Akim Demaille

commit sha 5d5e1df1dcb3ea64f1599bc339dcb8b48add68df

tests: check reports with conflicts and UTF-8 This is to record the current state of the report, which escapes the UTF-8 characters (as parse.error="verbose" does), but shouldn't (as parse.error="detailed" does). * tests/report.at: here.

view details

Akim Demaille

commit sha 5855da47227b020bf603fd6b291cba641c06fcff

parser: keep string aliases as the user wrote it Currently our scanner decodes all the escapes in the strings, and we later reescape the strings when we emit them. This is troublesome, as we do not respect the user input. For instance, when the user writes in UTF-8, we destroy her string when we write it back. And this shows everywhere: in the reports we show the escaped string instead of the actual alias: 0 $accept: . exp $end 1 exp: . exp "\342\212\225" exp 2 | . exp "+" exp 3 | . exp "+" exp 4 | . "number" 5 | . "\303\221\303\271\341\271\203\303\251\342\204\235\303\264" "number" shift, and go to state 1 "\303\221\303\271\341\271\203\303\251\342\204\235\303\264" shift, and go to state 2 This commit preserves the user's exact spelling of the string aliases, instead of interpreting the escapes and then reescaping. The report now shows: 0 $accept: . exp $end 1 exp: . exp "⊕" exp 2 | . exp "+" exp 3 | . exp "+" exp 4 | . "number" 5 | . "Ñùṃéℝô" "number" shift, and go to state 1 "Ñùṃéℝô" shift, and go to state 2 Likewise, the XML (and therefore HTML) outputs are fixed. * src/scan-gram.l (STRING, TSTRING): Do not interpret the escapes in the resulting string. * src/parse-gram.y (unquote, parser_init, parser_free, unquote_free) (handle_defines, handle_language, obstack_for_unquote): New. Use them to unquote where needed. * tests/regression.at, tests/report.at: Update.

view details

Akim Demaille

commit sha e4d33cf57914b3718762183bcc9237fc03f3c1fe

regen

view details

Akim Demaille

commit sha efbcadeca72dc339802e1760db7f8336bd20f514

reports: don't escape the labels Currently we use "quotearg" to escape the strings output in Dot. As a result, if the user's locale is C for instance, all the non-ASCII are escaped. Unfortunately graphviz does not interpret this style of escaping. For instance: 5 -> 2 [style=solid label="\"\303\221\303\271\341\271\203\303\251\342\204\235\303\264\""] was displayed as a sequence of numbers. We now output: 5 -> 2 [style=solid label="\"Ñùṃéℝô\""] independently of the user's locale. * src/system.h (obstack_backslash): New. * src/graphviz.h, src/graphviz.c (escape): Remove, use obstack_backslash instead. * src/print-graph.c: Likewise. * tests/report.at: Adjust.

view details

Akim Demaille

commit sha 11f6e1567da34d81a088f4123c5f99299c02faff

reports: the column width differs from the byte count From "number" shift, and go to state 1 "Ñùṃéℝô" shift, and go to state 2 to "number" shift, and go to state 1 "Ñùṃéℝô" shift, and go to state 2 * src/print.c: Use mbswidth, not strlen, to compute visual columns. * tests/report.at: Adjust.

view details

push time in 24 days

push eventakimd/bison

Akim Demaille

commit sha 826db68ab5af5e37bd136f6935d004fbaf7f04c5

style: introduce & use STRING_1GROW * src/flex-scanner.h (STRING_1GROW): New. * src/scan-gram.l, src/scan-skel.l: Use it.

view details

Akim Demaille

commit sha f94afb5e415846a73eeee47e6b158fbfacd978d4

style: factor common bits about string scanning * src/scan-gram.l: here.

view details

Akim Demaille

commit sha 1d3f83b22e5b18a7bc32f718d938ecd0755b6ae0

parser: keep string aliases as the user wrote it Currently our scanner decodes all the escapes in the strings, and we later reescape the strings when we emit them. This is troublesome, as we do not respect the user input. For instance, when the user writes in UTF-8, we destroy her string when we write it back. And this shows everywhere: in the reports we show the escaped string instead of the actual alias: 0 $accept: . exp $end 1 exp: . exp "\342\212\225" exp 2 | . exp "+" exp 3 | . exp "+" exp 4 | . "\360\237\224\242" 5 | . "\303\261\303\271m\303\251r\303\264" "\360\237\224\242" shift, and go to state 1 "\303\261\303\271m\303\251r\303\264" shift, and go to state 2 This commit preserves the user's exact spelling of the string aliases, instead of interpreting the escapes and then reescaping. The report now shows: 0 $accept: . exp $end 1 exp: . exp "⊕" exp 2 | . exp "+" exp 3 | . exp "+" exp 4 | . "🔢" 5 | . "ñùmérô" "🔢" shift, and go to state 1 "ñùmérô" shift, and go to state 2 * src/parse-gram.y * src/scan-gram.l * tests/regression.at * tests/report.at

view details

Akim Demaille

commit sha 66058c7e9d66f015080ffa3e53e66b7330a7ecaf

regen

view details

push time in 24 days

push eventakimd/bison

Akim Demaille

commit sha 1998606a904f0155079beda7a76489ff6940a7b6

regen

view details

Akim Demaille

commit sha a9bef0bae9f5de8fea5150b425c746d14bb24daf

tests: check reports with conflicts and UTF-8 This is to record the current state of the report, which escapes the UTF-8 characters (as parse.error="verbose" does), but shouldn't (as parse.error="detailed" does). * tests/report.at: here.

view details

Akim Demaille

commit sha 77aa70d5d9f6b61fe9a3cce91cf8425fb5f3fcd7

style: prefer 'FOO ()' to 'FOO' for function-like macros * src/flex-scanner.h (STRING_GROW, STRING_FINISH, STRING_FREE): Make them function-like macros. Adjust dependencies.

view details

Akim Demaille

commit sha 5feb35ced7591dea029e63e81123e0cd0a8801c0

style: reduce scopes * src/scan-gram.l (STRING_GROW_ESCAPE): Move the static_assert about type sizes here.

view details

Akim Demaille

commit sha 582c296a923c3b8ca1017ea51bd04d20f27485d9

style: prefer static_assert to verify * bootstrap.conf: We need gnulib's assert.h. * src/scan-gram.l, src/tables.c: Prefer static_assert.

view details

Akim Demaille

commit sha 510994f36aca8c606a20bae386b451506168b649

style: introduce & use STRING_1GROW * src/flex-scanner.h (STRING_1GROW): New. * src/scan-gram.l, src/scan-skel.l: Use it.

view details

Akim Demaille

commit sha 577214f611cc41a2d58bf2e01323bd753862817b

style: factor common bits about string scanning * src/scan-gram.l: here.

view details

Akim Demaille

commit sha 836a8daecf4293608a8926ef21bd1f25d21ec002

parser: keep string aliases as the user wrote it Currently our scanner decodes all the escapes in the strings, and we later reescape the strings when we emit them. This is troublesome, as we do not respect the user input. For instance, when the user writes in UTF-8, we destroy her string when we write it back. And this shows everywhere: in the reports we show the escaped string instead of the actual alias: 0 $accept: . exp $end 1 exp: . exp "\342\212\225" exp 2 | . exp "+" exp 3 | . exp "+" exp 4 | . "\360\237\224\242" 5 | . "\303\261\303\271m\303\251r\303\264" "\360\237\224\242" shift, and go to state 1 "\303\261\303\271m\303\251r\303\264" shift, and go to state 2 This commit preserves the user's exact spelling of the string aliases, instead of interpreting the escapes and then reescaping. The report now shows: 0 $accept: . exp $end 1 exp: . exp "⊕" exp 2 | . exp "+" exp 3 | . exp "+" exp 4 | . "🔢" 5 | . "ñùmérô" "🔢" shift, and go to state 1 "ñùmérô" shift, and go to state 2 * src/parse-gram.y * src/scan-gram.l * tests/regression.at * tests/report.at

view details

Akim Demaille

commit sha f71ba13dc55c5bd0d8f6917f10378ceae3466ffe

regen

view details

push time in 24 days

pull request commentphp/php-src

RFC: modernize the generation of syntax errors

Hi @Girgias! It depends what you call "it". On the Bison side, yes, it's been finished and released in Bison 3.6. On the PHP side, I can update this PR and have it match your coding style once I know it is ok to require Bison 3.6. Cheers!

akimd

comment created time in a month

push eventakimd/bison

Akim Demaille

commit sha d2acc4b4014ad7447c29ce56095f28d22ed12978

cex: rename -Wcounterexample as -Wcounterexamples, and support -Wcex Plural vs. singular is always a problem... But we already have conflicts-sr and conflicts-rr, so counterexamples makes more sense than counterexample. Besides, -Wcounterexample will still be accepted as an unambiguous prefix of -Wcounterexamples. Add -Wcex as a convenient alias. While at it, use only "counterexample", never "counter example". * src/complain.h, src/complain.c (Wcounterexample, warning_counterexample): Rename as... (Wcounterexamples, warning_counterexamples): these. (argmatch_warning_docs): Rename -Wcounterexample as -Wcounterexamples. (argmatch_warning_args): Likewise. Add support for -Wcex. Adjust dependencies.

view details

Akim Demaille

commit sha b0bb4cde2e66735137739f20dd3c97947e71a101

cex: suggest -Wcounterexamples when there are unexpected conflicts Suggesting -Wcounterexamples when there are conflicts is probably not what the user wants. If she knows her conflicts and has set %expect/%expect-rr appropriately, we shouldn't warn. The commit also swaps the counterexamples and the report of conflicts, into, IMHO, a more natural order: from Shift/reduce conflict on token B: 1: 3 a: A . 1: 8 y: A . B Example A • B C First derivation s ::=[ a ::=[ A • ] x ::=[ B C ] ] Example A • B C Second derivation s ::=[ y ::=[ A • B ] c ::=[ C ] ] input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] input.y:4.4: warning: rule useless in parser due to conflicts [-Wother] to input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] Shift/reduce conflict on token B: 1: 3 a: A . 1: 8 y: A . B Example A • B C First derivation s ::=[ a ::=[ A • ] x ::=[ B C ] ] Example A • B C Second derivation s ::=[ y ::=[ A • B ] c ::=[ C ] ] input.y:4.4: warning: rule useless in parser due to conflicts [-Wother] * src/conflicts.c (rule_conflicts_print): Rename as... (report_rule_expectation_mismatches): this. Move the handling of report_counterexamples to... (conflicts_print): Here. Display this warning when applicable.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha b0bb4cde2e66735137739f20dd3c97947e71a101

cex: suggest -Wcounterexamples when there are unexpected conflicts Suggesting -Wcounterexamples when there are conflicts is probably not what the user wants. If she knows her conflicts and has set %expect/%expect-rr appropriately, we shouldn't warn. The commit also swaps the counterexamples and the report of conflicts, into, IMHO, a more natural order: from Shift/reduce conflict on token B: 1: 3 a: A . 1: 8 y: A . B Example A • B C First derivation s ::=[ a ::=[ A • ] x ::=[ B C ] ] Example A • B C Second derivation s ::=[ y ::=[ A • B ] c ::=[ C ] ] input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] input.y:4.4: warning: rule useless in parser due to conflicts [-Wother] to input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] Shift/reduce conflict on token B: 1: 3 a: A . 1: 8 y: A . B Example A • B C First derivation s ::=[ a ::=[ A • ] x ::=[ B C ] ] Example A • B C Second derivation s ::=[ y ::=[ A • B ] c ::=[ C ] ] input.y:4.4: warning: rule useless in parser due to conflicts [-Wother] * src/conflicts.c (rule_conflicts_print): Rename as... (report_rule_expectation_mismatches): this. Move the handling of report_counterexamples to... (conflicts_print): Here. Display this warning when applicable.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha a53c6026cd367c75d5594e6e649ee1cdda93d5ae

api.header.include: document it, and fix its default value While defining api.header.include worked as expected, its default value was incorrectly defined. As a result, by default, the generated parsers still duplicated the content of the generated header instead of including it. * data/skeletons/yacc.c (api.header.include): Fix its default value. * tests/output.at: Check it. * doc/bison.texi (%define Summary): Document api.header.include. While at it, move the definition of api.namespace at the proper place.

view details

Akim Demaille

commit sha d2acc4b4014ad7447c29ce56095f28d22ed12978

cex: rename -Wcounterexample as -Wcounterexamples, and support -Wcex Plural vs. singular is always a problem... But we already have conflicts-sr and conflicts-rr, so counterexamples makes more sense than counterexample. Besides, -Wcounterexample will still be accepted as an unambiguous prefix of -Wcounterexamples. Add -Wcex as a convenient alias. While at it, use only "counterexample", never "counter example". * src/complain.h, src/complain.c (Wcounterexample, warning_counterexample): Rename as... (Wcounterexamples, warning_counterexamples): these. (argmatch_warning_docs): Rename -Wcounterexample as -Wcounterexamples. (argmatch_warning_args): Likewise. Add support for -Wcex. Adjust dependencies.

view details

Akim Demaille

commit sha 761d5225eea36167742b171e0a422775a166e11c

cex: suggest -Wcounterexamples when there are unexpected conflicts Suggesting -Wcounterexamples when there are conflicts is probably not what the user wants. If she knows her conflicts and has set %expect/%expect-rr appropriately, we shouldn't warn. The commit also swaps the counterexamples and the report of conflicts, into, IMHO, a more natural order: from Shift/reduce conflict on token B: 1: 3 a: A . 1: 8 y: A . B Example A • B C First derivation s ::=[ a ::=[ A • ] x ::=[ B C ] ] Example A • B C Second derivation s ::=[ y ::=[ A • B ] c ::=[ C ] ] input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] input.y:4.4: warning: rule useless in parser due to conflicts [-Wother] to input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] Shift/reduce conflict on token B: 1: 3 a: A . 1: 8 y: A . B Example A • B C First derivation s ::=[ a ::=[ A • ] x ::=[ B C ] ] Example A • B C Second derivation s ::=[ y ::=[ A • B ] c ::=[ C ] ] input.y:4.4: warning: rule useless in parser due to conflicts [-Wother] * src/conflicts.c (rule_conflicts_print): Rename as... (report_rule_expectation_mismatches): this. Move the handling of report_counterexamples to... (conflicts_print): Here. Display this warning when applicable.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha ae5edcc23b785b5ff0652aec79f8ee39f13be687

cex: color the counterexamples Use colors to show the counterexamples and the derivations in color, to highlight their structure. Align the outputs, and add i18n support. Reduce width by using a one-space separator instead of two-space. From Example A • B C First derivation s ::=[ a ::=[ A • ] x ::=[ B C ] ] Second derivation s ::=[ y ::=[ A • B ] c ::=[ C ] ] to Example A • B C First derivation s ::=[ a ::=[ A • ] x ::=[ B C ] ] Example A • B C Second derivation s ::=[ y ::=[ A • B ] c ::=[ C ] ] with colors. * data/bison-default.css (cex-dot, cex-0, cex-1, cex-2, cex-3, cex-4) (cex-5, cex-6, cex-7, cex-step, cex-leaf): New. * src/derivation.c (derivation_print_styled_impl): New. (derivation_print, derivation_print_leaves): Use it. * src/counterexample.c: Reformat the output. * tests/counterexample.at: Adjust.

view details

Akim Demaille

commit sha a53c6026cd367c75d5594e6e649ee1cdda93d5ae

api.header.include: document it, and fix its default value While defining api.header.include worked as expected, its default value was incorrectly defined. As a result, by default, the generated parsers still duplicated the content of the generated header instead of including it. * data/skeletons/yacc.c (api.header.include): Fix its default value. * tests/output.at: Check it. * doc/bison.texi (%define Summary): Document api.header.include. While at it, move the definition of api.namespace at the proper place.

view details

push time in a month

issue commentFaveod/arel-extensions

[] with a range

I would be very useful to match the semantics of Ruby, i.e., 0 being the first position, not 1.

akimd

comment created time in a month

push eventakimd/bison

Akim Demaille

commit sha 421662ec88797e249ae1eced9e1e1f05ffaf0abe

style: fix syntax-check issues * src/counterexample.c, src/files.c, src/files.h, src/lssi.c, * src/state-item.c: here.

view details

Akim Demaille

commit sha 1ccb4be02b07c3acf7e94a8b84d3178b91d26f55

cex: reformat the s/r and r/r reports In Bison we refer to "shift/reduce" conflicts, not "shift-reduce" (in Bison 3.6.3 186 occurrences vs 15). Enforce consistency on this. Instead of "spending" a second line for each conflict to report the lookaheads, put that on the same line as the type of conflict. Also, prefer "token" to "symbol". Maybe we should even prefer "lookahead". While at it, enable internationalization, with plurals where appropriate. As a consequence, instead of Shift-Reduce Conflict: 6: 3 b: . %empty 6: 6 d: c . A On Symbol: A display Shift/reduce conflict on token A: 6: 3 b: . %empty 6: 6 d: c . A * NEWS, doc/bison.texi, src/conflicts.c: Spell it "shift/reduce", not "shift-reduce". * src/counterexample.c (counterexample_report_shift_reduce) (counterexample_report_reduce_reduce): Reformat and internationalize output. * tests/counterexample.at: Adjust expectations.

view details

Akim Demaille

commit sha 296e2f90ab3315732e25ce38687954646f5a86e1

cex: enforce case for tokens/nonterminals It's unfortunate that the traditions between formal language theory and Yacc differs, but here, tokens should be upper case, and nonterminals should be lower case. * tests/counterexample.at: Comply with this.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha 8ece778cb869846dbc44fa0fd516a174798c0233

c++: fix printing of state number on streams Avoid this kind of display: LAC: checking lookahead identifier: R4 R3 G^B S5 * data/skeletons/lalr1.cc: Convert state_t to int before printing it.

view details

Akim Demaille

commit sha 12f4091de4d0147354bad7a7fdca62d02014d410

tests: show logs * examples/c/bistromathic/bistromathic.test, examples/test: here.

view details

Akim Demaille

commit sha 52ce2a008bb32e686151c3c58739ff4fcd17f83d

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html Besides, none of the C examples were compiled with the warning flags. * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. GCC's warn_unused_result is not silenced by a cast to void, so we have to "use" scanf's result. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 Flex generated code produces too many warnings, including things such as, with ICC: examples/c/lexcalc/scan.c(1088): error #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem) 2259 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 2260 ^ 2261 2262 I am tired of trying to fix Flex's output. The project does not seem maintained. We ought to avoid it. So, for the time being, don't try to enable warnings with Flex. * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

Akim Demaille

commit sha 0535d2a608b02c157bdb54221a35e86a310ae9e7

version 3.6.3 * NEWS: Record release date.

view details

Akim Demaille

commit sha 508ac09939960eac8d30afab6e252469afe18714

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

Akim Demaille

commit sha 7e16bd2cae4f6762449927b2ca3159f44724a3ee

Merge maint into HEAD * upstream/maint: maint: post-release administrivia version 3.6.3 build: check -Wmissing-prototypes tests: show logs c++: fix printing of state number on streams

view details

Akim Demaille

commit sha ae03b1678514ae323a9355ffa62fde96a85ab2a9

warnings: fix -Wmissing-prototypes issues * src/counterexample.c, src/lssi.c, src/parse-simulation.c, * src/state-item.c: Here.

view details

Akim Demaille

commit sha b1327c56f7f940f13886a1b6561a5132fa0a43b3

examples: fix missing includes * examples/c/bistromathic/parse.y: Use abort rather than assert so that the "unused result" warning is silenced even with -DNDEBUG.

view details

Akim Demaille

commit sha 2101b0e210e03e1d07d0a6711ed4c8df0f9430ae

CI: use GCC10 on ppc too We were still using GCC9, because GCC10 was failing. * .travis.yml (PPC64le): Use GCC10. While at it, use -O2 instead of -O3: it's certainly nicer for the CPUs, and allows to test different sets of compiler flags (we use -O3 in several other configurations).

view details

Akim Demaille

commit sha 39be113b1faaddc1cd925478cfdbe8d7d6573a36

all: show the rules in comments before the user actions For instance, in the case of Bison's own parser: - case 40: + case 40: /* grammar_declaration: "%code" "identifier" "{...}" */ { muscle_percent_code_grow ((yyvsp[-1].ID), (yylsp[-1]), translate_code_braceless ((yyvsp[0].BRACED_CODE), (yylsp[0])), (yylsp[0])); code_scanner_last_string_free (); } break; * data/skeletons/c.m4: Modified. * data/skeletons/d.m4: Modified. * data/skeletons/java.m4: Modified. * src/output.c (output_escaped): New. (quoted_output): Use it, and rename as... (output_quoted): this. Adjust dependencies. (rule_output): New. (user_actions_output): Use it. * data/skeletons/c.m4, data/skeletons/d.m4, data/skeletons/java.m4 (b4_case): Add support for $3, an optional comment.

view details

Akim Demaille

commit sha 421662ec88797e249ae1eced9e1e1f05ffaf0abe

style: fix syntax-check issues * src/counterexample.c, src/files.c, src/files.h, src/lssi.c, * src/state-item.c: here.

view details

Akim Demaille

commit sha 1ccb4be02b07c3acf7e94a8b84d3178b91d26f55

cex: reformat the s/r and r/r reports In Bison we refer to "shift/reduce" conflicts, not "shift-reduce" (in Bison 3.6.3 186 occurrences vs 15). Enforce consistency on this. Instead of "spending" a second line for each conflict to report the lookaheads, put that on the same line as the type of conflict. Also, prefer "token" to "symbol". Maybe we should even prefer "lookahead". While at it, enable internationalization, with plurals where appropriate. As a consequence, instead of Shift-Reduce Conflict: 6: 3 b: . %empty 6: 6 d: c . A On Symbol: A display Shift/reduce conflict on token A: 6: 3 b: . %empty 6: 6 d: c . A * NEWS, doc/bison.texi, src/conflicts.c: Spell it "shift/reduce", not "shift-reduce". * src/counterexample.c (counterexample_report_shift_reduce) (counterexample_report_reduce_reduce): Reformat and internationalize output. * tests/counterexample.at: Adjust expectations.

view details

Akim Demaille

commit sha 296e2f90ab3315732e25ce38687954646f5a86e1

cex: enforce case for tokens/nonterminals It's unfortunate that the traditions between formal language theory and Yacc differs, but here, tokens should be upper case, and nonterminals should be lower case. * tests/counterexample.at: Comply with this.

view details

Akim Demaille

commit sha ae5edcc23b785b5ff0652aec79f8ee39f13be687

cex: color the counterexamples Use colors to show the counterexamples and the derivations in color, to highlight their structure. Align the outputs, and add i18n support. Reduce width by using a one-space separator instead of two-space. From Example A • B C First derivation s ::=[ a ::=[ A • ] x ::=[ B C ] ] Second derivation s ::=[ y ::=[ A • B ] c ::=[ C ] ] to Example A • B C First derivation s ::=[ a ::=[ A • ] x ::=[ B C ] ] Example A • B C Second derivation s ::=[ y ::=[ A • B ] c ::=[ C ] ] with colors. * data/bison-default.css (cex-dot, cex-0, cex-1, cex-2, cex-3, cex-4) (cex-5, cex-6, cex-7, cex-step, cex-leaf): New. * src/derivation.c (derivation_print_styled_impl): New. (derivation_print, derivation_print_leaves): Use it. * src/counterexample.c: Reformat the output. * tests/counterexample.at: Adjust.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha 39be113b1faaddc1cd925478cfdbe8d7d6573a36

all: show the rules in comments before the user actions For instance, in the case of Bison's own parser: - case 40: + case 40: /* grammar_declaration: "%code" "identifier" "{...}" */ { muscle_percent_code_grow ((yyvsp[-1].ID), (yylsp[-1]), translate_code_braceless ((yyvsp[0].BRACED_CODE), (yylsp[0])), (yylsp[0])); code_scanner_last_string_free (); } break; * data/skeletons/c.m4: Modified. * data/skeletons/d.m4: Modified. * data/skeletons/java.m4: Modified. * src/output.c (output_escaped): New. (quoted_output): Use it, and rename as... (output_quoted): this. Adjust dependencies. (rule_output): New. (user_actions_output): Use it. * data/skeletons/c.m4, data/skeletons/d.m4, data/skeletons/java.m4 (b4_case): Add support for $3, an optional comment.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha b1327c56f7f940f13886a1b6561a5132fa0a43b3

examples: fix missing includes * examples/c/bistromathic/parse.y: Use abort rather than assert so that the "unused result" warning is silenced even with -DNDEBUG.

view details

Akim Demaille

commit sha 2101b0e210e03e1d07d0a6711ed4c8df0f9430ae

CI: use GCC10 on ppc too We were still using GCC9, because GCC10 was failing. * .travis.yml (PPC64le): Use GCC10. While at it, use -O2 instead of -O3: it's certainly nicer for the CPUs, and allows to test different sets of compiler flags (we use -O3 in several other configurations).

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha 8ece778cb869846dbc44fa0fd516a174798c0233

c++: fix printing of state number on streams Avoid this kind of display: LAC: checking lookahead identifier: R4 R3 G^B S5 * data/skeletons/lalr1.cc: Convert state_t to int before printing it.

view details

Akim Demaille

commit sha 12f4091de4d0147354bad7a7fdca62d02014d410

tests: show logs * examples/c/bistromathic/bistromathic.test, examples/test: here.

view details

Akim Demaille

commit sha 52ce2a008bb32e686151c3c58739ff4fcd17f83d

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html Besides, none of the C examples were compiled with the warning flags. * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. GCC's warn_unused_result is not silenced by a cast to void, so we have to "use" scanf's result. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 Flex generated code produces too many warnings, including things such as, with ICC: examples/c/lexcalc/scan.c(1088): error #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem) 2259 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 2260 ^ 2261 2262 I am tired of trying to fix Flex's output. The project does not seem maintained. We ought to avoid it. So, for the time being, don't try to enable warnings with Flex. * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

Akim Demaille

commit sha 742910838e68a40b0144bed3ee8a2802709d1c42

lists: fix various issues with the use of gnulib's list First, we should avoid code such as gl_list_iterator_t it = gl_list_iterator (deriv->children); derivation *child = NULL; while (gl_list_iterator_next (&it, (const void **) &child, NULL)) { derivation_print (child, f); because of -Wstrict-aliasing (whose job is to catch type-punning issues). See https://lists.gnu.org/r/bug-bison/2020-05/msg00039.html. Rather we need gl_list_iterator_t it = gl_list_iterator (deriv->children); const void **p = NULL; while (gl_list_iterator_next (&it, &p, NULL)) { derivation *child = (derivation *) p; derivation_print (child, f); Second, list iterators actually have destructors. Even though they are noop in the case of linked-lists, we should use them. Let's address both issues with typed wrappers (such as derivation_list_next) that take care of both issues, and besides allow to scope the iterators within the loop: derivation *child; for (gl_list_iterator_t it = gl_list_iterator (deriv->children); derivation_list_next (&it, &child); ) { derivation_print (child, f); * src/derivation.h, src/derivation.c (derivation_list_next): New. Use it where appropriate. * src/counterexample.c (search_state_list_next): New. Use it where appropriate. * src/parse-simulation.h, src/parse-simulation.c * src/state-item.h (state_item_list_next): New. Use it where appropriate.

view details

Akim Demaille

commit sha 03a6b439f6873305aa563c03cfbcc08c0aadebb1

style: fix includes * src/fixits.c: Follow our usual pattern. * src/scan-code.l, src/scan-gram.l, src/scan-skel.l: Prefer "" to include src/ headers. * README-hacking.md: Document the pattern.

view details

Akim Demaille

commit sha de5be4a693dfab791bb389e77944ed49b49ef0ce

doc: using asan * README-hacking.md: here.

view details

Akim Demaille

commit sha 94f7606db6f8e3d6c1cc71be6be304e16ba06a66

build: check -Wstrict-aliasing * configure.ac (warn_common): Add -Wstrict-aliasing.

view details

Akim Demaille

commit sha 0535d2a608b02c157bdb54221a35e86a310ae9e7

version 3.6.3 * NEWS: Record release date.

view details

Akim Demaille

commit sha 508ac09939960eac8d30afab6e252469afe18714

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

Akim Demaille

commit sha 7e16bd2cae4f6762449927b2ca3159f44724a3ee

Merge maint into HEAD * upstream/maint: maint: post-release administrivia version 3.6.3 build: check -Wmissing-prototypes tests: show logs c++: fix printing of state number on streams

view details

Akim Demaille

commit sha ae03b1678514ae323a9355ffa62fde96a85ab2a9

warnings: fix -Wmissing-prototypes issues * src/counterexample.c, src/lssi.c, src/parse-simulation.c, * src/state-item.c: Here.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha 52ce2a008bb32e686151c3c58739ff4fcd17f83d

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html Besides, none of the C examples were compiled with the warning flags. * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. GCC's warn_unused_result is not silenced by a cast to void, so we have to "use" scanf's result. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 Flex generated code produces too many warnings, including things such as, with ICC: examples/c/lexcalc/scan.c(1088): error #1682: implicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem) 2259 YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), 2260 ^ 2261 2262 I am tired of trying to fix Flex's output. The project does not seem maintained. We ought to avoid it. So, for the time being, don't try to enable warnings with Flex. * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

Akim Demaille

commit sha 0535d2a608b02c157bdb54221a35e86a310ae9e7

version 3.6.3 * NEWS: Record release date.

view details

Akim Demaille

commit sha 508ac09939960eac8d30afab6e252469afe18714

maint: post-release administrivia * NEWS: Add header line for next release. * .prev-version: Record previous version. * cfg.mk (old_NEWS_hash): Auto-update.

view details

push time in a month

created tagakimd/bison

tagv3.6.3

GNU Bison

created time in a month

push eventakimd/fast_gettext

Akim Demaille

commit sha c2d288bf8c5a3ab7b161a61b919e99d9db93337f

CI: try Ruby 2.3

view details

push time in a month

pull request commentgrosser/fast_gettext

Restore compatibility with older Rubies

I might be wrong, but I have the feeling that the 2.5 requirement is not really needed. If you can relax the requirement, our lives would be much easier (we have several deployments in production that use JRuby, and they are not easily upgraded).

I fully understand that projects must go forward, and at some point backward compatibility is a pain in the neck that hinders evolutions. But if 2.5 was only required for match?, then maybe you could easily restore compatibility for earlier versions?

Thanks a lot!

akimd

comment created time in a month

pull request commentgrosser/fast_gettext

Restore compatibility with older Rubies

Hi! Thanks for the fast reaction!

I believe our minimum requirement is Ruby 2.3. What does motivate the 2.5 requirement?

akimd

comment created time in a month

push eventakimd/fast_gettext

Akim Demaille

commit sha 8e63dd6c6519989035c5ee33eb5829b064324477

restore compatibility with older Rubies Don't use `Regex#match?`, `=~` is actually more portable. Actually regex are overkill here.

view details

push time in a month

PR opened grosser/fast_gettext

Restore compatibility with older Rubies

Hi!

Commit 08599fcec9d506ecce2f35db4a3a60af46f9420c, for some reason, went from using =~ to using match?, which is not supported by older Rubies. That broke several of our applications.

I venture we can both be happy by avoiding Regexes completely.

Cheers!

+1 -1

0 comment

1 changed file

pr created time in a month

push eventakimd/fast_gettext

Michael Grosser

commit sha 9a701e38ff44b62d2a52b31ef7a46ee86bbfc048

Merge pull request #124 from akimd/master readme: fix a few typos

view details

Daniel Veleba

commit sha 51001adb8900c264353c1a7a3a350b51aa6b2382

fix typo for #pluralisation_rule in Db repo

view details

Daniel Veleba

commit sha 8a0fbc37e454aaeb57f0138a875b9d9bb55e9ce2

add test for db pluralisation

view details

Michael Grosser

commit sha 412490fa9aa98dd961865abaab6ff338df5534b9

Merge pull request #126 from danielveleba/master Fix typo in #pluralisation_rule for db repo

view details

Michael Grosser

commit sha af55160c0f025fecfade95b59e0492614c9beb71

v2.0.3

view details

Michael Grosser

commit sha 1173edaccffd89ed53c05470a168c602f0158555

bump bundler

view details

Michael Grosser

commit sha 9d215035f06f9431e1f6f05620fac26391ea8a8d

bump ruby

view details

Michael Grosser

commit sha 7be95b2b337bf0c3864c6635cdfee031e63d1254

i18n no longer patches interpolate, so get rid of all the tests

view details

Michael Grosser

commit sha ad8b5f2e96386c11db257c7d82ef5a8b6bf903f9

2.4 is eol

view details

Michael Grosser

commit sha 0390e1e71f8d032d75a662adb19359e8e3e7966b

bring back other gems

view details

Michael Grosser

commit sha 0fdacb01fb49f28361e445672516398fa9d59905

Merge pull request #127 from grosser/grosser/bump bump ruby

view details

Akim Demaille

commit sha 86b15a4c31a333783330223c6b806e7401bb5ad2

restore compatibility with older Rubies Don't use `Regex#match?`, `=~` is actually more portable. Actually regex are overkill here.

view details

push time in a month

issue openedFaveod/arel-extensions

[] on a range

The current behavior is misleading, and does not match what Ruby does.

> User[:first_name][3,7].to_sql
SUBSTRING(`users`.`first_name`, 4, 4)
> User[:first_name][3..7].to_sql
SUBSTRING(`users`.`first_name`, 4, 5)

created time in a month

push eventakimd/bison

Akim Demaille

commit sha 742910838e68a40b0144bed3ee8a2802709d1c42

lists: fix various issues with the use of gnulib's list First, we should avoid code such as gl_list_iterator_t it = gl_list_iterator (deriv->children); derivation *child = NULL; while (gl_list_iterator_next (&it, (const void **) &child, NULL)) { derivation_print (child, f); because of -Wstrict-aliasing (whose job is to catch type-punning issues). See https://lists.gnu.org/r/bug-bison/2020-05/msg00039.html. Rather we need gl_list_iterator_t it = gl_list_iterator (deriv->children); const void **p = NULL; while (gl_list_iterator_next (&it, &p, NULL)) { derivation *child = (derivation *) p; derivation_print (child, f); Second, list iterators actually have destructors. Even though they are noop in the case of linked-lists, we should use them. Let's address both issues with typed wrappers (such as derivation_list_next) that take care of both issues, and besides allow to scope the iterators within the loop: derivation *child; for (gl_list_iterator_t it = gl_list_iterator (deriv->children); derivation_list_next (&it, &child); ) { derivation_print (child, f); * src/derivation.h, src/derivation.c (derivation_list_next): New. Use it where appropriate. * src/counterexample.c (search_state_list_next): New. Use it where appropriate. * src/parse-simulation.h, src/parse-simulation.c * src/state-item.h (state_item_list_next): New. Use it where appropriate.

view details

Akim Demaille

commit sha 03a6b439f6873305aa563c03cfbcc08c0aadebb1

style: fix includes * src/fixits.c: Follow our usual pattern. * src/scan-code.l, src/scan-gram.l, src/scan-skel.l: Prefer "" to include src/ headers. * README-hacking.md: Document the pattern.

view details

Akim Demaille

commit sha de5be4a693dfab791bb389e77944ed49b49ef0ce

doc: using asan * README-hacking.md: here.

view details

Akim Demaille

commit sha 94f7606db6f8e3d6c1cc71be6be304e16ba06a66

build: check -Wstrict-aliasing * configure.ac (warn_common): Add -Wstrict-aliasing.

view details

Akim Demaille

commit sha 81ed4ec361bb5108a5111cb651173ea45e0d5b0d

style: comment changes * data/bison-default.css: here.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha 705069d92a508ad391ec9ccca5d9297a2782d1e1

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html Besides, none of the C examples were compiled with the warning flags. * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. GCC's warn_unused_result is not silenced by a cast to void, so we have to "use" scanf's result. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha bb311cfbed533efda6761d76f111933ff4986db8

gnulib: update

view details

Akim Demaille

commit sha de48e3c7b47672bcec9d06216924fdb614b0282a

lists: fix various issues with the use of gnulib's list First, we should avoid code such as gl_list_iterator_t it = gl_list_iterator (deriv->children); derivation *child = NULL; while (gl_list_iterator_next (&it, (const void **) &child, NULL)) { derivation_print (child, f); because of -Wstrict-aliasing (whose job is to catch type-punning issues). See https://lists.gnu.org/r/bug-bison/2020-05/msg00039.html. Rather we need gl_list_iterator_t it = gl_list_iterator (deriv->children); const void **p = NULL; while (gl_list_iterator_next (&it, &p, NULL)) { derivation *child = (derivation *) p; derivation_print (child, f); Second, list iterators actually have destructors. Even though there are noop in the case of linked-list, we should use them. Let's address both issues we typed wrappers such as derivation_list_next that take care of both issues, and besides allow to better scope the iterators: derivation *child; for (gl_list_iterator_t it = gl_list_iterator (deriv->children); derivation_list_next (&it, &child); ) { derivation_print (child, f); * src/derivation.h, src/derivation.c (derivation_list_next): New. Use it where appropriate. * src/counterexample.c (search_state_list_next): New. Use it where appropriate. * src/parse-simulation.h, src/parse-simulation.c * src/state-item.h (state_item_list_next): New. Use it where appropriate.

view details

Akim Demaille

commit sha a4d8e480fc8840f7762c21b4b6427af733077118

style: fix includes * src/fixits.c: Follow our usual pattern. * src/scan-code.l, src/scan-gram.l, src/scan-skel.l: Prefer "" to include src/ headers. * README-hacking.md: Document the pattern.

view details

Akim Demaille

commit sha 2da185fff15886913745e8c83b2b5b1993a0605a

doc: using asan * README-hacking.md: here.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha ee23399a16ebb7960782cd097b23bab8fcb7dde7

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html Besides, none of the C examples were compiled with the warning flags. * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. GCC's warn_unused_result is not silenced by a cast to void, so we have to "use" scanf's result. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha 67221dd0a4ae3e7f8348a04e0459dc89938dcf56

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html Besides, none of the C examples were compiled with the warning flags. * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. GCC's warn_unused_result is not silenced by a cast to void, so we have to "use" scanf's result. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425 * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha ab450815e2a21eac5403f0332e0d61d6a41554cd

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha 857a99df3b2d09e2cb763e13f2caa85da691ed98

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha d866e9506262afb89c6d1d1cd43eef29122b20a8

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha 3461ca54a2f4932885fa66ca2db073c60143a1e2

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha 2455b07bcd3fe7cae3231b10af12f58cd65f114c

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

push time in a month

push eventakimd/bison

Akim Demaille

commit sha ed88fa09f7bcba368e62e11a97314e0ab73a7065

build: check -Wmissing-prototypes pstate_clear is lacking a prototype. Reported by Ryan https://lists.gnu.org/r/bug-bison/2020-05/msg00101.html * configure.ac (warn_c): Add -Wmissing-prototypes. * data/skeletons/yacc.c (pstate_clear): Make it static. * examples/local.mk (TEST_CFLAGS): New. * examples/c/bistromathic/local.mk, examples/c/calc/local.mk, * examples/c/lexcalc/local.mk, examples/c/mfcalc/local.mk, * examples/c/pushcalc/local.mk, examples/c/reccalc/local.mk, * examples/c/rpcalc/local.mk: Use it. * examples/c/bistromathic/parse.y, examples/c/reccalc/scan.l: Fix warnings. * doc/bison.texi: Discard scanf's return value to defeat -Werror=unused-result.

view details

push time in a month

more