1 2004-04-13 Jim Meyering <jim@meyering.net>
3 * src/conflicts.c (conflicts_print): Correct format string typo:
4 use `%%' to produce literal `%'. (trivial change)
6 2004-03-30 Paul Eggert <eggert@twinsun.com>
8 * src/getargs.c (version): Update copyright year to 2004.
10 * data/c.m4 (b4_int_type): Use 'short int' rather than
11 'short', and similarly for 'long', 'unsigned', etc.
12 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
13 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
14 yy_yypstack, yydumpstack): Likewise.
15 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
16 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
18 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
19 yy_stack_print, yyparse): Likewise.
20 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
21 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
22 * lib/bitset.c (bitset_print): Likewise.
23 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
24 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
25 * lib/bitsetv.c (bitsetv_dump): Likewise.
26 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
27 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
29 * src/LR0.c (allocate_itemsets): Likewise.
30 * src/gram.h (rule_number, rule): Likewise.
31 * src/lalr.h (goto_number): Likewise.
32 * src/nullable.c (nullable_compute): Likewise.
33 * src/output.c (prepare_rules): Likewise.
34 * src/relation.c (relation_print, relation_digraph): Likewise.
35 * src/relation.h (relation_node): Likewise.
36 * src/state.h (state_number, transitions, errs, reductions,
37 struct state): Likewise.
38 * src/symtab.h (symbol_number, struct symbol): Likewise.
39 * src/tables.c (vector_number, tally, action_number,
40 default_goto, goto_actions): Likewise.
41 * tests/existing.at (GNU Cim Grammar): Likewise.
42 * tests/regression.at (Web2c Actions): Likewise.
44 * src/output.c (muscle_insert_short_int_table): Renamed from
45 muscle_insert_short_table. All uses changed.
47 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
49 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
50 (declaration): Replace expected_conflicts with expected_sr_conflicts.
53 * src/scan-gram.l: Recognize %expect-rr.
55 * src/conflicts.h (expected_sr_conflicts): Rename from
57 (expected_rr_conflicts): Declare.
59 * src/conflicts.c (expected_sr_conflicts): Rename from
61 (expected_rr_conflicts): Define.
62 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
64 Use expected_sr_conflicts in place of expected_conflicts.
65 Warn if expected_rr_conflicts used in non-GLR parser.
67 * doc/bison.texinfo: Add documentation for %expect-rr.
69 2004-03-08 Paul Eggert <eggert@gnu.org>
71 Add support for hex token numbers. Suggested by Odd Arild Olsen in
72 <http://mail.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
74 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
76 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
77 * src/scan-gram.l (scan_integer): New function.
79 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
80 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
81 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
82 Say "long int", not "long", for uniformity with GNU style.
84 2004-02-25 Paul Eggert <eggert@twinsun.com>
86 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
87 compilers. This fixes a problem with Intel's C++ compiler being
88 chatty, reported by Guido Trentalancia in
89 <http://mail.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
91 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
93 Support %destructor and merge error locations in lalr1.cc.
95 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
96 (Parser::stos_): Define unconditionally.
97 (Parser::destruct_): New method. Generate its body with
98 b4_yydestruct_generate.
99 (Parser::error_start_): New attribute.
100 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
101 token which are discarded.
102 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
103 error_start_ when erroneous token are discarded.
104 (Parser::parse) <yyerrlab1>: Compute the location of the error
105 token so that it covers all the discarded tokens.
106 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
107 it can be called with `%skeleton "lalr1.cc"', and do that.
109 2004-02-02 Paul Eggert <eggert@twinsun.com>
111 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
112 $(top_srcdir)/lib and ../lib. This fixes a bug reported
113 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
114 There's no need to mention top_builddir since Automake does that
116 (INCLUDES): Remove, as Automake says it's obsolescent.
117 Contents migrated into AM_CPPFLAGS as described above.
118 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
120 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
122 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
123 (yyreportSyntaxError): Handle case where lookahead token is
126 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
128 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
129 resulting parsers are compilable with C++.
131 2003-12-23 Paul Eggert <eggert@twinsun.com>
133 * config/depcomp, config/install-sh: Sync with Automake 1.8.
134 * src/output.c (output_skeleton): Rename local var.
135 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
136 Bison tokens, as this runs afoul of the 2003-10-07 change that
137 disallowed NUL bytes in character constants or string literals.
139 * tests/local.at: Require Autoconf 2.59's Autotest.
140 * tests/testsuite.at: Don't include local.at, since we now assume
141 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
143 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
144 multiple inclusion warnings.
146 2003-12-02 Akim Demaille <akim@epita.fr>
148 * doc/bison.texinfo (How Can I Reset the Parser): More about start
152 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
154 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
156 2003-10-07 Paul Eggert <eggert@twinsun.com>
158 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
159 if testsuite doesn't exist.
161 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
162 literals, unfortunately.
163 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
164 Complain about NUL bytes in character constants or string literals.
166 2003-10-05 Paul Eggert <eggert@twinsun.com>
168 * NEWS: Don't document %no-default-prec, as it's still
170 * doc/bison.texinfo: Document %no-default-prec only if
171 the defaultprec flag is set. Normally it's not.
173 2003-10-04 Paul Eggert <eggert@twinsun.com>
175 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
176 non-modifiable lvalue, instead of a modifiable one.
177 * doc/bison.texinfo (Actions): Document that $$ can
178 be assigned to. Do not claim that $$ and $N are
179 array element references: user code should not rely on this.
181 2003-10-01 Paul Eggert <eggert@twinsun.com>
183 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
184 (grammar_declaration): Use it.
185 * src/scan-gram.l: New token %no-default-prec.
186 * tests/conflicts.at: Revamp tests to use %no-default-prec.
187 * NEWS, doc/bison.texinfo: Document the above.
189 2003-10-01 Akim Demaille <akim@epita.fr>
191 VCG no longer supports long_straight_phase.
193 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
194 * src/print_graph.c (print_graph): Adjust.
196 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
197 and Paul Eggert <eggert@twinsun.com>
199 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
200 Table of Symbols): Document %default-prec.
201 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
202 (grammar_declaration): Set default_prec on %default-prec.
203 * src/scan-gram.l (%default-prec): New token.
204 * src/reader.h (default_prec): New flag.
205 * src/reader.c: Likewise.
206 (packgram): Handle it.
207 * tests/conflicts.at (%default-prec without %prec,
208 %default-prec with %prec, %default-prec 1): New tests.
210 2003-09-30 Paul Eggert <eggert@twinsun.com>
212 * tests/testsuite.at: Include local.at, not input.at, fixing
213 a typo in the 2003-08-25 patch.
215 2003-08-27 Akim Demaille <akim@epita.fr>
217 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
220 2003-08-26 Akim Demaille <akim@epita.fr>
222 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
223 "<\#" to avoid magic from Gnus when posting parts of this script.
225 2003-08-26 Akim Demaille <akim@epita.fr>
227 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
228 (Parser::parse): here.
229 Adjust: nerrs and errstatus is now replaced by...
230 (Parser::nerrs_, Parser::errstatus_): New.
232 2003-08-25 Akim Demaille <akim@epita.fr>
234 * config/announce-gen, Makefile.cfg: New.
235 * Makefile.am: Adjust.
236 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
237 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
239 2003-08-25 Akim Demaille <akim@epita.fr>
241 When reducing initial empty rules, Bison parser read an initial
242 location that is not defined. This results in garbage, and that
243 affects Bison's own parser. Therefore we need (i) to extend Bison
244 to support a means to initialize this location, and (ii) to use
245 this CVS Bison to fix CVS Bison's parser.
247 * src/reader.h, reader.c (epilogue_augment): Remove, replace
249 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
250 * src/parse-gram.y: Adjust.
251 (%initial-action): New.
252 (%error-verbose): Since we require CVS Bison, there is no reason
254 * src/scan-gram.l: Adjust.
255 * src/Makefile.am (YACC): New, to make sure we use our own parser.
256 * data/yacc.c (yyparse): Use b4_initial_action.
258 2003-08-25 Akim Demaille <akim@epita.fr>
260 * doc/bison.texinfo: Don't promote stdout for error messages.
262 2003-08-25 Akim Demaille <akim@epita.fr>
264 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
265 From Alexandre Duret-Lutz.
267 2003-08-25 Akim Demaille <akim@epita.fr>
271 2003-08-25 Akim Demaille <akim@epita.fr>
273 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
276 2003-08-25 Akim Demaille <akim@epita.fr>
278 * data/lalr1.cc (Parser::reduce_print_): New.
281 2003-08-25 Akim Demaille <akim@epita.fr>
283 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
284 error recovery loops. This patch is based on
285 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
286 Also, augment the similarity between lalr1.cc and yacc.c.
287 Note: the locations of error recovery rules are not correct yet.
289 * data/lalr1.cc: Comment changes to augment the similarity between
291 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
292 (yyerrlab1): Remove, but where it used to be (now the bottom part of
293 yyerrlab), when hitting EOF, pop the whole stack here instead of
294 merely falling thru the default error handling mechanism.
295 (yyerrorlab): New label, with the old contents of YYERROR,
296 plus the following change: pop the stack of rhs corresponding
297 to the production that invoked YYERROR. That is how Yacc
298 behaves (required by POSIX).
299 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
302 2003-08-25 Akim Demaille <akim@epita.fr>
304 Tune local.at so that people can "autom4te -l autotest calc.at -o
305 calc" for instance, to extract a sub test suite.
307 * tests/testsuite.at: Move the initialization, Autotest version
308 requirement, and AT_TESTED invocation into...
309 * tests/local.at: here.
310 * tests/testsuite.at: Include it for compatibility with Autoconf
312 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
315 2003-08-04 Paul Eggert <eggert@twinsun.com>
317 Rework code slightly to avoid gcc -Wtraditional warnings.
318 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
319 The returned value is now stored in *YY0. All callers changed.
320 * src/output.c (merge_output): Adjust to the above change.
322 2003-07-26 Paul Eggert <eggert@twinsun.com>
324 * data/glr.c (YYASSERT): New macro.
325 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
326 yyresolveStates, yyprocessOneStack):
327 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
328 Derived from a suggestion by Frank Heckenbach.
330 2003-07-25 Paul Eggert <eggert@twinsun.com>
332 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
333 for portability to K&R C (after ansi2knr, presumably). See
334 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
335 by Frank Heckenbach, though I have omitted the structure-initialization
336 part of his glr-knr.diff patch since I recall that the Portable
337 C Compiler didn't require that change.
339 Let the user specify how to allocate and free memory.
340 Derived from a suggestion by Frank Heckenbach in
341 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
342 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
343 All uses of free, malloc, realloc changed to use these macros,
344 and unnecessary casts removed.
345 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
347 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
349 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
350 use s.empty() rather than s == "" to test for empty string; see
351 <http://mail.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
354 2003-06-25 Akim Demaille <akim@epita.fr>
356 * config/depcomp, config/install-sh: Update from masters.
358 2003-06-20 Paul Eggert <eggert@twinsun.com>
360 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
361 and return properly parenthesized result.
362 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
363 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
364 Remove unnecessary parentheses from uses.
365 * doc/bison.texinfo (Location Default Action): Describe the
366 conventions for parentheses.
368 2003-06-19 Paul Eggert <eggert@twinsun.com>
370 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
371 yyreportTree): Do not assume that size_t is the same width as int,
372 when printing sizes. Print sizes using an unsigned format.
373 Problem reported by Frank Heckenbach in
374 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
376 Port to Forte Developer 7 C compiler.
377 * data/glr.c (struct YYLTYPE): If locations are not being used,
378 declare a single dummy member, as empty structs do not conform
380 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
381 the Forte Developer 7 C compiler complains that end-of-loop
384 2003-06-17 Paul Eggert <eggert@twinsun.com>
386 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
387 avoid warnings from picky compilers about redefinition of PARAMS.
389 2003-06-17 Paul Eggert <eggert@twinsun.com>
393 * NEWS: Document 1.875b.
395 * lib/bbitset.h: Do not include config.h; that's the includer's job.
396 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
397 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
398 Don't use 'index' in comments, as it's a builtin fn on some hosts.
399 * lib/bitset_stats.c: Include gettext.h unconditionally, as
400 per recent gettext manual's suggestion.
401 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
402 Use prototypes, not old-style definitions.
403 * lib/lbitset.c (lbitset_unused_clear): Likewise.
404 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
405 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
406 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
407 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
408 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
409 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
410 vbitset_or_and_cmp, vbitset_copy): Likewise.
412 * lib/libiberty.h: Do not include config.h; that's the includer's job.
413 Do not include <stdlib.h>.
414 (PARAMS): Define unconditionally for C89.
415 (ATTRIBUTE_NORETURN): Remove.
416 (ATTRIBUTE_UNUSED): Define unconditionally.
418 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
419 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
420 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
421 * lib/vbitset.c, lib/vbitset.h: New files.
422 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
423 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
426 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
427 `How Can I Reset @code{yyparse}', since texinfo does not allow
428 arbitrary @ in node names.
430 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
431 shouldn't be needed according to the gettext 0.12.1 documentation
432 but which seem to be needed anyway: codeset.m4 glibc21.m4
433 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
434 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
435 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
437 * lib/.cvsignore: Add stdbool.h.
438 * m4/.cvsignore: Add nls.m4, po.m4.
440 Upgrade to CVS gnulib.
441 * stdbool_.h: File renamed from stdbool.h.in.
442 * configure.ac (AM_STDBOOL_H): Invoke this instead of
444 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
445 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
446 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
447 (MOSTLYCLEANFILES): New var.
448 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
449 (stdbool.h): New rule.
450 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
451 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
452 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
453 m4/quote.m4: Upgrade to today's gnulib.
455 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
456 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
458 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
459 yyerror are declared before use; C99 requires this.
461 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
463 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
465 (yyrecoverSyntaxError): Correct the logic for setting and testing
467 Correct comment on handling EOF.
468 Allow states with only a default reduction, rather than failing
469 (I can't quite reconstruct why these were not allowed before).
471 Fixes to avoid problem that $-N rules in GLR parsers can cause
472 buffer overruns, corrupting state.
474 * src/output.c (prepare_rules): Output max_left_semantic_context
476 * src/reader.h (max_left_semantic_context): New variable declaration.
477 * src/scan-gram.l (max_left_semantic_context): Define.
478 (handle_action_dollar): Update max_left_semantic_context.
479 * data/glr.c (YYMAXLEFT): New definition.
480 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
481 (yyresolveAction): Ditto.
483 Fixes to problems with location handling in GLR parsers reported by
484 Frank Heckenbach (2003/06/05).
486 * data/glr.c (YYLTYPE): Make trivial if locations not used.
487 (YYRHSLOC): Add parentheses, and define only if locations used.
488 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
490 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
491 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
493 * tests/cxx-type.at: Exercise location information; update tests
494 to differentiate output with and without locations.
495 Remove forward declarations of yylex and yyerror---caused errors
496 because default YYLTYPE not yet defined.
497 Change semantic actions to compute strings, rather than printing
498 them directly (to test proper passing of semantics values). Change
499 output to prefix notation and update test data and expected results.
500 (yylex): Track locations.
501 (stmtMerge): Return value rather than printing, and include arguments
504 2003-06-03 Paul Eggert <eggert@twinsun.com>
506 Avoid warnings generated by GCC 2.95.4 when Bison is
507 configured with --enable-gcc-warnings.
508 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
509 yy::]b4_parser_class_name[::translate_,
510 yy::Stack::operator[] (unsigned),
511 yy::Stack::operator[] (unsigned) const,
512 yy::Slice::operator[] (unsigned),
513 yy::Slice::operator[] (unsigned) const):
514 Rename local vars to avoid warnings.
515 * tests/glr-regression.at (Improper handling of embedded actions
516 and $-N in GLR parsers): Remove unused local variable from yylex.
517 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
518 (void) as arg when not pure, since we now assume C89 when building
519 Bison. Pacify GCC by using parameter.
521 2003-06-02 Paul Eggert <eggert@twinsun.com>
523 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
524 yy::Location::lines, yy::Location::columns): Rename arguments
525 to avoid shadowing; this removes a warning generated by GCC 3.3.
527 2003-06-01 Paul Eggert <eggert@twinsun.com>
529 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
530 to g++, as GCC 3.3 complains if you do it.
531 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
532 everything that WARNING_CFLAGS has, except omit warnings
533 not suitable for C++.
534 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
535 * tests/atlocal.in (CXXFLAGS): New var.
536 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
538 Fix a GLR parser bug I reported in February; see
539 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
540 The problem was that GLR parsers did not conform to the C standard,
541 because actions like { $1 = $2 + $3; } expanded to expressions
542 that invoked YYFILL in separate subexpressions, and YYFILL assigned
543 to a local variable. The C standard says that expressions
544 like (var = f ()) + (var = f ()) have undefined behavior.
545 Another problem was that GCC sometimes issues warnings that
546 yyfill and its parameters are unused.
548 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
550 (yyfill): New function.
552 (yyuserAction): Change type of yynormal to bool, so that it matches
553 the new yyfill signature. Mark it as possibly unused.
556 Follow up on a bug I reported in February, where a Bison-generated
557 parser can loop. Provide a test case and a fix for yacc.c. I
558 don't have a fix for lalr1.cc or for glr.c, unfortunately.
559 The original bug report is in:
560 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
562 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
563 macro's size was becoming unwieldy.
564 (yyerrlab): Do not discard an empty lookahead symbol, as this
565 might destroy garbage.
566 (yyerrorlab): New label, with the old contents of YYERROR,
567 plus the following change: pop the stack of rhs corresponding
568 to the production that invoked YYERROR. That is how Yacc
569 behaves, and POSIX requires this behavior.
570 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
571 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
572 Define 'alarm' to do nothing if unistd.h is not available.
573 Add a new rule "exp: '-' error;" to test the above change to
574 data/yacc.c. Use 'alarm' to abort any test taking longer than
575 10 seconds, as it's probably looping.
576 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
577 Also, the new yacc.c generates two fewer diagnostics for an
580 2003-05-24 Paul Eggert <eggert@twinsun.com>
582 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
583 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
584 This fixes a problem reported by John Bowman when the Compaq/HP
585 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
587 * data/yacc.c (union yyalloc): Likewise.
588 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
590 Switch from 'int' to 'bool' where that makes sense.
592 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
593 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
594 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
595 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
596 Return or accept bool, not int. All callers changed.
597 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
598 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
599 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
600 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
601 bitset_or_and_cmp_): Likewise.
602 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
603 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
604 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
605 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
606 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
607 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
608 bitset_stats_or_and_cmp): Likewise.
609 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
610 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
611 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
612 ebitset_xor_cmp): Likewise.
613 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
614 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
615 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
616 lbitset_xor_cmp): Likewise.
617 * lib/bbitset.h: Include <stdbool.h>.
618 (struct bitset_vtable): The following members now return bool, not
619 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
620 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
622 * src/conflicts.c (count_rr_conflicts): Likewise.
623 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
625 * lib/ebitset.c (ebitset_obstack_init): Likewise.
626 * lib/lbitset.c (lbitset_obstack_init): Likewise.
627 * src/getargs.c (debug_flag, defines_flag, locations_flag,
628 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
629 graph_flag): Likewise.
630 * src/getargs.h (debug_flag, defines_flag, locations_flag,
631 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
632 graph_flag): Likewise.
633 * src/output.c (error_verbose): Likewise.
634 * src/output.h (error_verbose): Likewise.
635 * src/reader.c (start_flag, typed): Likewise.
636 * src/reader.h (typed): Likewise.
637 * src/getargs.c (LOCATIONS_OPTION): New constant.
638 (long_options, getargs): Use it.
639 * src/lalr.c (build_relations): Use bool, not int.
640 * src/nullable.c (nullable_compute): Likewise.
641 * src/print.c (print_reductions): Likewise.
642 * src/tables.c (action_row, pack_vector): Likewise.
643 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
644 * src/output.c (prepare): Use it.
645 * src/output.c (token_definitions_output,
646 symbol_destructors_output, symbol_destructors_output): Use string,
647 not boolean integer, to keep track of whether to output separator.
648 * src/print_graph.c (print_core): Likewise.
649 * src/state.c (state_rule_lookaheads_print): Likewise.
651 * config/install-sh: Sync from automake 1.7.5.
653 2003-05-14 Paul Eggert <eggert@twinsun.com>
655 * src/parse-gram.y (rules_or_grammar_declaration): Require a
656 semicolon after a grammar declaration, in the interest of possible
657 future changes to the Bison input language.
658 Do not allow a stray semicolon at the start of the grammar.
659 (rhses.1): Allow one or more semicolons after any rule, including
660 just before "|" as required by POSIX.
661 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
664 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
666 %parse-param support for lalr1.cc.
668 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
669 b4_cc_constructor_calls, b4_cc_constructor_call,
670 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
672 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
673 parse-param arguments.
674 (yy::b4_parser_class_name): Declare instance variables to
675 hold parse-param arguments.
676 * tests/calc.at: s/value/semantic_value/ because value clashes
677 with a member of yy::b4_parser_class_name. Adjust C++ code
678 to handle %parse-param. Enable %parse-param test in C++.
680 2003-05-12 Paul Eggert <eggert@twinsun.com>
682 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
683 English a bit. Fix fclose typo. Change "const char" to "char
684 const", and use ANSI C rather than K&R for "main". Suggest
685 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
686 and suggest yy_switch_to_buffer.
688 2003-05-05 Paul Eggert <eggert@twinsun.com>
690 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
691 C89. This avoids a diagnostic on compilers that define __STDC__
692 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
693 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
695 2003-05-03 Paul Eggert <eggert@twinsun.com>
697 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
698 Do not overrun array bounds.
699 This should fix a bug reported today by Olatunji Oluwabukunmi in
700 <http://mail.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
702 2003-04-29 Akim Demaille <akim@epita.fr>
704 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
705 * src/getargs.c, src/getargs.h: here, as bool, not int.
706 (nondeterministic_parser): New.
707 * src/parse-gram.y, src/scan-gram.l: Support
708 %nondeterministic-parser.
709 * src/output.c (prepare): Use nondeterministic_parser instead
710 of glr_parser where appropriate.
711 * src/tables.c (conflict_row, action_row, save_row)
712 (token_actions, token_actions, pack_vector): Ditto.
714 2003-04-29 Akim Demaille <akim@epita.fr>
716 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
718 2003-04-29 Akim Demaille <akim@epita.fr>
720 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
721 with %pure-parser and %locations to exercise the patch from Yakov
724 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
726 * data/yacc.c: (b4_lex_param): Corrected for the case where
727 %lex-param is provided and %pure-parser isn't.
729 2003-04-27 Paul Eggert <eggert@twinsun.com>
731 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
732 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
733 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
734 if it is not defined.
735 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
737 2003-04-26 Paul Eggert <eggert@twinsun.com>
739 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
740 Declare to be of type suitable for the ninf value itself, not of
741 type suitable for the corresponding table, since the latter might
742 be unsigned but the ninf value might be negative. This fixes a
743 bug reported by Alexandre Duret-Lutz in
744 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
746 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
747 invokes it. We shouldn't invoke it twice because it will attempt
748 to put error.o in the archive twice. This fixes a glitch reported
750 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
752 2003-04-21 Paul Eggert <eggert@twinsun.com>
754 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
757 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
759 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
760 Fix obvious typo that results in uncompilable GLR parsers
761 when both %pure-parser and %locations are used. (trivial change)
763 2003-04-17 Paul Eggert <eggert@twinsun.com>
765 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
766 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
767 Do not insert the expected token via unput, as this runs afoul
768 of a POSIX-compatibility bug in flex 2.5.31.
769 All uses changed to BEGIN the parent state,
770 since we no longer insert the expected token via unput.
771 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
772 that is no longer emitted after the above change.
774 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
775 the first one. This change is from Paul Hilfinger, and it fixes
776 regression reported by Werner Lemberg in
777 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
779 (resolve_sr_conflict): Don't invoke state_errs_set
780 unless one or more tokens have been explicitly made errors.
781 Otherwise, the above change causes Bison to abort.
783 * tests/existing.at (GNU pic Grammar): New test case, taken from
786 2003-03-31 Akim Demaille <akim@epita.fr>
788 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
790 2003-03-31 Akim Demaille <akim@epita.fr>
792 * src/output.c (prepare_symbols): Avoid trailing spaces in the
795 2003-03-31 Akim Demaille <akim@epita.fr>
797 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
800 2003-03-29 Akim Demaille <akim@epita.fr>
802 * m4/error.m4: Do not put under dynamic conditions some code which
803 expansion is under static control.
805 2003-03-29 Akim Demaille <akim@epita.fr>
807 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
809 2003-03-29 Akim Demaille <akim@epita.fr>
811 * doc/bison.texinfo (Strings are Destroyed): New.
813 2003-03-13 Paul Eggert <eggert@twinsun.com>
815 * .cvsignore: Add configure.lineno.
816 * src/.cvsignore: Add yacc.
817 * tests/.cvsignore: Add testsuite.log.
818 * doc/fdl.texi: Sync with latest FSF version.
820 2003-03-12 Paul Eggert <eggert@twinsun.com>
822 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
823 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
824 cursor, instead of leaving it undefined. This fixes a bug
825 reported by Tim Van Holder in
826 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
827 * tests/input.at (Torturing the Scanner): Test the scanner on
828 an empty input file, which was Tim Van Holder's test case.
830 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
831 <sys/resource.h> can be included, include sys/time.h and
832 sys/times.h first, if available. This works around the SunOS
833 4.1.4 porting bug reported by Bruce Becker in
834 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
836 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
837 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
840 Merge changes from gnulib. This was prompted because the CVS
841 snapshot didn't build on Solaris 7 due to strnlen problems.
843 These changes need to be merged back into gnulib:
844 * lib/hash.c: Include <stdbool.h> unconditionally.
845 * m4/onceonly.m4 (m4_quote): New macro.
846 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
847 Quote AC_FOREACH variable-expansions properly.
848 The 2003-01-03 obstack.h change also needs merging.
849 {end of changes requiring merging}
851 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
852 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
853 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
854 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
855 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
856 New files, imported from gnulib.
857 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
860 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
861 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
864 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
866 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
867 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
868 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
869 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
870 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
871 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
872 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
873 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
874 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
875 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
876 (jm_PREREQ_ARGMATCH): Remove.
877 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
878 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
880 * src/system.h: Include <stdbool.h> unconditionally.
882 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
883 assuming at least C89 in the bitset code for some time now.
885 2003-03-03 Akim Demaille <akim@epita.fr>
889 2003-03-02 Akim Demaille <akim@epita.fr>
891 * doc/bison.texinfo (Table of Symbols): Reactivate the
892 documentation for %lex-param, and %parse-param.
894 2003-03-02 Akim Demaille <akim@epita.fr>
896 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
897 generate verbose error messages.
898 Use the number of tokens as an upper bound in yytname, as it
899 cannot be a non terminal.
901 2003-03-02 Akim Demaille <akim@epita.fr>
903 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
906 2003-03-02 Akim Demaille <akim@epita.fr>
908 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
909 Use them to exercise yycheck overrun.
910 Based on Andrew Suffield's grammar.
912 2003-03-02 Akim Demaille <akim@epita.fr>
914 Create tests/local.at for Bison generic testing macros.
916 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
917 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
919 * tests/calc.at (AT_CHECK_CALC): Adjust.
920 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
921 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
922 * tests/local.at: here.
923 (AT_COMPILE_CXX): Tags the tests using it as c++.
924 Ignore the test if CXX is not functional.
926 2003-03-01 Paul Eggert <eggert@twinsun.com>
928 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
929 not loc->end, since loc->end might contain garbage and this leads
930 to undefined behavior on some platforms.
931 (id_loc, token_start): Use (IF_LINTed) initial values that do not
932 depend on *loc, so that the reader doesn't give the the false
933 impression that *loc is initialized.
934 (<INITIAL>"%%"): Do not bother setting code_start, since its value
935 does not survive the return.
937 2003-03-01 Akim Demaille <akim@epita.fr>
939 * src/scan-gram.l (code_start): Always initialize it when entering
940 into yylex, as SC_EPILOGUE is activated *before* the corresponding
941 yylex invocation. An alternative would be making it static, but
942 then it starts with the second %%'s beginning, instead of its end.
944 2003-02-28 Paul Eggert <eggert@twinsun.com>
946 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
947 around a UnixWare 7.1.1 porting bug reported by John Hughes in
948 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
950 2003-02-26 Paul Eggert <eggert@twinsun.com>
952 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
953 Remove Sequent/Pyramid discussion (nobody uses them any more).
954 Merge VMS and MS-DOS discussion; these ports may well be dead
955 but let's keep mentioning them for now. Put <> around email
956 addresses. Add copyright notice.
958 2003-02-24 Paul Eggert <eggert@twinsun.com>
960 * data/glr.c (yy_reduce_print): yylineno -> yylno,
961 to avoid collision with flex use of yylineno.
962 Problem reported by Bruce Lilly in
963 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
964 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
965 * data/yacc.c (yy_reduce_print): Likewise.
967 * config/depcomp: Sync with Automake 1.7.3.
969 2003-02-21 Akim Demaille <akim@epita.fr>
971 * data/lalr1.cc: Use temporary variables instead of casts to
972 change integer types.
973 Suggested by Paul Eggert.
975 2003-02-21 Akim Demaille <akim@epita.fr>
977 * doc/bison.texinfo: Use "location" consistently to refer to @n,
978 to avoid confusions with lalr1.cc's notion of Position.
979 Suggested by Paul Eggert.
981 2003-02-20 Akim Demaille <akim@epita.fr>
983 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
984 before initial_columns.
985 (location.hh): Use consistent variable names when defining the
987 Use "last" so that we subtract from Positions, not from unsigned.
989 2003-02-20 Akim Demaille <akim@epita.fr>
991 * data/lalr1.cc (position.hh): New subfile, including the extended
992 and Doxygen'ed documentation of class Position.
993 (location.hh): Use it.
994 Document a` la Doxygen.
995 With the help of Benoit Perrot.
997 2003-02-20 Akim Demaille <akim@epita.fr>
999 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
1001 Redefine AT_YYERROR_SEES_LOC_IF using it.
1002 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
1004 Don't use the location in yy::Parser::error_ and
1005 yy::Parser::print_ when not %locations.
1006 Activate more lalr1.cc tests.
1008 2003-02-19 Akim Demaille <akim@epita.fr>
1010 * data/lalr1.cc: When displaying a line number, be sure to make it
1013 2003-02-19 Akim Demaille <akim@epita.fr>
1015 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
1017 (YYABORT, YYACCEPT, YYERROR): New.
1018 * tests/calc.at: Renable the lalr1.cc test.
1020 2003-02-19 Akim Demaille <akim@epita.fr>
1022 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
1023 error recovery, mixing with/without pops and discarding of the
1026 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
1028 2003-02-17 Paul Eggert <eggert@twinsun.com>
1030 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
1031 * tests/testsuite.at (AT_COMPILE): Use them.
1032 This fixes the testsuite problem reported by Robert Lentz in
1033 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
1035 2003-02-12 Paul Eggert <eggert@twinsun.com>
1037 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
1038 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
1039 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
1040 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
1041 Check for malloc failure, for consistency with yacc.c.
1042 (yytname_size): Remove, for consistency with yacc.c.
1044 The bug still remains in data/lalr1.cc, as I didn't have time
1047 2003-02-06 Akim Demaille <akim@epita.fr>
1049 * configure.ac (GXX): Rename as...
1050 (CXX): this, to keep the original Autoconf semantics.
1052 * data/lalr1.cc: Fix b4_copyright invocations.
1053 If YYDEBUG is not defined, don't depend upon name_ being defined.
1054 (location.hh): Include string and iostream.
1055 (Position::filename): New member.
1056 (Position::Position ()): New.
1057 (operator<< (Position)): New.
1058 (operator- (Position, int)): New.
1059 (Location::first, Location::last): Rename as...
1060 (Location::begin, Location::end): these, to mock the conventional
1062 (operator<< (Location)): New.
1063 * tests/atlocal.in (CXX): New.
1064 * tests/testsuite.at (AT_COMPILE_CXX): New.
1065 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
1066 locations in a more synthetic way.
1067 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
1069 Adjust the C locations to match those from Emacs: first column is
1071 Change all the expected results.
1072 Conform to the GCS: simplify the locations when applicable.
1073 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
1074 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
1075 these CPP macros with the m4 macros new defined by...
1076 (AT_CHECK_PUSHDEFS): this, i.e.:
1077 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
1078 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
1080 (AT_CHECK_POPDEFS): Undefine them.
1081 (AT_CHECK_CALC_LALR1_CC): New.
1082 Use it for the first lalr1.cc test.
1084 2003-02-04 Akim Demaille <akim@epita.fr>
1086 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
1087 Location as is defined.
1089 2003-02-04 Akim Demaille <akim@epita.fr>
1091 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
1092 name_ being defined.
1094 2003-02-03 Paul Eggert <eggert@twinsun.com>
1096 * src/gram.h (start_symbol): Remove unused decl.
1098 Use more-consistent naming conventions for local vars.
1100 * src/derives.c (derives_compute): Change type of local var from
1102 * src/gram.c (grammar_rules_partial_print): Likewise.
1103 * src/print.c (print_core): Likewise.
1104 * src/reduce.c (reduce_grammar_tables): Likewise.
1106 * src/gram.c (grammar_dump): Change name of item_number *
1107 local var from r to rp.
1108 * src/nullable.c (nullable_compute): Likewise.
1110 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
1112 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
1113 for symbol or symbol_number var.
1114 * src/reader.c (grammar_start_symbol_set): Likewise.
1115 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
1117 * src/state.c (transitions_to): Likewise.
1118 * src/state.h: Likewise.
1119 * src/tables.c (symbol_number_to_vector_number): Likewise.
1121 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
1124 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
1127 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
1130 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
1131 Use str, not s, for char * var. Use ch, not c, for character var.
1132 Use size for size var.
1134 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
1136 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
1138 * src/uniqstr.h: Likewise.
1140 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
1141 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
1142 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
1143 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
1144 param to have same name as that of enum, so that we don't use
1145 "s" to stand for a non-state.
1147 2003-02-02 Akim Demaille <akim@epita.fr>
1149 * src/scan-skel.l: Scan more than one inert character per yylex
1152 2003-02-01 Paul Eggert <eggert@twinsun.com>
1156 * po/LINGUAS: Add ms.
1158 2003-01-30 Akim Demaille <akim@epita.fr>
1160 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
1162 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1164 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
1167 Changes in response to error report by S. Eken: GLR mode does not
1168 handle negative $ indices or $ indices in embedded rules correctly.
1169 See <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
1171 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
1172 (b4_rhs_location): Ditto.
1173 (yyfill): New function to copy from stack tree into array
1175 (yyuserAction): Modify to allow incremental move of semantic values
1176 to rhs array when in GLR mode.
1177 Define YYFILL to use in user-defined actions to fill semantic array
1179 Remove dummy use of yystack, as there is now a guaranteed use.
1180 (yydoAction): Modify to allow incremental move of semantic values
1181 to rhs array when in GLR mode.
1182 (yyresolveAction): Ditto.
1183 (yyglrShiftDefer): Update comment.
1184 (yyresolveStates): Use X == NULL for pointers, not !X.
1185 (yyglrReduce): Ditto.
1188 * tests/glr-regr1.at: Rename to ...
1189 * tests/glr-regression.at: Add new regression test for the problems
1190 described above (adapted from S. Eken).
1191 Update copyright notice.
1192 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
1193 * tests/Makefile.am: Ditto.
1195 2003-01-28 Paul Eggert <eggert@twinsun.com>
1197 * data/lalr1.cc: Do not use @output_header_name@ unless
1198 b4_defines_flag is set. This fixes two bugs reported by
1200 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
1201 and <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
1203 2003-01-21 Paul Eggert <eggert@twinsun.com>
1205 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
1206 we don't need to worry about yyerrlab1 being reported as an
1207 "unused label" by non-GCC C compilers. The downside is that if
1208 locations are used then a couple of statements are duplicated each
1209 time YYERROR is invoked, but the upside is that the warnings
1211 (yyerrlab1): Move code to YERROR.
1212 (yyerrlab2): Remove. Change uses back to yyerrlab1.
1213 This reverts some of the 2002-12-27 change.
1215 2003-01-17 Paul Eggert <eggert@twinsun.com>
1217 * src/output.c (symbol_printers_output): Fix typo that led
1218 to core dump. Problem reported by Antonio Rus in
1219 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
1221 2003-01-13 Akim Demaille <akim@epita.fr>,
1222 Quoc Peyrot <chojin@lrde.epita.fr>,
1223 Robert Anisko <anisko_r@lrde.epita.fr>
1225 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
1226 when the stacks contain one element, as the loop would otherwise
1227 free the last state, and then use the top state (the one we just
1228 popped). This means that the initial elements will not be freed
1229 explicitly, as is the case in yacc.c; it is not a problem, as
1230 these elements have fake values.
1232 2003-01-11 Paul Eggert <eggert@twinsun.com>
1234 * NEWS: %expect-violations are now just warnings, reverting
1235 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
1236 bootstrapping problem reported by Matthias Klose; see
1237 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
1238 * src/conflicts.c (conflicts_print): Likewise.
1239 * tests/conflicts.at (%expect not enough, %expect too much,
1240 %expect with reduce conflicts): Likewise.
1241 * doc/bison.texinfo (Expect Decl): Document this. Also mention
1242 that the warning is enabled if the number of conflicts changes
1243 (not necessarily increases).
1245 * src/getargs.c (version): Update copyright year.
1247 2003-01-09 Akim Demaille <akim@epita.fr>
1249 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
1251 2003-01-08 Paul Eggert <eggert@twinsun.com>
1253 * Makefile.maint (WGETFLAGS):
1254 New macro, containing "-C off" to disable proxy caches.
1255 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
1256 (rel-check): Use $(WGET) instead of wget.
1258 2003-01-06 Paul Eggert <eggert@twinsun.com>
1260 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
1261 the GLR paper of Scott, Johnstone and Hussain.
1263 2003-01-04 Paul Eggert <eggert@twinsun.com>
1265 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
1266 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
1267 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
1268 (EXTRA_LIBRARIES): New var, for liby.a.
1269 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
1270 (EXTRA_SCRIPTS): New var, for yacc.
1272 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
1273 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
1274 Problem reported by Nelson H. F. Beebe.
1276 2003-01-03 Paul Eggert <eggert@twinsun.com>
1278 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
1279 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1280 when compiling Bison 1.875's `bitset bset = obstack_alloc
1281 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
1283 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
1284 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
1285 grow to a huge size with typical invocation.
1287 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
1288 Use the pattern recommended by Autoconf 2.57, except also protect
1289 against double-definition.
1290 * src/system.h: Likewise.
1291 Portability issues reported by Nelson H. F. Beebe.
1293 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
1294 All uses changed. Provide a definition in both C and C++.
1295 (yytrue, yyfalse): Define even if defined (__cplusplus).
1297 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
1298 Reported by Nelson H. F. Beebe.
1300 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
1302 2003-01-02 Paul Eggert <eggert@twinsun.com>
1304 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
1305 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
1306 Bug reported by Nelson H. F. Beebe.
1308 2003-01-01 Paul Eggert <eggert@twinsun.com>
1312 2002-12-30 Paul Eggert <eggert@twinsun.com>
1314 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
1316 (<INITIAL>","): Here. This causes stray "," to be treated
1319 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
1320 last brace in braced code when not in Yacc mode, for compatibility
1321 with Bison 1.35. This resurrects the 2001-12-15 patch to
1324 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
1325 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
1327 2002-12-28 Paul Eggert <eggert@twinsun.com>
1329 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
1330 that of SYM's type. This fixes Debian bug 168069, reported by
1333 2002-12-28 Paul Eggert <eggert@twinsun.com>
1337 Switch back to the Yacc style of conflict reports, undoing some
1338 of the 2002-07-30 change.
1339 * doc/bison.texinfo (Understanding): Use Yacc style for
1340 conflict reports. Also, use new way of locating rules.
1341 * src/conflicts.c (conflict_report):
1342 Renamed from conflict_report_yacc, removing the old
1343 'conflict_report'. Translate the entire conflict report at once,
1344 so that we don't assume that "," has the same interpretation in
1346 (conflicts_output): Use Yacc-style conflict report for each state,
1347 instead of our more-complicated style.
1348 (conflicts_print): Use Yacc-style conflict report, except print
1349 the input file name when not emulating Yacc.
1350 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
1351 Conflicted Reduction, %expect not enough, %expect too much,
1352 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
1353 * tests/existing.at (GNU Cim Grammar): Likewise.
1354 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
1356 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
1357 fatal): Don't invoke fflush; it's not needed and it might even be
1358 harmful for stdout, as stdout might not be open.
1359 * src/reduce.c (reduce_print): Likewise.
1361 2002-12-27 Paul Eggert <eggert@twinsun.com>
1363 Fix a bug where error locations were not being recorded correctly.
1364 This problem was originally reported by Paul Hilfinger in
1365 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
1367 * data/yacc.c (yyparse): New local var yylerrsp, to record the
1368 top of the location stack's error locations.
1369 (yyerrlab): Set it. When discarding a token, push its location
1370 onto yylerrsp so that we don't lose track of the error's end.
1371 (yyerrlab1): Now is only the target of YYERROR, so that we can
1372 properly record the location of the action that failed. For GCC
1373 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
1374 GCC warning about yyerrlab1 being unused if YYERROR is unused.
1375 (yyerrlab2): New label, which yyerrlab now falls through to.
1376 Compute the error's location by applying YYLLOC_DEFAULT to
1377 the locations of all the symbols that went into the error.
1378 * doc/bison.texinfo (Location Default Action): Mention that
1379 YYLLOC_DEFAULT is also invoked for syntax errors.
1380 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1381 Error locations include the locations of all the tokens that were
1382 discarded, not just the last token.
1384 2002-12-26 Paul Eggert <eggert@twinsun.com>
1386 * src/files.c: Include quote.h.
1387 (compute_output_file_names): Warn if we detect conflicting
1388 outputs to the same file. This should catch the misunderstanding
1389 exemplified by Debian Bug 165349, reported by Bruce Stephens..
1391 * src/conflicts.c (conflicts_print): If the user specifies
1392 "%expect N", report an error if there are any reduce/reduce
1393 conflicts. This is what the manual says should happen.
1394 This fixes Debian bug 130890, reported by Anthony DeRobertis.
1395 * tests/conflicts.at (%expect with reduce conflicts): New test.
1397 Don't use m4_include on relative file names, as it doesn't work as
1398 desired if there happens to be a file with that name under ".".
1400 * m4sugar/version.m4: Remove; it was included but it wasn't used.
1401 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
1402 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
1403 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
1404 * src/output.c (output_skeleton): Use full path names when
1405 specifying a file to include; don't rely on include path, as
1406 it's unreliable when the working file contains a file with
1409 2002-12-25 Paul Eggert <eggert@twinsun.com>
1411 Remove obsolete references to bison.simple and bison.hairy.
1412 Problem mentioned by Aubin Mahe in
1413 <http://mail.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
1414 * data/glr.c: Comment fix.
1415 * doc/bison.1: Remove references. Also, mention "yacc".
1417 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
1420 * src/parse-gram.y (declaration): Use enum "report_states" rather
1421 than its numeric value 1.
1423 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
1424 opening a new one. This fixes Debian bug 165349, reported by
1427 2002-12-24 Paul Eggert <eggert@twinsun.com>
1431 * Makefile.maint (cvs-update): Don't assume that the shell
1432 supports $(...), as Solaris sh doesn't.
1434 * src/parse-gram.y (lloc_default): Remove test for empty
1435 nonterminals at the end, since it didn't change the result.
1437 2002-12-24 Paul Eggert <eggert@twinsun.com>
1439 If the user does not define YYSTYPE as a macro, Bison now declares it
1440 using typedef instead of defining it as a macro. POSIX requires this.
1441 For consistency, YYLTYPE is also declared instead of defined.
1443 %union directives can now have a tag before the `{', e.g., the
1444 directive `%union foo {...}' now generates the C code
1445 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
1446 The default union tag is `YYSTYPE', for compatibility with Solaris 9
1447 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
1448 instead of `yyltype'.
1450 `yystype' and `yyltype' are now obsolescent macros instead of being
1451 typedefs or tags; they are no longer documented and will be
1452 withdrawn in a future release.
1454 * data/glr.c (b4_location_type): Remove.
1455 (YYSTYPE): Renamed from yystype.
1456 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
1457 (struct YYLTYPE): Renamed from struct yyltype.
1458 (YYLTYPE): Renamed from yyltype.
1459 (yyltype, yystype): New (and obsolescent) macros,
1460 for backward compatibility.
1461 * data/yacc.c: Likewise.
1463 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
1464 does not specify a union tag. This is for compatibility with
1467 * src/parse-gram.y (add_param): 2nd arg is now char * not char
1468 const *, since it is now modified by stripping surrounding { }.
1469 (current_braced_code): Remove.
1470 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
1471 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
1472 trailing " {...}". Now of type <chars>.
1473 (grammar_declaration): Adjust to bundled tokens.
1474 (code_content): Remove; stripping is now done by add_param.
1475 (print_token_value): Print contents of bundled tokens.
1476 (token_name): New function.
1478 * src/reader.h (braced_code, current_braced_code): Remove.
1479 (token_name): New decl.
1481 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
1482 token_type, not braced_code code_kind. All uses changed.
1483 (SC_PRE_CODE): New state, for scanning after a keyword that
1484 has (or usually has) an immediately-following braced code.
1485 (token_type): New local var, to keep track of which token type
1486 to return when scanning braced code.
1487 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
1488 <INITIAL>"%parse-param", <INITIAL>"%printer",
1489 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
1490 instead of returning a token type immediately.
1491 (<INITIAL>"{"): Set token type.
1492 (<SC_BRACED_CODE>"}"): Use it.
1493 (handle_action_dollar, handle_action_at): Now returns bool
1494 indicating success. Fail if ! current_rule; this prevents a core dump.
1495 (handle_symbol_code_dollar, handle_symbol_code_at):
1496 Remove; merge body into caller.
1497 (handle_dollar, handle_at): Complain in invalid contexts.
1499 * NEWS, doc/bison.texinfo: Document the above.
1500 * NEWS: Fix years and program names in copyright notice.
1502 2002-12-17 Paul Eggert <eggert@twinsun.com>
1504 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
1505 Reporting, Table of Symbols): Omit mentions of %lex-param and
1506 %parse-param from the documentation for now.
1508 2002-12-15 Paul Eggert <eggert@twinsun.com>
1510 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
1511 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
1512 lookahead symbol, and which sets yychar in parser actions) and it
1513 disagreed with the Bison documentation. Bug
1514 reported by Andrew Walrond.
1516 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
1517 as the caller now does that.
1518 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
1519 (YYEMPTY): Parenthesize right hand side, since others use it.
1520 (yyparse): Don't assume that our generated code is the only code
1523 2002-12-13 Paul Eggert <eggert@twinsun.com>
1527 POSIX requires a "yacc" command.
1528 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
1529 (MOSTLYCLEANFILES): Add yacc.
1531 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
1532 as an alias for bison y.
1534 * po/LINGUAS: Add da.
1536 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
1537 problem with latest <getopt.h>.
1538 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
1540 * doc/fdl.texi: Upgrade to 1.2.
1541 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
1542 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
1543 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
1545 * config/install-sh: Sync with autotools.
1547 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
1548 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
1549 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
1550 locations are requested.
1551 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
1552 locations are requested.
1554 2002-12-12 Paul Eggert <eggert@twinsun.com>
1556 Remove unportable casts and storage allocation tricks.
1557 While we're at it, remove almost all casts, since they
1558 usually aren't needed and are a sign of trouble.
1560 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
1562 * src/derives.c (derives_compute): Do not subtract NTOKENS from
1563 the pointer DSET returned by malloc; this isn't portable.
1564 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
1565 Similarly for DERIVES.
1566 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
1567 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
1568 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
1570 * src/derives.c (derives_compute): Do not bother invoking
1571 int_of_rule_number, since rule numbers are integers.
1573 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
1574 rather than XMALLOC (char, N).
1576 * src/files.c (filename_split): Rewrite to avoid cast.
1578 * src/gram.h (symbol_number_as_item_number,
1579 item_number_as_symbol_number, rule_number_as_item_number,
1580 item_number_as_rule_number):
1581 Now inline functions rather than macros, to avoid casts.
1582 * src/state.h (state_number_as_int): Likewise.
1583 * src/tables.c (state_number_to_vector_number,
1584 symbol_number_to_vector_number): Likewise.
1586 * src/gram.h (int_of_rule_number): Remove; no longer used.
1588 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
1589 since the resulting storage is always stored into.
1591 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
1594 * src/muscle_tab.c (muscle_m4_output):
1595 Now inline. Return bool, not int.
1596 * src/state.c (state_compare): Likewise.
1597 * src/symtab.c (symbol_check_defined,
1598 symbol_check_alias_consistency, symbol_pack, symbol_translation,
1599 hash_compare_symbol, hash_symbol):
1601 * src/uniqstr.c (uniqstr_print): Likewise.
1602 * src/muscle_tab.c (muscle_m4_output_processor):
1603 New function, to avoid casts.
1604 * src/state.c (state_comparator, stage_hasher): Likewise.
1605 * src/symtab.c (symbol_check_defined_processor,
1606 symbol_check_alias_consistency_processor, symbol_pack_processor,
1607 symbol_translation_processor, hash_symbol_comparator,
1608 hash_symbol_hasher): Likewise.
1609 * src/uniqstr.c (uniqstr_print_processor): Likewise.
1610 * src/muscle_tab.c (muscles_m4_output):
1611 Use new functions instead of casting old functions unportably.
1612 * src/state.c (state_hash_new): Likewise.
1613 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
1614 symbols_token_translations_init):
1616 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
1618 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
1619 var instead of casting to long, to avoid casts.
1620 (prepare_states): Use MALLOC rather than alloca, so that we don't
1621 have to worry about alloca.
1622 * src/state.c (state_hash_lookup): Likewise.
1624 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
1625 local var instead of casting to unsigned char, to avoid casts.
1627 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
1628 STATE_ALLOC): Remove.
1629 (transitions_new, errs_new, reductions_new, state_new): Use malloc
1630 rather than calloc, and use offsetof to avoid allocating slightly
1632 (state_new): Initialize all members.
1634 * src/state.c (state_hash): Use unsigned accumulator, not signed.
1636 * src/symtab.c (symbol_free): Remove; unused.
1637 (symbol_get): Remove cast in lhs of assignment.
1638 (symbols_do): Now static. Accept generic arguments, not
1639 hashing-related ones.
1641 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
1642 (symbol_processor): Remove.
1643 (symbols_do): Remove decl; now static.
1645 * src/system.h (alloca): Remove; decl no longer needed.
1646 (<stddef.h>): Include, for offsetof.
1647 (<inttypes.>, <stdint.h>): Include if available.
1648 (uintptr_t): New type, if system lacks it.
1649 (CALLOC, MALLOC, REALLOC): New macros.
1650 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
1653 * src/tables.c (table_size): Now int, to pacify GCC.
1654 (table_grow, table_ninf_remap): Use signed table size.
1655 (save_row): Don't bother initializing locals when not needed.
1656 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
1657 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
1659 * src/vcg.h: Correct misspellings.
1661 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
1664 * src/getargs.c (getargs): Don't assume EOF == -1.
1666 2002-12-09 Paul Eggert <eggert@twinsun.com>
1668 Change identifier spellings to avoid collisions with names
1669 that are reserved by POSIX.
1671 Don't use names ending in _t, since POSIX reserves them.
1672 For consistency, remove _e and _s endings -- they're weren't
1673 needed to remove ambiguity. All uses changed.
1674 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
1675 turn was just renamed from struniq_t.
1676 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
1677 which in turn was just renamed from struniq_processor_t.
1678 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
1679 in turn was renamed from hash_compare_struniq_t.
1680 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
1681 (state_list): Renamed from state_list_t.
1682 * src/assoc.h (assoc): Renamed from assoc_t.
1683 * src/conflicts.c (enum conflict_resolution): Renamed from
1684 enum conflict_resolution_e.
1685 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
1686 (rule_list): Renamed from rule_list_t.
1687 * src/getargs.h (enum trace): Renamed from enum trace_e.
1688 (enum report): Renamed from enum report_e.
1689 * src/gram.h (item_number): Renamed from item_number_t.
1690 (rule_number): Renamed from rule_number_t.
1691 (struct rule_s): Remove the "rule_s" part; not used.
1692 (rule): Renamed from rule_t.
1693 (rule_filter): Renamed from rule_filter_t.
1694 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
1695 (goto_list): Renamed from goto_list_t.
1696 * src/lalr.h (goto_number): Renamed from goto_number_t.
1697 * src/location.h (location): Renamed from location_t.
1698 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
1699 and moved here from:
1700 * src/muscle_tab.h (muscle_entry_t): here.
1701 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
1702 (rule_list): Renamed from rule_list_t.
1703 * src/print_graph.c (static_graph): Renamed from graph.
1704 * src/reader.h (braced_code): Renamed from braced_code_t.
1705 Remove brace_code_e tag.
1706 * src/relation.h (relation_node): Renamed from relation_node_t.
1707 (relation_nodes): Renamed from relation_nodes_t.
1708 (relation): Renamed from relation_t.
1709 * src/state.h (state_number): Renamed from state_number_t.
1710 (struct state): Renamed from struct state_s.
1711 (state): Renamed from state_t.
1712 (transitions): Renamed from transitions_t. Unused (and
1713 misspelled) transtion_s tag removed.
1714 (errs): Renamed from errs_t. Unused errs_s tag removed.
1715 (reductions): Renamed from reductions_t. Unused tag
1716 reductions_s removed.
1717 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
1718 (struct symbol_list): Renamed from struct symbol_list_s.
1719 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
1720 (struct symbol): Renamed from struct symbol_s.
1721 (symbol): Renamed from symbol_t.
1722 * src/tables.c (vector_number): Renamed from vector_number_t.
1723 (action_number): Renamed from action_t.
1724 * src/tables.h (base_number): Renamed from base_t.
1725 * src/vcg.h (enum color): Renamed from enum color_e.
1726 (enum textmode): Renamed from enum textmode_e.
1727 (enum shape): Renamed from enum shape_e.
1728 (struct colorentry): Renamed from struct colorentry_s.
1729 (struct classname): Renamed from struct classname_s.
1730 (struct infoname): Renamed from struct infoname_s.
1731 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
1732 (enum decision): Renamed from enum decision_e.
1733 (enum orientation): Renamed from enum orientation_e.
1734 (enum alignment): Renamed from enum alignment_e.
1735 (enum arrow_mode): Renamed from enum arrow_mode_e.
1736 (enum crossing_type): Renamed from enum crossing_type_e.
1737 (enum view): Renamed from enum view_e.
1738 (struct node): Renamed from struct node_s.
1739 (node): Renamed from node_t.
1740 (enum linestyle): Renamed from enum linestyle_e.
1741 (enum arrowstyle): Renamed from enum arrowstyle_e.
1742 (struct edge): Renamed from struct edge.
1743 (edge): Renamed from edge_t.
1744 (struct graph): Renamed from struct graph_s.
1745 (graph): Renamed from graph_t.
1746 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
1747 Rename value_t -> value.
1748 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
1749 value_t_as_yystype -> value_as_yystype.
1751 Don't include <errno.h> in the mainstream code, since it
1752 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
1753 * lib/get-errno.c, lib/get-errno.h: New files.
1754 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
1756 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
1757 * src/output.c (output_skeleton): Likewise.
1758 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
1760 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
1762 (handle_action_dollar, handle_action_at): Likewise.
1763 * src/system.h: Do not include <errno.h>.
1764 (TAB_EXT): Renamed from EXT_TAB.
1765 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
1767 Avoid str[a-z]*, since <string.h> reserves that name space.
1768 Change all instances of "struniq" in names to "uniqstr", and
1769 likewise for "STRUNIQ" and "UNIQSTR".
1770 * src/uniqstr.c: Renamed from src/struniq.c.
1771 * src/uniqstr.h: Renamed from src/struniq.h.
1772 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
1773 * src/files.c (strsuffix): Remove; unused.
1774 (concat2): Renamed from stringappend. Now static.
1775 * src/files.h (strsuffix, stringappend): Remove; unused.
1776 * src/parse-gram.y (<chars>): Renamed from <string>.
1777 (<uniqstr>): Renamed from <struniq>.
1778 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
1779 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
1780 (struct graph_s.expand): Renamed from struct graph_s.stretch.
1781 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
1782 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
1783 (N_EXPAND): Renamed from N_STRETCH.
1785 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
1786 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
1787 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
1789 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
1790 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
1791 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
1792 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
1793 (BASE_MAXIMUM): Renamed from BASE_MAX.
1794 (BASE_MINIMUM): Renamed from BASE_MIN.
1795 (ACTION_MAX): Remove; unused.
1796 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
1797 Unnecessary casts removed from above defines.
1800 Fix misspelling in names.
1801 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
1802 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
1806 * lib/timevar.c (timevar_report): Renamed from time_report,
1807 for consistency with other names.
1808 * lib/timevar.h (timevar_report): New decl.
1809 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
1812 Sort include-file uses.
1814 Reorder all include files under src to be in the order "system.h".
1815 then the ../lib include files in angle brackets (alphabetized),
1816 then the . include files in double-quotes (alphabetized). Fix
1817 dependency breakages encountered in this process, as follows:
1818 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
1819 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
1820 * src/state.h: Include "symtab.h".
1822 2002-12-08 Paul Eggert <eggert@twinsun.com>
1824 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
1825 since this causes problems when __file__ contains character
1826 sequences like "@" that are treated specially by src/scan-skel.l.
1827 Instead, just use the file's basename. This fixes the bug
1828 reported by Martin Mokrejs in
1829 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
1831 2002-12-06 Paul Eggert <eggert@twinsun.com>
1833 Add support for rules that do not have trailing semicolons, as
1834 POSIX requires. Improve the quality of locations in Bison
1837 * src/location.c: Include <quotearg.h>.
1838 (empty_location): Now const.
1839 (location_print): New function. Follow the recommendation of the
1840 GNU Coding Standards for locations that span file boundaries.
1841 * src/location.h: Do not include <quotearg.h>; no longer needed.
1842 (boundary): New type.
1843 (location_t): Use it. This allows locations to span file boundaries.
1844 All member uses changed: file -> start.file or end.file (as needed),
1845 first_line -> start.line, first_column -> start.column,
1846 last_line -> end.line, last_column -> end.column.
1847 (equal_boundaries): New function.
1848 (LOCATION_RESET, LOCATION_STEP): Remove.
1849 (LOCATION_PRINT): Remove. All callers changed to use location_print.
1850 (empty_location): Now const.
1851 (location_print): New decl.
1852 * src/parse-gram.y (lloc_default): New function, which handles
1853 empty locations more accurately.
1854 (YYLLOC_DEFAULT): Use it.
1855 (%token COLON): Remove.
1856 (%token ID_COLON): New token.
1858 (declarations, rules): Remove trailing semicolon.
1859 (declaration, rules_or_grammar_declaration):
1860 Allow empty (";") declaration.
1861 (symbol_def): Remove empty actions; no longer needed.
1862 (rules_or_grammar_declaration): Remove trailing semicolon.
1863 (semi_colon.opt): Remove.
1864 * src/reader.h: Include location.h.
1865 (scanner_cursor): New decl.
1866 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
1868 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
1870 (STEP): Remove. No longer needed, now that adjust_location does
1871 the work. All uses removed.
1872 (scanner_cursor): New var.
1873 (adjust_location): Renamed from extend_location. It now sets
1874 *loc and adjusts the scanner cursor. All uses changed.
1875 Don't bother testing for CR.
1876 (handle_syncline): Remove location arg; now updates scanner cursor.
1877 All callers changed.
1878 (unexpected_end_of_file): Now accepts start boundary of token or
1879 comment, not location. All callers changed. Update scanner cursor,
1881 (SC_AFTER_IDENTIFIER): New state.
1882 (context_state): Renamed from c_context. All uses changed.
1883 (id_loc, code_start, token_start): New local vars.
1884 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
1885 processing of Yacc white space and equivalents here.
1886 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
1887 instead of returning ID immediately, since we need to search for
1889 (<INITIAL>"'", "\""): Save token_start.
1890 (<INITIAL>"%{", "{", "%%"): Save code_start.
1891 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
1892 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
1893 BEGIN context_state at end, not INITIAL.
1894 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
1895 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
1896 Return correct token start.
1897 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
1898 the start of a character, string or multiline comment is found.
1899 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
1900 Reduction): Adjust reported locations to match the more-precise
1901 results now expected.
1902 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
1903 * tests/reduce.at (Useless Rules, Reduced Automaton,
1904 Underivable Rules): Likewise.
1905 * tests/regression.at (Invalid inputs): No longer `expecting ";"
1906 or "|"' now that so many other tokens are allowed by the new grammar.
1908 * src/complain.h (current_file): Remove duplicate decl;
1909 current_file is now owned by files.h.
1910 * src/complain.c, src/scan-gram.l: Include files.h.
1912 2002-12-06 Paul Eggert <eggert@twinsun.com>
1914 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
1915 promotes to int; it might be unsigned int.
1916 * data/yacc.c (yy_reduce_print): Likewise.
1918 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
1919 be #defined in the prologue, not in the Bison declarations.
1920 This fixes Debian Bug 102878, reported by Shaul Karl.
1922 2002-12-02 Paul Eggert <eggert@twinsun.com>
1924 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
1925 * lib/strtoul.c: New file, from gnulib.
1926 This fixes a porting bug reported by Peter Klein in
1927 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
1929 2002-11-30 Paul Eggert <eggert@twinsun.com>
1931 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
1932 and put only a forward declaration in the prologue. This is for
1933 consistency with the other scanner helper functions.
1935 Type clashes now generate warnings, not errors, since it
1936 appears that POSIX may allow some grammars with type clashes.
1937 * src/reader.c (grammar_current_rule_check): Warn about
1938 type clashes instead of complaining.
1939 * tests/input.at (Type Clashes): Expect warnings, not complaints.
1941 Add Yacc library, since POSIX requires it.
1942 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
1943 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
1944 * lib/main.c, lib/yyerror.c: New files.
1946 gram_error can be static; it need not be extern.
1947 * src/reader.h (gram_error): Remove decl.
1948 * src/parse-gram.y (gram_error): Now static. Add static decl.
1949 (print_token_value): Omit parameter names from forward decl,
1952 2002-11-29 Paul Eggert <eggert@twinsun.com>
1954 * doc/bison.texinfo: Emphasize that yylex and yyerror must
1955 be declared before being used. E.g., one should typically
1956 declare them in the prologue. Use GNU coding style in examples.
1957 Put "const" consistently after the type it modifies. Mention
1958 that C99 supports "inline". Mention that yyerror traditionally
1961 %parse-param and %lex-param now take just one argument, the
1962 declaration; the argument name is deduced from the declaration.
1964 * doc/bison.texinfo (Parser Function, Pure Calling, Error
1965 Reporting, Table of Symbols): Document this.
1966 * src/parse-gram.y (add_param): New function.
1968 (declaration): Implement new rule for %parse-param and %lex-param.
1969 * src/scan-gram.l: "," now elicits a warning, rather than being
1970 a token; this is more compatible with byacc.
1971 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
1973 2002-11-27 Paul Eggert <eggert@twinsun.com>
1975 Rename identifiers to avoid real and potential collisions.
1977 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
1978 to avoid collision with lex macro described by Bruce Lilly in
1979 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
1980 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
1981 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
1982 * src/parse-gram.y (print_token_value): Renamed from yyprint.
1984 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
1985 The name "yycontrol" violates the name space rules, and this stuff
1986 wasn't being used anyway.
1987 (input): Remove action; this stuff wasn't being used.
1988 (gram_error): Rename local variable yylloc -> loc.
1989 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
1990 (YY_DECL): Don't use "yy" at start of local variables.
1991 All uses changed, e.g., yylloc -> loc.
1992 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
1993 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
1994 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
1995 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
1997 * src/parse-gram.y (gram_error): loc is now const *.
1998 * src/reader.h (gram_error): Likewise.
2000 2002-11-24 Paul Eggert <eggert@twinsun.com>
2004 * tests/actions.at (Actions after errors): Use an output format
2005 more similar to that of the Printers and Destructors test.
2006 Test the position of the ';' token too.
2007 (Printers and Destructors): Likewise.
2008 (Printers and Destructors: %glr-parser): Remove for now, to avoid
2009 unnecessarily alarming people when the test fails.
2011 * data/yacc.c (yyerrlab1): Move this label down, so that the
2012 parser does not discard the lookahead token if the user code
2013 invokes YYERROR. This change is required for POSIX conformance.
2015 * lib/error.c: Sync with gnulib.
2017 2002-11-22 Paul Eggert <eggert@twinsun.com>
2019 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
2020 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
2021 * lib/xmalloc.c: Likewise.
2023 2002-11-20 Paul Eggert <eggert@twinsun.com>
2025 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
2027 2002-11-20 Paul Eggert <eggert@twinsun.com>
2029 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
2030 should use `if (! x) abort ();' rather than `assert (x);', and
2031 anyway it's one less thing to worry about configuring.
2033 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
2034 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
2035 and replace all instances of assert with abort.
2036 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
2037 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
2039 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
2040 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
2041 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
2042 hash_find_entry, hash_rehash, hash_insert): Likewise.
2043 * src/conflicts.c (resolve_sr_conflict): Likewise.
2044 * src/lalr.c (set_goto_map, map_goto): Likewise.
2045 * src/nullable.c (nullable_compute): Likewise.
2046 * src/output.c (prepare_rules, token_definitions_output): Likewise.
2047 * src/reader.c (packgram, reader): Likewise.
2048 * src/state.c (state_new, state_free, state_transitions_set,
2049 state_reduction_find): Likewise.
2050 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
2051 symbol_pack): Likewise.
2052 * src/tables.c (conflict_row, pack_vector): Likewise.
2053 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
2054 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
2055 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
2056 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
2058 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
2059 (ARGMATCH_CONSTRAINT): New macro.
2060 (ARGMATCH_ASSERT): Use it.
2062 * src/system.h (verify): New macro.
2063 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
2065 * src/tables.c (tables_generate): Likewise.
2067 * src/struniq.c (struniq_assert): Now returns void, and aborts
2068 if the assertion is false.
2069 (struniq_assert_p): Remove.
2070 * src/struniq.h: Likewise.
2072 2002-11-18 Paul Eggert <eggert@twinsun.com>
2074 * data/glr.c (yygetLRActions): Replace `yyindex' with
2075 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
2076 This fixes the regression with Sun ONE Studio 7 cc that I reported in
2077 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
2079 2002-11-18 Akim Demaille <akim@epita.fr>
2081 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
2083 From Tim Van Holder.
2085 2002-11-17 Paul Eggert <eggert@twinsun.com>
2087 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
2088 to "SyntaxError" for consistency with my 2002-11-15 change.
2090 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
2091 not define to {}, since this breaks the common use of `YYDPRINTF
2092 ((...));' if a single statement is desired (e.g. before `else').
2093 Work around GCC warnings by surrounding corresponding calls with
2095 (yyhasResolvedValue): Remove unused function.
2096 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
2098 (yyreportSyntaxError): Renamed from yyreportParseError.
2099 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
2101 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
2102 extern when possible. Remove unused initializations.
2104 2002-11-16 Akim Demaille <akim@epita.fr>
2106 Augment the similarity between GLR and LALR traces.
2108 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
2109 (YY_REDUCE_PRINT): New.
2110 (yyparse): Use them.
2111 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
2113 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
2114 state reached after the reduction/recovery, since...
2115 (yyparse, yyprocessOneStack): Report the state we are entering in.
2117 2002-11-16 Akim Demaille <akim@epita.fr>
2119 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
2120 Add support for --trace=skeleton.
2121 * src/scan-skel.l: %option debug.
2122 Scan strings of non-@ or \n instead of character by character.
2123 (scan_skel): Handle trace_skeleton.
2125 (@output_parser_name@, @output_header_name@): ``Restore'' their
2126 support (used to be M4 macros).
2127 * data/yacc.c: Quote larger chunks, a la glr.c.
2128 * data/lalr1.cc: Likewise.
2129 The header guards are no longer available, so use some other
2130 string than `YYLSP_NEEDED'.
2132 2002-11-16 Akim Demaille <akim@epita.fr>
2134 Make the ``Printers and Destructors'' test more verbose, taking
2135 `yacc.c''s behavior as (possibly wrong) reference.
2137 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
2138 instead of fprint on stdout.
2139 Set and report the last_line of the symbols.
2140 Consistently display values and locations.
2142 2002-11-16 Paul Eggert <eggert@twinsun.com>
2144 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
2146 2002-11-15 Paul Eggert <eggert@twinsun.com>
2148 * tests/actions.at (Actions after errors): New test case.
2150 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
2151 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
2152 tests/action.at, tests/calc.at, tests/conflicts.at,
2153 tests/cxx-type.at, tests/regression.at:
2154 "parse error" -> "syntax error" for POSIX compatibility.
2155 "parsing stack overflow..." -> "parser stack overflow" so
2156 that code matches Bison documentation.
2158 2002-11-15 Akim Demaille <akim@epita.fr>
2160 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
2161 take two BRACED_CODE, not two string_content.
2162 Free the scanner's obstack when we are done.
2163 (code_content): New.
2164 * tests/calc.at: Adjust.
2165 * doc/bison.texinfo: Adjust.
2166 Also, make sure to include the `,' for these declarations.
2168 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
2170 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
2171 definition; avoids potential autoreconf problems.
2173 2002-11-15 Akim Demaille <akim@epita.fr>
2175 Always check the value returned by yyparse.
2177 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
2178 returned by yyparse.
2179 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
2181 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
2182 returned by yyparse.
2184 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2186 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
2189 2002-11-14 Paul Eggert <eggert@twinsun.com>
2191 * src/output.c (output_skeleton): Call xfopen instead of
2192 duplicating xfopen's body.
2194 Fix bugs reported by Nelson H. F. Beebe in
2195 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
2197 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
2198 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
2199 Group compiler. Instead, use "$CC -E bar.c". Include the .h
2200 file twice in the grammar, as an extra check.
2202 * tests/input.at (Torturing the Scanner): Surround the
2203 backslash-newline tests with "#if 0", to make it less likely that
2204 we'll run into compiler bugs. Bring back solitary \ inside
2205 comment, but add a closing comment to work around HP C bug. Don't
2206 test backslash-newline in C character constant.
2208 2002-11-14 Akim Demaille <akim@epita.fr>
2210 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
2211 status of the compiler.
2212 Calling `exit 1' is no longer needed.
2213 Reported by Nelson H. F. Beebe.
2215 2002-11-14 Akim Demaille <akim@epita.fr>
2217 * tests/atlocal.in (CPPFLAGS): We have config.h.
2218 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
2220 * tests/actions.at, tests/calc.at, tests/conflicts.at,
2221 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
2222 * tests/regression.at, tests/torture.at: Use them for all the
2223 grammars that are to be compiled.
2224 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
2225 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
2226 * doc/bison.texinfo (GLR Parsers): Document `inline'.
2228 2002-11-14 Akim Demaille <akim@epita.fr>
2230 * doc/bison.texinfo: Various formatting changes (alignments in
2231 samples, additional @group/@end group, GCS in samples.
2232 Use @deffn instead of simple @table to define the directives,
2233 macros, variables etc.
2235 2002-11-13 Paul Eggert <eggert@twinsun.com>
2237 Fix some bugs reported by Albert Chin-A-Young in
2238 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
2240 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
2241 -o c"; the HP C compiler chatters during compilation.
2242 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2243 * tests/headers.at (export YYLTYPE): Likewise.
2245 * tests/input.at (Torturing the Scanner): Remove lines containing
2246 solitary backslashes, as they tickle a bug in the HP C compiler.
2248 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
2249 comments, since they're not portable. Use GNU coding style.
2251 2002-11-13 Akim Demaille <akim@epita.fr>
2253 * data/yacc.c: Leave bigger chunks of quoted text.
2254 (YYDSYMPRINTF): New.
2255 Use it to report symbol activities.
2256 * data/glr.c (YYDSYMPRINTF): New.
2259 2002-11-12 Paul Eggert <eggert@twinsun.com>
2263 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
2264 (yyglrReduce): Return yyok, not 0.
2265 This should avoid the enumerated-type warnings reported
2266 by Nelson H. F. Beebe in
2267 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
2269 * lib/bbitset.h (BITSET_INLINE): Remove.
2270 * lib/bitset.h [! BITSET_INLINE]: Remove.
2271 (bitset_set, bitset_reset, bitset_test): Rename local vars
2272 to avoid shadowing warnings by GCC.
2274 * data/glr.c (inline): Remove #define. It's the user's
2275 responsibility to #define it away, just like 'const'.
2276 This fixes one of the bugs reported by Nelson H. F. Beebe in
2277 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
2279 * Makefile.maint (po-check): Scan .l and .y files instead of the
2280 .c and the .h files that they generate. This fixes the bug
2281 reported by Tim Van Holder in:
2282 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
2283 Look for N_ as well as for _. Try to avoid matching #define for
2285 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
2286 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
2287 * src/scan-gram.l: Revamp regular expressions so that " and '
2288 do not confuse xgettext.
2290 * src/struniq.h (struniq_new): Do not declare the return type
2291 to be 'const'; this violates the C standard.
2292 * src/struniq.c (struniq_new): Likewise.
2294 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
2296 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
2297 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
2300 2002-11-12 Akim Demaille <akim@epita.fr>
2302 * Makefile.maint: Sync with Autoconf:
2303 (local_updates): New.
2305 2002-11-12 Akim Demaille <akim@epita.fr>
2307 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
2309 2002-11-12 Akim Demaille <akim@epita.fr>
2311 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
2314 2002-11-12 Akim Demaille <akim@epita.fr>
2316 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
2319 2002-11-12 Akim Demaille <akim@epita.fr>
2321 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
2322 Use it to test the GLR parser.
2324 2002-11-12 Akim Demaille <akim@epita.fr>
2326 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
2328 * data/glr.c (yystos): New.
2329 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
2331 (yyval): Don't define it, it is handled via M4.
2332 (yyrecoverParseError): Free verbosely the discarded symbols.
2333 * data/yacc.c (yysymprint): Remove, rather...
2334 (b4_yysymprint_generate): invoke.
2335 * data/c.m4 (b4_yysymprint_generate): New.
2336 Accept pointers as arguments, as opposed to the version from
2338 (b4_yydestruct_generate): Likewise.
2339 * tests/cations.at (Printers and Destructors): Use Bison directives
2340 instead of CPP macros.
2341 Don't rely on internal details.
2343 2002-11-12 Akim Demaille <akim@epita.fr>
2345 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
2346 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
2347 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
2348 it against YYEMPTY and so forth), work on yytoken (i.e., set
2349 it to YYEMPTY etc.).
2350 (yydestruct): Replace with a b4_yydestruct_generate invocation.
2351 (b4_symbol_actions): Remove.
2352 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
2353 for 0, end-of-input.
2355 2002-11-12 Akim Demaille <akim@epita.fr>
2357 * doc/bison.texinfo (Destructor Decl): New.
2359 2002-11-12 Akim Demaille <akim@epita.fr>
2361 * src/tables.c (tables_generate): Use free for pointers that
2362 cannot be NULL, not XFREE.
2363 (pack_vector): Use assert, not fatal, for bound violations.
2364 * src/state.c (state_new): Likewise.
2365 * src/reader.c (reader): Likewise.
2366 * src/lalr.c (set_goto_map): Likewise.
2367 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
2370 2002-11-12 Akim Demaille <akim@epita.fr>
2372 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
2374 * src/scan-gram.l (last_string): Is global to the file, not to
2376 * src/parse-gram.y (input): Don't append the epilogue here,
2377 (epilogue.opt): do it here, and free the scanner's obstack.
2378 * src/reader.c (epilogue_set): Rename as...
2379 (epilogue_augment): this.
2380 * data/c.m4 (b4_epilogue): Defaults to empty.
2382 2002-11-12 Akim Demaille <akim@epita.fr>
2384 * src/getargs.c (long_options): Remove duplicates.
2385 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
2387 * doc/bison.rnh: Remove.
2388 * doc/bison.texinfo (VMS Invocation): Remove.
2390 2002-11-12 Akim Demaille <akim@epita.fr>
2392 * src/struniq.h, src/struniq.c (struniq_t): Is const.
2393 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
2395 Use struniq for symbols.
2397 * src/symtab.h (symbol_t): The tag member is a struniq.
2398 (symbol_type_set): Adjust.
2399 * src/symtab.c (symbol_new): Takes a struniq.
2400 (symbol_free): Don't free the tag member.
2401 (hash_compare_symbol_t, hash_symbol_t): Rename as...
2402 (hash_compare_symbol, hash_symbol): these.
2403 Use the fact that tags as struniqs.
2404 (symbol_get): Use struniq_new.
2405 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
2407 * src/reader.h (merger_list, grammar_currentmerge_set): The name
2408 and type members are struniqs.
2409 * src/reader.c (get_merge_function)
2410 (grammar_current_rule_merge_set): Adjust.
2411 (TYPE, current_type): Are struniq.
2413 Use struniq for file names.
2415 * src/files.h, src/files.c (infile): Split into...
2416 (grammar_file, current_file): these.
2417 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
2418 * src/reduce.c (reduce_print): Likewise.
2419 * src/getargs.c (getargs): Likewise.
2420 * src/complain.h, src/complain.c: Likewise.
2421 * src/main.c (main): Call struniqs_new early enough to use it for
2423 Don't free the input file name.
2425 2002-11-12 Akim Demaille <akim@epita.fr>
2427 * src/symtab.c (symbol_free): Remove dead deactivated code:
2428 type_name are properly removed.
2429 Don't use XFREE to free items that cannot be NULL.
2430 * src/struniq.h, src/struniq.c: New.
2431 * src/main.c (main): Initialize/free struniqs.
2432 * src/parse-gram.y (%union): Add astruniq member.
2434 * src/scan-gram.l (<{tag}>): Return a struniq.
2435 Free the obstack bit that used to store it.
2436 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
2438 2002-11-11 Paul Eggert <eggert@twinsun.com>
2440 Revamp to fix many (but not all) of the C- and M4-related quoting
2441 problems. Among other things, this fixes the Bison bug reported
2442 by Jan Hubicka when processing the Bash grammar; see:
2443 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
2445 Use new @ escapes consistently. Represent brackets with @{ and @}
2446 rather than @<:@ and @:>@, since this works a bit better with dumb
2447 editors like vi. Represent @ with @@, since @ is now consistently
2448 an escape. Use @oline@ and @ofile@ rather than __oline__ and
2449 __ofile__, to avoid unexpected expansions. Similarly, use @output
2450 rather than #output.
2452 * data/c.m4 (b4_copyright): Omit file name from comment, since
2453 the file name could contain "*/".
2454 (b4_synclines_flag): Don't quote the 2nd argument; it should already
2455 be quoted. All uses changed.
2457 * data/glr.c: Use new @ escapes consistently.
2458 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
2459 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
2460 Remove, since they couldn't handle arbitrary characters in file
2462 * data/lalr1.cc: Likewise.
2463 * data/yacc.c: Likewise.
2465 * src/files.c (output_infix): Remove; all uses removed.
2466 * src/files.h: Likewise.
2468 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
2469 mishandled funny characters in file names, and anyway it isn't
2471 * data/yacc.c: Likewise.
2472 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
2474 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
2475 * data/yacc.c: Likewise.
2477 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
2479 (muscle_init): Quote filename as a C string.
2480 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
2481 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
2482 * src/output.c (escaped_file_name_output): New function.
2483 (prepare_symbols): Quote tokens for M4.
2484 (prepare): Don't insert output_infix, output_prefix,
2485 output_parser_name, output_header_name; this is now down by scan-skel.
2486 Insert skeleton as a C string.
2488 * src/output.c (user_actions_output, symbol_destructors_output,
2489 symbol_printers_output): Quote filenames for C and M4.
2490 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2492 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
2493 escapes other than \\ and \'; this simplifies the code.
2494 (<SC_STRING>): Likewise, for \\ and \".
2495 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
2496 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
2497 Use new escapes @{ and @} for [ and ].
2499 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
2500 them with auto vars.
2501 Switch to new escape scheme, where @ is the escape character uniformly.
2502 Abort if a stray escape character is found. Avoid unbounded input
2503 buffer when parsing non-escaped text.
2505 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
2506 __oline__, #output, $@, and @{ do not have unintended meanings.
2508 2002-11-09 Paul Eggert <eggert@twinsun.com>
2510 Fix the test failure due to GCC warnings described in
2511 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
2512 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
2513 evaluate to 0 if it's impossible for NINF to be in the respective
2515 (yygetLRActions, yyrecoverParseError): Use them.
2517 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
2518 counted in the token inserted at end of file. Now takes
2519 location_t *, not location_t, so that the location can be
2520 adjusted. All uses changed.
2522 * tests/regression.at (Invalid inputs): Adjust wording in
2523 diagnostic to match the new behavior.
2525 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
2526 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
2527 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
2528 abort ();'. This reduces the runtime of the "Many lookaheads"
2529 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
2532 2002-11-07 Paul Eggert <eggert@twinsun.com>
2534 * src/parse-gram.y (CHARACTER): Remove unused token.
2537 * src/scan-gram.l: Remove stack option. We no longer use the
2538 stack, since the stack was never deeper than 1; instead, use the
2539 new auto var c_context to record the stacked value.
2541 Remove nounput option. At an unexpected end of file, we now unput
2542 the minimal input necessary to end cleanly; this simplifies the
2545 Avoid unbounded token sizes where this is easy.
2547 (unexpected_end_of_file): New function.
2548 Use it to systematize the error message on unexpected EOF.
2549 (last-string): Now auto, not static.
2550 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
2551 (scanner_last_string_free): Remove; not used.
2552 (percent_percent_count): Move decl to just before use.
2553 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
2554 not the (never otherwised-used) CHARACTER.
2556 2002-11-07 Akim Demaille <akim@epita.fr>
2558 Let yyerror always receive the msg as last argument, so that
2559 yyerror can be variadic.
2561 * data/yacc.c (b4_yyerror_args): New.
2562 Use it when calling yyerror.
2563 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
2564 Use it when calling yyerror.
2565 * doc/bison.texinfo (Error Reporting): Adjust.
2566 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
2567 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
2569 2002-11-06 Akim Demaille <akim@epita.fr>
2571 #line should have quoted strings.
2572 Ideally, this should be done by m4_quotearg.
2574 * src/scan-skel.l: Include quotearg.h.
2576 * src/output.c (symbol_printers_output)
2577 (symbol_destructors_output): Quote the file name.
2579 2002-11-06 Akim Demaille <akim@epita.fr>
2581 * tests/regression.at (Invalid inputs): Adjust to the recent
2584 2002-11-06 Akim Demaille <akim@epita.fr>
2587 Reported by Jim Kent.
2589 * data/c.m4 (b4_syncline): New.
2590 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
2591 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
2592 * src/output.c (user_actions_output): Likewise.
2593 (prepare): Define 'b4_synclines_flag'.
2594 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
2596 2002-11-06 Akim Demaille <akim@epita.fr>
2598 * src/main.c (main): Free `infile'.
2599 * src/scan-gram.l (handle_syncline): New.
2601 * src/output.c (user_actions_output, symbol_destructors_output)
2602 (symbol_printers_output): Use the location's file name, not
2604 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2606 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2608 * src/tables.c (matching_state): Don't allow states to match if
2609 either has GLR conflict entries.
2611 2002-11-05 Paul Eggert <eggert@twinsun.com>
2613 * src/scan-gram.l: Use more accurate diagnostics, e.g.
2614 "integer out of range" rather than "invalid value".
2615 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
2618 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
2619 Also, remove one static variable in the scanner.
2621 * src/scan-gram.l (braces_level): Now auto, not static.
2622 Initialize to zero if the compiler is being picky.
2623 (INITIAL): Clear braces_level instead of incrementing it.
2624 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
2625 as POSIX 1003.1-2001 requires.
2626 * src/system.h (IF_LINT): New macro, taken from coreutils.
2627 * configure.ac: Define "lint" if --enable-gcc-warnings.
2629 2002-11-05 Akim Demaille <akim@epita.fr>
2631 * src/scan-gram.l: When it starts with `%', complain about the
2632 whole directive, not just that `invalid character: %'.
2634 2002-11-04 Akim Demaille <akim@epita.fr>
2636 * Makefile.maint: Update from Autoconf.
2637 (update, cvs-update, po-update, do-po-update): New.
2639 2002-11-04 Akim Demaille <akim@epita.fr>
2641 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
2643 Have yyerror `use' its arguments.
2644 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
2645 returns true when location & yacc & pure & parse-param.
2646 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
2648 2002-11-04 Akim Demaille <akim@epita.fr>
2650 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
2652 * src/scan-gram.l: Use [\'] instead of ['] to pacify
2655 Use quote, not quote_n since LOCATION_PRINT no longer uses the
2658 2002-11-03 Paul Eggert <eggert@twinsun.com>
2660 * src/reader.c (get_merge_function, grammar_current_rule_check):
2661 Use consistent diagnostics for reporting type name clashes.
2662 Quote the types with <>, for consistency with Yacc.
2663 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
2665 2002-11-03 Akim Demaille <akim@epita.fr>
2667 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
2669 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
2670 (b4_parse_param): Remove.
2671 Use b4_identification.
2672 Propagate b4_pure_args where needed to pass them to yyerror.
2673 * data/glr.m4 (b4_parse_param): Remove.
2674 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
2675 (b4_lpure_formals): New.
2676 Use b4_identification.
2677 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
2678 b4_user_formals and b4_user_args.
2679 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
2680 (yyreportAmbiguity): When using a pure parser, also need
2681 the location, and the parse-params.
2683 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
2684 When using a pure parser, also need the parse-params.
2686 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
2687 (%pure-parser + %parse-param) LALR and GLR parsers.
2688 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
2689 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
2690 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
2691 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
2692 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
2693 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
2694 * doc/bison.texinfo: Untabify the whole file.
2695 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
2696 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
2697 (Error Reporting): Adjust to these new directives.
2698 Document %error-verbose, deprecate YYERROR_VERBOSE.
2700 2002-11-03 Akim Demaille <akim@epita.fr>
2702 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
2703 AT_CHECK_CALC_GLR invocations to use % directives, instead of
2704 command line options.
2705 * tests/cxx-type.at: Formatting changes.
2707 2002-11-03 Paul Eggert <eggert@twinsun.com>
2709 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
2710 to count columns correctly, and to check for invalid inputs.
2712 Use mbsnwidth to count columns correctly. Account for tabs, too.
2714 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
2715 (extend_location): New function.
2718 Handle CRLF in C code rather than in Lex code.
2719 (YY_INPUT): New macro.
2720 (no_cr_read): New function.
2722 Scan UCNs, even though we don't fully handle them yet.
2723 (convert_ucn_to_byte): New function.
2725 Handle backslash-newline correctly in C code.
2726 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
2727 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
2729 (tag, splice): New EREs. Do not allow NUL or newline in tags.
2730 Use {splice} wherever C allows backslash-newline.
2731 YY_STEP after space, newline, vertical-tab.
2732 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
2734 (letter, id): Don't assume ASCII; e.g., spell out a-z.
2736 ({int}, handle_action_dollar, handle_action_at): Check for integer
2739 (YY_STEP): Omit trailing semicolon, so that it's more like C.
2741 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
2742 as well as \000. Check for UCHAR_MAX, not 255.
2743 Allow \x with an arbitrary positive number of digits, as in C.
2744 Check for overflow here.
2745 Allow \? and UCNs, for compatibility with C.
2747 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
2748 with quote slot used by complain_at.
2750 * tests/input.at: Add tests for backslash-newline, m4 quotes
2751 in symbols, long literals, and funny escapes in strings.
2753 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
2754 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
2755 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
2756 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
2757 * m4/mbswidth.m4: New file, from GNU coreutils.
2759 * doc/bison.texinfo (Grammar Outline): Document // comments.
2760 (Symbols): Document that trigraphs have no special meaning in Bison,
2761 nor is backslash-newline allowed.
2762 (Actions): Document that trigraphs have no special meaning.
2764 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
2767 2002-11-02 Paul Eggert <eggert@twinsun.com>
2769 * src/reader.c: Don't include quote.h; not needed.
2770 (get_merge_function): Reword warning to be consistent with
2771 type clash diagnostic in grammar_current_rule_check.
2773 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
2774 bug in trigraph handling.
2776 * src/output.c (prepare_symbols): When printing token names,
2777 escape "[" as "@<:@" and likewise for "]".
2779 * src/system.h (errno): Remove declaration, as we are now
2780 assuming C89 or better, and C89 guarantees errno.
2782 2002-10-30 Paul Eggert <eggert@twinsun.com>
2784 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
2785 Check for close failures.
2786 * src/files.h (xfclose): Return void, not int, since it always
2788 * src/files.c (xfclose): Likewise. Report I/O error if ferror
2790 * src/output.c (output_skeleton): Use xfclose rather than fclose
2791 and ferror. xfclose now checks ferror.
2793 * data/glr.c (YYLEFTMOST_STATE): Remove.
2794 (yyreportTree): Use a stack-based leftmost state. This avoids
2795 our continuing battles with bogus warnings about initializers.
2797 2002-10-30 Akim Demaille <akim@epita.fr>
2799 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
2802 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2804 * tests/glr-regr1.at: New test for reported regressions.
2805 * tests/testsuite.at: Add glr-regr1.at test.
2806 * tests/Makefile.am: Add glr-regr1.at test.
2808 2002-10-24 Paul Eggert <eggert@twinsun.com>
2812 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
2813 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
2814 we use malloc. Don't assume 'A' through 'Z' are contiguous.
2815 Don't assume strdup exists; POSIX says its an XSI extension.
2816 Check for buffer overflow on input.
2818 2002-10-24 Akim Demaille <akim@epita.fr>
2820 * src/output.c (output_skeleton): Don't disable M4sugar comments
2821 too soon: it results in comments being expanded.
2822 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
2825 2002-10-24 Akim Demaille <akim@epita.fr>
2827 * data/yacc.c (m4_int_type): New.
2828 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
2829 char' as only yacc.c wants K&R portability.
2830 * data/glr.c (yysigned_char): Remove.
2831 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
2832 Reported by Quoc Peyrot.
2834 2002-10-23 Paul Eggert <eggert@twinsun.com>
2836 * src/main.c (main): With --trace=time, report times even if a
2837 non-fatal error occurs. Formerly, the times were reported in some
2838 such cases but not in others.
2839 * src/reader.c (reader): Just return if a complaint has been issued,
2840 instead of exiting, so that 'main' can report times.
2842 2002-10-22 Akim Demaille <akim@epita.fr>
2844 * src/system.h: Include sys/types.
2845 Reported by Bert Deknuydt.
2847 2002-10-23 Paul Eggert <eggert@twinsun.com>
2849 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
2850 Suggested by Art Haas.
2852 2002-10-22 Paul Eggert <eggert@twinsun.com>
2854 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
2855 decl; not needed any more.
2856 * src/main.c (main): Use return to exit, undoing yesterday's change.
2857 The last OS that we could find where this wouldn't work is
2858 SunOS 3.5, and that's too old to worry about now.
2860 * data/glr.c (struct yyltype): Define members even when not
2861 doing locations. This is more consistent with yacc.c, and it
2862 works around the following bug reports:
2863 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
2864 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
2866 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
2867 @acronym consistently. Standardize on "Yacc" instead of "YACC",
2868 "Algol" instead of "ALGOL". Give a bit more history about BNF.
2870 2002-10-22 Akim Demaille <akim@epita.fr>
2874 2002-10-21 Paul Eggert <eggert@twinsun.com>
2876 Be consistent about 'bool'; the old code used an enum in one
2877 module and an int in another, and this violates the C standard.
2878 * m4/stdbool.m4: New file, from coreutils 4.5.3.
2879 * configure.ac (AC_HEADER_STDBOOL): Add.
2880 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
2881 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
2882 * src/symtab.c (hash_compare_symbol_t): Likewise.
2883 * src/system.h (bool, false, true): Use a definition consistent
2884 with ../lib/hash.c. All uses changed.
2886 * src/complain.c (warning_issued): Renamed from warn_message_count,
2887 so that we needn't worry about integer overflow (!).
2888 Now of type bool. All uses changed.
2889 (complaint_issued): Renamed from complain_message_count; likewise.
2891 * src/main.c (main): Use exit to exit with failure.
2893 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
2894 rather than 1 and 0.
2895 * src/main.c (main): Likewise.
2896 * src/getargs.c (getargs): Likewise.
2897 * src/reader.c (reader): Likewise.
2899 * src/getarg.c (getargs): Remove duplicate code for
2900 "Try `bison --help'".
2902 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
2903 What was that "2" for?
2905 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
2906 * src/getargs.c (usage): Likewise.
2908 * src/getargs.c (getargs): When there are too few operands, report
2909 the last one. When there are too many, report the first extra
2910 one. This is how diffutils does it.
2912 2002-10-20 Paul Eggert <eggert@twinsun.com>
2914 Remove K&R vestiges.
2915 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
2916 * src/complain.c (VA_START): Remove. Assume prototypes.
2917 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
2918 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
2919 fatal): Assume prototypes.
2920 * src/complain.h: Assume prototypes.
2921 * src/system.h (PARAMS): Remove.
2922 Include <limits.h> unconditionally, since it's guaranteeed even
2923 for a freestanding C89 compiler.
2924 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
2925 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
2927 2002-10-20 Akim Demaille <akim@epita.fr>
2929 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
2930 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
2931 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
2932 (yyresolveStates, yyresolveAction, yyresolveStack)
2933 (yyprocessOneStack): Use them.
2934 (yy_reduce_print): New.
2935 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
2937 2002-10-20 Akim Demaille <akim@epita.fr>
2939 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
2940 arguments and output `void'.
2941 (b4_c_function): Rename as...
2942 (b4_c_function_def): this.
2943 (b4_c_function_decl, b4_c_ansi_function_def)
2944 (b4_c_ansi_function_decl): New.
2945 Change the interpretation of the arguments: before `int, foo', now
2947 * data/yacc.c (yyparse): Prototype and define thanks to these.
2948 Adjust b4_c_function_def uses.
2949 * data/glr.c (yyparse): Likewise, but ANSI only.
2951 2002-10-20 Akim Demaille <akim@epita.fr>
2953 * src/output.c (prepare): Move the definition of `tokens_number',
2954 `nterms_number', `undef_token_number', `user_token_number_max'
2956 (prepare_tokens): Here.
2957 (prepare_tokens): Rename as...
2958 (prepare_symbols): this.
2959 (prepare): Move the definition of `rules_number' to...
2960 (prepare_rules): here.
2961 (prepare): Move the definition of `last', `final_state_number',
2962 `states_number' to...
2963 (prepare_states): here.
2964 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
2966 2002-10-20 Akim Demaille <akim@epita.fr>
2968 * src/tables.h, src/tables.c, src/output.c: Comment changes.
2970 2002-10-20 Akim Demaille <akim@epita.fr>
2972 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
2975 2002-10-20 Akim Demaille <akim@epita.fr>
2977 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
2978 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
2980 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
2982 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
2983 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
2986 2002-10-19 Paul Eggert <eggert@twinsun.com>
2988 Do not create a temporary file, as that involves security and
2989 cleanup headaches. Instead, use a pair of pipes.
2990 Derived from a suggestion by Florian Krohm.
2991 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
2992 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
2993 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
2994 (BISON_PREREQ_SUBPIPE): Add.
2995 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
2996 Add subpipe.h, subpipe.c.
2997 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
2998 * po/POTFILES.in: Add lib/subpipe.c.
2999 * src/output.c: Include "subpipe.h".
3000 (m4_invoke): Remove decl.
3001 (scan_skel): New decl.
3002 (output_skeleton): Use pipe rather than temporary file for m4 input.
3003 Check that m4sugar.m4 is readable, to avoid deadlock.
3004 Check for pipe I/O error.
3005 * src/scan-skel.l (readpipe): Remove decl.
3006 (scan_skel): New function, to be used in place of m4_invoke.
3007 Read from stream rather than file.
3009 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
3010 float, as this generates a warning on Solaris 8 + GCC 3.2 with
3011 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
3012 this generates a more-accurate value anyway.
3014 * lib/timevar.c (timervar_accumulate): Rename locals to
3015 avoid confusion with similarly-named more-global.
3016 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
3018 * src/output.c (prepare): Use xstrdup to convert char const *
3019 to char *, to avoid GCC warning.
3021 2002-10-19 Akim Demaille <akim@epita.fr>
3023 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
3024 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
3025 Use them to have `calc.y' ready for %pure-parser.
3026 * data/yacc.c (YYLEX): Pass a yylex return type to
3029 2002-10-19 Akim Demaille <akim@epita.fr>
3031 Prototype support of %lex-param and %parse-param.
3033 * src/parse-gram.y: Add the definition of the %lex-param and
3034 %parse-param tokens, plus their rules.
3035 Drop the `_' version of %glr-parser.
3037 * src/scan-gram.l (INITIAL): Scan them.
3038 * src/muscle_tab.c: Comment changes.
3039 (muscle_insert, muscle_find): Rename `pair' as `probe'.
3040 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
3041 (muscle_entry_s): The `value' member is no longer const.
3042 Adjust all dependencies.
3043 * src/muscle_tab.c (muscle_init): Adjust: use
3044 MUSCLE_INSERT_STRING.
3045 Initialize the obstack earlier.
3046 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
3047 (muscle_pair_list_grow): New.
3048 * data/c.m4 (b4_c_function_call, b4_c_args): New.
3049 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
3050 * tests/calc.at: Use %locations, not --locations.
3051 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
3053 2002-10-19 Akim Demaille <akim@epita.fr>
3055 * src/getargs.c (usage): Take status as argument and exit
3057 Report the traditional `Try ... --help' message when status != 0.
3058 (usage, version): Don't take a FILE * as arg, it is pointless.
3059 (getargs): When there is an incorrect number of arguments, make it
3060 an error, and report it GNUlically thanks to `usage ()'.
3062 2002-10-18 Paul Eggert <eggert@twinsun.com>
3064 * data/glr.c (yyreportParseError): Don't assume that sprintf
3065 yields the length of the printed string, as this is not true
3066 on SunOS 4.1.4. Reported by Peter Klein.
3068 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
3069 * tests/conflicts.at (%nonassoc and eof): Likewise.
3070 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
3072 2002-10-17 Akim Demaille <akim@epita.fr>
3074 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
3075 * src/getargs.c (trace_types, trace_args): Adjust.
3076 * src/reader.c (grammar_current_rule_prec_set)
3077 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
3078 Standardize error messages.
3080 (reader): Use trace_flag to enable scanner/parser debugging,
3081 instead of an adhoc scheme.
3082 * src/scan-gram.l: Remove trailing debugging code.
3084 2002-10-16 Paul Eggert <eggert@twinsun.com>
3086 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
3089 * NEWS: Officially drop support for building Bison with K&R C,
3090 since it didn't work anyway and it's not worth worrying about.
3091 * Makefile.maint (wget_files): Remove ansi2knr.c.
3092 (ansi2knr.c-url_prefix): Remove.
3093 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
3094 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3095 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3097 2002-10-15 Paul Eggert <eggert@twinsun.com>
3099 Stop using the "enum_" trick for K&R-style function definitions;
3100 it confused me, and I was the author! Instead, assume that people
3101 who want to use K&R C compilers (when using these modules in GCC,
3102 perhaps?) will run ansi2knr.
3104 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
3105 All uses of "enum_" changed to "enum ".
3106 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3107 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3109 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
3110 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
3111 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
3112 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
3113 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
3114 abitset_not, abitset_ones, abitset_or, abitset_or_and,
3115 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
3116 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
3117 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
3118 Use function prototypes; this removes the need for declaring
3119 static functions simply to provide their prototypes.
3120 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
3121 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
3122 bitset_count_, bitset_create, bitset_dump, bitset_first,
3123 bitset_free, bitset_init, bitset_last, bitset_next,
3124 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
3125 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
3126 bitset_print, bitset_release_memory, bitset_toggle_,
3127 bitset_type_choose, bitset_type_get, bitset_type_name_get,
3128 debug_bitset): Likewise.
3129 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
3130 * lib/bitset_stats.c (bitset_log_histogram_print,
3131 bitset_percent_histogram_print, bitset_stats_and,
3132 bitset_stats_and_cmp, bitset_stats_and_or,
3133 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
3134 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
3135 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
3136 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
3137 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
3138 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
3139 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
3140 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
3141 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
3142 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
3143 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
3144 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
3145 bitset_stats_zero): Likewise.
3146 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3147 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3148 bitsetv_dump, debug_bitsetv): Likewise.
3149 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
3150 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
3151 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
3152 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
3153 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
3154 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
3155 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
3156 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
3157 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
3158 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
3159 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
3161 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
3162 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
3163 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
3164 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
3165 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
3166 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
3167 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
3168 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
3169 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
3170 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
3171 lbitset_xor_cmp, lbitset_zero): Likewise.
3173 2002-10-14 Akim Demaille <akim@epita.fr>
3177 2002-10-14 Akim Demaille <akim@epita.fr>
3179 * tests/Makefile.am (maintainer-check-posix): New.
3181 2002-10-14 Akim Demaille <akim@epita.fr>
3183 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
3186 2002-10-14 Akim Demaille <akim@epita.fr>
3188 * src/tables.c (table_ninf_remap): base -> tab.
3189 Reported by Matt Rosing.
3191 2002-10-14 Paul Eggert <eggert@twinsun.com>
3193 * tests/action.at, tests/calc.at, tests/conflicts.at,
3194 tests/cxx-type.at, tests/headers.at, tests/input.at,
3195 tests/regression.at, tests/synclines.at, tests/torture.at:
3196 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
3197 so that the tests still work even if POSIXLY_CORRECT is set.
3198 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
3200 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
3201 for portability to K&R hosts. Fix typo: signed char is guaranteed
3202 only to 127, not to 128.
3203 * data/glr.c (yysigned_char): New type.
3204 * data/yacc.c (yysigned_char): Likewise.
3205 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
3207 2002-10-13 Paul Eggert <eggert@twinsun.com>
3209 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
3210 true due to limited range of data type" warning from GCC.
3212 * data/c.m4 (b4_token_defines): Protect against double-inclusion
3213 by wrapping enum yytokentype's definition inside #ifndef
3214 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
3216 2002-10-13 Akim Demaille <akim@epita.fr>
3218 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
3219 Un yy- yyrhs to avoid the name clash with the global YYRHS.
3221 2002-10-13 Akim Demaille <akim@epita.fr>
3223 * Makefile.maint: Update from Autoconf 2.54.
3224 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
3226 2002-10-13 Akim Demaille <akim@epita.fr>
3228 * src/print.c (print_state): Separate the list of solved conflicts
3229 from the other items.
3230 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
3232 2002-10-13 Akim Demaille <akim@epita.fr>
3234 Let nondeterministic skeletons be usable with deterministic
3237 With the patch, GAWK compiled by GCC without -O2 passes its test
3238 suite using a GLR parser driven by LALR tables. It fails with -O2
3239 because `struct stat' gives two different answers on my machine:
3240 88 (definition of an auto var) and later 96 (memset on this var).
3241 Hence the stack is badly corrumpted. The headers inclusion is to
3242 blame: if I move the awk.h inclusion before GLR's system header
3243 inclusion, the two struct stat have the same size.
3245 * src/tables.c (pack_table): Always create conflict_table.
3246 (token_actions): Always create conflict_list.
3247 * data/glr.c (YYFLAG): Remove, unused.
3249 2002-10-13 Akim Demaille <akim@epita.fr>
3251 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
3253 (VALGRIND, GXX): New.
3254 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
3255 * tests/bison.in: Run $PREBISON a pre-command.
3256 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
3257 (maintainer-check-g++): New.
3258 * Makefile.am (maintainer-check): New.
3260 2002-10-13 Akim Demaille <akim@epita.fr>
3262 * data/glr.c: Formatting changes.
3263 Tweak some trace messages to match yacc.c's.
3265 2002-10-13 Akim Demaille <akim@epita.fr>
3267 GLR parsers sometimes raise parse errors instead of performing the
3269 Reported by Charles-Henry de Boysson.
3271 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
3272 check the length of the traces when %glr.
3273 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
3275 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
3277 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
3278 (yyltype): Remove the yy prefix from the member names.
3279 (yytable): Complete its comment.
3280 (yygetLRActions): Map error action number from YYTABLE from
3282 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
3283 (which was a bug: it should have been YYTABEL_NINF, and yet it was
3284 not satisfying as we could compare an YYACTION computed from
3285 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
3286 only value for error actions.
3287 (yyreportParseError): In verbose parse error messages, don't issue
3288 `error' in the list of expected tokens.
3289 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
3290 next action to perform to match glr.c's decoding.
3291 (yytable): Complete its comment.
3293 2002-10-13 Paul Eggert <eggert@twinsun.com>
3295 Fix problem reported by Henrik Grubbstroem in
3296 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
3297 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
3298 because the Bison parser reads the second action before reducing
3300 * src/scan-gram.l (rule_length): New static var.
3301 Use it to keep track of the rule length in the scanner, since
3302 we can't expect the parser to be in lock-step sync with the scanner.
3303 (handle_action_dollar, handle_action_at): Use this var.
3304 * tests/actions.at (Exotic Dollars): Test for the problem.
3306 2002-10-12 Paul Eggert <eggert@twinsun.com>
3308 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
3309 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
3310 Include <sys/time.h> when checking for clock_t and struct tms.
3311 Use same include order as source.
3312 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
3313 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
3315 * lib/timevar.c: Update copyright date and clarify comments.
3316 (get_time) [IN_GCC]: Keep the GCC version for reference.
3318 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
3319 GCC version as of today, then merge Bison's changes.
3320 Change "GCC" to "Bison" in copyright notice. timevar.def's
3321 author is Akim, so change that too.
3323 * src/reader.c (grammar_current_rule_check):
3324 Don't worry about the default action if $$ is untyped.
3325 Prevents bogus warnings reported by Jim Gifford in
3326 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
3328 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
3329 * data/glr.c, data/lalr1.cc, data/yacc.c:
3330 Output token definitions before the first part of user declarations.
3331 Fixes compatibility problem reported by Jim Gifford for kbd in
3332 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
3334 2002-10-11 Paul Eggert <eggert@twinsun.com>
3336 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
3337 (yyparse): here. This undoes some of the 2002-07-25 change.
3338 Compatibility problem reported by Ralf S. Engelschall with
3339 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
3341 2002-10-11 Akim Demaille <akim@epita.fr>
3343 * tests/regression.at Characters Escapes): New.
3344 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
3346 Reported by Jan Nieuwenhuizen.
3348 2002-10-11 Akim Demaille <akim@epita.fr>
3352 2002-10-10 Paul Eggert <eggert@twinsun.com>
3354 Portability fixes for bitsets; this also avoids several GCC
3357 * lib/abitset.c: Include <stddef.h>, for offsetof.
3358 * lib/lbitset.c: Likewise.
3360 * lib/abitset.c (abitset_bytes): Return a size that is aligned
3361 properly for vectors of objects. Do not assume that adding a
3362 header size to a multiple of a word size yields a value that is
3363 properly aligned for the whole union.
3364 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3366 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
3367 unique names for structures.
3368 * lib/ebitset.c (ebitset_bytes): Likewise.
3369 * lib/lbitset.c (lbitset_bytes): Likewise.
3371 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
3372 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
3373 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
3374 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
3375 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
3376 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
3377 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
3378 to improve the type-checking that GCC can do.
3379 * lib/bitset.c (bitset_op4_cmp): Likewise.
3380 * lib/bitset_stats.c (bitset_stats_count,
3381 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
3382 bitset_stats_copy, bitset_stats_disjoint_p,
3383 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
3384 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
3385 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
3386 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
3387 bitset_stats_and_or_cmp, bitset_stats_andn_or,
3388 bitset_stats_andn_or_cmp, bitset_stats_or_and,
3389 bitset_stats_or_and_cmp): Likewise.
3390 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
3391 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
3392 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
3393 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
3395 * lib/abitset.h: Include bitset.h, not bbitset.h.
3396 * lib/ebitset.h: Likewise.
3397 * lib/lbitset.h: Likewise.
3399 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
3400 All instances of parameters of type enum bitset_opts are now of
3401 type enum_bitset_opts, to conform to the C Standard, and similarly
3402 for enum_bitset_type.
3403 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3404 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3406 Do not use "struct bitset_struct" to mean different things in
3407 different modules. Not only is this confusing, it violates
3408 the C Standard, which requires that structure types in different
3409 modules must be compatible if one is to be passed to the other.
3410 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
3411 All instances of "struct bitset_struct *" replaced with "bitset".
3412 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
3413 (union bitset_union, struct abitset_struct, struct ebitset_struct,
3414 struct lbitset_struct, struct bitset_stats_struct): New types.
3415 All uses of struct bitset_struct changed to union bitset_union,
3417 * lib/abitset.c (struct abitset_struct, abitset,
3418 struct bitset_struct): Remove.
3419 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
3420 struct bitset_struct): Remove.
3421 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
3422 bitset_struct): Remove.
3423 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
3426 Do not call a function of type T using a call that assumes the
3427 function is of a different type U. Standard C requires that a
3428 function must be called with a type that is compatible with its
3430 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3432 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3434 * lib/ebitset.c (PFV): Remove.
3435 * lib/lbitset.c (PFV): Likewise.
3436 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
3437 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
3439 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
3440 (ebitset_vtable): Use them.
3441 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
3442 lbitset_xor): New functions.
3443 (lbitset_vtable): Use them.
3445 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
3448 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
3450 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
3451 Use offsetof, for simplicity.
3453 2002-10-06 Paul Eggert <eggert@twinsun.com>
3455 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
3456 the same width as int. This reapplies a hunk of the 2002-08-12 patch
3457 <http://mail.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
3458 which was inadvertently undone by the 2002-09-30 patch.
3459 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
3460 the same width as int.
3462 2002-10-04 Paul Eggert <eggert@twinsun.com>
3466 * configure.ac (AC_INIT), NEWS: Increment version number.
3468 * doc/bison.texinfo: Minor spelling, grammar, and white space
3470 (Symbols): Mention that any negative value returned from yylex
3471 signifies end-of-input. Warn about negative chars. Mention
3472 the portable Standard C character set.
3474 The GNU coding standard says CFLAGS and YFLAGS are reserved
3475 for the installer to set.
3476 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
3477 * src/Makefile.am (AM_CFLAGS): Likewise.
3478 (AM_YFLAGS): Renamed from YFLAGS.
3480 Fix some MAX and MIN problems.
3481 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
3482 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
3483 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
3484 * src/reader.c (reader): Use it.
3486 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
3487 POSIX 1003.1-2001 has removed fgrep.
3489 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
3491 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
3492 interpreted as signed.
3493 * lib/ebitset.c (ebitset_list): Fix bug.
3495 2002-10-01 Paul Eggert <eggert@twinsun.com>
3497 More fixes for 64-bit hosts and large bitsets.
3499 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
3500 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
3501 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
3502 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
3503 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
3504 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
3505 bitset_count_): Likewise.
3506 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
3507 bitset_first, bitset_last): Likewise.
3508 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
3509 bitset_stats_list_reverse, bitset_stats_size,
3510 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
3512 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3513 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3514 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3515 bitsetv_reflexive_transitive_closure): Likewise.
3516 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
3517 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
3519 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
3522 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
3523 Use size_t, not unsigned int, to count bytes.
3524 * lib/abitset.h (abitset_bytes): Likewise.
3525 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
3527 * lib/bitset.h (bitset_bytes): Likewise.
3528 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
3529 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
3530 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3531 * lib/ebitset.c (ebitset_bytes): Likewise.
3532 * lib/ebitset.h (ebitset_bytes): Likewise.
3533 * lib/lbitset.c (lbitset_bytes): Likewise.
3534 * lib/lbitset.h (lbitset_bytes): Likewise.
3536 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
3537 abitset_subset_p, abitset_disjoint_p, abitset_and,
3538 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
3539 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
3540 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
3541 abitset_or_and, abitset_or_and_cmp):
3542 Use bitset_windex instead of unsigned int.
3543 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3544 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
3545 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
3546 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
3548 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
3550 * lib/bitset.c (bitset_print):
3551 Use proper printf formats for widths of integer types.
3552 * lib/bitset_stats.c (bitset_percent_histogram_print,
3553 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
3554 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3555 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3556 * lib/lbitset.c (lbitset_bytes): Likewise.
3558 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
3559 BITSET_SIZE_MAX): New macros.
3560 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
3561 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
3562 to BITSET_WINDEX_MAX.
3564 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
3565 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
3566 since we now return the bitset_bindex type (not int).
3568 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
3569 when computing sizes.
3570 * lib/ebitset.c (ebitset_elts_grow): Likewise.
3572 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
3573 and avoid cast to unsigned.
3575 2002-09-30 Akim Demaille <akim@epita.fr>
3577 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
3578 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
3579 Updates from Michael Hayes.
3581 2002-09-30 Art Haas <ahaas@neosoft.com>
3583 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
3585 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
3588 2002-09-27 Akim Demaille <akim@epita.fr>
3592 2002-09-27 Akim Demaille <akim@epita.fr>
3594 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
3595 (Because of AC_LIBSOURCE).
3597 2002-09-27 Akim Demaille <akim@epita.fr>
3599 Playing with Autoscan.
3601 * configure.ac: Remove the old LIBOBJ tweaks.
3602 (AC_REPLACE_FUNCS): Add strrchr and strtol.
3603 * lib/strrchr.c: New.
3604 * lib/strtol.c: New, from the Coreutils 4.5.1.
3606 2002-09-27 Akim Demaille <akim@epita.fr>
3608 Playing with Autoscan.
3610 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
3611 * lib/Makefile.am (libbison_a_SOURCES): No longer include
3612 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
3613 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
3616 2002-09-24 Akim Demaille <akim@epita.fr>
3618 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
3619 (Frequently Asked Questions, Parser Stack Overflow): New.
3621 2002-09-13 Akim Demaille <akim@epita.fr>
3623 Playing with autoscan.
3625 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
3626 * src/files.c (skeleton_find): Remove, unused.
3627 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
3628 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
3630 2002-09-13 Akim Demaille <akim@epita.fr>
3632 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
3633 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
3635 2002-09-13 Akim Demaille <akim@epita.fr>
3637 * configure.ac: Require 2.54.
3638 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
3639 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
3640 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
3641 Remove, provided by Autoconf macros.
3643 2002-09-12 Akim Demaille <akim@epita.fr>
3645 * m4/prereq.m4: Update, from Coreutils 4.5.1.
3647 2002-09-12 Akim Demaille <akim@epita.fr>
3649 * m4/prereq.m4: Update, from Fileutils 4.1.5.
3650 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
3651 Reported by Martin Mokrejs.
3653 2002-09-10 Akim Demaille <akim@epita.fr>
3655 * src/parse-gram.y: Associate a human readable string to each
3657 * tests/regression.at (Invalid inputs): Adjust.
3659 2002-09-10 Gary V. Vaughan <gary@gnu.org>
3661 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
3662 with an Autoconf-2.5x style configure.ac.
3664 2002-09-06 Paul Eggert <eggert@twinsun.com>
3666 * doc/bison.texinfo (Conditions): Make explicit that the GPL
3667 exception applies only to yacc.c. This is a modification of a
3668 patch originally suggested by Akim Demaille.
3670 2002-09-06 Akim Demaille <akim@epita.fr>
3672 * data/c.m4 (b4_copyright): Move the GPL exception comment from
3674 * data/yacc.c: here.
3676 * data/lalr1.cc (struct yyltype): Don't define it, since we use
3678 (b4_ltype): Default to yy::Location from location.hh.
3680 2002-09-04 Jim Meyering <jim@meyering.net>
3682 * data/yacc.c: Guard the declaration of yytoknum also with
3683 `#ifdef YYPRINT', so it is declared only when used.
3685 2002-09-04 Akim Demaille <akim@epita.fr>
3687 * configure.in: Rename as...
3688 * configure.ac: this.
3691 2002-09-04 Akim Demaille <akim@epita.fr>
3693 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
3694 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
3695 translate maintainer only messages.
3697 2002-08-12 Paul Eggert <eggert@twinsun.com>
3701 * Makefile.am (SUBDIRS): Remove intl.
3702 (DISTCLEANFILES): Remove.
3703 * NEWS: Mention that GNU M4 is now required. Clarify what is
3704 meant by "larger grammars". Mention the pt_BR translation.
3705 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
3706 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
3707 Bump version from 0.11.2 to 0.11.5.
3708 (BISON_PREREQ_STAGE): Remove.
3709 (AM_GNU_GETTEXT): Use external gettext.
3710 (AC_OUTPUT): Remove intl/Makefile.
3712 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
3714 * data/glr.c: Include string.h, for strlen.
3715 (yyreportParseError): Use size_t for yysize.
3716 (yy_yypstack): No longer nested inside yypstates, as nested
3717 functions are not portable. Do not assume size_t is the
3719 (yypstates): Do not assume that ptrdiff_t is the same width
3720 as int, and similarly for yyposn and YYINDEX.
3722 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
3724 * lib/Makefile.am (INCLUDES): Do not include from the intl
3725 directory, which has been removed.
3726 * src/Makefile.am (INCLUDES): Likewise.
3728 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
3729 (bitsets_sources, additional_bitsets_sources, timevars_sources):
3732 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
3733 * tests/Makefile.am (EXTRA_DIST): Likewise.
3735 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
3736 Do not assume that bitset_windex is the same width as unsigned.
3738 * lib/abitset.c (abitset_unused_clear): Do not assume that
3739 bitset_word is the same width as int.
3740 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
3741 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
3742 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
3743 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
3744 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
3746 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
3747 portability to one's complement hosts!).
3748 * lib/ebitset.c (ebitset_op1): Likewise.
3749 * lib/lbitset.c (lbitset_op1): Likewise.
3751 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
3752 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
3753 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
3754 Sync with fileutils.
3755 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
3756 lib/gettext.h: Sync with diffutils.
3758 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
3759 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
3761 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
3762 PROTOTYPES to check for prototypes, and "defined __STDC__" to
3765 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
3766 size_t; the old version tried to do this but casted improperly.
3767 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
3768 (bitset_test): Now returns int, not unsigned long.
3770 * lib/bitset_stats.c: Include "gettext.h".
3772 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
3773 name locals "index", as it generates unnecessary warnings on some
3774 hosts that have an "index" function.
3776 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
3777 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
3778 they need translation.
3779 * src/LR0.c (state_list_append, new_itemsets, get_state,
3780 append_states, generate_states): Likewise.
3781 * src/assoc.c (assoc_to_string): Likewise.
3782 * src/closure.c (print_closure, set_firsts, closure): Likewise.
3783 * src/gram.c (grammar_dump): Likewise.
3784 * src/injections.c (injections_compute): Likewise.
3785 * src/lalr.c (lookaheads_print): Likewise.
3786 * src/relation.c (relation_transpose): Likewise.
3787 * src/scan-gram.l: Likewise.
3788 * src/tables.c (table_grow, pack_vector): Likewise.
3790 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
3791 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
3792 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
3793 * m4/mbstate_t.m4: Sync with fileutils.
3794 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
3796 * po/LINGUAS: Add pt_BR.
3797 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
3798 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
3800 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
3802 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
3804 * src/complain.c (strerror_r): Remove decl; not needed.
3805 (strerror): Use same pattern as ../lib/error.c.
3807 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
3809 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
3811 * src/main.c (main): Cast result of bindtextdomain and textdomain
3812 to void, to avoid a GCC warning when --disable-nls is in effect.
3814 * src/scan-gram.l: Use strings rather than escapes when possible,
3815 to minimize the number of warnings from xgettext.
3816 (handle_action_dollar, handle_action_at): Don't use isdigit,
3817 as it mishandles negative chars and it may not work as expected
3818 outside the C locale.
3820 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
3821 this is a GCC extension and is not portable to other compilers.
3823 * src/system.h (alloca): Use same pattern as ../lib/error.c.
3824 Do not include <ctype.h>; no longer needed.
3825 Do not include <malloc.h>; no longer needed (and generates
3826 warnings on OpenBSD 3.0).
3828 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
3831 * tests/regression.at: Do not use 'cc -c input.c -o input';
3832 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
3834 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
3835 exit status as failure, not just exit status 1. Sun C exits
3836 with status 2 sometimes.
3838 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
3839 Use it for the two large tests.
3841 2002-08-02 Akim Demaille <akim@epita.fr>
3843 * src/conflicts.c (conflicts_output): Don't output rules never
3844 reduced here, since anyway that computation doesn't work.
3845 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
3846 (rule_useless_p, rule_never_reduced_p): New.
3847 (grammar_rules_partial_print): Use a filter instead of a range.
3848 Display the title only if needed.
3849 (grammar_rules_print): Adjust.
3850 (grammar_rules_never_reduced_report): New.
3851 * src/tables.c (action_row): Move the computation of rules never
3853 (token_actions): here.
3854 * src/main.c (main): Make the parser before making the report, so
3855 that rules never reduced are computed.
3856 Call grammar_rules_never_reduced_report.
3857 * src/print.c (print_results): Report rules never reduced.
3858 * tests/conflicts.at, tests/reduce.at: Adjust.
3860 2002-08-01 Akim Demaille <akim@epita.fr>
3862 Instead of attaching lookaheads and duplicating the rules being
3863 reduced by a state, attach the lookaheads to the reductions.
3865 * src/state.h (state_t): Remove the `lookaheads',
3866 `lookaheads_rule' member.
3867 (reductions_t): Add a `lookaheads' member.
3868 Use a regular array for the `rules'.
3869 * src/state.c (reductions_new): Initialize the lookaheads member
3871 (state_rule_lookaheads_print): Adjust.
3872 * src/state.h, src/state.c (state_reductions_find): New.
3873 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
3874 (count_rr_conflicts): Adjust.
3875 * src/lalr.c (LArule): Remove.
3876 (add_lookback_edge): Adjust.
3877 (state_lookaheads_count): New.
3878 (states_lookaheads_initialize): Merge into...
3879 (initialize_LA): this.
3880 (lalr_free): Adjust.
3881 * src/main.c (main): Don't free nullable and derives too early: it
3882 is used by --verbose.
3883 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
3885 2002-08-01 Akim Demaille <akim@epita.fr>
3887 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
3889 (set_derives, free_derives): Rename as...
3890 (derives_compute, derives_free): this.
3891 Adjust all dependencies.
3892 * src/nullable.c (set_nullable, free_nullable): Rename as...
3893 (nullable_compute, nullable_free): these.
3894 (rule_list_t): Store rule_t *, not rule_number_t.
3895 * src/state.c (state_rule_lookaheads_print): Directly compare rule
3896 pointers, instead of their numbers.
3897 * src/main.c (main): Call nullable_free, and derives_free earlier,
3898 as they were lo longer used.
3900 2002-08-01 Akim Demaille <akim@epita.fr>
3902 * lib/timevar.c (get_time): Include children time.
3903 * src/lalr.h (LA, LArule): Don't export them: used with the
3905 * src/lalr.c (LA, LArule): Static.
3906 * src/lalr.h, src/lalr.c (lalr_free): New.
3907 * src/main.c (main): Call it.
3908 * src/tables.c (pack_vector): Check whether loc is >= to the
3910 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
3911 (tables_generate): do it, since that's also it which allocates
3913 Don't free LA and LArule, main does.
3915 2002-07-31 Akim Demaille <akim@epita.fr>
3917 Separate parser tables computation and output.
3919 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
3920 (conflict_list, conflict_list_cnt, table, check, table_ninf)
3921 (yydefgoto, yydefact, high): Move to...
3922 * src/tables.h, src/tables.c: here.
3923 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3924 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3925 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
3926 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
3927 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
3928 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
3929 (action_row, save_row, token_actions, save_column, default_goto)
3930 (goto_actions, sort_actions, matching_state, pack_vector)
3931 (table_ninf_remap, pack_table, prepare_actions): Move to...
3932 * src/tables.c: here.
3933 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
3934 * src/output.c (token_actions, output_base, output_conflicts)
3935 (output_check): Merge into...
3936 (prepare_actions): this.
3937 (actions_output): Rename as...
3938 (user_actions_output): this.
3939 * src/main.c (main): Call tables_generate and tables_free.
3941 2002-07-31 Akim Demaille <akim@epita.fr>
3943 Steal GCC's --time-report support.
3945 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
3946 stolen/adjusted from GCC.
3947 * m4/stage.m4: Remove time related checks.
3948 * m4/timevar.m4: New.
3949 * configure.in: Adjust.
3950 * src/system.h: Adjust to using timevar.h.
3951 * src/getargs.h, src/getargs.c: Support trace_time for
3953 * src/main.c (stage): Remove.
3954 (main): Replace `stage' invocations with timevar calls.
3955 * src/output.c: Insert pertinent timevar calls.
3957 2002-07-31 Akim Demaille <akim@epita.fr>
3959 Let --trace have arguments.
3961 * src/getargs.h (enum trace_e): New.
3962 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
3963 (long_options, short_options): --trace/-T takes an optional
3965 Change all the uses of trace_flag to reflect the new flags.
3966 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
3968 Strengthen `stage' portability.
3970 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
3971 * configure.in: Use it.
3972 Don't check for malloc.h and sys/times.h.
3973 * src/system.h: Include them when appropriate.
3974 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
3975 times and struct tms are available.
3977 2002-07-30 Akim Demaille <akim@epita.fr>
3979 In verbose parse error message, don't report `error' as an
3981 * tests/actions.at (Printers and Destructors): Adjust.
3982 * tests/calc.at (Calculator $1): Adjust.
3983 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
3984 error message, do not report the parser accepts the error token in
3987 2002-07-30 Akim Demaille <akim@epita.fr>
3989 Normalize conflict related messages.
3991 * src/complain.h, src/complain.c (warn, complain): New.
3992 * src/conflicts.c (conflicts_print): Use them.
3993 (conflict_report_yacc): New, extracted from...
3994 (conflicts_print): here.
3995 * tests/conflicts.at, tests/existing.at: Adjust.
3997 2002-07-30 Akim Demaille <akim@epita.fr>
3999 Report rules which are never reduced by the parser: those hidden
4002 * src/LR0.c (save_reductions): Don't make the final state too
4003 different: save its reduction (accept) instead of having a state
4004 without any action (no shift or goto, no reduce).
4005 Note: the final state is now a ``regular'' state, i.e., the
4006 parsers now contain `reduce 0' as default reduction.
4007 Nevertheless, since they decide to `accept' when yystate =
4008 final_state, they still will not reduce rule 0.
4009 * src/print.c (print_actions, print_reduction): Adjust.
4010 * src/output.c (action_row): Track reduced rules.
4011 (token_actions): Report rules never reduced.
4012 * tests/conflicts.at, tests/regression.at: Adjust.
4014 2002-07-30 Akim Demaille <akim@epita.fr>
4016 `stage' was accidently included in a previous patch.
4017 Initiate its autoconfiscation.
4019 * configure.in: Look for malloc.h and sys/times.h.
4020 * src/main.c (stage): Adjust.
4021 Report only when trace_flag.
4023 2002-07-29 Akim Demaille <akim@epita.fr>
4025 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
4027 (errs_t): symbol_t*, not symbol_number_t.
4028 (reductions_t): rule_t*, not rule_number_t.
4029 (FOR_EACH_SHIFT): New.
4030 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
4031 * src/print.c, src/print_graph.c: Adjust.
4033 2002-07-29 Akim Demaille <akim@epita.fr>
4035 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
4037 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
4038 (endtoken, accept): these.
4039 * src/reader.c (reader): Set endtoken's default tag to "$end".
4040 Set undeftoken's tag to "$undefined" instead of "$undefined.".
4041 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
4044 2002-07-29 Akim Demaille <akim@epita.fr>
4046 * src/reduce.c (reduce_grammar): When the language is empty,
4047 complain about the start symbol, not the axiom.
4049 * tests/reduce.at (Empty Language): New.
4051 2002-07-26 Akim Demaille <akim@epita.fr>
4053 * src/reader.h, src/reader.c (gram_error): ... can't get
4054 yycontrol without making too strong assumptions on the parser
4056 * src/output.c (prepare_tokens): Use the real 0th value of
4057 token_translations instead of `0'.
4058 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
4060 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
4061 for the time being: %locations ought to provide it to yyerror.
4063 2002-07-25 Akim Demaille <akim@epita.fr>
4065 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
4066 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
4067 * tests/regression.at (Web2c Actions): Adjust.
4069 2002-07-25 Akim Demaille <akim@epita.fr>
4071 Stop storing rules from 1 to nrules + 1.
4073 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
4074 * src/nullable.c, src/output.c, src/print.c, src/reader.c
4075 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
4076 Iterate from 0 to nrules.
4077 Use rule_number_as_item_number and item_number_as_rule_number.
4078 Adjust to `derive' now containing possibly 0.
4079 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
4080 Handle the `- 1' part in rule numbers from/to item numbers.
4081 * src/conflicts.c (log_resolution): Fix the message which reversed
4083 * src/output.c (action_row): Initialize default_rule to -1.
4084 (token_actions): Adjust.
4085 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
4087 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
4089 2002-07-25 Akim Demaille <akim@epita.fr>
4091 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
4092 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
4093 (b4_c_knr_arg_decl): New.
4094 * data/yacc.c: Use it to define yysymprint, yydestruct, and
4095 yyreport_parse_error.
4097 2002-07-25 Akim Demaille <akim@epita.fr>
4099 * data/yacc.c (yyreport_parse_error): New, extracted from...
4101 (yydestruct, yysymprint): Move above yyparse.
4104 2002-07-25 Akim Demaille <akim@epita.fr>
4106 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
4108 (b4_sint_type, b4_uint_type): these.
4109 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
4110 * tests/regression.at (Web2c Actions): Adjust.
4112 2002-07-25 Akim Demaille <akim@epita.fr>
4114 * src/gram.h (TIEM_NUMBER_MAX): New.
4115 (item_number_of_rule_number, rule_number_of_item_number): Rename
4117 (rule_number_as_item_number, item_number_as_rule_number): these.
4118 Adjust dependencies.
4119 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
4120 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
4121 (symbol_number_to_vector_number): New.
4122 (order): Of vector_number_t* type.
4123 (base_t, BASE_MAX, BASE_MIN): New.
4124 (froms, tos, width, pos, check): Of base_t type.
4125 (action_number_t, ACTION_MIN, ACTION_MAX): New.
4126 (actrow): Of action_number_t type.
4127 (conflrow): Of unsigned int type.
4128 (table_ninf, base_ninf): New.
4129 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
4130 (muscle_insert_int_table, muscle_insert_base_table)
4131 (muscle_insert_rule_number_table): New.
4132 (prepare_tokens): Output `toknum' as int_table.
4133 (action_row): Returns a rule_number_t.
4134 Use ACTION_MIN, not SHRT_MIN.
4135 (token_actions): yydefact is rule_number_t*.
4136 (table_ninf_remap): New.
4137 (pack_table): Use it for `base' and `table'.
4138 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
4140 (YYPACT_NINF, YYTABLE_NINF): these.
4141 (yypact, yytable): Compute their types instead of hard-coded
4143 * tests/regression.at (Web2c Actions): Adjust.
4145 2002-07-19 Akim Demaille <akim@epita.fr>
4147 * src/scan-gram.l (id): Can start with an underscore.
4149 2002-07-16 Akim Demaille <akim@epita.fr>
4151 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
4152 Adjust all former `associativity' dependencies.
4153 * src/symtab.c (symbol_new): Default associativity is `undef', not
4155 (symbol_check_alias_consistence): Adjust.
4157 2002-07-09 Akim Demaille <akim@epita.fr>
4159 * doc/bison.texinfo: Properly set the ``header'' part.
4160 Use @dircategory ``GNU programming tools'' as per Texinfo's
4164 2002-07-09 Akim Demaille <akim@epita.fr>
4166 * lib/quotearg.h: Protect against multiple inclusions.
4167 * src/location.h (location_t): Add a `file' member.
4168 (LOCATION_RESET, LOCATION_PRINT): Adjust.
4169 * src/complain.c (warn_at, complain_at, fatal_at): Drop
4170 `error_one_per_line' support.
4172 2002-07-09 Akim Demaille <akim@epita.fr>
4174 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
4175 * src/reader.c (lineno): Remove.
4176 Adjust all dependencies.
4177 (get_merge_function): Take a location and use complain_at.
4178 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
4179 * tests/regression.at (Invalid inputs, Mixing %token styles):
4182 2002-07-09 Akim Demaille <akim@epita.fr>
4184 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
4185 recovery rule, and forbid extensions when --yacc.
4186 (gram_error): Use complain_at.
4187 * src/reader.c (reader): Exit if there were parse errors.
4189 2002-07-09 Akim Demaille <akim@epita.fr>
4191 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
4192 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
4193 Reported by R Blake <blakers@mac.com>.
4195 2002-07-09 Akim Demaille <akim@epita.fr>
4197 * data/yacc.c: Output the copyright notive in the header.
4199 2002-07-03 Akim Demaille <akim@epita.fr>
4201 * src/output.c (froms, tos): Are state_number_t.
4202 (save_column): sp, sp1, and sp2 are state_number_t.
4203 (prepare): Rename `final' as `final_state_number', `nnts' as
4204 `nterms_number', `nrules' as `rules_number', `nstates' as
4205 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
4207 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
4208 * data/lalr1.cc (nsym_): Remove, unused.
4210 2002-07-03 Akim Demaille <akim@epita.fr>
4212 * src/lalr.h, src/lalr.c (goto_number_t): New.
4213 * src/lalr.c (goto_list_t): New.
4215 * src/nullable.c (rule_list_t): New.
4217 * src/types.h: Remove.
4219 2002-07-03 Akim Demaille <akim@epita.fr>
4221 * src/closure.c (print_fderives): Use rule_rhs_print.
4222 * src/derives.c (print_derives): Use rule_rhs_print.
4223 (rule_list_t): New, replaces `shorts'.
4224 (set_derives): Add comments.
4225 * tests/sets.at (Nullable, Firsts): Adjust.
4227 2002-07-03 Akim Demaille <akim@epita.fr>
4229 * src/output.c (prepare_actions): Free `tally' and `width'.
4230 (prepare_actions): Allocate and free `order'.
4231 * src/symtab.c (symbols_free): Free `symbols'.
4232 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
4233 * src/output.c (m4_invoke): Move to...
4234 * src/scan-skel.l: here.
4235 (<<EOF>>): Close yyout, and free its name.
4237 2002-07-03 Akim Demaille <akim@epita.fr>
4239 Fix some memory leaks, and fix a bug: state 0 was examined twice.
4241 * src/LR0.c (new_state): Merge into...
4242 (state_list_append): this.
4243 (new_states): Merge into...
4244 (generate_states): here.
4245 (set_states): Don't ensure a proper `errs' state member here, do it...
4246 * src/conflicts.c (conflicts_solve): here.
4247 * src/state.h, src/state.c: Comment changes.
4248 (state_t): Rename member `shifts' as `transitions'.
4249 Adjust all dependencies.
4250 (errs_new): For consistency, also take the values as argument.
4252 (state_errs_set): New.
4253 (state_reductions_set, state_transitions_set): Assert that no
4254 previous value was assigned.
4256 (states_free): Use it.
4257 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
4258 temporary storage: use `errs' and `nerrs' as elsewhere.
4259 (set_conflicts): Allocate and free this `errs'.
4261 2002-07-02 Akim Demaille <akim@epita.fr>
4263 * lib/libiberty.h: New.
4264 * lib: Update the bitset implementation from upstream.
4265 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
4266 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
4267 * src/main.c: Adjust bitset stats calls.
4269 2002-07-01 Paul Eggert <eggert@twinsun.com>
4271 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
4272 char, so that negative chars don't collide with $.
4274 2002-06-30 Akim Demaille <akim@epita.fr>
4276 Have the GLR tests be `warning' checked, and fix the warnings.
4278 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
4279 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
4280 (yyremoveDeletes): `yyi' and `yyj' are size_t.
4281 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
4282 (yyaddDeferredAction): static.
4283 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
4284 (yyreportParseError): yyprefix is const.
4285 yytokenp is used only when verbose.
4286 (yy__GNUC__): Replace with __GNUC__.
4287 (yypdumpstack): yyi is size_t.
4288 (yypreference): Un-yy local variables and arguments, to avoid
4289 clashes with `yyr1'. Anyway, we are not in the user name space.
4290 (yytname_size): be an int, as is compared with ints.
4291 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
4293 * tests/cxx-gram.at: Use quotation to protect $1.
4294 Use AT_COMPILE to enable warnings hunts.
4295 Prototype yylex and yyerror.
4297 Include `string.h', not `strings.h'.
4298 Produce and prototype stmtMerge only when used.
4299 yylex takes a location.
4301 2002-06-30 Akim Demaille <akim@epita.fr>
4303 We spend a lot of time in quotearg, in particular when --verbose.
4305 * src/symtab.c (symbol_get): Store a quoted version of the key.
4306 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
4309 2002-06-30 Akim Demaille <akim@epita.fr>
4311 * src/state.h (reductions_t): Rename member `nreds' as num.
4312 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
4313 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
4315 2002-06-30 Akim Demaille <akim@epita.fr>
4317 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
4318 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
4319 (shifts_to): Rename as...
4320 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
4321 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
4322 (TRANSITION_IS_DISABLED, transitions_to): these.
4324 2002-06-30 Akim Demaille <akim@epita.fr>
4326 * src/print.c (print_shifts, print_gotos): Merge into...
4327 (print_transitions): this.
4328 (print_transitions, print_errs, print_reductions): Align the
4330 (print_core, print_transitions, print_errs, print_state,
4331 print_grammar): Output empty lines separator before, not after.
4332 (state_default_rule_compute): Rename as...
4333 (state_default_rule): this.
4334 * tests/conflicts.at (Defaulted Conflicted Reduction),
4335 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
4336 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
4338 2002-06-30 Akim Demaille <akim@epita.fr>
4340 Display items as we display rules.
4342 * src/gram.h, src/gram.c (rule_lhs_print): New.
4343 * src/gram.c (grammar_rules_partial_print): Use it.
4344 * src/print.c (print_core): Likewise.
4345 * tests/conflicts.at (Defaulted Conflicted Reduction),
4346 (Unresolved SR Conflicts): Adjust.
4347 (Unresolved SR Conflicts): Adjust and rename as...
4348 (Resolved SR Conflicts): this, as was meant.
4349 * tests/regression.at (Web2c Report): Adjust.
4351 2002-06-30 Akim Demaille <akim@epita.fr>
4353 * src/print.c (state_default_rule_compute): New, extracted from...
4354 (print_reductions): here.
4355 Pessimize, but clarify the code.
4356 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
4358 2002-06-30 Akim Demaille <akim@epita.fr>
4360 * src/output.c (action_row): Let default_rule be always a rule
4363 2002-06-30 Akim Demaille <akim@epita.fr>
4365 * src/closure.c (print_firsts, print_fderives, closure):
4367 * src/lalr.c (lookaheads_print): Likewise.
4368 * src/state.c (state_rule_lookaheads_print): Likewise.
4369 * src/print_graph.c (print_core): Likewise.
4370 * src/print.c (print_reductions): Likewise.
4371 * src/output.c (action_row): Likewise.
4372 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
4374 2002-06-30 Akim Demaille <akim@epita.fr>
4376 * src/print_graph.c: Use report_flag.
4378 2002-06-30 Akim Demaille <akim@epita.fr>
4380 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
4382 * src/relation.h, src/relation.c (traverse, relation_digraph)
4383 (relation_print, relation_transpose): New.
4385 2002-06-30 Akim Demaille <akim@epita.fr>
4387 * src/state.h, src/state.c (shifts_to): New.
4388 * src/lalr.c (build_relations): Use it.
4390 2002-06-30 Akim Demaille <akim@epita.fr>
4392 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
4393 (item_number_of_rule_number, rule_number_of_item_number): New.
4394 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
4395 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
4396 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
4397 Propagate their use.
4398 Much remains to be done, in particular wrt `shorts' from types.h.
4400 2002-06-30 Akim Demaille <akim@epita.fr>
4402 * src/symtab.c (symbol_new): Initialize the `printer' member.
4404 2002-06-30 Akim Demaille <akim@epita.fr>
4406 * src/LR0.c (save_reductions): Remove, replaced by...
4407 * src/state.h, src/state.c (state_reductions_set): New.
4408 (reductions, errs): Rename as...
4409 (reductions_t, errs_t): these.
4410 Adjust all dependencies.
4412 2002-06-30 Akim Demaille <akim@epita.fr>
4414 * src/LR0.c (state_list_t, state_list_append): New.
4415 (first_state, last_state): Now symbol_list_t.
4416 (this_state): Remove.
4417 (new_itemsets, append_states, save_reductions): Take a state_t as
4419 (set_states, generate_states): Adjust.
4420 (save_shifts): Remove, replaced by...
4421 * src/state.h, src/state.c (state_shifts_set): New.
4422 (shifts): Rename as...
4424 Adjust all dependencies.
4425 * src/state.h (state_t): Remove the `next' member.
4427 2002-06-30 Akim Demaille <akim@epita.fr>
4429 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
4432 2002-06-30 Akim Demaille <akim@epita.fr>
4434 Use hash.h for the state hash table.
4436 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
4437 (allocate_storage): Use state_hash_new.
4438 (free_storage): Use state_hash_free.
4439 (new_state, get_state): Adjust.
4440 * src/lalr.h, src/lalr.c (states): Move to...
4441 * src/states.h (state_t): Remove the `link' member, no longer
4443 * src/states.h, src/states.c: here.
4444 (state_hash_new, state_hash_free, state_hash_lookup)
4445 (state_hash_insert, states_free): New.
4446 * src/states.c (state_table, state_compare, state_hash): New.
4447 * src/output.c (output_actions): Do not free states now, since we
4448 still need to know the final_state number in `prepare', called
4449 afterwards. Do it...
4450 * src/main.c (main): here: call states_free after `output'.
4452 2002-06-30 Akim Demaille <akim@epita.fr>
4454 * src/state.h, src/state.c (state_new): New, extracted from...
4455 * src/LR0.c (new_state): here.
4456 * src/state.h (STATE_ALLOC): Move to...
4457 * src/state.c: here.
4458 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
4459 * src/state.h, src/state.c: here.
4461 2002-06-30 Akim Demaille <akim@epita.fr>
4463 * src/reader.c (gensym): Rename as...
4464 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
4465 (getsym): Rename as...
4468 2002-06-30 Akim Demaille <akim@epita.fr>
4470 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
4471 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
4472 * src/output.c, src/print.c, src/print_graph.c: Propagate.
4473 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
4475 2002-06-30 Akim Demaille <akim@epita.fr>
4477 Make the test suite pass with warnings checked.
4479 * tests/actions.at (Printers and Destructors): Improve.
4480 Avoid unsigned vs. signed issues.
4481 * tests/calc.at: Don't exercise the scanner here, do it...
4482 * tests/input.at (Torturing the Scanner): here.
4484 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4486 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
4487 reorganize first lines parallel to yacc.c.
4489 2002-06-28 Akim Demaille <akim@epita.fr>
4491 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
4492 (b4_token_enum, b4_token_defines): New, factored from...
4493 * data/lalr1.cc, data/yacc.c, glr.c: here.
4495 2002-06-28 Akim Demaille <akim@epita.fr>
4497 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
4499 * src/output.c (merger_output): static.
4501 2002-06-28 Akim Demaille <akim@epita.fr>
4503 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
4504 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
4506 * src/output.c (save_row): Initialize all the variables to pacify GCC.
4508 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4510 Accumulated changelog for new GLR parsing features.
4512 * src/conflicts.c (count_total_conflicts): Change name to
4513 conflicts_total_count.
4514 * src/conflicts.h: Ditto.
4515 * src/output.c (token_actions): Use the new name.
4516 (output_conflicts): Change conflp => conflict_list_heads, and
4517 confl => conflict_list for better readability.
4518 * data/glr.c: Use the new names.
4519 * NEWS: Add self to GLR announcement.
4521 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
4523 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
4526 * data/bison.glr: Change name to glr.c
4527 * data/glr.c: Renamed from bison.glr.
4528 * data/Makefile.am: Add glr.c
4532 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
4533 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
4535 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4537 * data/bison.glr: Be sure to restore the
4538 current #line when returning to the skeleton contents after having
4539 exposed the input file's #line.
4541 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4543 * data/bison.glr: Bring up to date with changes to bison.simple.
4545 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4547 * data/bison.glr: Correct definitions that use b4_prefix.
4548 Various reformatting.
4549 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
4550 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
4551 yytokenp argument; now part of stack.
4552 (yychar): Define to behave as documented.
4555 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4557 * src/reader.h: Add declaration for free_merger_functions.
4559 * src/reader.c (merge_functions): New variable.
4560 (get_merge_function): New function.
4561 (free_merger_functions): New function.
4562 (readgram): Check for %prec that is not followed by a symbol.
4563 Handle %dprec and %merge declarations.
4564 (packgram): Initialize dprec and merger fields in rules array.
4566 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
4567 conflict_list_cnt, conflict_list_free): New variables.
4568 (table_grow): Also grow conflict_table.
4569 (prepare_rules): Output dprec and merger tables.
4570 (conflict_row): New function.
4571 (action_row): Output conflict lists for GLR parser. Don't use
4572 default reduction in conflicted states for GLR parser so that there
4573 are spaces for the conflict lists.
4574 (save_row): Also save conflict information.
4575 (token_actions): Allocate conflict list.
4576 (merger_output): New function.
4577 (pack_vector): Pack conflict table, too.
4578 (output_conflicts): New function to output yyconflp and yyconfl.
4579 (output_check): Allocate conflict_tos.
4580 (output_actions): Output conflict tables, also.
4581 (output_skeleton): Output b4_mergers definition.
4582 (prepare): Output b4_max_rhs_length definition.
4583 Use 'bison.glr' as default skeleton for GLR parsers.
4585 * src/gram.c (glr_parser): New flag.
4586 (grammar_free): Call free_merger_functions.
4588 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
4589 all pairs of conflicting reductions, rather than just all tokens
4590 causing conflicts. Needed to size conflict tables.
4591 (conflicts_output): Modify call to count_rr_conflicts for new
4593 (conflicts_print): Ditto.
4594 (count_total_conflicts): New function.
4596 * src/reader.h (merger_list): New type.
4597 (merge_functions): New variable.
4599 * src/lex.h (tok_dprec, tok_merge): New token types.
4601 * src/gram.h (rule_s): Add dprec and merger fields.
4602 (glr_parser): New flag.
4604 * src/conflicts.h (count_total_conflicts): New function.
4606 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
4608 * doc/bison.texinfo (Generalized LR Parsing): New section.
4609 (GLR Parsers): New section.
4610 (Language and Grammar): Mention GLR parsing.
4611 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
4612 Correct typo ("tge" -> "the").
4614 * data/bison.glr: New skeleton for GLR parsing.
4616 * tests/cxx-gram.at: New tests for GLR parsing.
4618 * tests/testsuite.at: Include cxx-gram.at.
4620 * tests/Makefile.am: Add cxx-gram.at.
4624 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
4626 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
4628 2002-06-27 Akim Demaille <akim@epita.fr>
4630 * src/options.h, src/options.c: Remove.
4631 * src/getargs.c (short_options, long_options): New.
4633 2002-06-27 Akim Demaille <akim@epita.fr>
4635 * data/bison.simple, data/bison.c++: Rename as...
4636 * data/yacc.c, data/lalr1.cc: these.
4637 * doc/bison.texinfo (Environment Variables): Remove.
4639 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
4641 * src/getargs.c (report_argmatch): Initialize strtok().
4643 2002-06-20 Akim Demaille <akim@epita.fr>
4645 * data/bison.simple (b4_symbol_actions): New, replaces...
4646 (b4_symbol_destructor, b4_symbol_printer): these.
4647 (yysymprint): Be sure to call YYPRINT only for tokens, and using
4650 2002-06-20 Akim Demaille <akim@epita.fr>
4652 * data/bison.simple (yydestructor): Rename as...
4655 2002-06-20 Akim Demaille <akim@epita.fr>
4657 * src/symtab.h, src/symtab.c (symbol_type_set)
4658 (symbol_destructor_set, symbol_precedence_set): The location is
4662 2002-06-20 Akim Demaille <akim@epita.fr>
4664 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
4666 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
4668 * src/symtab.h, src/symtab.c (symbol_class_set)
4669 (symbol_user_token_number_set): Likewise.
4671 Promote complain_at.
4672 * tests/input.at (Type Clashes): Adjust.
4674 2002-06-20 Akim Demaille <akim@epita.fr>
4676 * data/bison.simple (YYLEX): Fix the declaration when
4679 2002-06-20 Akim Demaille <akim@epita.fr>
4681 * data/bison.simple (yysymprint): Don't print the token number,
4683 * tests/actions.at (Destructors): Rename as...
4684 (Printers and Destructors): this.
4685 Also exercise %printer.
4687 2002-06-20 Akim Demaille <akim@epita.fr>
4689 * data/bison.simple (YYDSYMPRINT): New.
4690 Use it to remove many of the #if YYDEBUG/if (yydebug).
4692 2002-06-20 Akim Demaille <akim@epita.fr>
4694 * src/symtab.h, src/symtab.c (symbol_t): printer and
4695 printer_location are new members.
4696 (symbol_printer_set): New.
4697 * src/parse-gram.y (PERCENT_PRINTER): New token.
4698 Handle its associated rule.
4699 * src/scan-gram.l: Adjust.
4700 (handle_destructor_at, handle_destructor_dollar): Rename as...
4701 (handle_symbol_code_at, handle_symbol_code_dollar): these.
4702 * src/output.c (symbol_printers_output): New.
4703 (output_skeleton): Call it.
4704 * data/bison.simple (yysymprint): New. Cannot be named yyprint
4705 since there are already many grammar files with a user `yyprint'.
4706 Replace the calls to YYPRINT to calls to yysymprint.
4707 * tests/calc.at: Adjust.
4708 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
4709 taking advantage of parser very internal details (stack size!).
4711 2002-06-20 Akim Demaille <akim@epita.fr>
4713 * src/scan-gram.l: Complete the scanner with the missing patterns
4715 Use `quote' and `symbol_tag_get' where appropriate.
4717 2002-06-19 Akim Demaille <akim@epita.fr>
4719 * tests/actions.at (Destructors): Augment to test locations.
4720 * data/bison.simple (yydestructor): Pass it the current location
4721 if locations are enabled.
4722 Prototype only when __STDC__ or C++.
4723 Change the argument names to move into the yy name space: there is
4726 2002-06-19 Akim Demaille <akim@epita.fr>
4728 * data/bison.simple (b4_pure_if): New.
4729 Use it instead of #ifdef YYPURE.
4731 2002-06-19 Akim Demaille <akim@epita.fr>
4733 * data/bison.simple (b4_location_if): New.
4734 Use it instead of #ifdef YYLSP_NEEDED.
4736 2002-06-19 Akim Demaille <akim@epita.fr>
4738 Prepare @$ in %destructor, but currently don't bind it in the
4739 skeleton, as %location use is not cleaned up yet.
4741 * src/scan-gram.l (handle_dollar, handle_destructor_at)
4742 (handle_action_at): New.
4743 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
4744 a braced_code_t and a location as additional arguments.
4745 (handle_destructor_dollar): Instead of requiring `b4_eval', just
4746 unquote one when outputting `b4_dollar_dollar'.
4748 * data/bison.simple (b4_eval): Remove.
4749 (b4_symbol_destructor): Adjust.
4750 * tests/input.at (Invalid @n): Adjust.
4752 2002-06-19 Zack Weinberg <zack@codesourcery.com>
4754 * doc/bison.texinfo: Document ability to have multiple
4757 2002-06-18 Akim Demaille <akim@epita.fr>
4759 * src/files.c (compute_base_names): When computing the output file
4760 names from the input file name, strip the directory part.
4762 2002-06-18 Akim Demaille <akim@epita.fr>
4764 * data/bison.simple.new: Comment changes.
4765 Reported by Andreas Schwab.
4767 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
4769 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
4770 there are no `label `yyoverflowlab' defined but not used' warnings
4771 when yyoverflow is defined.
4773 2002-06-18 Akim Demaille <akim@epita.fr>
4775 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
4777 (symbol_destructor_set): Adjust.
4778 * src/output.c (symbol_destructors_output): Output the destructor
4780 Output the symbol name.
4781 * data/bison.simple (b4_symbol_destructor): Adjust.
4783 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
4784 and Akim Demaille <akim@epita.fr>
4786 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
4787 what's left on the stack when the error recovery hits EOF.
4788 * tests/actions.at (Destructors): Complete to exercise this case.
4790 2002-06-17 Akim Demaille <akim@epita.fr>
4792 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
4793 arguments is really empty, not only equal to `[]'.
4794 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
4796 (symbol_destructor_set): New.
4797 * src/output.c (symbol_destructors_output): New.
4798 * src/reader.h (brace_code_t, current_braced_code): New.
4799 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
4800 (handle_dollar): Rename as...
4801 (handle_action_dollar): this.
4802 (handle_destructor_dollar): New.
4803 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
4804 (grammar_declaration): Use it.
4805 * data/bison.simple (yystos): Is always defined.
4806 (yydestructor): New.
4807 * tests/actions.at (Destructors): New.
4808 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
4810 2002-06-17 Akim Demaille <akim@epita.fr>
4812 * src/symlist.h, src/symlist.c (symbol_list_length): New.
4813 * src/scan-gram.l (handle_dollar, handle_at): Compute the
4814 rule_length only when needed.
4815 * src/output.c (actions_output, token_definitions_output): Output
4817 * src/symtab.c: Don't access directly to the symbol tag, use
4819 * src/parse-gram.y: Use symbol_list_free.
4821 2002-06-17 Akim Demaille <akim@epita.fr>
4823 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
4824 (symbol_list_prepend, get_type_name): Move to...
4825 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
4826 (symbol_list_prepend, symbol_list_n_type_name_get): here.
4828 (symbol_list_free): New.
4829 * src/scan-gram.l (handle_dollar): Takes a location.
4830 * tests/input.at (Invalid $n): Adjust.
4832 2002-06-17 Akim Demaille <akim@epita.fr>
4834 * src/reader.h, src/reader.c (symbol_list_new): Export it.
4835 (symbol_list_prepend): New.
4836 * src/parse-gram.y (%union): `list' is a new member.
4837 (symbols.1): New, replaces...
4838 (terms_to_prec.1, nterms_to_type.1): these.
4839 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
4840 Take a location as additional argument.
4843 2002-06-15 Akim Demaille <akim@epita.fr>
4845 * src/parse-gram.y: Move %token in the declaration section so that
4846 we don't depend upon CVS Bison.
4848 2002-06-15 Akim Demaille <akim@epita.fr>
4850 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
4851 * src/print.c (print_core): Use it.
4853 2002-06-15 Akim Demaille <akim@epita.fr>
4855 * src/conflicts.c (log_resolution): Accept the rule involved in
4856 the sr conflicts instead of the lookahead number that points to
4858 (flush_reduce): Accept the current lookahead vector as argument,
4859 instead of the index in LA.
4860 (resolve_sr_conflict): Accept the current number of lookahead
4861 bitset to consider for the STATE, instead of the index in LA.
4862 (set_conflicts): Adjust.
4863 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
4865 2002-06-15 Akim Demaille <akim@epita.fr>
4867 * src/state.h (state_t): Replace the `lookaheadsp' member, a
4868 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
4869 Adjust all dependencies.
4870 * src/lalr.c (initialize_lookaheads): Split into...
4871 (states_lookaheads_count, states_lookaheads_initialize): these.
4874 2002-06-15 Akim Demaille <akim@epita.fr>
4876 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
4878 (grammar_rules_print): here.
4879 * src/reduce.c (reduce_output): Use it.
4880 * tests/reduce.at (Useless Rules, Reduced Automaton)
4881 (Underivable Rules): Adjust.
4883 2002-06-15 Akim Demaille <akim@epita.fr>
4885 Copy BYacc's nice way to report the grammar.
4887 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
4889 Don't print the rules' location, it is confusing and useless.
4890 (rule_print): Use grammar_rhs_print.
4891 * src/print.c (print_grammar): Use grammar_rules_print.
4893 2002-06-15 Akim Demaille <akim@epita.fr>
4895 Complete and rationalize `useless thing' warnings.
4897 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
4898 (symbol_tag_print): New.
4899 Use them everywhere in place of accessing directly the tag member.
4900 * src/gram.h, src/gram.c (rule_print): New.
4901 Use it where a rule used to be printed `by hand'.
4902 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
4903 (reduce_grammar_tables): Report the useless rules.
4904 (reduce_print): Useless things are a warning, not an error.
4906 * tests/reduce.at (Useless Nonterminals, Useless Rules):
4907 (Reduced Automaton, Underivable Rules): Adjust.
4908 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
4909 * tests/conflicts.at (Unresolved SR Conflicts)
4910 (Solved SR Conflicts): Adjust.
4912 2002-06-15 Akim Demaille <akim@epita.fr>
4914 Let symbols have a location.
4916 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
4919 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
4920 Use location_t, not int.
4921 * src/symtab.c (symbol_check_defined): Take advantage of the
4923 * tests/regression.at (Invalid inputs): Adjust.
4925 2002-06-15 Akim Demaille <akim@epita.fr>
4927 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
4928 (input): Don't try to initialize yylloc here, do it in the
4930 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
4931 * src/gram.h (rule_t): Change line and action_line into location
4932 and action_location, of location_t type.
4933 Adjust all dependencies.
4934 * src/location.h, src/location.c (empty_location): New.
4935 * src/reader.h, src/reader.c (grammar_start_symbol_set)
4936 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
4937 (grammar_current_rule_symbol_append)
4938 (grammar_current_rule_action_append): Expect a location as argument.
4939 * src/reader.c (grammar_midrule_action): Adjust to attach an
4940 action's location as dummy symbol location.
4941 * src/symtab.h, src/symtab.c (startsymbol_location): New.
4942 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
4945 2002-06-14 Akim Demaille <akim@epita.fr>
4947 Grammar declarations may be found in the grammar section.
4949 * src/parse-gram.y (rules_or_grammar_declaration): New.
4950 (declarations): Each declaration may end with a semicolon, not
4952 (grammar_declaration): `"%union"'.
4953 (grammar): Branch to rules_or_grammar_declaration.
4955 2002-06-14 Akim Demaille <akim@epita.fr>
4957 * src/main.c (main): Invoke scanner_free.
4959 2002-06-14 Akim Demaille <akim@epita.fr>
4961 * src/output.c (m4_invoke): Extracted from...
4962 (output_skeleton): here.
4965 2002-06-14 Akim Demaille <akim@epita.fr>
4967 * src/parse-gram.y (directives, directive, gram)
4968 (grammar_directives, precedence_directives, precedence_directive):
4970 (declarations, declaration, grammar, grammar_declaration)
4971 (precedence_declaration, precedence_declarator): these.
4972 (symbol_declaration): New.
4974 2002-06-14 Akim Demaille <akim@epita.fr>
4976 * src/files.c (action_obstack): Remove, unused.
4977 (output_obstack): Remove it, and all its dependencies, as it is no
4979 * src/reader.c (epilogue_set): Build the epilogue in the
4981 * src/output.h, src/output.c (muscle_obstack): Move to...
4982 * src/muscle_tab.h, src/muscle_tab.h: here.
4983 (muscle_init): Initialize muscle_obstack.
4985 * src/main.c (main): Call it.
4987 2002-06-14 Akim Demaille <akim@epita.fr>
4989 * src/location.h: New, extracted from...
4990 * src/reader.h: here.
4991 * src/Makefile.am (noinst_HEADERS): Merge into
4992 (bison_SOURCES): this.
4994 * src/parse-gram.y: Use location_t instead of Bison's.
4995 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
4996 Use location_t instead of ints.
4998 2002-06-14 Akim Demaille <akim@epita.fr>
5000 * data/bison.simple, data/bison.c++: Be sure to restore the
5001 current #line when returning to the skeleton contents after having
5002 exposed the input file's #line.
5004 2002-06-12 Akim Demaille <akim@epita.fr>
5006 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
5008 * tests/actions.at (Exotic Dollars): New.
5010 2002-06-12 Akim Demaille <akim@epita.fr>
5012 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
5014 * tests/input.at (Torturing the Scanner): New.
5016 2002-06-11 Akim Demaille <akim@epita.fr>
5018 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
5019 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
5020 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
5021 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
5022 * src/reader.c (reader): Use it.
5024 2002-06-11 Akim Demaille <akim@epita.fr>
5026 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
5028 (scanner_last_string_free): New.
5030 2002-06-11 Akim Demaille <akim@epita.fr>
5032 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
5033 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
5034 (last_string, YY_OBS_FREE): New.
5035 Use them when returning an ID.
5037 2002-06-11 Akim Demaille <akim@epita.fr>
5039 Have Bison grammars parsed by a Bison grammar.
5041 * src/reader.c, src/reader.h (prologue_augment): New.
5042 * src/reader.c (copy_definition): Remove.
5044 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
5045 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
5046 (grammar_current_rule_prec_set, grammar_current_rule_check)
5047 (grammar_current_rule_symbol_append)
5048 (grammar_current_rule_action_append): Export.
5049 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
5050 (symbol_list_action_append): Remove.
5051 Hook the routines from reader.
5052 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
5053 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
5055 * src/reader.c (read_declarations): Remove, unused.
5057 * src/parse-gram.y: Handle the epilogue.
5058 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
5059 (grammar_start_symbol_set): this.
5060 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
5061 * src/reader.c (readgram): Remove, unused.
5062 (reader): Adjust to insert eoftoken and axiom where appropriate.
5064 * src/reader.c (copy_dollar): Replace with...
5065 * src/scan-gram.h (handle_dollar): this.
5066 * src/parse-gram.y: Remove `%thong'.
5068 * src/reader.c (copy_at): Replace with...
5069 * src/scan-gram.h (handle_at): this.
5071 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
5074 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
5077 * src/reader.h, src/reader.c (grammar_rule_end): New.
5079 * src/parse.y (current_type, current_class): New.
5080 Implement `%nterm', `%token' support.
5081 Merge `%term' into `%token'.
5082 (string_as_id): New.
5083 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
5086 * src/parse-gram.y: Be sure to handle properly the beginning of
5089 * src/parse-gram.y: Handle %type.
5090 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
5092 * src/parse-gram.y: More directives support.
5093 * src/options.c: No longer handle source directives.
5095 * src/parse-gram.y: Fix %output.
5097 * src/parse-gram.y: Handle %union.
5098 Use the prologue locations.
5099 * src/reader.c (parse_union_decl): Remove.
5101 * src/reader.h, src/reader.c (epilogue_set): New.
5102 * src/parse-gram.y: Use it.
5104 * data/bison.simple, data/bison.c++: b4_stype is now either not
5105 defined, then default to int, or to the contents of %union,
5106 without `union' itself.
5108 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
5110 * src/output.c (actions_output): Don't output braces, as they are
5111 already handled by the scanner.
5113 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
5114 characters to themselves.
5116 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
5117 that the epilogue has a proper #line.
5119 * src/parse-gram.y: Handle precedence/associativity.
5121 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
5123 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
5124 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
5125 at all to define terminals that cannot be emitted.
5127 * src/scan-gram.l: Escape M4 characters.
5129 * src/scan-gram.l: Working properly with escapes in user
5132 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
5133 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
5135 Use more modest sizes, as for the time being the parser does not
5136 release memory, and therefore the process swallows a huge amount
5139 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
5140 stricter %token grammar.
5142 * src/symtab.h (associativity): Add `undef_assoc'.
5143 (symbol_precedence_set): Do nothing when passed an undef_assoc.
5144 * src/symtab.c (symbol_check_alias_consistence): Adjust.
5146 * tests/regression.at (Invalid %directive): Remove, as it is now
5148 (Invalid inputs): Adjust to the new error messages.
5149 (Token definitions): The new grammar doesn't allow too many
5152 * src/lex.h, src/lex.c: Remove.
5153 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
5154 (copy_character, copy_string2, copy_string, copy_identifier)
5155 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
5156 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
5157 (parse_action): Remove.
5158 * po/POTFILES.in: Adjust.
5160 2002-06-11 Akim Demaille <akim@epita.fr>
5162 * src/reader.c (parse_action): Don't store directly into the
5163 rule's action member: return the action as a string.
5164 Don't require `rule_length' as an argument: compute it.
5165 (grammar_current_rule_symbol_append)
5166 (grammar_current_rule_action_append): New, eved out from
5168 Remove `action_flag', `rulelength', unused now.
5170 2002-06-11 Akim Demaille <akim@epita.fr>
5172 * src/reader.c (grammar_current_rule_prec_set).
5173 (grammar_current_rule_check): New, eved out from...
5175 Remove `xaction', `first_rhs': useless.
5176 * tests/input.at (Type clashes): New.
5177 * tests/existing.at (GNU Cim Grammar): Adjust.
5179 2002-06-11 Akim Demaille <akim@epita.fr>
5181 * src/reader.c (grammar_midrule_action): New, Eved out from
5184 2002-06-11 Akim Demaille <akim@epita.fr>
5186 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
5188 (readgram): Use them as replacement of inlined code, crule and
5191 2002-06-11 Akim Demaille <akim@epita.fr>
5193 * src/reader.c (grammar_end, grammar_symbol_append): New.
5194 (readgram): Use them.
5195 Make the use of `p' as local as possible.
5197 2002-06-10 Akim Demaille <akim@epita.fr>
5199 GCJ's parser requires the tokens to be defined before the prologue.
5201 * data/bison.simple: Output the token definition before the user's
5203 * tests/regression.at (Braces parsing, Duplicate string)
5204 (Mixing %token styles): Check the output from bison.
5205 (Early token definitions): New.
5207 2002-06-10 Akim Demaille <akim@epita.fr>
5209 * src/symtab.c (symbol_user_token_number_set): Don't complain when
5210 assigning twice the same user number to a token, so that we can
5212 * src/lex.c (lex): here.
5213 Also use `symbol_class_set' instead of hand written code.
5214 * src/reader.c (parse_assoc_decl): Likewise.
5216 2002-06-10 Akim Demaille <akim@epita.fr>
5218 * src/symtab.c, src/symtab.c (symbol_class_set)
5219 (symbol_user_token_number_set): New.
5220 * src/reader.c (parse_token_decl): Use them.
5221 Use a switch instead of ifs.
5222 Use a single argument.
5224 2002-06-10 Akim Demaille <akim@epita.fr>
5226 Remove `%thong' support as it is undocumented, unused, duplicates
5227 `%token's job, and creates useless e-mail traffic with people who
5228 want to know what it is, why it is undocumented, unused, and
5229 duplicates `%token's job.
5231 * src/reader.c (parse_thong_decl): Remove.
5232 * src/options.c (option_table): Remove "thong".
5233 * src/lex.h (tok_thong): Remove.
5235 2002-06-10 Akim Demaille <akim@epita.fr>
5237 * src/symtab.c, src/symtab.c (symbol_type_set)
5238 (symbol_precedence_set): New.
5239 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
5240 (value_components_used): Remove, unused.
5242 2002-06-09 Akim Demaille <akim@epita.fr>
5244 Move symbols handling code out of the reader.
5246 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
5248 * src/symtab.h, src/symtab.c: here.
5250 * src/gram.c (start_symbol): Remove: use startsymbol->number.
5251 * src/reader.c (startval): Rename as...
5252 * src/symtab.h, src/symtab.c (startsymbol): this.
5253 * src/reader.c: Adjust.
5255 * src/reader.c (symbol_check_defined, symbol_make_alias)
5256 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5257 (token_translations_init)
5259 * src/symtab.c: here.
5260 * src/reader.c (packsymbols): Move to...
5261 * src/symtab.h, src/symtab.c (symbols_pack): here.
5262 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
5265 2002-06-03 Akim Demaille <akim@epita.fr>
5267 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
5270 2002-06-03 Akim Demaille <akim@epita.fr>
5272 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
5273 structs with non literals.
5274 * src/scan-skel.l: never-interactive.
5275 * src/conflicts.c (enum conflict_resolution_e): No trailing
5277 * src/getargs.c (usage): Split long literal strings.
5278 Reported by Hans Aberg.
5280 2002-05-28 Akim Demaille <akim@epita.fr>
5282 * data/bison.c++: Use C++ ostreams.
5283 (cdebug_): New member.
5285 2002-05-28 Akim Demaille <akim@epita.fr>
5287 * src/output.c (output_skeleton): Be sure to allocate enough room
5288 for `/' _and_ for `\0' in full_skeleton.
5290 2002-05-28 Akim Demaille <akim@epita.fr>
5292 * data/bison.c++: Catch up with bison.simple:
5293 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5294 and Paul Eggert <eggert@twinsun.com>: `error' handing.
5295 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
5298 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5300 * src/output.c (output_skeleton): Put an explicit path in front of
5301 the skeleton file name, rather than relying on the -I directory,
5302 to partially alleviate effects of having a skeleton file lying around
5303 in the current directory.
5305 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5307 * src/conflicts.c (log_resolution): Correct typo:
5308 obstack_printf should be obstack_fgrow1.
5310 2002-05-26 Akim Demaille <akim@epita.fr>
5312 * src/state.h (state_t): `solved_conflicts' is a new member.
5313 * src/LR0.c (new_state): Set it to 0.
5314 * src/conflicts.h, src/conflicts.c (print_conflicts)
5315 (free_conflicts, solve_conflicts): Rename as...
5316 (conflicts_print, conflicts_free, conflicts_solve): these.
5318 * src/conflicts.c (enum conflict_resolution_e)
5319 (solved_conflicts_obstack): New, used by...
5320 (log_resolution): this.
5321 Adjust to attach the conflict resolution to each state.
5322 Complete the description with the precedence/associativity
5324 (resolve_sr_conflict): Adjust.
5325 * src/print.c (print_state): Output its solved_conflicts.
5326 * tests/conflicts.at (Unresolved SR Conflicts)
5327 (Solved SR Conflicts): Exercise --report=all.
5329 2002-05-26 Akim Demaille <akim@epita.fr>
5331 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5332 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5333 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
5334 (token_number_t, item_number_as_token_number)
5335 (token_number_as_item_number, muscle_insert_token_number_table):
5337 (symbol_number_t, item_number_as_symbol_number)
5338 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
5339 these, since it is more appropriate.
5341 2002-05-26 Akim Demaille <akim@epita.fr>
5343 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
5345 * data/bison.simple (yystos) [YYDEBUG]: New.
5346 (yyparse) [YYDEBUG]: Display the symbols which are popped during
5348 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
5350 2002-05-25 Akim Demaille <akim@epita.fr>
5352 * doc/bison.texinfo (Debugging): Split into...
5353 (Tracing): this new section, its former contents, and...
5354 (Understanding): this new section.
5355 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
5357 (report_flag): this.
5358 Adjust all dependencies.
5359 (report_args, report_types, report_argmatch): New.
5360 (usage, getargs): Report/support -r, --report.
5362 (struct option_table_struct): Rename as..,
5363 (struct option_table_s): this.
5364 Rename the `set_flag' member to `flag' to match with getopt_long's
5366 * src/options.c (option_table): Split verbose into an entry for
5367 %verbose, and another for --verbose.
5368 Support --report/-r, so remove -r from the obsolete --raw.
5369 * src/print.c: Attach full item sets and lookaheads reports to
5370 report_flag instead of trace_flag.
5371 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
5373 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5374 and Paul Eggert <eggert@twinsun.com>
5376 * data/bison.simple (yyparse): Correct error handling to conform to
5377 POSIX and yacc. Specifically, after syntax error is discovered,
5378 do not reduce further before shifting the error token.
5379 Clean up the code a bit by removing the labels yyerrdefault,
5380 yyerrhandle, yyerrpop.
5381 * NEWS: Document the above.
5383 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5385 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
5386 type; it isn't always big enough, since it doesn't necessarily
5387 include non-terminals.
5388 (yytranslate): Expand definition of yy_token_number_type, so that
5389 the latter can be removed.
5390 (yy_token_number_type): Remove, only one use.
5391 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
5392 don't use TokenNumberType as element type.
5394 * tests/regression.at: Modify expected output to agree with change
5395 to yyr1 and yytranslate.
5397 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
5399 * src/reader.c (parse_action): Use copy_character instead of
5402 2002-05-13 Akim Demaille <akim@epita.fr>
5404 * tests/regression.at (Token definitions): Prototype yylex and
5407 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5409 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
5410 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
5412 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
5414 2002-05-07 Akim Demaille <akim@epita.fr>
5416 * tests/synclines.at: Be sure to prototype yylex and yyerror to
5419 2002-05-07 Akim Demaille <akim@epita.fr>
5423 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
5424 over the RHS of each rule.
5425 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
5426 * src/state.h (state_t): Member `nitems' is unsigned short.
5427 * src/LR0.c (get_state): Adjust.
5428 * src/reader.c (packgram): Likewise.
5429 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
5431 (muscle_insert_int_table): Remove, unused.
5432 (prepare_rules): Remove `max'.
5434 2002-05-06 Akim Demaille <akim@epita.fr>
5436 * src/closure.c (print_firsts): Display of the symbol tags.
5437 (bitmatrix_print): Move to...
5438 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
5440 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
5442 2002-05-06 Akim Demaille <akim@epita.fr>
5444 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
5447 2002-05-06 Akim Demaille <akim@epita.fr>
5449 * src/LR0.c (new_state, get_state): Instead of using the global
5450 `kernel_size' and `kernel_base', have two new arguments:
5451 `core_size' and `core'.
5454 2002-05-06 Akim Demaille <akim@epita.fr>
5456 * src/reader.c (packgram): No longer end `ritem' with a 0
5457 sentinel: it is not used.
5459 2002-05-05 Akim Demaille <akim@epita.fr>
5461 New experimental feature: display the lookaheads in the report and
5464 * src/print (print_core): When --trace-flag, display the rules
5466 * src/print_graph.c (print_core): Likewise.
5470 2002-05-05 Akim Demaille <akim@epita.fr>
5472 * tests/torture.at (Many lookaheads): New test.
5474 2002-05-05 Akim Demaille <akim@epita.fr>
5476 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
5477 (GENERATE_MUSCLE_INSERT_TABLE): this.
5478 (output_int_table, output_unsigned_int_table, output_short_table)
5479 (output_token_number_table, output_item_number_table): Replace with...
5480 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
5481 (muscle_insert_short_table, muscle_insert_token_number_table)
5482 (muscle_insert_item_number_table): these.
5484 (prepare_tokens): Don't free `translations', since...
5485 * src/reader.h, src/reader.c (grammar_free): do it.
5487 * src/gram.h, src/gram.c (grammar_free): here.
5488 * data/bison.simple, data/bison.c++: b4_token_number_max is now
5491 2002-05-05 Akim Demaille <akim@epita.fr>
5493 * src/output.c (output_unsigned_int_table): New.
5494 (prepare_rules): `i' is unsigned.
5495 `prhs', `rline', `r2' are unsigned int.
5496 Rename muscle `rhs_number_max' as `rhs_max'.
5497 Output muscles `prhs_max', `rline_max', and `r2_max'.
5499 * data/bison.simple, data/bison.c++: Adjust to use these muscles
5500 to compute types instead of constant types.
5501 * tests/regression.at (Web2c Actions): Adjust.
5503 2002-05-04 Akim Demaille <akim@epita.fr>
5505 * src/symtab.h (SALIAS, SUNDEF): Rename as...
5506 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
5507 Adjust dependencies.
5508 * src/output.c (token_definitions_output): Be sure not to output a
5509 `#define 'a'' when fed with `%token 'a' "a"'.
5510 * tests/regression.at (Token definitions): New.
5512 2002-05-03 Paul Eggert <eggert@twinsun.com>
5514 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
5517 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
5519 * Makefile.am (SUBDIRS): Remove intl.
5520 (EXTRA_DIST): Add config/config.rpath.
5522 2002-05-03 Akim Demaille <akim@epita.fr>
5524 * data/bison.simple (m4_if): Don't output empty enums.
5525 And actually, output valid enum definitions :(.
5527 2002-05-03 Akim Demaille <akim@epita.fr>
5529 * configure.bat: Remove, completely obsolete.
5530 * Makefile.am (EXTRA_DIST): Adjust.
5531 Don't distribute config.rpath...
5532 * config/Makefile.am (EXTRA_DIST): Do it.
5534 2002-05-03 Akim Demaille <akim@epita.fr>
5536 * configure.in (GETTEXT_VERSION): New.
5537 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
5539 2002-05-03 Akim Demaille <akim@epita.fr>
5541 * data/bison.simple (b4_token_enum): New.
5542 (b4_token_defines): Use it to output tokens both as #define and
5544 Suggested by Paul Eggert.
5545 * src/output.c (token_definitions_output): Don't output spurious
5548 2002-05-03 Akim Demaille <akim@epita.fr>
5550 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5552 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
5554 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
5555 Update the stack class, give a try to deque as the default container.
5557 2002-05-02 Akim Demaille <akim@epita.fr>
5559 * data/bison.simple (yyparse): Do not implement @$ = @1.
5560 (YYLLOC_DEFAULT): Adjust to do it.
5561 * doc/bison.texinfo (Location Default Action): Fix.
5563 2002-05-02 Akim Demaille <akim@epita.fr>
5565 * src/reader.c (parse_braces): Merge into...
5566 (parse_action): this.
5568 2002-05-02 Akim Demaille <akim@epita.fr>
5570 * configure.in (ALL_LINGUAS): Remove.
5571 * po/LINGUAS, hr.po: New.
5573 2002-05-02 Akim Demaille <akim@epita.fr>
5575 Remove the so called hairy (semantic) parsers.
5577 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
5578 * src/gram.h, src/gram.c (semantic_parser): Remove.
5579 (rule_t): Remove the guard and guard_line members.
5580 * src/lex.h (token_t): remove tok_guard.
5581 * src/options.c (option_table): Remove %guard and %semantic_parser
5583 * src/output.c, src/output.h (guards_output): Remove.
5585 (token_definitions_output): Don't output the `T'
5587 (output_skeleton): Don't output the guards.
5588 * src/files.c, src/files.c (attrsfile): Remove.
5589 * src/reader.c (symbol_list): Remove the guard and guard_line
5591 Adjust dependencies.
5592 (parse_guard): Remove.
5593 * data/bison.hairy: Remove.
5594 * doc/bison.texinfo (Environment Variables): Remove occurrences of
5597 2002-05-02 Akim Demaille <akim@epita.fr>
5599 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
5600 (parse_guard): Rename the formal argument `stack_offset' as
5601 `rule_length', which is more readable.
5603 (copy_at, copy_dollar): Instead of outputting the hard coded
5604 values of $$, $n and so forth, output invocation to b4_lhs_value,
5605 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
5606 Note: this patch partially drops `semantic-parser' support: it
5607 always does `rule_length - n', where semantic parsers ought to
5609 * data/bison.simple, data/bison.c++ (b4_lhs_value)
5610 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
5612 2002-05-02 Akim Demaille <akim@epita.fr>
5614 * configure.in (AC_INIT): Bump to 1.49b.
5615 (AM_INIT_AUTOMAKE): Short invocation.
5617 2002-05-02 Akim Demaille <akim@epita.fr>
5621 2002-05-01 Akim Demaille <akim@epita.fr>
5623 * src/skeleton.h: Remove.
5625 2002-05-01 Akim Demaille <akim@epita.fr>
5627 * src/skeleton.h: Fix the #endif.
5628 Reported by Magnus Fromreide.
5630 2002-04-26 Paul Eggert <eggert@twinsun.com>
5632 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
5633 Define if we define YYSTYPE and YYLTYPE, respectively.
5634 (YYCOPY): Fix [] quoting problem in the non-GCC case.
5636 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
5638 * src/scan-skel.l: Postprocess quadrigraphs.
5640 * src/reader.c (copy_character): New function, used to output
5641 single characters while replacing `[' and `]' with quadrigraphs, to
5642 avoid troubles with M4 quotes.
5643 (copy_comment): Output characters with copy_character.
5644 (read_additionnal_code): Likewise.
5645 (copy_string2): Likewise.
5646 (copy_definition): Likewise.
5648 * tests/calc.at: Exercise M4 quoting.
5650 2002-04-25 Akim Demaille <akim@epita.fr>
5652 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
5653 between `!' and the command.
5654 Reported by Paul Eggert.
5656 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
5658 * tests/calc.at: Exercise prologue splitting.
5660 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
5661 `b4_post_prologue' instead of `b4_prologue'.
5663 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
5665 (output): Free pre_prologue_obstack and post_prologue_obstack.
5666 * src/files.h, src/files.c (attrs_obstack): Remove.
5667 (pre_prologue_obstack, post_prologue_obstack): New.
5668 * src/reader.c (copy_definition): Add a parameter to specify the
5669 obstack to fill, instead of using attrs_obstack unconditionally.
5670 (read_declarations): Pass pre_prologue_obstack to copy_definition if
5671 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
5673 2002-04-23 Paul Eggert <eggert@twinsun.com>
5675 * data/bison.simple: Remove unnecessary commentary and white
5676 space differences from 1_29-branch.
5677 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
5679 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
5680 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
5681 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
5682 constructors or destructors.
5684 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
5686 2002-04-23 Akim Demaille <akim@epita.fr>
5688 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
5689 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
5690 location with columns.
5691 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
5692 All reported by Paul Eggert.
5694 2002-04-22 Akim Demaille <akim@epita.fr>
5696 * src/reduce.c (dump_grammar): Move to...
5697 * src/gram.h, src/gram.c (grammar_dump): here.
5698 Be sure to separate long item numbers.
5699 Don't read the members of a rule's prec if its nil.
5701 2002-04-22 Akim Demaille <akim@epita.fr>
5703 * src/output.c (table_size, table_grow): New.
5704 (MAXTABLE): Remove, replace uses with table_size.
5705 (pack_vector): Instead of dying when the table is too big, grow it.
5707 2002-04-22 Akim Demaille <akim@epita.fr>
5709 * data/bison.simple (yyr1): Its type is that of a token number.
5710 * data/bison.c++ (r1_): Likewise.
5711 * tests/regression.at (Web2c Actions): Adjust.
5713 2002-04-22 Akim Demaille <akim@epita.fr>
5715 * src/reader.c (token_translations_init): 256 is now the default
5716 value for the error token, i.e., it will be assigned another
5717 number if the user assigned 256 to one of her tokens.
5718 (reader): Don't force 256 to error.
5719 * doc/bison.texinfo (Symbols): Adjust.
5720 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
5721 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
5722 etc. instead of 10, 20, 30 (which was used to `jump' over error
5723 (256) and undefined (2)).
5725 2002-04-22 Akim Demaille <akim@epita.fr>
5727 Propagate more token_number_t.
5729 * src/gram.h (token_number_as_item_number)
5730 (item_number_as_token_number): New.
5731 * src/output.c (GENERATE_OUTPUT_TABLE): New.
5732 Use it to create output_item_number_table and
5733 output_token_number_table.
5734 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5735 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
5736 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
5737 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
5739 2002-04-22 Akim Demaille <akim@epita.fr>
5741 * src/output.h, src/output.c (get_lines_number): Remove.
5743 2002-04-19 Akim Demaille <akim@epita.fr>
5745 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
5747 (Debugging): More details about enabling the debugging features.
5748 (Table of Symbols): Describe $$, $n, @$, and @n.
5749 Suggested by Tim Josling.
5751 2002-04-19 Akim Demaille <akim@epita.fr>
5753 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
5755 2002-04-10 Akim Demaille <akim@epita.fr>
5757 * src/system.h: Rely on HAVE_LIMITS_H.
5758 Suggested by Paul Eggert.
5760 2002-04-09 Akim Demaille <akim@epita.fr>
5762 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
5763 full stderr, and strip it according to the bison options, instead
5764 of composing the error message from different bits.
5765 This makes it easier to check for several error messages.
5766 Adjust all the invocations.
5767 Add an invocation exercising the error token.
5768 Add an invocation demonstrating a stupid error message.
5769 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
5771 Error message are for stderr, not stdout.
5773 2002-04-09 Akim Demaille <akim@epita.fr>
5775 * src/gram.h, src/gram.c (error_token_number): Remove, use
5777 * src/reader.c (reader): Don't specify the user token number (2)
5778 for $undefined, as it uselessly prevents using it.
5779 * src/gram.h (token_number_t): Move to...
5780 * src/symtab.h: here.
5781 (state_t.number): Is a token_number_t.
5782 * src/print.c, src/reader.c: Use undeftoken->number instead of
5784 (Even though this 2 is not the same as above: the number of the
5785 undeftoken remains being 2, it is its user token number which
5787 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
5788 `user_token_number_max'.
5789 Output `undef_token_number'.
5790 * data/bison.simple, data/bison.c++: Use them.
5791 Be sure to map invalid yylex return values to
5792 `undef_token_number'. This saves us from gratuitous SEGV.
5794 * tests/conflicts.at (Solved SR Conflicts)
5795 (Unresolved SR Conflicts): Adjust.
5796 * tests/regression.at (Web2c Actions): Adjust.
5798 2002-04-08 Akim Demaille <akim@epita.fr>
5800 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
5802 Remove the duplicate `typedefs'.
5803 (RhsNumberType): Fix the declaration and various other typos.
5805 * data/bison.simple: Use __ofile__.
5806 * src/scan-skel.l: Handle __ofile__.
5808 2002-04-08 Akim Demaille <akim@epita.fr>
5810 * src/gram.h (item_number_t): New, the type of item numbers in
5811 RITEM. Note that it must be able to code symbol numbers as
5812 positive number, and the negation of rule numbers as negative
5814 Adjust all dependencies (pretty many).
5815 * src/reduce.c (rule): Remove this `short *' pointer: use
5817 * src/system.h (MINSHORT, MAXSHORT): Remove.
5819 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
5821 (MAXTABLE): Move to...
5822 * src/output.c (MAXTABLE): here.
5823 (prepare_rules): Use output_int_table to output rhs.
5824 * data/bison.simple, data/bison.c++: Adjust.
5825 * tests/torture.at (Big triangle): Move the limit from 254 to
5827 * tests/regression.at (Web2c Actions): Ajust.
5829 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
5830 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
5831 passes, but produces negative #line number, once fixed, GCC is
5832 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
5834 * src/state.h (state_h): Code input lines on ints, not shorts.
5836 2002-04-08 Akim Demaille <akim@epita.fr>
5838 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
5839 and then the grammar.
5841 2002-04-08 Akim Demaille <akim@epita.fr>
5843 * src/system.h: No longer using strndup.
5845 2002-04-07 Akim Demaille <akim@epita.fr>
5847 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
5848 * src/output.c (output_table_data): Return the longest number.
5849 (prepare_tokens): Output `token_number_max').
5850 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
5852 Use them to define yy_token_number_type/TokenNumberType.
5853 Use this type for yytranslate.
5854 * tests/torture.at (Big triangle): Push the limit from 124 to
5856 * tests/regression.at (Web2c Actions): Adjust.
5858 2002-04-07 Akim Demaille <akim@epita.fr>
5860 * tests/torture.at (Big triangle): New.
5861 (GNU AWK Grammar, GNU Cim Grammar): Move to...
5862 * tests/existing.at: here.
5864 2002-04-07 Akim Demaille <akim@epita.fr>
5866 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
5868 Adjust dependencies.
5870 2002-04-07 Akim Demaille <akim@epita.fr>
5872 * src/reader.c: Normalize increments to prefix form.
5874 2002-04-07 Akim Demaille <akim@epita.fr>
5876 * src/reader.c, symtab.c: Remove debugging code.
5878 2002-04-07 Akim Demaille <akim@epita.fr>
5880 Rename all the `bucket's as `symbol_t'.
5882 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
5883 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
5884 * src/symtab.c, src/symtab.h (bucket): Rename as...
5886 (symbol_list_new, bucket_check_defined, bucket_make_alias)
5887 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
5888 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5889 (buckets_new, buckets_free, buckets_do): Rename as...
5890 (symbol_list_new, symbol_check_defined, symbol_make_alias)
5891 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5892 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
5893 (symbols_new, symbols_free, symbols_do): these.
5895 2002-04-07 Akim Demaille <akim@epita.fr>
5897 Use lib/hash for the symbol table.
5899 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
5901 * src/lex.c (lex): Set the `number' member of new terminals.
5902 * src/reader.c (bucket_check_defined, bucket_make_alias)
5903 (bucket_check_alias_consistence, bucket_translation): New.
5904 (reader, grammar_free, readgram, token_translations_init)
5905 (packsymbols): Adjust.
5906 (reader): Number the predefined tokens.
5907 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
5908 for predefined tokens.
5909 * src/symtab.h (bucket): Remove all the hash table related
5911 * src/symtab.c (symtab): Replace by...
5912 (bucket_table): this.
5913 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5914 (buckets_new, buckets_do): New.
5916 2002-04-07 Akim Demaille <akim@epita.fr>
5918 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
5919 (start_symbol, max_user_token_number, semantic_parser)
5920 (error_token_number): Initialize.
5921 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
5924 (errtoken, eoftoken, undeftoken, axiom): Extern.
5926 2002-04-07 Akim Demaille <akim@epita.fr>
5928 * src/gram.h (rule_s): prec and precsym are now pointers
5929 to the bucket giving the priority/associativity.
5930 Member `associativity' removed: useless.
5931 * src/reduce.c, src/conflicts.c: Adjust.
5933 2002-04-07 Akim Demaille <akim@epita.fr>
5935 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
5936 Properly escape the symbols' TAG when outputting them.
5938 2002-04-07 Akim Demaille <akim@epita.fr>
5940 * src/lalr.h (LA): Is a bitsetv, not bitset*.
5942 2002-04-07 Akim Demaille <akim@epita.fr>
5944 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
5945 (LArule): this, which is an array to rule_t*.
5946 * src/print.c, src/conflicts.c: Adjust.
5948 2002-04-07 Akim Demaille <akim@epita.fr>
5950 * src/gram.h (rule_t): Rename `number' as `user_number'.
5951 `number' is a new member.
5952 Adjust dependencies.
5953 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
5955 2002-04-07 Akim Demaille <akim@epita.fr>
5957 As a result of the previous patch, it is no longer needed
5958 to reorder ritem itself.
5960 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
5962 2002-04-07 Akim Demaille <akim@epita.fr>
5964 Be sure never to walk through RITEMS, but use only data related to
5965 the rules themselves. RITEMS should be banished.
5967 * src/output.c (output_token_translations): Rename as...
5968 (prepare_tokens): this.
5969 In addition to `translate', prepare the muscles `tname' and
5970 `toknum', which were handled by...
5971 (output_rule_data): this.
5972 Remove, and move the remainder of its outputs into...
5973 (prepare_rules): this new routines, which also merges content from
5974 (output_gram): this.
5975 (prepare_rules): Be sure never to walk through RITEMS.
5976 (output_stos): Rename as...
5977 (prepare_stos): this.
5978 (output): Always invoke prepare_states, after all, just don't use it
5979 in the output if you don't need it.
5981 2002-04-07 Akim Demaille <akim@epita.fr>
5983 * src/LR0.c (new_state): Display `nstates' as the name of the
5984 newly created state.
5985 Adjust to initialize first_state and last_state if needed.
5986 Be sure to distinguish the initial from the final state.
5987 (new_states): Create the itemset of the initial state, and use
5989 * src/closure.c (closure): Now that the initial state has its
5990 items properly set, there is no need for a special case when
5993 As a result, now the rule 0, reducing to $axiom, is visible in the
5994 outputs. Adjust the test suite.
5996 * tests/conflicts.at (Solved SR Conflicts)
5997 (Unresolved SR Conflicts): Adjust.
5998 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
5999 * tests/conflicts.at (S/R in initial): New.
6001 2002-04-07 Akim Demaille <akim@epita.fr>
6003 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
6004 the RHS of the rules.
6005 * src/output.c (output_gram): Likewise.
6007 2002-04-07 Akim Demaille <akim@epita.fr>
6009 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
6011 Adjust all dependencies.
6012 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
6013 `number' of the buckets too.
6014 * src/gram.h: Include `symtab.h'.
6015 (associativity): Move to...
6016 * src/symtab.h: here.
6017 No longer include `gram.h'.
6019 2002-04-07 Akim Demaille <akim@epita.fr>
6021 * src/gram.h, src/gram.c (rules_rhs_length): New.
6022 (ritem_longest_rhs): Use it.
6023 * src/gram.h (rule_t): `number' is a new member.
6024 * src/reader.c (packgram): Set it.
6025 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
6026 the end of `rules', and count them out of `nrules'.
6027 (reduce_output, dump_grammar): Adjust.
6028 * src/print.c (print_grammar): It is no longer needed to check for
6029 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
6030 * tests/reduce.at (Reduced Automaton): New test.
6032 2002-04-07 Akim Demaille <akim@epita.fr>
6034 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
6035 lacking `+ 1' to nrules, Bison reported as useless a token if it
6036 was used solely to set the precedence of the last rule...
6038 2002-04-07 Akim Demaille <akim@epita.fr>
6040 * data/bison.c++, data/bison.simple: Don't output the current file
6041 name in #line, to avoid useless diffs between two identical
6042 outputs under different names.
6044 2002-04-07 Akim Demaille <akim@epita.fr>
6046 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
6047 Normalize loops to using `< nrules + 1', not `<= nrules'.
6049 2002-04-07 Akim Demaille <akim@epita.fr>
6053 2002-04-07 Akim Demaille <akim@epita.fr>
6055 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
6056 bucket.value as bucket.number.
6058 2002-04-07 Akim Demaille <akim@epita.fr>
6060 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
6061 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
6062 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
6063 RHS, instead of being an index in RITEMS.
6065 2002-04-04 Paul Eggert <eggert@twinsun.com>
6067 * doc/bison.texinfo: Update copyright date.
6068 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
6069 (Symbols): Warn about running Bison in one character set,
6070 but compiling and/or running in an incompatible one.
6071 Warn about character code 256, too.
6073 2002-04-03 Paul Eggert <eggert@twinsun.com>
6075 * src/bison.data (YYSTACK_ALLOC): Depend on whether
6076 YYERROR_VERBOSE is nonzero, not whether it is defined.
6078 Merge changes from bison-1_29-branch.
6080 2002-03-20 Paul Eggert <eggert@twinsun.com>
6082 Merge fixes from Debian bison_1.34-1.diff.
6084 * configure.in (AC_PREREQ): 2.53.
6086 2002-03-20 Akim Demaille <akim@epita.fr>
6088 * src/conflicts.c (log_resolution): Argument `resolution' is const.
6090 2002-03-19 Paul Eggert <eggert@twinsun.com>
6092 * src/bison.simple (YYCOPY): New macro.
6093 (YYSTACK_RELOCATE): Use it.
6094 Remove Type arg; no longer needed. All callers changed.
6095 (yymemcpy): Remove; no longer needed.
6097 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
6098 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
6100 2002-03-19 Akim Demaille <akim@epita.fr>
6102 Test and fix the #line outputs.
6104 * tests/atlocal.at (GCC): New.
6105 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
6106 (Prologue synch line, ,%union synch line, Postprologue synch line)
6107 (Action synch line, Epilogue synch line): New tests.
6108 * src/reader.c (parse_union_decl): Define the muscle stype_line.
6109 * data/bison.simple, data/bison.c++: Use it.
6111 2002-03-19 Akim Demaille <akim@epita.fr>
6113 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
6114 (Solved SR Conflicts, %expect not enough, %expect right)
6115 (%expect too much): Move to...
6116 * tests/conflicts.at: this new file.
6118 2002-03-19 Akim Demaille <akim@epita.fr>
6120 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
6121 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
6122 that we can move to enums for instance.
6123 * src/output.c (token_definitions_output): Output a list of
6124 `token-name, token-number' instead of the #define.
6125 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
6127 2002-03-14 Akim Demaille <akim@epita.fr>
6131 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
6133 * data/bison.c++: Make the user able to add members to the generated
6134 parser by subclassing.
6136 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
6138 * src/reader.c (read_additionnal_code): `c' should be an integer, not
6140 Reported by Nicolas Tisserand and Nicolas Burrus.
6142 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
6144 * src/reader.c: Warn about lacking semi-colons, do not complain.
6146 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
6148 * data/bison.c++: Remove a debug line.
6150 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
6152 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
6153 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
6154 provide a default implementation.
6156 2002-03-04 Akim Demaille <akim@epita.fr>
6158 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
6159 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
6160 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
6161 * tests/semantic.at (Parsing Guards): Similarly.
6162 * src/reader.at (readgram): Complain if the last rule is not ended
6165 2002-03-04 Akim Demaille <akim@epita.fr>
6167 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
6168 * src/closure.c: here.
6169 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
6171 * src/warshall.h, src/warshall.c: Remove.
6172 * tests/sets.at (Broken Closure): Adjust.
6174 2002-03-04 Akim Demaille <akim@epita.fr>
6176 * src/output.c (output_skeleton): tempdir is const.
6177 bytes_read is unused.
6179 2002-03-04 Akim Demaille <akim@epita.fr>
6181 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6182 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
6186 2002-03-04 Akim Demaille <akim@epita.fr>
6188 * src/closure.c (closure): `r' is unused.
6190 2002-03-04 Akim Demaille <akim@epita.fr>
6192 * tests/sets.at (Broken Closure): Add the ending `;'.
6193 * src/reader.at (readgram): Complain if a rule is not ended with a
6196 2002-03-04 Akim Demaille <akim@epita.fr>
6198 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
6199 (count_sr_conflicts): Use bitset_count.
6200 * src/reduce.c (inaccessable_symbols): Ditto.
6201 (bits_size): Remove.
6202 * src/warshall.h, src/warshall.c: Convert to bitsetv.
6204 2002-03-04 Akim Demaille <akim@epita.fr>
6206 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
6207 * src/reduce.c: Remove the `bitset_zero's following the
6208 `bitset_create's, as now it is performed by the latter.
6210 2002-03-04 Akim Demaille <akim@epita.fr>
6212 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
6213 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
6214 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
6215 latest sources from Michael.
6217 2002-03-04 Akim Demaille <akim@epita.fr>
6219 * src/output.c (output): Don't free the grammar.
6220 * src/reader.c (grammar_free): New.
6221 * src/main.c (main): Call it and don't free symtab here.
6223 2002-03-04 Akim Demaille <akim@epita.fr>
6225 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
6227 Reported by Benoit Perrot.
6229 2002-03-04 Akim Demaille <akim@epita.fr>
6231 Use bitset operations when possible, not loops over bits.
6233 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
6235 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
6236 * src/reduce.c (useless_nonterminals): Formatting changes.
6237 * src/warshall.c (TC): Use bitset_or.
6239 2002-03-04 Akim Demaille <akim@epita.fr>
6241 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
6242 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
6245 2002-03-04 Akim Demaille <akim@epita.fr>
6247 * src/lalr.c (F): Now a bitset*.
6248 Adjust all dependencies.
6250 2002-03-04 Akim Demaille <akim@epita.fr>
6252 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
6253 Adjust all dependencies.
6255 2002-03-04 Akim Demaille <akim@epita.fr>
6257 * src/L0.c, src/LR0.h (nstates): Be size_t.
6258 Adjust comparisons (signed vs unsigned).
6259 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
6261 Adjust all dependencies.
6263 2002-03-04 Akim Demaille <akim@epita.fr>
6265 * src/closure.c (firsts): Now, also a bitset.
6266 Adjust all dependencies.
6267 (varsetsize): Remove, now unused.
6268 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
6270 2002-03-04 Akim Demaille <akim@epita.fr>
6272 * src/print.c: Convert to use bitset.h, not hand coded iterations
6275 2002-03-04 Akim Demaille <akim@epita.fr>
6277 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
6279 2002-03-04 Akim Demaille <akim@epita.fr>
6281 * src/closure.c (ruleset): Be a bitset.
6282 (rulesetsize): Remove.
6284 2002-03-04 Akim Demaille <akim@epita.fr>
6286 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6287 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
6288 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
6289 * src/closure.c (fderives): Be an array of bitsets.
6291 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
6293 * data/bison.c++: Merge the two generated headers. Insert a copyright
6294 notice in each output file.
6296 2002-02-28 Akim Demaille <akim@epita.fr>
6298 * data/bison.c++: Copy the prologue of bison.simple to fetch
6299 useful M4 definitions, such as b4_header_guard.
6301 2002-02-25 Akim Demaille <akim@epita.fr>
6303 * src/getargs.c (version): Give the name of the authors, and use a
6304 translator friendly scheme for the bgr
6307 2002-02-25 Akim Demaille <akim@epita.fr>
6309 * src/output.c (header_output): Remove, now handled completely via
6312 2002-02-25 Akim Demaille <akim@epita.fr>
6314 * m4/m4.m4: New, from CVS Autoconf.
6315 * configure.in: Invoke it.
6316 * src/output.c (output_skeleton): Use its result instead of the
6319 2002-02-25 Akim Demaille <akim@epita.fr>
6321 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
6323 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
6324 * src/output.c (output_skeleton): Use mkstemp to create a real
6326 Move the filling of `skeleton' and its muscle to...
6328 (output): Move the definition of the prologue muscle to...
6330 * src/system.h (DEFAULT_TMPDIR): New.
6332 2002-02-14 Paul Eggert <eggert@twinsun.com>
6334 Remove the support for C++ namespace cleanliness; it was
6335 causing more problems than it was curing, since it didn't work
6336 properly on some nonstandard C++ compilers. This can wait
6337 for a proper C++ parser.
6339 * NEWS: Document this.
6340 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
6341 of C++, as it's treated like C now.
6342 * src/bison.simple (YYSTD): Remove.
6343 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
6344 Treat C++ just like Standard C instead of trying to support
6345 namespace cleanliness.
6347 2002-02-14 Akim Demaille <akim@epita.fr>
6349 * tests/regression.at (else): Adjust to Andreas' change.
6351 2002-02-14 Akim Demaille <akim@epita.fr>
6353 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
6355 2002-02-13 Andreas Schwab <schwab@suse.de>
6357 * src/output.c (output_rule_data): Don't output NULL, it might
6360 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
6362 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
6363 (Copyright notice): Update.
6365 2002-02-11 Akim Demaille <akim@epita.fr>
6367 * tests/regression.at (%nonassoc and eof): Don't include
6368 nonportable headers.
6370 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
6372 * data/bison.c++: Correct error recovery. Make the user able to
6373 initialize the starting location.
6375 2002-02-07 Akim Demaille <akim@epita.fr>
6377 * tests/input.at: New.
6379 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6381 * data/bison.c++: Replace some direct m4 expansions by constants. Be
6382 more consistent when naming methods and variables. Put preprocessor
6383 directives around tables only needed for debugging.
6385 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6387 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
6389 (yy::b4_name::parse): Use print_.
6391 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6393 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
6395 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6397 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
6399 (yy::b4_name::parse): Build verbose error messages, and use error_.
6401 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
6403 * data/bison.c++: Fix m4 quoting in comments.
6405 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
6407 * data/bison.c++: Adjust the parser code. Fix some muscles that were
6410 2002-02-05 Akim Demaille <akim@epita.fr>
6412 * data/bison.c++: Adjust to the M4 back end.
6413 More is certainly needed.
6415 2002-02-05 Akim Demaille <akim@epita.fr>
6417 Give a try to M4 as a back end.
6419 * lib/readpipe.c: New, from wdiff.
6420 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
6422 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
6423 specific values. Now it is m4 that performs the lookup.
6424 * src/parse-skel.y: Remove.
6425 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
6426 * src/output.c (actions_output, guards_output)
6427 (token_definitions_output): No longer keeps track of the output
6428 line number, hence remove the second argument.
6429 (guards_output): Check against the guard member of a rule, not the
6432 (output_skeleton): Don't look for the skeleton location, let m4 do
6434 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
6436 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
6437 (prepare): Given that for the time being changesyntax is not
6438 usable in M4, rename the muscles using `-' to `_'.
6439 Define `defines_flag', `output_parser_name' and `output_header_name'.
6440 * src/output.h (actions_output, guards_output)
6441 (token_definitions_output): Adjust prototypes.
6442 * src/scan-skel.l: Instead of scanning the skeletons, it now
6443 processes the output of m4: `__oline__' and `#output'.
6444 * data/bison.simple: Adjust to be used by M4(sugar).
6445 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
6447 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
6448 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
6449 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
6450 shamelessly stolen from CVS Autoconf.
6452 2002-02-05 Akim Demaille <akim@epita.fr>
6454 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
6455 * configure.in: Check for the declarations of free and malloc.
6456 * src/muscle_tab.c: Adjust.
6458 2002-02-05 Akim Demaille <akim@epita.fr>
6460 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
6461 which have no values.
6463 2002-02-05 Akim Demaille <akim@epita.fr>
6465 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
6468 2002-01-29 Paul Eggert <eggert@twinsun.com>
6470 * src/bison.simple (YYSIZE_T): Do not define merely because
6471 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
6472 On some platforms, <alloca.h> does not declare YYSTD (size_t).
6474 2002-01-27 Akim Demaille <akim@epita.fr>
6476 Fix `%nonassoc and eof'.
6478 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
6479 which were not properly copied! Replace
6480 memcpy (res->errs, src->errs, src->nerrs);
6482 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
6484 * tests/regression.at (%nonassoc and eof): Adjust to newest
6485 Autotest: `.' is not in the PATH.
6487 2002-01-27 Akim Demaille <akim@epita.fr>
6489 * tests/sets.at (AT_EXTRACT_SETS): New.
6493 2002-01-26 Akim Demaille <akim@epita.fr>
6495 * tests/actions.at, tests/calc.at, tests/headers.at,
6496 * tests/torture.at: Adjust to the newest Autotest which no longer
6497 forces `.' in the PATH.
6499 2002-01-25 Akim Demaille <akim@epita.fr>
6501 * tests/regression.at (%nonassoc and eof): New.
6502 Suggested by Robert Anisko.
6504 2002-01-24 Akim Demaille <akim@epita.fr>
6506 Bison dumps core when trying to complain about broken input files.
6507 Reported by Cris van Pelt.
6509 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
6510 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
6512 (Invalid inputs): Strengthen: exercise parse_percent_token.
6514 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
6516 * src/Makefile.am: Add bison.c++.
6517 * src/bison.c++: New skeleton.
6519 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
6523 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
6525 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
6527 2002-01-20 Marc Autret <marc@gnu.org>
6529 * src/files.c (compute_output_file_names): Fix
6531 2002-01-20 Marc Autret <marc@gnu.org>
6533 * tests/output.at: New test.
6534 * src/files.c (compute_base_names): Don't map extensions when
6535 the YACC flag is set, use defaults.
6536 Reported by Evgeny Stambulchik.
6538 2002-01-20 Marc Autret <marc@gnu.org>
6540 * src/system.h: Need to define __attribute__ away for non-GCC
6541 compilers as well (i.e. the vendor C compiler).
6542 Suggested by Albert Chin-A-Young.
6544 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
6546 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
6547 canonical definition.
6548 * src/system.h: Use the canonical definition for PARAMS (avoids
6549 a conflict with the macro from lib/hash.h).
6551 2002-01-11 Akim Demaille <akim@epita.fr>
6553 * configure.in: Use AC_FUNC_STRNLEN.
6554 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
6556 2002-01-09 Akim Demaille <akim@epita.fr>
6558 * src/files.c, src/files.h (output_infix): New.
6559 (tab_extension): Remove.
6560 (compute_base_names): Compute the former, drop the latter.
6561 * src/output.c (prepare): Insert the muscles `output-infix', and
6563 * src/parse-skel.y (string, string.1): New.
6564 (section.header): Use it.
6565 (section.yacc): Remove.
6566 (prefix): Remove too.
6567 * src/scan-skel.l: Adjust.
6568 * src/bison.simple, src/bison.hairy: Adjust.
6570 2002-01-09 Akim Demaille <akim@epita.fr>
6572 * configure.in (WERROR_CFLAGS): Compute it.
6573 * src/Makefile.am (CFLAGS): Pass it.
6574 * tests/atlocal.in (CFLAGS): Idem.
6575 * src/files.c: Fix a few warnings.
6576 (get_extension_index): Remove, unused.
6578 2002-01-08 Akim Demaille <akim@epita.fr>
6580 * src/getargs.c (AS_FILE_NAME): New.
6581 (getargs): Use it to convert DOSish file names.
6582 * src/files.c (base_name): Rename as full_base_name to avoid
6583 clashes with `base_name ()'.
6584 (filename_split): New.
6585 (compute_base_names): N-th rewrite, using filename_split.
6587 2002-01-08 Akim Demaille <akim@epita.fr>
6589 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
6590 New, stolen from the Fileutils 4.1.
6591 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
6592 * configure.in: Check for the presence of memrchr, and of its
6595 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
6597 * lib/hash.h (__P): Added definition for this macro.
6598 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
6599 BUILT_SOURCES, to ensure they are generated first.
6600 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
6601 %error-verbose to allow bootstrapping with bison 1.30x.
6603 2002-01-06 Akim Demaille <akim@epita.fr>
6605 * src/reader.c (parse_braces): Don't fetch the next char, the
6606 convention is to fetch on entry.
6607 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
6608 'switch' without a following semicolon.
6609 * tests/regression.at (braces parsing): New.
6611 2002-01-06 Akim Demaille <akim@epita.fr>
6613 Bison is dead wrong in its RR conflict reports.
6615 * tests/torture.at (GNU Cim Grammar): New.
6616 * src/conflicts.c (count_rr_conflicts): Fix.
6618 2002-01-06 Akim Demaille <akim@epita.fr>
6620 Creating package.m4 from configure.ac causes too many problems.
6622 * tests/Makefile.am (package.m4): Create it by hand,
6623 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
6625 2002-01-06 Akim Demaille <akim@epita.fr>
6627 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
6630 2002-01-04 Paul Eggert <eggert@twinsun.com>
6632 * doc/bison.texinfo (Debugging):
6633 Remove YYSTDERR; it's no longer defined or used.
6634 Also, s/cstdio.h/cstdio/.
6636 2002-01-03 Akim Demaille <akim@epita.fr>
6638 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
6640 2002-01-03 Akim Demaille <akim@epita.fr>
6642 * src/parse-skel.y (process_skeleton): Don't bind the parser's
6643 tracing code to --trace, wait for a better --trace option, with
6646 2002-01-03 Akim Demaille <akim@epita.fr>
6648 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
6649 The ISO C++ standard is extremely clear about it: stderr is
6650 considered a macro, not a regular symbol (see table 94 `Header
6651 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
6652 Therefore std:: does not apply to it. It still does with fprintf.
6653 Also, s/cstdio.h/cstdio/.
6655 2002-01-03 Akim Demaille <akim@epita.fr>
6657 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
6658 for non system headers.
6660 2002-01-02 Akim Demaille <akim@epita.fr>
6662 Equip the skeleton chain with location tracking, runtime trace,
6663 pure parser and scanner.
6665 * src/parse-skel.y: Request a pure parser, locations, and prefix
6667 (%union): Having several members with the same type does not help
6668 type mismatches, simplify.
6669 (YYPRINT, yyprint): New.
6670 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
6673 * src/scan-skel.l: Adjust to these changes.
6674 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
6675 (LOCATION_PRINT, skel_control_t): New.
6677 2001-12-30 Akim Demaille <akim@epita.fr>
6679 * src/parse-skel.y: Get rid of the shift/reduce conflict:
6680 replace `gb' with BLANKS.
6681 * src/scan-skel.l: Adjust.
6683 2001-12-30 Akim Demaille <akim@epita.fr>
6685 * src/system.h: We don't need nor want bcopy.
6686 Throw away MS-DOS crap: we don't need getpid.
6687 * configure.in: We don't need strndup. It was even causing
6688 problems: because Flex includes the headers *before* us,
6689 _GNU_SOURCE is not defined by config.h, and therefore strndup was
6691 * lib/xstrndup.c: New.
6692 * src/scan-skel.l: Use it.
6693 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
6694 * src/parse-skel.y: Use %directives instead of #defines.
6696 2001-12-30 Akim Demaille <akim@epita.fr>
6698 * src/skeleton.h: New.
6699 * src/output.c (output_parser, output_master_parser): Remove, dead
6701 * src/output.h (get_lines_number, actions_output, guards_output)
6702 (token_definitions_output): Prototype them.
6703 * src/parse-skel.y: Add the license notice.
6704 Include output.h and skeleton.h.
6705 (process_skeleton): Returns void, and takes a single parameter.
6706 * src/scan-skel.l: Add the license notice.
6708 Don't use %option yylineno: it seems that then Flex imagines
6709 REJECT has been used, and therefore it won't reallocate its
6710 buffers (which makes no other sense to me than a bug). It results
6711 in warnings for `unused: yy_flex_realloc'.
6713 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
6715 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6716 (MUSCLE_INSERT_PREFIX): ...to there.
6717 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6718 (MUSCLE_INSERT_PREFIX): Move from here...
6720 * src/bison.hairy: Add a section directive. Put braces around muscle
6721 names. This parser skeleton is still broken, but Bison should not
6722 choke on a bad muscle 'syntax'.
6723 * src/bison.simple: Add a section directive. Put braces around muscle
6726 * src/files.h (strsuffix, stringappend): Add declarations.
6727 (tab_extension): Add declaration.
6728 (short_base_name): Add declaration.
6730 * src/files.c (strsuffix, stringappend): No longer static. These
6731 functions are used in the skeleton parser.
6732 (tab_extension): New.
6733 (compute_base_names): Use the computations done in this function
6734 to guess if the generated parsers should have '.tab' in their
6736 (short_base_name): No longer static.
6738 * src/output.c (output_skeleton): New.
6739 (output): Disable call to output_master_parser, and give a try to
6740 a new skeleton handling system.
6741 (guards_output, actions_output): No longer static.
6742 (token_definitions_output, get_lines_number): No longer static.
6744 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
6746 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
6749 * src/parse-skel.y: New file.
6750 * src/scan-skel.l: New file.
6752 2001-12-29 Akim Demaille <akim@epita.fr>
6754 %name-prefix is broken.
6756 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
6757 Adjust all dependencies.
6758 * tests/headers.at (export YYLTYPE): Strengthen this test: use
6761 Renaming yylval but not yylloc is not consistent. Now we do.
6763 * src/bison.simple: Prefix yylloc if used.
6764 * doc/bison.texinfo (Decl Summary): Document that.
6766 2001-12-29 Akim Demaille <akim@epita.fr>
6768 * doc/bison.texinfo: Promote `%long-directive' over
6770 Remove all references to fixed-output-files, yacc is enough.
6772 2001-12-29 Akim Demaille <akim@epita.fr>
6774 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
6775 user prologue. These are defaults.
6776 * tests/actions.at (Mid-rule actions): Make sure the user can
6777 define YYDEBUG and YYERROR_VERBOSE.
6779 2001-12-29 Akim Demaille <akim@epita.fr>
6781 * src/output.c (header_output): Don't forget to export YYLTYPE and
6783 * tests/headers.at (export YYLTYPE): New, make sure it does.
6784 * tests/regression.at (%union and --defines, Invalid CPP headers):
6786 * tests/headers.at: here.
6788 2001-12-29 Akim Demaille <akim@epita.fr>
6790 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
6792 2001-12-29 Akim Demaille <akim@epita.fr>
6794 * tests/actions.at (Mid-rule actions): Output on a single line
6797 2001-12-29 Akim Demaille <akim@epita.fr>
6799 * doc/bison.texinfo: Formatting changes.
6801 2001-12-29 Akim Demaille <akim@epita.fr>
6803 Don't store the token defs in a muscle, just be ready to output it
6804 on command. Now possible via `symbols'. Fixes a memory leak.
6806 * src/output.c (token_definitions_output): New.
6807 (output_parser, header_output): Use it.
6808 * src/reader.c (symbols_save): Remove.
6810 2001-12-29 Akim Demaille <akim@epita.fr>
6812 * src/bison.simple: Do not provide a default for YYSTYPE and
6813 YYLTYPE before the user's prologue. Otherwise it's hardly... a
6816 2001-12-29 Akim Demaille <akim@epita.fr>
6818 Mid-rule actions are simply... ignored!
6820 * src/reader.c (readgram): Be sure to attach mid-rule actions to
6821 the empty-rule associated to the dummy symbol, not to the host
6823 * tests/actions.at (Mid-rule actions): New.
6825 2001-12-29 Akim Demaille <akim@epita.fr>
6829 * src/reader.c (reader): Free grammar.
6831 2001-12-29 Akim Demaille <akim@epita.fr>
6835 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
6836 since it allocates it for each state, although only one is needed.
6837 (allocate_storage): Do it here.
6839 2001-12-29 Akim Demaille <akim@epita.fr>
6841 * src/options.h, src/options.c (create_long_option_table): Rename
6843 (long_option_table_new): this, with a clearer prototype.
6844 (percent_table): Remove, unused,
6845 * src/getargs.c (getargs): Adjust.
6847 2001-12-29 Akim Demaille <akim@epita.fr>
6849 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
6850 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
6853 2001-12-29 Akim Demaille <akim@epita.fr>
6855 * src/lalr.c (build_relations): Rename `states' as `states1'.
6856 Sorry, I don't understand exactly what it is, no better name...
6858 2001-12-29 Akim Demaille <akim@epita.fr>
6860 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
6861 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
6862 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
6865 2001-12-29 Akim Demaille <akim@epita.fr>
6867 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
6870 2001-12-29 Akim Demaille <akim@epita.fr>
6872 * src/reader.c, src/reader.h (user_toknums): Remove.
6873 Adjust all users to use symbols[i]->user_token_number.
6875 2001-12-29 Akim Demaille <akim@epita.fr>
6877 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
6878 Adjust all users to use symbols[i]->prec or ->assoc.
6880 2001-12-29 Akim Demaille <akim@epita.fr>
6882 * src/reader.c, src/reader.h (tags): Remove.
6883 Adjust all users to use symbols[i]->tag.
6885 2001-12-29 Akim Demaille <akim@epita.fr>
6887 * src/gram.h, src/gram.c (symbols): New, similar to state_table
6889 * src/reader.c (packsymbols): Fill this table.
6891 * src/conflicts.c (resolve_sr_conflict): Adjust.
6892 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
6894 Use symbols[i]->tag instead of tags[i].
6896 2001-12-29 Akim Demaille <akim@epita.fr>
6898 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
6899 In addition, put a comment in there, to replace...
6900 * tests/regression.at (%union and C comments): Remove.
6902 2001-12-29 Akim Demaille <akim@epita.fr>
6904 * tests/regression.at (Web2c Actions): Blindly move the actual
6905 output as expected output. The contents *seem* right to me, but I
6906 can't pretend reading perfectly parser tables... Nonetheless, all
6907 the other tests pass correctly, the table look OK, even though the
6908 presence of `$axiom' is to be noted: AFAICS it is useless (but
6911 2001-12-29 Akim Demaille <akim@epita.fr>
6913 * src/reader.c (readgram): Don't add the rule 0 if there were no
6914 rules read. In other words, add it _after_ having performed
6915 grammar sanity checks.
6916 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
6918 2001-12-29 Akim Demaille <akim@epita.fr>
6920 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
6921 visible, and some states have now a different number.
6923 2001-12-29 Akim Demaille <akim@epita.fr>
6925 * src/reader.c (readgram): Bind the initial rule's lineno to that
6927 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
6928 (Solved SR Conflicts): Adjust rule 0's line number.
6930 2001-12-29 Akim Demaille <akim@epita.fr>
6932 Fix the `GAWK Grammar' failure.
6934 * src/LR0.c (final_state): Initialize to -1 so that we do compute
6935 the reductions of the first state which was mistakenly confused
6936 with the final state because precisely final_state was initialized
6938 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
6939 now noticed by Bison.
6940 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
6941 have a reduction on $default.
6943 2001-12-29 Akim Demaille <akim@epita.fr>
6945 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
6947 * src/closure.c (print_closure): Likewise.
6948 * src/derives.c (print_derives): Likewise.
6949 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
6952 2001-12-29 Akim Demaille <akim@epita.fr>
6954 * src/lalr.c (lookaheads_print): New.
6955 (lalr): Call it when --trace-flag.
6956 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
6959 2001-12-29 Akim Demaille <akim@epita.fr>
6961 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
6962 when walking through ritem, even via rule->rhs.
6963 * src/reduce.c (dump_grammar, useful_production, reduce_output)
6964 (useful_production, useless_nonterminals): Likewise.
6965 (reduce_grammar_tables): Likewise, plus update nritems.
6966 * src/nullable.c (set_nullable): Likewise.
6967 * src/lalr.c (build_relations): Likewise.
6968 * tests/sets.at (Nullable): Adjust.
6969 Fortunately, now, the $axiom is no longer nullable.
6971 2001-12-29 Akim Demaille <akim@epita.fr>
6973 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
6975 * src/gram.c (ritem_longest_rhs): Likewise.
6976 * src/reduce.c (nonterminals_reduce): Likewise.
6977 * src/print_graph.c (print_graph): Likewise.
6978 * src/output.c (output_rule_data): Likewise.
6979 * src/nullable.c (set_nullable): Likewise.
6981 2001-12-29 Akim Demaille <akim@epita.fr>
6983 * src/output.c: Comment changes.
6985 2001-12-27 Paul Eggert <eggert@twinsun.com>
6987 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
6988 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
6989 Sparc, as they were causing more porting problems than the
6990 (minor) performance improvement was worth.
6992 Also, catch up with 1.31's YYSTD.
6994 2001-12-27 Akim Demaille <akim@epita.fr>
6996 * src/output.c (output_gram): Rely on nritems, not the
6997 0-sentinel. See below.
6998 Use -1 as separator, not 0.
6999 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
7000 Rely on -1 as separator in yyrhs, instead of 0.
7001 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
7002 twice `Now at end of input', therefore there are two lines less to
7005 2001-12-27 Akim Demaille <akim@epita.fr>
7007 * tests/regression.at (Unresolved SR Conflicts):
7008 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
7011 2001-12-27 Akim Demaille <akim@epita.fr>
7013 * src/LR0.c (new_state): Recognize the final state by the fact it
7014 is reached by eoftoken.
7015 (insert_start_shifting_state, insert_eof_shifting_state)
7016 (insert_accepting_state, augment_automaton): Remove, since now
7017 these states are automatically computed from the initial state.
7018 (generate_states): Adjust.
7019 * src/print.c: When reporting a rule number to the user, substract
7020 1, so that the axiom rule is rule 0, and the first user rule is 1.
7021 * src/reduce.c: Likewise.
7022 * src/print_graph.c (print_core): For the time being, just as for
7023 the report, depend upon --trace-flags to dump the full set of
7025 * src/reader.c (readgram): Once the grammar read, insert the rule
7026 0: `$axiom: START-SYMBOL $'.
7027 * tests/set.at: Adjust: rule 0 is now displayed, and since the
7028 number of the states has changed (the final state is no longer
7029 necessarily the last), catch up.
7031 2001-12-27 Akim Demaille <akim@epita.fr>
7033 Try to make the use of the eoftoken valid. Given that its value
7034 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
7035 is used instead of > 0 where appropriate, (ii), depend upon nritems
7036 instead of the 0-sentinel.
7038 * src/gram.h, src/gram.c (nritems): New.
7039 Expected to be duplication of nitems, but for the time being...
7040 * src/reader.c (packgram): Assert nritems and nitems are equal.
7041 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
7042 * src/closure.c (print_closure, print_fderives): Likewise.
7043 * src/gram.c (ritem_print): Likewise.
7044 * src/print.c (print_core, print_grammar): Likewise.
7045 * src/print_graph.c: Likewise.
7047 2001-12-27 Akim Demaille <akim@epita.fr>
7049 * src/main.c (main): If there are complains after grammar
7050 reductions, then output the report anyway if requested, then die.
7051 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
7052 * src/reader.c (eoftoken): New.
7053 (parse_token_decl): If the token being defined has value `0', it
7055 (packsymbols): No longer hack `tags' to insert `$' by hand.
7056 Be sure to preserve the value of the eoftoken.
7057 (reader): Make sure eoftoken is defined.
7058 Initialize nsyms to 0: now eoftoken is created just like the others.
7059 * src/print.c (print_grammar): Don't special case the eof token.
7060 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
7061 lie anyway, albeit pleasant.
7062 * tests/calc.at: Exercise error messages with eoftoken.
7063 Change the grammar so that empty input is invalid.
7064 Adjust expectations.
7065 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
7067 2001-12-27 Akim Demaille <akim@epita.fr>
7069 * configure.in: Check the protos of strchr ans strspn.
7070 Replace strchr if needed.
7071 * src/system.h: Provide the protos of strchr, strspn and memchr if
7073 * lib/strchr.c: New.
7074 * src/reader.c (symbols_save): Use strchr.
7076 2001-12-27 Akim Demaille <akim@epita.fr>
7078 * src/print.c, src/print_graph.c (escape): New.
7079 Use it to quote the TAGS outputs.
7080 * src/print_graph.c (print_state): Now errors are in red, and
7081 reductions in green.
7082 Prefer high to wide: output the state number on a line of its own.
7084 2001-12-27 Akim Demaille <akim@epita.fr>
7086 * src/state.h, src/state.c (reductions_new): New.
7087 * src/LR0.c (set_state_table): Let all the states have a
7088 `reductions', even if reduced to 0.
7089 (save_reductions): Adjust.
7090 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
7091 * src/print.c (print_reductions, print_actions): Adjust.
7092 * src/output.c (action_row): Adjust.
7094 2001-12-27 Akim Demaille <akim@epita.fr>
7096 * src/state.h, src/state.c (errs_new, errs_dup): New.
7097 * src/LR0.c (set_state_table): Let all the states have an errs,
7098 even if reduced to 0.
7099 * src/print.c (print_errs, print_reductions): Adjust.
7100 * src/output.c (output_actions, action_row): Adjust.
7101 * src/conflicts.c (resolve_sr_conflict): Adjust.
7103 2001-12-27 Akim Demaille <akim@epita.fr>
7105 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
7107 2001-12-27 Akim Demaille <akim@epita.fr>
7109 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
7110 * src/print.c: here.
7111 (lookaheadset, shiftset): New, used as additional storage by
7113 (print_results): Adjust.
7114 (print_shifts, print_gotos, print_errs): New, extracted from...
7115 (print_actions): here.
7116 * src/print_graph.c (print_actions): Remove dead code.
7118 2001-12-27 Akim Demaille <akim@epita.fr>
7120 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
7123 2001-12-27 Akim Demaille <akim@epita.fr>
7125 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
7126 (build_relations): Adjust.
7128 2001-12-27 Akim Demaille <akim@epita.fr>
7130 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
7133 2001-12-27 Akim Demaille <akim@epita.fr>
7135 * src/reader.c (packgram): Catch nitems overflows.
7137 2001-12-27 Akim Demaille <akim@epita.fr>
7139 * src/files.c, src/files.h (guard_obstack): Remove.
7140 * src/output.c (output): Adjust.
7141 * src/reader.c (parse_braces): New, factoring...
7142 (copy_action, copy_guard): these two which are renamed as...
7143 (parse_action, parse_guard): these.
7144 As a voluntary consequence, using braces around guards is now
7147 2001-12-27 Akim Demaille <akim@epita.fr>
7149 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
7150 * src/reader.c (symbol_list): `guard' and `guard_line' are new
7152 (symbol_list_new): Adjust.
7153 (copy_action): action_line is the first line, not the last.
7154 (copy_guard): Just as for actions, store the `action' only, not
7155 the switch/case/break flesh.
7156 Don't parse the user action that might follow the guard, let...
7157 (readgram): do it, i.e., now, there can be an action after a
7159 In other words the guard is just explicitly optional.
7161 * src/output.c (guards_output): New.
7162 (output_parser): Call it when needed.
7163 (output): Also free the guard and attrs obstacks.
7164 * src/files.c, src/files.h (obstack_save): Remove.
7165 (output_files): Remove.
7166 As a result, if one needs the former `.act' file, using an
7167 appropriate skeleton which requires actions and guards is now
7169 * src/main.c (main): Adjust.
7170 * tests/semantic.at: New.
7171 * tests/regression.at: Use `input.y' as input file name.
7172 Avoid 8+3 problems by requiring input.c when the test needs the
7175 2001-12-27 Akim Demaille <akim@epita.fr>
7177 * src/reader.c (symbol_list_new): Be sure to initialize all the
7180 2001-12-27 Akim Demaille <akim@epita.fr>
7182 All the hacks using a final pseudo state are now useless.
7184 * src/LR0.c (set_state_table): state_table holds exactly nstates.
7185 * src/lalr.c (nLA): New.
7186 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
7187 instead of lookaheadsp from the pseudo state (nstate + 1).
7189 2001-12-27 Akim Demaille <akim@epita.fr>
7191 * src/output.c (action_row, token_actions): Use a state_t instead
7192 of a integer, and nlookaheads instead of the following state's
7195 2001-12-27 Akim Demaille <akim@epita.fr>
7197 * src/conflicts.c (log_resolution, flush_shift)
7198 (resolve_sr_conflict, set_conflicts, solve_conflicts)
7199 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
7200 (conflicts_print, print_reductions): Use a state_t instead of an
7201 integer when referring to a state.
7202 As much as possible, depend upon nlookaheads, instead of the
7203 `lookaheadsp' member of the following state (since lookaheads of
7204 successive states are successive, the difference between state n + 1
7205 and n served as the number of lookaheads for state n).
7206 * src/lalr.c (add_lookback_edge): Likewise.
7207 * src/print.c (print_core, print_actions, print_state)
7208 (print_results): Likewise.
7209 * src/print_graph.c (print_core, print_actions, print_state)
7210 (print_graph): Likewise.
7211 * src/conflicts.h: Adjust.
7213 2001-12-27 Akim Demaille <akim@epita.fr>
7215 * src/bison.hairy: Formatting/comment changes.
7217 Remove `register' indications.
7218 Add plenty of `static'.
7220 2001-12-27 Akim Demaille <akim@epita.fr>
7222 * src/output.c (prepare): Drop the muscle `ntbase' which
7224 * src/bison.simple: Formatting/comment changes.
7225 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
7226 is an undocumented synonym.
7228 2001-12-22 Akim Demaille <akim@epita.fr>
7230 * src/output.c (output_table_data): Change the prototype to use
7231 `int' for array ranges: some invocations do pass an int, not a
7233 Reported by Wayne Green.
7235 2001-12-22 Akim Demaille <akim@epita.fr>
7237 Some actions of web2c.y are improperly triggered.
7238 Reported by Mike Castle.
7240 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
7241 * tests/regression.at (Web2c): Rename as...
7242 (Web2c Report): this.
7243 (Web2c Actions): New.
7245 2001-12-22 Akim Demaille <akim@epita.fr>
7247 Reductions in web2c.y are improperly reported.
7248 Reported by Mike Castle.
7250 * src/conflicts.c (print_reductions): Fix.
7251 * tests/regression.at (Web2c): New.
7253 2001-12-18 Akim Demaille <akim@epita.fr>
7255 Some host fail on `assert (!"foo")', which expands to
7256 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
7257 Reported by Nelson Beebee.
7259 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
7260 `#define it_succeeded 0' and `assert (it_succeeded)'.
7262 2001-12-17 Marc Autret <autret_m@epita.fr>
7264 * src/bison.simple: Don't hard code the skeleton line and filename.
7265 * src/output.c (output_parser): Rename 'line' as 'output_line'.
7266 New line counter 'skeleton_line' (skeleton-line muscle).
7268 2001-12-17 Paul Eggert <eggert@twinsun.com>
7270 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
7271 YYDEBUG must be defined to a nonzero value.
7273 * src/bison.simple (yytname): Do not assume that the user defines
7274 YYDEBUG to a properly parenthesized expression.
7276 2001-12-17 Akim Demaille <akim@epita.fr>
7278 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
7279 nlookaheads is a new member.
7281 * src/lalr.h (nlookaheads): Remove this orphan declaration.
7282 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
7285 2001-12-17 Akim Demaille <akim@epita.fr>
7287 * src/files.h, src/files.c (open_files, close_files): Remove.
7288 * src/main.c (main): Don't open/close files, nor invoke lex_free,
7290 * src/reader.c (reader): Do it.
7292 2001-12-17 Akim Demaille <akim@epita.fr>
7294 * src/conflicts.c (print_reductions): Formatting changes.
7296 2001-12-17 Akim Demaille <akim@epita.fr>
7298 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
7299 (flush_reduce): New.
7300 (resolve_sr_conflict): Adjust.
7302 2001-12-17 Akim Demaille <akim@epita.fr>
7304 * src/output.c (output_obstack): Be static and rename as...
7305 (format_obstack): this, to avoid any confusion with files.c's
7307 * src/reader.h (muscle_obstack): Move to...
7308 * src/output.h: here, since it's defined in output.c.
7310 2001-12-17 Akim Demaille <akim@epita.fr>
7312 * src/output.c (action_row, save_column, default_goto)
7313 (sort_actions, matching_state, pack_vector): Better variable
7316 2001-12-17 Akim Demaille <akim@epita.fr>
7318 * src/output.c: Various formatting changes.
7320 2001-12-17 Akim Demaille <akim@epita.fr>
7322 * src/files.c (output_files): Free the output_obstack.
7323 * src/main.c (main): Call print and print_graph conditionally.
7324 * src/print.c (print): Work unconditionally.
7325 * src/print_graph.c (print_graph): Work unconditionally.
7326 * src/conflicts.c (log_resolution): Output only if verbose_flag.
7328 2001-12-16 Marc Autret <autret_m@epita.fr>
7330 * src/output.c (actions_output): Fix. When we use %no-lines,
7331 there is one less line per action.
7333 2001-12-16 Marc Autret <autret_m@epita.fr>
7335 * src/bison.simple: Remove a useless #line directive.
7336 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
7337 * src/output.c (get_lines_number): New.
7338 (output_parser): Adjust, now takes care about the lines of a
7341 (actions_output): Computes the number of lines taken by actions.
7342 (output_master_parser): Insert new skeleton which is the name of
7343 the output parser file name.
7345 2001-12-15 Marc Autret <autret_m@epita.fr>
7347 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
7349 2001-12-15 Marc Autret <autret_m@epita.fr>
7351 * src/output.c (output_gram): Keep track of the hairy one.
7353 2001-12-15 Akim Demaille <akim@epita.fr>
7355 Make `make distcheck' work.
7357 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
7358 system.h which uses libgettext.h.
7360 2001-12-15 Akim Demaille <akim@epita.fr>
7362 * src/nullable.c (set_nullable): Useless rules must be skipped,
7363 otherwise, since we range over their symbols, we might look at a
7364 nonterminal which no longer ``exists'', i.e., it is not counted in
7365 `nvars', hence we overflow our arrays.
7367 2001-12-15 Akim Demaille <akim@epita.fr>
7369 The header can also be produced directly, without any obstack!
7372 * src/files.c, src/files.h (defines_obstack): Remove.
7373 (compute_header_macro): Global.
7374 (defines_obstack_save): Remove.
7375 * src/reader.c (parse_union_decl): No longer output to
7376 defines_obstack: its content can be found in the `stype' muscle
7378 (output_token_translations): Merge into...
7379 (symbols_output): this.
7381 (symbols_save): this.
7383 * src/output.c (header_output): New.
7386 2001-12-15 Akim Demaille <akim@epita.fr>
7388 * src/reader.c (parse_union_decl): Instead of handling two obstack
7389 simultaneously, use one to define the `stype' muscle, and use the
7390 value of the latter to fill defines_obstack.
7391 (copy_comment): Remove.
7392 (copy_comment2): Work for a single obstack.
7394 (copy_comment): this.
7396 2001-12-15 Akim Demaille <akim@epita.fr>
7398 * src/lex.c, src/lex.h (xgetc): No longer static.
7399 * src/reader.c (parse_union_decl): Revamp.
7401 2001-12-15 Akim Demaille <akim@epita.fr>
7403 Still making progress in separating Bison into (i) input, (ii)
7404 process, (iii) output: now we can directly output the parser file
7405 without using table_obstack at all.
7407 * src/files.c, src/files.h (table_obstack): Bye bye.
7408 (parser_file_name): New.
7409 * src/files.c (compute_output_file_names): Compute it.
7410 * src/output.c (actions_output, output_parser)
7411 (output_master_parser): To a file instead of an obstack.
7413 2001-12-15 Akim Demaille <akim@epita.fr>
7415 Attach actions to rules, instead of pre-outputting them to
7418 * src/gram.h (rule_t): action and action_line are new members.
7419 * src/reader.c (symbol_list): Likewise.
7420 (copy_action): Save the actions within the rule.
7421 (packgram): Save them in rule_table.
7422 * src/output.c (actions_output): New.
7423 (output_parser): Use it on `%%actions'.
7424 (output_rule_data): Don't free rule_table.
7426 (prepare): Don't save the `action' muscle.
7427 * src/bison.simple: s/%%action/%%actions/.
7429 2001-12-15 Akim Demaille <akim@epita.fr>
7431 * src/reader.c (copy_action): When --yacc, don't append a `;'
7432 to the user action: let it fail if lacking.
7433 Suggested by Arnold Robbins and Tom Tromey.
7435 2001-12-14 Akim Demaille <akim@epita.fr>
7437 * src/lex.c (literalchar): Simply return the char you decoded, non
7438 longer mess around with obstacks and int pointers.
7441 2001-12-14 Akim Demaille <akim@epita.fr>
7443 * src/lex.c (literalchar): Don't escape the special characters,
7444 just decode them, and keep them as char (before, eol was output as
7445 the 2 char string `\n' etc.).
7446 * src/output.c (output_rule_data): Use quotearg to output the
7449 2001-12-13 Paul Eggert <eggert@twinsun.com>
7451 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
7452 Do not infringe on the global user namespace when using C++.
7453 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
7454 All uses of `fprintf' and `stderr' changed.
7456 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
7458 2001-12-13 Akim Demaille <akim@epita.fr>
7460 The computation of nullable is broken: it doesn't handle empty
7463 * tests/torture.at (GNU AWK Grammar): New.
7464 * tests/sets.at (Nullable): New.
7465 * src/nullable.c (set_nullable): Instead of blindly looping over
7466 `ritems', loop over the rules, and then over their rhs's.
7468 Work around Autotest bugs.
7470 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
7471 frame, because Autotest understand lines starting with a `+' as
7472 traces from the shell. Then, they are not processed properly.
7473 Admittedly an Autotest bug, but we don't have time to wait for
7474 Autotest to catch up.
7475 * tests/regression.at (Broken Closure): Adjust to the new table
7478 * tests/sets.at: here.
7480 2001-12-13 Akim Demaille <akim@epita.fr>
7482 * src/closure.c (closure): Use nrules instead of playing tricks
7485 2001-12-13 Akim Demaille <akim@epita.fr>
7487 * src/print.c (print_actions): Output the handling of `$' as the
7488 traces do: shifting the token EOF. Before EOF was treated as a
7490 * tests/regression.at: Adjust some tests.
7491 * src/print_graph.c (print_core): Complete the set of items via
7492 closure. The next-to-final and final states are still unsatisfying,
7493 but that's to be addressed elsewhere.
7494 No longer output the rule numbers, but do output the state number.
7495 A single loop for the shifts + gotos is enough, but picked a
7496 distinct color for each.
7497 (print_graph): Initialize and finalize closure.
7499 2001-12-13 Akim Demaille <akim@epita.fr>
7501 * src/reader.c (readgram): Remove dead code, an strip useless
7503 (get_type): Remove, unused.
7505 2001-12-12 Akim Demaille <akim@epita.fr>
7507 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
7508 on that of lib/error.c.
7510 2001-12-12 Akim Demaille <akim@epita.fr>
7512 Some hosts don't like `/' in includes.
7514 * src/system.h: Include libgettext.h without qualifying the path.
7515 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
7518 2001-12-11 Marc Autret <autret_m@epita.fr>
7520 * src/output.c (output_parser): Remove useless muscle.
7522 2001-12-11 Marc Autret <autret_m@epita.fr>
7524 * src/bison.simple: Remove #line just before %%epilogue. It
7525 is now handled in ...
7526 * src/reader.c (read_additionnal_code): Add the output of a
7527 #line for the epilogue.
7529 2001-12-10 Marc Autret <autret_m@epita.fr>
7531 * src/reader.c (copy_definition): Re-use CPP-outed code which
7532 replace precedent remove.
7533 * src/bison.simple: Remove #line before %%prologue because
7534 %%input-line is wrong at this time.
7536 2001-12-10 Marc Autret <autret_m@epita.fr>
7538 * src/reader.c (symbols_output): Clean up.
7539 * src/output.c (output_gram, output): Clean up.
7541 2001-12-10 Akim Demaille <akim@epita.fr>
7543 * src/lalr.c (initialize_lookaheads): New. Extracted from...
7544 * src/LR0.c (set_state_table): here.
7545 * src/lalr.c (lalr): Call it.
7547 2001-12-10 Akim Demaille <akim@epita.fr>
7549 * src/state.h (shifts): Remove the `number' member: shifts are
7550 attached to state, hence no longer need to be labelled with a
7553 2001-12-10 Akim Demaille <akim@epita.fr>
7555 Now that states have a complete set of members, the linked list of
7556 shifts is useless: just fill directly the state's shifts member.
7558 * src/state.h (shifts): Remove the `next' member.
7559 * src/LR0.c (first_state, last_state): Remove.
7561 (augment_automaton): Don't look for the shifts that must be added
7562 a shift on EOF: it is those of the state we looked for! But now,
7563 since shifts are attached, it is no longer needed to looking
7564 merely by its id: its number.
7566 2001-12-10 Akim Demaille <akim@epita.fr>
7568 * src/LR0.c (augment_automaton): Better variable locality.
7569 Remove an impossible branch: if there is a state corresponding to
7570 the start symbol being shifted, then there is shift for the start
7571 symbol from the initial state.
7573 2001-12-10 Akim Demaille <akim@epita.fr>
7575 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
7576 only when appropriate: when insert_start_shifting_state' is not
7578 * tests/regression.at (Rule Line Numbers): Adjust.
7580 2001-12-10 Akim Demaille <akim@epita.fr>
7582 * src/LR0.c (augment_automaton): Now that all states have shifts,
7583 merge the two cases addition shifts to the initial state.
7585 2001-12-10 Akim Demaille <akim@epita.fr>
7587 * src/lalr.c (set_state_table): Move to...
7589 * src/lalr.c (lalr): Don't call it...
7590 * src/LR0.c (generate_states): do it.
7591 * src/LR0.h (first_state): Remove, only the table is used.
7593 2001-12-10 Akim Demaille <akim@epita.fr>
7595 * src/LR0.h (first_shift, first_reduction): Remove.
7596 * src/lalr.c: Don't use first_shift: find shifts through the
7599 2001-12-10 Akim Demaille <akim@epita.fr>
7601 * src/LR0.c: Attach shifts to states as soon as they are
7603 * src/lalr.c (set_state_table): Instead of assigning shifts to
7604 state, just assert that the mapping was properly done.
7606 2001-12-10 Akim Demaille <akim@epita.fr>
7608 * src/LR0.c (insert_start_shift): Rename as...
7609 (insert_start_shifting_state): this.
7610 (insert_eof_shifting_state, insert_accepting_state): New.
7611 (augment_automaton): Adjust.
7612 Better locality of the variables.
7613 When looking if the start_symbol is shifted from the initial
7614 state, using `while (... symbol != start_symbol ...)' sounds
7615 better than `while (... symbol < start_symbol ...)': If fail
7616 to see how the order between symbols could be relevant!
7618 2001-12-10 Akim Demaille <akim@epita.fr>
7620 * src/getargs.h: Don't declare `spec_name_prefix' and
7621 `spec_file_prefix', declared by src/files.h.
7622 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
7623 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
7624 * src/output.c (prepare): Adjust.
7625 * src/reader.c (symbols_output): Likewise.
7626 * src/vmsgetargs.c: Vaguely adjust, but who cares?
7628 2001-12-10 Akim Demaille <akim@epita.fr>
7630 * src/muscle_tab.c (muscle_init): NULL is a better default than
7633 2001-12-10 Akim Demaille <akim@epita.fr>
7635 * src/reader.c (reader): Calling symbols_output once is enough.
7637 2001-12-10 Akim Demaille <akim@epita.fr>
7639 Now that states have a complete set of members, the linked list of
7640 reductions is useless: just fill directly the state's reductions
7643 * src/state.h (struct reductions): Remove member `number' and
7645 * src/LR0.c (first_reduction, last_reduction): Remove.
7646 (save_reductions): Don't link the new reductions, store them in
7648 * src/lalr.c (set_state_table): No need to attach reductions to
7649 states, it's already done.
7650 * src/output.c (output_actions): No longer free the shifts, then
7651 the reductions, then the states: free all the states and their
7654 2001-12-10 Akim Demaille <akim@epita.fr>
7656 * src/options.c (OPTN, DRTV, BOTH): New.
7657 (option_table): Use them.
7659 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
7660 the job of system.h.
7661 * src/options.c: Don't include stdio.h and xalloc.h for the same
7664 2001-12-10 Akim Demaille <akim@epita.fr>
7666 * src/output.c (output, prepare): Make sure the values of the
7667 muscles `action' and `prologue' are 0-terminated.
7669 2001-12-10 Akim Demaille <akim@epita.fr>
7671 Clean up GCC warnings.
7673 * src/reader.c (copy_action): `buf' is not used.
7674 (parse_skel_decl): Be static.
7675 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
7676 * src/options.h (create_long_option_table): Have a real prototype.
7677 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
7678 (hash_delete_at): Return const void *.
7679 Adjust casts to preserve the const.
7681 2001-12-10 Akim Demaille <akim@epita.fr>
7683 * configure.in: Require 2.52g.
7684 M4 is not needed, but AUTOM4TE is.
7686 * tests/Makefile.am: Adjust.
7688 2001-12-10 Akim Demaille <akim@epita.fr>
7690 One structure for states is enough, even though theoretically
7691 there are LR(0) states and LALR(1) states.
7693 * src/lalr.h (state_t): Remove.
7694 (state_table): Be state_t **, not state_t *.
7695 * src/state.h (core, CORE_ALLOC): Rename as...
7696 (state_t, STATE_ALLOC): this.
7697 Add the LALR(1) members: shifts, reductions, errs.
7698 * src/LR0.c (state_table): Rename as...
7699 (state_hash): this, to avoid name clashes with the global
7701 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
7702 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
7704 2001-12-10 Akim Demaille <akim@epita.fr>
7706 Bison dumps core on bash.y.
7707 Reported by Pascal Bart.
7709 * src/warshall.c (bitmatrix_print): New.
7711 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
7712 j must be the outer loop.
7713 * tests/regression.at (Broken Closure): New.
7715 2001-12-05 Akim Demaille <akim@epita.fr>
7717 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
7719 Reported by Peter Hamorsky.
7721 2001-12-05 Akim Demaille <akim@epita.fr>
7723 * src/conflicts.c (err_table): Remove.
7724 (resolve_sr_conflict): Adjust.
7725 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
7727 (state_t.reductions, state_t.shifts): this.
7729 2001-12-05 Akim Demaille <akim@epita.fr>
7731 * src/reduce.c (reduce_grammar_tables): No longer disable the
7732 removal of useless rules via CPP but via `if (0)', so that the
7733 compiler still check the code is valid.
7734 For instance, it should have noticed `rline' no longer exists: use
7735 the `line' member of rule_t.
7736 * src/gram.c (dummy, rline): Remove, unused.
7738 2001-12-05 Akim Demaille <akim@epita.fr>
7740 * src/output.c (pack_vector): Use assert, not berror.
7741 * src/main.c (berror): Remove, unused.
7743 2001-12-05 Akim Demaille <akim@epita.fr>
7745 New experimental feature: if --verbose --trace output all the
7746 items of a state, not only its kernel.
7748 * src/print.c (print_core): If `trace_flag', then invoke closure
7749 before outputting the items of the state (print_core is no longer
7750 a correct name them).
7751 (print_results): Invoke new_closure/free_closure if needed.
7753 2001-12-05 Akim Demaille <akim@epita.fr>
7755 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
7756 * src/closure.c, src/closure.h (itemsetsize): Rename as...
7757 (nitemset): for consistency with the rest of the project.
7759 2001-12-05 Akim Demaille <akim@epita.fr>
7761 * src/closure.c (print_closure): Improve.
7762 (closure): Use it for printing input and output.
7764 2001-12-05 Akim Demaille <akim@epita.fr>
7766 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
7767 indexed by nonterminals.
7769 2001-12-05 Akim Demaille <akim@epita.fr>
7771 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
7773 * src/warshall.h: Remove accidental duplication of the content.
7775 2001-12-05 Akim Demaille <akim@epita.fr>
7777 * src/closure.c (set_fderives): De-obfuscate.
7779 2001-12-05 Akim Demaille <akim@epita.fr>
7781 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
7783 2001-12-05 Akim Demaille <akim@epita.fr>
7785 * src/closure.c (set_firsts): De-obfuscate.
7787 2001-12-05 Akim Demaille <akim@epita.fr>
7789 * src/output.c (action_row): De-obfuscate
7790 using the good o' techniques: arrays not pointers, variable
7791 locality, BITISSET, RESETBIT etc.
7793 2001-12-05 Akim Demaille <akim@epita.fr>
7795 Pessimize the code to simplify it: from now on, all the states
7796 have a valid SHIFTS, which NSHIFTS is possibly 0.
7798 * src/LR0.c (shifts_new): Be global and move to..
7799 * src/state.c, src/state.h: here.
7800 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
7801 * src/print_graph: Adjust.
7803 2001-12-05 Akim Demaille <akim@epita.fr>
7805 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
7806 * src/conflicts.c: Use it.
7807 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
7808 incorrectly ``simplified''.
7810 2001-12-05 Akim Demaille <akim@epita.fr>
7812 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
7813 using the good o' techniques: arrays not pointers, variable
7814 locality, BITISSET, RESETBIT etc.
7816 2001-12-05 Akim Demaille <akim@epita.fr>
7818 * src/state.h (SHIFT_SYMBOL): New.
7819 * src/conflicts.c: Use it to deobfuscate.
7821 2001-12-05 Akim Demaille <akim@epita.fr>
7823 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
7824 (print_reductions): De-obfuscate using the good o' techniques:
7825 arrays not pointers, variable locality, BITISSET.
7827 2001-12-05 Akim Demaille <akim@epita.fr>
7829 * src/conflicts.c (print_reductions): Arrays, not pointers.
7832 2001-12-05 Akim Demaille <akim@epita.fr>
7834 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7836 2001-12-05 Akim Demaille <akim@epita.fr>
7838 * src/conflicts.c (print_reductions): Improve variable locality.
7840 2001-12-05 Akim Demaille <akim@epita.fr>
7842 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7844 2001-12-05 Akim Demaille <akim@epita.fr>
7846 * src/conflicts.c (print_reductions): Improve variable locality.
7848 2001-12-05 Akim Demaille <akim@epita.fr>
7850 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
7851 * src/lalr.c: Use them.
7853 2001-12-05 Akim Demaille <akim@epita.fr>
7855 * src/LR0.c (augment_automaton): Formatting changes.
7856 Better variable locality.
7858 2001-12-05 Akim Demaille <akim@epita.fr>
7860 * src/lalr.c (matrix_print): New.
7861 (transpose): Use it.
7862 Use arrays instead of pointers.
7864 2001-12-05 Akim Demaille <akim@epita.fr>
7866 * src/lalr.c (maxrhs): Move to...
7867 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
7868 * src/lalr.c (build_relations): Adjust.
7870 2001-12-05 Akim Demaille <akim@epita.fr>
7872 * src/lalr.c (transpose): Free the memory allocated to the
7873 argument, as it is replaced by the results by the unique caller.
7874 (build_relations): Merely invoke transpose: it handles the memory
7876 Improve variable locality.
7877 Avoid variables used as mere abbreviations.
7878 (compute_lookaheads): Use arrays instead of pointers.
7880 2001-12-05 Akim Demaille <akim@epita.fr>
7882 * src/lalr.c (initialize_F): Improve variable locality.
7883 Avoid variables used as mere abbreviations.
7885 2001-12-05 Akim Demaille <akim@epita.fr>
7887 * src/derives.c (print_derives): Display the ruleno.
7888 * src/lalr.c (initialize_F, transpose): Better variable locality
7889 to improve readability.
7890 Avoid variables used as mere abbreviations.
7892 2001-12-05 Akim Demaille <akim@epita.fr>
7894 * src/lalr.c (traverse): Use arrays instead of pointers.
7896 2001-12-05 Akim Demaille <akim@epita.fr>
7898 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
7899 the handling of squeue.
7900 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7902 2001-12-05 Akim Demaille <akim@epita.fr>
7904 Because useless nonterminals are now kept alive (instead of being
7905 `destroyed'), we now sometimes examine them, and store information
7906 related to them. Hence we need to know their number, and adjust
7909 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
7911 * src/LR0.c (allocate_itemsets): The memory allocated to
7912 `symbol_count' was used for two different purpose: once to count
7913 the number of occurrences of each symbol, and later reassigned to
7914 `shift_symbol', containing the symbol that can be shifted from a
7916 Deobfuscate, i.e., allocate, use and free `symbol_count' here
7918 (new_itemsets): Allocate `shift_symbol' here.
7919 (allocate_itemsets): symbol_count includes useless nonterminals.
7921 (free_storage): Use `free', not `XFREE', for pointers that cannot
7924 2001-12-05 Akim Demaille <akim@epita.fr>
7926 * src/nullable.c (set_nullable): Deobfuscate the handling of
7928 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7930 2001-12-05 Akim Demaille <akim@epita.fr>
7932 * src/gram.c, src/gram.h (ritem_print): New.
7933 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
7934 (This useless function was defined only to work around VMS linkers
7935 that can't handle compilation units with variables only).
7936 * src/reduce.c (dump_grammar): Use it to trace the construction of
7939 2001-12-04 Paul Eggert <eggert@twinsun.com>
7941 * src/bison.simple (union yyalloc): Change member names
7942 to be the same as the stack names.
7943 (yyparse): yyptr is now union yyalloc *, not char *.
7944 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
7945 and may generate better code on some machines.
7946 (yystpcpy): Use prototype if __STDC__ is defined, not just
7947 if __cplusplus is defined.
7949 2001-11-30 Akim Demaille <akim@epita.fr>
7951 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
7952 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
7953 Gettext doesn't compile cleanly, and dies with -Werror.
7954 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
7955 Include WARNING_CFLAGS here.
7956 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
7957 before being defined.
7959 2001-11-27 Paul Eggert <eggert@twinsun.com>
7961 * lib/quotearg.h (quotearg_n, quotearg_n_style):
7962 First arg is int, not unsigned.
7963 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
7964 (SIZE_MAX, UINT_MAX): New macros.
7965 (quotearg_n_options): Abort if N is negative.
7966 Avoid overflow check on hosts where size_t is 64 bits and int
7967 is 32 bits, as overflow is impossible there.
7968 Fix off-by-one typo that caused unnecessary reallocation.
7970 2001-11-29 Paul Eggert <eggert@twinsun.com>
7972 Name space cleanup in generated parser.
7974 * doc/bison.texinfo (Bison Parser): Discuss system headers
7975 and their effect on the user name space.
7978 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
7979 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
7980 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
7982 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
7983 on user names when possible.
7985 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
7986 Simplify test for whather <alloca.h> exists.
7988 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
7990 (<stdio.h>): Include if YYDEBUG.
7992 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
7993 ! defined (yyoverflow) && ! defined (yymemcpy).
7995 (yymemcpy, yyparse): Rename local variables as needed so that
7996 they all begin with 'yy'.
7998 (yystrlen, yystpcpy): New functions.
8000 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
8003 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
8004 instead of relying on string.h functions. Use YYSTACK_ALLOC
8005 and YYSTACK_FREE instead of malloc and free.
8007 2001-11-30 Akim Demaille <akim@epita.fr>
8009 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
8010 before their first uses.
8011 (YYBISON, YYPURE): Move to the top of the output.
8013 2001-11-30 Akim Demaille <akim@epita.fr>
8015 * tests/reduce.at (Useless Nonterminals): Fix.
8017 2001-11-30 Akim Demaille <akim@epita.fr>
8019 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
8020 if body instead of `;' to pacify GCC's warnings.
8022 2001-11-30 Akim Demaille <akim@epita.fr>
8024 Instead of mapping the LHS of unused rules to -1, keep the LHS
8025 valid, but flag the rules as invalid.
8027 * src/gram.h (rule_t): `useful' is a new member.
8028 * src/print.c (print_grammar): Adjust.
8029 * src/derives.c (set_derives): Likewise.
8030 * src/reader.c (packgram, reduce_output): Likewise.
8031 * src/reduce.c (reduce_grammar_tables): Likewise.
8032 * tests/reduce.at (Underivable Rules, Useless Rules): New.
8034 2001-11-30 Akim Demaille <akim@epita.fr>
8036 * src/reduce.c (reduce_output): Formatting changes.
8037 * src/print.c (print_results, print_grammar): Likewise.
8038 * tests/regression.at (Rule Line Numbers)
8039 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
8041 2001-11-30 Akim Demaille <akim@epita.fr>
8043 * src/reduce.c (nonterminals_reduce): Instead of throwing away
8044 useless nonterminals, move them at the end of the symbol arrays.
8045 (reduce_output): Adjust.
8046 * tests/reduce.at (Useless Nonterminals): Adjust.
8048 2001-11-30 Akim Demaille <akim@epita.fr>
8050 * src/reduce.c: Various comment/formatting changes.
8051 (nonterminals_reduce): New, extracted from...
8052 (reduce_grammar_tables): here.
8053 (reduce_grammar): Call nonterminals_reduce.
8055 2001-11-29 Paul Eggert <eggert@twinsun.com>
8057 * src/bison.simple (YYSTACK_REALLOC): Remove.
8058 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
8059 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
8061 (union yyalloc): New type.
8062 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
8063 an arbitrary restriction on hosts where size_t is wider than int.
8065 (yyparse): Don't dump core if alloca or malloc fails; instead, report
8066 a parser stack overflow. Allocate just one block of memory for all
8067 three stacks, instead of allocating three blocks; this typically is
8068 faster and reduces fragmentation.
8070 Do not limit the number of items in the stack to a value that fits
8071 in 'int', as this is an arbitrary limit on hosts with 64-bit
8072 size_t and 32-bit int.
8074 2001-11-29 Marc Autret <autret_m@epita.fr>
8076 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
8077 of defining YYERROR_VERBOSE.
8078 [AT_DATA]: $4 is now out of C declarations in the prologue.
8080 2001-11-28 Marc Autret <autret_m@epita.fr>
8082 * src/reader.c (parse_dquoted_param): New.
8083 (parse_skel_decl): Use it.
8084 * src/lex.h: Add its prototype.
8085 * src/lex.c (literalchar): Become not static.
8087 2001-11-28 Marc Autret <autret_m@epita.fr>
8089 * src/output.h: And put its extern declaration here.
8090 * src/output.c (error_verbose): Define here.
8091 (prepare): Echo name modification.
8092 * src/getargs.h: Clean its extern declaration.
8093 * src/getargs.c (error_verbose_flag): Remove.
8094 (getargs): Remove case 'e'.
8095 * src/options.c (option_table): 'error-verbose' is now seen as simple
8099 * src/reader.c (read_declarations): Remove case tok_include.
8100 (parse_include_decl): Remove.
8101 * src/lex.h (token_t): Remove tok_include.
8102 * src/options.c (option_table): 'include' is now a simple command line
8105 2001-11-28 Marc Autret <autret_m@epita.fr>
8107 * src/bison.simple: Adjust muscle names.
8108 * src/muscle_tab.c (muscle_init): Also rename the muscles.
8109 * src/output.c (prepare): s/_/-/ for the muscles names.
8110 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
8112 2001-11-28 Marc Autret <autret_m@epita.fr>
8114 * src/bison.simple: Fix debug.
8115 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
8117 2001-11-28 Akim Demaille <akim@epita.fr>
8119 * src/LR0.c (shifts_new): New.
8120 (save_shifts, insert_start_shift, augment_automaton): Use it.
8122 2001-11-28 Akim Demaille <akim@epita.fr>
8124 * src/closure.c (closure): `b' and `ruleno' denote the same value:
8127 2001-11-28 Akim Demaille <akim@epita.fr>
8129 * src/closure.c (closure): Instead of looping over word in array
8130 then bits in words, loop over bits in array.
8132 2001-11-28 Akim Demaille <akim@epita.fr>
8134 * src/closure.c (closure): No longer optimize the special case
8135 where all the bits of `ruleset[r]' are set to 0, to make the code
8138 2001-11-28 Akim Demaille <akim@epita.fr>
8140 * src/closure.c (closure): `r' and `c' are new variables, used to
8141 de-obfuscate accesses to RULESET and CORE.
8143 2001-11-28 Akim Demaille <akim@epita.fr>
8145 * src/reduce.c (reduce_print): Use ngettext.
8146 (dump_grammar): Improve the trace accuracy.
8148 2001-11-28 Akim Demaille <akim@epita.fr>
8150 * src/reduce.c (dump_grammar): Don't translate trace messages.
8152 2001-11-28 Akim Demaille <akim@epita.fr>
8154 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
8155 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
8156 as all tags are free'ed afterwards.
8159 2001-11-27 Paul Eggert <eggert@twinsun.com>
8161 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
8162 use alloca when we didn't want to, and vice versa.
8164 2001-11-27 Marc Autret <autret_m@epita.fr>
8166 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
8168 * src/output.c (prepare): Remove its update.
8170 2001-11-27 Marc Autret <autret_m@epita.fr>
8172 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
8175 2001-11-27 Marc Autret <autret_m@epita.fr>
8177 * src/bison.simple: Remove YYERROR_VERBOSE using.
8178 Use %%error_verbose.
8179 (yyparse): Likewise.
8180 * src/output.c (prepare): Give its final value.
8181 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
8182 * src/getargs.h: Add its extern declaration.
8183 * src/getargs.c (error_verbose_flag): New int.
8184 (getargs): Update to catch new case.
8185 * src/options.c (option_table): 'error-verbose' is a new option.
8186 (shortopts): Update.
8188 2001-11-27 Akim Demaille <akim@epita.fr>
8190 * src/system.h: Use intl/libgettext.h.
8191 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
8193 2001-11-27 Akim Demaille <akim@epita.fr>
8195 * tests/torture.at (Exploding the Stack Size with Malloc):
8196 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
8198 2001-11-27 Akim Demaille <akim@epita.fr>
8200 * src/files.c: Include error.h.
8201 Reported by Hans Aberg.
8203 2001-11-26 Marc Autret <autret_m@epita.fr>
8205 * src/reader.c (parse_include_decl): New, not yet implemented.
8206 (read_declarations): Add case tok_include.
8207 * src/getargs.h (include): Add its extern definition.
8208 * src/getargs.c (include): New const char *.
8209 (getargs): Add case '-I'.
8210 * src/options.c (option_table): Add include as command line and
8212 * src/lex.h (token_t): Add tok_include.
8214 2001-11-26 Akim Demaille <akim@epita.fr>
8216 * src/reader.c (readgram): Make sure rules for mid-rule actions
8217 have a lineno equal to that of their host rule.
8218 Reported by Hans Aberg.
8219 * tests/regression.at (Rule Line Numbers): New.
8221 2001-11-26 Akim Demaille <akim@epita.fr>
8223 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
8226 2001-11-26 Akim Demaille <akim@epita.fr>
8228 * src/complain.c, src/complain.h (error): Remove, provided by
8231 2001-11-26 Akim Demaille <akim@epita.fr>
8233 * src/reader.c (read_declarations): Don't abort on tok_illegal,
8234 issue an error message.
8235 * tests/regression.at (Invalid %directive): New.
8236 Reported by Hans Aberg.
8238 2001-11-26 Akim Demaille <akim@epita.fr>
8240 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
8241 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
8243 2001-11-26 Akim Demaille <akim@epita.fr>
8245 * src/conflicts.c (conflicts_print): Don't complain at all when
8246 there are no reduce/reduce conflicts, and as many shift/reduce
8247 conflicts as expected.
8248 * tests/regression.at (%expect right): Adjust.
8250 2001-11-23 Akim Demaille <akim@epita.fr>
8252 * lib/alloca.c: Update, from fileutils.
8254 2001-11-23 Akim Demaille <akim@epita.fr>
8256 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
8258 2001-11-23 Akim Demaille <akim@epita.fr>
8260 * src/system.h: Include alloca.h.
8261 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
8263 2001-11-23 Akim Demaille <akim@epita.fr>
8265 * src/print_graph.c (print_actions): Remove `rule', unused.
8266 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
8267 pacify GCC's signed < unsigned warnings.
8268 * src/closure.c (itemsetsize): Likewise.
8269 * src/reader.c (symbol_list_new): Static.
8271 2001-11-23 Akim Demaille <akim@epita.fr>
8273 Attaching lineno to buckets is stupid, since only one copy of each
8274 symbol is kept, only the line of the first occurrence is kept too.
8276 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
8277 * src/reader.c (rline_allocated): Remove, unused.
8278 (symbol_list): Have a `line' member.
8279 (symbol_list_new): New.
8281 * src/print.c (print_grammar): Output the rule line numbers.
8282 * tests/regression.at (Solved SR Conflicts)
8283 (Unresolved SR Conflicts): Adjust.
8284 Reported by Hans Aberg.
8286 2001-11-22 Marc Autret <autret_m@epita.fr>
8288 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
8290 2001-11-22 Marc Autret <autret_m@epita.fr>
8292 * src/muscle_tab.c (muscle_init): Remove initialization of
8294 * src/output.c (output_master_parser): Do it here.
8296 2001-11-20 Akim Demaille <akim@epita.fr>
8299 * configure.in (ALL_LINGUAS): Adjust.
8300 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
8301 longer contains strings to translate.
8303 2001-11-19 Akim Demaille <akim@epita.fr>
8305 * src/conflicts.c (conflicts_print): Add a missing \n.
8307 2001-11-19 Akim Demaille <akim@epita.fr>
8309 * src/nullable.c (nullable_print): New.
8310 (set_nullable): Call it when tracing.
8311 Better locality of variables.
8313 2001-11-19 Akim Demaille <akim@epita.fr>
8315 * src/print.c (print_actions): Better locality of variables.
8317 2001-11-19 Akim Demaille <akim@epita.fr>
8319 * src/derives.c (print_derives): Fix and enrich.
8320 * src/closure.c (print_fderives): Likewise.
8322 2001-11-19 Akim Demaille <akim@epita.fr>
8324 * src/closure.c (itemsetend): Remove, replaced with...
8327 2001-11-19 Akim Demaille <akim@epita.fr>
8329 * src/LR0.c (kernel_end): Remove, replaced with...
8332 2001-11-19 Akim Demaille <akim@epita.fr>
8334 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
8337 2001-11-19 Akim Demaille <akim@epita.fr>
8339 * src/closure.c (closure): Use arrays instead of pointers to clarify.
8341 2001-11-19 Akim Demaille <akim@epita.fr>
8343 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
8345 * src/LR0.c: Likewise.
8346 (allocate_itemsets): Use arrays instead of pointers to clarify.
8348 2001-11-19 Akim Demaille <akim@epita.fr>
8350 * src/getargs.c (statistics_flag): Replace with...
8352 (longopts): Accept --trace instead of --statistics.
8353 * src/getargs.h, src/options.c: Adjust.
8354 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
8355 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
8357 2001-11-19 Akim Demaille <akim@epita.fr>
8359 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
8360 pointers to clarify the code.
8361 (save_reductions, save_shifts): Factor common parts of alternatives.
8363 2001-11-19 Akim Demaille <akim@epita.fr>
8365 * src/LR0.c (new_state, get_state): Complete TRACE code.
8366 * src/closure.c: Include `reader.h' to get `tags', needed by the
8368 Rename the conditional DEBUG as TRACE.
8369 Output consistently TRACEs to stderr, not stdout.
8370 * src/derives.c: Likewise.
8371 * src/reduce.c: (inaccessable_symbols): Using if is better style
8373 Use `#if TRACE' instead of `#if 0' for tracing code.
8375 2001-11-19 Akim Demaille <akim@epita.fr>
8377 * src/system.h (LIST_FREE, shortcpy): New.
8378 * src/LR0.c: Use them.
8379 * src/output.c (free_itemsets, free_reductions, free_shifts):
8380 Remove, replaced by LIST_FREE.
8382 2001-11-19 Akim Demaille <akim@epita.fr>
8384 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
8385 (REDUCTIONS_ALLOC): New.
8386 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
8389 2001-11-19 Akim Demaille <akim@epita.fr>
8391 * src/LR0.c (new_state): Complete trace code.
8392 * src/nullable.c (set_nullable): Don't translate traces.
8394 2001-11-19 Akim Demaille <akim@epita.fr>
8396 * src/print_graph.c (print_core): Better locality of variables.
8397 * src/print.c (print_core): Likewise.
8399 2001-11-19 Akim Demaille <akim@epita.fr>
8401 * src/vcg.c: You do the output, so you are responsible of the
8402 handling of VCG syntax, in particular: use quotearg.
8403 * src/print_graph.c: Don't.
8404 (print_actions): Don't output the actions as part of the nodes,
8405 since that's the job of the edges.
8406 (print_state): Don't output by hand: fill the node description,
8407 and ask for its output.
8409 2001-11-19 Akim Demaille <akim@epita.fr>
8411 * src/bison.simple (yyparse): When verbosely reporting an error,
8412 no longer put additional quotes around token names.
8413 * tests/calc.at: Adjust.
8415 2001-11-19 Akim Demaille <akim@epita.fr>
8417 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
8418 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
8419 * src/output.c: Adjust.
8421 2001-11-19 Akim Demaille <akim@epita.fr>
8423 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
8425 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
8427 2001-11-19 Akim Demaille <akim@epita.fr>
8429 * src/gram.h (rule_t): New.
8431 (rrhs, rlhs): Remove, part of state_t.
8432 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
8433 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8434 * src/reader.c, src/reduce.c: Adjust.
8436 2001-11-19 Akim Demaille <akim@epita.fr>
8438 * src/reader.c (symbols_output): New, extracted from...
8439 (packsymbols): Here.
8442 2001-11-19 Akim Demaille <akim@epita.fr>
8444 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
8445 (maxrhs): this new function.
8447 2001-11-19 Akim Demaille <akim@epita.fr>
8449 * src/lalr.c (F): New macro to access the variable F.
8452 2001-11-19 Akim Demaille <akim@epita.fr>
8454 * src/lalr.h (LA): New macro to access the variable LA.
8455 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8456 * src/lalr.c: Adjust.
8458 2001-11-19 Akim Demaille <akim@epita.fr>
8460 * src/lalr.c (initialize_LA): Only initialize LA. Let...
8461 (set_state_table): handle the `lookaheads' members.
8463 2001-11-19 Akim Demaille <akim@epita.fr>
8465 * src/lalr.h (lookaheads): Removed array, whose contents is now
8467 (state_t): this structure.
8468 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8471 2001-11-19 Akim Demaille <akim@epita.fr>
8473 * src/lalr.h (consistent): Removed array, whose contents is now
8475 (state_t): this structure.
8476 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8479 2001-11-19 Akim Demaille <akim@epita.fr>
8481 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
8482 contents are now members of...
8483 (state_t): this structure.
8484 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8487 2001-11-19 Akim Demaille <akim@epita.fr>
8489 * src/lalr.h (state_t): New.
8490 (state_table): Be a state_t * instead of a core **.
8491 (accessing_symbol): Remove, part of state_t.
8492 * src/lalr.c: Adjust.
8493 (set_accessing_symbol): Merge into...
8494 (set_state_table): this.
8495 * src/print_graph.c, src/conflicts.c: Adjust.
8497 2001-11-14 Akim Demaille <akim@epita.fr>
8499 * tests/calc.at, tests/output.at, tests/regression.at,
8500 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
8501 now the tests are run in private dirs, therefore AC_CLEANUP and
8502 family can be simplified to 0-ary.
8503 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
8504 use abs. path to find config.h.
8505 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
8506 stderr, there can be way too much random noise.
8507 Instead pass -Werror to GCC and rely on the exit status.
8508 Reported by Wolfram Wagner.
8510 2001-11-14 Akim Demaille <akim@epita.fr>
8512 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
8513 defined only if yyoverflow is defined, to avoid `warning: unused
8515 Reported by The Test Suite.
8517 2001-11-14 Akim Demaille <akim@epita.fr>
8519 * src/print.c: Include reduce.h.
8520 Reported by Hans Aberg.
8522 2001-11-14 Akim Demaille <akim@epita.fr>
8524 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
8525 Revert a previous patch: these are really const.
8526 * src/conflicts.c (conflict_report): Additional useless pair of
8527 braces to pacify GCC's warnings for `if () if () {} else {}'.
8528 * src/lex.c (parse_percent_token): Replace equal_offset with
8531 Be sure to strdup `arg' when used, since there is no reason for
8532 token_buffer not to change.
8534 2001-11-14 Akim Demaille <akim@epita.fr>
8536 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
8538 * src/main.c (main): Use them.
8539 Suggested by Hans Aberg.
8541 2001-11-12 Akim Demaille <akim@epita.fr>
8543 * src/system.h (ngettext): Now that we use ngettext, be sure to
8544 provide a default definition when NLS are not used.
8546 2001-11-12 Akim Demaille <akim@epita.fr>
8548 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
8549 Use @kbd to denote user input.
8550 (Language and Grammar): ANSIfy the example.
8551 Adjust its layout for info/notinfo.
8552 (Location Tracking Calc): Output error messages to stderr.
8553 Output locations in a more GNUtically correct way.
8554 Fix a couple of Englishos.
8555 Adjust @group/@end group pairs.
8557 2001-11-12 Akim Demaille <akim@epita.fr>
8559 %expect was not functioning at all.
8561 * src/conflicts.c (expected_conflicts): Set to -1.
8562 (conflict_report): Use ngettext.
8563 (conflicts_print): Check %expect and make its violation an error.
8564 * doc/bison.texinfo (Expect Decl): Adjust.
8565 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
8566 * tests/regression.at (%expect not enough, %expect right)
8567 (%expect too much): New.
8569 2001-11-12 Akim Demaille <akim@epita.fr>
8571 * tests/regression.at (Conflicts): Rename as...
8572 (Unresolved SR Conflicts): this.
8573 (Solved SR Conflicts): New.
8575 2001-11-12 Akim Demaille <akim@epita.fr>
8577 * src/reduce.c (print_results): Rename as...
8578 (reduce_output): This.
8579 Output to OUT, passed as argument, instead of output_obstack.
8580 (dump_grammar): Likewise.
8583 (reduce_grammar): No longer call reduce_output, since...
8584 * src/print.c (print_results): do it.
8585 * src/main.c (main): Call reduce_free;
8587 2001-11-12 Akim Demaille <akim@epita.fr>
8589 * src/conflicts.c (print_reductions): Accept OUT as argument.
8590 Output to it, not to output_obstack.
8591 * src/print.c (print_actions): Adjust.
8593 2001-11-12 Akim Demaille <akim@epita.fr>
8595 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
8596 the result instead of using...
8597 (src_total, rrc_total, src_count, rrc_count): Remove.
8598 (any_conflicts): Remove.
8599 (print_conflicts): Split into...
8600 (conflicts_print, conflicts_output): New.
8601 * src/conflicts.h: Adjust.
8602 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
8603 * src/print.c (print_grammar): Issue `\n' between two rules.
8604 * tests/regression.at (Conflicts): New.
8605 Reported by Tom Lane.
8607 2001-11-12 Akim Demaille <akim@epita.fr>
8609 * tests/regression.at (Invalid input): Remove, duplicate with
8610 ``Invalid input: 1''.
8612 2001-11-12 Akim Demaille <akim@epita.fr>
8614 * tests/torture.at (AT_DATA_STACK_TORTURE)
8615 (Exploding the Stack Size with Alloca)
8616 (Exploding the Stack Size with Malloc): New.
8618 2001-11-12 Akim Demaille <akim@epita.fr>
8620 * src/bison.simple (YYSTACK_REALLOC): New.
8621 (yyparse) [!yyoverflow]: Use it and free the old stack.
8622 Reported by Per Allansson.
8624 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
8626 * src/bison.simple: Define type yystype instead of YYSTYPE, and
8627 define CPP macro, which substitute YYSTYPE by yystype.
8628 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
8629 with yyltype/YYLTYPE. This allows inclusion of the generated
8630 header within the parser if the compiler, such as GGC, accepts
8631 multiple equivalent #defines.
8634 2001-11-05 Akim Demaille <akim@epita.fr>
8636 * src/reader.c (symbols_output): New, extracted from...
8637 (packsymbols): here.
8640 2001-11-05 Akim Demaille <akim@epita.fr>
8642 * src/lex.c (parse_percent_token): s/quotearg/quote/.
8644 2001-11-05 Akim Demaille <akim@epita.fr>
8646 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
8649 2001-11-05 Akim Demaille <akim@epita.fr>
8651 * src/options.h (struct option_table_struct): set_flags is void*.
8652 * src/options.c (longopts): Support `--output' and `%output'.
8654 * src/lex.h (tok_setopt): Remove, replaced with...
8655 (tok_intopt, tok_stropt): these new guys.
8656 * src/lex.c (getopt.h): Not needed.
8657 (token_buffer, unlexed_token_buffer): Not const.
8658 (percent_table): Promote `-' over `_' in directive names.
8659 Active `%name-prefix', `file-prefix', and `output'.
8660 (parse_percent_token): Accept possible arguments to directives.
8661 Promote `-' over `_' in directive names.
8663 2001-11-04 Akim Demaille <akim@epita.fr>
8665 * doc/bison.texinfo (Decl Summary): Split the list into
8666 `directives for grammars' and `directives for bison'.
8668 Add description of `%name-prefix', `file-prefix', and `output'.
8669 Promote `-' over `_' in directive names.
8670 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
8671 Simplify the description of `--name-prefix'.
8672 Promote `-' over `_' in directive names.
8673 Promote `--output' over `--output-file'.
8674 Fix the description of `--defines'.
8675 * tests/output.at: Exercise %file-prefix and %output.
8677 2001-11-02 Akim Demaille <akim@epita.fr>
8679 * doc/refcard.tex: Update.
8681 2001-11-02 Akim Demaille <akim@epita.fr>
8683 * src/symtab.h (SUNDEF): New.
8684 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
8685 stand for `uninitialized', instead of 0.
8686 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
8687 * src/lex.c (lex): Adjust.
8689 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
8691 Let yylex return it instead of a plain 0.
8692 Reported by Dick Streefland.
8694 2001-11-02 Akim Demaille <akim@epita.fr>
8696 * tests/regression.at (Mixing %token styles): New test.
8698 2001-11-02 Akim Demaille <akim@epita.fr>
8700 * src/reader.c (parse_thong_decl): Formatting changes.
8701 (token_translations_init): New, extracted from...
8702 (packsymbols): Here.
8705 2001-11-01 Akim Demaille <akim@epita.fr>
8707 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
8708 Check that `9foo.y' produces correct cpp guards.
8709 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
8713 2001-11-01 Akim Demaille <akim@epita.fr>
8715 * tests/regression.at (Invalid input: 2): New.
8716 * src/lex.c (unlexed_token_buffer): New.
8717 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
8721 2001-11-01 Akim Demaille <akim@epita.fr>
8723 * tests/calc.at: Catch up with 1.30.
8724 * configure.in: Bump to 1.49a.
8725 Adjust to newer Autotest.
8727 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
8729 * src/conflicts.c: Move global variables rrc_total and src_total ...
8730 (print_conflicts): here.
8731 * src/output.c (output): Free global variable user_toknums.
8732 * src/lex.c (token_obstack): Become static.
8734 2001-10-18 Akim Demaille <akim@epita.fr>
8736 * tests/atlocal.in (GCC): Add.
8737 * tests/calc.at: s/m4_match/m4_bmatch/.
8738 s/m4_patsubst/m4_bpatsubst/.
8739 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
8740 * configure.in: AC_SUBST(GCC).
8742 2001-10-14 Marc Autret <autret_m@epita.fr>
8744 * src/options.c (create_long_option_table): Fix.
8746 2001-10-10 Akim Demaille <akim@epita.fr>
8748 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
8750 2001-10-04 Akim Demaille <akim@epita.fr>
8752 * src/reader.c (parse_union_decl): Push the caracters in
8753 union_obstack, not attrs_obstack.
8755 2001-10-04 Akim Demaille <akim@epita.fr>
8757 Merge in the branch 1.29.
8759 * src/reader.c (packsymbols): Use a temporary obstack for
8760 `%%tokendef', since output_stack is already used elsewhere.
8762 2001-10-02 Akim Demaille <akim@epita.fr>
8766 2001-10-02 Akim Demaille <akim@epita.fr>
8770 2001-10-02 Akim Demaille <akim@epita.fr>
8772 * tests/regression.at (Invalid CPP headers): New.
8773 From Alexander Belopolsky.
8774 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
8776 2001-10-02 Akim Demaille <akim@epita.fr>
8778 * tests/regression.at (Invalid input): New.
8779 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
8782 2001-10-02 Akim Demaille <akim@epita.fr>
8784 * tests/calc.at: Now that --debug works, the tests must be adjusted.
8786 2001-10-02 Akim Demaille <akim@epita.fr>
8788 * src/output.c (output_parser): Assert `skeleton'.
8789 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
8793 2001-10-01 Marc Autret <autret_m@epita.fr>
8795 * src/lex.h: Echo modifications.
8796 * src/lex.c (unlex): Parameter is now token_t.
8799 2001-10-01 Marc Autret <autret_m@epita.fr>
8801 * src/main.c: Include lex.h.
8804 2001-09-29 Akim Demaille <akim@epita.fr>
8806 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
8808 2001-09-28 Akim Demaille <akim@epita.fr>
8810 * tests/testsuite.at: Update to newer Autotest.
8811 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
8813 2001-09-27 Akim Demaille <akim@epita.fr>
8815 Position independent wrapper.
8817 * tests/bison: Remove.
8818 * tests/bison.in: New.
8819 * configure.in: Adjust.
8821 2001-09-27 Paul Eggert <eggert@twinsun.com>
8823 Port quotearg fixes from tar 1.13.24.
8825 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8827 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8828 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8830 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
8831 * m4/mbrtowc.m4: New file.
8832 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
8833 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
8835 2001-09-27 Akim Demaille <akim@epita.fr>
8839 2001-09-27 Akim Demaille <akim@epita.fr>
8843 2001-09-25 Akim Demaille <akim@epita.fr>
8845 * src/system.h: Include `xalloc.h'.
8846 Remove it from the C files.
8847 * src/files.c (output_files): Free the obstacks.
8848 * src/lex.c (init_lex): Rename as...
8851 * src/main.c (main): Use it.
8853 2001-09-24 Marc Autret <autret_m@epita.fr>
8855 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
8856 to output informations in fout (FILE*).
8857 (open_graph, close_graph): Likewise.
8858 (output_graph, output_edge, output_node): Likewise.
8859 * src/vcg.h: Update function prototypes.
8860 * src/print_graph.c (print_graph): Open output graph file.
8861 (print_actions): Adjust.
8862 * src/files.h: Remove extern declaration.
8863 * src/files.c: Remove graph_obstack declaration.
8864 (open_files): Remove graph_obstack initialization.
8865 (output_files): Remove graph_obstack saving.
8867 2001-09-24 Marc Autret <autret_m@epita.fr>
8869 * src/files.c (compute_output_file_names): Fix.
8871 2001-09-24 Marc Autret <autret_m@epita.fr>,
8872 Akim Demaille <akim@epita.fr>
8874 * src/reader.c (reader): Remove call to free_symtab ().
8875 * src/main.c (main): Call it here.
8877 * src/conflicts.c (initialize_conflicts): Rename as...
8878 (solve_conflicts): this.
8879 * src/print.c (print_core, print_actions, print_state)
8880 (print_grammar): Dump to a file instead a `output_obstack'.
8881 (print_results): Dump `output_obstack', and then proceed with the
8883 * src/files.c (compute_output_file_names, close_files): New.
8884 (output_files): Adjust.
8885 * src/main.c (main): Adjust.
8887 2001-09-23 Marc Autret <autret_m@epita.fr>
8889 * src/files.c (compute_header_macro): Computes header macro name
8890 from spec_defines_file when given.
8892 2001-09-23 Marc Autret <autret_m@epita.fr>
8894 * src/files.c (output_files): Add default extensions.
8896 2001-09-22 Akim Demaille <akim@epita.fr>
8898 * src/conflicts.c (finalize_conflicts): Rename as...
8899 (free_conflicts): this.
8901 2001-09-22 Akim Demaille <akim@epita.fr>
8903 * src/gram.c (gram_free): Rename back as...
8905 (output_token_translations): Free `token_translations'.
8906 * src/symtab.c (free_symtab): Free the tag field.
8908 2001-09-22 Akim Demaille <akim@epita.fr>
8910 Remove `translations' as it is always set to true.
8912 * src/gram.h: Adjust.
8913 * src/reader.c (packsymbols, parse_token_decl): Adjust
8914 * src/print.c (print_grammar): Adjust.
8915 * src/output.c (output_token_translations): Adjust.
8916 * src/lex.c (lex): Adjust.
8917 * src/gram.c: Be sure the set pointers to NULL.
8918 (dummy): Rename as...
8921 2001-09-22 Akim Demaille <akim@epita.fr>
8923 * configure.in: Invoke AM_LIB_DMALLOC.
8924 * src/system.h: Use dmalloc.
8925 * src/LR0.c: Be sure to have pointers initialized to NULL.
8926 (allocate_itemsets): Allocate kernel_items only if needed.
8928 2001-09-22 Akim Demaille <akim@epita.fr>
8930 * configure.in: Bump to 1.29b.
8931 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
8932 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
8933 need xmalloc.c in calc.y.
8936 2001-09-21 Akim Demaille <akim@epita.fr>
8939 * Makefile.maint, config/config.guess, config/config.sub,
8940 * config/missing: Update from masters.
8941 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
8943 * configure.in (ALL_LINGUAS): Add `tr'.
8945 2001-09-21 Akim Demaille <akim@epita.fr>
8947 * tests/Makefile.am (package.m4): Move to...
8948 ($(srcdir)/$(TESTSUITE)): here.
8950 2001-09-20 Akim Demaille <akim@epita.fr>
8952 * src/complain.c: No longer try to be standalone: use system.h.
8953 Don't assume __STDC__ is defined to 1. Just test if it is defined.
8954 * src/complain.h: Likewise.
8955 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
8956 Remove the unused variable `n'.
8957 From Albert Chin-A-Young.
8959 2001-09-18 Marc Autret <autret_m@epita.fr>
8961 * doc/bison.1: Update.
8962 * doc/bison.texinfo (Bison Options): Update --defines and --graph
8964 (Option Cross Key): Update.
8967 2001-09-18 Marc Autret <autret_m@epita.fr>
8969 * tests/regression.at: New test (comment in %union).
8971 2001-09-18 Marc Autret <autret_m@epita.fr>
8973 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
8975 Reported by Keith Browne.
8977 2001-09-18 Marc Autret <autret_m@epita.fr>
8979 * tests/output.at: Add tests for --defines and --graph.
8981 2001-09-18 Marc Autret <autret_m@epita.fr>
8983 * tests/output.at: Removes tests of %{header,src}_extension features.
8985 2001-09-18 Akim Demaille <akim@epita.fr>
8987 * tests/Makefile.am (package.m4): New.
8988 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
8989 (_AT_CHECK_CALC_ERROR): Likewise.
8990 Factor the `, ' part of verbose error messages.
8992 2001-09-18 Marc Autret <autret_m@epita.fr>
8994 * src/getargs.c (longopts): Declare --defines and --graph as options
8995 with optional arguments.
8996 * src/files.h: Add extern declarations.
8997 * src/files.c (spec_graph_file, spec_defines_file): New.
8998 (output_files): Update.
8999 Remove CPP-outed code.
9001 2001-09-18 Marc Autret <autret_m@epita.fr>
9003 Turn off %{source,header}_extension feature.
9005 * src/files.c (compute_exts_from_gf): Update.
9006 (compute_exts_from_src): Update.
9007 (output_files): CPP-out useless code.
9008 * src/files.h: Remove {header,source}_extension extern declarations.
9009 * src/reader.c (parse_dquoted_param): CPP-out.
9010 (parse_header_extension_decl): Remove.
9011 (parse_source_extension_decl): Remove.
9012 (read_declarations): Remove cases tok_{hdrext,srcext}.
9013 * src/lex.c (percent_table): Remove {header,source}_extension entries.
9014 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
9016 2001-09-10 Akim Demaille <akim@epita.fr>
9018 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
9019 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
9020 (AT_CHECK_OUTPUT): this.
9021 Merely check ls' exit status, its output is useless.
9023 2001-09-10 Akim Demaille <akim@epita.fr>
9025 * tests/calc.at: Use m4_match.
9026 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
9028 2001-09-10 Marc Autret <autret_m@epita.fr>,
9029 Akim Demaille <akim@epita.fr>
9031 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
9033 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
9035 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
9036 * src/lex.h: Adjust prototype.
9037 (token_t): Add `tok_undef'.
9038 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
9039 (parse_percent_token): Now returns token_t.
9040 Add default statement in switch.
9041 (lex): Separate `c' as an input variable, from the token_t result
9043 (unlexed): Is a token_t.
9045 2001-09-10 Akim Demaille <akim@epita.fr>
9047 * configure.in: Bump to 1.29a.
9049 2001-09-07 Akim Demaille <akim@epita.fr>
9053 2001-08-30 Akim Demaille <akim@epita.fr>
9055 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
9056 * m4/atconfig.m4: Remove.
9057 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
9059 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
9060 m4_if, m4_patsubst, and m4_regexp.
9061 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
9062 `input' file instead of echo.
9064 2001-08-29 Akim Demaille <akim@epita.fr>
9068 2001-08-29 Akim Demaille <akim@epita.fr>
9072 2001-08-29 Paul Eggert <eggert@twinsun.com>
9074 * src/bison.simple (yyparse): Don't take the address of an
9075 item before the start of an array, as that doesn't conform to
9078 2001-08-29 Robert Anisko <anisko_r@epita.fr>
9080 * doc/bison.texinfo (Location Tracking Calc): New node.
9082 2001-08-29 Paul Eggert <eggert@twinsun.com>
9084 * src/output.c (output): Do not define const, as this now
9085 causes more problems than it cures.
9087 2001-08-29 Akim Demaille <akim@epita.fr>
9089 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
9091 Be sure to tag the `detailmenu'.
9093 2001-08-29 Akim Demaille <akim@epita.fr>
9095 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
9096 download in a tmp dir.
9098 2001-08-28 Marc Autret <autret_m@epita.fr>
9100 * config/depcomp: New file.
9102 2001-08-28 Marc Autret <autret_m@epita.fr>
9104 * doc/bison.1 (mandoc): Adjust.
9105 From Juan Manuel Guerrero.
9107 2001-08-28 Marc Autret <autret_m@epita.fr>
9109 * src/print_graph.c (print_state): Fix.
9111 2001-08-27 Marc Autret <autret_m@epita.fr>
9113 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
9115 Echo modifications to the functions prototypes.
9116 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
9118 2001-08-27 Marc Autret <autret_m@epita.fr>
9120 * src/vcg.c: Include `xalloc.h'.
9121 (add_colorentry): New.
9122 (add_classname): New.
9123 (add_infoname): New.
9124 * src/vcg.h: Add new prototypes.
9126 2001-08-27 Akim Demaille <akim@epita.fr>
9128 * Makefile.maint: Sync. again with CVS Autoconf.
9130 2001-08-27 Akim Demaille <akim@epita.fr>
9132 * Makefile.maint: Formatting changes.
9133 (po-update, cvs-update, update): New targets.
9136 2001-08-27 Akim Demaille <akim@epita.fr>
9138 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9139 * Makefile.maint: Sync. with CVS Autoconf.
9141 2001-08-27 Marc Autret <autret_m@epita.fr>
9143 * src/vcg.h (struct infoname_s): New.
9144 (struct colorentry_s): New.
9145 (graph_s): New fields {vertical,horizontal}_order in structure.
9146 Add `infoname' field.
9147 Add `colorentry' field;
9148 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
9149 (G_HORIZONTAL_ORDER): New.
9151 (G_COLORENTRY): New.
9152 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
9153 Add output of `infoname'.
9154 Add output of `colorentry'.
9156 2001-08-27 Marc Autret <autret_m@epita.fr>
9158 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
9159 This one shadowed a global parameter.
9161 2001-08-24 Marc Autret <autret_m@epita.fr>
9163 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
9164 instead of `unsigned'.
9165 (print_state): Do not call obstack_object_size () in obstack_grow ()
9166 to avoid macro variables shadowing.
9168 2001-08-23 Marc Autret <autret_m@epita.fr>
9170 * src/lex.c (percent_table): Typo: s/naem/name/.
9172 Normalize new options declarations.
9174 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
9176 * tests/suite.at: Exercise %header_extension and %source_extension.
9178 2001-08-16 Marc Autret <autret_m@epita.fr>
9180 * src/reader.c (parse_dquoted_param): New.
9181 (parse_header_extension_decl): Use it.
9182 (parse_source_extension_decl): Likewise.
9184 2001-08-16 Marc Autret <autret_m@epita.fr>
9186 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
9187 (get_xxxx_str): Use assert () instead of complain ().
9188 Remove return invokations in default cases.
9189 (get_decision_str): Modify default behaviour. Remove second argument.
9190 Echo modifications on calls.
9191 (output_graph): Fix.
9193 2001-08-16 Marc Autret <autret_m@epita.fr>
9195 * src/getargs.c (usage): Update with ``-g, --graph''.
9197 2001-08-16 Marc Autret <autret_m@epita.fr>
9199 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
9200 (Option Cross Key): Likewise.
9201 * doc/bison.1: Update.
9203 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
9205 * src/output.c (output_master_parser): Don't finish action_obstack.
9206 (output_parser): Don't care about the muscle action, here.
9207 (prepare): Copy the action_obstack in the action muscle.
9208 (output): Free action_obstack.
9210 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
9212 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
9213 will contain `%union' declaration.
9214 (parse_union_decl): Delete #line directive output.
9215 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
9216 informations about %union.
9217 (parse_union_decl): Copy the union_obstack in the muscle stype.
9218 * src/bison.simple: Add new #line directive.
9219 Add typdef %%stype YYSTYPE.
9221 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
9223 * src/bison.simple: Add new `#line' directive.
9225 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
9227 * src/bison.simple: New `#line' directive.
9228 * src/output.c (output_parser): Support new dynamic muscle input_line.
9230 2001-09-22 Marc Autret <autret_m@epita.fr>
9232 * src/output.c (output_master_parser): New.
9233 (output_parser): Be more re-entrant.
9235 2001-09-21 Marc Autret <autret_m@epita.fr>
9237 * src/reader.c (copy_definition, parse_union_decl): Update and use
9239 (copy_action): Likewise.
9240 Use obstack_1grow ().
9241 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
9243 2001-09-21 Marc Autret <autret_m@epita.fr>
9245 * src/options.c (option_table): Adjust.
9246 * src/lex.c (parse_percent_token): Fix.
9248 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
9250 * src/options.c (symtab.h): Include it, need by lex.h.
9252 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
9254 * src/lex.c (parse_percent_token): Change type of variable `tx', which
9255 is now an option_table_struct*.
9256 (option_strcmp): New function option_strcmp.
9257 (parse_percent_token): Call option_strcmp.
9258 * src/getargs.c (xalloc.h, options.h): Include it.
9259 (getargs): Call create_long_option_table.
9260 (getargs): Free longopts at the end of the function.
9261 (shortopts): Move in options.c.
9262 * src/options.c (create_long_option_table): New function. Convert
9263 information from option_table to option structure.
9264 * src/reader.c (options.h): Include it.
9266 * src/Makefile.am: Adjust.
9267 * src/options.c (option_table): Create from longopts and percent_table.
9268 * src/getargs.c (longopts): Delete.
9269 * src/lex.c (struct percent_table_struct): Delete.
9270 (percent_table): Delete.
9271 (options.h): Include it.
9272 * src/options.c: Create.
9273 * src/options.h: Create.
9274 Declare enum opt_access_e.
9275 Define struct option_table_struct.
9277 2001-09-20 Marc Autret <autret_m@epita.fr>
9279 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
9282 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
9284 * src/bison.simple: s/%%filename/%%skeleton.
9285 * src/muscle_tab.c (getargs.h): Include it.
9286 (muscle_init): Insert new muscle skeleton.
9288 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
9290 * src/output.c (output_parser): Delete unused variable actions_dumped.
9292 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
9294 * src/output.c (output): Delete call to reader_output_yylsp.
9295 * src/reader.c (reader): Likewise.
9296 * src/reader.h: Delete declaration of reader_output_yylsp.
9298 2001-09-02 Marc Autret <autret_m@epita.fr>
9300 * src/reader.c: Include muscle_tab.h.
9301 (parse_union_decl): Update.
9302 (parse_macro_decl): Rename parse_muscle_decl.
9303 Update to use renamed functions and variable.
9304 (read_declarations, copy_action, read_additionnal_code, : Updated
9305 with correct variables and functions names.
9306 (packsymbols, reader): Likewise.
9308 * src/reader.h (muscle_obstack): Extern declaration update.
9310 * src/output.c: Include muscle_tab.h
9311 In all functions using macro_insert, change by using muscle_insert ().
9312 (macro_obstack): Rename muscle_obstack.
9313 Echo modifications in the whole file.
9314 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
9315 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
9316 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
9318 * src/muscle_tab.h: Update double inclusion macros.
9319 (macro_entry_s): Rename muscle_entry_s.
9322 * src/muscle_tab.c: Include muscle_tab.h.
9323 Rename macro_tabble to muscle_table.
9324 (mhash1, mhash2, mcmp): Use muscle_entry.
9325 (macro_init): Rename muscle_init. Update.
9326 (macro_insert): Rename muscle_insert. Update.
9327 (macro_find): Rename muscle_find. Update.
9329 * src/main.c: Include muscle_tab.h.
9330 (main): Call muscle_init ().
9331 * src/Makefile.am (bison_SOURCES): Echo modifications.
9333 2001-09-02 Marc Autret <autret_m@epita.fr>
9335 Now the files macro_tab.[ch] are named muscle_tab.[ch].
9337 * src/muscle_tab.c, src/muscle_tab.h: Add files.
9339 2001-09-02 Marc Autret <autret_m@epita.fr>
9341 * src/macrotab.c, src/macrotab.h: Remove.
9343 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
9345 * src/reader.c (copy_guard): Use muscle to specify the `#line'
9348 2001-09-01 Marc Autret <autret_m@epita.fr>
9350 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
9351 to an explicit value to activate the feature. We do it here.
9353 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9355 * src/output.c (prepare): Delete the `filename' muscule insertion.
9356 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
9357 (parse_union_decl): Likewise.
9358 * src/macrotab.c (macro_init): Initialize filename by infile.
9360 2001-08-31 Marc Autret <autret_m@epita.fr>
9362 * src/bison.simple (YYLSP_NEEDED): New definition.
9363 * src/output.c (prepare): Add macro insertion of `locations_flag'
9365 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9367 * src/output.c (prepare): Delete insertion of previous muscles,
9368 and insert the `prefix' muscles.
9369 * src/macrotab.c (macro_init): Likewise.
9370 (macro_init): Initialization prefix directive by `yy'.
9371 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
9372 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
9373 yylval, yydebug, yyerror, yynerrs and yyparse.
9374 New directive `#define' to substitute yydebug, ... with option
9377 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9379 * src/main.c (main): Standardize.
9380 * src/output.c (output_table_data, output_parser): Likewise.
9381 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
9383 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
9385 * src/reader.c (read_additionnal_code): Rename %%user_code to
9387 * src/output.c (output): Rename %%declarations to %%prologue.
9388 * src/bison.simple: Echo modifications.
9390 2001-08-31 Marc Autret <autret_m@epita.fr>
9392 * src/reader.c (readgram): CleanUp.
9393 (output_token_defines): Likewise.
9394 (packsymbols): Likewise.
9396 * src/output.c (output): CPP-out useless code.
9398 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9400 * src/reader.c (reader): Delete obsolete call to function
9401 output_trailers and output_headers.
9402 * src/output.h: Remove obsolete functions prototypes of output_headers
9403 and output_trailers.
9405 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
9407 * src/main.c: Include macrotab.h.
9408 * src/macrotab.h (macro_entry_s): Constify fields.
9409 Adjust functions prototypes.
9410 * src/macrotab.c (macro_insert): Constify key and value.
9411 (macro_find): Constify key.
9412 (macro_insert): Include 'xalloc.h'
9413 (macro_insert): Use XMALLOC.
9414 (macro_find): Constify return value.
9415 * src/output.c (output_table_data): Rename table to table_data.
9416 (output_parser): Constify macro_key, macro_value.
9418 2001-08-30 Marc Autret <autret_m@epita.fr>
9420 * src/reader.c (parse_skel_decl): New.
9421 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
9422 * src/lex.h (token_t): New token `tok_skel'.
9423 * src/lex.c (percent_table): Add skeleton option entry.
9426 2001-08-29 Marc Autret <autret_m@epita.fr>
9428 * src/bison.simple: Add %%user_code directive at the end.
9429 * src/reader.c (read_additionnal_code): New.
9431 * src/output.c (output_program): Remove.
9434 2001-08-28 Marc Autret <autret_m@epita.fr>
9436 * src/output.c (output_actions): Clean up.
9437 (output_gram): CPP-out useless code.
9438 * src/reader.c (reader): Clean up, CPP-out useless code.
9440 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
9442 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
9444 * src/bison.simple: Add `%%definitions'.
9446 2001-08-28 Marc Autret <autret_m@epita.fr>
9448 * config/depcomp: New file.
9450 2001-08-27 Paul Eggert <eggert@twinsun.com>
9452 * src/bison.simple (yyparse): Don't take the address of an
9453 item before the start of an array, as that doesn't conform to
9456 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
9458 * src/output.c (output): Remove the initialization of the macro
9459 obstack. It was done too late here.
9461 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
9463 (reader): Initialize the macro obstack here, since we need it to grow
9464 '%define' directives.
9466 * src/reader.h: Declare the macro obstack as extern.
9468 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
9470 * src/output.c (output_parser): Fix. Store single '%' characters in
9471 the output obstack instead of throwing them away.
9473 2001-08-27 Akim Demaille <akim@epita.fr>
9475 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9477 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9479 * lib/Makefile.am: Adjust.
9481 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9483 * src/bison.simple: Update and add '%%' directives.
9485 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9487 * src/reader.c (reader): Remove calls to 'output_headers' and
9488 'output_trailers'. Remove some C output.
9489 (readgram): Disable a piece of code that was writing a default
9490 definition for 'YYSTYPE'.
9491 (reader_output_yylsp): Remove.
9492 (packsymbols): Output token defintions to a macro.
9493 (copy_definition): Disable C output.
9495 * src/reader.c (parse_macro_decl): New function used to parse macro
9497 (copy_string2): Put the body of copy_string into this new function.
9498 Add a parameter to let the caller choose whether he wants to copy the
9499 string delimiters or not.
9500 (copy_string): Be a simple call to copy_string2 with the last argument
9502 (read_declarations): Add case for macro definition.
9503 (copy_identifier): New.
9504 (parse_macro_decl): Read macro identifiers using copy_identifier
9507 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9509 * src/output.c (prepare): Add prefixed names.
9510 (output_parser): Output semantic actions.
9511 (output_parser): Fix bug on '%%line' directives.
9513 * src/output.c (output_headers): Remove. The C code printed by this
9514 function should now be in the skeletons.
9515 (output_trailers): Remove.
9516 (output): Disable call to 'reader_output_yylsp'.
9517 (output_rule_data): Do not output tables to the table obstack.
9519 * src/output.c: Remove some C dedicated output.
9520 Improve the use of macro and output obstacks.
9521 (output_defines): Remove.
9523 * src/output.c (output_token_translations): Associate 'translate'
9524 table with a macro. No output to the table obstack.
9525 (output_gram): Same for 'rhs' and 'prhs'.
9526 (output_stos): Same for 'stos'.
9527 (output_rule_data): Same for 'r1' and 'r2'.
9528 (token_actions): Same for 'defact'.
9529 (goto_actions): Same for 'defgoto'.
9530 (output_base): Same for 'pact' and 'pgoto'.
9531 (output_table): Same for 'table'.
9532 (output_check): Same for 'check'.
9534 * src/output.c (output_table_data): New function.
9535 (output_short_table): Remove.
9536 (output_short_or_char_table): Remove.
9538 * src/output.c (output_parser): Replace most of the skeleton copy code
9539 with something new. Skeletons are now processed character by character
9540 rather than line by line, and Bison looks for '%%' macros. This is the
9541 first step in making Bison's output process (a lot) more flexible.
9542 (output_parser): Use the macro table.
9544 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9546 * src/main.c (main): Initialize the macro table.
9548 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9550 * src/lex.c (percent_table): Add tok_define.
9551 * src/lex.h: Add tok_define.
9553 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9555 * src/macrotab.c: New file.
9556 * src/macrotab.h: New file.
9557 * src/Makefile.am: Update.
9559 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9561 * lib/hash.c: New file.
9562 * lib/hash.h: New file.
9563 * lib/Makefile.am: Update.
9565 2001-08-15 Akim Demaille <akim@epita.fr>
9569 2001-08-15 Marc Autret <autret_m@epita.fr>
9571 * src/reader.c (readgram): Indent output macro YYSTYPE.
9572 (packsymbols): Likewise.
9573 (output_token_defines): Likewise.
9574 * src/files.c: Standardize.
9575 (compute_header_macro): New.
9576 (defines_obstack_save): New. Use compute_header_macro.
9577 (output_files): Update. Use defines_obstack_save.
9579 2001-08-15 Akim Demaille <akim@epita.fr>
9581 * doc/bison.texinfo (Table of Symbols): Document
9584 2001-08-15 Akim Demaille <akim@epita.fr>
9586 * missing: Update from CVS Automake.
9587 * config/config.guess, config/config.sub, config/texinfo.tex:
9588 Update from gnu.org.
9590 2001-08-15 Akim Demaille <akim@epita.fr>
9592 * Makefile.maint: Sync with CVS Autoconf.
9594 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
9596 * doc/bison.texinfo: Include GNU Free Documentation License from
9598 * doc/fdl.texi: Add to package.
9600 2001-08-14 Marc Autret <autret_m@epita.fr>
9602 Turn on %{source,header}_extension features.
9604 * src/lex.c (percent_table): Un-CPP out header_extension and
9606 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
9607 (compute_exts_from_src): Remove conditions. It restores priorities
9610 2001-08-14 Marc Autret <autret_m@epita.fr>
9612 * src/files.c (compute_base_names): Add extensions computing when
9613 `--file-prefix' used.
9614 Standardize function calls.
9616 2001-08-13 Marc Autret <autret_m@epita.fr>
9618 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
9619 defining it (defined but null disables alloca).
9621 2001-08-13 Marc Autret <autret_m@epita.fr>
9623 * src/bison.simple (_yy_memcpy): CPP reformat.
9625 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
9627 * tests/atconfig.in (CPPFLAGS): Fix.
9629 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
9631 * doc/bison.texinfo: Include GNU General Public License from
9633 * doc/gpl.texi: Add to package.
9635 2001-08-10 Marc Autret <autret_m@epita.fr>
9637 * src/print_graph.h: Fix.
9638 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
9640 2001-08-10 Akim Demaille <akim@epita.fr>
9642 * src/system.h: Provide default declarations for stpcpy, strndup,
9645 2001-08-10 Robert Anisko <anisko_r@epita.fr>
9647 * doc/bison.texinfo (Locations): Update @$ stuff.
9649 2001-08-09 Robert Anisko <anisko_r@epita.fr>
9651 * src/bison.simple (YYLLOC_DEFAULT): Update.
9654 2001-08-08 Marc Autret <autret_m@epita.fr>
9656 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
9657 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
9658 Reported by Fabrice Bauzac.
9660 2001-08-08 Marc Autret <autret_m@epita.fr>
9662 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
9663 * src/vcg.c (output_node): Fix.
9664 * src/vcg.h: Cleanup.
9665 * src/print_graph.c: Add comments.
9666 (node_output_size): New global variable. Simplify the formatting of
9667 the VCG graph output.
9668 (print_actions): Unused code is now used. It notifies the final state
9669 and no action states in the VCG graph. It also give the reduce actions.
9670 The `shift and goto' edges are red and the `go to state' edges are
9672 Get the current node name and node_obstack by argument.
9673 (node_obstack): New variable.
9674 (print_state): Manage node_obstack.
9675 (print_core): Use node_obstack given by argument.
9676 A node is not only computed here but in print_actions also.
9677 (print_graph): CPP out useless code instead of commenting it.
9679 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
9681 * tests/atconfig.in (CPPFLAGS): Fix.
9683 2001-08-07 Akim Demaille <akim@epita.fr>
9685 * src/print_graph.c (quote): New.
9686 (print_core): Use it.
9688 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
9690 * src/vcg.c (complain.h): Include it.
9691 Unepitaize `return' invocations.
9692 [NDEBUG] (main): Remove.
9693 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
9694 * src/files.c (open_files): Initialize graph_obstack.
9695 * src/print_graph.c (print_actions): CPP out useless code.
9696 (print_core): Don't output the last `\n' in labels.
9698 * src/files.c (output_files): Output the VCG file.
9699 * src/main.c (main): Invoke print_graph ();
9701 2001-08-06 Marc Autret <autret_m@epita.fr>
9703 Automaton VCG graph output.
9704 Using option ``-g'' or long option ``--graph'', you can generate
9705 a gram_filename.vcg file containing a VCG description of the LALR (1)
9706 automaton of your grammar.
9708 * src/main.c: Call to print_graph() function.
9709 * src/getargs.h: Update.
9710 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
9711 (graph_flag): New flag.
9713 (getargs): Add case `g'.
9714 * src/files.c (graph_obstack): New obstack struct.
9715 (open_files): Initialize new obstack.
9716 (output_files): Saves graph_obstack if required.
9717 * src/files.h (graph_obstack): New extern declaration.
9718 * src/Makefile.am: Add new source files.
9720 2001-08-06 Marc Autret <autret_m@epita.fr>
9722 * src/print_graph.c, src/print_graph.h (graph): New.
9723 * src/vcg.h: New file.
9724 * src/vcg.c: New file, VCG graph handling.
9726 2001-08-06 Marc Autret <autret_m@epita.fr>
9728 Add of %source_extension and %header_extension which specify
9729 the source or/and the header output file extension.
9731 * src/files.c (compute_base_names): Remove initialisation of
9732 src_extension and header_extension.
9733 (compute_exts_from_gf): Update.
9734 (compute_exts_from_src): Update.
9735 (output_files): Update.
9736 * src/reader.c (parse_header_extension_decl): New.
9737 (parse_source_extension_decl): New.
9738 (read_declarations): New case statements for the new tokens.
9739 * src/lex.c (percent_table): Add entries for %source_extension
9740 and %header_extension.
9741 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
9743 2001-08-06 Marc Autret <autret_m@epita.fr>
9745 * configure.in: Bump to 1.28c.
9746 * doc/bison.texinfo: Texinfo thingies.
9748 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
9750 * tests/atconfig.in (CPPFLAGS): Add.
9751 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
9753 2001-08-03 Akim Demaille <akim@epita.fr>
9757 2001-08-03 Akim Demaille <akim@epita.fr>
9759 * tests/Makefile.am (check-local): Ship testsuite.
9760 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
9763 2001-08-03 Akim Demaille <akim@epita.fr>
9765 * configure.in: Try using -Wformat when compiling.
9767 2001-08-03 Akim Demaille <akim@epita.fr>
9769 * configure.in: Bump to 1.28b.
9771 2001-08-03 Akim Demaille <akim@epita.fr>
9773 * src/complain.c: Adjust strerror_r portability issues.
9775 2001-08-03 Akim Demaille <akim@epita.fr>
9779 2001-08-03 Akim Demaille <akim@epita.fr>
9781 * src/getargs.c, src/getarg.h (skeleton)): Constify.
9782 * src/lex.c (literalchar): Avoid name clashes on `buf'.
9783 * src/getargs.c: Include complain.h.
9784 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
9785 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
9787 2001-08-03 Akim Demaille <akim@epita.fr>
9789 * src/reader.c (readgram): Display hidden chars in error messages.
9791 2001-08-03 Akim Demaille <akim@epita.fr>
9793 Update to gettext 0.10.39.
9795 2001-08-03 Akim Demaille <akim@epita.fr>
9797 * lib/strspn.c: New.
9799 2001-08-01 Marc Autret <autret_m@epita.fr>
9801 * doc/bison.texinfo: Update.
9802 * doc/bison.1 (mandoc): Update.
9803 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
9804 * src/files.c: Support output files extensions computing.
9805 (src_extension): New static variable.
9806 (header_extension): New static variable.
9808 (get_extension_index): New function, gets the index of an extension
9809 filename in a string.
9810 (compute_exts_from_gf): New function, computes extensions from the
9811 grammar file extension.
9812 (compute_exts_from_src): New functions, computes extensions from the
9813 C source file extension, file given by ``-o'' option.
9814 (compute_base_names): Update.
9815 (output_files): Update.
9817 2001-08-01 Robert Anisko <anisko_r@epita.fr>
9819 * doc/bison.texi: Document @$.
9820 (Locations): New section.
9822 2001-07-18 Akim Demaille <akim@epita.fr>
9824 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
9825 * config/prev-version.txt, config/move-if-change: New.
9826 * Makefile.am: Adjust.
9828 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
9830 * src/bison.simple (yyparse): Suppress warning `comparaison
9831 between signed and unsigned'.
9833 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
9835 * src/getargs.h (raw_flag): Remove.
9836 * src/getargs.c: Die on `-r'/`--raw'.
9837 * src/lex.c (parse_percent_token): Die on `%raw'.
9838 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
9839 * tests/calc.at: Suppress test with option `--raw'.
9841 2001-07-14 Akim Demaille <akim@epita.fr>
9844 * configure.in: Require Autoconf 2.50.
9845 Update to gettext 0.10.38.
9847 2001-03-16 Akim Demaille <akim@epita.fr>
9849 * doc/bison.texinfo: ANSIfy the examples.
9851 2001-03-16 Akim Demaille <akim@epita.fr>
9853 * getargs.c (skeleton): New variable.
9854 (longopts): --skeleton is a new option.
9855 (shortopts, getargs): -S is a new option.
9856 * getargs.h: Declare skeleton.
9857 * output.c (output_parser): Use it.
9859 2001-03-16 Akim Demaille <akim@epita.fr>
9861 * m4/strerror_r.m4: New.
9862 * m4/error.m4: Run AC_FUNC_STRERROR_R.
9863 * lib/error.h, lib/error.c: Update.
9865 2001-03-16 Akim Demaille <akim@epita.fr>
9867 * src/getargs.c (longopts): Clean up.
9869 2001-02-21 Akim Demaille <akim@epita.fr>
9871 * src/reader.c (gensym): `gensym_count' is your own.
9872 Use a static buf to create the symbol name, as token_buffer is no
9875 2001-02-08 Akim Demaille <akim@epita.fr>
9877 * src/conflicts.c (conflict_report): Be sure not to append to res
9878 between two calls, which could happen if both first sprintf were
9879 skipped, but not the first cp += strlen.
9881 2001-02-08 Akim Demaille <akim@epita.fr>
9883 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
9884 New, from fileutils 4.0.37.
9885 * configure.in: Require Autoconf 2.49c. I took some time before
9886 making this decision. This is the only way out for portability
9887 issues in Bison, it would mean way too much duplicate effort to
9888 import in Bison features implemented in 2.49c since 2.13.
9889 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
9891 2001-02-02 Akim Demaille <akim@epita.fr>
9893 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
9894 * lib/xalloc.h, lib/xmalloc.c: Update.
9896 2001-01-19 Akim Demaille <akim@epita.fr>
9898 Get rid of the ad hoc handling of token_buffer in the scanner: use
9901 * src/lex.c (token_obstack): New.
9902 (init_lex): Initialize it. No longer call...
9903 (grow_token_buffer): this. Remove it.
9904 Adjust all the places which used it to use the obstack.
9906 2001-01-19 Akim Demaille <akim@epita.fr>
9908 * src/lex.h: Rename all the tokens:
9909 s/\bENDFILE\b/tok_eof/g;
9910 s/\bIDENTIFIER\b/tok_identifier/g;
9912 Let them be enums, not #define, to ease debugging.
9913 Adjust all the code.
9915 2001-01-18 Akim Demaille <akim@epita.fr>
9917 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
9918 * src/lex.c (maxtoken, grow_token_buffer): Static.
9920 2001-01-18 Akim Demaille <akim@epita.fr>
9922 Since we now use obstacks, more % directives can be enabled.
9924 * src/lex.c (percent_table): Also accept `%yacc',
9925 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
9927 Handle the actions for `%semantic_parser' and `%pure_parser' here,
9928 instead of returning a token.
9929 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
9930 * src/reader.c (read_declarations): Adjust.
9931 * src/files.c (open_files): Don't call `compute_base_names', don't
9932 compute `attrsfile' since they depend upon data which might be
9933 *in* the input file now.
9934 (output_files): Do it here.
9935 * src/output.c (output_headers): Document the fact that this patch
9936 introduces a guaranteed SEGV for semantic parsers.
9937 * doc/bison.texinfo: Document them.
9938 * tests/suite.at: Exercise these %options.
9940 2000-12-20 Akim Demaille <akim@epita.fr>
9942 Also handle the output file (--verbose) with obstacks.
9944 * files.c (foutput): Remove.
9945 (output_obstack): New.
9946 Adjust all dependencies.
9947 * src/conflicts.c: Return a string.
9948 * src/system.h (obstack_grow_string): Rename as...
9949 (obstack_sgrow): this. Be ready to work with non literals.
9950 (obstack_fgrow4): New.
9952 2000-12-20 Akim Demaille <akim@epita.fr>
9954 * src/files.c (open_files): Fix the computation of short_base_name
9955 in the case of `-o foo.tab.c'.
9957 2000-12-20 Akim Demaille <akim@epita.fr>
9959 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
9960 (copy_dollar): Now that everything uses obstacks, get rid of the
9963 2000-12-20 Akim Demaille <akim@epita.fr>
9965 * src/files.c (open_files): Actually the `.output' file is based
9966 on the short_base_name, not base_name.
9967 * tests/suite.at (Checking output file names): Adjust.
9969 2000-12-20 Akim Demaille <akim@epita.fr>
9971 * src/bison.s1: Remove, we now use directly...
9972 * src/bison.simple: this.
9973 * src/Makefile.am: Use pkgdata instead of data.
9975 2000-12-20 Akim Demaille <akim@epita.fr>
9977 * src/files.c (guard_obstack): New.
9978 (open_files): Initialize it.
9979 (output_files): Dump it...
9980 * src/files.h: Export it.
9981 * src/reader.c (copy_guard): Use it.
9983 2000-12-19 Akim Demaille <akim@epita.fr>
9985 * src/files.c (outfile, defsfile, actfile): Removed as global
9987 (open_files): Don't compute them.
9988 (output_files): Adjust.
9989 (base_name, short_base_name): Be global.
9990 Adjust dependencies.
9992 2000-12-19 Akim Demaille <akim@epita.fr>
9994 * src/files.c (strsuffix): New.
9995 (stringappend): Be just like strcat but allocate.
9996 (base_names): Eve out from open_files.
9997 Try to simplify the rather hairy computation of base_name and
9999 (open_files): Use it.
10000 * tests/suite.at (Checking output file names): New test.
10002 2000-12-19 Akim Demaille <akim@epita.fr>
10004 * src/system.h (obstack_grow_literal_string): Rename as...
10005 (obstack_grow_string): this.
10006 * src/output.c (output_parser): Recognize `%% actions' instead of
10008 * src/bison.s1: s/$/%% actions/.
10009 * src/bison.hairy: Likewise.
10011 2000-12-19 Akim Demaille <akim@epita.fr>
10013 * src/output.c (output_parser): Compute the `#line' lines when
10015 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
10016 Suggested by Hans Aberg.
10018 2000-12-19 Akim Demaille <akim@epita.fr>
10020 Let the handling of the skeleton files be local to the procedures
10023 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
10025 (fparser, open_extra_files): Remove.
10026 (open_files, output_files): Don't take care of fparser.
10027 * src/files.h: Adjust.
10028 * src/output.c (output_parser): Open and close the file to the
10030 * src/reader.c (read_declarations): When %semantic_parser, open
10033 2000-12-19 Akim Demaille <akim@epita.fr>
10035 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
10036 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
10038 2000-12-19 Akim Demaille <akim@epita.fr>
10040 * src/files.c (open_files): Yipee! We no longer need all the code
10041 looking for `/tmp' since we have no tmp file.
10043 2000-12-19 Akim Demaille <akim@epita.fr>
10045 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
10047 * src/files.c (open_files): Less dependency on MSDOS etc.
10049 2000-12-14 Akim Demaille <akim@epita.fr>
10051 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
10052 Provide a default definition.
10053 Use it when executing the default @ action.
10054 * src/reader.c (reader_output_yylsp): No longer include
10055 `timestamp' and `text' in the default YYLTYPE.
10057 2000-12-12 Akim Demaille <akim@epita.fr>
10059 * src/reader.c (copy_definition, parse_union_decl, copy_action)
10060 (copy_guard): Quote the file names.
10061 Reported by Laurent Mascherpa.
10063 2000-12-12 Akim Demaille <akim@epita.fr>
10065 * src/output.c (output_headers, output_program, output): Be sure
10066 to escape special characters when outputting filenames.
10067 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
10068 (output_headers): Don't depend on them, Use ACTSTR.
10070 2000-11-17 Akim Demaille <akim@epita.fr>
10072 * lib/obstack.h: Formatting changes.
10073 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
10074 prevents type checking.
10075 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
10076 cast the value to (void *): assigning a `foo *' to a `void *'
10078 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
10079 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
10082 2000-11-17 Akim Demaille <akim@epita.fr>
10084 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
10086 (suite.m4, regression.m4, calc.m4): these.
10087 * tests/atgeneral.m4: Update from CVS Autoconf.
10089 2000-11-17 Akim Demaille <akim@epita.fr>
10091 * tests/regression.m4 (%union and --defines): New test,
10092 demonstrating a current bug in the obstack implementation.
10094 2000-11-17 Akim Demaille <akim@epita.fr>
10096 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
10098 Use them to declare the variables which are global or local to
10101 2000-11-17 Akim Demaille <akim@epita.fr>
10103 * acconfig.h: Remove, no longer used.
10105 2000-11-07 Akim Demaille <akim@epita.fr>
10107 * src: s/Copyright (C)/Copyright/g.
10109 2000-11-07 Akim Demaille <akim@epita.fr>
10111 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
10113 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
10115 2000-11-07 Akim Demaille <akim@epita.fr>
10117 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
10118 Merge in a single CPP if/else.
10120 2000-11-07 Akim Demaille <akim@epita.fr>
10122 * src/output.c (output): Remove useless variables.
10123 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
10124 argument `data' for consistency with the prototypes.
10125 Qualify it `const'.
10126 (obstack_copy, obstack_copy0): Rename the second argument as
10127 `address' for consistency. Qualify it `const'.
10128 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
10129 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
10130 `const' their input argument (`data' or `address').
10131 Adjust the corresponding macros to include `const' in casts.
10133 2000-11-03 Akim Demaille <akim@epita.fr>
10135 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
10136 s/PFILE1/BISON_HAIRY/.
10137 Adjust dependencies.
10139 2000-11-03 Akim Demaille <akim@epita.fr>
10141 For some reason, this was not applied.
10143 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
10144 `unlink': it's no longer used.
10146 2000-11-03 Akim Demaille <akim@epita.fr>
10148 * src/files.c (skeleton_find): New function, eved out of...
10149 (open_files, open_extra_files): here.
10151 2000-11-03 Akim Demaille <akim@epita.fr>
10153 Don't use `atexit'.
10155 * src/files.c (obstack_save): New function.
10156 (done): Rename as...
10157 (output_files): this.
10158 Use `obstack_save'.
10159 * src/main.c (main): Don't use `atexit' to register `done', since
10160 it no longer has to remove tmp files, just call `output_files'
10161 when there are no errors.
10163 2000-11-02 Akim Demaille <akim@epita.fr>
10165 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
10166 `unlink': it's no longer used.
10167 * src/files.h: Formatting changes.
10169 2000-11-02 Akim Demaille <akim@epita.fr>
10171 Remove the last uses of mktemp and unlink/delete.
10173 * src/files.c (fdefines, ftable): Removed.
10174 (defines_ostack, table_obstack): New.
10175 Adjust dependencies of the former into uses of the latter.
10176 * src/output.c (output_short_or_char_table, output_short_table):
10177 Convert to using obstacks.
10178 * src/reader.c (copy_comment2): Accept one FILE * and two
10180 (output_token_defines, reader_output_yylsp): Use obstacks.
10181 * src/system.h (obstack_fgrow3): New.
10183 2000-11-01 Akim Demaille <akim@epita.fr>
10185 Change each use of `fattrs' into a use of `attrs_obstack'.
10187 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
10188 * src/files.c (fattrs): Remove.
10189 (attrs_obstack): New.
10190 Adjust all dependencies.
10191 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
10193 2000-11-01 Akim Demaille <akim@epita.fr>
10195 Introduce obstacks.
10196 Change each use of `faction' into a use of `action_obstack'.
10198 * lib/obstack.h, lib/obstack.c: New files.
10199 * src/files.c (faction): Remove.
10200 (action_obstack): New.
10201 Adjust all dependencies.
10203 2000-10-20 Akim Demaille <akim@epita.fr>
10205 * lib/quote.h (PARAMS): New macro. Use it.
10207 2000-10-16 Akim Demaille <akim@epita.fr>
10209 * src/output.c (output_short_or_char_table): New function.
10210 (output_short_table, output_token_translations): Use it.
10211 (goto_actions): Use output_short_table.
10213 2000-10-16 Akim Demaille <akim@epita.fr>
10215 * src/symtab.c (bucket_new): New function.
10218 * src/output.c (output_short_table): New argument to display the
10219 comment associated with the table.
10220 Adjust dependencies.
10221 (output_gram): Use it.
10222 (output_rule_data): Nicer output layout for YYTNAME.
10224 2000-10-16 Akim Demaille <akim@epita.fr>
10226 * src/lex.c (read_typename): New function.
10228 * src/reader.c (copy_dollar): Likewise.
10230 2000-10-16 Akim Demaille <akim@epita.fr>
10232 * src/reader.c (copy_comment2): Expect the input stream to be on
10233 the `/' which is suspected to open a comment, instead of being
10234 called after `//' or `/*' was read.
10235 (copy_comment, copy_definition, parse_union_decl, copy_action)
10236 (copy_guard): Adjust.
10238 2000-10-16 Akim Demaille <akim@epita.fr>
10240 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
10241 `read_signed_integer'.
10243 2000-10-16 Akim Demaille <akim@epita.fr>
10245 * src/reader.c (copy_dollar): New function.
10246 (copy_guard, copy_action): Use it.
10248 2000-10-16 Akim Demaille <akim@epita.fr>
10250 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
10251 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
10252 New files, from Fileutils 4.0.27.
10253 * src/main.c (printable_version): Remove.
10254 * src/lex.c, src/reader.c: Use `quote'.
10256 2000-10-04 Akim Demaille <akim@epita.fr>
10258 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
10260 2000-10-04 Akim Demaille <akim@epita.fr>
10262 * doc/bison.texinfo: Various typos spotted by Neil Booth.
10264 2000-10-04 Akim Demaille <akim@epita.fr>
10266 When a literal string is used to define two different tokens,
10267 `bison -v' segfaults.
10268 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
10270 * tests/regression.m4: New file.
10271 Include the core of the sample provided by Piotr Gackiewicz.
10272 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
10275 2000-10-04 Akim Demaille <akim@epita.fr>
10277 * src/reader.c (parse_expect_decl): Keep `count' within the size
10281 2000-10-02 Paul Eggert <eggert@twinsun.com>
10283 * bison.s1 (yyparse): Assign the default value
10284 unconditionally, to avoid a GCC warning and make the parser a
10287 2000-10-02 Akim Demaille <akim@epita.fr>
10289 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
10292 2000-10-02 Akim Demaille <akim@epita.fr>
10294 * src/derives.c, src/print.c, src/reduce.c: To ease the
10295 translation, move some `\n' out of the translated strings.
10297 2000-10-02 Akim Demaille <akim@epita.fr>
10299 The location tracking mechanism is precious for parse error
10300 messages. Nevertheless, it is enabled only when `@n' is used in
10301 the grammar, which is a different issue (you can use it in error
10302 message, but not in the grammar per se). Therefore, there should
10303 be another means to enable it.
10305 * src/getargs.c (getargs): Support `--locations'.
10306 (usage): Report it.
10307 * src/getargs.h (locationsflag): Export it.
10308 * src/lex.c (percent_table): Support `%locations'.
10309 * src/reader.c (yylsp_needed): Remove this variable, now replaced
10310 with `locationsflag'.
10311 * doc/bison.texinfo: Document `--locations' and `%locations'.
10313 * tests/calc.m4: Test it.
10315 For regularity of the names, replace each
10316 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
10317 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
10318 In addition replace each `flag' with `_flag'.
10320 2000-10-02 Akim Demaille <akim@epita.fr>
10322 Also test parse error messages, including with YYERROR_VERBOSE.
10324 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
10326 Use it to check the computations.
10327 Use it to check `nonassoc' is honored.
10328 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
10329 `--yyerror-verbose'.
10330 (_AT_CHECK_CALC): Adjust to this option.
10331 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
10333 2000-10-02 Akim Demaille <akim@epita.fr>
10335 Test also `--verbose', `--defines' and `--name-prefix'. Testing
10336 the latter demonstrates a flaw in the handling of non debugging
10337 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
10338 was used in order to simplify:
10354 unfortunately this leads to a CPP conflict when
10355 `--name-prefix=foo' is used since it produces `#define yydebug
10358 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
10359 (YYDPRINTF): New macro.
10361 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
10363 Also test `--verbose', `--defines' and `--name-prefix'.
10365 2000-10-02 Akim Demaille <akim@epita.fr>
10367 Improve the readability of the produced parsers.
10369 * src/bison.s1: Formatting changes.
10370 Improve the comment related to the `$' mark.
10371 (yydefault): Don't fall through to `yyresume': `goto' there.
10372 * src/output.c (output_parser): When the `$' is met, skip the end
10374 New variable, `number_of_dollar_signs', to check there's exactly
10375 one `$' in the parser skeleton.
10377 2000-10-02 Akim Demaille <akim@epita.fr>
10379 * lib/xstrdup.c: New file, from the fileutils.
10380 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
10381 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
10382 instead of strlen + xmalloc + strcpy.
10383 * src/symtab.c (copys): Remove, use xstrdup instead.
10385 2000-10-02 Akim Demaille <akim@epita.fr>
10387 * src/gram.h (associativity): New enum type which replaces the
10388 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
10389 `right_assoc', `left_assoc' and `non_assoc'.
10390 Adjust all dependencies.
10391 * src/reader.c: Formatting changes.
10392 (LTYPESTR): Don't define it, use it as a literal in
10393 `reader_output_yylsp'.
10394 * src/symtab.h (symbol_class): New enum type which replaces the
10395 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
10396 `sunknown', `stoken and `snterm'.
10398 2000-10-02 Akim Demaille <akim@epita.fr>
10400 * src/getargs.c (fixed_outfiles): Rename as...
10401 (yaccflag): for consistency and accuracy.
10402 Adjust dependencies.
10404 2000-10-02 Akim Demaille <akim@epita.fr>
10406 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
10407 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
10408 difficult and introduced a lot of core dump. It turns out that
10409 Bison used an implementation of `xmalloc' based on `calloc', and
10410 at various places it does depend upon the initialization to 0. I
10411 have not tried to isolate the pertinent places, and all the former
10412 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
10413 someone should address this issue.
10415 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
10416 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
10418 Adjust dependencies.
10419 * src/warshall.h: New file.
10422 2000-10-02 Akim Demaille <akim@epita.fr>
10424 Various anti-`extern in *.c' changes.
10426 * src/system.h: Include `assert.h'.
10428 2000-10-02 Akim Demaille <akim@epita.fr>
10430 * src/state.h (nstates, final_state, first_state, first_shift)
10431 (first_reduction): Move their exportation from here...
10432 * src/LR0.h: to here.
10433 Adjust dependencies.
10434 * src/getargs.c (statisticsflag): New variable.
10435 Add support for `--statistics'.
10436 Adjust dependencies.
10438 Remove a lot of now useless `extern' statements in most files.
10440 2000-10-02 Akim Demaille <akim@epita.fr>
10442 * src/LR0.h: New file.
10445 2000-10-02 Akim Demaille <akim@epita.fr>
10447 * src/print.h: New file.
10449 * src/print.c: Formatting and ordering changes.
10450 (verbose, terse): Replace with...
10451 (print_results): this new function.
10452 Adjust dependencies.
10454 2000-10-02 Akim Demaille <akim@epita.fr>
10456 * src/conflicts.c (conflict_report): New function.
10457 (conflict_log, verbose_conflict_log): Replace with...
10458 (print_conflicts): this function.
10459 Adjust dependencies.
10460 * src/conflicts.h: New file.
10461 Propagate its inclusion.
10463 2000-10-02 Akim Demaille <akim@epita.fr>
10465 * src/nullable.h: New file.
10466 Propagate its inclusion.
10467 * src/nullable.c: Formatting changes.
10469 2000-10-02 Akim Demaille <akim@epita.fr>
10471 * src/reduce.h: New file.
10472 Propagate its inclusion.
10473 * src/reduce.c: Topological sort and other formatting changes.
10474 (bool, TRUE, FALSE): Move their definition to...
10475 * src/system.h: here.
10477 2000-10-02 Akim Demaille <akim@epita.fr>
10479 * src/files.c: Formatting changes.
10480 (tryopen, tryclose, openfiles): Rename as...
10481 (xfopen, xfclose, open_files): this.
10482 (stringappend): static.
10483 * src/files.h: Complete the list of exported symbols.
10486 2000-10-02 Akim Demaille <akim@epita.fr>
10488 * src/reader.h: New file.
10489 Propagate its use instead of tedious list of `extern' and
10491 * src/reader.c: Formatting changes, topological sort,
10494 2000-10-02 Akim Demaille <akim@epita.fr>
10496 * src/lex.h: Prototype `lex.c' exported functions.
10497 * src/reader.c: Adjust.
10498 * src/lex.c: Formatting changes.
10499 (safegetc): Rename as...
10502 2000-10-02 Akim Demaille <akim@epita.fr>
10504 * src/lalr.h: New file.
10505 Propagate its inclusion instead of prototypes and `extern'.
10506 * src/lalr.c: Formatting changes, topological sorting etc.
10508 2000-10-02 Akim Demaille <akim@epita.fr>
10510 * src/output.c (token_actions): Introduce a temporary array,
10511 YYDEFACT, that makes it possible for this function to use
10512 output_short_table.
10514 2000-10-02 Akim Demaille <akim@epita.fr>
10516 `user_toknums' is output as a `short[]' in `output.c', while it is
10517 defined as a `int[]' in `reader.c'. For consistency with the
10518 other output tables, `user_toknums' is now defined as a table of
10521 * src/reader.c (user_toknums): Be a short table instead of an int
10523 Adjust dependencies.
10525 Factor the short table outputs.
10527 * src/output.c (output_short_table): New function.
10528 * src/output.c (output_gram, output_stos, output_rule_data)
10529 (output_base, output_table, output_check): Use it.
10531 2000-10-02 Akim Demaille <akim@epita.fr>
10533 * src/output.c (output): Topological sort of the functions, in
10534 order to get rid of the `static' prototypes.
10535 No longer use `register'.
10536 * src/output.h: New file.
10537 Propagate its inclusion in files explicitly prototyping functions
10540 2000-09-21 Akim Demaille <akim@epita.fr>
10542 * src/atgeneral.m4: Update from Autoconf.
10544 2000-09-21 Akim Demaille <akim@epita.fr>
10546 * src/closure.h: New file.
10547 * src/closure.c: Formatting changes, topological sort over the
10548 functions, use of closure.h.
10549 (initialize_closure, finalize_closure): Rename as...
10550 (new_closure, free_closure): these. Adjust dependencies.
10551 * src/LR0.c: Formatting changes, topological sort, use of
10553 (initialize_states): Rename as...
10554 (new_states): this.
10555 * src/Makefile.am (noinst_HEADERS): Adjust.
10557 2000-09-20 Akim Demaille <akim@epita.fr>
10559 * src/acconfig.h: Don't protect config.h against multiple
10561 Don't define PARAMS.
10562 * src/system.h: Define PARAMS.
10563 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
10564 purpose of config.h. system.h must not try to fix wrong
10565 definitions in config.h.
10567 2000-09-20 Akim Demaille <akim@epita.fr>
10569 * src/derives.h: New file.
10570 * src/main.c, src/derives.h: Use it.
10571 Formatting changes.
10572 * src/Makefile.am (noinst_HEADERS): Adjust.
10574 2000-09-20 Akim Demaille <akim@epita.fr>
10576 * tests/atgeneral.m4: Update from Autoconf.
10577 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
10578 (AT_CHECK_CALC): New macros.
10579 Use these macros to test bison with options `', `--raw',
10580 `--debug', `--yacc', `--yacc --debug'.
10582 2000-09-19 Akim Demaille <akim@epita.fr>
10584 * src/output.c: Formatting changes.
10585 * src/machine.h: Remove, leaving its contents in...
10586 * src/system.h: here.
10588 Adjust all dependencies on stdio.h and machine.h.
10589 * src/getargs.h: New file.
10590 Let all `extern' declarations about getargs.c be replaced with
10591 inclusion of `getargs.h'.
10592 * src/Makefile.am (noinst_HEADERS): Adjust.
10594 * tests/calc.m4 (yyin): Be initialized in main, not on the global
10596 (yyerror): Returns void, not int.
10597 * doc/bison.texinfo: Formatting changes.
10599 2000-09-19 Akim Demaille <akim@epita.fr>
10601 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
10604 2000-09-18 Akim Demaille <akim@epita.fr>
10606 * configure.in: Append WARNING_CFLAGS to CFLAGS.
10607 * src/Makefile.am (INCLUDES): Don't.
10608 Be ready to fetch headers in lib/.
10610 2000-09-18 Akim Demaille <akim@epita.fr>
10612 * doc/bison.texinfo: Update the copyright.
10613 ANSIfy and GNUify the examples.
10614 Remove the old menu.
10616 2000-09-18 Akim Demaille <akim@epita.fr>
10618 First set of tests: use the `calc' example from the documentation.
10620 * src/bison.s1 (yyparse): Condition the code using `yytname' which
10621 is defined only when YYDEBUG is.
10622 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
10623 * src/files.c (tryopen, tryclose): Formatting changes.
10624 Move to the top and be static.
10625 * src/reader.c (read_signed_integer): Likewise.
10626 * tests/calc.m4: New file.
10627 * Makefile.am, suite.m4: Adjust.
10628 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
10630 2000-09-18 Akim Demaille <akim@epita.fr>
10632 Add support for an Autotest test suite for Bison.
10634 * m4/m4.m4, m4/atconfig.m4: New files.
10635 * m4/Makefile.am (EXTRA_DIST): Adjust.
10636 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
10638 * src/getargs.c: Display a more standard --version message.
10639 * src/reader.c (reader): Formatting changes.
10640 No longer depend upon VERSION_STRING.
10641 * configure.in: No longer use `dnl'.
10642 Set up the test suite and the new directory `tests/.
10643 (VERSION_STRING): Remove.
10645 2000-04-14 Akim Demaille <akim@epita.fr>
10647 * src/reader.c (copy_comment2): New function, same as former
10648 `copy_comment', but outputs into two FILE *.
10649 (copy_comment): Use it.
10650 (parse_union_decl): Use it.
10651 (get_type, parse_start_decl): Use the same `invalid' message.
10652 (parse_start_decl, parse_union_decl): Use the same `multiple'
10654 (parse_union_decl, copy_guard, copy_action): Use the same
10655 `unmatched' message.
10656 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
10658 2000-03-31 Akim Demaille <akim@epita.fr>
10660 * src/files.c (tryopen, tryclose): Move to the top.
10663 2000-03-31 Akim Demaille <akim@epita.fr>
10665 * src/main.c (main): Don't call `done', exit does it.
10667 2000-03-31 Akim Demaille <akim@epita.fr>
10669 * allocate.c: s/return (foo)/return foo/.
10670 * lalr.c: Likewise.
10672 * output.c: Likewise.
10673 * reader.c: Likewise.
10674 * symtab.c: Likewise.
10675 * vmsgetargs.c: Likewise.
10677 2000-03-31 Akim Demaille <akim@epita.fr>
10679 Clean up the error reporting functions.
10681 * src/report.c: New file.
10682 * src/report.h: Likewise.
10683 * src/Makefile.am: Adjust.
10684 * m4/error.m4: New file.
10685 * m4/Makefile.am: Adjust.
10686 * configure.in (jm_PREREQ_ERROR): Call it.
10687 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
10689 (fatal, fatals): Remove. All callers use complain.c::fatal.
10690 (warn, warni, warns, warnss, warnss): Remove. All callers use
10691 complain.c::complain.
10692 (toomany): Remove, use fatal instead.
10693 * src/files.c (done): No argument, use complain_message_count.
10694 * src/main.c (main): Register `done' to `atexit'.
10696 * src/getargs.c (usage): More `fputs', less `fprintf'.
10698 2000-03-28 Akim Demaille <akim@epita.fr>
10700 * lib/: New directory.
10701 * Makefile.am (SUBDIRS): Adjust.
10702 * configure.in: Adjust.
10703 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
10705 * src/alloca.c: Moved to lib/.
10706 * src/getopt.c: Likewise.
10707 * src/getopt1.c: Likewise.
10708 * src/getopt.h: Likewise.
10709 * src/ansi2knr.c: Likewise.
10710 * src/ansi2knr.1: Likewise.
10711 * src/Makefile.am: Adjust.
10712 * lib/Makefile.am: New file.
10714 2000-03-28 Akim Demaille <akim@epita.fr>
10716 * src/getargs.c (usage): Refresh the help message.
10718 2000-03-17 Akim Demaille <akim@epita.fr>
10720 * src/getopt1.c: Updated from textutils 2.0e
10721 * src/getopt.c: Likewise.
10722 * src/getopt.h: Likewise.
10724 2000-03-17 Akim Demaille <akim@epita.fr>
10726 * src/Makefile.am (bison.simple): Fix the awk program: quote only
10727 the file name, not the whole `#line LINE FILE'.
10729 2000-03-17 Akim Demaille <akim@epita.fr>
10731 On syntax errors, report the token on which we choked.
10733 * src/bison.s1 (yyparse): In the label yyerrlab, when
10734 YYERROR_VERBOSE, add yychar in msg.
10736 2000-03-17 Akim Demaille <akim@epita.fr>
10738 * src/reader.c (copy_at): New function.
10739 (copy_guard): Use it.
10740 (copy_action): Use it.
10742 2000-03-17 Akim Demaille <akim@epita.fr>
10744 Be kind to translators, save some useless translations.
10746 * src/main.c (banner): New function.
10747 (fatal_banner): Use it.
10748 (warn_banner): Use it.
10750 2000-03-17 Akim Demaille <akim@epita.fr>
10752 * src/reader.c (copy_definition): Use copy_string and
10753 copy_comment. Removed now unused `match', `ended',
10755 (copy_comment, copy_string): Moved, to be visible from
10758 2000-03-17 Akim Demaille <akim@epita.fr>
10760 * src/reader.c (copy_string): Declare `static inline'. No
10761 problems with inline, since it is checked by configure.
10762 (copy_comment): Likewise.
10764 2000-03-17 Akim Demaille <akim@epita.fr>
10766 * src/reader.c (packsymbols): Formatting changes.
10768 2000-03-17 Akim Demaille <akim@epita.fr>
10770 * src/reader.c (copy_comment): New function, factored out from:
10771 (copy_action): Use it. Removed now unused `match', `ended',
10773 (copy_guard): Likewise.
10775 2000-03-17 Akim Demaille <akim@epita.fr>
10777 * src/reader.c (copy_string): New function, factored out from:
10778 (copy_action): Use it.
10779 (copy_guard): Likewise.
10781 2000-03-17 Akim Demaille <akim@epita.fr>
10783 Change the handling of @s so that they behave exactly like $s.
10784 There is now a pseudo variable @$ (readble and writable), location
10785 of the lhs of the rule (by default ranging from the location of
10786 the first symbol of the rhs, to the location of the last symbol,
10787 or, if the rhs is empty, YYLLOC).
10789 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
10791 (yyparse): When providing a default semantic action, provide a
10792 default location action.
10793 (after the $): No longer change `*YYLSP', just stack YYLOC the
10794 same way you stack YYVAL.
10795 * src/reader.c (read_declarations): Use warns.
10796 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
10797 (copy_action, case '@'): Likewise.
10798 Use a standard error message, to save useless work from
10801 2000-03-17 Akim Demaille <akim@epita.fr>
10803 * src/bison.s1: Formatting and cosmetics changes.
10804 * src/reader.c: Likewise.
10805 Update the Copyright notice.
10807 2000-03-17 Akim Demaille <akim@epita.fr>
10809 * src/bison.s1 (#line): All set to `#line' only, since the
10810 Makefile now handles them.
10812 2000-03-16 Akim Demaille <akim@epita.fr>
10814 * src/output.c (output_rule_data): Output the documentation of
10815 some of the tables.
10816 (Copyright notice): Update.
10817 Formatting changes.
10819 2000-03-16 Akim Demaille <akim@epita.fr>
10821 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
10822 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
10823 One `#if YYDEBUG' remains, since it uses variables which are
10824 defined only if `YYDEBUG != 0'.
10826 2000-03-16 Akim Demaille <akim@epita.fr>
10828 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
10829 and related variables so that the similarities are highlighted.
10831 2000-03-16 Akim Demaille <akim@epita.fr>
10833 * src/bison.s1: Properly indent CPP directives.
10835 2000-03-16 Akim Demaille <akim@epita.fr>
10837 * src/bison.s1: Properly indent the `alloca' CPP section.
10839 2000-03-16 Akim Demaille <akim@epita.fr>
10841 Do not hard code values of directories in `configure.in'.
10842 Update the `configure' tool chain.
10844 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
10846 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
10847 (AC_OUTPUT): Add m4/Makefile.
10848 Bump to bison 1.28a, 1.29 has never been released.
10849 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
10850 handled via src/Makefile.am.
10851 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
10852 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
10854 * Makefile.am (SUBDIRS): Add m4.
10855 (ACLOCAL_AM_FLAGS): New variable.
10856 (AUTOMAKE_OPTIONS): Add check-news.
10857 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
10858 the proper line number and file name.
10859 (DEFS): Propagate the location of bison library files and of the
10861 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
10863 * acinclude.m4: Remove, replaced by the directory m4.
10864 * m4/Makefile.am (EXTRA_DIST): New variable.
10865 * m4/gettext.m4: New file, from the fileutils.
10866 * m4/lcmessage.m4: Likewise
10867 * m4/progtest.m4: Likewise.
10868 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
10870 2000-03-10 Akim Demaille <akim@epita.fr>
10873 Formatting changes of various comments.
10874 Respect the GNU coding standards at various places.
10875 Don't use `_()' when no translation is needed.
10877 1999-12-13 Jesse Thilo <jthilo@gnu.org>
10880 OS/2 honors TMPDIR environment variable.
10882 1999-12-13 Jesse Thilo <jthilo@gnu.org>
10884 * doc/bison.texinfo: Tweaked spelling and grammar.
10886 Removed reference to price of printed copy.
10887 Mention BISON_SIMPLE and BISON_HAIRY.
10889 1999-12-13 Jesse Thilo <jthilo@gnu.org>
10891 * configure.in, NEWS:
10892 Bison 1.29 released.
10894 1999-10-27 Jesse Thilo <jthilo@gnu.org>
10896 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
10897 Added reference card.
10899 1999-07-26 Jesse Thilo <jthilo@gnu.org>
10901 * po/ru.po: Added Russian translation.
10903 1999-07-26 Jesse Thilo <jthilo@gnu.org>
10905 * configure.in: Added Russian translation.
10907 1999-07-06 Jesse Thilo <jthilo@gnu.org>
10909 * configure.in, NEWS, README:
10910 Released version 1.28.
10912 1999-06-14 Jesse Thilo <jthilo@gnu.org>
10915 Squashed redefinition warning on some systems.
10917 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
10918 Have configure build version string instead of relying on ANSI string
10921 1999-06-14 Jesse Thilo <jthilo@gnu.org>
10923 * po/POTFILES.in: Got rid of version.c.
10925 1999-06-14 Jesse Thilo <jthilo@gnu.org>
10927 * acconfig.h, configure.in:
10928 Have configure build version string instead of relying on ANSI string
10931 1999-06-08 Jesse Thilo <jthilo@gnu.org>
10934 Dropped mention of `+' for long-named options.
10936 1999-05-30 Jesse Thilo <jthilo@gnu.org>
10938 * src/files.c: Added <unistd.h> for unlink().
10940 * src/Makefile.am, src/system.h:
10943 1999-05-30 Jesse Thilo <jthilo@gnu.org>
10945 * README: Added a FAQ list.
10947 * configure.in, acconfig.h:
10950 1999-05-30 Jesse Thilo <jthilo@gnu.org>
10952 * doc/FAQ, doc/Makefile.am:
10955 1999-05-19 Jesse Thilo <jthilo@gnu.org>
10957 * src/alloc.h, src/symtab.h, src/version.c:
10958 Protected inclusion of "config.h" with HAVE_CONFIG_H.
10960 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10962 * src/.cvsignore, src/Makefile.am:
10963 Reorganized: sources in `src', documentation in `doc'.
10965 * src/lex.c (literalchar):
10966 fixed the code for escaping double quotes (thanks
10969 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10971 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
10972 Adjusted paths to reflect directory reorganization.
10974 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10976 * doc/.cvsignore, doc/Makefile.am:
10977 Reorganized: sources in `src', documentation in `doc'.
10979 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10982 Updated AC_INIT file to reflect directory reorganization.
10984 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
10985 Reorganized: sources in `src', documentation in `doc'.
10987 1999-04-13 Jesse Thilo <jthilo@gnu.org>
10990 Don't declare calloc() and realloc() if not necessary.
10992 1999-04-13 Jesse Thilo <jthilo@gnu.org>
10994 * configure.in, acconfig.h, acinclude.m4:
10995 Don't declare calloc() and realloc() if not necessary.
10997 1999-03-23 Jesse Thilo <jthilo@gnu.org>
10999 * po/.cvsignore: Added i18n support.
11001 1999-03-23 Jesse Thilo <jthilo@gnu.org>
11003 * acconfig.h, configure.in, Makefile.am:
11004 Added i18n support.
11006 1999-03-22 Jesse Thilo <jthilo@gnu.org>
11008 * src/bison.s1: Fixed #line numbers.
11010 1999-03-15 Jesse Thilo <jthilo@gnu.org>
11012 * po/es.po, po/fr.po, po/nl.po, po/de.po:
11013 Added PO files from Translation Project.
11015 1999-03-03 Jesse Thilo <jthilo@gnu.org>
11018 Added support for non-ANSI compilers (ansi2knr).
11020 1999-02-16 Jesse Thilo <jthilo@gnu.org>
11022 * configure.in: Bumped version number to 1.27.
11025 Added `bison.simple' to list of files removed by `make distclean'.
11027 1999-02-12 Jesse Thilo <jthilo@gnu.org>
11029 * src/files.c, src/files.h:
11030 Defined locations of parser files in config.h instead of Makefile.
11032 1999-02-12 Jesse Thilo <jthilo@gnu.org>
11034 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
11035 Defined locations of parser files in config.h instead of Makefile.
11037 1999-02-09 Jesse Thilo <jthilo@gnu.org>
11040 Removed inappropriate use of $< macro.
11042 1999-02-05 Jesse Thilo <jthilo@gnu.org>
11044 * po/Makefile.in.in, po/POTFILES.in:
11045 Add `po' directory skeleton.
11047 1999-01-27 Jesse Thilo <jthilo@gnu.org>
11049 * README: Document help-bison list.
11051 * configure.in: Add check for mkstemp().
11053 1999-01-20 Jesse Thilo <jthilo@gnu.org>
11055 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
11056 Hush a few compiler warnings.
11059 Add tryclose(), which verifies that fclose was successful.
11060 Hush a couple of compiler warnings.
11062 1999-01-20 Jesse Thilo <jthilo@gnu.org>
11064 * Makefile.am, OChangeLog:
11065 ChangeLog is now automatically generated. Include the old version as
11068 1999-01-14 Jesse Thilo <jthilo@gnu.org>
11070 * src/gram.h, src/lalr.c, src/lex.c, src/lex.h, src/machine.h, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/state.h, src/symtab.c, src/symtab.h, src/types.h, src/vmsgetargs.c, src/warshall.c, src/allocate.c, src/alloc.h, src/bison.s1, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/files.h, src/getargs.c, src/gram.c, src/LR0.c:
11071 Update FSF address.
11073 1999-01-14 Jesse Thilo <jthilo@gnu.org>
11075 * doc/bison.texinfo: Fix formatting glitch.
11077 * doc/bison.texinfo: Update FSF address.
11079 1999-01-14 Jesse Thilo <jthilo@gnu.org>
11081 * acconfig.h: Update FSF address.
11083 1999-01-08 Jesse Thilo <jthilo@gnu.org>
11086 Don't define PACKAGE here, since config.h defines it.
11088 1998-12-30 Jesse Thilo <jthilo@gnu.org>
11090 * src/reader.c: Update copyright date.
11093 Ditch sprintf to statically-sized buffers in fatal/warn functions in
11094 favor of output directly to stderr (avoids buffer overruns).
11096 * src/reader.c: Some checks for premature EOF.
11098 * src/allocate.c, src/alloc.h, src/closure.c, src/conflicts.c, src/derives.c, src/getargs.c, src/gram.c, src/lalr.c, src/lex.c, src/LR0.c, src/main.c, src/nullable.c, src/output.c, src/print.c, src/reduce.c, src/symtab.c, src/symtab.h, src/warshall.c:
11099 Use prototypes if the compiler understands them.
11101 * src/files.c: Honor TMPDIR on Unix hosts.
11102 Use prototypes if the compiler understands them.
11105 Fix a couple of buffer overrun bugs.
11106 Use prototypes if the compiler understands them.
11108 * src/system.h: Include unistd.h and ctype.h.
11109 Use #ifdef instead of #if for NLS symbols.
11111 1998-12-30 Jesse Thilo <jthilo@gnu.org>
11113 * doc/bison.texinfo:
11114 Delete comment "consider using @set for edition number, etc..." since
11115 we now are doing so.
11117 1998-12-30 Jesse Thilo <jthilo@gnu.org>
11120 Use prototypes if the compiler understands them.
11122 * NEWS: Document 1.26 highlights.
11124 * Makefile.am: Require Automake 1.3 or later.
11127 Use prototypes if the compiler understands them.
11129 1998-12-29 Jesse Thilo <jthilo@gnu.org>
11132 Use VERSION symbol from automake for version number.
11134 1998-12-29 Jesse Thilo <jthilo@gnu.org>
11136 * acconfig.h, configure.in, version.cin:
11137 Use VERSION symbol from automake for version number.
11139 1998-11-28 Jesse Thilo <jthilo@gnu.org>
11142 Distribute original version of simple parser (bison.s1), not built
11143 version (bison.simple).
11145 1998-11-28 Jesse Thilo <jthilo@gnu.org>
11147 * doc/bison.texinfo: Add info dir entry.
11149 * doc/bison.texinfo:
11150 Let automake put version number into documentation.
11152 1998-11-26 Jesse Thilo <jthilo@gnu.org>
11154 * src/bison.cld, src/build.com, src/vmshlp.mar:
11155 Add non-RCS files from /gd/gnu/bison.
11157 1998-11-26 Jesse Thilo <jthilo@gnu.org>
11160 Document the BISON_HAIRY and BISON_SIMPLE variables.
11162 1998-11-25 Jesse Thilo <jthilo@gnu.org>
11164 * src/version.c: Build version.c automatically.
11167 Fix token numbering (used to start at 258, not 257).
11169 * src/system.h: Include config.h.
11171 * src/getargs.c: Update bug report address.
11173 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
11174 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
11176 1998-11-25 Jesse Thilo <jthilo@gnu.org>
11179 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
11181 * configure.in, version.cin:
11182 Build version.c automatically.
11184 * AUTHORS: Add AUTHORS file.
11186 * README: Update bug report address.
11189 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
11191 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
11192 Add automake stuff.
11194 1998-11-25 Jesse Thilo <jthilo@gnu.org>
11196 * doc/bison.texinfo: Clean up some formatting.
11198 1998-05-05 Richard Stallman <rms@gnu.org>
11200 * doc/bison.texinfo:
11201 Explain better why to make a pure parser.
11203 1998-01-05 Richard Stallman <rms@gnu.org>
11205 * src/files.c (openfiles):
11206 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
11207 find a temporary directory, if possible. Do not unlink files while
11210 1997-08-25 Richard Stallman <rms@gnu.org>
11212 * src/reader.c (stack_offset;):
11213 Change some warni to warns.
11215 * src/lex.c (literalchar): Use warns, not warni.
11217 1997-06-28 Richard Stallman <rms@gnu.org>
11219 * src/bison.s1: Add a Bison version comment.
11221 * src/main.c (fatal, warn, berror):
11224 1997-06-28 Richard Stallman <rms@gnu.org>
11226 * Makefile.in (bison_version): New variable.
11227 (dist): Use that variable.
11228 (bison.s1): Substitute the Bison version into bison.simple.
11230 * bison.simple: Add a Bison version comment.
11232 1997-06-18 Richard Stallman <rms@gnu.org>
11234 * src/main.c (fatal, warn, berror):
11235 Make error messages standard.
11236 (toomany): Improve error message text.
11238 * src/LR0.c, src/closure.c, src/conflicts.c, src/derives.c, src/files.c, src/lalr.c, src/lex.c, src/nullable.c, src/output.c, src/print.c, src/reader.c, src/reduce.c, src/symtab.c:
11239 new.h renamed to alloc.h.
11241 1997-06-18 Richard Stallman <rms@gnu.org>
11243 * Makefile.in: new.h renamed to alloc.h.
11245 1997-05-24 Richard Stallman <rms@gnu.org>
11247 * src/lex.c (literalchar):
11248 Fix the code for escaping \, " and '.
11250 (lex): Avoid trouble when there are many chars
11251 to discard in a char literal with just several chars in it.
11253 1997-05-17 Richard Stallman <rms@gnu.org>
11256 Use malloc, if using alloca is troublesome.
11257 (YYSTACK_USE_ALLOCA): New flag macro.
11258 Define it for some systems and compilers.
11259 (YYSTACK_ALLOC): New macro.
11260 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11261 If it was malloc'd, free it.
11263 1997-05-17 Richard Stallman <rms@gnu.org>
11266 Use malloc, if using alloca is troublesome.
11267 (YYSTACK_USE_ALLOCA): New flag macro.
11268 Define it for some systems and compilers.
11269 (YYSTACK_ALLOC): New macro.
11270 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11271 If it was malloc'd, free it.
11273 1997-04-23 Richard Stallman <rms@gnu.org>
11276 (alloca) [__hpux]: Always define as __builtin_alloca.
11278 1997-04-23 Richard Stallman <rms@gnu.org>
11281 (alloca) [__hpux]: Always define as __builtin_alloca.
11283 1997-04-22 Richard Stallman <rms@gnu.org>
11286 [__hpux]: Include alloca.h (right for HPUX 10)
11287 instead of declaring alloca (right for HPUX 9).
11289 * src/bison.s1 (__yy_memcpy):
11290 Declare arg `count' as unsigned int.
11291 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11293 1997-04-22 Richard Stallman <rms@gnu.org>
11296 [__hpux]: Include alloca.h (right for HPUX 10)
11297 instead of declaring alloca (right for HPUX 9).
11299 * bison.simple (__yy_memcpy):
11300 Declare arg `count' as unsigned int.
11301 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11303 1997-01-03 Richard Stallman <rms@gnu.org>
11305 * src/allocate.c: [__STDC__ or _MSC_VER]:
11306 Declare calloc and realloc to return void *.
11308 1997-01-02 Richard Stallman <rms@gnu.org>
11311 [_MSC_VER]: Include stdlib.h and process.h.
11312 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
11314 * src/main.c (main): Return FAILURE as a value.
11315 (printable_version): Declare arg as int, not char.
11317 1997-01-02 Richard Stallman <rms@gnu.org>
11319 * Makefile.in (dist):
11320 Explicitly check for symlinks, and copy them.
11322 1996-12-19 Richard Stallman <rms@gnu.org>
11325 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
11327 1996-12-18 Paul Eggert <eggert@gnu.org>
11329 * src/bison.s1 (yyparse):
11330 If __GNUC__ and YYPARSE_PARAM are both defined,
11331 declare yyparse to have a void * argument.
11333 1996-12-18 Paul Eggert <eggert@gnu.org>
11335 * bison.simple (yyparse):
11336 If __GNUC__ and YYPARSE_PARAM are both defined,
11337 declare yyparse to have a void * argument.
11339 1996-12-17 Richard Stallman <rms@gnu.org>
11341 * src/reduce.c (nbits): Add some casts.
11343 1996-08-12 Richard Stallman <rms@gnu.org>
11345 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
11347 1996-08-12 Richard Stallman <rms@gnu.org>
11349 * bison.simple: Test _MSDOS as well as _MSDOS_.
11351 1996-07-31 Richard Stallman <rms@gnu.org>
11354 [__sun && __i386]: Include alloca.h.
11356 1996-07-31 Richard Stallman <rms@gnu.org>
11359 [__sun && __i386]: Include alloca.h.
11361 1996-07-30 Richard Stallman <rms@gnu.org>
11363 * src/bison.s1: Comment change.
11365 * src/bison.s1: Test _MSDOS_, not MSDOS.
11367 1996-07-30 Richard Stallman <rms@gnu.org>
11369 * bison.simple: Comment change.
11371 * bison.simple: Test _MSDOS_, not MSDOS.
11373 1996-06-01 Richard Stallman <rms@gnu.org>
11375 * src/reduce.c, src/reader.c, src/print.c, src/output.c, src/nullable.c, src/lex.c, src/lalr.c, src/getargs.c, src/derives.c, src/conflicts.c, src/closure.c, src/allocate.c:
11376 Insert `_' macro around many string constants.
11379 Insert `_' macro around many string constants.
11381 (main): Call setlocale, bindtextdomain and textdomain.
11383 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
11384 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
11385 [ENABLE_NLS]: Include libintl.h.
11386 [ENABLE_NLS] (gettext): Define.
11387 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
11388 (N_, PACKAGE, LOCALEDIR): New macros.
11390 1996-06-01 Richard Stallman <rms@gnu.org>
11392 * POTFILES.in: New file.
11394 * Makefile.in (allocate.o):
11395 Define target explicitly.
11397 * Makefile.in (CFLAGS): Set to @CFLAGS@.
11398 (LDFLAGS): Set to @LDFLAGS@.
11399 (configure): Run autoconf only if preceding `cd' succeeds.
11400 (bison.s1): Redirect output to temporary file then move the
11401 temporary to the target, rather than redirecting directly to bison.s1.
11402 (clean): Remove config.status and config.log.
11403 (distclean): Don't remove config.status here.
11405 1996-05-12 Richard Stallman <rms@gnu.org>
11408 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11410 1996-05-12 Richard Stallman <rms@gnu.org>
11413 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11415 1996-05-11 Richard Stallman <rms@gnu.org>
11417 * src/bison.s1 (__yy_memcpy):
11418 Really reorder the args, as was supposedly done on Feb 14 1995.
11419 (yyparse): Calls changed accordingly.
11421 1996-05-11 Richard Stallman <rms@gnu.org>
11423 * Makefile.in (dist): Don't use $(srcdir).
11425 * bison.simple (__yy_memcpy):
11426 Really reorder the args, as was supposedly done on Feb 14 1995.
11427 (yyparse): Calls changed accordingly.
11429 1996-01-27 Richard Stallman <rms@gnu.org>
11431 * src/output.c (output_rule_data):
11432 Test YYERROR_VERBOSE in the conditional
11433 around the definition of ttyname.
11435 1995-12-29 Richard Stallman <rms@gnu.org>
11438 Fix line numbers in #line commands.
11440 1995-12-29 Richard Stallman <rms@gnu.org>
11443 Fix line numbers in #line commands.
11445 1995-12-27 Richard Stallman <rms@gnu.org>
11447 * src/bison.s1 (YYPARSE_PARAM_DECL):
11448 In C++, make it always null.
11449 (YYPARSE_PARAM_ARG): New macro.
11450 (yyparse): Use YYPARSE_PARAM_ARG.
11452 1995-12-27 Richard Stallman <rms@gnu.org>
11454 * bison.simple (YYPARSE_PARAM_DECL):
11455 In C++, make it always null.
11456 (YYPARSE_PARAM_ARG): New macro.
11457 (yyparse): Use YYPARSE_PARAM_ARG.
11459 1995-11-29 Richard Stallman <rms@gnu.org>
11461 * doc/bison.texinfo:
11462 Describe literal string tokens, %raw, %no_lines, %token_table.
11464 1995-11-29 Daniel Hagerty <hag@gnu.org>
11466 * doc/bison.texinfo: Fixed update date
11468 1995-10-16 Richard Stallman <rms@gnu.org>
11470 * src/version.c: Version 1.25.
11472 1995-10-16 Richard Stallman <rms@gnu.org>
11474 * NEWS: *** empty log message ***
11476 1995-10-16 Richard Stallman <rms@gnu.org>
11478 * doc/bison.1, doc/bison.rnh:
11481 1995-10-15 Richard Stallman <rms@gnu.org>
11483 * src/vmsgetargs.c, src/getargs.c:
11484 Added -n, -k, and -raw switches.
11485 (noparserflag, toknumflag, rawtoknumflag): New variables.
11487 * src/symtab.h (SALIAS):
11488 New #define for adding aliases to %token.
11489 (struct bucket): Added `alias' field.
11491 * src/reduce.c (reduce_grammar):
11492 Revise error message.
11493 (print_notices): Remove final `.' from error message.
11495 * src/reader.c (reader_output_yylsp):
11497 (readgram): Use `#if 0' around code that accepted %command
11498 inside grammar rules: The documentation doesn't allow it,
11499 and it will fail since the %command processors scan for the next %.
11500 (parse_token_decl): Extended the %token
11501 declaration to allow a multi-character symbol as an alias.
11502 (parse_thong_decl): New function.
11503 (read_declarations): Added %thong declarations.
11504 (read_declarations): Handle NOOP to deal with allowing
11505 % declarations as another means to specify the flags.
11506 (readgram): Allow %prec prior to semantics embedded in a rule.
11507 (skip_to_char, read_declarations, copy_definition)
11508 (parse_token_decl, parse_start_decl, parse_type_decl)
11509 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
11510 (get_type_name, copy_guard, copy_action, readgram)
11511 (get_type, packsymbols): Revised most error messages.
11512 Changed `fatal' to `warnxxx' to avoid aborting for error.
11513 Revised and use multiple warnxxx functions to avoid using VARARGS1.
11514 (read_declarations): Improve the error message for
11515 an invalid character. Do not abort.
11516 (read_declarations, copy_guard, copy_action): Use
11517 printable_version to avoid unprintable characters in printed output.
11518 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
11519 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
11520 Allow the type of a non-terminal can be given
11521 more than once, as long as all specifications give the same type.
11524 (output_headers, output_trailers, output, output_gram)
11525 (output_rule_data): Implement noparserflag variable.
11526 Implement toknumflag variable.
11527 (output): Call reader_output_yylsp to output LTYPESTR.
11529 * src/main.c (main):
11530 If reader sees an error, don't process the grammar.
11531 (fatals): Updated to not use VARARGS1.
11532 (printable_version, int_to_string, warn, warni, warns, warnss)
11533 (warnsss): New error reporting functions. Avoid abort for error.
11536 Added THONG and NOOP for alias processing.
11537 Added SETOPT for the new code that allows setting options with %flags.
11540 Include getopt.h. Add some extern decls.
11541 (safegetc): New function to deal with EOF gracefully.
11542 (literalchar); new function to deal with reading \ escapes.
11543 (lex): Use literalchar.
11544 (lex): Implemented "..." tokens.
11545 (literalchar, lex, parse_percent_token): Made tokenbuffer
11546 always contain the token. This includes growing the token
11547 buffer while reading an integer.
11548 (parse_percent_token): Replaced if-else statement with percent_table.
11549 (parse_percent_token): Added % declarations as another
11550 way to specify the flags -n, -l, and -r. Also added hooks for
11551 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
11552 major changes to files.c.
11553 (lex) Retain in the incoming stream a character following
11555 (skip_white_space, lex): Revised most error messages
11556 and changed fatal to warn to avoid aborting.
11557 (percent_table): Added %thong declarations.
11559 * src/gram.h: Comment changes.
11561 * src/files.c (openfiles, open_extra_files, done):
11563 and actfile file. Handle noparserflag. Both for -n switch.
11565 * src/conflicts.c (resolve_sr_conflict):
11566 Remove use of alloca.
11568 1995-06-01 Jim Meyering <meyering@gnu.org>
11570 * doc/bison.texinfo: *** empty log message ***
11572 1995-05-06 Richard Stallman <rms@gnu.org>
11574 * src/bison.s1: Comment change.
11576 1995-05-06 Richard Stallman <rms@gnu.org>
11578 * bison.simple: Comment change.
11580 1995-05-03 Richard Stallman <rms@gnu.org>
11582 * src/version.c: Version now 1.24.
11584 * src/bison.s1: Change distribution terms.
11586 * src/version.c: Version now 1.23.
11588 1995-05-03 Richard Stallman <rms@gnu.org>
11590 * doc/bison.texinfo:
11591 Rewrite "Conditions for Using Bison".
11592 Update version to 1.24.
11594 1995-05-03 Richard Stallman <rms@gnu.org>
11596 * bison.simple: Change distribution terms.
11598 1995-02-23 Richard Stallman <rms@gnu.org>
11600 * src/files.c: Test __VMS_POSIX as well as VMS.
11602 1995-02-14 Jim Meyering <meyering@gnu.org>
11604 * src/bison.s1 (__yy_memcpy):
11605 Renamed from __yy_bcopy to avoid
11606 confusion. Reverse FROM and TO arguments to be consistent with
11609 1995-02-14 Jim Meyering <meyering@gnu.org>
11611 * bison.simple (__yy_memcpy):
11612 Renamed from __yy_bcopy to avoid
11613 confusion. Reverse FROM and TO arguments to be consistent with
11616 1994-11-10 David J. MacKenzie <djm@gnu.org>
11622 * Makefile.in (DISTFILES): Include NEWS.
11624 * Makefile.in (DISTFILES):
11625 Include install-sh, not install.sh.
11627 * configure.in: Update to Autoconf v2 macro names.
11629 1994-10-05 David J. MacKenzie <djm@gnu.org>
11631 * Makefile.in: fix typo
11633 * Makefile.in (prefix, exec_prefix):
11634 Let configure set them.
11636 1994-09-28 David J. MacKenzie <djm@gnu.org>
11638 * Makefile.in: Set datadir to $(prefix)/share.
11640 1994-09-15 Richard Stallman <rms@gnu.org>
11643 Update copyright notice and GPL version.
11645 1994-09-15 Richard Stallman <rms@gnu.org>
11648 Update copyright notice and GPL version.
11650 1994-07-12 Richard Stallman <rms@gnu.org>
11652 * src/reduce.c, src/reader.c:
11655 1994-05-05 David J. MacKenzie <djm@gnu.org>
11657 * Makefile.in: entered into RCS
11659 1994-03-26 Richard Stallman <rms@gnu.org>
11661 * src/bison.s1: entered into RCS
11663 1994-03-26 Richard Stallman <rms@gnu.org>
11665 * bison.simple: entered into RCS
11667 1994-03-25 Richard Stallman <rms@gnu.org>
11669 * src/main.c: entered into RCS
11671 1994-03-24 Richard Stallman <rms@gnu.org>
11673 * src/conflicts.c: entered into RCS
11675 1994-01-02 Richard Stallman <rms@gnu.org>
11677 * Makefile.in: *** empty log message ***
11679 1993-11-21 Richard Stallman <rms@gnu.org>
11681 * src/bison.s1: *** empty log message ***
11683 1993-11-21 Richard Stallman <rms@gnu.org>
11685 * doc/bison.texinfo: entered into RCS
11687 * doc/bison.texinfo: *** empty log message ***
11689 1993-11-21 Richard Stallman <rms@gnu.org>
11691 * bison.simple: *** empty log message ***
11693 1993-10-25 David J. MacKenzie <djm@gnu.org>
11695 * doc/bison.texinfo: *** empty log message ***
11697 1993-10-19 Richard Stallman <rms@gnu.org>
11699 * src/bison.s1: *** empty log message ***
11701 1993-10-19 Richard Stallman <rms@gnu.org>
11703 * bison.simple: *** empty log message ***
11705 1993-10-14 Richard Stallman <rms@gnu.org>
11707 * src/bison.s1: *** empty log message ***
11709 1993-10-14 Richard Stallman <rms@gnu.org>
11711 * bison.simple: *** empty log message ***
11713 1993-09-14 David J. MacKenzie <djm@gnu.org>
11715 * doc/bison.texinfo: *** empty log message ***
11717 1993-09-13 Noah Friedman <friedman@gnu.org>
11719 * Makefile.in: *** empty log message ***
11721 1993-09-10 Richard Stallman <rms@gnu.org>
11723 * src/conflicts.c: *** empty log message ***
11725 * src/system.h: entered into RCS
11727 1993-09-10 Richard Stallman <rms@gnu.org>
11729 * doc/bison.1: entered into RCS
11731 1993-09-06 Noah Friedman <friedman@gnu.org>
11733 * src/version.c: entered into RCS
11735 1993-09-06 Noah Friedman <friedman@gnu.org>
11737 * Makefile.in: *** empty log message ***
11739 1993-07-30 David J. MacKenzie <djm@gnu.org>
11741 * Makefile.in: *** empty log message ***
11743 1993-07-24 Richard Stallman <rms@gnu.org>
11745 * src/bison.s1: *** empty log message ***
11747 1993-07-24 Richard Stallman <rms@gnu.org>
11749 * bison.simple: *** empty log message ***
11751 1993-07-08 David J. MacKenzie <djm@gnu.org>
11753 * Makefile.in: *** empty log message ***
11755 1993-07-04 Richard Stallman <rms@gnu.org>
11757 * src/bison.s1: *** empty log message ***
11759 1993-07-04 Richard Stallman <rms@gnu.org>
11761 * bison.simple: *** empty log message ***
11763 1993-06-26 David J. MacKenzie <djm@gnu.org>
11765 * src/getargs.c: entered into RCS
11767 1993-06-26 David J. MacKenzie <djm@gnu.org>
11769 * doc/bison.texinfo: *** empty log message ***
11771 * doc/bison.1: New file.
11773 1993-06-25 Richard Stallman <rms@gnu.org>
11775 * src/getargs.c: New file.
11777 1993-06-16 Richard Stallman <rms@gnu.org>
11779 * src/bison.s1: *** empty log message ***
11781 1993-06-16 Richard Stallman <rms@gnu.org>
11783 * bison.simple: *** empty log message ***
11785 1993-06-03 Richard Stallman <rms@gnu.org>
11787 * src/bison.s1: New file.
11789 1993-06-03 Richard Stallman <rms@gnu.org>
11791 * doc/bison.texinfo: *** empty log message ***
11793 1993-06-03 Richard Stallman <rms@gnu.org>
11795 * bison.simple: New file.
11797 1993-05-19 Richard Stallman <rms@gnu.org>
11799 * doc/bison.texinfo: New file.
11801 1993-05-07 Noah Friedman <friedman@gnu.org>
11803 * Makefile.in: *** empty log message ***
11805 1993-04-28 Noah Friedman <friedman@gnu.org>
11807 * src/reader.c: *** empty log message ***
11809 1993-04-23 Noah Friedman <friedman@gnu.org>
11811 * src/alloc.h: entered into RCS
11813 1993-04-20 David J. MacKenzie <djm@gnu.org>
11815 * src/version.c: *** empty log message ***
11817 * src/files.c, src/allocate.c:
11820 * src/reader.c: *** empty log message ***
11822 * src/lex.c: entered into RCS
11824 * src/conflicts.c: New file.
11826 * src/symtab.c: entered into RCS
11828 * src/alloc.h: New file.
11830 * src/LR0.c: entered into RCS
11832 1993-04-18 Noah Friedman <friedman@gnu.org>
11834 * src/reader.c: New file.
11836 * src/version.c: *** empty log message ***
11838 1993-04-18 Noah Friedman <friedman@gnu.org>
11840 * Makefile.in: *** empty log message ***
11842 1993-04-17 Noah Friedman <friedman@gnu.org>
11844 * Makefile.in: *** empty log message ***
11846 1993-04-15 Richard Stallman <rms@gnu.org>
11848 * src/main.c, src/files.c:
11851 1993-04-15 Noah Friedman <friedman@gnu.org>
11853 * configure.in: entered into RCS
11855 * configure.in: *** empty log message ***
11857 * configure.in: New file.
11859 1993-04-14 Richard Stallman <rms@gnu.org>
11861 * Makefile.in: New file.
11863 1993-04-13 Richard Stallman <rms@gnu.org>
11865 * src/version.c: New file.
11867 1993-03-25 Richard Stallman <rms@gnu.org>
11869 * src/output.c: entered into RCS
11871 1992-09-25 Richard Stallman <rms@gnu.org>
11873 * configure.bat: entered into RCS
11875 1992-06-22 Richard Stallman <rms@gnu.org>
11877 * src/vmsgetargs.c: entered into RCS
11879 1992-06-22 Richard Stallman <rms@gnu.org>
11881 * doc/bison.rnh: entered into RCS
11883 1992-04-20 David J. MacKenzie <djm@gnu.org>
11885 * README: entered into RCS
11887 1992-01-22 Richard Stallman <rms@gnu.org>
11889 * src/machine.h: entered into RCS
11891 1991-12-21 Richard Stallman <rms@gnu.org>
11893 * src/lalr.c, src/closure.c:
11896 1991-12-20 Richard Stallman <rms@gnu.org>
11898 * src/state.h: entered into RCS
11900 1991-12-18 Richard Stallman <rms@gnu.org>
11902 * src/print.c, src/nullable.c, src/derives.c:
11905 1991-11-03 David J. MacKenzie <djm@gnu.org>
11907 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
11910 1988-09-09 Richard Stallman <rms@gnu.org>
11912 * src/bison.hairy: entered into RCS
11914 1987-12-16 Richard Stallman <rms@gnu.org>
11916 * REFERENCES: entered into RCS
11920 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
11921 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
11923 This file is part of Bison, the GNU Compiler Compiler.
11925 Bison is free software; you can redistribute it and/or modify
11926 it under the terms of the GNU General Public License as published by
11927 the Free Software Foundation; either version 2, or (at your option)
11930 Bison is distributed in the hope that it will be useful,
11931 but WITHOUT ANY WARRANTY; without even the implied warranty of
11932 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11933 GNU General Public License for more details.
11935 You should have received a copy of the GNU General Public License
11936 along with Bison; see the file COPYING. If not, write to
11937 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
11938 Boston, MA 02111-1307, USA.