summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* maint: update copyright yearsAkim Demaille2013-01-12195-204/+206
| | | | | Suggested by Stefano Lattarini. Run "make update-copyright".
* build: fix VPATH issueAkim Demaille2013-01-121-4/+3
| | | | | * Makefile.am (update-b4-copyright, update-package-copyright-year): Fix path to build-aux.
* carets: document default activationTheophile Ranquet2013-01-112-1/+21
| | | | | * NEWS: Announce it. * doc/bison.texi: Adjust.
* carets: show them in more testsTheophile Ranquet2013-01-112-18/+131
| | | | * tests/input.at, tests/named-refs.at: Here.
* carets: activate by defaultTheophile Ranquet2013-01-113-11/+11
| | | | | | | * src/getargs.c (feature_flag): Here. * tests/local.at (AT_BISON_CHECK_, AT_BISON_CHECK_NO_XML): Deactivate carets for the testsuite, by default. * tests/input.at: Adjust the locations for command line definitions.
* variants: document move and swapTheophile Ranquet2013-01-112-4/+10
| | | | | | | * data/variant.hh (swap): Doc. (build): Rename as... (move): This, more coherent naming with clearer meaning. * data/c++.m4 (move): Adjust.
* c++: privatize variant blind copiesTheophile Ranquet2013-01-114-1/+14
| | | | | | | * data/variant.hh (variant, operator=): Make private. * data/c++.m4 (operator=): New, to avoid needing a definition of that operator for each class member (such as a possible variant). * data/glr.cc, data/lalr.cc: Add the necessary include for the abort.
* glr.c: fix an unused argument issueAkim Demaille2013-01-111-1/+2
| | | | | * data/glr.c (yyuserAction): "Use" yyrhslen, as in variant mode, we might not use it.
* glr.c: style changesAkim Demaille2013-01-111-1/+1
| | | | * data/glr.c (yyuserAction): Use a size_t for sizes.
* c.m4: style fixAkim Demaille2013-01-111-1/+1
| | | | * data/c.m4 (b4_parse_param_use): Add missing space before paren.
* skel: better aliasing of identifiersTheophile Ranquet2013-01-115-6/+98
| | | | | * data/glr.c, data/yacc.c: Avoid emitting useless defines. * data/glr.cc: Restore prefixes for epilogue.
* glr.cc: fatal if using api.token.ctor without variantsTheophile Ranquet2013-01-111-0/+6
| | | | * data/glr.cc: Here.
* skel: correctly indent switch casesTheophile Ranquet2013-01-111-1/+1
| | | | * data/bison.m4 (b4_type_action_): Here.
* variants: assert changesTheophile Ranquet2013-01-111-7/+13
| | | | | | * data/variant.hh (swap): More asserts can't hurt. Don't perform useless swaps. (build): Deactivate problematic asserts, pending further investigation. (variant): Prohibit copy construction.
* lalr1.cc: use a vector for the symbol stackTheophile Ranquet2013-01-112-7/+7
| | | | | | * data/lalr1.cc: Adjust includes. * data/stack.hh (push, pop): Use push_back and pop_back. (operator []): Access vector from the end.
* lalr1.cc: change symbols implementationTheophile Ranquet2013-01-112-149/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A "symbol" groups together the symbol type (INT, PLUS, etc.), its possible semantic value, and its optional location. The type is needed to access the value, as it is stored as a variant/union. There are two kinds of symbols. "symbol_type" are "external symbols": they have type, value and location, and are returned by yylex. "stack_symbol_type" are "internal symbols", they group state number, value and location, and are stored in the parser stack. The type of the symbol is computed from the state number. The class template symbol_base_type<Exact> factors the code common to stack_symbol_type and symbol_type. It uses the Curiously Recurring Template pattern so that we can always (static_) downcast to the exact type. symbol_base_type features value and location, and delegates the handling of the type to its parameter. When trying to generalize the support for variant, a significant issue was revealed: because stack_symbol_type and symbol_type _derive_ from symbol_base_type, the type/state member is defined _after_ the value and location. In C++ the order of the definition of the members defines the order in which they are initialized, things go backward: the value is initialized _before_ the type. This is wrong, since the type is needed to access the value. Therefore, we need another means to factor the common code, one that ensures the order of the members. The idea is simple: define two (base) classes that code the symbol type ("by_type" codes it by its type, and "by_state" by the state number). Define basic_symbol<Base> as the class template that provides value and location support. Make it _derive_ from its parameter, by_type or by_state. Then define stack_symbol_type and symbol_type as basic_symbol<by_state>, basic_symbol<by_type>. The name basic_symbol was chosen by similarity with basic_string and basic_ostream. * data/c++.m4 (symbol_base_type<Exact>): Remove, replace by... (basic_symbol<Base>): which derives from its parameter, one of... (by_state, by_type): which provide means to retrieve the actual type of symbol. (symbol_type): Is now basic_symbol<by_type>. (stack_symbol_type): Is now basic_symbol<by_state>. * data/lalr1.cc: Many adjustments.
* bench: add %b directive to use a specific BisonTheophile Ranquet2013-01-111-1/+9
| | | | | | | | For example, $ bench.pl -v '%s lalr1.cc & %d variant & ( %b ~/old-bison/bin/bison | %b ~/new-bison/bin/bison )' -g list -i 10000 * etc/bench.pl.in: Here.
* regenAkim Demaille2013-01-092-2/+1
|
* gnulib: updateAkim Demaille2013-01-041-0/+0
|
* doc: use deffn to declare the list of %define variablesAkim Demaille2012-12-311-50/+43
| | | | | | | * doc/bison.texi (%define Summary): Use @deffn instead of @table, it spares a lot of width, especially in PDF, and looks nicer in the other formats too. It is also more consistent with the rest of the document.
* doc: minor completion and fixesAkim Demaille2012-12-311-2/+14
| | | | | * doc/bison.texi (%define Summary): Provide more history to some variables.
* java: stype is obsoleted by api.value.typeAkim Demaille2012-12-315-22/+26
| | | | | | | | | | This is consistent with the other %define variable names. * data/java.m4: Use api.value.type instead of stype. * doc/bison.texi, NEWS: Document that change. * src/muscle-tab.c (muscle_percent_variable_update): Provide backward compatibility. * tests/java.at: Adjust.
* doc: fix html buildAkim Demaille2012-12-311-1/+1
| | | | * doc/local.mk (bison.html): Fix dependencies.
* todo: remove erroneous taskAkim Demaille2012-12-312-7/+6
| | | | | | * tests/input.at: Check that there are no warnings about stray $ and @ in the epilogue. * TODO: Remove the correponding task.
* gnulib: updateAkim Demaille2012-12-313-8/+8
|
* regenAkim Demaille2012-12-282-484/+242
|
* syncline: one line is enoughAkim Demaille2012-12-282-5/+16
| | | | | | | | | | | | | | | | | | So far we were issuing two lines for each syncline change: /* Line 356 of yacc.c */ #line 1 "src/parse-gram.y" This is a lot of clutter, especially when reading diffs, as these lines change often. Fuse them into a single, shorter, line: #line 1 "src/parse-gram.y" /* yacc.c:356 */ * data/bison.m4 (b4_syncline): Issue a single line. Comment improvements. (b4_sync_start, b4_sync_end): Issue a shorter comment. * data/c++.m4 (b4_semantic_type_declare): b4_user_code must be on its own line as it might start with a "#line" directive.
* regenAkim Demaille2012-12-282-47/+47
|
* maint: restore ANSI 89 complianceAkim Demaille2012-12-285-27/+39
| | | | | | * data/bison.m4, src/conflicts.c, src/files.c, src/output.c, * src/symtab.c: Use /* ... */ comments only. Declare variables before statements.
* graph: minor simplificationAkim Demaille2012-12-282-42/+19
| | | | | | | | * src/gram.c (print_lhs): Use %*s to indent. * src/print_graph.c (print_lhs): Use obstack_printf. Became simple enough to be inlined in... (print_core): here. Use a "rule*" instead of an index in "rules[]".
* closure, gram: add missing constAkim Demaille2012-12-284-22/+24
| | | | | * src/closure.h, src/closure.c, src/gram.h, src/gram.c: Add some missing const where appropriate.
* carets: properly display when no line feed is presentTheophile Ranquet2012-12-274-26/+25
| | | | | | | * src/location.c (location_caret): finish the line with one whether or not it is present in input. Rewrite code without getline. (cleanup_caret): Reset the caret_info global. * bootstrap.conf: No longer require getline.
* scanner: reintroduce unput for missing end tokensTheophile Ranquet2012-12-272-84/+51
| | | | | | | | | | | Unput was no longer used since a POSIX-compatiblity issue with Flex 2.5.31, which has been adressed in newer versions of Flex. See this discussion: <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00029.html> This partially reverts commit aa4180418fff518198e1b0f2c43fec6432210dc7. * src/scan-gram.l (unexpected_end): Here. * tests/input.at: Adjust for new order of error reports.
* tables: scope reductionAkim Demaille2012-12-271-24/+25
| | | | * src/tables.c (default_goto): Make it easier to understand.
* regenAkim Demaille2012-12-272-421/+448
|
* skeletons: fix commentsAkim Demaille2012-12-277-44/+37
| | | | | | | | | | | | | | | | | The commit 38de4e570fdc7c8db9633c3b2054e565d8c1c6b9 underquoted the content of the comments, which resulted in losing square brackets in the comments. Besides, some other invocations were underquoting the effective arguments. * data/c.m4 (b4_comment_): Properly quote the comment. (b4_comment_, b4_comment): Move to... * data/c-like.m4: here, so that... * data/java.m4: can use it instead of its own copy. * data/bison.m4 (b4_integral_parser_tables_map): Fix some comments. * data/lalr1.cc, data/lalr1.java, data/yacc.c: Comment fixes. * data/lalr1.cc: Reorder a bit to factor some CPP directives.
* maint: which -> whoseAkim Demaille2012-12-275-10/+10
| | | | | | | Apparently, I was confusing both. * data/bison.m4, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Use "whose" where appropriate.
* tables: scope reductionAkim Demaille2012-12-261-37/+33
| | | | * src/tables.c (matching_state): here.
* tables: scope reductionAkim Demaille2012-12-261-23/+25
| | | | * src/tables.c (token_actions): here.
* tables: scope reductionAkim Demaille2012-12-261-26/+21
| | | | * src/tables.c (save_row): here.
* tables: scope reductionAkim Demaille2012-12-261-45/+43
| | | | | | * src/tables.c (save_column, pack_vector): Reduce the scope to emphasize the structure of the code. Rename the returned value "res" to make understanding easier.
* tables: use size_t where appropriateAkim Demaille2012-12-261-7/+6
| | | | | | | These changes aim at making the code easier to understand. * src/tables.c (tally): This is a size, always >= 0, so make it a size_t.
* tables: style changesAkim Demaille2012-12-261-11/+12
| | | | | | * src/tables.c: Prefer < to >. Fix/complete some comments. Remove useless parens.
* skeletons: no longer call yylex via a CPP macroAkim Demaille2012-12-264-40/+39
| | | | | | | | | | | | | The YYLEX existed only to support YYLEX_PARAM, which is now removed. This macro was a nuisance, since incorrect yylex calls where pointed the macro _use_, instead of its definition. * data/c.m4 (b4_lex_formals, b4_lex): New. * data/glr.c, data/yacc.c: Use it. * data/lalr1.cc (b4_lex): New. Use it. squash! skeletons: no longer call yylex via a CPP macro
* YYLEX_PARAM: drop supportAkim Demaille2012-12-263-16/+8
| | | | | * data/yacc.c, doc/bison.texi: Remove YYLEX_PARAM support. * NEWS: Document it.
* examples: minor improvementsAkim Demaille2012-12-261-2/+1
| | | | | * examples/variant.yy: Don't use debug_stream(), obsoleted. Use <*>.
* skeletons: factor comments about symbolsAkim Demaille2012-12-262-9/+40
| | | | | | * data/variant.hh (b4_char_sizeof_): Rename as... * data/bison.m4 (b4_symbol_tag_comment): this. Provide more documentation about b4_symbol_*.
* c: improve the definition of public typesAkim Demaille2012-12-262-17/+33
| | | | | | | | * data/c.m4 (b4_token_enum): Improve comments. (b4_value_type_define, b4_location_type_define): New, extracted from... (b4_declare_yylstype): here. Separate the typedefs from the union/struct definitions.
* doc: update variant usageAkim Demaille2012-12-262-29/+27
| | | | | * doc/bison.texi, examples/variant.yy: Use "%define api.value.type variant", instead of "%define variant".
* tests: check the "%define variant" is deprecated.Akim Demaille2012-12-261-57/+36
| | | | | | | | | | * tests/input.at: Rename some AT_SETUP to avoid that AT_SETUP_STRIP thinks they contain %define directives. ("%define" backward compatibility): Merge tests together to speed up the test suite, and to make maintenance easier (multiple AT_CHECK means multiple runs of the test suite to be sure to have updated all the error messages). Check the "%define variant" is properly obsoleted.