summaryrefslogtreecommitdiff
path: root/doc
Commit message (Collapse)AuthorAgeFilesLines
...
* tests: remove useless support of '.' in integersAkim Demaille2019-06-041-3/+3
| | | | | * tests/calc.at: here. * doc/bison.texi: Avoid uninitialized variables.
* doc: clarify the purpose of symbol_type constructorsAkim Demaille2019-05-251-7/+13
| | | | | | | Reported by Frank Heckenbach. http://lists.gnu.org/archive/html/bug-bison/2019-02/msg00006.html * doc/bison.texi (Complete Symbols): Here.
* doc: avoid Texinfo portability issuesAkim Demaille2019-05-201-2/+1
| | | | | | | | | | Reported by Bruno Haible. http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00024.html Fixed by Karl Berry. http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00034.html * doc/bison.texi: Don't specify the langage, rely on the default. Avoid blank pages.
* fix: copyable instead of copiableAkim Demaille2019-05-191-3/+3
| | | | | | | Reported by Frank Heckenbach. http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00020.html * data/skeletons/lalr1.cc, doc/bison.texi: here.
* fix: use copiable, not copyableAkim Demaille2019-05-191-6/+9
| | | | | | | Reported by Hans Åberg. http://lists.gnu.org/archive/html/bug-bison/2019-05/msg00017.html * data/skeletons/lalr1.cc, doc/bison.texi: here.
* diagnostics: %pure-parser is obsoleteAkim Demaille2019-05-191-2/+2
| | | | | | | | | | | Reported by Uxio Prego. http://lists.gnu.org/archive/html/bug-bison/2018-12/msg00029.html * src/scan-gram.l, src/parse-gram.y (PERCENT_PURE_PARSER) (handle_pure_parser): New. Issue a deprecation/update notice for %pure-parser. * doc/bison.texi (Java Bison Interface): Don't mention %pure-parser. * tests/actions.at, tests/input.at: Adjust.
* doc: use colors for diagnostics in TeX tooAkim Demaille2019-05-091-3/+36
| | | | | | | | | Thanks to Gavin Smith and Patrice Dumas. http://lists.gnu.org/archive/html/help-texinfo/2019-04/msg00015.html * doc/bison.texi (@colorWarning, @colorError, @colorNotice) (@colorOff): Define for TeX and HTML. (@dwarning, @derror, @dnotice): Use them.
* doc: use svg instead of pngAkim Demaille2019-04-292-9/+9
| | | | * doc/bison.texi, doc/local.mk: here.
* doc: use colorsAkim Demaille2019-04-292-64/+81
| | | | | | * doc/bison.texi (dwarning, derror, dnotice): New. Use them in the diagnostics. * doc/local.mk (AM_MAKEINFOFLAGS): Pass customization variables.
* doc: clarify -fsyntax-errorAkim Demaille2019-04-271-1/+5
| | | | * NEWS, doc/bison.texi: here.
* api.location.type: support it in CAkim Demaille2019-04-251-3/+2
| | | | | | | | | | | | Reported by Balázs Scheidler. * data/skeletons/c.m4 (b4_location_type_define): Use api.location.type if defined. * doc/bison.texi: Document it. * tests/local.at (AT_C_IF, AT_LANG_CASE): New. Support Span in C. * tests/calc.at (Span): Convert it to be usable in C and C++. Check api.location.type with yacc.c and glr.c.
* diagnostics: document the change of formatAkim Demaille2019-04-231-39/+39
| | | | | | * doc/bison.texiL Adjust output. Also, Graphviz has no uppercsae V. * NEWS: Explain the format change.
* doc: sort the warning categoriesAkim Demaille2019-04-191-20/+20
| | | | * doc/bison.texi, src/getargs.c: here.
* doc: minor fixesAkim Demaille2019-04-071-27/+26
| | | | | | * doc/bison.texi: Use consistently $ and @kbd in shell examples. Prefer sticking to English words: output and file instead of outfile and infile.
* graph: prefer *.gv to *.dotAkim Demaille2019-02-211-15/+21
| | | | | | | | | | | Reported by Hans Åberg. https://lists.gnu.org/archive/html/help-bison/2019-02/msg00064.html * src/files.c (spec_graph_file): Use `*.gv` when 3.4 or better, otherwise `*.dot`. * src/parse-gram.y (handle_require): Pretend we are already 3.4. * doc/bison.texi: Adjust. * tests/local.at, tests/output.at: Exercise this.
* doc: fixes to please older versions of TexinfoAkim Demaille2019-02-211-3/+14
| | | | | | | | | Currently, we have errors: ./doc/bison.texi:13005: node `History' lacks menu item for `Yacc' despite being its Up target * doc/bison.texi (History): Add the local menu. While at it, add a few index entries.
* doc: style changesAkim Demaille2019-02-171-39/+66
| | | | | | | * doc/bison.texi (Bibliography): Add [Corbett 1984] and [Johnson 1978]. (History): Use them. And other minor changes.
* doc: a history sectionEric S. Raymond2019-02-171-0/+133
| | | | * bison.texi (A Brief History of the Greater Ungulates): New section.
* build: fix distcheckAkim Demaille2019-02-161-1/+3
| | | | | | | Regression introduced in 05a80977798abf472bfc11c477751303ad604733. * doc/local.mk (bison.help): Don't depend on the path of the bison executable.
* doc: run tests/bison, not src/bisonAkim Demaille2019-02-141-3/+3
| | | | | | * doc/local.mk: Don't run src/bison, as it expects to find all its files installed. Instead, run tests/bison which is ready to run in builddir.
* doc: a single space before closing commentsAkim Demaille2019-02-101-68/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I don't think this style: /* If buffer is full, make it bigger. */ if (i == length) { length *= 2; symbuf = (char *) realloc (symbuf, length + 1); } /* Add this character to the buffer. */ symbuf[i++] = c; /* Get another character. */ c = getchar (); or more readable than /* If buffer is full, make it bigger. */ if (i == length) { length *= 2; symbuf = (char *) realloc (symbuf, length + 1); } /* Add this character to the buffer. */ symbuf[i++] = c; /* Get another character. */ c = getchar (); Actually, I think the latter is more readable, and helps with width issues in the PDF. As a matter of fact, I would happily move to // only for single line comments. * doc/bison.texi: A single space before closing comments.
* doc: modernize the examplesAkim Demaille2019-02-101-90/+91
| | | | | | | | | | | | | | | | | | | * doc/bison.texi: Prefer 'fun' to 'fnct'. Reduce local variable scopes. Prefer strdup to malloc + strcpy. Avoid gratuitous casts. Use simpler names (e.g., 'name' instead of 'fname'). Avoid uses of 0 for NULL. Avoid using NULL when possible (e.g., 'p' instead of 'p != NULL'). Prefer union names to casts (e.g. 'yylval.VAR = s' instead of '*((symrec**) &yylval) = s'). Give arguments a name in fun declarations. Use our typedefs instead of duplicating them (func_t). Stop promoting an explicit $$ = $1;, it should be implicit (Bison might be able to eliminate useless chain rules). Help a bit Texinfo by making smaller groups. Rely on the C compiler to call function pointers (prefer '$1->value.fun ($3)' to (*($1->value.fnctptr))($3)').
* add -fsyntax-onlyAkim Demaille2019-01-281-0/+2
| | | | | | | | | | When debugging Bison itself, this is very handy, especially when tweaking the frontend badly enough to break the backends. It can also be used to check a grammar. * src/getargs.h, src/getargs.c (feature_syntax_only): New. (feature_args, feature_types): Adjust. * src/main.c (main): Use it.
* yacc: issue warnings, not errors, for Bison extensionsAkim Demaille2019-01-271-14/+14
| | | | | | | | | Reported by Kiyoshi Kanazawa. http://lists.gnu.org/archive/html/bug-bison/2019-01/msg00029.html * src/getargs.c (getargs): Let --yacc imply -Wyacc, not -Werror=yacc. * tests/input.at: Adjust. * doc/bison.tex (Bison Options): Document.
* --update: when used, do not generate the output filesAkim Demaille2019-01-221-2/+2
| | | | | | | | | | | It is inconvenient that we also generate the output files when we update the grammar file, and it's somewhat unexpected. Let's not do that. * src/main.c (main): Skip generation when --update is passed. * src/getargs.c (usage): Update the help message. * doc/bison.texi (Bison Options): Likewise. * tests/input.at: Check that we don't generate the output.
* doc: document -ffixit and --updateAkim Demaille2019-01-181-0/+92
| | | | * doc/bison.texi (Bison Options): here.
* doc: style fixesAkim Demaille2019-01-181-21/+21
| | | | | | * doc/bison.texi: Use @kbd where appropriate. Update ^~~~ marks for caret-errors. * build-aux/cross-options.pl: Do not add quotes to %define's argument.
* c, c++: avoid implicit fall-throwAkim Demaille2019-01-151-0/+22
| | | | | | | | | | | Reported by Derek Clegg. http://lists.gnu.org/archive/html/bug-bison/2019-01/msg00004.html * configure.ac (warn_common): Add -Wimplicit-fallthrough. This does trigger failures in the test suite. * data/skeletons/glr.c, data/skeletons/lalr1.cc, * data/skeletons/yacc.c, tests/c++.at: Make fall-throws explicit.
* doc: use @option consistentlyAkim Demaille2019-01-051-15/+15
| | | | * doc/bison.texi: Use @option, not @code, for options.
* package: bump copyrights to 2019Akim Demaille2019-01-053-6/+6
|
* java/d: rename some %define variables for consistencyAkim Demaille2019-01-051-38/+29
| | | | | | | | | | | | | | | | | | | See 890ee8a1fd288b3cc1c21c49ea0ece696ef40565 and https://lists.gnu.org/archive/html/bison-patches/2019-01/msg00024.html. * data/skeletons/d.m4, data/skeletons/java.m4 (abstract, annotations, extends, final, implements, public, strictfp): Rename as... (api.parser.abstract, api.parser.annotations, api.parser.extends) (api.parser.final, api.parser.implements, api.parser.public) (api.parser.strictfp): these. * src/muscle-tab.c (muscle_percent_variable_update): Ensure backward compatibility. * doc/bison.texi, examples/d/calc.y, examples/java/Calc.y, tests/input.at: Adjust.
* clearly deprecate %name-prefixAkim Demaille2019-01-031-32/+24
| | | | | | | | | | | * src/scan-gram.l (%name-prefix): Issue a deprecation warning. * tests/calc.at, tests/headers.at, tests/input.at, tests/java.at, * tests/javapush.at, tests/local.at: Adjust expectations. Or disable -Wdeprecated. * doc/bison.texi: Document that %name-prefix is replaced by %define api.prefix.
* doc: formatting changesAkim Demaille2019-01-031-95/+97
| | | | * doc/bison.texi: here.
* rename parser_class_name as api.parser.classAkim Demaille2019-01-021-22/+55
| | | | | | | | | | | | | | | The previous name was historical and inconsistent. * src/muscle-tab.c (define_directive): Use the proper value passing syntax, based on the muscle kind. (muscle_percent_variable_update): Use the right value passing syntax. Migrate from parser_class_name to api.parser.class. * data/skeletons: Migrate from parser_class_name to api.parser.class. * doc/bison.texi (%define Summary): Document both parser_class_name and api.parser.class. Promote the latter over the former.
* style: formatting changes in the docAkim Demaille2019-01-021-8/+6
| | | | * doc/bison.texi: here.
* package: make bison a relocatable packageAkim Demaille2018-12-253-2/+8
| | | | | | | | | | | | | | | | | | Suggested by David Barto https://lists.gnu.org/archive/html/help-bison/2015-02/msg00004.html and Victor Zverovich. https://lists.gnu.org/archive/html/bison-patches/2018-10/msg00121.html This is very easy to do, thanks to work by Bruno Haible in gnulib. See "Supporting Relocation" in gnulib's documentation. * bootstrap.conf: We need relocatable-prog and relocatable-script (for yacc). * src/yacc.in: New. * configure.ac, src/local.mk: Instantiate it. * src/main.c, src/output.c (main, pkgdatadir): Use relocatable2. * doc/bison.texi (FAQ): Document it.
* c++: exhibit a safe symbol_typeAkim Demaille2018-12-221-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of introducing make_symbol (whose name, btw, somewhat infringes on the user's "name space", if she defines a token named "symbol"), let's make the construction of symbol_type safer, using assertions. For instance with: %token ':' <std::string> ID <int> INT; generate: symbol_type (int token, const std::string&); symbol_type (int token, const int&); symbol_type (int token); It does mean that now named token constructors (make_ID, make_INT, etc.) go through a useless assert, but I think we can ignore this: I assume any decent compiler will inline the symbol_type ctor inside the make_TOKEN functions, which will show that the assert is trivially verified, hence I expect no code will be emitted for it. And anyway, that's an assert, NDEBUG controls it. * data/c++.m4 (symbol_type): Turn into a subclass of basic_symbol<by_type>. Declare symbol constructors when variants are enabled. * data/variant.hh (_b4_type_constructor_declare) (_b4_type_constructor_define): Replace with... (_b4_symbol_constructor_declare, _b4_symbol_constructor_def): these. Generate symbol_type constructors. * doc/bison.texi (Complete Symbols): Document. * tests/types.at: Check.
* symbols: document the overhaul of symbol declarationsAkim Demaille2018-12-171-7/+51
| | | | * doc/bison.texi (Symbol Decls): New.
* style: s/non-terminal/nonterminal/Akim Demaille2018-12-112-8/+8
| | | | | | | | I personally prefer 'non terminal', or 'non-terminal', but 'nonterminal' is the common spelling. * data/glr.c, src/parse-gram.y, src/symtab.c, src/symtab.h, * tests/input.at, doc/refcard.tex: here.
* C++: support variadic emplaceAkim Demaille2018-12-101-10/+7
| | | | | | | | | Suggested by Askar Safin. http://lists.gnu.org/archive/html/bug-bison/2018-12/msg00006.html * data/variant.hh: Implement. * tests/types.at: Check. * doc/bison.texi: Document.
* doc: formatting changesAkim Demaille2018-11-281-60/+54
| | | | * doc/bison.texi: here.
* doc: formatting changesAkim Demaille2018-11-261-65/+57
| | | | * doc/bison.texi: Here.
* allow %expect and %expect-rr modifiers on individual rulesPaul Hilfinger2018-11-211-2/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows one to document (and check) which rules participate in shift/reduce and reduce/reduce conflicts. This is particularly important GLR parsers, where conflicts are a normal occurrence. For example, %glr-parser %expect 1 %% ... argument_list: arguments %expect 1 | arguments ',' | %empty ; arguments: expression | argument_list ',' expression ; ... Looking at the output from -v, one can see that the shift-reduce conflict here is due to the fact that the parser does not know whether to reduce arguments to argument_list until it sees the token AFTER the following ','. By marking the rule with %expect 1 (because there is a conflict in one state), we document the source of the 1 overall shift- reduce conflict. In GLR parsers, we can use %expect-rr in a rule for reduce/reduce conflicts. In this case, we mark each of the conflicting rules. For example, %glr-parser %expect-rr 1 %% stmt: target_list '=' expr ';' | expr_list ';' ; target_list: target | target ',' target_list ; target: ID %expect-rr 1 ; expr_list: expr | expr ',' expr_list ; expr: ID %expect-rr 1 | ... ; In a statement such as x, y = 3, 4; the parser must reduce x to a target or an expr, but does not know which until it sees the '='. So we notate the two possible reductions to indicate that each conflicts in one rule. See https://lists.gnu.org/archive/html/bison-patches/2013-02/msg00105.html. * doc/bison.texi (Suppressing Conflict Warnings): Document %expect, %expect-rr in grammar rules. * src/conflicts.c (count_state_rr_conflicts): Adjust comment. (rule_has_state_sr_conflicts): New static function. (count_rule_sr_conflicts): New static function. (rule_nast_state_rr_conflicts): New static function. (count_rule_rr_conflicts): New static function. (rule_conflicts_print): New static function. (conflicts_print): Also use rule_conflicts_print to report on individual rules. * src/gram.h (struct rule): Add new fields expected_sr_conflicts, expected_rr_conflicts. * src/reader.c (grammar_midrule_action): Transfer expected_sr_conflicts, expected_rr_conflicts to new rule, and turn off in current_rule. (grammar_current_rule_expect_sr): New function. (grammar_current_rule_expect_rr): New function. (packgram): Transfer expected_sr_conflicts, expected_rr_conflicts to new rule. * src/reader.h (grammar_current_rule_expect_sr): New function. (grammar_current_rule_expect_rr): New function. * src/symlist.c (symbol_list_sym_new): Initialize expected_sr_conflicts, expected_rr_conflicts. * src/symlist.h (struct symbol_list): Add new fields expected_sr_conflicts, expected_rr_conflicts. * tests/conflicts.at: Add tests "%expect in grammar rule not enough", "%expect in grammar rule right.", "%expect in grammar rule too much."
* doc: calc++: remove ancient fix for flexJannick2018-11-211-6/+0
| | | | * doc/bison.texi (Calc++ Scanner): Remove fix for Flex 2.5.31-2.5.33.
* doc: calc++: ignore \r in the scanerJannick2018-11-211-1/+1
| | | | * doc/bison.texi (Calc++ Scanner): Ignore \r.
* build: minor fixes in doc/Akim Demaille2018-11-061-10/+10
| | | | | * doc/local.mk: Consistently use *.tmp for temporary files. Fix comments.
* doc: -Wzero-as-null-pointer-constant was added to GCC 4.7Akim Demaille2018-11-031-1/+1
| | | | | | | | It is not supported by previous versions. See https://www.gnu.org/software/gcc/gcc-4.7/changes.html Reported by Nelson H. F. Beebe. * doc/bison.texi (Calc++ Scanner): here.
* examples: #include <cstring> in calc++Adam Sampson2018-11-021-0/+1
| | | | | strerror is defined by <string.h>, and recent versions of GNU libstdc++ no longer include this automatically from <string>.
* build: don't depend on the libc to generate bison.helpAkim Demaille2018-10-291-5/+8
| | | | | | | | | | | | | | | | | The "Report translation bugs to..." part of --help is issued only on glibc systems. So if the tarball is not wrapped on such a system, and used on such a system (or the converse), then bison.help will differ on the user's system, and help2man will be called to update bison.1. But help2man should not be a requirement. Reported by Alexandre Duret-Lutz. * doc/local.mk (doc/bison.help): Remove the possible doc about translation bugs. Pass LC_ALL=C, as reported in src/getargs.c's usage(). (doc/cross-options.texi): Use bison.help instead of calling bison --help.
* doc: fix distcheckAkim Demaille2018-10-271-1/+1
| | | | | | | The extracted example, simple.yy, does not use %require "3.2", so it generates a stack.hh, which breaks distcheck. * doc/bison.texi: Fix it.