1 2003-08-26 Akim Demaille <akim@epita.fr>
3 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
5 Adjust: nerrs and errstatus is now replaced by...
6 (Parser::nerrs_, Parser::errstatus_): New.
8 2003-08-25 Akim Demaille <akim@epita.fr>
10 * config/announce-gen, Makefile.cfg: New.
11 * Makefile.am: Adjust.
12 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
13 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
15 2003-08-25 Akim Demaille <akim@epita.fr>
17 When reducing initial empty rules, Bison parser read an initial
18 location that is not defined. This results in garbage, and that
19 affects Bison's own parser. Therefore we need (i) to extend Bison
20 to support a means to initialize this location, and (ii) to use
21 this CVS Bison to fix CVS Bison's parser.
23 * src/reader.h, reader.c (epilogue_augment): Remove, replace
25 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
26 * src/parse-gram.y: Adjust.
27 (%initial-action): New.
28 (%error-verbose): Since we require CVS Bison, there is no reason
30 * src/scan-gram.l: Adjust.
31 * src/Makefile.am (YACC): New, to make sure we use our own parser.
32 * data/yacc.c (yyparse): Use b4_initial_action.
34 2003-08-25 Akim Demaille <akim@epita.fr>
36 * doc/bison.texinfo: Don't promote stdout for error messages.
38 2003-08-25 Akim Demaille <akim@epita.fr>
40 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
41 From Alexandre Duret-Lutz.
43 2003-08-25 Akim Demaille <akim@epita.fr>
45 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
48 2003-08-25 Akim Demaille <akim@epita.fr>
50 * data/lalr1.cc (Parser::reduce_print_): New.
53 2003-08-25 Akim Demaille <akim@epita.fr>
55 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
56 error recovery loops. This patch is based on
57 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
58 Also, augment the similarity between lalr1.cc and yacc.c.
59 Note: the locations of error recovery rules are not correct yet.
61 * data/lalr1.cc: Comment changes to augment the similarity between
63 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
64 (yyerrlab1): Remove, but where it used to be (now the bottom part of
65 yyerrlab), when hitting EOF, pop the whole stack here instead of
66 merely falling thru the default error handling mechanism.
67 (yyerrorlab): New label, with the old contents of YYERROR,
68 plus the following change: pop the stack of rhs corresponding
69 to the production that invoked YYERROR. That is how Yacc
70 behaves (required by POSIX).
71 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
74 2003-08-25 Akim Demaille <akim@epita.fr>
76 Tune local.at so that people can "autom4te -l autotest calc.at -o
77 calc" for instance, to extract a sub test suite.
79 * tests/testsuite.at: Move the initialization, Autotest version
80 requirement, and AT_TESTED invocation into...
81 * tests/local.at: here.
82 * tests/testsuite.at: Include it for compatibility with Autoconf
84 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
87 2003-08-04 Paul Eggert <eggert@twinsun.com>
89 Rework code slightly to avoid gcc -Wtraditional warnings.
90 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
91 The returned value is now stored in *YY0. All callers changed.
92 * src/output.c (merge_output): Adjust to the above change.
94 2003-07-26 Paul Eggert <eggert@twinsun.com>
96 * data/glr.c (YYASSERT): New macro.
97 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
98 yyresolveStates, yyprocessOneStack):
99 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
100 Derived from a suggestion by Frank Heckenbach.
102 2003-07-25 Paul Eggert <eggert@twinsun.com>
104 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
105 for portability to K&R C (after ansi2knr, presumably). See
106 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
107 by Frank Heckenbach, though I have omitted the structure-initialization
108 part of his glr-knr.diff patch since I recall that the Portable
109 C Compiler didn't require that change.
111 Let the user specify how to allocate and free memory.
112 Derived from a suggestion by Frank Heckenbach in
113 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
114 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
115 All uses of free, malloc, realloc changed to use these macros,
116 and unnecessary casts removed.
117 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
119 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
121 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
122 use s.empty() rather than s == "" to test for empty string; see
123 <http://mail.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
126 2003-06-25 Akim Demaille <akim@epita.fr>
128 * config/depcomp, config/install-sh: Update from masters.
130 2003-06-20 Paul Eggert <eggert@twinsun.com>
132 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
133 and return properly parenthesized result.
134 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
135 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
136 Remove unnecessary parentheses from uses.
137 * doc/bison.texinfo (Location Default Action): Describe the
138 conventions for parentheses.
140 2003-06-19 Paul Eggert <eggert@twinsun.com>
142 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
143 yyreportTree): Do not assume that size_t is the same width as int,
144 when printing sizes. Print sizes using an unsigned format.
145 Problem reported by Frank Heckenbach in
146 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
148 Port to Forte Developer 7 C compiler.
149 * data/glr.c (struct YYLTYPE): If locations are not being used,
150 declare a single dummy member, as empty structs do not conform
152 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
153 the Forte Developer 7 C compiler complains that end-of-loop
156 2003-06-17 Paul Eggert <eggert@twinsun.com>
158 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
159 avoid warnings from picky compilers about redefinition of PARAMS.
161 2003-06-17 Paul Eggert <eggert@twinsun.com>
165 * NEWS: Document 1.875b.
167 * lib/bbitset.h: Do not include config.h; that's the includer's job.
168 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
169 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
170 Don't use 'index' in comments, as it's a builtin fn on some hosts.
171 * lib/bitset_stats.c: Include gettext.h unconditionally, as
172 per recent gettext manual's suggestion.
173 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
174 Use prototypes, not old-style definitions.
175 * lib/lbitset.c (lbitset_unused_clear): Likewise.
176 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
177 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
178 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
179 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
180 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
181 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
182 vbitset_or_and_cmp, vbitset_copy): Likewise.
184 * lib/libiberty.h: Do not include config.h; that's the includer's job.
185 Do not include <stdlib.h>.
186 (PARAMS): Define unconditionally for C89.
187 (ATTRIBUTE_NORETURN): Remove.
188 (ATTRIBUTE_UNUSED): Define unconditionally.
190 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
191 <http://mail.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
192 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
193 * lib/vbitset.c, lib/vbitset.h: New files.
194 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
195 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
198 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
199 `How Can I Reset @code{yyparse}', since texinfo does not allow
200 arbitrary @ in node names.
202 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
203 shouldn't be needed according to the gettext 0.12.1 documentation
204 but which seem to be needed anyway: codeset.m4 glibc21.m4
205 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
206 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
207 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
209 * lib/.cvsignore: Add stdbool.h.
210 * m4/.cvsignore: Add nls.m4, po.m4.
212 Upgrade to CVS gnulib.
213 * stdbool_.h: File renamed from stdbool.h.in.
214 * configure.ac (AM_STDBOOL_H): Invoke this instead of
216 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
217 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
218 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
219 (MOSTLYCLEANFILES): New var.
220 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
221 (stdbool.h): New rule.
222 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
223 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
224 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
225 m4/quote.m4: Upgrade to today's gnulib.
227 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
228 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
230 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
231 yyerror are declared before use; C99 requires this.
233 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
235 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
237 (yyrecoverSyntaxError): Correct the logic for setting and testing
239 Correct comment on handling EOF.
240 Allow states with only a default reduction, rather than failing
241 (I can't quite reconstruct why these were not allowed before).
243 Fixes to avoid problem that $-N rules in GLR parsers can cause
244 buffer overruns, corrupting state.
246 * src/output.c (prepare_rules): Output max_left_semantic_context
248 * src/reader.h (max_left_semantic_context): New variable declaration.
249 * src/scan-gram.l (max_left_semantic_context): Define.
250 (handle_action_dollar): Update max_left_semantic_context.
251 * data/glr.c (YYMAXLEFT): New definition.
252 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
253 (yyresolveAction): Ditto.
255 Fixes to problems with location handling in GLR parsers reported by
256 Frank Heckenbach (2003/06/05).
258 * data/glr.c (YYLTYPE): Make trivial if locations not used.
259 (YYRHSLOC): Add parentheses, and define only if locations used.
260 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
262 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
263 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
265 * tests/cxx-type.at: Exercise location information; update tests
266 to differentiate output with and without locations.
267 Remove forward declarations of yylex and yyerror---caused errors
268 because default YYLTYPE not yet defined.
269 Change semantic actions to compute strings, rather than printing
270 them directly (to test proper passing of semantics values). Change
271 output to prefix notation and update test data and expected results.
272 (yylex): Track locations.
273 (stmtMerge): Return value rather than printing, and include arguments
276 2003-06-03 Paul Eggert <eggert@twinsun.com>
278 Avoid warnings generated by GCC 2.95.4 when Bison is
279 configured with --enable-gcc-warnings.
280 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
281 yy::]b4_parser_class_name[::translate_,
282 yy::Stack::operator[] (unsigned),
283 yy::Stack::operator[] (unsigned) const,
284 yy::Slice::operator[] (unsigned),
285 yy::Slice::operator[] (unsigned) const):
286 Rename local vars to avoid warnings.
287 * tests/glr-regression.at (Improper handling of embedded actions
288 and $-N in GLR parsers): Remove unused local variable from yylex.
289 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
290 (void) as arg when not pure, since we now assume C89 when building
291 Bison. Pacify GCC by using parameter.
293 2003-06-02 Paul Eggert <eggert@twinsun.com>
295 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
296 yy::Location::lines, yy::Location::columns): Rename arguments
297 to avoid shadowing; this removes a warning generated by GCC 3.3.
299 2003-06-01 Paul Eggert <eggert@twinsun.com>
301 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
302 to g++, as GCC 3.3 complains if you do it.
303 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
304 everything that WARNING_CFLAGS has, except omit warnings
305 not suitable for C++.
306 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
307 * tests/atlocal.in (CXXFLAGS): New var.
308 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
310 Fix a GLR parser bug I reported in February; see
311 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
312 The problem was that GLR parsers did not conform to the C standard,
313 because actions like { $1 = $2 + $3; } expanded to expressions
314 that invoked YYFILL in separate subexpressions, and YYFILL assigned
315 to a local variable. The C standard says that expressions
316 like (var = f ()) + (var = f ()) have undefined behavior.
317 Another problem was that GCC sometimes issues warnings that
318 yyfill and its parameters are unused.
320 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
322 (yyfill): New function.
324 (yyuserAction): Change type of yynormal to bool, so that it matches
325 the new yyfill signature. Mark it as possibly unused.
328 Follow up on a bug I reported in February, where a Bison-generated
329 parser can loop. Provide a test case and a fix for yacc.c. I
330 don't have a fix for lalr1.cc or for glr.c, unfortunately.
331 The original bug report is in:
332 <http://mail.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
334 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
335 macro's size was becoming unwieldy.
336 (yyerrlab): Do not discard an empty lookahead symbol, as this
337 might destroy garbage.
338 (yyerrorlab): New label, with the old contents of YYERROR,
339 plus the following change: pop the stack of rhs corresponding
340 to the production that invoked YYERROR. That is how Yacc
341 behaves, and POSIX requires this behavior.
342 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
343 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
344 Define 'alarm' to do nothing if unistd.h is not available.
345 Add a new rule "exp: '-' error;" to test the above change to
346 data/yacc.c. Use 'alarm' to abort any test taking longer than
347 10 seconds, as it's probably looping.
348 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
349 Also, the new yacc.c generates two fewer diagnostics for an
352 2003-05-24 Paul Eggert <eggert@twinsun.com>
354 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
355 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
356 This fixes a problem reported by John Bowman when the Compaq/HP
357 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
359 * data/yacc.c (union yyalloc): Likewise.
360 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
362 Switch from 'int' to 'bool' where that makes sense.
364 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
365 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
366 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
367 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
368 Return or accept bool, not int. All callers changed.
369 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
370 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
371 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
372 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
373 bitset_or_and_cmp_): Likewise.
374 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
375 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
376 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
377 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
378 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
379 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
380 bitset_stats_or_and_cmp): Likewise.
381 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
382 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
383 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
384 ebitset_xor_cmp): Likewise.
385 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
386 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
387 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
388 lbitset_xor_cmp): Likewise.
389 * lib/bbitset.h: Include <stdbool.h>.
390 (struct bitset_vtable): The following members now return bool, not
391 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
392 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
394 * src/conflicts.c (count_rr_conflicts): Likewise.
395 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
397 * lib/ebitset.c (ebitset_obstack_init): Likewise.
398 * lib/lbitset.c (lbitset_obstack_init): Likewise.
399 * src/getargs.c (debug_flag, defines_flag, locations_flag,
400 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
401 graph_flag): Likewise.
402 * src/getargs.h (debug_flag, defines_flag, locations_flag,
403 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
404 graph_flag): Likewise.
405 * src/output.c (error_verbose): Likewise.
406 * src/output.h (error_verbose): Likewise.
407 * src/reader.c (start_flag, typed): Likewise.
408 * src/reader.h (typed): Likewise.
409 * src/getargs.c (LOCATIONS_OPTION): New constant.
410 (long_options, getargs): Use it.
411 * src/lalr.c (build_relations): Use bool, not int.
412 * src/nullable.c (nullable_compute): Likewise.
413 * src/print.c (print_reductions): Likewise.
414 * src/tables.c (action_row, pack_vector): Likewise.
415 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
416 * src/output.c (prepare): Use it.
417 * src/output.c (token_definitions_output,
418 symbol_destructors_output, symbol_destructors_output): Use string,
419 not boolean integer, to keep track of whether to output separator.
420 * src/print_graph.c (print_core): Likewise.
421 * src/state.c (state_rule_lookaheads_print): Likewise.
423 * config/install-sh: Sync from automake 1.7.5.
425 2003-05-14 Paul Eggert <eggert@twinsun.com>
427 * src/parse-gram.y (rules_or_grammar_declaration): Require a
428 semicolon after a grammar declaration, in the interest of possible
429 future changes to the Bison input language.
430 Do not allow a stray semicolon at the start of the grammar.
431 (rhses.1): Allow one or more semicolons after any rule, including
432 just before "|" as required by POSIX.
433 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
436 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
438 %parse-param support for lalr1.cc.
440 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
441 b4_cc_constructor_calls, b4_cc_constructor_call,
442 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
444 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
445 parse-param arguments.
446 (yy::b4_parser_class_name): Declare instance variables to
447 hold parse-param arguments.
448 * tests/calc.at: s/value/semantic_value/ because value clashes
449 with a member of yy::b4_parser_class_name. Adjust C++ code
450 to handle %parse-param. Enable %parse-param test in C++.
452 2003-05-12 Paul Eggert <eggert@twinsun.com>
454 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
455 English a bit. Fix fclose typo. Change "const char" to "char
456 const", and use ANSI C rather than K&R for "main". Suggest
457 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
458 and suggest yy_switch_to_buffer.
460 2003-05-05 Paul Eggert <eggert@twinsun.com>
462 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
463 C89. This avoids a diagnostic on compilers that define __STDC__
464 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
465 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
467 2003-05-03 Paul Eggert <eggert@twinsun.com>
469 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
470 Do not overrun array bounds.
471 This should fix a bug reported today by Olatunji Oluwabukunmi in
472 <http://mail.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
474 2003-04-29 Akim Demaille <akim@epita.fr>
476 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
477 * src/getargs.c, src/getargs.h: here, as bool, not int.
478 (nondeterministic_parser): New.
479 * src/parse-gram.y, src/scan-gram.l: Support
480 %nondeterministic-parser.
481 * src/output.c (prepare): Use nondeterministic_parser instead
482 of glr_parser where appropriate.
483 * src/tables.c (conflict_row, action_row, save_row)
484 (token_actions, token_actions, pack_vector): Ditto.
486 2003-04-29 Akim Demaille <akim@epita.fr>
488 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
490 2003-04-29 Akim Demaille <akim@epita.fr>
492 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
493 with %pure-parser and %locations to exercise the patch from Yakov
496 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
498 * data/yacc.c: (b4_lex_param): Corrected for the case where
499 %lex-param is provided and %pure-parser isn't.
501 2003-04-27 Paul Eggert <eggert@twinsun.com>
503 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
504 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
505 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
506 if it is not defined.
507 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
509 2003-04-26 Paul Eggert <eggert@twinsun.com>
511 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
512 Declare to be of type suitable for the ninf value itself, not of
513 type suitable for the corresponding table, since the latter might
514 be unsigned but the ninf value might be negative. This fixes a
515 bug reported by Alexandre Duret-Lutz in
516 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
518 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
519 invokes it. We shouldn't invoke it twice because it will attempt
520 to put error.o in the archive twice. This fixes a glitch reported
522 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
524 2003-04-21 Paul Eggert <eggert@twinsun.com>
526 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
529 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
531 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
532 Fix obvious typo that results in uncompilable GLR parsers
533 when both %pure-parser and %locations are used. (trivial change)
535 2003-04-17 Paul Eggert <eggert@twinsun.com>
537 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
538 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
539 Do not insert the expected token via unput, as this runs afoul
540 of a POSIX-compatibility bug in flex 2.5.31.
541 All uses changed to BEGIN the parent state,
542 since we no longer insert the expected token via unput.
543 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
544 that is no longer emitted after the above change.
546 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
547 the first one. This change is from Paul Hilfinger, and it fixes
548 regression reported by Werner Lemberg in
549 <http://mail.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
551 (resolve_sr_conflict): Don't invoke state_errs_set
552 unless one or more tokens have been explicitly made errors.
553 Otherwise, the above change causes Bison to abort.
555 * tests/existing.at (GNU pic Grammar): New test case, taken from
558 2003-03-31 Akim Demaille <akim@epita.fr>
560 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
562 2003-03-31 Akim Demaille <akim@epita.fr>
564 * src/output.c (prepare_symbols): Avoid trailing spaces in the
567 2003-03-31 Akim Demaille <akim@epita.fr>
569 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
572 2003-03-29 Akim Demaille <akim@epita.fr>
574 * m4/error.m4: Do not put under dynamic conditions some code which
575 expansion is under static control.
577 2003-03-29 Akim Demaille <akim@epita.fr>
579 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
581 2003-03-29 Akim Demaille <akim@epita.fr>
583 * doc/bison.texinfo (Strings are Destroyed): New.
585 2003-03-13 Paul Eggert <eggert@twinsun.com>
587 * .cvsignore: Add configure.lineno.
588 * src/.cvsignore: Add yacc.
589 * tests/.cvsignore: Add testsuite.log.
590 * doc/fdl.texi: Sync with latest FSF version.
592 2003-03-12 Paul Eggert <eggert@twinsun.com>
594 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
595 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
596 cursor, instead of leaving it undefined. This fixes a bug
597 reported by Tim Van Holder in
598 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
599 * tests/input.at (Torturing the Scanner): Test the scanner on
600 an empty input file, which was Tim Van Holder's test case.
602 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
603 <sys/resource.h> can be included, include sys/time.h and
604 sys/times.h first, if available. This works around the SunOS
605 4.1.4 porting bug reported by Bruce Becker in
606 <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
608 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
609 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
612 Merge changes from gnulib. This was prompted because the CVS
613 snapshot didn't build on Solaris 7 due to strnlen problems.
615 These changes need to be merged back into gnulib:
616 * lib/hash.c: Include <stdbool.h> unconditionally.
617 * m4/onceonly.m4 (m4_quote): New macro.
618 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
619 Quote AC_FOREACH variable-expansions properly.
620 The 2003-01-03 obstack.h change also needs merging.
621 {end of changes requiring merging}
623 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
624 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
625 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
626 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
627 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
628 New files, imported from gnulib.
629 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
632 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
633 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
636 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
638 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
639 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
640 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
641 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
642 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
643 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
644 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
645 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
646 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
647 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
648 (jm_PREREQ_ARGMATCH): Remove.
649 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
650 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
652 * src/system.h: Include <stdbool.h> unconditionally.
654 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
655 assuming at least C89 in the bitset code for some time now.
657 2003-03-03 Akim Demaille <akim@epita.fr>
661 2003-03-02 Akim Demaille <akim@epita.fr>
663 * doc/bison.texinfo (Table of Symbols): Reactivate the
664 documentation for %lex-param, and %parse-param.
666 2003-03-02 Akim Demaille <akim@epita.fr>
668 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
669 generate verbose error messages.
670 Use the number of tokens as an upper bound in yytname, as it
671 cannot be a non terminal.
673 2003-03-02 Akim Demaille <akim@epita.fr>
675 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
678 2003-03-02 Akim Demaille <akim@epita.fr>
680 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
681 Use them to exercise yycheck overrun.
682 Based on Andrew Suffield's grammar.
684 2003-03-02 Akim Demaille <akim@epita.fr>
686 Create tests/local.at for Bison generic testing macros.
688 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
689 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
691 * tests/calc.at (AT_CHECK_CALC): Adjust.
692 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
693 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
694 * tests/local.at: here.
695 (AT_COMPILE_CXX): Tags the tests using it as c++.
696 Ignore the test if CXX is not functional.
698 2003-03-01 Paul Eggert <eggert@twinsun.com>
700 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
701 not loc->end, since loc->end might contain garbage and this leads
702 to undefined behavior on some platforms.
703 (id_loc, token_start): Use (IF_LINTed) initial values that do not
704 depend on *loc, so that the reader doesn't give the the false
705 impression that *loc is initialized.
706 (<INITIAL>"%%"): Do not bother setting code_start, since its value
707 does not survive the return.
709 2003-03-01 Akim Demaille <akim@epita.fr>
711 * src/scan-gram.l (code_start): Always initialize it when entering
712 into yylex, as SC_EPILOGUE is activated *before* the corresponding
713 yylex invocation. An alternative would be making it static, but
714 then it starts with the second %%'s beginning, instead of its end.
716 2003-02-28 Paul Eggert <eggert@twinsun.com>
718 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
719 around a UnixWare 7.1.1 porting bug reported by John Hughes in
720 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
722 2003-02-26 Paul Eggert <eggert@twinsun.com>
724 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
725 Remove Sequent/Pyramid discussion (nobody uses them any more).
726 Merge VMS and MS-DOS discussion; these ports may well be dead
727 but let's keep mentioning them for now. Put <> around email
728 addresses. Add copyright notice.
730 2003-02-24 Paul Eggert <eggert@twinsun.com>
732 * data/glr.c (yy_reduce_print): yylineno -> yylno,
733 to avoid collision with flex use of yylineno.
734 Problem reported by Bruce Lilly in
735 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
736 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
737 * data/yacc.c (yy_reduce_print): Likewise.
739 * config/depcomp: Sync with Automake 1.7.3.
741 2003-02-21 Akim Demaille <akim@epita.fr>
743 * data/lalr1.cc: Use temporary variables instead of casts to
744 change integer types.
745 Suggested by Paul Eggert.
747 2003-02-21 Akim Demaille <akim@epita.fr>
749 * doc/bison.texinfo: Use "location" consistently to refer to @n,
750 to avoid confusions with lalr1.cc's notion of Position.
751 Suggested by Paul Eggert.
753 2003-02-20 Akim Demaille <akim@epita.fr>
755 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
756 before initial_columns.
757 (location.hh): Use consistent variable names when defining the
759 Use "last" so that we subtract from Positions, not from unsigned.
761 2003-02-20 Akim Demaille <akim@epita.fr>
763 * data/lalr1.cc (position.hh): New subfile, including the extended
764 and Doxygen'ed documentation of class Position.
765 (location.hh): Use it.
766 Document a` la Doxygen.
767 With the help of Benoit Perrot.
769 2003-02-20 Akim Demaille <akim@epita.fr>
771 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
773 Redefine AT_YYERROR_SEES_LOC_IF using it.
774 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
776 Don't use the location in yy::Parser::error_ and
777 yy::Parser::print_ when not %locations.
778 Activate more lalr1.cc tests.
780 2003-02-19 Akim Demaille <akim@epita.fr>
782 * data/lalr1.cc: When displaying a line number, be sure to make it
785 2003-02-19 Akim Demaille <akim@epita.fr>
787 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
789 (YYABORT, YYACCEPT, YYERROR): New.
790 * tests/calc.at: Renable the lalr1.cc test.
792 2003-02-19 Akim Demaille <akim@epita.fr>
794 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
795 error recovery, mixing with/without pops and discarding of the
798 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
800 2003-02-17 Paul Eggert <eggert@twinsun.com>
802 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
803 * tests/testsuite.at (AT_COMPILE): Use them.
804 This fixes the testsuite problem reported by Robert Lentz in
805 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
807 2003-02-12 Paul Eggert <eggert@twinsun.com>
809 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
810 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
811 <http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
812 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
813 Check for malloc failure, for consistency with yacc.c.
814 (yytname_size): Remove, for consistency with yacc.c.
816 The bug still remains in data/lalr1.cc, as I didn't have time
819 2003-02-06 Akim Demaille <akim@epita.fr>
821 * configure.ac (GXX): Rename as...
822 (CXX): this, to keep the original Autoconf semantics.
824 * data/lalr1.cc: Fix b4_copyright invocations.
825 If YYDEBUG is not defined, don't depend upon name_ being defined.
826 (location.hh): Include string and iostream.
827 (Position::filename): New member.
828 (Position::Position ()): New.
829 (operator<< (Position)): New.
830 (operator- (Position, int)): New.
831 (Location::first, Location::last): Rename as...
832 (Location::begin, Location::end): these, to mock the conventional
834 (operator<< (Location)): New.
835 * tests/atlocal.in (CXX): New.
836 * tests/testsuite.at (AT_COMPILE_CXX): New.
837 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
838 locations in a more synthetic way.
839 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
841 Adjust the C locations to match those from Emacs: first column is
843 Change all the expected results.
844 Conform to the GCS: simplify the locations when applicable.
845 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
846 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
847 these CPP macros with the m4 macros new defined by...
848 (AT_CHECK_PUSHDEFS): this, i.e.:
849 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
850 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
852 (AT_CHECK_POPDEFS): Undefine them.
853 (AT_CHECK_CALC_LALR1_CC): New.
854 Use it for the first lalr1.cc test.
856 2003-02-04 Akim Demaille <akim@epita.fr>
858 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
859 Location as is defined.
861 2003-02-04 Akim Demaille <akim@epita.fr>
863 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
866 2003-02-03 Paul Eggert <eggert@twinsun.com>
868 * src/gram.h (start_symbol): Remove unused decl.
870 Use more-consistent naming conventions for local vars.
872 * src/derives.c (derives_compute): Change type of local var from
874 * src/gram.c (grammar_rules_partial_print): Likewise.
875 * src/print.c (print_core): Likewise.
876 * src/reduce.c (reduce_grammar_tables): Likewise.
878 * src/gram.c (grammar_dump): Change name of item_number *
879 local var from r to rp.
880 * src/nullable.c (nullable_compute): Likewise.
882 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
884 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
885 for symbol or symbol_number var.
886 * src/reader.c (grammar_start_symbol_set): Likewise.
887 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
889 * src/state.c (transitions_to): Likewise.
890 * src/state.h: Likewise.
891 * src/tables.c (symbol_number_to_vector_number): Likewise.
893 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
896 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
899 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
902 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
903 Use str, not s, for char * var. Use ch, not c, for character var.
904 Use size for size var.
906 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
908 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
910 * src/uniqstr.h: Likewise.
912 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
913 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
914 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
915 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
916 param to have same name as that of enum, so that we don't use
917 "s" to stand for a non-state.
919 2003-02-02 Akim Demaille <akim@epita.fr>
921 * src/scan-skel.l: Scan more than one inert character per yylex
924 2003-02-01 Paul Eggert <eggert@twinsun.com>
928 * po/LINGUAS: Add ms.
930 2003-01-30 Akim Demaille <akim@epita.fr>
932 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
934 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
936 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
939 Changes in response to error report by S. Eken: GLR mode does not
940 handle negative $ indices or $ indices in embedded rules correctly.
941 See <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
943 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
944 (b4_rhs_location): Ditto.
945 (yyfill): New function to copy from stack tree into array
947 (yyuserAction): Modify to allow incremental move of semantic values
948 to rhs array when in GLR mode.
949 Define YYFILL to use in user-defined actions to fill semantic array
951 Remove dummy use of yystack, as there is now a guaranteed use.
952 (yydoAction): Modify to allow incremental move of semantic values
953 to rhs array when in GLR mode.
954 (yyresolveAction): Ditto.
955 (yyglrShiftDefer): Update comment.
956 (yyresolveStates): Use X == NULL for pointers, not !X.
957 (yyglrReduce): Ditto.
960 * tests/glr-regr1.at: Rename to ...
961 * tests/glr-regression.at: Add new regression test for the problems
962 described above (adapted from S. Eken).
963 Update copyright notice.
964 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
965 * tests/Makefile.am: Ditto.
967 2003-01-28 Paul Eggert <eggert@twinsun.com>
969 * data/lalr1.cc: Do not use @output_header_name@ unless
970 b4_defines_flag is set. This fixes two bugs reported by
972 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
973 and <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
975 2003-01-21 Paul Eggert <eggert@twinsun.com>
977 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
978 we don't need to worry about yyerrlab1 being reported as an
979 "unused label" by non-GCC C compilers. The downside is that if
980 locations are used then a couple of statements are duplicated each
981 time YYERROR is invoked, but the upside is that the warnings
983 (yyerrlab1): Move code to YERROR.
984 (yyerrlab2): Remove. Change uses back to yyerrlab1.
985 This reverts some of the 2002-12-27 change.
987 2003-01-17 Paul Eggert <eggert@twinsun.com>
989 * src/output.c (symbol_printers_output): Fix typo that led
990 to core dump. Problem reported by Antonio Rus in
991 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
993 2003-01-13 Akim Demaille <akim@epita.fr>,
994 Quoc Peyrot <chojin@lrde.epita.fr>,
995 Robert Anisko <anisko_r@lrde.epita.fr>
997 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
998 when the stacks contain one element, as the loop would otherwise
999 free the last state, and then use the top state (the one we just
1000 popped). This means that the initial elements will not be freed
1001 explicitly, as is the case in yacc.c; it is not a problem, as
1002 these elements have fake values.
1004 2003-01-11 Paul Eggert <eggert@twinsun.com>
1006 * NEWS: %expect-violations are now just warnings, reverting
1007 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
1008 bootstrapping problem reported by Matthias Klose; see
1009 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
1010 * src/conflicts.c (conflicts_print): Likewise.
1011 * tests/conflicts.at (%expect not enough, %expect too much,
1012 %expect with reduce conflicts): Likewise.
1013 * doc/bison.texinfo (Expect Decl): Document this. Also mention
1014 that the warning is enabled if the number of conflicts changes
1015 (not necessarily increases).
1017 * src/getargs.c (version): Update copyright year.
1019 2003-01-09 Akim Demaille <akim@epita.fr>
1021 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
1023 2003-01-08 Paul Eggert <eggert@twinsun.com>
1025 * Makefile.maint (WGETFLAGS):
1026 New macro, containing "-C off" to disable proxy caches.
1027 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
1028 (rel-check): Use $(WGET) instead of wget.
1030 2003-01-06 Paul Eggert <eggert@twinsun.com>
1032 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
1033 the GLR paper of Scott, Johnstone and Hussain.
1035 2003-01-04 Paul Eggert <eggert@twinsun.com>
1037 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
1038 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
1039 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
1040 (EXTRA_LIBRARIES): New var, for liby.a.
1041 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
1042 (EXTRA_SCRIPTS): New var, for yacc.
1044 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
1045 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
1046 Problem reported by Nelson H. F. Beebe.
1048 2003-01-03 Paul Eggert <eggert@twinsun.com>
1050 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
1051 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1052 when compiling Bison 1.875's `bitset bset = obstack_alloc
1053 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
1055 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
1056 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
1057 grow to a huge size with typical invocation.
1059 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
1060 Use the pattern recommended by Autoconf 2.57, except also protect
1061 against double-definition.
1062 * src/system.h: Likewise.
1063 Portability issues reported by Nelson H. F. Beebe.
1065 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
1066 All uses changed. Provide a definition in both C and C++.
1067 (yytrue, yyfalse): Define even if defined (__cplusplus).
1069 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
1070 Reported by Nelson H. F. Beebe.
1072 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
1074 2003-01-02 Paul Eggert <eggert@twinsun.com>
1076 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
1077 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
1078 Bug reported by Nelson H. F. Beebe.
1080 2003-01-01 Paul Eggert <eggert@twinsun.com>
1084 2002-12-30 Paul Eggert <eggert@twinsun.com>
1086 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
1088 (<INITIAL>","): Here. This causes stray "," to be treated
1091 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
1092 last brace in braced code when not in Yacc mode, for compatibility
1093 with Bison 1.35. This resurrects the 2001-12-15 patch to
1096 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
1097 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
1099 2002-12-28 Paul Eggert <eggert@twinsun.com>
1101 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
1102 that of SYM's type. This fixes Debian bug 168069, reported by
1105 2002-12-28 Paul Eggert <eggert@twinsun.com>
1109 Switch back to the Yacc style of conflict reports, undoing some
1110 of the 2002-07-30 change.
1111 * doc/bison.texinfo (Understanding): Use Yacc style for
1112 conflict reports. Also, use new way of locating rules.
1113 * src/conflicts.c (conflict_report):
1114 Renamed from conflict_report_yacc, removing the old
1115 'conflict_report'. Translate the entire conflict report at once,
1116 so that we don't assume that "," has the same interpretation in
1118 (conflicts_output): Use Yacc-style conflict report for each state,
1119 instead of our more-complicated style.
1120 (conflicts_print): Use Yacc-style conflict report, except print
1121 the input file name when not emulating Yacc.
1122 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
1123 Conflicted Reduction, %expect not enough, %expect too much,
1124 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
1125 * tests/existing.at (GNU Cim Grammar): Likewise.
1126 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
1128 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
1129 fatal): Don't invoke fflush; it's not needed and it might even be
1130 harmful for stdout, as stdout might not be open.
1131 * src/reduce.c (reduce_print): Likewise.
1133 2002-12-27 Paul Eggert <eggert@twinsun.com>
1135 Fix a bug where error locations were not being recorded correctly.
1136 This problem was originally reported by Paul Hilfinger in
1137 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
1139 * data/yacc.c (yyparse): New local var yylerrsp, to record the
1140 top of the location stack's error locations.
1141 (yyerrlab): Set it. When discarding a token, push its location
1142 onto yylerrsp so that we don't lose track of the error's end.
1143 (yyerrlab1): Now is only the target of YYERROR, so that we can
1144 properly record the location of the action that failed. For GCC
1145 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
1146 GCC warning about yyerrlab1 being unused if YYERROR is unused.
1147 (yyerrlab2): New label, which yyerrlab now falls through to.
1148 Compute the error's location by applying YYLLOC_DEFAULT to
1149 the locations of all the symbols that went into the error.
1150 * doc/bison.texinfo (Location Default Action): Mention that
1151 YYLLOC_DEFAULT is also invoked for syntax errors.
1152 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1153 Error locations include the locations of all the tokens that were
1154 discarded, not just the last token.
1156 2002-12-26 Paul Eggert <eggert@twinsun.com>
1158 * src/files.c: Include quote.h.
1159 (compute_output_file_names): Warn if we detect conflicting
1160 outputs to the same file. This should catch the misunderstanding
1161 exemplified by Debian Bug 165349, reported by Bruce Stephens..
1163 * src/conflicts.c (conflicts_print): If the user specifies
1164 "%expect N", report an error if there are any reduce/reduce
1165 conflicts. This is what the manual says should happen.
1166 This fixes Debian bug 130890, reported by Anthony DeRobertis.
1167 * tests/conflicts.at (%expect with reduce conflicts): New test.
1169 Don't use m4_include on relative file names, as it doesn't work as
1170 desired if there happens to be a file with that name under ".".
1172 * m4sugar/version.m4: Remove; it was included but it wasn't used.
1173 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
1174 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
1175 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
1176 * src/output.c (output_skeleton): Use full path names when
1177 specifying a file to include; don't rely on include path, as
1178 it's unreliable when the working file contains a file with
1181 2002-12-25 Paul Eggert <eggert@twinsun.com>
1183 Remove obsolete references to bison.simple and bison.hairy.
1184 Problem mentioned by Aubin Mahe in
1185 <http://mail.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
1186 * data/glr.c: Comment fix.
1187 * doc/bison.1: Remove references. Also, mention "yacc".
1189 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
1192 * src/parse-gram.y (declaration): Use enum "report_states" rather
1193 than its numeric value 1.
1195 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
1196 opening a new one. This fixes Debian bug 165349, reported by
1199 2002-12-24 Paul Eggert <eggert@twinsun.com>
1203 * Makefile.maint (cvs-update): Don't assume that the shell
1204 supports $(...), as Solaris sh doesn't.
1206 * src/parse-gram.y (lloc_default): Remove test for empty
1207 nonterminals at the end, since it didn't change the result.
1209 2002-12-24 Paul Eggert <eggert@twinsun.com>
1211 If the user does not define YYSTYPE as a macro, Bison now declares it
1212 using typedef instead of defining it as a macro. POSIX requires this.
1213 For consistency, YYLTYPE is also declared instead of defined.
1215 %union directives can now have a tag before the `{', e.g., the
1216 directive `%union foo {...}' now generates the C code
1217 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
1218 The default union tag is `YYSTYPE', for compatibility with Solaris 9
1219 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
1220 instead of `yyltype'.
1222 `yystype' and `yyltype' are now obsolescent macros instead of being
1223 typedefs or tags; they are no longer documented and will be
1224 withdrawn in a future release.
1226 * data/glr.c (b4_location_type): Remove.
1227 (YYSTYPE): Renamed from yystype.
1228 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
1229 (struct YYLTYPE): Renamed from struct yyltype.
1230 (YYLTYPE): Renamed from yyltype.
1231 (yyltype, yystype): New (and obsolescent) macros,
1232 for backward compatibility.
1233 * data/yacc.c: Likewise.
1235 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
1236 does not specify a union tag. This is for compatibility with
1239 * src/parse-gram.y (add_param): 2nd arg is now char * not char
1240 const *, since it is now modified by stripping surrounding { }.
1241 (current_braced_code): Remove.
1242 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
1243 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
1244 trailing " {...}". Now of type <chars>.
1245 (grammar_declaration): Adjust to bundled tokens.
1246 (code_content): Remove; stripping is now done by add_param.
1247 (print_token_value): Print contents of bundled tokens.
1248 (token_name): New function.
1250 * src/reader.h (braced_code, current_braced_code): Remove.
1251 (token_name): New decl.
1253 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
1254 token_type, not braced_code code_kind. All uses changed.
1255 (SC_PRE_CODE): New state, for scanning after a keyword that
1256 has (or usually has) an immediately-following braced code.
1257 (token_type): New local var, to keep track of which token type
1258 to return when scanning braced code.
1259 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
1260 <INITIAL>"%parse-param", <INITIAL>"%printer",
1261 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
1262 instead of returning a token type immediately.
1263 (<INITIAL>"{"): Set token type.
1264 (<SC_BRACED_CODE>"}"): Use it.
1265 (handle_action_dollar, handle_action_at): Now returns bool
1266 indicating success. Fail if ! current_rule; this prevents a core dump.
1267 (handle_symbol_code_dollar, handle_symbol_code_at):
1268 Remove; merge body into caller.
1269 (handle_dollar, handle_at): Complain in invalid contexts.
1271 * NEWS, doc/bison.texinfo: Document the above.
1272 * NEWS: Fix years and program names in copyright notice.
1274 2002-12-17 Paul Eggert <eggert@twinsun.com>
1276 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
1277 Reporting, Table of Symbols): Omit mentions of %lex-param and
1278 %parse-param from the documentation for now.
1280 2002-12-15 Paul Eggert <eggert@twinsun.com>
1282 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
1283 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
1284 lookahead symbol, and which sets yychar in parser actions) and it
1285 disagreed with the Bison documentation. Bug
1286 reported by Andrew Walrond.
1288 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
1289 as the caller now does that.
1290 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
1291 (YYEMPTY): Parenthesize right hand side, since others use it.
1292 (yyparse): Don't assume that our generated code is the only code
1295 2002-12-13 Paul Eggert <eggert@twinsun.com>
1299 POSIX requires a "yacc" command.
1300 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
1301 (MOSTLYCLEANFILES): Add yacc.
1303 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
1304 as an alias for bison y.
1306 * po/LINGUAS: Add da.
1308 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
1309 problem with latest <getopt.h>.
1310 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
1312 * doc/fdl.texi: Upgrade to 1.2.
1313 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
1314 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
1315 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
1317 * config/install-sh: Sync with autotools.
1319 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
1320 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
1321 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
1322 locations are requested.
1323 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
1324 locations are requested.
1326 2002-12-12 Paul Eggert <eggert@twinsun.com>
1328 Remove unportable casts and storage allocation tricks.
1329 While we're at it, remove almost all casts, since they
1330 usually aren't needed and are a sign of trouble.
1332 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
1334 * src/derives.c (derives_compute): Do not subtract NTOKENS from
1335 the pointer DSET returned by malloc; this isn't portable.
1336 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
1337 Similarly for DERIVES.
1338 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
1339 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
1340 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
1342 * src/derives.c (derives_compute): Do not bother invoking
1343 int_of_rule_number, since rule numbers are integers.
1345 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
1346 rather than XMALLOC (char, N).
1348 * src/files.c (filename_split): Rewrite to avoid cast.
1350 * src/gram.h (symbol_number_as_item_number,
1351 item_number_as_symbol_number, rule_number_as_item_number,
1352 item_number_as_rule_number):
1353 Now inline functions rather than macros, to avoid casts.
1354 * src/state.h (state_number_as_int): Likewise.
1355 * src/tables.c (state_number_to_vector_number,
1356 symbol_number_to_vector_number): Likewise.
1358 * src/gram.h (int_of_rule_number): Remove; no longer used.
1360 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
1361 since the resulting storage is always stored into.
1363 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
1366 * src/muscle_tab.c (muscle_m4_output):
1367 Now inline. Return bool, not int.
1368 * src/state.c (state_compare): Likewise.
1369 * src/symtab.c (symbol_check_defined,
1370 symbol_check_alias_consistency, symbol_pack, symbol_translation,
1371 hash_compare_symbol, hash_symbol):
1373 * src/uniqstr.c (uniqstr_print): Likewise.
1374 * src/muscle_tab.c (muscle_m4_output_processor):
1375 New function, to avoid casts.
1376 * src/state.c (state_comparator, stage_hasher): Likewise.
1377 * src/symtab.c (symbol_check_defined_processor,
1378 symbol_check_alias_consistency_processor, symbol_pack_processor,
1379 symbol_translation_processor, hash_symbol_comparator,
1380 hash_symbol_hasher): Likewise.
1381 * src/uniqstr.c (uniqstr_print_processor): Likewise.
1382 * src/muscle_tab.c (muscles_m4_output):
1383 Use new functions instead of casting old functions unportably.
1384 * src/state.c (state_hash_new): Likewise.
1385 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
1386 symbols_token_translations_init):
1388 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
1390 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
1391 var instead of casting to long, to avoid casts.
1392 (prepare_states): Use MALLOC rather than alloca, so that we don't
1393 have to worry about alloca.
1394 * src/state.c (state_hash_lookup): Likewise.
1396 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
1397 local var instead of casting to unsigned char, to avoid casts.
1399 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
1400 STATE_ALLOC): Remove.
1401 (transitions_new, errs_new, reductions_new, state_new): Use malloc
1402 rather than calloc, and use offsetof to avoid allocating slightly
1404 (state_new): Initialize all members.
1406 * src/state.c (state_hash): Use unsigned accumulator, not signed.
1408 * src/symtab.c (symbol_free): Remove; unused.
1409 (symbol_get): Remove cast in lhs of assignment.
1410 (symbols_do): Now static. Accept generic arguments, not
1411 hashing-related ones.
1413 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
1414 (symbol_processor): Remove.
1415 (symbols_do): Remove decl; now static.
1417 * src/system.h (alloca): Remove; decl no longer needed.
1418 (<stddef.h>): Include, for offsetof.
1419 (<inttypes.>, <stdint.h>): Include if available.
1420 (uintptr_t): New type, if system lacks it.
1421 (CALLOC, MALLOC, REALLOC): New macros.
1422 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
1425 * src/tables.c (table_size): Now int, to pacify GCC.
1426 (table_grow, table_ninf_remap): Use signed table size.
1427 (save_row): Don't bother initializing locals when not needed.
1428 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
1429 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
1431 * src/vcg.h: Correct misspellings.
1433 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
1436 * src/getargs.c (getargs): Don't assume EOF == -1.
1438 2002-12-09 Paul Eggert <eggert@twinsun.com>
1440 Change identifier spellings to avoid collisions with names
1441 that are reserved by POSIX.
1443 Don't use names ending in _t, since POSIX reserves them.
1444 For consistency, remove _e and _s endings -- they're weren't
1445 needed to remove ambiguity. All uses changed.
1446 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
1447 turn was just renamed from struniq_t.
1448 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
1449 which in turn was just renamed from struniq_processor_t.
1450 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
1451 in turn was renamed from hash_compare_struniq_t.
1452 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
1453 (state_list): Renamed from state_list_t.
1454 * src/assoc.h (assoc): Renamed from assoc_t.
1455 * src/conflicts.c (enum conflict_resolution): Renamed from
1456 enum conflict_resolution_e.
1457 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
1458 (rule_list): Renamed from rule_list_t.
1459 * src/getargs.h (enum trace): Renamed from enum trace_e.
1460 (enum report): Renamed from enum report_e.
1461 * src/gram.h (item_number): Renamed from item_number_t.
1462 (rule_number): Renamed from rule_number_t.
1463 (struct rule_s): Remove the "rule_s" part; not used.
1464 (rule): Renamed from rule_t.
1465 (rule_filter): Renamed from rule_filter_t.
1466 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
1467 (goto_list): Renamed from goto_list_t.
1468 * src/lalr.h (goto_number): Renamed from goto_number_t.
1469 * src/location.h (location): Renamed from location_t.
1470 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
1471 and moved here from:
1472 * src/muscle_tab.h (muscle_entry_t): here.
1473 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
1474 (rule_list): Renamed from rule_list_t.
1475 * src/print_graph.c (static_graph): Renamed from graph.
1476 * src/reader.h (braced_code): Renamed from braced_code_t.
1477 Remove brace_code_e tag.
1478 * src/relation.h (relation_node): Renamed from relation_node_t.
1479 (relation_nodes): Renamed from relation_nodes_t.
1480 (relation): Renamed from relation_t.
1481 * src/state.h (state_number): Renamed from state_number_t.
1482 (struct state): Renamed from struct state_s.
1483 (state): Renamed from state_t.
1484 (transitions): Renamed from transitions_t. Unused (and
1485 misspelled) transtion_s tag removed.
1486 (errs): Renamed from errs_t. Unused errs_s tag removed.
1487 (reductions): Renamed from reductions_t. Unused tag
1488 reductions_s removed.
1489 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
1490 (struct symbol_list): Renamed from struct symbol_list_s.
1491 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
1492 (struct symbol): Renamed from struct symbol_s.
1493 (symbol): Renamed from symbol_t.
1494 * src/tables.c (vector_number): Renamed from vector_number_t.
1495 (action_number): Renamed from action_t.
1496 * src/tables.h (base_number): Renamed from base_t.
1497 * src/vcg.h (enum color): Renamed from enum color_e.
1498 (enum textmode): Renamed from enum textmode_e.
1499 (enum shape): Renamed from enum shape_e.
1500 (struct colorentry): Renamed from struct colorentry_s.
1501 (struct classname): Renamed from struct classname_s.
1502 (struct infoname): Renamed from struct infoname_s.
1503 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
1504 (enum decision): Renamed from enum decision_e.
1505 (enum orientation): Renamed from enum orientation_e.
1506 (enum alignment): Renamed from enum alignment_e.
1507 (enum arrow_mode): Renamed from enum arrow_mode_e.
1508 (enum crossing_type): Renamed from enum crossing_type_e.
1509 (enum view): Renamed from enum view_e.
1510 (struct node): Renamed from struct node_s.
1511 (node): Renamed from node_t.
1512 (enum linestyle): Renamed from enum linestyle_e.
1513 (enum arrowstyle): Renamed from enum arrowstyle_e.
1514 (struct edge): Renamed from struct edge.
1515 (edge): Renamed from edge_t.
1516 (struct graph): Renamed from struct graph_s.
1517 (graph): Renamed from graph_t.
1518 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
1519 Rename value_t -> value.
1520 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
1521 value_t_as_yystype -> value_as_yystype.
1523 Don't include <errno.h> in the mainstream code, since it
1524 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
1525 * lib/get-errno.c, lib/get-errno.h: New files.
1526 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
1528 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
1529 * src/output.c (output_skeleton): Likewise.
1530 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
1532 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
1534 (handle_action_dollar, handle_action_at): Likewise.
1535 * src/system.h: Do not include <errno.h>.
1536 (TAB_EXT): Renamed from EXT_TAB.
1537 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
1539 Avoid str[a-z]*, since <string.h> reserves that name space.
1540 Change all instances of "struniq" in names to "uniqstr", and
1541 likewise for "STRUNIQ" and "UNIQSTR".
1542 * src/uniqstr.c: Renamed from src/struniq.c.
1543 * src/uniqstr.h: Renamed from src/struniq.h.
1544 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
1545 * src/files.c (strsuffix): Remove; unused.
1546 (concat2): Renamed from stringappend. Now static.
1547 * src/files.h (strsuffix, stringappend): Remove; unused.
1548 * src/parse-gram.y (<chars>): Renamed from <string>.
1549 (<uniqstr>): Renamed from <struniq>.
1550 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
1551 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
1552 (struct graph_s.expand): Renamed from struct graph_s.stretch.
1553 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
1554 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
1555 (N_EXPAND): Renamed from N_STRETCH.
1557 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
1558 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
1559 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
1561 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
1562 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
1563 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
1564 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
1565 (BASE_MAXIMUM): Renamed from BASE_MAX.
1566 (BASE_MINIMUM): Renamed from BASE_MIN.
1567 (ACTION_MAX): Remove; unused.
1568 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
1569 Unnecessary casts removed from above defines.
1572 Fix misspelling in names.
1573 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
1574 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
1578 * lib/timevar.c (timevar_report): Renamed from time_report,
1579 for consistency with other names.
1580 * lib/timevar.h (timevar_report): New decl.
1581 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
1584 Sort include-file uses.
1586 Reorder all include files under src to be in the order "system.h".
1587 then the ../lib include files in angle brackets (alphabetized),
1588 then the . include files in double-quotes (alphabetized). Fix
1589 dependency breakages encountered in this process, as follows:
1590 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
1591 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
1592 * src/state.h: Include "symtab.h".
1594 2002-12-08 Paul Eggert <eggert@twinsun.com>
1596 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
1597 since this causes problems when __file__ contains character
1598 sequences like "@" that are treated specially by src/scan-skel.l.
1599 Instead, just use the file's basename. This fixes the bug
1600 reported by Martin Mokrejs in
1601 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
1603 2002-12-06 Paul Eggert <eggert@twinsun.com>
1605 Add support for rules that do not have trailing semicolons, as
1606 POSIX requires. Improve the quality of locations in Bison
1609 * src/location.c: Include <quotearg.h>.
1610 (empty_location): Now const.
1611 (location_print): New function. Follow the recommendation of the
1612 GNU Coding Standards for locations that span file boundaries.
1613 * src/location.h: Do not include <quotearg.h>; no longer needed.
1614 (boundary): New type.
1615 (location_t): Use it. This allows locations to span file boundaries.
1616 All member uses changed: file -> start.file or end.file (as needed),
1617 first_line -> start.line, first_column -> start.column,
1618 last_line -> end.line, last_column -> end.column.
1619 (equal_boundaries): New function.
1620 (LOCATION_RESET, LOCATION_STEP): Remove.
1621 (LOCATION_PRINT): Remove. All callers changed to use location_print.
1622 (empty_location): Now const.
1623 (location_print): New decl.
1624 * src/parse-gram.y (lloc_default): New function, which handles
1625 empty locations more accurately.
1626 (YYLLOC_DEFAULT): Use it.
1627 (%token COLON): Remove.
1628 (%token ID_COLON): New token.
1630 (declarations, rules): Remove trailing semicolon.
1631 (declaration, rules_or_grammar_declaration):
1632 Allow empty (";") declaration.
1633 (symbol_def): Remove empty actions; no longer needed.
1634 (rules_or_grammar_declaration): Remove trailing semicolon.
1635 (semi_colon.opt): Remove.
1636 * src/reader.h: Include location.h.
1637 (scanner_cursor): New decl.
1638 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
1640 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
1642 (STEP): Remove. No longer needed, now that adjust_location does
1643 the work. All uses removed.
1644 (scanner_cursor): New var.
1645 (adjust_location): Renamed from extend_location. It now sets
1646 *loc and adjusts the scanner cursor. All uses changed.
1647 Don't bother testing for CR.
1648 (handle_syncline): Remove location arg; now updates scanner cursor.
1649 All callers changed.
1650 (unexpected_end_of_file): Now accepts start boundary of token or
1651 comment, not location. All callers changed. Update scanner cursor,
1653 (SC_AFTER_IDENTIFIER): New state.
1654 (context_state): Renamed from c_context. All uses changed.
1655 (id_loc, code_start, token_start): New local vars.
1656 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
1657 processing of Yacc white space and equivalents here.
1658 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
1659 instead of returning ID immediately, since we need to search for
1661 (<INITIAL>"'", "\""): Save token_start.
1662 (<INITIAL>"%{", "{", "%%"): Save code_start.
1663 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
1664 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
1665 BEGIN context_state at end, not INITIAL.
1666 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
1667 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
1668 Return correct token start.
1669 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
1670 the start of a character, string or multiline comment is found.
1671 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
1672 Reduction): Adjust reported locations to match the more-precise
1673 results now expected.
1674 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
1675 * tests/reduce.at (Useless Rules, Reduced Automaton,
1676 Underivable Rules): Likewise.
1677 * tests/regression.at (Invalid inputs): No longer `expecting ";"
1678 or "|"' now that so many other tokens are allowed by the new grammar.
1680 * src/complain.h (current_file): Remove duplicate decl;
1681 current_file is now owned by files.h.
1682 * src/complain.c, src/scan-gram.l: Include files.h.
1684 2002-12-06 Paul Eggert <eggert@twinsun.com>
1686 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
1687 promotes to int; it might be unsigned int.
1688 * data/yacc.c (yy_reduce_print): Likewise.
1690 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
1691 be #defined in the prologue, not in the Bison declarations.
1692 This fixes Debian Bug 102878, reported by Shaul Karl.
1694 2002-12-02 Paul Eggert <eggert@twinsun.com>
1696 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
1697 * lib/strtoul.c: New file, from gnulib.
1698 This fixes a porting bug reported by Peter Klein in
1699 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
1701 2002-11-30 Paul Eggert <eggert@twinsun.com>
1703 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
1704 and put only a forward declaration in the prologue. This is for
1705 consistency with the other scanner helper functions.
1707 Type clashes now generate warnings, not errors, since it
1708 appears that POSIX may allow some grammars with type clashes.
1709 * src/reader.c (grammar_current_rule_check): Warn about
1710 type clashes instead of complaining.
1711 * tests/input.at (Type Clashes): Expect warnings, not complaints.
1713 Add Yacc library, since POSIX requires it.
1714 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
1715 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
1716 * lib/main.c, lib/yyerror.c: New files.
1718 gram_error can be static; it need not be extern.
1719 * src/reader.h (gram_error): Remove decl.
1720 * src/parse-gram.y (gram_error): Now static. Add static decl.
1721 (print_token_value): Omit parameter names from forward decl,
1724 2002-11-29 Paul Eggert <eggert@twinsun.com>
1726 * doc/bison.texinfo: Emphasize that yylex and yyerror must
1727 be declared before being used. E.g., one should typically
1728 declare them in the prologue. Use GNU coding style in examples.
1729 Put "const" consistently after the type it modifies. Mention
1730 that C99 supports "inline". Mention that yyerror traditionally
1733 %parse-param and %lex-param now take just one argument, the
1734 declaration; the argument name is deduced from the declaration.
1736 * doc/bison.texinfo (Parser Function, Pure Calling, Error
1737 Reporting, Table of Symbols): Document this.
1738 * src/parse-gram.y (add_param): New function.
1740 (declaration): Implement new rule for %parse-param and %lex-param.
1741 * src/scan-gram.l: "," now elicits a warning, rather than being
1742 a token; this is more compatible with byacc.
1743 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
1745 2002-11-27 Paul Eggert <eggert@twinsun.com>
1747 Rename identifiers to avoid real and potential collisions.
1749 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
1750 to avoid collision with lex macro described by Bruce Lilly in
1751 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
1752 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
1753 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
1754 * src/parse-gram.y (print_token_value): Renamed from yyprint.
1756 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
1757 The name "yycontrol" violates the name space rules, and this stuff
1758 wasn't being used anyway.
1759 (input): Remove action; this stuff wasn't being used.
1760 (gram_error): Rename local variable yylloc -> loc.
1761 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
1762 (YY_DECL): Don't use "yy" at start of local variables.
1763 All uses changed, e.g., yylloc -> loc.
1764 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
1765 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
1766 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
1767 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
1769 * src/parse-gram.y (gram_error): loc is now const *.
1770 * src/reader.h (gram_error): Likewise.
1772 2002-11-24 Paul Eggert <eggert@twinsun.com>
1776 * tests/actions.at (Actions after errors): Use an output format
1777 more similar to that of the Printers and Destructors test.
1778 Test the position of the ';' token too.
1779 (Printers and Destructors): Likewise.
1780 (Printers and Destructors: %glr-parser): Remove for now, to avoid
1781 unnecessarily alarming people when the test fails.
1783 * data/yacc.c (yyerrlab1): Move this label down, so that the
1784 parser does not discard the lookahead token if the user code
1785 invokes YYERROR. This change is required for POSIX conformance.
1787 * lib/error.c: Sync with gnulib.
1789 2002-11-22 Paul Eggert <eggert@twinsun.com>
1791 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
1792 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
1793 * lib/xmalloc.c: Likewise.
1795 2002-11-20 Paul Eggert <eggert@twinsun.com>
1797 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
1799 2002-11-20 Paul Eggert <eggert@twinsun.com>
1801 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
1802 should use `if (! x) abort ();' rather than `assert (x);', and
1803 anyway it's one less thing to worry about configuring.
1805 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
1806 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
1807 and replace all instances of assert with abort.
1808 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
1809 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
1811 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
1812 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
1813 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
1814 hash_find_entry, hash_rehash, hash_insert): Likewise.
1815 * src/conflicts.c (resolve_sr_conflict): Likewise.
1816 * src/lalr.c (set_goto_map, map_goto): Likewise.
1817 * src/nullable.c (nullable_compute): Likewise.
1818 * src/output.c (prepare_rules, token_definitions_output): Likewise.
1819 * src/reader.c (packgram, reader): Likewise.
1820 * src/state.c (state_new, state_free, state_transitions_set,
1821 state_reduction_find): Likewise.
1822 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
1823 symbol_pack): Likewise.
1824 * src/tables.c (conflict_row, pack_vector): Likewise.
1825 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
1826 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
1827 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
1828 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
1830 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
1831 (ARGMATCH_CONSTRAINT): New macro.
1832 (ARGMATCH_ASSERT): Use it.
1834 * src/system.h (verify): New macro.
1835 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
1837 * src/tables.c (tables_generate): Likewise.
1839 * src/struniq.c (struniq_assert): Now returns void, and aborts
1840 if the assertion is false.
1841 (struniq_assert_p): Remove.
1842 * src/struniq.h: Likewise.
1844 2002-11-18 Paul Eggert <eggert@twinsun.com>
1846 * data/glr.c (yygetLRActions): Replace `yyindex' with
1847 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
1848 This fixes the regression with Sun ONE Studio 7 cc that I reported in
1849 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
1851 2002-11-18 Akim Demaille <akim@epita.fr>
1853 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
1855 From Tim Van Holder.
1857 2002-11-17 Paul Eggert <eggert@twinsun.com>
1859 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
1860 to "SyntaxError" for consistency with my 2002-11-15 change.
1862 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
1863 not define to {}, since this breaks the common use of `YYDPRINTF
1864 ((...));' if a single statement is desired (e.g. before `else').
1865 Work around GCC warnings by surrounding corresponding calls with
1867 (yyhasResolvedValue): Remove unused function.
1868 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
1870 (yyreportSyntaxError): Renamed from yyreportParseError.
1871 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
1873 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
1874 extern when possible. Remove unused initializations.
1876 2002-11-16 Akim Demaille <akim@epita.fr>
1878 Augment the similarity between GLR and LALR traces.
1880 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
1881 (YY_REDUCE_PRINT): New.
1882 (yyparse): Use them.
1883 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
1885 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
1886 state reached after the reduction/recovery, since...
1887 (yyparse, yyprocessOneStack): Report the state we are entering in.
1889 2002-11-16 Akim Demaille <akim@epita.fr>
1891 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
1892 Add support for --trace=skeleton.
1893 * src/scan-skel.l: %option debug.
1894 Scan strings of non-@ or \n instead of character by character.
1895 (scan_skel): Handle trace_skeleton.
1897 (@output_parser_name@, @output_header_name@): ``Restore'' their
1898 support (used to be M4 macros).
1899 * data/yacc.c: Quote larger chunks, a la glr.c.
1900 * data/lalr1.cc: Likewise.
1901 The header guards are no longer available, so use some other
1902 string than `YYLSP_NEEDED'.
1904 2002-11-16 Akim Demaille <akim@epita.fr>
1906 Make the ``Printers and Destructors'' test more verbose, taking
1907 `yacc.c''s behavior as (possibly wrong) reference.
1909 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
1910 instead of fprint on stdout.
1911 Set and report the last_line of the symbols.
1912 Consistently display values and locations.
1914 2002-11-16 Paul Eggert <eggert@twinsun.com>
1916 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
1918 2002-11-15 Paul Eggert <eggert@twinsun.com>
1920 * tests/actions.at (Actions after errors): New test case.
1922 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
1923 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
1924 tests/action.at, tests/calc.at, tests/conflicts.at,
1925 tests/cxx-type.at, tests/regression.at:
1926 "parse error" -> "syntax error" for POSIX compatibility.
1927 "parsing stack overflow..." -> "parser stack overflow" so
1928 that code matches Bison documentation.
1930 2002-11-15 Akim Demaille <akim@epita.fr>
1932 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
1933 take two BRACED_CODE, not two string_content.
1934 Free the scanner's obstack when we are done.
1935 (code_content): New.
1936 * tests/calc.at: Adjust.
1937 * doc/bison.texinfo: Adjust.
1938 Also, make sure to include the `,' for these declarations.
1940 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
1942 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
1943 definition; avoids potential autoreconf problems.
1945 2002-11-15 Akim Demaille <akim@epita.fr>
1947 Always check the value returned by yyparse.
1949 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
1950 returned by yyparse.
1951 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
1953 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
1954 returned by yyparse.
1956 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1958 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
1961 2002-11-14 Paul Eggert <eggert@twinsun.com>
1963 * src/output.c (output_skeleton): Call xfopen instead of
1964 duplicating xfopen's body.
1966 Fix bugs reported by Nelson H. F. Beebe in
1967 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
1969 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
1970 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
1971 Group compiler. Instead, use "$CC -E bar.c". Include the .h
1972 file twice in the grammar, as an extra check.
1974 * tests/input.at (Torturing the Scanner): Surround the
1975 backslash-newline tests with "#if 0", to make it less likely that
1976 we'll run into compiler bugs. Bring back solitary \ inside
1977 comment, but add a closing comment to work around HP C bug. Don't
1978 test backslash-newline in C character constant.
1980 2002-11-14 Akim Demaille <akim@epita.fr>
1982 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
1983 status of the compiler.
1984 Calling `exit 1' is no longer needed.
1985 Reported by Nelson H. F. Beebe.
1987 2002-11-14 Akim Demaille <akim@epita.fr>
1989 * tests/atlocal.in (CPPFLAGS): We have config.h.
1990 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
1992 * tests/actions.at, tests/calc.at, tests/conflicts.at,
1993 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
1994 * tests/regression.at, tests/torture.at: Use them for all the
1995 grammars that are to be compiled.
1996 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
1997 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
1998 * doc/bison.texinfo (GLR Parsers): Document `inline'.
2000 2002-11-14 Akim Demaille <akim@epita.fr>
2002 * doc/bison.texinfo: Various formatting changes (alignments in
2003 samples, additional @group/@end group, GCS in samples.
2004 Use @deffn instead of simple @table to define the directives,
2005 macros, variables etc.
2007 2002-11-13 Paul Eggert <eggert@twinsun.com>
2009 Fix some bugs reported by Albert Chin-A-Young in
2010 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
2012 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
2013 -o c"; the HP C compiler chatters during compilation.
2014 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
2015 * tests/headers.at (export YYLTYPE): Likewise.
2017 * tests/input.at (Torturing the Scanner): Remove lines containing
2018 solitary backslashes, as they tickle a bug in the HP C compiler.
2020 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
2021 comments, since they're not portable. Use GNU coding style.
2023 2002-11-13 Akim Demaille <akim@epita.fr>
2025 * data/yacc.c: Leave bigger chunks of quoted text.
2026 (YYDSYMPRINTF): New.
2027 Use it to report symbol activities.
2028 * data/glr.c (YYDSYMPRINTF): New.
2031 2002-11-12 Paul Eggert <eggert@twinsun.com>
2035 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
2036 (yyglrReduce): Return yyok, not 0.
2037 This should avoid the enumerated-type warnings reported
2038 by Nelson H. F. Beebe in
2039 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
2041 * lib/bbitset.h (BITSET_INLINE): Remove.
2042 * lib/bitset.h [! BITSET_INLINE]: Remove.
2043 (bitset_set, bitset_reset, bitset_test): Rename local vars
2044 to avoid shadowing warnings by GCC.
2046 * data/glr.c (inline): Remove #define. It's the user's
2047 responsibility to #define it away, just like 'const'.
2048 This fixes one of the bugs reported by Nelson H. F. Beebe in
2049 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
2051 * Makefile.maint (po-check): Scan .l and .y files instead of the
2052 .c and the .h files that they generate. This fixes the bug
2053 reported by Tim Van Holder in:
2054 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
2055 Look for N_ as well as for _. Try to avoid matching #define for
2057 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
2058 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
2059 * src/scan-gram.l: Revamp regular expressions so that " and '
2060 do not confuse xgettext.
2062 * src/struniq.h (struniq_new): Do not declare the return type
2063 to be 'const'; this violates the C standard.
2064 * src/struniq.c (struniq_new): Likewise.
2066 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
2068 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
2069 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
2072 2002-11-12 Akim Demaille <akim@epita.fr>
2074 * Makefile.maint: Sync with Autoconf:
2075 (local_updates): New.
2077 2002-11-12 Akim Demaille <akim@epita.fr>
2079 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
2081 2002-11-12 Akim Demaille <akim@epita.fr>
2083 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
2086 2002-11-12 Akim Demaille <akim@epita.fr>
2088 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
2091 2002-11-12 Akim Demaille <akim@epita.fr>
2093 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
2094 Use it to test the GLR parser.
2096 2002-11-12 Akim Demaille <akim@epita.fr>
2098 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
2100 * data/glr.c (yystos): New.
2101 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
2103 (yyval): Don't define it, it is handled via M4.
2104 (yyrecoverParseError): Free verbosely the discarded symbols.
2105 * data/yacc.c (yysymprint): Remove, rather...
2106 (b4_yysymprint_generate): invoke.
2107 * data/c.m4 (b4_yysymprint_generate): New.
2108 Accept pointers as arguments, as opposed to the version from
2110 (b4_yydestruct_generate): Likewise.
2111 * tests/cations.at (Printers and Destructors): Use Bison directives
2112 instead of CPP macros.
2113 Don't rely on internal details.
2115 2002-11-12 Akim Demaille <akim@epita.fr>
2117 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
2118 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
2119 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
2120 it against YYEMPTY and so forth), work on yytoken (i.e., set
2121 it to YYEMPTY etc.).
2122 (yydestruct): Replace with a b4_yydestruct_generate invocation.
2123 (b4_symbol_actions): Remove.
2124 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
2125 for 0, end-of-input.
2127 2002-11-12 Akim Demaille <akim@epita.fr>
2129 * doc/bison.texinfo (Destructor Decl): New.
2131 2002-11-12 Akim Demaille <akim@epita.fr>
2133 * src/tables.c (tables_generate): Use free for pointers that
2134 cannot be NULL, not XFREE.
2135 (pack_vector): Use assert, not fatal, for bound violations.
2136 * src/state.c (state_new): Likewise.
2137 * src/reader.c (reader): Likewise.
2138 * src/lalr.c (set_goto_map): Likewise.
2139 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
2142 2002-11-12 Akim Demaille <akim@epita.fr>
2144 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
2146 * src/scan-gram.l (last_string): Is global to the file, not to
2148 * src/parse-gram.y (input): Don't append the epilogue here,
2149 (epilogue.opt): do it here, and free the scanner's obstack.
2150 * src/reader.c (epilogue_set): Rename as...
2151 (epilogue_augment): this.
2152 * data/c.m4 (b4_epilogue): Defaults to empty.
2154 2002-11-12 Akim Demaille <akim@epita.fr>
2156 * src/getargs.c (long_options): Remove duplicates.
2157 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
2159 * doc/bison.rnh: Remove.
2160 * doc/bison.texinfo (VMS Invocation): Remove.
2162 2002-11-12 Akim Demaille <akim@epita.fr>
2164 * src/struniq.h, src/struniq.c (struniq_t): Is const.
2165 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
2167 Use struniq for symbols.
2169 * src/symtab.h (symbol_t): The tag member is a struniq.
2170 (symbol_type_set): Adjust.
2171 * src/symtab.c (symbol_new): Takes a struniq.
2172 (symbol_free): Don't free the tag member.
2173 (hash_compare_symbol_t, hash_symbol_t): Rename as...
2174 (hash_compare_symbol, hash_symbol): these.
2175 Use the fact that tags as struniqs.
2176 (symbol_get): Use struniq_new.
2177 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
2179 * src/reader.h (merger_list, grammar_currentmerge_set): The name
2180 and type members are struniqs.
2181 * src/reader.c (get_merge_function)
2182 (grammar_current_rule_merge_set): Adjust.
2183 (TYPE, current_type): Are struniq.
2185 Use struniq for file names.
2187 * src/files.h, src/files.c (infile): Split into...
2188 (grammar_file, current_file): these.
2189 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
2190 * src/reduce.c (reduce_print): Likewise.
2191 * src/getargs.c (getargs): Likewise.
2192 * src/complain.h, src/complain.c: Likewise.
2193 * src/main.c (main): Call struniqs_new early enough to use it for
2195 Don't free the input file name.
2197 2002-11-12 Akim Demaille <akim@epita.fr>
2199 * src/symtab.c (symbol_free): Remove dead deactivated code:
2200 type_name are properly removed.
2201 Don't use XFREE to free items that cannot be NULL.
2202 * src/struniq.h, src/struniq.c: New.
2203 * src/main.c (main): Initialize/free struniqs.
2204 * src/parse-gram.y (%union): Add astruniq member.
2206 * src/scan-gram.l (<{tag}>): Return a struniq.
2207 Free the obstack bit that used to store it.
2208 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
2210 2002-11-11 Paul Eggert <eggert@twinsun.com>
2212 Revamp to fix many (but not all) of the C- and M4-related quoting
2213 problems. Among other things, this fixes the Bison bug reported
2214 by Jan Hubicka when processing the Bash grammar; see:
2215 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
2217 Use new @ escapes consistently. Represent brackets with @{ and @}
2218 rather than @<:@ and @:>@, since this works a bit better with dumb
2219 editors like vi. Represent @ with @@, since @ is now consistently
2220 an escape. Use @oline@ and @ofile@ rather than __oline__ and
2221 __ofile__, to avoid unexpected expansions. Similarly, use @output
2222 rather than #output.
2224 * data/c.m4 (b4_copyright): Omit file name from comment, since
2225 the file name could contain "*/".
2226 (b4_synclines_flag): Don't quote the 2nd argument; it should already
2227 be quoted. All uses changed.
2229 * data/glr.c: Use new @ escapes consistently.
2230 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
2231 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
2232 Remove, since they couldn't handle arbitrary characters in file
2234 * data/lalr1.cc: Likewise.
2235 * data/yacc.c: Likewise.
2237 * src/files.c (output_infix): Remove; all uses removed.
2238 * src/files.h: Likewise.
2240 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
2241 mishandled funny characters in file names, and anyway it isn't
2243 * data/yacc.c: Likewise.
2244 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
2246 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
2247 * data/yacc.c: Likewise.
2249 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
2251 (muscle_init): Quote filename as a C string.
2252 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
2253 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
2254 * src/output.c (escaped_file_name_output): New function.
2255 (prepare_symbols): Quote tokens for M4.
2256 (prepare): Don't insert output_infix, output_prefix,
2257 output_parser_name, output_header_name; this is now down by scan-skel.
2258 Insert skeleton as a C string.
2260 * src/output.c (user_actions_output, symbol_destructors_output,
2261 symbol_printers_output): Quote filenames for C and M4.
2262 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2264 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
2265 escapes other than \\ and \'; this simplifies the code.
2266 (<SC_STRING>): Likewise, for \\ and \".
2267 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
2268 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
2269 Use new escapes @{ and @} for [ and ].
2271 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
2272 them with auto vars.
2273 Switch to new escape scheme, where @ is the escape character uniformly.
2274 Abort if a stray escape character is found. Avoid unbounded input
2275 buffer when parsing non-escaped text.
2277 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
2278 __oline__, #output, $@, and @{ do not have unintended meanings.
2280 2002-11-09 Paul Eggert <eggert@twinsun.com>
2282 Fix the test failure due to GCC warnings described in
2283 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
2284 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
2285 evaluate to 0 if it's impossible for NINF to be in the respective
2287 (yygetLRActions, yyrecoverParseError): Use them.
2289 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
2290 counted in the token inserted at end of file. Now takes
2291 location_t *, not location_t, so that the location can be
2292 adjusted. All uses changed.
2294 * tests/regression.at (Invalid inputs): Adjust wording in
2295 diagnostic to match the new behavior.
2297 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
2298 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
2299 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
2300 abort ();'. This reduces the runtime of the "Many lookaheads"
2301 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
2304 2002-11-07 Paul Eggert <eggert@twinsun.com>
2306 * src/parse-gram.y (CHARACTER): Remove unused token.
2309 * src/scan-gram.l: Remove stack option. We no longer use the
2310 stack, since the stack was never deeper than 1; instead, use the
2311 new auto var c_context to record the stacked value.
2313 Remove nounput option. At an unexpected end of file, we now unput
2314 the minimal input necessary to end cleanly; this simplifies the
2317 Avoid unbounded token sizes where this is easy.
2319 (unexpected_end_of_file): New function.
2320 Use it to systematize the error message on unexpected EOF.
2321 (last-string): Now auto, not static.
2322 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
2323 (scanner_last_string_free): Remove; not used.
2324 (percent_percent_count): Move decl to just before use.
2325 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
2326 not the (never otherwised-used) CHARACTER.
2328 2002-11-07 Akim Demaille <akim@epita.fr>
2330 Let yyerror always receive the msg as last argument, so that
2331 yyerror can be variadic.
2333 * data/yacc.c (b4_yyerror_args): New.
2334 Use it when calling yyerror.
2335 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
2336 Use it when calling yyerror.
2337 * doc/bison.texinfo (Error Reporting): Adjust.
2338 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
2339 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
2341 2002-11-06 Akim Demaille <akim@epita.fr>
2343 #line should have quoted strings.
2344 Ideally, this should be done by m4_quotearg.
2346 * src/scan-skel.l: Include quotearg.h.
2348 * src/output.c (symbol_printers_output)
2349 (symbol_destructors_output): Quote the file name.
2351 2002-11-06 Akim Demaille <akim@epita.fr>
2353 * tests/regression.at (Invalid inputs): Adjust to the recent
2356 2002-11-06 Akim Demaille <akim@epita.fr>
2359 Reported by Jim Kent.
2361 * data/c.m4 (b4_syncline): New.
2362 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
2363 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
2364 * src/output.c (user_actions_output): Likewise.
2365 (prepare): Define 'b4_synclines_flag'.
2366 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
2368 2002-11-06 Akim Demaille <akim@epita.fr>
2370 * src/main.c (main): Free `infile'.
2371 * src/scan-gram.l (handle_syncline): New.
2373 * src/output.c (user_actions_output, symbol_destructors_output)
2374 (symbol_printers_output): Use the location's file name, not
2376 * src/reader.c (prologue_augment, epilogue_set): Likewise.
2378 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2380 * src/tables.c (matching_state): Don't allow states to match if
2381 either has GLR conflict entries.
2383 2002-11-05 Paul Eggert <eggert@twinsun.com>
2385 * src/scan-gram.l: Use more accurate diagnostics, e.g.
2386 "integer out of range" rather than "invalid value".
2387 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
2390 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
2391 Also, remove one static variable in the scanner.
2393 * src/scan-gram.l (braces_level): Now auto, not static.
2394 Initialize to zero if the compiler is being picky.
2395 (INITIAL): Clear braces_level instead of incrementing it.
2396 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
2397 as POSIX 1003.1-2001 requires.
2398 * src/system.h (IF_LINT): New macro, taken from coreutils.
2399 * configure.ac: Define "lint" if --enable-gcc-warnings.
2401 2002-11-05 Akim Demaille <akim@epita.fr>
2403 * src/scan-gram.l: When it starts with `%', complain about the
2404 whole directive, not just that `invalid character: %'.
2406 2002-11-04 Akim Demaille <akim@epita.fr>
2408 * Makefile.maint: Update from Autoconf.
2409 (update, cvs-update, po-update, do-po-update): New.
2411 2002-11-04 Akim Demaille <akim@epita.fr>
2413 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
2415 Have yyerror `use' its arguments.
2416 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
2417 returns true when location & yacc & pure & parse-param.
2418 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
2420 2002-11-04 Akim Demaille <akim@epita.fr>
2422 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
2424 * src/scan-gram.l: Use [\'] instead of ['] to pacify
2427 Use quote, not quote_n since LOCATION_PRINT no longer uses the
2430 2002-11-03 Paul Eggert <eggert@twinsun.com>
2432 * src/reader.c (get_merge_function, grammar_current_rule_check):
2433 Use consistent diagnostics for reporting type name clashes.
2434 Quote the types with <>, for consistency with Yacc.
2435 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
2437 2002-11-03 Akim Demaille <akim@epita.fr>
2439 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
2441 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
2442 (b4_parse_param): Remove.
2443 Use b4_identification.
2444 Propagate b4_pure_args where needed to pass them to yyerror.
2445 * data/glr.m4 (b4_parse_param): Remove.
2446 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
2447 (b4_lpure_formals): New.
2448 Use b4_identification.
2449 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
2450 b4_user_formals and b4_user_args.
2451 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
2452 (yyreportAmbiguity): When using a pure parser, also need
2453 the location, and the parse-params.
2455 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
2456 When using a pure parser, also need the parse-params.
2458 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
2459 (%pure-parser + %parse-param) LALR and GLR parsers.
2460 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
2461 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
2462 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
2463 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
2464 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
2465 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
2466 * doc/bison.texinfo: Untabify the whole file.
2467 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
2468 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
2469 (Error Reporting): Adjust to these new directives.
2470 Document %error-verbose, deprecate YYERROR_VERBOSE.
2472 2002-11-03 Akim Demaille <akim@epita.fr>
2474 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
2475 AT_CHECK_CALC_GLR invocations to use % directives, instead of
2476 command line options.
2477 * tests/cxx-type.at: Formatting changes.
2479 2002-11-03 Paul Eggert <eggert@twinsun.com>
2481 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
2482 to count columns correctly, and to check for invalid inputs.
2484 Use mbsnwidth to count columns correctly. Account for tabs, too.
2486 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
2487 (extend_location): New function.
2490 Handle CRLF in C code rather than in Lex code.
2491 (YY_INPUT): New macro.
2492 (no_cr_read): New function.
2494 Scan UCNs, even though we don't fully handle them yet.
2495 (convert_ucn_to_byte): New function.
2497 Handle backslash-newline correctly in C code.
2498 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
2499 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
2501 (tag, splice): New EREs. Do not allow NUL or newline in tags.
2502 Use {splice} wherever C allows backslash-newline.
2503 YY_STEP after space, newline, vertical-tab.
2504 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
2506 (letter, id): Don't assume ASCII; e.g., spell out a-z.
2508 ({int}, handle_action_dollar, handle_action_at): Check for integer
2511 (YY_STEP): Omit trailing semicolon, so that it's more like C.
2513 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
2514 as well as \000. Check for UCHAR_MAX, not 255.
2515 Allow \x with an arbitrary positive number of digits, as in C.
2516 Check for overflow here.
2517 Allow \? and UCNs, for compatibility with C.
2519 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
2520 with quote slot used by complain_at.
2522 * tests/input.at: Add tests for backslash-newline, m4 quotes
2523 in symbols, long literals, and funny escapes in strings.
2525 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
2526 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
2527 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
2528 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
2529 * m4/mbswidth.m4: New file, from GNU coreutils.
2531 * doc/bison.texinfo (Grammar Outline): Document // comments.
2532 (Symbols): Document that trigraphs have no special meaning in Bison,
2533 nor is backslash-newline allowed.
2534 (Actions): Document that trigraphs have no special meaning.
2536 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
2539 2002-11-02 Paul Eggert <eggert@twinsun.com>
2541 * src/reader.c: Don't include quote.h; not needed.
2542 (get_merge_function): Reword warning to be consistent with
2543 type clash diagnostic in grammar_current_rule_check.
2545 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
2546 bug in trigraph handling.
2548 * src/output.c (prepare_symbols): When printing token names,
2549 escape "[" as "@<:@" and likewise for "]".
2551 * src/system.h (errno): Remove declaration, as we are now
2552 assuming C89 or better, and C89 guarantees errno.
2554 2002-10-30 Paul Eggert <eggert@twinsun.com>
2556 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
2557 Check for close failures.
2558 * src/files.h (xfclose): Return void, not int, since it always
2560 * src/files.c (xfclose): Likewise. Report I/O error if ferror
2562 * src/output.c (output_skeleton): Use xfclose rather than fclose
2563 and ferror. xfclose now checks ferror.
2565 * data/glr.c (YYLEFTMOST_STATE): Remove.
2566 (yyreportTree): Use a stack-based leftmost state. This avoids
2567 our continuing battles with bogus warnings about initializers.
2569 2002-10-30 Akim Demaille <akim@epita.fr>
2571 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
2574 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2576 * tests/glr-regr1.at: New test for reported regressions.
2577 * tests/testsuite.at: Add glr-regr1.at test.
2578 * tests/Makefile.am: Add glr-regr1.at test.
2580 2002-10-24 Paul Eggert <eggert@twinsun.com>
2584 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
2585 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
2586 we use malloc. Don't assume 'A' through 'Z' are contiguous.
2587 Don't assume strdup exists; POSIX says its an XSI extension.
2588 Check for buffer overflow on input.
2590 2002-10-24 Akim Demaille <akim@epita.fr>
2592 * src/output.c (output_skeleton): Don't disable M4sugar comments
2593 too soon: it results in comments being expanded.
2594 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
2597 2002-10-24 Akim Demaille <akim@epita.fr>
2599 * data/yacc.c (m4_int_type): New.
2600 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
2601 char' as only yacc.c wants K&R portability.
2602 * data/glr.c (yysigned_char): Remove.
2603 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
2604 Reported by Quoc Peyrot.
2606 2002-10-23 Paul Eggert <eggert@twinsun.com>
2608 * src/main.c (main): With --trace=time, report times even if a
2609 non-fatal error occurs. Formerly, the times were reported in some
2610 such cases but not in others.
2611 * src/reader.c (reader): Just return if a complaint has been issued,
2612 instead of exiting, so that 'main' can report times.
2614 2002-10-22 Akim Demaille <akim@epita.fr>
2616 * src/system.h: Include sys/types.
2617 Reported by Bert Deknuydt.
2619 2002-10-23 Paul Eggert <eggert@twinsun.com>
2621 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
2622 Suggested by Art Haas.
2624 2002-10-22 Paul Eggert <eggert@twinsun.com>
2626 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
2627 decl; not needed any more.
2628 * src/main.c (main): Use return to exit, undoing yesterday's change.
2629 The last OS that we could find where this wouldn't work is
2630 SunOS 3.5, and that's too old to worry about now.
2632 * data/glr.c (struct yyltype): Define members even when not
2633 doing locations. This is more consistent with yacc.c, and it
2634 works around the following bug reports:
2635 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
2636 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
2638 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
2639 @acronym consistently. Standardize on "Yacc" instead of "YACC",
2640 "Algol" instead of "ALGOL". Give a bit more history about BNF.
2642 2002-10-22 Akim Demaille <akim@epita.fr>
2646 2002-10-21 Paul Eggert <eggert@twinsun.com>
2648 Be consistent about 'bool'; the old code used an enum in one
2649 module and an int in another, and this violates the C standard.
2650 * m4/stdbool.m4: New file, from coreutils 4.5.3.
2651 * configure.ac (AC_HEADER_STDBOOL): Add.
2652 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
2653 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
2654 * src/symtab.c (hash_compare_symbol_t): Likewise.
2655 * src/system.h (bool, false, true): Use a definition consistent
2656 with ../lib/hash.c. All uses changed.
2658 * src/complain.c (warning_issued): Renamed from warn_message_count,
2659 so that we needn't worry about integer overflow (!).
2660 Now of type bool. All uses changed.
2661 (complaint_issued): Renamed from complain_message_count; likewise.
2663 * src/main.c (main): Use exit to exit with failure.
2665 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
2666 rather than 1 and 0.
2667 * src/main.c (main): Likewise.
2668 * src/getargs.c (getargs): Likewise.
2669 * src/reader.c (reader): Likewise.
2671 * src/getarg.c (getargs): Remove duplicate code for
2672 "Try `bison --help'".
2674 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
2675 What was that "2" for?
2677 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
2678 * src/getargs.c (usage): Likewise.
2680 * src/getargs.c (getargs): When there are too few operands, report
2681 the last one. When there are too many, report the first extra
2682 one. This is how diffutils does it.
2684 2002-10-20 Paul Eggert <eggert@twinsun.com>
2686 Remove K&R vestiges.
2687 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
2688 * src/complain.c (VA_START): Remove. Assume prototypes.
2689 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
2690 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
2691 fatal): Assume prototypes.
2692 * src/complain.h: Assume prototypes.
2693 * src/system.h (PARAMS): Remove.
2694 Include <limits.h> unconditionally, since it's guaranteeed even
2695 for a freestanding C89 compiler.
2696 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
2697 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
2699 2002-10-20 Akim Demaille <akim@epita.fr>
2701 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
2702 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
2703 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
2704 (yyresolveStates, yyresolveAction, yyresolveStack)
2705 (yyprocessOneStack): Use them.
2706 (yy_reduce_print): New.
2707 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
2709 2002-10-20 Akim Demaille <akim@epita.fr>
2711 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
2712 arguments and output `void'.
2713 (b4_c_function): Rename as...
2714 (b4_c_function_def): this.
2715 (b4_c_function_decl, b4_c_ansi_function_def)
2716 (b4_c_ansi_function_decl): New.
2717 Change the interpretation of the arguments: before `int, foo', now
2719 * data/yacc.c (yyparse): Prototype and define thanks to these.
2720 Adjust b4_c_function_def uses.
2721 * data/glr.c (yyparse): Likewise, but ANSI only.
2723 2002-10-20 Akim Demaille <akim@epita.fr>
2725 * src/output.c (prepare): Move the definition of `tokens_number',
2726 `nterms_number', `undef_token_number', `user_token_number_max'
2728 (prepare_tokens): Here.
2729 (prepare_tokens): Rename as...
2730 (prepare_symbols): this.
2731 (prepare): Move the definition of `rules_number' to...
2732 (prepare_rules): here.
2733 (prepare): Move the definition of `last', `final_state_number',
2734 `states_number' to...
2735 (prepare_states): here.
2736 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
2738 2002-10-20 Akim Demaille <akim@epita.fr>
2740 * src/tables.h, src/tables.c, src/output.c: Comment changes.
2742 2002-10-20 Akim Demaille <akim@epita.fr>
2744 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
2747 2002-10-20 Akim Demaille <akim@epita.fr>
2749 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
2750 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
2752 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
2754 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
2755 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
2758 2002-10-19 Paul Eggert <eggert@twinsun.com>
2760 Do not create a temporary file, as that involves security and
2761 cleanup headaches. Instead, use a pair of pipes.
2762 Derived from a suggestion by Florian Krohm.
2763 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
2764 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
2765 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
2766 (BISON_PREREQ_SUBPIPE): Add.
2767 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
2768 Add subpipe.h, subpipe.c.
2769 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
2770 * po/POTFILES.in: Add lib/subpipe.c.
2771 * src/output.c: Include "subpipe.h".
2772 (m4_invoke): Remove decl.
2773 (scan_skel): New decl.
2774 (output_skeleton): Use pipe rather than temporary file for m4 input.
2775 Check that m4sugar.m4 is readable, to avoid deadlock.
2776 Check for pipe I/O error.
2777 * src/scan-skel.l (readpipe): Remove decl.
2778 (scan_skel): New function, to be used in place of m4_invoke.
2779 Read from stream rather than file.
2781 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
2782 float, as this generates a warning on Solaris 8 + GCC 3.2 with
2783 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
2784 this generates a more-accurate value anyway.
2786 * lib/timevar.c (timervar_accumulate): Rename locals to
2787 avoid confusion with similarly-named more-global.
2788 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
2790 * src/output.c (prepare): Use xstrdup to convert char const *
2791 to char *, to avoid GCC warning.
2793 2002-10-19 Akim Demaille <akim@epita.fr>
2795 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
2796 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
2797 Use them to have `calc.y' ready for %pure-parser.
2798 * data/yacc.c (YYLEX): Pass a yylex return type to
2801 2002-10-19 Akim Demaille <akim@epita.fr>
2803 Prototype support of %lex-param and %parse-param.
2805 * src/parse-gram.y: Add the definition of the %lex-param and
2806 %parse-param tokens, plus their rules.
2807 Drop the `_' version of %glr-parser.
2809 * src/scan-gram.l (INITIAL): Scan them.
2810 * src/muscle_tab.c: Comment changes.
2811 (muscle_insert, muscle_find): Rename `pair' as `probe'.
2812 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
2813 (muscle_entry_s): The `value' member is no longer const.
2814 Adjust all dependencies.
2815 * src/muscle_tab.c (muscle_init): Adjust: use
2816 MUSCLE_INSERT_STRING.
2817 Initialize the obstack earlier.
2818 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
2819 (muscle_pair_list_grow): New.
2820 * data/c.m4 (b4_c_function_call, b4_c_args): New.
2821 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
2822 * tests/calc.at: Use %locations, not --locations.
2823 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
2825 2002-10-19 Akim Demaille <akim@epita.fr>
2827 * src/getargs.c (usage): Take status as argument and exit
2829 Report the traditional `Try ... --help' message when status != 0.
2830 (usage, version): Don't take a FILE * as arg, it is pointless.
2831 (getargs): When there is an incorrect number of arguments, make it
2832 an error, and report it GNUlically thanks to `usage ()'.
2834 2002-10-18 Paul Eggert <eggert@twinsun.com>
2836 * data/glr.c (yyreportParseError): Don't assume that sprintf
2837 yields the length of the printed string, as this is not true
2838 on SunOS 4.1.4. Reported by Peter Klein.
2840 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
2841 * tests/conflicts.at (%nonassoc and eof): Likewise.
2842 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
2844 2002-10-17 Akim Demaille <akim@epita.fr>
2846 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
2847 * src/getargs.c (trace_types, trace_args): Adjust.
2848 * src/reader.c (grammar_current_rule_prec_set)
2849 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
2850 Standardize error messages.
2852 (reader): Use trace_flag to enable scanner/parser debugging,
2853 instead of an adhoc scheme.
2854 * src/scan-gram.l: Remove trailing debugging code.
2856 2002-10-16 Paul Eggert <eggert@twinsun.com>
2858 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
2861 * NEWS: Officially drop support for building Bison with K&R C,
2862 since it didn't work anyway and it's not worth worrying about.
2863 * Makefile.maint (wget_files): Remove ansi2knr.c.
2864 (ansi2knr.c-url_prefix): Remove.
2865 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
2866 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2867 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
2869 2002-10-15 Paul Eggert <eggert@twinsun.com>
2871 Stop using the "enum_" trick for K&R-style function definitions;
2872 it confused me, and I was the author! Instead, assume that people
2873 who want to use K&R C compilers (when using these modules in GCC,
2874 perhaps?) will run ansi2knr.
2876 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
2877 All uses of "enum_" changed to "enum ".
2878 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
2879 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
2881 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
2882 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
2883 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
2884 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
2885 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
2886 abitset_not, abitset_ones, abitset_or, abitset_or_and,
2887 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
2888 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
2889 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
2890 Use function prototypes; this removes the need for declaring
2891 static functions simply to provide their prototypes.
2892 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
2893 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
2894 bitset_count_, bitset_create, bitset_dump, bitset_first,
2895 bitset_free, bitset_init, bitset_last, bitset_next,
2896 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
2897 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
2898 bitset_print, bitset_release_memory, bitset_toggle_,
2899 bitset_type_choose, bitset_type_get, bitset_type_name_get,
2900 debug_bitset): Likewise.
2901 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
2902 * lib/bitset_stats.c (bitset_log_histogram_print,
2903 bitset_percent_histogram_print, bitset_stats_and,
2904 bitset_stats_and_cmp, bitset_stats_and_or,
2905 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
2906 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
2907 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
2908 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
2909 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
2910 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
2911 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
2912 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
2913 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
2914 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
2915 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
2916 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
2917 bitset_stats_zero): Likewise.
2918 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
2919 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
2920 bitsetv_dump, debug_bitsetv): Likewise.
2921 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
2922 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
2923 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
2924 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
2925 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
2926 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
2927 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
2928 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
2929 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
2930 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
2931 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
2933 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
2934 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
2935 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
2936 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
2937 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
2938 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
2939 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
2940 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
2941 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
2942 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
2943 lbitset_xor_cmp, lbitset_zero): Likewise.
2945 2002-10-14 Akim Demaille <akim@epita.fr>
2949 2002-10-14 Akim Demaille <akim@epita.fr>
2951 * tests/Makefile.am (maintainer-check-posix): New.
2953 2002-10-14 Akim Demaille <akim@epita.fr>
2955 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
2958 2002-10-14 Akim Demaille <akim@epita.fr>
2960 * src/tables.c (table_ninf_remap): base -> tab.
2961 Reported by Matt Rosing.
2963 2002-10-14 Paul Eggert <eggert@twinsun.com>
2965 * tests/action.at, tests/calc.at, tests/conflicts.at,
2966 tests/cxx-type.at, tests/headers.at, tests/input.at,
2967 tests/regression.at, tests/synclines.at, tests/torture.at:
2968 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
2969 so that the tests still work even if POSIXLY_CORRECT is set.
2970 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
2972 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
2973 for portability to K&R hosts. Fix typo: signed char is guaranteed
2974 only to 127, not to 128.
2975 * data/glr.c (yysigned_char): New type.
2976 * data/yacc.c (yysigned_char): Likewise.
2977 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
2979 2002-10-13 Paul Eggert <eggert@twinsun.com>
2981 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
2982 true due to limited range of data type" warning from GCC.
2984 * data/c.m4 (b4_token_defines): Protect against double-inclusion
2985 by wrapping enum yytokentype's definition inside #ifndef
2986 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
2988 2002-10-13 Akim Demaille <akim@epita.fr>
2990 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
2991 Un yy- yyrhs to avoid the name clash with the global YYRHS.
2993 2002-10-13 Akim Demaille <akim@epita.fr>
2995 * Makefile.maint: Update from Autoconf 2.54.
2996 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
2998 2002-10-13 Akim Demaille <akim@epita.fr>
3000 * src/print.c (print_state): Separate the list of solved conflicts
3001 from the other items.
3002 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
3004 2002-10-13 Akim Demaille <akim@epita.fr>
3006 Let nondeterministic skeletons be usable with deterministic
3009 With the patch, GAWK compiled by GCC without -O2 passes its test
3010 suite using a GLR parser driven by LALR tables. It fails with -O2
3011 because `struct stat' gives two different answers on my machine:
3012 88 (definition of an auto var) and later 96 (memset on this var).
3013 Hence the stack is badly corrumpted. The headers inclusion is to
3014 blame: if I move the awk.h inclusion before GLR's system header
3015 inclusion, the two struct stat have the same size.
3017 * src/tables.c (pack_table): Always create conflict_table.
3018 (token_actions): Always create conflict_list.
3019 * data/glr.c (YYFLAG): Remove, unused.
3021 2002-10-13 Akim Demaille <akim@epita.fr>
3023 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
3025 (VALGRIND, GXX): New.
3026 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
3027 * tests/bison.in: Run $PREBISON a pre-command.
3028 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
3029 (maintainer-check-g++): New.
3030 * Makefile.am (maintainer-check): New.
3032 2002-10-13 Akim Demaille <akim@epita.fr>
3034 * data/glr.c: Formatting changes.
3035 Tweak some trace messages to match yacc.c's.
3037 2002-10-13 Akim Demaille <akim@epita.fr>
3039 GLR parsers sometimes raise parse errors instead of performing the
3041 Reported by Charles-Henry de Boysson.
3043 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
3044 check the length of the traces when %glr.
3045 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
3047 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
3049 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
3050 (yyltype): Remove the yy prefix from the member names.
3051 (yytable): Complete its comment.
3052 (yygetLRActions): Map error action number from YYTABLE from
3054 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
3055 (which was a bug: it should have been YYTABEL_NINF, and yet it was
3056 not satisfying as we could compare an YYACTION computed from
3057 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
3058 only value for error actions.
3059 (yyreportParseError): In verbose parse error messages, don't issue
3060 `error' in the list of expected tokens.
3061 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
3062 next action to perform to match glr.c's decoding.
3063 (yytable): Complete its comment.
3065 2002-10-13 Paul Eggert <eggert@twinsun.com>
3067 Fix problem reported by Henrik Grubbstroem in
3068 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
3069 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
3070 because the Bison parser reads the second action before reducing
3072 * src/scan-gram.l (rule_length): New static var.
3073 Use it to keep track of the rule length in the scanner, since
3074 we can't expect the parser to be in lock-step sync with the scanner.
3075 (handle_action_dollar, handle_action_at): Use this var.
3076 * tests/actions.at (Exotic Dollars): Test for the problem.
3078 2002-10-12 Paul Eggert <eggert@twinsun.com>
3080 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
3081 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
3082 Include <sys/time.h> when checking for clock_t and struct tms.
3083 Use same include order as source.
3084 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
3085 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
3087 * lib/timevar.c: Update copyright date and clarify comments.
3088 (get_time) [IN_GCC]: Keep the GCC version for reference.
3090 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
3091 GCC version as of today, then merge Bison's changes.
3092 Change "GCC" to "Bison" in copyright notice. timevar.def's
3093 author is Akim, so change that too.
3095 * src/reader.c (grammar_current_rule_check):
3096 Don't worry about the default action if $$ is untyped.
3097 Prevents bogus warnings reported by Jim Gifford in
3098 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
3100 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
3101 * data/glr.c, data/lalr1.cc, data/yacc.c:
3102 Output token definitions before the first part of user declarations.
3103 Fixes compatibility problem reported by Jim Gifford for kbd in
3104 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
3106 2002-10-11 Paul Eggert <eggert@twinsun.com>
3108 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
3109 (yyparse): here. This undoes some of the 2002-07-25 change.
3110 Compatibility problem reported by Ralf S. Engelschall with
3111 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
3113 2002-10-11 Akim Demaille <akim@epita.fr>
3115 * tests/regression.at Characters Escapes): New.
3116 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
3118 Reported by Jan Nieuwenhuizen.
3120 2002-10-11 Akim Demaille <akim@epita.fr>
3124 2002-10-10 Paul Eggert <eggert@twinsun.com>
3126 Portability fixes for bitsets; this also avoids several GCC
3129 * lib/abitset.c: Include <stddef.h>, for offsetof.
3130 * lib/lbitset.c: Likewise.
3132 * lib/abitset.c (abitset_bytes): Return a size that is aligned
3133 properly for vectors of objects. Do not assume that adding a
3134 header size to a multiple of a word size yields a value that is
3135 properly aligned for the whole union.
3136 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3138 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
3139 unique names for structures.
3140 * lib/ebitset.c (ebitset_bytes): Likewise.
3141 * lib/lbitset.c (lbitset_bytes): Likewise.
3143 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
3144 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
3145 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
3146 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
3147 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
3148 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
3149 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
3150 to improve the type-checking that GCC can do.
3151 * lib/bitset.c (bitset_op4_cmp): Likewise.
3152 * lib/bitset_stats.c (bitset_stats_count,
3153 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
3154 bitset_stats_copy, bitset_stats_disjoint_p,
3155 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
3156 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
3157 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
3158 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
3159 bitset_stats_and_or_cmp, bitset_stats_andn_or,
3160 bitset_stats_andn_or_cmp, bitset_stats_or_and,
3161 bitset_stats_or_and_cmp): Likewise.
3162 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
3163 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
3164 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
3165 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
3167 * lib/abitset.h: Include bitset.h, not bbitset.h.
3168 * lib/ebitset.h: Likewise.
3169 * lib/lbitset.h: Likewise.
3171 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
3172 All instances of parameters of type enum bitset_opts are now of
3173 type enum_bitset_opts, to conform to the C Standard, and similarly
3174 for enum_bitset_type.
3175 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
3176 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
3178 Do not use "struct bitset_struct" to mean different things in
3179 different modules. Not only is this confusing, it violates
3180 the C Standard, which requires that structure types in different
3181 modules must be compatible if one is to be passed to the other.
3182 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
3183 All instances of "struct bitset_struct *" replaced with "bitset".
3184 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
3185 (union bitset_union, struct abitset_struct, struct ebitset_struct,
3186 struct lbitset_struct, struct bitset_stats_struct): New types.
3187 All uses of struct bitset_struct changed to union bitset_union,
3189 * lib/abitset.c (struct abitset_struct, abitset,
3190 struct bitset_struct): Remove.
3191 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
3192 struct bitset_struct): Remove.
3193 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
3194 bitset_struct): Remove.
3195 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
3198 Do not call a function of type T using a call that assumes the
3199 function is of a different type U. Standard C requires that a
3200 function must be called with a type that is compatible with its
3202 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3204 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
3206 * lib/ebitset.c (PFV): Remove.
3207 * lib/lbitset.c (PFV): Likewise.
3208 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
3209 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
3211 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
3212 (ebitset_vtable): Use them.
3213 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
3214 lbitset_xor): New functions.
3215 (lbitset_vtable): Use them.
3217 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
3220 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
3222 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
3223 Use offsetof, for simplicity.
3225 2002-10-06 Paul Eggert <eggert@twinsun.com>
3227 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
3228 the same width as int. This reapplies a hunk of the 2002-08-12 patch
3229 <http://mail.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
3230 which was inadvertently undone by the 2002-09-30 patch.
3231 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
3232 the same width as int.
3234 2002-10-04 Paul Eggert <eggert@twinsun.com>
3238 * configure.ac (AC_INIT), NEWS: Increment version number.
3240 * doc/bison.texinfo: Minor spelling, grammar, and white space
3242 (Symbols): Mention that any negative value returned from yylex
3243 signifies end-of-input. Warn about negative chars. Mention
3244 the portable Standard C character set.
3246 The GNU coding standard says CFLAGS and YFLAGS are reserved
3247 for the installer to set.
3248 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
3249 * src/Makefile.am (AM_CFLAGS): Likewise.
3250 (AM_YFLAGS): Renamed from YFLAGS.
3252 Fix some MAX and MIN problems.
3253 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
3254 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
3255 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
3256 * src/reader.c (reader): Use it.
3258 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
3259 POSIX 1003.1-2001 has removed fgrep.
3261 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
3263 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
3264 interpreted as signed.
3265 * lib/ebitset.c (ebitset_list): Fix bug.
3267 2002-10-01 Paul Eggert <eggert@twinsun.com>
3269 More fixes for 64-bit hosts and large bitsets.
3271 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
3272 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
3273 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
3274 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
3275 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
3276 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
3277 bitset_count_): Likewise.
3278 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
3279 bitset_first, bitset_last): Likewise.
3280 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
3281 bitset_stats_list_reverse, bitset_stats_size,
3282 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
3284 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3285 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
3286 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
3287 bitsetv_reflexive_transitive_closure): Likewise.
3288 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
3289 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
3291 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
3294 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
3295 Use size_t, not unsigned int, to count bytes.
3296 * lib/abitset.h (abitset_bytes): Likewise.
3297 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
3299 * lib/bitset.h (bitset_bytes): Likewise.
3300 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
3301 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
3302 * lib/bitsetv.c (bitsetv_alloc): Likewise.
3303 * lib/ebitset.c (ebitset_bytes): Likewise.
3304 * lib/ebitset.h (ebitset_bytes): Likewise.
3305 * lib/lbitset.c (lbitset_bytes): Likewise.
3306 * lib/lbitset.h (lbitset_bytes): Likewise.
3308 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
3309 abitset_subset_p, abitset_disjoint_p, abitset_and,
3310 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
3311 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
3312 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
3313 abitset_or_and, abitset_or_and_cmp):
3314 Use bitset_windex instead of unsigned int.
3315 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3316 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
3317 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
3318 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
3320 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
3322 * lib/bitset.c (bitset_print):
3323 Use proper printf formats for widths of integer types.
3324 * lib/bitset_stats.c (bitset_percent_histogram_print,
3325 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
3326 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3327 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
3328 * lib/lbitset.c (lbitset_bytes): Likewise.
3330 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
3331 BITSET_SIZE_MAX): New macros.
3332 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
3333 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
3334 to BITSET_WINDEX_MAX.
3336 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
3337 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
3338 since we now return the bitset_bindex type (not int).
3340 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
3341 when computing sizes.
3342 * lib/ebitset.c (ebitset_elts_grow): Likewise.
3344 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
3345 and avoid cast to unsigned.
3347 2002-09-30 Akim Demaille <akim@epita.fr>
3349 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
3350 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
3351 Updates from Michael Hayes.
3353 2002-09-30 Art Haas <ahaas@neosoft.com>
3355 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
3357 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
3360 2002-09-27 Akim Demaille <akim@epita.fr>
3364 2002-09-27 Akim Demaille <akim@epita.fr>
3366 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
3367 (Because of AC_LIBSOURCE).
3369 2002-09-27 Akim Demaille <akim@epita.fr>
3371 Playing with Autoscan.
3373 * configure.ac: Remove the old LIBOBJ tweaks.
3374 (AC_REPLACE_FUNCS): Add strrchr and strtol.
3375 * lib/strrchr.c: New.
3376 * lib/strtol.c: New, from the Coreutils 4.5.1.
3378 2002-09-27 Akim Demaille <akim@epita.fr>
3380 Playing with Autoscan.
3382 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
3383 * lib/Makefile.am (libbison_a_SOURCES): No longer include
3384 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
3385 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
3388 2002-09-24 Akim Demaille <akim@epita.fr>
3390 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
3391 (Frequently Asked Questions, Parser Stack Overflow): New.
3393 2002-09-13 Akim Demaille <akim@epita.fr>
3395 Playing with autoscan.
3397 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
3398 * src/files.c (skeleton_find): Remove, unused.
3399 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
3400 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
3402 2002-09-13 Akim Demaille <akim@epita.fr>
3404 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
3405 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
3407 2002-09-13 Akim Demaille <akim@epita.fr>
3409 * configure.ac: Require 2.54.
3410 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
3411 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
3412 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
3413 Remove, provided by Autoconf macros.
3415 2002-09-12 Akim Demaille <akim@epita.fr>
3417 * m4/prereq.m4: Update, from Coreutils 4.5.1.
3419 2002-09-12 Akim Demaille <akim@epita.fr>
3421 * m4/prereq.m4: Update, from Fileutils 4.1.5.
3422 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
3423 Reported by Martin Mokrejs.
3425 2002-09-10 Akim Demaille <akim@epita.fr>
3427 * src/parse-gram.y: Associate a human readable string to each
3429 * tests/regression.at (Invalid inputs): Adjust.
3431 2002-09-10 Gary V. Vaughan <gary@gnu.org>
3433 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
3434 with an Autoconf-2.5x style configure.ac.
3436 2002-09-06 Paul Eggert <eggert@twinsun.com>
3438 * doc/bison.texinfo (Conditions): Make explicit that the GPL
3439 exception applies only to yacc.c. This is a modification of a
3440 patch originally suggested by Akim Demaille.
3442 2002-09-06 Akim Demaille <akim@epita.fr>
3444 * data/c.m4 (b4_copyright): Move the GPL exception comment from
3446 * data/yacc.c: here.
3448 * data/lalr1.cc (struct yyltype): Don't define it, since we use
3450 (b4_ltype): Default to yy::Location from location.hh.
3452 2002-09-04 Jim Meyering <jim@meyering.net>
3454 * data/yacc.c: Guard the declaration of yytoknum also with
3455 `#ifdef YYPRINT', so it is declared only when used.
3457 2002-09-04 Akim Demaille <akim@epita.fr>
3459 * configure.in: Rename as...
3460 * configure.ac: this.
3463 2002-09-04 Akim Demaille <akim@epita.fr>
3465 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
3466 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
3467 translate maintainer only messages.
3469 2002-08-12 Paul Eggert <eggert@twinsun.com>
3473 * Makefile.am (SUBDIRS): Remove intl.
3474 (DISTCLEANFILES): Remove.
3475 * NEWS: Mention that GNU M4 is now required. Clarify what is
3476 meant by "larger grammars". Mention the pt_BR translation.
3477 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
3478 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
3479 Bump version from 0.11.2 to 0.11.5.
3480 (BISON_PREREQ_STAGE): Remove.
3481 (AM_GNU_GETTEXT): Use external gettext.
3482 (AC_OUTPUT): Remove intl/Makefile.
3484 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
3486 * data/glr.c: Include string.h, for strlen.
3487 (yyreportParseError): Use size_t for yysize.
3488 (yy_yypstack): No longer nested inside yypstates, as nested
3489 functions are not portable. Do not assume size_t is the
3491 (yypstates): Do not assume that ptrdiff_t is the same width
3492 as int, and similarly for yyposn and YYINDEX.
3494 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
3496 * lib/Makefile.am (INCLUDES): Do not include from the intl
3497 directory, which has been removed.
3498 * src/Makefile.am (INCLUDES): Likewise.
3500 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
3501 (bitsets_sources, additional_bitsets_sources, timevars_sources):
3504 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
3505 * tests/Makefile.am (EXTRA_DIST): Likewise.
3507 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
3508 Do not assume that bitset_windex is the same width as unsigned.
3510 * lib/abitset.c (abitset_unused_clear): Do not assume that
3511 bitset_word is the same width as int.
3512 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
3513 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
3514 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
3515 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
3516 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
3518 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
3519 portability to one's complement hosts!).
3520 * lib/ebitset.c (ebitset_op1): Likewise.
3521 * lib/lbitset.c (lbitset_op1): Likewise.
3523 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
3524 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
3525 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
3526 Sync with fileutils.
3527 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
3528 lib/gettext.h: Sync with diffutils.
3530 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
3531 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
3533 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
3534 PROTOTYPES to check for prototypes, and "defined __STDC__" to
3537 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
3538 size_t; the old version tried to do this but casted improperly.
3539 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
3540 (bitset_test): Now returns int, not unsigned long.
3542 * lib/bitset_stats.c: Include "gettext.h".
3544 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
3545 name locals "index", as it generates unnecessary warnings on some
3546 hosts that have an "index" function.
3548 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
3549 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
3550 they need translation.
3551 * src/LR0.c (state_list_append, new_itemsets, get_state,
3552 append_states, generate_states): Likewise.
3553 * src/assoc.c (assoc_to_string): Likewise.
3554 * src/closure.c (print_closure, set_firsts, closure): Likewise.
3555 * src/gram.c (grammar_dump): Likewise.
3556 * src/injections.c (injections_compute): Likewise.
3557 * src/lalr.c (lookaheads_print): Likewise.
3558 * src/relation.c (relation_transpose): Likewise.
3559 * src/scan-gram.l: Likewise.
3560 * src/tables.c (table_grow, pack_vector): Likewise.
3562 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
3563 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
3564 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
3565 * m4/mbstate_t.m4: Sync with fileutils.
3566 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
3568 * po/LINGUAS: Add pt_BR.
3569 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
3570 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
3572 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
3574 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
3576 * src/complain.c (strerror_r): Remove decl; not needed.
3577 (strerror): Use same pattern as ../lib/error.c.
3579 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
3581 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
3583 * src/main.c (main): Cast result of bindtextdomain and textdomain
3584 to void, to avoid a GCC warning when --disable-nls is in effect.
3586 * src/scan-gram.l: Use strings rather than escapes when possible,
3587 to minimize the number of warnings from xgettext.
3588 (handle_action_dollar, handle_action_at): Don't use isdigit,
3589 as it mishandles negative chars and it may not work as expected
3590 outside the C locale.
3592 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
3593 this is a GCC extension and is not portable to other compilers.
3595 * src/system.h (alloca): Use same pattern as ../lib/error.c.
3596 Do not include <ctype.h>; no longer needed.
3597 Do not include <malloc.h>; no longer needed (and generates
3598 warnings on OpenBSD 3.0).
3600 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
3603 * tests/regression.at: Do not use 'cc -c input.c -o input';
3604 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
3606 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
3607 exit status as failure, not just exit status 1. Sun C exits
3608 with status 2 sometimes.
3610 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
3611 Use it for the two large tests.
3613 2002-08-02 Akim Demaille <akim@epita.fr>
3615 * src/conflicts.c (conflicts_output): Don't output rules never
3616 reduced here, since anyway that computation doesn't work.
3617 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
3618 (rule_useless_p, rule_never_reduced_p): New.
3619 (grammar_rules_partial_print): Use a filter instead of a range.
3620 Display the title only if needed.
3621 (grammar_rules_print): Adjust.
3622 (grammar_rules_never_reduced_report): New.
3623 * src/tables.c (action_row): Move the computation of rules never
3625 (token_actions): here.
3626 * src/main.c (main): Make the parser before making the report, so
3627 that rules never reduced are computed.
3628 Call grammar_rules_never_reduced_report.
3629 * src/print.c (print_results): Report rules never reduced.
3630 * tests/conflicts.at, tests/reduce.at: Adjust.
3632 2002-08-01 Akim Demaille <akim@epita.fr>
3634 Instead of attaching lookaheads and duplicating the rules being
3635 reduced by a state, attach the lookaheads to the reductions.
3637 * src/state.h (state_t): Remove the `lookaheads',
3638 `lookaheads_rule' member.
3639 (reductions_t): Add a `lookaheads' member.
3640 Use a regular array for the `rules'.
3641 * src/state.c (reductions_new): Initialize the lookaheads member
3643 (state_rule_lookaheads_print): Adjust.
3644 * src/state.h, src/state.c (state_reductions_find): New.
3645 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
3646 (count_rr_conflicts): Adjust.
3647 * src/lalr.c (LArule): Remove.
3648 (add_lookback_edge): Adjust.
3649 (state_lookaheads_count): New.
3650 (states_lookaheads_initialize): Merge into...
3651 (initialize_LA): this.
3652 (lalr_free): Adjust.
3653 * src/main.c (main): Don't free nullable and derives too early: it
3654 is used by --verbose.
3655 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
3657 2002-08-01 Akim Demaille <akim@epita.fr>
3659 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
3661 (set_derives, free_derives): Rename as...
3662 (derives_compute, derives_free): this.
3663 Adjust all dependencies.
3664 * src/nullable.c (set_nullable, free_nullable): Rename as...
3665 (nullable_compute, nullable_free): these.
3666 (rule_list_t): Store rule_t *, not rule_number_t.
3667 * src/state.c (state_rule_lookaheads_print): Directly compare rule
3668 pointers, instead of their numbers.
3669 * src/main.c (main): Call nullable_free, and derives_free earlier,
3670 as they were lo longer used.
3672 2002-08-01 Akim Demaille <akim@epita.fr>
3674 * lib/timevar.c (get_time): Include children time.
3675 * src/lalr.h (LA, LArule): Don't export them: used with the
3677 * src/lalr.c (LA, LArule): Static.
3678 * src/lalr.h, src/lalr.c (lalr_free): New.
3679 * src/main.c (main): Call it.
3680 * src/tables.c (pack_vector): Check whether loc is >= to the
3682 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
3683 (tables_generate): do it, since that's also it which allocates
3685 Don't free LA and LArule, main does.
3687 2002-07-31 Akim Demaille <akim@epita.fr>
3689 Separate parser tables computation and output.
3691 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
3692 (conflict_list, conflict_list_cnt, table, check, table_ninf)
3693 (yydefgoto, yydefact, high): Move to...
3694 * src/tables.h, src/tables.c: here.
3695 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3696 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3697 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
3698 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
3699 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
3700 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
3701 (action_row, save_row, token_actions, save_column, default_goto)
3702 (goto_actions, sort_actions, matching_state, pack_vector)
3703 (table_ninf_remap, pack_table, prepare_actions): Move to...
3704 * src/tables.c: here.
3705 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
3706 * src/output.c (token_actions, output_base, output_conflicts)
3707 (output_check): Merge into...
3708 (prepare_actions): this.
3709 (actions_output): Rename as...
3710 (user_actions_output): this.
3711 * src/main.c (main): Call tables_generate and tables_free.
3713 2002-07-31 Akim Demaille <akim@epita.fr>
3715 Steal GCC's --time-report support.
3717 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
3718 stolen/adjusted from GCC.
3719 * m4/stage.m4: Remove time related checks.
3720 * m4/timevar.m4: New.
3721 * configure.in: Adjust.
3722 * src/system.h: Adjust to using timevar.h.
3723 * src/getargs.h, src/getargs.c: Support trace_time for
3725 * src/main.c (stage): Remove.
3726 (main): Replace `stage' invocations with timevar calls.
3727 * src/output.c: Insert pertinent timevar calls.
3729 2002-07-31 Akim Demaille <akim@epita.fr>
3731 Let --trace have arguments.
3733 * src/getargs.h (enum trace_e): New.
3734 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
3735 (long_options, short_options): --trace/-T takes an optional
3737 Change all the uses of trace_flag to reflect the new flags.
3738 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
3740 Strengthen `stage' portability.
3742 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
3743 * configure.in: Use it.
3744 Don't check for malloc.h and sys/times.h.
3745 * src/system.h: Include them when appropriate.
3746 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
3747 times and struct tms are available.
3749 2002-07-30 Akim Demaille <akim@epita.fr>
3751 In verbose parse error message, don't report `error' as an
3753 * tests/actions.at (Printers and Destructors): Adjust.
3754 * tests/calc.at (Calculator $1): Adjust.
3755 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
3756 error message, do not report the parser accepts the error token in
3759 2002-07-30 Akim Demaille <akim@epita.fr>
3761 Normalize conflict related messages.
3763 * src/complain.h, src/complain.c (warn, complain): New.
3764 * src/conflicts.c (conflicts_print): Use them.
3765 (conflict_report_yacc): New, extracted from...
3766 (conflicts_print): here.
3767 * tests/conflicts.at, tests/existing.at: Adjust.
3769 2002-07-30 Akim Demaille <akim@epita.fr>
3771 Report rules which are never reduced by the parser: those hidden
3774 * src/LR0.c (save_reductions): Don't make the final state too
3775 different: save its reduction (accept) instead of having a state
3776 without any action (no shift or goto, no reduce).
3777 Note: the final state is now a ``regular'' state, i.e., the
3778 parsers now contain `reduce 0' as default reduction.
3779 Nevertheless, since they decide to `accept' when yystate =
3780 final_state, they still will not reduce rule 0.
3781 * src/print.c (print_actions, print_reduction): Adjust.
3782 * src/output.c (action_row): Track reduced rules.
3783 (token_actions): Report rules never reduced.
3784 * tests/conflicts.at, tests/regression.at: Adjust.
3786 2002-07-30 Akim Demaille <akim@epita.fr>
3788 `stage' was accidently included in a previous patch.
3789 Initiate its autoconfiscation.
3791 * configure.in: Look for malloc.h and sys/times.h.
3792 * src/main.c (stage): Adjust.
3793 Report only when trace_flag.
3795 2002-07-29 Akim Demaille <akim@epita.fr>
3797 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
3799 (errs_t): symbol_t*, not symbol_number_t.
3800 (reductions_t): rule_t*, not rule_number_t.
3801 (FOR_EACH_SHIFT): New.
3802 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
3803 * src/print.c, src/print_graph.c: Adjust.
3805 2002-07-29 Akim Demaille <akim@epita.fr>
3807 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
3809 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
3810 (endtoken, accept): these.
3811 * src/reader.c (reader): Set endtoken's default tag to "$end".
3812 Set undeftoken's tag to "$undefined" instead of "$undefined.".
3813 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
3816 2002-07-29 Akim Demaille <akim@epita.fr>
3818 * src/reduce.c (reduce_grammar): When the language is empty,
3819 complain about the start symbol, not the axiom.
3821 * tests/reduce.at (Empty Language): New.
3823 2002-07-26 Akim Demaille <akim@epita.fr>
3825 * src/reader.h, src/reader.c (gram_error): ... can't get
3826 yycontrol without making too strong assumptions on the parser
3828 * src/output.c (prepare_tokens): Use the real 0th value of
3829 token_translations instead of `0'.
3830 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
3832 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
3833 for the time being: %locations ought to provide it to yyerror.
3835 2002-07-25 Akim Demaille <akim@epita.fr>
3837 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
3838 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
3839 * tests/regression.at (Web2c Actions): Adjust.
3841 2002-07-25 Akim Demaille <akim@epita.fr>
3843 Stop storing rules from 1 to nrules + 1.
3845 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
3846 * src/nullable.c, src/output.c, src/print.c, src/reader.c
3847 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
3848 Iterate from 0 to nrules.
3849 Use rule_number_as_item_number and item_number_as_rule_number.
3850 Adjust to `derive' now containing possibly 0.
3851 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
3852 Handle the `- 1' part in rule numbers from/to item numbers.
3853 * src/conflicts.c (log_resolution): Fix the message which reversed
3855 * src/output.c (action_row): Initialize default_rule to -1.
3856 (token_actions): Adjust.
3857 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
3859 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
3861 2002-07-25 Akim Demaille <akim@epita.fr>
3863 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
3864 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
3865 (b4_c_knr_arg_decl): New.
3866 * data/yacc.c: Use it to define yysymprint, yydestruct, and
3867 yyreport_parse_error.
3869 2002-07-25 Akim Demaille <akim@epita.fr>
3871 * data/yacc.c (yyreport_parse_error): New, extracted from...
3873 (yydestruct, yysymprint): Move above yyparse.
3876 2002-07-25 Akim Demaille <akim@epita.fr>
3878 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
3880 (b4_sint_type, b4_uint_type): these.
3881 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
3882 * tests/regression.at (Web2c Actions): Adjust.
3884 2002-07-25 Akim Demaille <akim@epita.fr>
3886 * src/gram.h (TIEM_NUMBER_MAX): New.
3887 (item_number_of_rule_number, rule_number_of_item_number): Rename
3889 (rule_number_as_item_number, item_number_as_rule_number): these.
3890 Adjust dependencies.
3891 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
3892 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
3893 (symbol_number_to_vector_number): New.
3894 (order): Of vector_number_t* type.
3895 (base_t, BASE_MAX, BASE_MIN): New.
3896 (froms, tos, width, pos, check): Of base_t type.
3897 (action_number_t, ACTION_MIN, ACTION_MAX): New.
3898 (actrow): Of action_number_t type.
3899 (conflrow): Of unsigned int type.
3900 (table_ninf, base_ninf): New.
3901 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
3902 (muscle_insert_int_table, muscle_insert_base_table)
3903 (muscle_insert_rule_number_table): New.
3904 (prepare_tokens): Output `toknum' as int_table.
3905 (action_row): Returns a rule_number_t.
3906 Use ACTION_MIN, not SHRT_MIN.
3907 (token_actions): yydefact is rule_number_t*.
3908 (table_ninf_remap): New.
3909 (pack_table): Use it for `base' and `table'.
3910 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
3912 (YYPACT_NINF, YYTABLE_NINF): these.
3913 (yypact, yytable): Compute their types instead of hard-coded
3915 * tests/regression.at (Web2c Actions): Adjust.
3917 2002-07-19 Akim Demaille <akim@epita.fr>
3919 * src/scan-gram.l (id): Can start with an underscore.
3921 2002-07-16 Akim Demaille <akim@epita.fr>
3923 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
3924 Adjust all former `associativity' dependencies.
3925 * src/symtab.c (symbol_new): Default associativity is `undef', not
3927 (symbol_check_alias_consistence): Adjust.
3929 2002-07-09 Akim Demaille <akim@epita.fr>
3931 * doc/bison.texinfo: Properly set the ``header'' part.
3932 Use @dircategory ``GNU programming tools'' as per Texinfo's
3936 2002-07-09 Akim Demaille <akim@epita.fr>
3938 * lib/quotearg.h: Protect against multiple inclusions.
3939 * src/location.h (location_t): Add a `file' member.
3940 (LOCATION_RESET, LOCATION_PRINT): Adjust.
3941 * src/complain.c (warn_at, complain_at, fatal_at): Drop
3942 `error_one_per_line' support.
3944 2002-07-09 Akim Demaille <akim@epita.fr>
3946 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
3947 * src/reader.c (lineno): Remove.
3948 Adjust all dependencies.
3949 (get_merge_function): Take a location and use complain_at.
3950 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
3951 * tests/regression.at (Invalid inputs, Mixing %token styles):
3954 2002-07-09 Akim Demaille <akim@epita.fr>
3956 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
3957 recovery rule, and forbid extensions when --yacc.
3958 (gram_error): Use complain_at.
3959 * src/reader.c (reader): Exit if there were parse errors.
3961 2002-07-09 Akim Demaille <akim@epita.fr>
3963 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
3964 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
3965 Reported by R Blake <blakers@mac.com>.
3967 2002-07-09 Akim Demaille <akim@epita.fr>
3969 * data/yacc.c: Output the copyright notive in the header.
3971 2002-07-03 Akim Demaille <akim@epita.fr>
3973 * src/output.c (froms, tos): Are state_number_t.
3974 (save_column): sp, sp1, and sp2 are state_number_t.
3975 (prepare): Rename `final' as `final_state_number', `nnts' as
3976 `nterms_number', `nrules' as `rules_number', `nstates' as
3977 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
3979 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
3980 * data/lalr1.cc (nsym_): Remove, unused.
3982 2002-07-03 Akim Demaille <akim@epita.fr>
3984 * src/lalr.h, src/lalr.c (goto_number_t): New.
3985 * src/lalr.c (goto_list_t): New.
3987 * src/nullable.c (rule_list_t): New.
3989 * src/types.h: Remove.
3991 2002-07-03 Akim Demaille <akim@epita.fr>
3993 * src/closure.c (print_fderives): Use rule_rhs_print.
3994 * src/derives.c (print_derives): Use rule_rhs_print.
3995 (rule_list_t): New, replaces `shorts'.
3996 (set_derives): Add comments.
3997 * tests/sets.at (Nullable, Firsts): Adjust.
3999 2002-07-03 Akim Demaille <akim@epita.fr>
4001 * src/output.c (prepare_actions): Free `tally' and `width'.
4002 (prepare_actions): Allocate and free `order'.
4003 * src/symtab.c (symbols_free): Free `symbols'.
4004 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
4005 * src/output.c (m4_invoke): Move to...
4006 * src/scan-skel.l: here.
4007 (<<EOF>>): Close yyout, and free its name.
4009 2002-07-03 Akim Demaille <akim@epita.fr>
4011 Fix some memory leaks, and fix a bug: state 0 was examined twice.
4013 * src/LR0.c (new_state): Merge into...
4014 (state_list_append): this.
4015 (new_states): Merge into...
4016 (generate_states): here.
4017 (set_states): Don't ensure a proper `errs' state member here, do it...
4018 * src/conflicts.c (conflicts_solve): here.
4019 * src/state.h, src/state.c: Comment changes.
4020 (state_t): Rename member `shifts' as `transitions'.
4021 Adjust all dependencies.
4022 (errs_new): For consistency, also take the values as argument.
4024 (state_errs_set): New.
4025 (state_reductions_set, state_transitions_set): Assert that no
4026 previous value was assigned.
4028 (states_free): Use it.
4029 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
4030 temporary storage: use `errs' and `nerrs' as elsewhere.
4031 (set_conflicts): Allocate and free this `errs'.
4033 2002-07-02 Akim Demaille <akim@epita.fr>
4035 * lib/libiberty.h: New.
4036 * lib: Update the bitset implementation from upstream.
4037 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
4038 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
4039 * src/main.c: Adjust bitset stats calls.
4041 2002-07-01 Paul Eggert <eggert@twinsun.com>
4043 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
4044 char, so that negative chars don't collide with $.
4046 2002-06-30 Akim Demaille <akim@epita.fr>
4048 Have the GLR tests be `warning' checked, and fix the warnings.
4050 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
4051 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
4052 (yyremoveDeletes): `yyi' and `yyj' are size_t.
4053 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
4054 (yyaddDeferredAction): static.
4055 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
4056 (yyreportParseError): yyprefix is const.
4057 yytokenp is used only when verbose.
4058 (yy__GNUC__): Replace with __GNUC__.
4059 (yypdumpstack): yyi is size_t.
4060 (yypreference): Un-yy local variables and arguments, to avoid
4061 clashes with `yyr1'. Anyway, we are not in the user name space.
4062 (yytname_size): be an int, as is compared with ints.
4063 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
4065 * tests/cxx-gram.at: Use quotation to protect $1.
4066 Use AT_COMPILE to enable warnings hunts.
4067 Prototype yylex and yyerror.
4069 Include `string.h', not `strings.h'.
4070 Produce and prototype stmtMerge only when used.
4071 yylex takes a location.
4073 2002-06-30 Akim Demaille <akim@epita.fr>
4075 We spend a lot of time in quotearg, in particular when --verbose.
4077 * src/symtab.c (symbol_get): Store a quoted version of the key.
4078 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
4081 2002-06-30 Akim Demaille <akim@epita.fr>
4083 * src/state.h (reductions_t): Rename member `nreds' as num.
4084 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
4085 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
4087 2002-06-30 Akim Demaille <akim@epita.fr>
4089 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
4090 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
4091 (shifts_to): Rename as...
4092 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
4093 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
4094 (TRANSITION_IS_DISABLED, transitions_to): these.
4096 2002-06-30 Akim Demaille <akim@epita.fr>
4098 * src/print.c (print_shifts, print_gotos): Merge into...
4099 (print_transitions): this.
4100 (print_transitions, print_errs, print_reductions): Align the
4102 (print_core, print_transitions, print_errs, print_state,
4103 print_grammar): Output empty lines separator before, not after.
4104 (state_default_rule_compute): Rename as...
4105 (state_default_rule): this.
4106 * tests/conflicts.at (Defaulted Conflicted Reduction),
4107 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
4108 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
4110 2002-06-30 Akim Demaille <akim@epita.fr>
4112 Display items as we display rules.
4114 * src/gram.h, src/gram.c (rule_lhs_print): New.
4115 * src/gram.c (grammar_rules_partial_print): Use it.
4116 * src/print.c (print_core): Likewise.
4117 * tests/conflicts.at (Defaulted Conflicted Reduction),
4118 (Unresolved SR Conflicts): Adjust.
4119 (Unresolved SR Conflicts): Adjust and rename as...
4120 (Resolved SR Conflicts): this, as was meant.
4121 * tests/regression.at (Web2c Report): Adjust.
4123 2002-06-30 Akim Demaille <akim@epita.fr>
4125 * src/print.c (state_default_rule_compute): New, extracted from...
4126 (print_reductions): here.
4127 Pessimize, but clarify the code.
4128 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
4130 2002-06-30 Akim Demaille <akim@epita.fr>
4132 * src/output.c (action_row): Let default_rule be always a rule
4135 2002-06-30 Akim Demaille <akim@epita.fr>
4137 * src/closure.c (print_firsts, print_fderives, closure):
4139 * src/lalr.c (lookaheads_print): Likewise.
4140 * src/state.c (state_rule_lookaheads_print): Likewise.
4141 * src/print_graph.c (print_core): Likewise.
4142 * src/print.c (print_reductions): Likewise.
4143 * src/output.c (action_row): Likewise.
4144 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
4146 2002-06-30 Akim Demaille <akim@epita.fr>
4148 * src/print_graph.c: Use report_flag.
4150 2002-06-30 Akim Demaille <akim@epita.fr>
4152 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
4154 * src/relation.h, src/relation.c (traverse, relation_digraph)
4155 (relation_print, relation_transpose): New.
4157 2002-06-30 Akim Demaille <akim@epita.fr>
4159 * src/state.h, src/state.c (shifts_to): New.
4160 * src/lalr.c (build_relations): Use it.
4162 2002-06-30 Akim Demaille <akim@epita.fr>
4164 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
4165 (item_number_of_rule_number, rule_number_of_item_number): New.
4166 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
4167 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
4168 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
4169 Propagate their use.
4170 Much remains to be done, in particular wrt `shorts' from types.h.
4172 2002-06-30 Akim Demaille <akim@epita.fr>
4174 * src/symtab.c (symbol_new): Initialize the `printer' member.
4176 2002-06-30 Akim Demaille <akim@epita.fr>
4178 * src/LR0.c (save_reductions): Remove, replaced by...
4179 * src/state.h, src/state.c (state_reductions_set): New.
4180 (reductions, errs): Rename as...
4181 (reductions_t, errs_t): these.
4182 Adjust all dependencies.
4184 2002-06-30 Akim Demaille <akim@epita.fr>
4186 * src/LR0.c (state_list_t, state_list_append): New.
4187 (first_state, last_state): Now symbol_list_t.
4188 (this_state): Remove.
4189 (new_itemsets, append_states, save_reductions): Take a state_t as
4191 (set_states, generate_states): Adjust.
4192 (save_shifts): Remove, replaced by...
4193 * src/state.h, src/state.c (state_shifts_set): New.
4194 (shifts): Rename as...
4196 Adjust all dependencies.
4197 * src/state.h (state_t): Remove the `next' member.
4199 2002-06-30 Akim Demaille <akim@epita.fr>
4201 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
4204 2002-06-30 Akim Demaille <akim@epita.fr>
4206 Use hash.h for the state hash table.
4208 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
4209 (allocate_storage): Use state_hash_new.
4210 (free_storage): Use state_hash_free.
4211 (new_state, get_state): Adjust.
4212 * src/lalr.h, src/lalr.c (states): Move to...
4213 * src/states.h (state_t): Remove the `link' member, no longer
4215 * src/states.h, src/states.c: here.
4216 (state_hash_new, state_hash_free, state_hash_lookup)
4217 (state_hash_insert, states_free): New.
4218 * src/states.c (state_table, state_compare, state_hash): New.
4219 * src/output.c (output_actions): Do not free states now, since we
4220 still need to know the final_state number in `prepare', called
4221 afterwards. Do it...
4222 * src/main.c (main): here: call states_free after `output'.
4224 2002-06-30 Akim Demaille <akim@epita.fr>
4226 * src/state.h, src/state.c (state_new): New, extracted from...
4227 * src/LR0.c (new_state): here.
4228 * src/state.h (STATE_ALLOC): Move to...
4229 * src/state.c: here.
4230 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
4231 * src/state.h, src/state.c: here.
4233 2002-06-30 Akim Demaille <akim@epita.fr>
4235 * src/reader.c (gensym): Rename as...
4236 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
4237 (getsym): Rename as...
4240 2002-06-30 Akim Demaille <akim@epita.fr>
4242 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
4243 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
4244 * src/output.c, src/print.c, src/print_graph.c: Propagate.
4245 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
4247 2002-06-30 Akim Demaille <akim@epita.fr>
4249 Make the test suite pass with warnings checked.
4251 * tests/actions.at (Printers and Destructors): Improve.
4252 Avoid unsigned vs. signed issues.
4253 * tests/calc.at: Don't exercise the scanner here, do it...
4254 * tests/input.at (Torturing the Scanner): here.
4256 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4258 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
4259 reorganize first lines parallel to yacc.c.
4261 2002-06-28 Akim Demaille <akim@epita.fr>
4263 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
4264 (b4_token_enum, b4_token_defines): New, factored from...
4265 * data/lalr1.cc, data/yacc.c, glr.c: here.
4267 2002-06-28 Akim Demaille <akim@epita.fr>
4269 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
4271 * src/output.c (merger_output): static.
4273 2002-06-28 Akim Demaille <akim@epita.fr>
4275 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
4276 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
4278 * src/output.c (save_row): Initialize all the variables to pacify GCC.
4280 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4282 Accumulated changelog for new GLR parsing features.
4284 * src/conflicts.c (count_total_conflicts): Change name to
4285 conflicts_total_count.
4286 * src/conflicts.h: Ditto.
4287 * src/output.c (token_actions): Use the new name.
4288 (output_conflicts): Change conflp => conflict_list_heads, and
4289 confl => conflict_list for better readability.
4290 * data/glr.c: Use the new names.
4291 * NEWS: Add self to GLR announcement.
4293 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
4295 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
4298 * data/bison.glr: Change name to glr.c
4299 * data/glr.c: Renamed from bison.glr.
4300 * data/Makefile.am: Add glr.c
4304 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
4305 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
4307 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4309 * data/bison.glr: Be sure to restore the
4310 current #line when returning to the skeleton contents after having
4311 exposed the input file's #line.
4313 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4315 * data/bison.glr: Bring up to date with changes to bison.simple.
4317 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4319 * data/bison.glr: Correct definitions that use b4_prefix.
4320 Various reformatting.
4321 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
4322 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
4323 yytokenp argument; now part of stack.
4324 (yychar): Define to behave as documented.
4327 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4329 * src/reader.h: Add declaration for free_merger_functions.
4331 * src/reader.c (merge_functions): New variable.
4332 (get_merge_function): New function.
4333 (free_merger_functions): New function.
4334 (readgram): Check for %prec that is not followed by a symbol.
4335 Handle %dprec and %merge declarations.
4336 (packgram): Initialize dprec and merger fields in rules array.
4338 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
4339 conflict_list_cnt, conflict_list_free): New variables.
4340 (table_grow): Also grow conflict_table.
4341 (prepare_rules): Output dprec and merger tables.
4342 (conflict_row): New function.
4343 (action_row): Output conflict lists for GLR parser. Don't use
4344 default reduction in conflicted states for GLR parser so that there
4345 are spaces for the conflict lists.
4346 (save_row): Also save conflict information.
4347 (token_actions): Allocate conflict list.
4348 (merger_output): New function.
4349 (pack_vector): Pack conflict table, too.
4350 (output_conflicts): New function to output yyconflp and yyconfl.
4351 (output_check): Allocate conflict_tos.
4352 (output_actions): Output conflict tables, also.
4353 (output_skeleton): Output b4_mergers definition.
4354 (prepare): Output b4_max_rhs_length definition.
4355 Use 'bison.glr' as default skeleton for GLR parsers.
4357 * src/gram.c (glr_parser): New flag.
4358 (grammar_free): Call free_merger_functions.
4360 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
4361 all pairs of conflicting reductions, rather than just all tokens
4362 causing conflicts. Needed to size conflict tables.
4363 (conflicts_output): Modify call to count_rr_conflicts for new
4365 (conflicts_print): Ditto.
4366 (count_total_conflicts): New function.
4368 * src/reader.h (merger_list): New type.
4369 (merge_functions): New variable.
4371 * src/lex.h (tok_dprec, tok_merge): New token types.
4373 * src/gram.h (rule_s): Add dprec and merger fields.
4374 (glr_parser): New flag.
4376 * src/conflicts.h (count_total_conflicts): New function.
4378 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
4380 * doc/bison.texinfo (Generalized LR Parsing): New section.
4381 (GLR Parsers): New section.
4382 (Language and Grammar): Mention GLR parsing.
4383 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
4384 Correct typo ("tge" -> "the").
4386 * data/bison.glr: New skeleton for GLR parsing.
4388 * tests/cxx-gram.at: New tests for GLR parsing.
4390 * tests/testsuite.at: Include cxx-gram.at.
4392 * tests/Makefile.am: Add cxx-gram.at.
4396 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
4398 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
4400 2002-06-27 Akim Demaille <akim@epita.fr>
4402 * src/options.h, src/options.c: Remove.
4403 * src/getargs.c (short_options, long_options): New.
4405 2002-06-27 Akim Demaille <akim@epita.fr>
4407 * data/bison.simple, data/bison.c++: Rename as...
4408 * data/yacc.c, data/lalr1.cc: these.
4409 * doc/bison.texinfo (Environment Variables): Remove.
4411 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
4413 * src/getargs.c (report_argmatch): Initialize strtok().
4415 2002-06-20 Akim Demaille <akim@epita.fr>
4417 * data/bison.simple (b4_symbol_actions): New, replaces...
4418 (b4_symbol_destructor, b4_symbol_printer): these.
4419 (yysymprint): Be sure to call YYPRINT only for tokens, and using
4422 2002-06-20 Akim Demaille <akim@epita.fr>
4424 * data/bison.simple (yydestructor): Rename as...
4427 2002-06-20 Akim Demaille <akim@epita.fr>
4429 * src/symtab.h, src/symtab.c (symbol_type_set)
4430 (symbol_destructor_set, symbol_precedence_set): The location is
4434 2002-06-20 Akim Demaille <akim@epita.fr>
4436 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
4438 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
4440 * src/symtab.h, src/symtab.c (symbol_class_set)
4441 (symbol_user_token_number_set): Likewise.
4443 Promote complain_at.
4444 * tests/input.at (Type Clashes): Adjust.
4446 2002-06-20 Akim Demaille <akim@epita.fr>
4448 * data/bison.simple (YYLEX): Fix the declaration when
4451 2002-06-20 Akim Demaille <akim@epita.fr>
4453 * data/bison.simple (yysymprint): Don't print the token number,
4455 * tests/actions.at (Destructors): Rename as...
4456 (Printers and Destructors): this.
4457 Also exercise %printer.
4459 2002-06-20 Akim Demaille <akim@epita.fr>
4461 * data/bison.simple (YYDSYMPRINT): New.
4462 Use it to remove many of the #if YYDEBUG/if (yydebug).
4464 2002-06-20 Akim Demaille <akim@epita.fr>
4466 * src/symtab.h, src/symtab.c (symbol_t): printer and
4467 printer_location are new members.
4468 (symbol_printer_set): New.
4469 * src/parse-gram.y (PERCENT_PRINTER): New token.
4470 Handle its associated rule.
4471 * src/scan-gram.l: Adjust.
4472 (handle_destructor_at, handle_destructor_dollar): Rename as...
4473 (handle_symbol_code_at, handle_symbol_code_dollar): these.
4474 * src/output.c (symbol_printers_output): New.
4475 (output_skeleton): Call it.
4476 * data/bison.simple (yysymprint): New. Cannot be named yyprint
4477 since there are already many grammar files with a user `yyprint'.
4478 Replace the calls to YYPRINT to calls to yysymprint.
4479 * tests/calc.at: Adjust.
4480 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
4481 taking advantage of parser very internal details (stack size!).
4483 2002-06-20 Akim Demaille <akim@epita.fr>
4485 * src/scan-gram.l: Complete the scanner with the missing patterns
4487 Use `quote' and `symbol_tag_get' where appropriate.
4489 2002-06-19 Akim Demaille <akim@epita.fr>
4491 * tests/actions.at (Destructors): Augment to test locations.
4492 * data/bison.simple (yydestructor): Pass it the current location
4493 if locations are enabled.
4494 Prototype only when __STDC__ or C++.
4495 Change the argument names to move into the yy name space: there is
4498 2002-06-19 Akim Demaille <akim@epita.fr>
4500 * data/bison.simple (b4_pure_if): New.
4501 Use it instead of #ifdef YYPURE.
4503 2002-06-19 Akim Demaille <akim@epita.fr>
4505 * data/bison.simple (b4_location_if): New.
4506 Use it instead of #ifdef YYLSP_NEEDED.
4508 2002-06-19 Akim Demaille <akim@epita.fr>
4510 Prepare @$ in %destructor, but currently don't bind it in the
4511 skeleton, as %location use is not cleaned up yet.
4513 * src/scan-gram.l (handle_dollar, handle_destructor_at)
4514 (handle_action_at): New.
4515 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
4516 a braced_code_t and a location as additional arguments.
4517 (handle_destructor_dollar): Instead of requiring `b4_eval', just
4518 unquote one when outputting `b4_dollar_dollar'.
4520 * data/bison.simple (b4_eval): Remove.
4521 (b4_symbol_destructor): Adjust.
4522 * tests/input.at (Invalid @n): Adjust.
4524 2002-06-19 Zack Weinberg <zack@codesourcery.com>
4526 * doc/bison.texinfo: Document ability to have multiple
4529 2002-06-18 Akim Demaille <akim@epita.fr>
4531 * src/files.c (compute_base_names): When computing the output file
4532 names from the input file name, strip the directory part.
4534 2002-06-18 Akim Demaille <akim@epita.fr>
4536 * data/bison.simple.new: Comment changes.
4537 Reported by Andreas Schwab.
4539 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
4541 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
4542 there are no `label `yyoverflowlab' defined but not used' warnings
4543 when yyoverflow is defined.
4545 2002-06-18 Akim Demaille <akim@epita.fr>
4547 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
4549 (symbol_destructor_set): Adjust.
4550 * src/output.c (symbol_destructors_output): Output the destructor
4552 Output the symbol name.
4553 * data/bison.simple (b4_symbol_destructor): Adjust.
4555 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
4556 and Akim Demaille <akim@epita.fr>
4558 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
4559 what's left on the stack when the error recovery hits EOF.
4560 * tests/actions.at (Destructors): Complete to exercise this case.
4562 2002-06-17 Akim Demaille <akim@epita.fr>
4564 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
4565 arguments is really empty, not only equal to `[]'.
4566 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
4568 (symbol_destructor_set): New.
4569 * src/output.c (symbol_destructors_output): New.
4570 * src/reader.h (brace_code_t, current_braced_code): New.
4571 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
4572 (handle_dollar): Rename as...
4573 (handle_action_dollar): this.
4574 (handle_destructor_dollar): New.
4575 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
4576 (grammar_declaration): Use it.
4577 * data/bison.simple (yystos): Is always defined.
4578 (yydestructor): New.
4579 * tests/actions.at (Destructors): New.
4580 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
4582 2002-06-17 Akim Demaille <akim@epita.fr>
4584 * src/symlist.h, src/symlist.c (symbol_list_length): New.
4585 * src/scan-gram.l (handle_dollar, handle_at): Compute the
4586 rule_length only when needed.
4587 * src/output.c (actions_output, token_definitions_output): Output
4589 * src/symtab.c: Don't access directly to the symbol tag, use
4591 * src/parse-gram.y: Use symbol_list_free.
4593 2002-06-17 Akim Demaille <akim@epita.fr>
4595 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
4596 (symbol_list_prepend, get_type_name): Move to...
4597 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
4598 (symbol_list_prepend, symbol_list_n_type_name_get): here.
4600 (symbol_list_free): New.
4601 * src/scan-gram.l (handle_dollar): Takes a location.
4602 * tests/input.at (Invalid $n): Adjust.
4604 2002-06-17 Akim Demaille <akim@epita.fr>
4606 * src/reader.h, src/reader.c (symbol_list_new): Export it.
4607 (symbol_list_prepend): New.
4608 * src/parse-gram.y (%union): `list' is a new member.
4609 (symbols.1): New, replaces...
4610 (terms_to_prec.1, nterms_to_type.1): these.
4611 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
4612 Take a location as additional argument.
4615 2002-06-15 Akim Demaille <akim@epita.fr>
4617 * src/parse-gram.y: Move %token in the declaration section so that
4618 we don't depend upon CVS Bison.
4620 2002-06-15 Akim Demaille <akim@epita.fr>
4622 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
4623 * src/print.c (print_core): Use it.
4625 2002-06-15 Akim Demaille <akim@epita.fr>
4627 * src/conflicts.c (log_resolution): Accept the rule involved in
4628 the sr conflicts instead of the lookahead number that points to
4630 (flush_reduce): Accept the current lookahead vector as argument,
4631 instead of the index in LA.
4632 (resolve_sr_conflict): Accept the current number of lookahead
4633 bitset to consider for the STATE, instead of the index in LA.
4634 (set_conflicts): Adjust.
4635 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
4637 2002-06-15 Akim Demaille <akim@epita.fr>
4639 * src/state.h (state_t): Replace the `lookaheadsp' member, a
4640 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
4641 Adjust all dependencies.
4642 * src/lalr.c (initialize_lookaheads): Split into...
4643 (states_lookaheads_count, states_lookaheads_initialize): these.
4646 2002-06-15 Akim Demaille <akim@epita.fr>
4648 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
4650 (grammar_rules_print): here.
4651 * src/reduce.c (reduce_output): Use it.
4652 * tests/reduce.at (Useless Rules, Reduced Automaton)
4653 (Underivable Rules): Adjust.
4655 2002-06-15 Akim Demaille <akim@epita.fr>
4657 Copy BYacc's nice way to report the grammar.
4659 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
4661 Don't print the rules' location, it is confusing and useless.
4662 (rule_print): Use grammar_rhs_print.
4663 * src/print.c (print_grammar): Use grammar_rules_print.
4665 2002-06-15 Akim Demaille <akim@epita.fr>
4667 Complete and rationalize `useless thing' warnings.
4669 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
4670 (symbol_tag_print): New.
4671 Use them everywhere in place of accessing directly the tag member.
4672 * src/gram.h, src/gram.c (rule_print): New.
4673 Use it where a rule used to be printed `by hand'.
4674 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
4675 (reduce_grammar_tables): Report the useless rules.
4676 (reduce_print): Useless things are a warning, not an error.
4678 * tests/reduce.at (Useless Nonterminals, Useless Rules):
4679 (Reduced Automaton, Underivable Rules): Adjust.
4680 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
4681 * tests/conflicts.at (Unresolved SR Conflicts)
4682 (Solved SR Conflicts): Adjust.
4684 2002-06-15 Akim Demaille <akim@epita.fr>
4686 Let symbols have a location.
4688 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
4691 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
4692 Use location_t, not int.
4693 * src/symtab.c (symbol_check_defined): Take advantage of the
4695 * tests/regression.at (Invalid inputs): Adjust.
4697 2002-06-15 Akim Demaille <akim@epita.fr>
4699 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
4700 (input): Don't try to initialize yylloc here, do it in the
4702 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
4703 * src/gram.h (rule_t): Change line and action_line into location
4704 and action_location, of location_t type.
4705 Adjust all dependencies.
4706 * src/location.h, src/location.c (empty_location): New.
4707 * src/reader.h, src/reader.c (grammar_start_symbol_set)
4708 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
4709 (grammar_current_rule_symbol_append)
4710 (grammar_current_rule_action_append): Expect a location as argument.
4711 * src/reader.c (grammar_midrule_action): Adjust to attach an
4712 action's location as dummy symbol location.
4713 * src/symtab.h, src/symtab.c (startsymbol_location): New.
4714 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
4717 2002-06-14 Akim Demaille <akim@epita.fr>
4719 Grammar declarations may be found in the grammar section.
4721 * src/parse-gram.y (rules_or_grammar_declaration): New.
4722 (declarations): Each declaration may end with a semicolon, not
4724 (grammar_declaration): `"%union"'.
4725 (grammar): Branch to rules_or_grammar_declaration.
4727 2002-06-14 Akim Demaille <akim@epita.fr>
4729 * src/main.c (main): Invoke scanner_free.
4731 2002-06-14 Akim Demaille <akim@epita.fr>
4733 * src/output.c (m4_invoke): Extracted from...
4734 (output_skeleton): here.
4737 2002-06-14 Akim Demaille <akim@epita.fr>
4739 * src/parse-gram.y (directives, directive, gram)
4740 (grammar_directives, precedence_directives, precedence_directive):
4742 (declarations, declaration, grammar, grammar_declaration)
4743 (precedence_declaration, precedence_declarator): these.
4744 (symbol_declaration): New.
4746 2002-06-14 Akim Demaille <akim@epita.fr>
4748 * src/files.c (action_obstack): Remove, unused.
4749 (output_obstack): Remove it, and all its dependencies, as it is no
4751 * src/reader.c (epilogue_set): Build the epilogue in the
4753 * src/output.h, src/output.c (muscle_obstack): Move to...
4754 * src/muscle_tab.h, src/muscle_tab.h: here.
4755 (muscle_init): Initialize muscle_obstack.
4757 * src/main.c (main): Call it.
4759 2002-06-14 Akim Demaille <akim@epita.fr>
4761 * src/location.h: New, extracted from...
4762 * src/reader.h: here.
4763 * src/Makefile.am (noinst_HEADERS): Merge into
4764 (bison_SOURCES): this.
4766 * src/parse-gram.y: Use location_t instead of Bison's.
4767 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
4768 Use location_t instead of ints.
4770 2002-06-14 Akim Demaille <akim@epita.fr>
4772 * data/bison.simple, data/bison.c++: Be sure to restore the
4773 current #line when returning to the skeleton contents after having
4774 exposed the input file's #line.
4776 2002-06-12 Akim Demaille <akim@epita.fr>
4778 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
4780 * tests/actions.at (Exotic Dollars): New.
4782 2002-06-12 Akim Demaille <akim@epita.fr>
4784 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
4786 * tests/input.at (Torturing the Scanner): New.
4788 2002-06-11 Akim Demaille <akim@epita.fr>
4790 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
4791 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
4792 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
4793 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
4794 * src/reader.c (reader): Use it.
4796 2002-06-11 Akim Demaille <akim@epita.fr>
4798 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
4800 (scanner_last_string_free): New.
4802 2002-06-11 Akim Demaille <akim@epita.fr>
4804 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
4805 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
4806 (last_string, YY_OBS_FREE): New.
4807 Use them when returning an ID.
4809 2002-06-11 Akim Demaille <akim@epita.fr>
4811 Have Bison grammars parsed by a Bison grammar.
4813 * src/reader.c, src/reader.h (prologue_augment): New.
4814 * src/reader.c (copy_definition): Remove.
4816 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
4817 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
4818 (grammar_current_rule_prec_set, grammar_current_rule_check)
4819 (grammar_current_rule_symbol_append)
4820 (grammar_current_rule_action_append): Export.
4821 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
4822 (symbol_list_action_append): Remove.
4823 Hook the routines from reader.
4824 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
4825 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
4827 * src/reader.c (read_declarations): Remove, unused.
4829 * src/parse-gram.y: Handle the epilogue.
4830 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
4831 (grammar_start_symbol_set): this.
4832 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
4833 * src/reader.c (readgram): Remove, unused.
4834 (reader): Adjust to insert eoftoken and axiom where appropriate.
4836 * src/reader.c (copy_dollar): Replace with...
4837 * src/scan-gram.h (handle_dollar): this.
4838 * src/parse-gram.y: Remove `%thong'.
4840 * src/reader.c (copy_at): Replace with...
4841 * src/scan-gram.h (handle_at): this.
4843 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
4846 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
4849 * src/reader.h, src/reader.c (grammar_rule_end): New.
4851 * src/parse.y (current_type, current_class): New.
4852 Implement `%nterm', `%token' support.
4853 Merge `%term' into `%token'.
4854 (string_as_id): New.
4855 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
4858 * src/parse-gram.y: Be sure to handle properly the beginning of
4861 * src/parse-gram.y: Handle %type.
4862 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
4864 * src/parse-gram.y: More directives support.
4865 * src/options.c: No longer handle source directives.
4867 * src/parse-gram.y: Fix %output.
4869 * src/parse-gram.y: Handle %union.
4870 Use the prologue locations.
4871 * src/reader.c (parse_union_decl): Remove.
4873 * src/reader.h, src/reader.c (epilogue_set): New.
4874 * src/parse-gram.y: Use it.
4876 * data/bison.simple, data/bison.c++: b4_stype is now either not
4877 defined, then default to int, or to the contents of %union,
4878 without `union' itself.
4880 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
4882 * src/output.c (actions_output): Don't output braces, as they are
4883 already handled by the scanner.
4885 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
4886 characters to themselves.
4888 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
4889 that the epilogue has a proper #line.
4891 * src/parse-gram.y: Handle precedence/associativity.
4893 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
4895 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
4896 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
4897 at all to define terminals that cannot be emitted.
4899 * src/scan-gram.l: Escape M4 characters.
4901 * src/scan-gram.l: Working properly with escapes in user
4904 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
4905 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
4907 Use more modest sizes, as for the time being the parser does not
4908 release memory, and therefore the process swallows a huge amount
4911 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
4912 stricter %token grammar.
4914 * src/symtab.h (associativity): Add `undef_assoc'.
4915 (symbol_precedence_set): Do nothing when passed an undef_assoc.
4916 * src/symtab.c (symbol_check_alias_consistence): Adjust.
4918 * tests/regression.at (Invalid %directive): Remove, as it is now
4920 (Invalid inputs): Adjust to the new error messages.
4921 (Token definitions): The new grammar doesn't allow too many
4924 * src/lex.h, src/lex.c: Remove.
4925 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
4926 (copy_character, copy_string2, copy_string, copy_identifier)
4927 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
4928 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
4929 (parse_action): Remove.
4930 * po/POTFILES.in: Adjust.
4932 2002-06-11 Akim Demaille <akim@epita.fr>
4934 * src/reader.c (parse_action): Don't store directly into the
4935 rule's action member: return the action as a string.
4936 Don't require `rule_length' as an argument: compute it.
4937 (grammar_current_rule_symbol_append)
4938 (grammar_current_rule_action_append): New, eved out from
4940 Remove `action_flag', `rulelength', unused now.
4942 2002-06-11 Akim Demaille <akim@epita.fr>
4944 * src/reader.c (grammar_current_rule_prec_set).
4945 (grammar_current_rule_check): New, eved out from...
4947 Remove `xaction', `first_rhs': useless.
4948 * tests/input.at (Type clashes): New.
4949 * tests/existing.at (GNU Cim Grammar): Adjust.
4951 2002-06-11 Akim Demaille <akim@epita.fr>
4953 * src/reader.c (grammar_midrule_action): New, Eved out from
4956 2002-06-11 Akim Demaille <akim@epita.fr>
4958 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
4960 (readgram): Use them as replacement of inlined code, crule and
4963 2002-06-11 Akim Demaille <akim@epita.fr>
4965 * src/reader.c (grammar_end, grammar_symbol_append): New.
4966 (readgram): Use them.
4967 Make the use of `p' as local as possible.
4969 2002-06-10 Akim Demaille <akim@epita.fr>
4971 GCJ's parser requires the tokens to be defined before the prologue.
4973 * data/bison.simple: Output the token definition before the user's
4975 * tests/regression.at (Braces parsing, Duplicate string)
4976 (Mixing %token styles): Check the output from bison.
4977 (Early token definitions): New.
4979 2002-06-10 Akim Demaille <akim@epita.fr>
4981 * src/symtab.c (symbol_user_token_number_set): Don't complain when
4982 assigning twice the same user number to a token, so that we can
4984 * src/lex.c (lex): here.
4985 Also use `symbol_class_set' instead of hand written code.
4986 * src/reader.c (parse_assoc_decl): Likewise.
4988 2002-06-10 Akim Demaille <akim@epita.fr>
4990 * src/symtab.c, src/symtab.c (symbol_class_set)
4991 (symbol_user_token_number_set): New.
4992 * src/reader.c (parse_token_decl): Use them.
4993 Use a switch instead of ifs.
4994 Use a single argument.
4996 2002-06-10 Akim Demaille <akim@epita.fr>
4998 Remove `%thong' support as it is undocumented, unused, duplicates
4999 `%token's job, and creates useless e-mail traffic with people who
5000 want to know what it is, why it is undocumented, unused, and
5001 duplicates `%token's job.
5003 * src/reader.c (parse_thong_decl): Remove.
5004 * src/options.c (option_table): Remove "thong".
5005 * src/lex.h (tok_thong): Remove.
5007 2002-06-10 Akim Demaille <akim@epita.fr>
5009 * src/symtab.c, src/symtab.c (symbol_type_set)
5010 (symbol_precedence_set): New.
5011 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
5012 (value_components_used): Remove, unused.
5014 2002-06-09 Akim Demaille <akim@epita.fr>
5016 Move symbols handling code out of the reader.
5018 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
5020 * src/symtab.h, src/symtab.c: here.
5022 * src/gram.c (start_symbol): Remove: use startsymbol->number.
5023 * src/reader.c (startval): Rename as...
5024 * src/symtab.h, src/symtab.c (startsymbol): this.
5025 * src/reader.c: Adjust.
5027 * src/reader.c (symbol_check_defined, symbol_make_alias)
5028 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5029 (token_translations_init)
5031 * src/symtab.c: here.
5032 * src/reader.c (packsymbols): Move to...
5033 * src/symtab.h, src/symtab.c (symbols_pack): here.
5034 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
5037 2002-06-03 Akim Demaille <akim@epita.fr>
5039 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
5042 2002-06-03 Akim Demaille <akim@epita.fr>
5044 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
5045 structs with non literals.
5046 * src/scan-skel.l: never-interactive.
5047 * src/conflicts.c (enum conflict_resolution_e): No trailing
5049 * src/getargs.c (usage): Split long literal strings.
5050 Reported by Hans Aberg.
5052 2002-05-28 Akim Demaille <akim@epita.fr>
5054 * data/bison.c++: Use C++ ostreams.
5055 (cdebug_): New member.
5057 2002-05-28 Akim Demaille <akim@epita.fr>
5059 * src/output.c (output_skeleton): Be sure to allocate enough room
5060 for `/' _and_ for `\0' in full_skeleton.
5062 2002-05-28 Akim Demaille <akim@epita.fr>
5064 * data/bison.c++: Catch up with bison.simple:
5065 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5066 and Paul Eggert <eggert@twinsun.com>: `error' handing.
5067 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
5070 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5072 * src/output.c (output_skeleton): Put an explicit path in front of
5073 the skeleton file name, rather than relying on the -I directory,
5074 to partially alleviate effects of having a skeleton file lying around
5075 in the current directory.
5077 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5079 * src/conflicts.c (log_resolution): Correct typo:
5080 obstack_printf should be obstack_fgrow1.
5082 2002-05-26 Akim Demaille <akim@epita.fr>
5084 * src/state.h (state_t): `solved_conflicts' is a new member.
5085 * src/LR0.c (new_state): Set it to 0.
5086 * src/conflicts.h, src/conflicts.c (print_conflicts)
5087 (free_conflicts, solve_conflicts): Rename as...
5088 (conflicts_print, conflicts_free, conflicts_solve): these.
5090 * src/conflicts.c (enum conflict_resolution_e)
5091 (solved_conflicts_obstack): New, used by...
5092 (log_resolution): this.
5093 Adjust to attach the conflict resolution to each state.
5094 Complete the description with the precedence/associativity
5096 (resolve_sr_conflict): Adjust.
5097 * src/print.c (print_state): Output its solved_conflicts.
5098 * tests/conflicts.at (Unresolved SR Conflicts)
5099 (Solved SR Conflicts): Exercise --report=all.
5101 2002-05-26 Akim Demaille <akim@epita.fr>
5103 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5104 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5105 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
5106 (token_number_t, item_number_as_token_number)
5107 (token_number_as_item_number, muscle_insert_token_number_table):
5109 (symbol_number_t, item_number_as_symbol_number)
5110 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
5111 these, since it is more appropriate.
5113 2002-05-26 Akim Demaille <akim@epita.fr>
5115 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
5117 * data/bison.simple (yystos) [YYDEBUG]: New.
5118 (yyparse) [YYDEBUG]: Display the symbols which are popped during
5120 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
5122 2002-05-25 Akim Demaille <akim@epita.fr>
5124 * doc/bison.texinfo (Debugging): Split into...
5125 (Tracing): this new section, its former contents, and...
5126 (Understanding): this new section.
5127 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
5129 (report_flag): this.
5130 Adjust all dependencies.
5131 (report_args, report_types, report_argmatch): New.
5132 (usage, getargs): Report/support -r, --report.
5134 (struct option_table_struct): Rename as..,
5135 (struct option_table_s): this.
5136 Rename the `set_flag' member to `flag' to match with getopt_long's
5138 * src/options.c (option_table): Split verbose into an entry for
5139 %verbose, and another for --verbose.
5140 Support --report/-r, so remove -r from the obsolete --raw.
5141 * src/print.c: Attach full item sets and lookaheads reports to
5142 report_flag instead of trace_flag.
5143 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
5145 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5146 and Paul Eggert <eggert@twinsun.com>
5148 * data/bison.simple (yyparse): Correct error handling to conform to
5149 POSIX and yacc. Specifically, after syntax error is discovered,
5150 do not reduce further before shifting the error token.
5151 Clean up the code a bit by removing the labels yyerrdefault,
5152 yyerrhandle, yyerrpop.
5153 * NEWS: Document the above.
5155 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5157 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
5158 type; it isn't always big enough, since it doesn't necessarily
5159 include non-terminals.
5160 (yytranslate): Expand definition of yy_token_number_type, so that
5161 the latter can be removed.
5162 (yy_token_number_type): Remove, only one use.
5163 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
5164 don't use TokenNumberType as element type.
5166 * tests/regression.at: Modify expected output to agree with change
5167 to yyr1 and yytranslate.
5169 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
5171 * src/reader.c (parse_action): Use copy_character instead of
5174 2002-05-13 Akim Demaille <akim@epita.fr>
5176 * tests/regression.at (Token definitions): Prototype yylex and
5179 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5181 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
5182 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
5184 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
5186 2002-05-07 Akim Demaille <akim@epita.fr>
5188 * tests/synclines.at: Be sure to prototype yylex and yyerror to
5191 2002-05-07 Akim Demaille <akim@epita.fr>
5195 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
5196 over the RHS of each rule.
5197 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
5198 * src/state.h (state_t): Member `nitems' is unsigned short.
5199 * src/LR0.c (get_state): Adjust.
5200 * src/reader.c (packgram): Likewise.
5201 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
5203 (muscle_insert_int_table): Remove, unused.
5204 (prepare_rules): Remove `max'.
5206 2002-05-06 Akim Demaille <akim@epita.fr>
5208 * src/closure.c (print_firsts): Display of the symbol tags.
5209 (bitmatrix_print): Move to...
5210 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
5212 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
5214 2002-05-06 Akim Demaille <akim@epita.fr>
5216 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
5219 2002-05-06 Akim Demaille <akim@epita.fr>
5221 * src/LR0.c (new_state, get_state): Instead of using the global
5222 `kernel_size' and `kernel_base', have two new arguments:
5223 `core_size' and `core'.
5226 2002-05-06 Akim Demaille <akim@epita.fr>
5228 * src/reader.c (packgram): No longer end `ritem' with a 0
5229 sentinel: it is not used.
5231 2002-05-05 Akim Demaille <akim@epita.fr>
5233 New experimental feature: display the lookaheads in the report and
5236 * src/print (print_core): When --trace-flag, display the rules
5238 * src/print_graph.c (print_core): Likewise.
5242 2002-05-05 Akim Demaille <akim@epita.fr>
5244 * tests/torture.at (Many lookaheads): New test.
5246 2002-05-05 Akim Demaille <akim@epita.fr>
5248 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
5249 (GENERATE_MUSCLE_INSERT_TABLE): this.
5250 (output_int_table, output_unsigned_int_table, output_short_table)
5251 (output_token_number_table, output_item_number_table): Replace with...
5252 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
5253 (muscle_insert_short_table, muscle_insert_token_number_table)
5254 (muscle_insert_item_number_table): these.
5256 (prepare_tokens): Don't free `translations', since...
5257 * src/reader.h, src/reader.c (grammar_free): do it.
5259 * src/gram.h, src/gram.c (grammar_free): here.
5260 * data/bison.simple, data/bison.c++: b4_token_number_max is now
5263 2002-05-05 Akim Demaille <akim@epita.fr>
5265 * src/output.c (output_unsigned_int_table): New.
5266 (prepare_rules): `i' is unsigned.
5267 `prhs', `rline', `r2' are unsigned int.
5268 Rename muscle `rhs_number_max' as `rhs_max'.
5269 Output muscles `prhs_max', `rline_max', and `r2_max'.
5271 * data/bison.simple, data/bison.c++: Adjust to use these muscles
5272 to compute types instead of constant types.
5273 * tests/regression.at (Web2c Actions): Adjust.
5275 2002-05-04 Akim Demaille <akim@epita.fr>
5277 * src/symtab.h (SALIAS, SUNDEF): Rename as...
5278 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
5279 Adjust dependencies.
5280 * src/output.c (token_definitions_output): Be sure not to output a
5281 `#define 'a'' when fed with `%token 'a' "a"'.
5282 * tests/regression.at (Token definitions): New.
5284 2002-05-03 Paul Eggert <eggert@twinsun.com>
5286 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
5289 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
5291 * Makefile.am (SUBDIRS): Remove intl.
5292 (EXTRA_DIST): Add config/config.rpath.
5294 2002-05-03 Akim Demaille <akim@epita.fr>
5296 * data/bison.simple (m4_if): Don't output empty enums.
5297 And actually, output valid enum definitions :(.
5299 2002-05-03 Akim Demaille <akim@epita.fr>
5301 * configure.bat: Remove, completely obsolete.
5302 * Makefile.am (EXTRA_DIST): Adjust.
5303 Don't distribute config.rpath...
5304 * config/Makefile.am (EXTRA_DIST): Do it.
5306 2002-05-03 Akim Demaille <akim@epita.fr>
5308 * configure.in (GETTEXT_VERSION): New.
5309 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
5311 2002-05-03 Akim Demaille <akim@epita.fr>
5313 * data/bison.simple (b4_token_enum): New.
5314 (b4_token_defines): Use it to output tokens both as #define and
5316 Suggested by Paul Eggert.
5317 * src/output.c (token_definitions_output): Don't output spurious
5320 2002-05-03 Akim Demaille <akim@epita.fr>
5322 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5324 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
5326 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
5327 Update the stack class, give a try to deque as the default container.
5329 2002-05-02 Akim Demaille <akim@epita.fr>
5331 * data/bison.simple (yyparse): Do not implement @$ = @1.
5332 (YYLLOC_DEFAULT): Adjust to do it.
5333 * doc/bison.texinfo (Location Default Action): Fix.
5335 2002-05-02 Akim Demaille <akim@epita.fr>
5337 * src/reader.c (parse_braces): Merge into...
5338 (parse_action): this.
5340 2002-05-02 Akim Demaille <akim@epita.fr>
5342 * configure.in (ALL_LINGUAS): Remove.
5343 * po/LINGUAS, hr.po: New.
5345 2002-05-02 Akim Demaille <akim@epita.fr>
5347 Remove the so called hairy (semantic) parsers.
5349 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
5350 * src/gram.h, src/gram.c (semantic_parser): Remove.
5351 (rule_t): Remove the guard and guard_line members.
5352 * src/lex.h (token_t): remove tok_guard.
5353 * src/options.c (option_table): Remove %guard and %semantic_parser
5355 * src/output.c, src/output.h (guards_output): Remove.
5357 (token_definitions_output): Don't output the `T'
5359 (output_skeleton): Don't output the guards.
5360 * src/files.c, src/files.c (attrsfile): Remove.
5361 * src/reader.c (symbol_list): Remove the guard and guard_line
5363 Adjust dependencies.
5364 (parse_guard): Remove.
5365 * data/bison.hairy: Remove.
5366 * doc/bison.texinfo (Environment Variables): Remove occurrences of
5369 2002-05-02 Akim Demaille <akim@epita.fr>
5371 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
5372 (parse_guard): Rename the formal argument `stack_offset' as
5373 `rule_length', which is more readable.
5375 (copy_at, copy_dollar): Instead of outputting the hard coded
5376 values of $$, $n and so forth, output invocation to b4_lhs_value,
5377 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
5378 Note: this patch partially drops `semantic-parser' support: it
5379 always does `rule_length - n', where semantic parsers ought to
5381 * data/bison.simple, data/bison.c++ (b4_lhs_value)
5382 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
5384 2002-05-02 Akim Demaille <akim@epita.fr>
5386 * configure.in (AC_INIT): Bump to 1.49b.
5387 (AM_INIT_AUTOMAKE): Short invocation.
5389 2002-05-02 Akim Demaille <akim@epita.fr>
5393 2002-05-01 Akim Demaille <akim@epita.fr>
5395 * src/skeleton.h: Remove.
5397 2002-05-01 Akim Demaille <akim@epita.fr>
5399 * src/skeleton.h: Fix the #endif.
5400 Reported by Magnus Fromreide.
5402 2002-04-26 Paul Eggert <eggert@twinsun.com>
5404 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
5405 Define if we define YYSTYPE and YYLTYPE, respectively.
5406 (YYCOPY): Fix [] quoting problem in the non-GCC case.
5408 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
5410 * src/scan-skel.l: Postprocess quadrigraphs.
5412 * src/reader.c (copy_character): New function, used to output
5413 single characters while replacing `[' and `]' with quadrigraphs, to
5414 avoid troubles with M4 quotes.
5415 (copy_comment): Output characters with copy_character.
5416 (read_additionnal_code): Likewise.
5417 (copy_string2): Likewise.
5418 (copy_definition): Likewise.
5420 * tests/calc.at: Exercise M4 quoting.
5422 2002-04-25 Akim Demaille <akim@epita.fr>
5424 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
5425 between `!' and the command.
5426 Reported by Paul Eggert.
5428 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
5430 * tests/calc.at: Exercise prologue splitting.
5432 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
5433 `b4_post_prologue' instead of `b4_prologue'.
5435 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
5437 (output): Free pre_prologue_obstack and post_prologue_obstack.
5438 * src/files.h, src/files.c (attrs_obstack): Remove.
5439 (pre_prologue_obstack, post_prologue_obstack): New.
5440 * src/reader.c (copy_definition): Add a parameter to specify the
5441 obstack to fill, instead of using attrs_obstack unconditionally.
5442 (read_declarations): Pass pre_prologue_obstack to copy_definition if
5443 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
5445 2002-04-23 Paul Eggert <eggert@twinsun.com>
5447 * data/bison.simple: Remove unnecessary commentary and white
5448 space differences from 1_29-branch.
5449 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
5451 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
5452 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
5453 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
5454 constructors or destructors.
5456 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
5458 2002-04-23 Akim Demaille <akim@epita.fr>
5460 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
5461 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
5462 location with columns.
5463 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
5464 All reported by Paul Eggert.
5466 2002-04-22 Akim Demaille <akim@epita.fr>
5468 * src/reduce.c (dump_grammar): Move to...
5469 * src/gram.h, src/gram.c (grammar_dump): here.
5470 Be sure to separate long item numbers.
5471 Don't read the members of a rule's prec if its nil.
5473 2002-04-22 Akim Demaille <akim@epita.fr>
5475 * src/output.c (table_size, table_grow): New.
5476 (MAXTABLE): Remove, replace uses with table_size.
5477 (pack_vector): Instead of dying when the table is too big, grow it.
5479 2002-04-22 Akim Demaille <akim@epita.fr>
5481 * data/bison.simple (yyr1): Its type is that of a token number.
5482 * data/bison.c++ (r1_): Likewise.
5483 * tests/regression.at (Web2c Actions): Adjust.
5485 2002-04-22 Akim Demaille <akim@epita.fr>
5487 * src/reader.c (token_translations_init): 256 is now the default
5488 value for the error token, i.e., it will be assigned another
5489 number if the user assigned 256 to one of her tokens.
5490 (reader): Don't force 256 to error.
5491 * doc/bison.texinfo (Symbols): Adjust.
5492 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
5493 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
5494 etc. instead of 10, 20, 30 (which was used to `jump' over error
5495 (256) and undefined (2)).
5497 2002-04-22 Akim Demaille <akim@epita.fr>
5499 Propagate more token_number_t.
5501 * src/gram.h (token_number_as_item_number)
5502 (item_number_as_token_number): New.
5503 * src/output.c (GENERATE_OUTPUT_TABLE): New.
5504 Use it to create output_item_number_table and
5505 output_token_number_table.
5506 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
5507 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
5508 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
5509 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
5511 2002-04-22 Akim Demaille <akim@epita.fr>
5513 * src/output.h, src/output.c (get_lines_number): Remove.
5515 2002-04-19 Akim Demaille <akim@epita.fr>
5517 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
5519 (Debugging): More details about enabling the debugging features.
5520 (Table of Symbols): Describe $$, $n, @$, and @n.
5521 Suggested by Tim Josling.
5523 2002-04-19 Akim Demaille <akim@epita.fr>
5525 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
5527 2002-04-10 Akim Demaille <akim@epita.fr>
5529 * src/system.h: Rely on HAVE_LIMITS_H.
5530 Suggested by Paul Eggert.
5532 2002-04-09 Akim Demaille <akim@epita.fr>
5534 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
5535 full stderr, and strip it according to the bison options, instead
5536 of composing the error message from different bits.
5537 This makes it easier to check for several error messages.
5538 Adjust all the invocations.
5539 Add an invocation exercising the error token.
5540 Add an invocation demonstrating a stupid error message.
5541 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
5543 Error message are for stderr, not stdout.
5545 2002-04-09 Akim Demaille <akim@epita.fr>
5547 * src/gram.h, src/gram.c (error_token_number): Remove, use
5549 * src/reader.c (reader): Don't specify the user token number (2)
5550 for $undefined, as it uselessly prevents using it.
5551 * src/gram.h (token_number_t): Move to...
5552 * src/symtab.h: here.
5553 (state_t.number): Is a token_number_t.
5554 * src/print.c, src/reader.c: Use undeftoken->number instead of
5556 (Even though this 2 is not the same as above: the number of the
5557 undeftoken remains being 2, it is its user token number which
5559 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
5560 `user_token_number_max'.
5561 Output `undef_token_number'.
5562 * data/bison.simple, data/bison.c++: Use them.
5563 Be sure to map invalid yylex return values to
5564 `undef_token_number'. This saves us from gratuitous SEGV.
5566 * tests/conflicts.at (Solved SR Conflicts)
5567 (Unresolved SR Conflicts): Adjust.
5568 * tests/regression.at (Web2c Actions): Adjust.
5570 2002-04-08 Akim Demaille <akim@epita.fr>
5572 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
5574 Remove the duplicate `typedefs'.
5575 (RhsNumberType): Fix the declaration and various other typos.
5577 * data/bison.simple: Use __ofile__.
5578 * src/scan-skel.l: Handle __ofile__.
5580 2002-04-08 Akim Demaille <akim@epita.fr>
5582 * src/gram.h (item_number_t): New, the type of item numbers in
5583 RITEM. Note that it must be able to code symbol numbers as
5584 positive number, and the negation of rule numbers as negative
5586 Adjust all dependencies (pretty many).
5587 * src/reduce.c (rule): Remove this `short *' pointer: use
5589 * src/system.h (MINSHORT, MAXSHORT): Remove.
5591 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
5593 (MAXTABLE): Move to...
5594 * src/output.c (MAXTABLE): here.
5595 (prepare_rules): Use output_int_table to output rhs.
5596 * data/bison.simple, data/bison.c++: Adjust.
5597 * tests/torture.at (Big triangle): Move the limit from 254 to
5599 * tests/regression.at (Web2c Actions): Ajust.
5601 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
5602 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
5603 passes, but produces negative #line number, once fixed, GCC is
5604 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
5606 * src/state.h (state_h): Code input lines on ints, not shorts.
5608 2002-04-08 Akim Demaille <akim@epita.fr>
5610 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
5611 and then the grammar.
5613 2002-04-08 Akim Demaille <akim@epita.fr>
5615 * src/system.h: No longer using strndup.
5617 2002-04-07 Akim Demaille <akim@epita.fr>
5619 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
5620 * src/output.c (output_table_data): Return the longest number.
5621 (prepare_tokens): Output `token_number_max').
5622 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
5624 Use them to define yy_token_number_type/TokenNumberType.
5625 Use this type for yytranslate.
5626 * tests/torture.at (Big triangle): Push the limit from 124 to
5628 * tests/regression.at (Web2c Actions): Adjust.
5630 2002-04-07 Akim Demaille <akim@epita.fr>
5632 * tests/torture.at (Big triangle): New.
5633 (GNU AWK Grammar, GNU Cim Grammar): Move to...
5634 * tests/existing.at: here.
5636 2002-04-07 Akim Demaille <akim@epita.fr>
5638 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
5640 Adjust dependencies.
5642 2002-04-07 Akim Demaille <akim@epita.fr>
5644 * src/reader.c: Normalize increments to prefix form.
5646 2002-04-07 Akim Demaille <akim@epita.fr>
5648 * src/reader.c, symtab.c: Remove debugging code.
5650 2002-04-07 Akim Demaille <akim@epita.fr>
5652 Rename all the `bucket's as `symbol_t'.
5654 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
5655 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
5656 * src/symtab.c, src/symtab.h (bucket): Rename as...
5658 (symbol_list_new, bucket_check_defined, bucket_make_alias)
5659 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
5660 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5661 (buckets_new, buckets_free, buckets_do): Rename as...
5662 (symbol_list_new, symbol_check_defined, symbol_make_alias)
5663 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
5664 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
5665 (symbols_new, symbols_free, symbols_do): these.
5667 2002-04-07 Akim Demaille <akim@epita.fr>
5669 Use lib/hash for the symbol table.
5671 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
5673 * src/lex.c (lex): Set the `number' member of new terminals.
5674 * src/reader.c (bucket_check_defined, bucket_make_alias)
5675 (bucket_check_alias_consistence, bucket_translation): New.
5676 (reader, grammar_free, readgram, token_translations_init)
5677 (packsymbols): Adjust.
5678 (reader): Number the predefined tokens.
5679 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
5680 for predefined tokens.
5681 * src/symtab.h (bucket): Remove all the hash table related
5683 * src/symtab.c (symtab): Replace by...
5684 (bucket_table): this.
5685 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
5686 (buckets_new, buckets_do): New.
5688 2002-04-07 Akim Demaille <akim@epita.fr>
5690 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
5691 (start_symbol, max_user_token_number, semantic_parser)
5692 (error_token_number): Initialize.
5693 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
5696 (errtoken, eoftoken, undeftoken, axiom): Extern.
5698 2002-04-07 Akim Demaille <akim@epita.fr>
5700 * src/gram.h (rule_s): prec and precsym are now pointers
5701 to the bucket giving the priority/associativity.
5702 Member `associativity' removed: useless.
5703 * src/reduce.c, src/conflicts.c: Adjust.
5705 2002-04-07 Akim Demaille <akim@epita.fr>
5707 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
5708 Properly escape the symbols' TAG when outputting them.
5710 2002-04-07 Akim Demaille <akim@epita.fr>
5712 * src/lalr.h (LA): Is a bitsetv, not bitset*.
5714 2002-04-07 Akim Demaille <akim@epita.fr>
5716 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
5717 (LArule): this, which is an array to rule_t*.
5718 * src/print.c, src/conflicts.c: Adjust.
5720 2002-04-07 Akim Demaille <akim@epita.fr>
5722 * src/gram.h (rule_t): Rename `number' as `user_number'.
5723 `number' is a new member.
5724 Adjust dependencies.
5725 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
5727 2002-04-07 Akim Demaille <akim@epita.fr>
5729 As a result of the previous patch, it is no longer needed
5730 to reorder ritem itself.
5732 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
5734 2002-04-07 Akim Demaille <akim@epita.fr>
5736 Be sure never to walk through RITEMS, but use only data related to
5737 the rules themselves. RITEMS should be banished.
5739 * src/output.c (output_token_translations): Rename as...
5740 (prepare_tokens): this.
5741 In addition to `translate', prepare the muscles `tname' and
5742 `toknum', which were handled by...
5743 (output_rule_data): this.
5744 Remove, and move the remainder of its outputs into...
5745 (prepare_rules): this new routines, which also merges content from
5746 (output_gram): this.
5747 (prepare_rules): Be sure never to walk through RITEMS.
5748 (output_stos): Rename as...
5749 (prepare_stos): this.
5750 (output): Always invoke prepare_states, after all, just don't use it
5751 in the output if you don't need it.
5753 2002-04-07 Akim Demaille <akim@epita.fr>
5755 * src/LR0.c (new_state): Display `nstates' as the name of the
5756 newly created state.
5757 Adjust to initialize first_state and last_state if needed.
5758 Be sure to distinguish the initial from the final state.
5759 (new_states): Create the itemset of the initial state, and use
5761 * src/closure.c (closure): Now that the initial state has its
5762 items properly set, there is no need for a special case when
5765 As a result, now the rule 0, reducing to $axiom, is visible in the
5766 outputs. Adjust the test suite.
5768 * tests/conflicts.at (Solved SR Conflicts)
5769 (Unresolved SR Conflicts): Adjust.
5770 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
5771 * tests/conflicts.at (S/R in initial): New.
5773 2002-04-07 Akim Demaille <akim@epita.fr>
5775 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
5776 the RHS of the rules.
5777 * src/output.c (output_gram): Likewise.
5779 2002-04-07 Akim Demaille <akim@epita.fr>
5781 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
5783 Adjust all dependencies.
5784 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
5785 `number' of the buckets too.
5786 * src/gram.h: Include `symtab.h'.
5787 (associativity): Move to...
5788 * src/symtab.h: here.
5789 No longer include `gram.h'.
5791 2002-04-07 Akim Demaille <akim@epita.fr>
5793 * src/gram.h, src/gram.c (rules_rhs_length): New.
5794 (ritem_longest_rhs): Use it.
5795 * src/gram.h (rule_t): `number' is a new member.
5796 * src/reader.c (packgram): Set it.
5797 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
5798 the end of `rules', and count them out of `nrules'.
5799 (reduce_output, dump_grammar): Adjust.
5800 * src/print.c (print_grammar): It is no longer needed to check for
5801 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
5802 * tests/reduce.at (Reduced Automaton): New test.
5804 2002-04-07 Akim Demaille <akim@epita.fr>
5806 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
5807 lacking `+ 1' to nrules, Bison reported as useless a token if it
5808 was used solely to set the precedence of the last rule...
5810 2002-04-07 Akim Demaille <akim@epita.fr>
5812 * data/bison.c++, data/bison.simple: Don't output the current file
5813 name in #line, to avoid useless diffs between two identical
5814 outputs under different names.
5816 2002-04-07 Akim Demaille <akim@epita.fr>
5818 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
5819 Normalize loops to using `< nrules + 1', not `<= nrules'.
5821 2002-04-07 Akim Demaille <akim@epita.fr>
5825 2002-04-07 Akim Demaille <akim@epita.fr>
5827 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
5828 bucket.value as bucket.number.
5830 2002-04-07 Akim Demaille <akim@epita.fr>
5832 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
5833 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
5834 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
5835 RHS, instead of being an index in RITEMS.
5837 2002-04-04 Paul Eggert <eggert@twinsun.com>
5839 * doc/bison.texinfo: Update copyright date.
5840 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
5841 (Symbols): Warn about running Bison in one character set,
5842 but compiling and/or running in an incompatible one.
5843 Warn about character code 256, too.
5845 2002-04-03 Paul Eggert <eggert@twinsun.com>
5847 * src/bison.data (YYSTACK_ALLOC): Depend on whether
5848 YYERROR_VERBOSE is nonzero, not whether it is defined.
5850 Merge changes from bison-1_29-branch.
5852 2002-03-20 Paul Eggert <eggert@twinsun.com>
5854 Merge fixes from Debian bison_1.34-1.diff.
5856 * configure.in (AC_PREREQ): 2.53.
5858 2002-03-20 Akim Demaille <akim@epita.fr>
5860 * src/conflicts.c (log_resolution): Argument `resolution' is const.
5862 2002-03-19 Paul Eggert <eggert@twinsun.com>
5864 * src/bison.simple (YYCOPY): New macro.
5865 (YYSTACK_RELOCATE): Use it.
5866 Remove Type arg; no longer needed. All callers changed.
5867 (yymemcpy): Remove; no longer needed.
5869 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
5870 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
5872 2002-03-19 Akim Demaille <akim@epita.fr>
5874 Test and fix the #line outputs.
5876 * tests/atlocal.at (GCC): New.
5877 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
5878 (Prologue synch line, ,%union synch line, Postprologue synch line)
5879 (Action synch line, Epilogue synch line): New tests.
5880 * src/reader.c (parse_union_decl): Define the muscle stype_line.
5881 * data/bison.simple, data/bison.c++: Use it.
5883 2002-03-19 Akim Demaille <akim@epita.fr>
5885 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
5886 (Solved SR Conflicts, %expect not enough, %expect right)
5887 (%expect too much): Move to...
5888 * tests/conflicts.at: this new file.
5890 2002-03-19 Akim Demaille <akim@epita.fr>
5892 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
5893 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
5894 that we can move to enums for instance.
5895 * src/output.c (token_definitions_output): Output a list of
5896 `token-name, token-number' instead of the #define.
5897 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
5899 2002-03-14 Akim Demaille <akim@epita.fr>
5903 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
5905 * data/bison.c++: Make the user able to add members to the generated
5906 parser by subclassing.
5908 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
5910 * src/reader.c (read_additionnal_code): `c' should be an integer, not
5912 Reported by Nicolas Tisserand and Nicolas Burrus.
5914 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
5916 * src/reader.c: Warn about lacking semi-colons, do not complain.
5918 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
5920 * data/bison.c++: Remove a debug line.
5922 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
5924 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
5925 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
5926 provide a default implementation.
5928 2002-03-04 Akim Demaille <akim@epita.fr>
5930 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
5931 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
5932 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
5933 * tests/semantic.at (Parsing Guards): Similarly.
5934 * src/reader.at (readgram): Complain if the last rule is not ended
5937 2002-03-04 Akim Demaille <akim@epita.fr>
5939 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
5940 * src/closure.c: here.
5941 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
5943 * src/warshall.h, src/warshall.c: Remove.
5944 * tests/sets.at (Broken Closure): Adjust.
5946 2002-03-04 Akim Demaille <akim@epita.fr>
5948 * src/output.c (output_skeleton): tempdir is const.
5949 bytes_read is unused.
5951 2002-03-04 Akim Demaille <akim@epita.fr>
5953 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
5954 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
5958 2002-03-04 Akim Demaille <akim@epita.fr>
5960 * src/closure.c (closure): `r' is unused.
5962 2002-03-04 Akim Demaille <akim@epita.fr>
5964 * tests/sets.at (Broken Closure): Add the ending `;'.
5965 * src/reader.at (readgram): Complain if a rule is not ended with a
5968 2002-03-04 Akim Demaille <akim@epita.fr>
5970 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
5971 (count_sr_conflicts): Use bitset_count.
5972 * src/reduce.c (inaccessable_symbols): Ditto.
5973 (bits_size): Remove.
5974 * src/warshall.h, src/warshall.c: Convert to bitsetv.
5976 2002-03-04 Akim Demaille <akim@epita.fr>
5978 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
5979 * src/reduce.c: Remove the `bitset_zero's following the
5980 `bitset_create's, as now it is performed by the latter.
5982 2002-03-04 Akim Demaille <akim@epita.fr>
5984 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
5985 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
5986 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
5987 latest sources from Michael.
5989 2002-03-04 Akim Demaille <akim@epita.fr>
5991 * src/output.c (output): Don't free the grammar.
5992 * src/reader.c (grammar_free): New.
5993 * src/main.c (main): Call it and don't free symtab here.
5995 2002-03-04 Akim Demaille <akim@epita.fr>
5997 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
5999 Reported by Benoit Perrot.
6001 2002-03-04 Akim Demaille <akim@epita.fr>
6003 Use bitset operations when possible, not loops over bits.
6005 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
6007 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
6008 * src/reduce.c (useless_nonterminals): Formatting changes.
6009 * src/warshall.c (TC): Use bitset_or.
6011 2002-03-04 Akim Demaille <akim@epita.fr>
6013 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
6014 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
6017 2002-03-04 Akim Demaille <akim@epita.fr>
6019 * src/lalr.c (F): Now a bitset*.
6020 Adjust all dependencies.
6022 2002-03-04 Akim Demaille <akim@epita.fr>
6024 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
6025 Adjust all dependencies.
6027 2002-03-04 Akim Demaille <akim@epita.fr>
6029 * src/L0.c, src/LR0.h (nstates): Be size_t.
6030 Adjust comparisons (signed vs unsigned).
6031 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
6033 Adjust all dependencies.
6035 2002-03-04 Akim Demaille <akim@epita.fr>
6037 * src/closure.c (firsts): Now, also a bitset.
6038 Adjust all dependencies.
6039 (varsetsize): Remove, now unused.
6040 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
6042 2002-03-04 Akim Demaille <akim@epita.fr>
6044 * src/print.c: Convert to use bitset.h, not hand coded iterations
6047 2002-03-04 Akim Demaille <akim@epita.fr>
6049 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
6051 2002-03-04 Akim Demaille <akim@epita.fr>
6053 * src/closure.c (ruleset): Be a bitset.
6054 (rulesetsize): Remove.
6056 2002-03-04 Akim Demaille <akim@epita.fr>
6058 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
6059 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
6060 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
6061 * src/closure.c (fderives): Be an array of bitsets.
6063 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
6065 * data/bison.c++: Merge the two generated headers. Insert a copyright
6066 notice in each output file.
6068 2002-02-28 Akim Demaille <akim@epita.fr>
6070 * data/bison.c++: Copy the prologue of bison.simple to fetch
6071 useful M4 definitions, such as b4_header_guard.
6073 2002-02-25 Akim Demaille <akim@epita.fr>
6075 * src/getargs.c (version): Give the name of the authors, and use a
6076 translator friendly scheme for the bgr
6079 2002-02-25 Akim Demaille <akim@epita.fr>
6081 * src/output.c (header_output): Remove, now handled completely via
6084 2002-02-25 Akim Demaille <akim@epita.fr>
6086 * m4/m4.m4: New, from CVS Autoconf.
6087 * configure.in: Invoke it.
6088 * src/output.c (output_skeleton): Use its result instead of the
6091 2002-02-25 Akim Demaille <akim@epita.fr>
6093 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
6095 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
6096 * src/output.c (output_skeleton): Use mkstemp to create a real
6098 Move the filling of `skeleton' and its muscle to...
6100 (output): Move the definition of the prologue muscle to...
6102 * src/system.h (DEFAULT_TMPDIR): New.
6104 2002-02-14 Paul Eggert <eggert@twinsun.com>
6106 Remove the support for C++ namespace cleanliness; it was
6107 causing more problems than it was curing, since it didn't work
6108 properly on some nonstandard C++ compilers. This can wait
6109 for a proper C++ parser.
6111 * NEWS: Document this.
6112 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
6113 of C++, as it's treated like C now.
6114 * src/bison.simple (YYSTD): Remove.
6115 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
6116 Treat C++ just like Standard C instead of trying to support
6117 namespace cleanliness.
6119 2002-02-14 Akim Demaille <akim@epita.fr>
6121 * tests/regression.at (else): Adjust to Andreas' change.
6123 2002-02-14 Akim Demaille <akim@epita.fr>
6125 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
6127 2002-02-13 Andreas Schwab <schwab@suse.de>
6129 * src/output.c (output_rule_data): Don't output NULL, it might
6132 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
6134 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
6135 (Copyright notice): Update.
6137 2002-02-11 Akim Demaille <akim@epita.fr>
6139 * tests/regression.at (%nonassoc and eof): Don't include
6140 nonportable headers.
6142 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
6144 * data/bison.c++: Correct error recovery. Make the user able to
6145 initialize the starting location.
6147 2002-02-07 Akim Demaille <akim@epita.fr>
6149 * tests/input.at: New.
6151 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6153 * data/bison.c++: Replace some direct m4 expansions by constants. Be
6154 more consistent when naming methods and variables. Put preprocessor
6155 directives around tables only needed for debugging.
6157 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6159 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
6161 (yy::b4_name::parse): Use print_.
6163 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6165 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
6167 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
6169 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
6171 (yy::b4_name::parse): Build verbose error messages, and use error_.
6173 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
6175 * data/bison.c++: Fix m4 quoting in comments.
6177 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
6179 * data/bison.c++: Adjust the parser code. Fix some muscles that were
6182 2002-02-05 Akim Demaille <akim@epita.fr>
6184 * data/bison.c++: Adjust to the M4 back end.
6185 More is certainly needed.
6187 2002-02-05 Akim Demaille <akim@epita.fr>
6189 Give a try to M4 as a back end.
6191 * lib/readpipe.c: New, from wdiff.
6192 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
6194 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
6195 specific values. Now it is m4 that performs the lookup.
6196 * src/parse-skel.y: Remove.
6197 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
6198 * src/output.c (actions_output, guards_output)
6199 (token_definitions_output): No longer keeps track of the output
6200 line number, hence remove the second argument.
6201 (guards_output): Check against the guard member of a rule, not the
6204 (output_skeleton): Don't look for the skeleton location, let m4 do
6206 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
6208 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
6209 (prepare): Given that for the time being changesyntax is not
6210 usable in M4, rename the muscles using `-' to `_'.
6211 Define `defines_flag', `output_parser_name' and `output_header_name'.
6212 * src/output.h (actions_output, guards_output)
6213 (token_definitions_output): Adjust prototypes.
6214 * src/scan-skel.l: Instead of scanning the skeletons, it now
6215 processes the output of m4: `__oline__' and `#output'.
6216 * data/bison.simple: Adjust to be used by M4(sugar).
6217 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
6219 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
6220 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
6221 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
6222 shamelessly stolen from CVS Autoconf.
6224 2002-02-05 Akim Demaille <akim@epita.fr>
6226 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
6227 * configure.in: Check for the declarations of free and malloc.
6228 * src/muscle_tab.c: Adjust.
6230 2002-02-05 Akim Demaille <akim@epita.fr>
6232 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
6233 which have no values.
6235 2002-02-05 Akim Demaille <akim@epita.fr>
6237 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
6240 2002-01-29 Paul Eggert <eggert@twinsun.com>
6242 * src/bison.simple (YYSIZE_T): Do not define merely because
6243 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
6244 On some platforms, <alloca.h> does not declare YYSTD (size_t).
6246 2002-01-27 Akim Demaille <akim@epita.fr>
6248 Fix `%nonassoc and eof'.
6250 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
6251 which were not properly copied! Replace
6252 memcpy (res->errs, src->errs, src->nerrs);
6254 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
6256 * tests/regression.at (%nonassoc and eof): Adjust to newest
6257 Autotest: `.' is not in the PATH.
6259 2002-01-27 Akim Demaille <akim@epita.fr>
6261 * tests/sets.at (AT_EXTRACT_SETS): New.
6265 2002-01-26 Akim Demaille <akim@epita.fr>
6267 * tests/actions.at, tests/calc.at, tests/headers.at,
6268 * tests/torture.at: Adjust to the newest Autotest which no longer
6269 forces `.' in the PATH.
6271 2002-01-25 Akim Demaille <akim@epita.fr>
6273 * tests/regression.at (%nonassoc and eof): New.
6274 Suggested by Robert Anisko.
6276 2002-01-24 Akim Demaille <akim@epita.fr>
6278 Bison dumps core when trying to complain about broken input files.
6279 Reported by Cris van Pelt.
6281 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
6282 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
6284 (Invalid inputs): Strengthen: exercise parse_percent_token.
6286 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
6288 * src/Makefile.am: Add bison.c++.
6289 * src/bison.c++: New skeleton.
6291 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
6295 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
6297 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
6299 2002-01-20 Marc Autret <marc@gnu.org>
6301 * src/files.c (compute_output_file_names): Fix
6303 2002-01-20 Marc Autret <marc@gnu.org>
6305 * tests/output.at: New test.
6306 * src/files.c (compute_base_names): Don't map extensions when
6307 the YACC flag is set, use defaults.
6308 Reported by Evgeny Stambulchik.
6310 2002-01-20 Marc Autret <marc@gnu.org>
6312 * src/system.h: Need to define __attribute__ away for non-GCC
6313 compilers as well (i.e. the vendor C compiler).
6314 Suggested by Albert Chin-A-Young.
6316 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
6318 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
6319 canonical definition.
6320 * src/system.h: Use the canonical definition for PARAMS (avoids
6321 a conflict with the macro from lib/hash.h).
6323 2002-01-11 Akim Demaille <akim@epita.fr>
6325 * configure.in: Use AC_FUNC_STRNLEN.
6326 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
6328 2002-01-09 Akim Demaille <akim@epita.fr>
6330 * src/files.c, src/files.h (output_infix): New.
6331 (tab_extension): Remove.
6332 (compute_base_names): Compute the former, drop the latter.
6333 * src/output.c (prepare): Insert the muscles `output-infix', and
6335 * src/parse-skel.y (string, string.1): New.
6336 (section.header): Use it.
6337 (section.yacc): Remove.
6338 (prefix): Remove too.
6339 * src/scan-skel.l: Adjust.
6340 * src/bison.simple, src/bison.hairy: Adjust.
6342 2002-01-09 Akim Demaille <akim@epita.fr>
6344 * configure.in (WERROR_CFLAGS): Compute it.
6345 * src/Makefile.am (CFLAGS): Pass it.
6346 * tests/atlocal.in (CFLAGS): Idem.
6347 * src/files.c: Fix a few warnings.
6348 (get_extension_index): Remove, unused.
6350 2002-01-08 Akim Demaille <akim@epita.fr>
6352 * src/getargs.c (AS_FILE_NAME): New.
6353 (getargs): Use it to convert DOSish file names.
6354 * src/files.c (base_name): Rename as full_base_name to avoid
6355 clashes with `base_name ()'.
6356 (filename_split): New.
6357 (compute_base_names): N-th rewrite, using filename_split.
6359 2002-01-08 Akim Demaille <akim@epita.fr>
6361 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
6362 New, stolen from the Fileutils 4.1.
6363 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
6364 * configure.in: Check for the presence of memrchr, and of its
6367 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
6369 * lib/hash.h (__P): Added definition for this macro.
6370 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
6371 BUILT_SOURCES, to ensure they are generated first.
6372 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
6373 %error-verbose to allow bootstrapping with bison 1.30x.
6375 2002-01-06 Akim Demaille <akim@epita.fr>
6377 * src/reader.c (parse_braces): Don't fetch the next char, the
6378 convention is to fetch on entry.
6379 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
6380 'switch' without a following semicolon.
6381 * tests/regression.at (braces parsing): New.
6383 2002-01-06 Akim Demaille <akim@epita.fr>
6385 Bison is dead wrong in its RR conflict reports.
6387 * tests/torture.at (GNU Cim Grammar): New.
6388 * src/conflicts.c (count_rr_conflicts): Fix.
6390 2002-01-06 Akim Demaille <akim@epita.fr>
6392 Creating package.m4 from configure.ac causes too many problems.
6394 * tests/Makefile.am (package.m4): Create it by hand,
6395 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
6397 2002-01-06 Akim Demaille <akim@epita.fr>
6399 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
6402 2002-01-04 Paul Eggert <eggert@twinsun.com>
6404 * doc/bison.texinfo (Debugging):
6405 Remove YYSTDERR; it's no longer defined or used.
6406 Also, s/cstdio.h/cstdio/.
6408 2002-01-03 Akim Demaille <akim@epita.fr>
6410 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
6412 2002-01-03 Akim Demaille <akim@epita.fr>
6414 * src/parse-skel.y (process_skeleton): Don't bind the parser's
6415 tracing code to --trace, wait for a better --trace option, with
6418 2002-01-03 Akim Demaille <akim@epita.fr>
6420 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
6421 The ISO C++ standard is extremely clear about it: stderr is
6422 considered a macro, not a regular symbol (see table 94 `Header
6423 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
6424 Therefore std:: does not apply to it. It still does with fprintf.
6425 Also, s/cstdio.h/cstdio/.
6427 2002-01-03 Akim Demaille <akim@epita.fr>
6429 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
6430 for non system headers.
6432 2002-01-02 Akim Demaille <akim@epita.fr>
6434 Equip the skeleton chain with location tracking, runtime trace,
6435 pure parser and scanner.
6437 * src/parse-skel.y: Request a pure parser, locations, and prefix
6439 (%union): Having several members with the same type does not help
6440 type mismatches, simplify.
6441 (YYPRINT, yyprint): New.
6442 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
6445 * src/scan-skel.l: Adjust to these changes.
6446 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
6447 (LOCATION_PRINT, skel_control_t): New.
6449 2001-12-30 Akim Demaille <akim@epita.fr>
6451 * src/parse-skel.y: Get rid of the shift/reduce conflict:
6452 replace `gb' with BLANKS.
6453 * src/scan-skel.l: Adjust.
6455 2001-12-30 Akim Demaille <akim@epita.fr>
6457 * src/system.h: We don't need nor want bcopy.
6458 Throw away MS-DOS crap: we don't need getpid.
6459 * configure.in: We don't need strndup. It was even causing
6460 problems: because Flex includes the headers *before* us,
6461 _GNU_SOURCE is not defined by config.h, and therefore strndup was
6463 * lib/xstrndup.c: New.
6464 * src/scan-skel.l: Use it.
6465 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
6466 * src/parse-skel.y: Use %directives instead of #defines.
6468 2001-12-30 Akim Demaille <akim@epita.fr>
6470 * src/skeleton.h: New.
6471 * src/output.c (output_parser, output_master_parser): Remove, dead
6473 * src/output.h (get_lines_number, actions_output, guards_output)
6474 (token_definitions_output): Prototype them.
6475 * src/parse-skel.y: Add the license notice.
6476 Include output.h and skeleton.h.
6477 (process_skeleton): Returns void, and takes a single parameter.
6478 * src/scan-skel.l: Add the license notice.
6480 Don't use %option yylineno: it seems that then Flex imagines
6481 REJECT has been used, and therefore it won't reallocate its
6482 buffers (which makes no other sense to me than a bug). It results
6483 in warnings for `unused: yy_flex_realloc'.
6485 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
6487 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6488 (MUSCLE_INSERT_PREFIX): ...to there.
6489 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
6490 (MUSCLE_INSERT_PREFIX): Move from here...
6492 * src/bison.hairy: Add a section directive. Put braces around muscle
6493 names. This parser skeleton is still broken, but Bison should not
6494 choke on a bad muscle 'syntax'.
6495 * src/bison.simple: Add a section directive. Put braces around muscle
6498 * src/files.h (strsuffix, stringappend): Add declarations.
6499 (tab_extension): Add declaration.
6500 (short_base_name): Add declaration.
6502 * src/files.c (strsuffix, stringappend): No longer static. These
6503 functions are used in the skeleton parser.
6504 (tab_extension): New.
6505 (compute_base_names): Use the computations done in this function
6506 to guess if the generated parsers should have '.tab' in their
6508 (short_base_name): No longer static.
6510 * src/output.c (output_skeleton): New.
6511 (output): Disable call to output_master_parser, and give a try to
6512 a new skeleton handling system.
6513 (guards_output, actions_output): No longer static.
6514 (token_definitions_output, get_lines_number): No longer static.
6516 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
6518 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
6521 * src/parse-skel.y: New file.
6522 * src/scan-skel.l: New file.
6524 2001-12-29 Akim Demaille <akim@epita.fr>
6526 %name-prefix is broken.
6528 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
6529 Adjust all dependencies.
6530 * tests/headers.at (export YYLTYPE): Strengthen this test: use
6533 Renaming yylval but not yylloc is not consistent. Now we do.
6535 * src/bison.simple: Prefix yylloc if used.
6536 * doc/bison.texinfo (Decl Summary): Document that.
6538 2001-12-29 Akim Demaille <akim@epita.fr>
6540 * doc/bison.texinfo: Promote `%long-directive' over
6542 Remove all references to fixed-output-files, yacc is enough.
6544 2001-12-29 Akim Demaille <akim@epita.fr>
6546 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
6547 user prologue. These are defaults.
6548 * tests/actions.at (Mid-rule actions): Make sure the user can
6549 define YYDEBUG and YYERROR_VERBOSE.
6551 2001-12-29 Akim Demaille <akim@epita.fr>
6553 * src/output.c (header_output): Don't forget to export YYLTYPE and
6555 * tests/headers.at (export YYLTYPE): New, make sure it does.
6556 * tests/regression.at (%union and --defines, Invalid CPP headers):
6558 * tests/headers.at: here.
6560 2001-12-29 Akim Demaille <akim@epita.fr>
6562 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
6564 2001-12-29 Akim Demaille <akim@epita.fr>
6566 * tests/actions.at (Mid-rule actions): Output on a single line
6569 2001-12-29 Akim Demaille <akim@epita.fr>
6571 * doc/bison.texinfo: Formatting changes.
6573 2001-12-29 Akim Demaille <akim@epita.fr>
6575 Don't store the token defs in a muscle, just be ready to output it
6576 on command. Now possible via `symbols'. Fixes a memory leak.
6578 * src/output.c (token_definitions_output): New.
6579 (output_parser, header_output): Use it.
6580 * src/reader.c (symbols_save): Remove.
6582 2001-12-29 Akim Demaille <akim@epita.fr>
6584 * src/bison.simple: Do not provide a default for YYSTYPE and
6585 YYLTYPE before the user's prologue. Otherwise it's hardly... a
6588 2001-12-29 Akim Demaille <akim@epita.fr>
6590 Mid-rule actions are simply... ignored!
6592 * src/reader.c (readgram): Be sure to attach mid-rule actions to
6593 the empty-rule associated to the dummy symbol, not to the host
6595 * tests/actions.at (Mid-rule actions): New.
6597 2001-12-29 Akim Demaille <akim@epita.fr>
6601 * src/reader.c (reader): Free grammar.
6603 2001-12-29 Akim Demaille <akim@epita.fr>
6607 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
6608 since it allocates it for each state, although only one is needed.
6609 (allocate_storage): Do it here.
6611 2001-12-29 Akim Demaille <akim@epita.fr>
6613 * src/options.h, src/options.c (create_long_option_table): Rename
6615 (long_option_table_new): this, with a clearer prototype.
6616 (percent_table): Remove, unused,
6617 * src/getargs.c (getargs): Adjust.
6619 2001-12-29 Akim Demaille <akim@epita.fr>
6621 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
6622 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
6625 2001-12-29 Akim Demaille <akim@epita.fr>
6627 * src/lalr.c (build_relations): Rename `states' as `states1'.
6628 Sorry, I don't understand exactly what it is, no better name...
6630 2001-12-29 Akim Demaille <akim@epita.fr>
6632 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
6633 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
6634 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
6637 2001-12-29 Akim Demaille <akim@epita.fr>
6639 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
6642 2001-12-29 Akim Demaille <akim@epita.fr>
6644 * src/reader.c, src/reader.h (user_toknums): Remove.
6645 Adjust all users to use symbols[i]->user_token_number.
6647 2001-12-29 Akim Demaille <akim@epita.fr>
6649 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
6650 Adjust all users to use symbols[i]->prec or ->assoc.
6652 2001-12-29 Akim Demaille <akim@epita.fr>
6654 * src/reader.c, src/reader.h (tags): Remove.
6655 Adjust all users to use symbols[i]->tag.
6657 2001-12-29 Akim Demaille <akim@epita.fr>
6659 * src/gram.h, src/gram.c (symbols): New, similar to state_table
6661 * src/reader.c (packsymbols): Fill this table.
6663 * src/conflicts.c (resolve_sr_conflict): Adjust.
6664 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
6666 Use symbols[i]->tag instead of tags[i].
6668 2001-12-29 Akim Demaille <akim@epita.fr>
6670 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
6671 In addition, put a comment in there, to replace...
6672 * tests/regression.at (%union and C comments): Remove.
6674 2001-12-29 Akim Demaille <akim@epita.fr>
6676 * tests/regression.at (Web2c Actions): Blindly move the actual
6677 output as expected output. The contents *seem* right to me, but I
6678 can't pretend reading perfectly parser tables... Nonetheless, all
6679 the other tests pass correctly, the table look OK, even though the
6680 presence of `$axiom' is to be noted: AFAICS it is useless (but
6683 2001-12-29 Akim Demaille <akim@epita.fr>
6685 * src/reader.c (readgram): Don't add the rule 0 if there were no
6686 rules read. In other words, add it _after_ having performed
6687 grammar sanity checks.
6688 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
6690 2001-12-29 Akim Demaille <akim@epita.fr>
6692 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
6693 visible, and some states have now a different number.
6695 2001-12-29 Akim Demaille <akim@epita.fr>
6697 * src/reader.c (readgram): Bind the initial rule's lineno to that
6699 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
6700 (Solved SR Conflicts): Adjust rule 0's line number.
6702 2001-12-29 Akim Demaille <akim@epita.fr>
6704 Fix the `GAWK Grammar' failure.
6706 * src/LR0.c (final_state): Initialize to -1 so that we do compute
6707 the reductions of the first state which was mistakenly confused
6708 with the final state because precisely final_state was initialized
6710 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
6711 now noticed by Bison.
6712 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
6713 have a reduction on $default.
6715 2001-12-29 Akim Demaille <akim@epita.fr>
6717 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
6719 * src/closure.c (print_closure): Likewise.
6720 * src/derives.c (print_derives): Likewise.
6721 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
6724 2001-12-29 Akim Demaille <akim@epita.fr>
6726 * src/lalr.c (lookaheads_print): New.
6727 (lalr): Call it when --trace-flag.
6728 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
6731 2001-12-29 Akim Demaille <akim@epita.fr>
6733 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
6734 when walking through ritem, even via rule->rhs.
6735 * src/reduce.c (dump_grammar, useful_production, reduce_output)
6736 (useful_production, useless_nonterminals): Likewise.
6737 (reduce_grammar_tables): Likewise, plus update nritems.
6738 * src/nullable.c (set_nullable): Likewise.
6739 * src/lalr.c (build_relations): Likewise.
6740 * tests/sets.at (Nullable): Adjust.
6741 Fortunately, now, the $axiom is no longer nullable.
6743 2001-12-29 Akim Demaille <akim@epita.fr>
6745 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
6747 * src/gram.c (ritem_longest_rhs): Likewise.
6748 * src/reduce.c (nonterminals_reduce): Likewise.
6749 * src/print_graph.c (print_graph): Likewise.
6750 * src/output.c (output_rule_data): Likewise.
6751 * src/nullable.c (set_nullable): Likewise.
6753 2001-12-29 Akim Demaille <akim@epita.fr>
6755 * src/output.c: Comment changes.
6757 2001-12-27 Paul Eggert <eggert@twinsun.com>
6759 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
6760 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
6761 Sparc, as they were causing more porting problems than the
6762 (minor) performance improvement was worth.
6764 Also, catch up with 1.31's YYSTD.
6766 2001-12-27 Akim Demaille <akim@epita.fr>
6768 * src/output.c (output_gram): Rely on nritems, not the
6769 0-sentinel. See below.
6770 Use -1 as separator, not 0.
6771 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
6772 Rely on -1 as separator in yyrhs, instead of 0.
6773 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
6774 twice `Now at end of input', therefore there are two lines less to
6777 2001-12-27 Akim Demaille <akim@epita.fr>
6779 * tests/regression.at (Unresolved SR Conflicts):
6780 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
6783 2001-12-27 Akim Demaille <akim@epita.fr>
6785 * src/LR0.c (new_state): Recognize the final state by the fact it
6786 is reached by eoftoken.
6787 (insert_start_shifting_state, insert_eof_shifting_state)
6788 (insert_accepting_state, augment_automaton): Remove, since now
6789 these states are automatically computed from the initial state.
6790 (generate_states): Adjust.
6791 * src/print.c: When reporting a rule number to the user, substract
6792 1, so that the axiom rule is rule 0, and the first user rule is 1.
6793 * src/reduce.c: Likewise.
6794 * src/print_graph.c (print_core): For the time being, just as for
6795 the report, depend upon --trace-flags to dump the full set of
6797 * src/reader.c (readgram): Once the grammar read, insert the rule
6798 0: `$axiom: START-SYMBOL $'.
6799 * tests/set.at: Adjust: rule 0 is now displayed, and since the
6800 number of the states has changed (the final state is no longer
6801 necessarily the last), catch up.
6803 2001-12-27 Akim Demaille <akim@epita.fr>
6805 Try to make the use of the eoftoken valid. Given that its value
6806 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
6807 is used instead of > 0 where appropriate, (ii), depend upon nritems
6808 instead of the 0-sentinel.
6810 * src/gram.h, src/gram.c (nritems): New.
6811 Expected to be duplication of nitems, but for the time being...
6812 * src/reader.c (packgram): Assert nritems and nitems are equal.
6813 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
6814 * src/closure.c (print_closure, print_fderives): Likewise.
6815 * src/gram.c (ritem_print): Likewise.
6816 * src/print.c (print_core, print_grammar): Likewise.
6817 * src/print_graph.c: Likewise.
6819 2001-12-27 Akim Demaille <akim@epita.fr>
6821 * src/main.c (main): If there are complains after grammar
6822 reductions, then output the report anyway if requested, then die.
6823 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
6824 * src/reader.c (eoftoken): New.
6825 (parse_token_decl): If the token being defined has value `0', it
6827 (packsymbols): No longer hack `tags' to insert `$' by hand.
6828 Be sure to preserve the value of the eoftoken.
6829 (reader): Make sure eoftoken is defined.
6830 Initialize nsyms to 0: now eoftoken is created just like the others.
6831 * src/print.c (print_grammar): Don't special case the eof token.
6832 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
6833 lie anyway, albeit pleasant.
6834 * tests/calc.at: Exercise error messages with eoftoken.
6835 Change the grammar so that empty input is invalid.
6836 Adjust expectations.
6837 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
6839 2001-12-27 Akim Demaille <akim@epita.fr>
6841 * configure.in: Check the protos of strchr ans strspn.
6842 Replace strchr if needed.
6843 * src/system.h: Provide the protos of strchr, strspn and memchr if
6845 * lib/strchr.c: New.
6846 * src/reader.c (symbols_save): Use strchr.
6848 2001-12-27 Akim Demaille <akim@epita.fr>
6850 * src/print.c, src/print_graph.c (escape): New.
6851 Use it to quote the TAGS outputs.
6852 * src/print_graph.c (print_state): Now errors are in red, and
6853 reductions in green.
6854 Prefer high to wide: output the state number on a line of its own.
6856 2001-12-27 Akim Demaille <akim@epita.fr>
6858 * src/state.h, src/state.c (reductions_new): New.
6859 * src/LR0.c (set_state_table): Let all the states have a
6860 `reductions', even if reduced to 0.
6861 (save_reductions): Adjust.
6862 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
6863 * src/print.c (print_reductions, print_actions): Adjust.
6864 * src/output.c (action_row): Adjust.
6866 2001-12-27 Akim Demaille <akim@epita.fr>
6868 * src/state.h, src/state.c (errs_new, errs_dup): New.
6869 * src/LR0.c (set_state_table): Let all the states have an errs,
6870 even if reduced to 0.
6871 * src/print.c (print_errs, print_reductions): Adjust.
6872 * src/output.c (output_actions, action_row): Adjust.
6873 * src/conflicts.c (resolve_sr_conflict): Adjust.
6875 2001-12-27 Akim Demaille <akim@epita.fr>
6877 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
6879 2001-12-27 Akim Demaille <akim@epita.fr>
6881 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
6882 * src/print.c: here.
6883 (lookaheadset, shiftset): New, used as additional storage by
6885 (print_results): Adjust.
6886 (print_shifts, print_gotos, print_errs): New, extracted from...
6887 (print_actions): here.
6888 * src/print_graph.c (print_actions): Remove dead code.
6890 2001-12-27 Akim Demaille <akim@epita.fr>
6892 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
6895 2001-12-27 Akim Demaille <akim@epita.fr>
6897 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
6898 (build_relations): Adjust.
6900 2001-12-27 Akim Demaille <akim@epita.fr>
6902 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
6905 2001-12-27 Akim Demaille <akim@epita.fr>
6907 * src/reader.c (packgram): Catch nitems overflows.
6909 2001-12-27 Akim Demaille <akim@epita.fr>
6911 * src/files.c, src/files.h (guard_obstack): Remove.
6912 * src/output.c (output): Adjust.
6913 * src/reader.c (parse_braces): New, factoring...
6914 (copy_action, copy_guard): these two which are renamed as...
6915 (parse_action, parse_guard): these.
6916 As a voluntary consequence, using braces around guards is now
6919 2001-12-27 Akim Demaille <akim@epita.fr>
6921 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
6922 * src/reader.c (symbol_list): `guard' and `guard_line' are new
6924 (symbol_list_new): Adjust.
6925 (copy_action): action_line is the first line, not the last.
6926 (copy_guard): Just as for actions, store the `action' only, not
6927 the switch/case/break flesh.
6928 Don't parse the user action that might follow the guard, let...
6929 (readgram): do it, i.e., now, there can be an action after a
6931 In other words the guard is just explicitly optional.
6933 * src/output.c (guards_output): New.
6934 (output_parser): Call it when needed.
6935 (output): Also free the guard and attrs obstacks.
6936 * src/files.c, src/files.h (obstack_save): Remove.
6937 (output_files): Remove.
6938 As a result, if one needs the former `.act' file, using an
6939 appropriate skeleton which requires actions and guards is now
6941 * src/main.c (main): Adjust.
6942 * tests/semantic.at: New.
6943 * tests/regression.at: Use `input.y' as input file name.
6944 Avoid 8+3 problems by requiring input.c when the test needs the
6947 2001-12-27 Akim Demaille <akim@epita.fr>
6949 * src/reader.c (symbol_list_new): Be sure to initialize all the
6952 2001-12-27 Akim Demaille <akim@epita.fr>
6954 All the hacks using a final pseudo state are now useless.
6956 * src/LR0.c (set_state_table): state_table holds exactly nstates.
6957 * src/lalr.c (nLA): New.
6958 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
6959 instead of lookaheadsp from the pseudo state (nstate + 1).
6961 2001-12-27 Akim Demaille <akim@epita.fr>
6963 * src/output.c (action_row, token_actions): Use a state_t instead
6964 of a integer, and nlookaheads instead of the following state's
6967 2001-12-27 Akim Demaille <akim@epita.fr>
6969 * src/conflicts.c (log_resolution, flush_shift)
6970 (resolve_sr_conflict, set_conflicts, solve_conflicts)
6971 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
6972 (conflicts_print, print_reductions): Use a state_t instead of an
6973 integer when referring to a state.
6974 As much as possible, depend upon nlookaheads, instead of the
6975 `lookaheadsp' member of the following state (since lookaheads of
6976 successive states are successive, the difference between state n + 1
6977 and n served as the number of lookaheads for state n).
6978 * src/lalr.c (add_lookback_edge): Likewise.
6979 * src/print.c (print_core, print_actions, print_state)
6980 (print_results): Likewise.
6981 * src/print_graph.c (print_core, print_actions, print_state)
6982 (print_graph): Likewise.
6983 * src/conflicts.h: Adjust.
6985 2001-12-27 Akim Demaille <akim@epita.fr>
6987 * src/bison.hairy: Formatting/comment changes.
6989 Remove `register' indications.
6990 Add plenty of `static'.
6992 2001-12-27 Akim Demaille <akim@epita.fr>
6994 * src/output.c (prepare): Drop the muscle `ntbase' which
6996 * src/bison.simple: Formatting/comment changes.
6997 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
6998 is an undocumented synonym.
7000 2001-12-22 Akim Demaille <akim@epita.fr>
7002 * src/output.c (output_table_data): Change the prototype to use
7003 `int' for array ranges: some invocations do pass an int, not a
7005 Reported by Wayne Green.
7007 2001-12-22 Akim Demaille <akim@epita.fr>
7009 Some actions of web2c.y are improperly triggered.
7010 Reported by Mike Castle.
7012 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
7013 * tests/regression.at (Web2c): Rename as...
7014 (Web2c Report): this.
7015 (Web2c Actions): New.
7017 2001-12-22 Akim Demaille <akim@epita.fr>
7019 Reductions in web2c.y are improperly reported.
7020 Reported by Mike Castle.
7022 * src/conflicts.c (print_reductions): Fix.
7023 * tests/regression.at (Web2c): New.
7025 2001-12-18 Akim Demaille <akim@epita.fr>
7027 Some host fail on `assert (!"foo")', which expands to
7028 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
7029 Reported by Nelson Beebee.
7031 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
7032 `#define it_succeeded 0' and `assert (it_succeeded)'.
7034 2001-12-17 Marc Autret <autret_m@epita.fr>
7036 * src/bison.simple: Don't hard code the skeleton line and filename.
7037 * src/output.c (output_parser): Rename 'line' as 'output_line'.
7038 New line counter 'skeleton_line' (skeleton-line muscle).
7040 2001-12-17 Paul Eggert <eggert@twinsun.com>
7042 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
7043 YYDEBUG must be defined to a nonzero value.
7045 * src/bison.simple (yytname): Do not assume that the user defines
7046 YYDEBUG to a properly parenthesized expression.
7048 2001-12-17 Akim Demaille <akim@epita.fr>
7050 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
7051 nlookaheads is a new member.
7053 * src/lalr.h (nlookaheads): Remove this orphan declaration.
7054 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
7057 2001-12-17 Akim Demaille <akim@epita.fr>
7059 * src/files.h, src/files.c (open_files, close_files): Remove.
7060 * src/main.c (main): Don't open/close files, nor invoke lex_free,
7062 * src/reader.c (reader): Do it.
7064 2001-12-17 Akim Demaille <akim@epita.fr>
7066 * src/conflicts.c (print_reductions): Formatting changes.
7068 2001-12-17 Akim Demaille <akim@epita.fr>
7070 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
7071 (flush_reduce): New.
7072 (resolve_sr_conflict): Adjust.
7074 2001-12-17 Akim Demaille <akim@epita.fr>
7076 * src/output.c (output_obstack): Be static and rename as...
7077 (format_obstack): this, to avoid any confusion with files.c's
7079 * src/reader.h (muscle_obstack): Move to...
7080 * src/output.h: here, since it's defined in output.c.
7082 2001-12-17 Akim Demaille <akim@epita.fr>
7084 * src/output.c (action_row, save_column, default_goto)
7085 (sort_actions, matching_state, pack_vector): Better variable
7088 2001-12-17 Akim Demaille <akim@epita.fr>
7090 * src/output.c: Various formatting changes.
7092 2001-12-17 Akim Demaille <akim@epita.fr>
7094 * src/files.c (output_files): Free the output_obstack.
7095 * src/main.c (main): Call print and print_graph conditionally.
7096 * src/print.c (print): Work unconditionally.
7097 * src/print_graph.c (print_graph): Work unconditionally.
7098 * src/conflicts.c (log_resolution): Output only if verbose_flag.
7100 2001-12-16 Marc Autret <autret_m@epita.fr>
7102 * src/output.c (actions_output): Fix. When we use %no-lines,
7103 there is one less line per action.
7105 2001-12-16 Marc Autret <autret_m@epita.fr>
7107 * src/bison.simple: Remove a useless #line directive.
7108 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
7109 * src/output.c (get_lines_number): New.
7110 (output_parser): Adjust, now takes care about the lines of a
7113 (actions_output): Computes the number of lines taken by actions.
7114 (output_master_parser): Insert new skeleton which is the name of
7115 the output parser file name.
7117 2001-12-15 Marc Autret <autret_m@epita.fr>
7119 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
7121 2001-12-15 Marc Autret <autret_m@epita.fr>
7123 * src/output.c (output_gram): Keep track of the hairy one.
7125 2001-12-15 Akim Demaille <akim@epita.fr>
7127 Make `make distcheck' work.
7129 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
7130 system.h which uses libgettext.h.
7132 2001-12-15 Akim Demaille <akim@epita.fr>
7134 * src/nullable.c (set_nullable): Useless rules must be skipped,
7135 otherwise, since we range over their symbols, we might look at a
7136 nonterminal which no longer ``exists'', i.e., it is not counted in
7137 `nvars', hence we overflow our arrays.
7139 2001-12-15 Akim Demaille <akim@epita.fr>
7141 The header can also be produced directly, without any obstack!
7144 * src/files.c, src/files.h (defines_obstack): Remove.
7145 (compute_header_macro): Global.
7146 (defines_obstack_save): Remove.
7147 * src/reader.c (parse_union_decl): No longer output to
7148 defines_obstack: its content can be found in the `stype' muscle
7150 (output_token_translations): Merge into...
7151 (symbols_output): this.
7153 (symbols_save): this.
7155 * src/output.c (header_output): New.
7158 2001-12-15 Akim Demaille <akim@epita.fr>
7160 * src/reader.c (parse_union_decl): Instead of handling two obstack
7161 simultaneously, use one to define the `stype' muscle, and use the
7162 value of the latter to fill defines_obstack.
7163 (copy_comment): Remove.
7164 (copy_comment2): Work for a single obstack.
7166 (copy_comment): this.
7168 2001-12-15 Akim Demaille <akim@epita.fr>
7170 * src/lex.c, src/lex.h (xgetc): No longer static.
7171 * src/reader.c (parse_union_decl): Revamp.
7173 2001-12-15 Akim Demaille <akim@epita.fr>
7175 Still making progress in separating Bison into (i) input, (ii)
7176 process, (iii) output: now we can directly output the parser file
7177 without using table_obstack at all.
7179 * src/files.c, src/files.h (table_obstack): Bye bye.
7180 (parser_file_name): New.
7181 * src/files.c (compute_output_file_names): Compute it.
7182 * src/output.c (actions_output, output_parser)
7183 (output_master_parser): To a file instead of an obstack.
7185 2001-12-15 Akim Demaille <akim@epita.fr>
7187 Attach actions to rules, instead of pre-outputting them to
7190 * src/gram.h (rule_t): action and action_line are new members.
7191 * src/reader.c (symbol_list): Likewise.
7192 (copy_action): Save the actions within the rule.
7193 (packgram): Save them in rule_table.
7194 * src/output.c (actions_output): New.
7195 (output_parser): Use it on `%%actions'.
7196 (output_rule_data): Don't free rule_table.
7198 (prepare): Don't save the `action' muscle.
7199 * src/bison.simple: s/%%action/%%actions/.
7201 2001-12-15 Akim Demaille <akim@epita.fr>
7203 * src/reader.c (copy_action): When --yacc, don't append a `;'
7204 to the user action: let it fail if lacking.
7205 Suggested by Arnold Robbins and Tom Tromey.
7207 2001-12-14 Akim Demaille <akim@epita.fr>
7209 * src/lex.c (literalchar): Simply return the char you decoded, non
7210 longer mess around with obstacks and int pointers.
7213 2001-12-14 Akim Demaille <akim@epita.fr>
7215 * src/lex.c (literalchar): Don't escape the special characters,
7216 just decode them, and keep them as char (before, eol was output as
7217 the 2 char string `\n' etc.).
7218 * src/output.c (output_rule_data): Use quotearg to output the
7221 2001-12-13 Paul Eggert <eggert@twinsun.com>
7223 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
7224 Do not infringe on the global user namespace when using C++.
7225 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
7226 All uses of `fprintf' and `stderr' changed.
7228 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
7230 2001-12-13 Akim Demaille <akim@epita.fr>
7232 The computation of nullable is broken: it doesn't handle empty
7235 * tests/torture.at (GNU AWK Grammar): New.
7236 * tests/sets.at (Nullable): New.
7237 * src/nullable.c (set_nullable): Instead of blindly looping over
7238 `ritems', loop over the rules, and then over their rhs's.
7240 Work around Autotest bugs.
7242 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
7243 frame, because Autotest understand lines starting with a `+' as
7244 traces from the shell. Then, they are not processed properly.
7245 Admittedly an Autotest bug, but we don't have time to wait for
7246 Autotest to catch up.
7247 * tests/regression.at (Broken Closure): Adjust to the new table
7250 * tests/sets.at: here.
7252 2001-12-13 Akim Demaille <akim@epita.fr>
7254 * src/closure.c (closure): Use nrules instead of playing tricks
7257 2001-12-13 Akim Demaille <akim@epita.fr>
7259 * src/print.c (print_actions): Output the handling of `$' as the
7260 traces do: shifting the token EOF. Before EOF was treated as a
7262 * tests/regression.at: Adjust some tests.
7263 * src/print_graph.c (print_core): Complete the set of items via
7264 closure. The next-to-final and final states are still unsatisfying,
7265 but that's to be addressed elsewhere.
7266 No longer output the rule numbers, but do output the state number.
7267 A single loop for the shifts + gotos is enough, but picked a
7268 distinct color for each.
7269 (print_graph): Initialize and finalize closure.
7271 2001-12-13 Akim Demaille <akim@epita.fr>
7273 * src/reader.c (readgram): Remove dead code, an strip useless
7275 (get_type): Remove, unused.
7277 2001-12-12 Akim Demaille <akim@epita.fr>
7279 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
7280 on that of lib/error.c.
7282 2001-12-12 Akim Demaille <akim@epita.fr>
7284 Some hosts don't like `/' in includes.
7286 * src/system.h: Include libgettext.h without qualifying the path.
7287 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
7290 2001-12-11 Marc Autret <autret_m@epita.fr>
7292 * src/output.c (output_parser): Remove useless muscle.
7294 2001-12-11 Marc Autret <autret_m@epita.fr>
7296 * src/bison.simple: Remove #line just before %%epilogue. It
7297 is now handled in ...
7298 * src/reader.c (read_additionnal_code): Add the output of a
7299 #line for the epilogue.
7301 2001-12-10 Marc Autret <autret_m@epita.fr>
7303 * src/reader.c (copy_definition): Re-use CPP-outed code which
7304 replace precedent remove.
7305 * src/bison.simple: Remove #line before %%prologue because
7306 %%input-line is wrong at this time.
7308 2001-12-10 Marc Autret <autret_m@epita.fr>
7310 * src/reader.c (symbols_output): Clean up.
7311 * src/output.c (output_gram, output): Clean up.
7313 2001-12-10 Akim Demaille <akim@epita.fr>
7315 * src/lalr.c (initialize_lookaheads): New. Extracted from...
7316 * src/LR0.c (set_state_table): here.
7317 * src/lalr.c (lalr): Call it.
7319 2001-12-10 Akim Demaille <akim@epita.fr>
7321 * src/state.h (shifts): Remove the `number' member: shifts are
7322 attached to state, hence no longer need to be labelled with a
7325 2001-12-10 Akim Demaille <akim@epita.fr>
7327 Now that states have a complete set of members, the linked list of
7328 shifts is useless: just fill directly the state's shifts member.
7330 * src/state.h (shifts): Remove the `next' member.
7331 * src/LR0.c (first_state, last_state): Remove.
7333 (augment_automaton): Don't look for the shifts that must be added
7334 a shift on EOF: it is those of the state we looked for! But now,
7335 since shifts are attached, it is no longer needed to looking
7336 merely by its id: its number.
7338 2001-12-10 Akim Demaille <akim@epita.fr>
7340 * src/LR0.c (augment_automaton): Better variable locality.
7341 Remove an impossible branch: if there is a state corresponding to
7342 the start symbol being shifted, then there is shift for the start
7343 symbol from the initial state.
7345 2001-12-10 Akim Demaille <akim@epita.fr>
7347 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
7348 only when appropriate: when insert_start_shifting_state' is not
7350 * tests/regression.at (Rule Line Numbers): Adjust.
7352 2001-12-10 Akim Demaille <akim@epita.fr>
7354 * src/LR0.c (augment_automaton): Now that all states have shifts,
7355 merge the two cases addition shifts to the initial state.
7357 2001-12-10 Akim Demaille <akim@epita.fr>
7359 * src/lalr.c (set_state_table): Move to...
7361 * src/lalr.c (lalr): Don't call it...
7362 * src/LR0.c (generate_states): do it.
7363 * src/LR0.h (first_state): Remove, only the table is used.
7365 2001-12-10 Akim Demaille <akim@epita.fr>
7367 * src/LR0.h (first_shift, first_reduction): Remove.
7368 * src/lalr.c: Don't use first_shift: find shifts through the
7371 2001-12-10 Akim Demaille <akim@epita.fr>
7373 * src/LR0.c: Attach shifts to states as soon as they are
7375 * src/lalr.c (set_state_table): Instead of assigning shifts to
7376 state, just assert that the mapping was properly done.
7378 2001-12-10 Akim Demaille <akim@epita.fr>
7380 * src/LR0.c (insert_start_shift): Rename as...
7381 (insert_start_shifting_state): this.
7382 (insert_eof_shifting_state, insert_accepting_state): New.
7383 (augment_automaton): Adjust.
7384 Better locality of the variables.
7385 When looking if the start_symbol is shifted from the initial
7386 state, using `while (... symbol != start_symbol ...)' sounds
7387 better than `while (... symbol < start_symbol ...)': If fail
7388 to see how the order between symbols could be relevant!
7390 2001-12-10 Akim Demaille <akim@epita.fr>
7392 * src/getargs.h: Don't declare `spec_name_prefix' and
7393 `spec_file_prefix', declared by src/files.h.
7394 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
7395 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
7396 * src/output.c (prepare): Adjust.
7397 * src/reader.c (symbols_output): Likewise.
7398 * src/vmsgetargs.c: Vaguely adjust, but who cares?
7400 2001-12-10 Akim Demaille <akim@epita.fr>
7402 * src/muscle_tab.c (muscle_init): NULL is a better default than
7405 2001-12-10 Akim Demaille <akim@epita.fr>
7407 * src/reader.c (reader): Calling symbols_output once is enough.
7409 2001-12-10 Akim Demaille <akim@epita.fr>
7411 Now that states have a complete set of members, the linked list of
7412 reductions is useless: just fill directly the state's reductions
7415 * src/state.h (struct reductions): Remove member `number' and
7417 * src/LR0.c (first_reduction, last_reduction): Remove.
7418 (save_reductions): Don't link the new reductions, store them in
7420 * src/lalr.c (set_state_table): No need to attach reductions to
7421 states, it's already done.
7422 * src/output.c (output_actions): No longer free the shifts, then
7423 the reductions, then the states: free all the states and their
7426 2001-12-10 Akim Demaille <akim@epita.fr>
7428 * src/options.c (OPTN, DRTV, BOTH): New.
7429 (option_table): Use them.
7431 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
7432 the job of system.h.
7433 * src/options.c: Don't include stdio.h and xalloc.h for the same
7436 2001-12-10 Akim Demaille <akim@epita.fr>
7438 * src/output.c (output, prepare): Make sure the values of the
7439 muscles `action' and `prologue' are 0-terminated.
7441 2001-12-10 Akim Demaille <akim@epita.fr>
7443 Clean up GCC warnings.
7445 * src/reader.c (copy_action): `buf' is not used.
7446 (parse_skel_decl): Be static.
7447 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
7448 * src/options.h (create_long_option_table): Have a real prototype.
7449 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
7450 (hash_delete_at): Return const void *.
7451 Adjust casts to preserve the const.
7453 2001-12-10 Akim Demaille <akim@epita.fr>
7455 * configure.in: Require 2.52g.
7456 M4 is not needed, but AUTOM4TE is.
7458 * tests/Makefile.am: Adjust.
7460 2001-12-10 Akim Demaille <akim@epita.fr>
7462 One structure for states is enough, even though theoretically
7463 there are LR(0) states and LALR(1) states.
7465 * src/lalr.h (state_t): Remove.
7466 (state_table): Be state_t **, not state_t *.
7467 * src/state.h (core, CORE_ALLOC): Rename as...
7468 (state_t, STATE_ALLOC): this.
7469 Add the LALR(1) members: shifts, reductions, errs.
7470 * src/LR0.c (state_table): Rename as...
7471 (state_hash): this, to avoid name clashes with the global
7473 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
7474 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
7476 2001-12-10 Akim Demaille <akim@epita.fr>
7478 Bison dumps core on bash.y.
7479 Reported by Pascal Bart.
7481 * src/warshall.c (bitmatrix_print): New.
7483 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
7484 j must be the outer loop.
7485 * tests/regression.at (Broken Closure): New.
7487 2001-12-05 Akim Demaille <akim@epita.fr>
7489 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
7491 Reported by Peter Hamorsky.
7493 2001-12-05 Akim Demaille <akim@epita.fr>
7495 * src/conflicts.c (err_table): Remove.
7496 (resolve_sr_conflict): Adjust.
7497 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
7499 (state_t.reductions, state_t.shifts): this.
7501 2001-12-05 Akim Demaille <akim@epita.fr>
7503 * src/reduce.c (reduce_grammar_tables): No longer disable the
7504 removal of useless rules via CPP but via `if (0)', so that the
7505 compiler still check the code is valid.
7506 For instance, it should have noticed `rline' no longer exists: use
7507 the `line' member of rule_t.
7508 * src/gram.c (dummy, rline): Remove, unused.
7510 2001-12-05 Akim Demaille <akim@epita.fr>
7512 * src/output.c (pack_vector): Use assert, not berror.
7513 * src/main.c (berror): Remove, unused.
7515 2001-12-05 Akim Demaille <akim@epita.fr>
7517 New experimental feature: if --verbose --trace output all the
7518 items of a state, not only its kernel.
7520 * src/print.c (print_core): If `trace_flag', then invoke closure
7521 before outputting the items of the state (print_core is no longer
7522 a correct name them).
7523 (print_results): Invoke new_closure/free_closure if needed.
7525 2001-12-05 Akim Demaille <akim@epita.fr>
7527 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
7528 * src/closure.c, src/closure.h (itemsetsize): Rename as...
7529 (nitemset): for consistency with the rest of the project.
7531 2001-12-05 Akim Demaille <akim@epita.fr>
7533 * src/closure.c (print_closure): Improve.
7534 (closure): Use it for printing input and output.
7536 2001-12-05 Akim Demaille <akim@epita.fr>
7538 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
7539 indexed by nonterminals.
7541 2001-12-05 Akim Demaille <akim@epita.fr>
7543 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
7545 * src/warshall.h: Remove accidental duplication of the content.
7547 2001-12-05 Akim Demaille <akim@epita.fr>
7549 * src/closure.c (set_fderives): De-obfuscate.
7551 2001-12-05 Akim Demaille <akim@epita.fr>
7553 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
7555 2001-12-05 Akim Demaille <akim@epita.fr>
7557 * src/closure.c (set_firsts): De-obfuscate.
7559 2001-12-05 Akim Demaille <akim@epita.fr>
7561 * src/output.c (action_row): De-obfuscate
7562 using the good o' techniques: arrays not pointers, variable
7563 locality, BITISSET, RESETBIT etc.
7565 2001-12-05 Akim Demaille <akim@epita.fr>
7567 Pessimize the code to simplify it: from now on, all the states
7568 have a valid SHIFTS, which NSHIFTS is possibly 0.
7570 * src/LR0.c (shifts_new): Be global and move to..
7571 * src/state.c, src/state.h: here.
7572 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
7573 * src/print_graph: Adjust.
7575 2001-12-05 Akim Demaille <akim@epita.fr>
7577 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
7578 * src/conflicts.c: Use it.
7579 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
7580 incorrectly ``simplified''.
7582 2001-12-05 Akim Demaille <akim@epita.fr>
7584 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
7585 using the good o' techniques: arrays not pointers, variable
7586 locality, BITISSET, RESETBIT etc.
7588 2001-12-05 Akim Demaille <akim@epita.fr>
7590 * src/state.h (SHIFT_SYMBOL): New.
7591 * src/conflicts.c: Use it to deobfuscate.
7593 2001-12-05 Akim Demaille <akim@epita.fr>
7595 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
7596 (print_reductions): De-obfuscate using the good o' techniques:
7597 arrays not pointers, variable locality, BITISSET.
7599 2001-12-05 Akim Demaille <akim@epita.fr>
7601 * src/conflicts.c (print_reductions): Arrays, not pointers.
7604 2001-12-05 Akim Demaille <akim@epita.fr>
7606 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7608 2001-12-05 Akim Demaille <akim@epita.fr>
7610 * src/conflicts.c (print_reductions): Improve variable locality.
7612 2001-12-05 Akim Demaille <akim@epita.fr>
7614 * src/conflicts.c (print_reductions): Pessimize, but clarify.
7616 2001-12-05 Akim Demaille <akim@epita.fr>
7618 * src/conflicts.c (print_reductions): Improve variable locality.
7620 2001-12-05 Akim Demaille <akim@epita.fr>
7622 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
7623 * src/lalr.c: Use them.
7625 2001-12-05 Akim Demaille <akim@epita.fr>
7627 * src/LR0.c (augment_automaton): Formatting changes.
7628 Better variable locality.
7630 2001-12-05 Akim Demaille <akim@epita.fr>
7632 * src/lalr.c (matrix_print): New.
7633 (transpose): Use it.
7634 Use arrays instead of pointers.
7636 2001-12-05 Akim Demaille <akim@epita.fr>
7638 * src/lalr.c (maxrhs): Move to...
7639 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
7640 * src/lalr.c (build_relations): Adjust.
7642 2001-12-05 Akim Demaille <akim@epita.fr>
7644 * src/lalr.c (transpose): Free the memory allocated to the
7645 argument, as it is replaced by the results by the unique caller.
7646 (build_relations): Merely invoke transpose: it handles the memory
7648 Improve variable locality.
7649 Avoid variables used as mere abbreviations.
7650 (compute_lookaheads): Use arrays instead of pointers.
7652 2001-12-05 Akim Demaille <akim@epita.fr>
7654 * src/lalr.c (initialize_F): Improve variable locality.
7655 Avoid variables used as mere abbreviations.
7657 2001-12-05 Akim Demaille <akim@epita.fr>
7659 * src/derives.c (print_derives): Display the ruleno.
7660 * src/lalr.c (initialize_F, transpose): Better variable locality
7661 to improve readability.
7662 Avoid variables used as mere abbreviations.
7664 2001-12-05 Akim Demaille <akim@epita.fr>
7666 * src/lalr.c (traverse): Use arrays instead of pointers.
7668 2001-12-05 Akim Demaille <akim@epita.fr>
7670 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
7671 the handling of squeue.
7672 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7674 2001-12-05 Akim Demaille <akim@epita.fr>
7676 Because useless nonterminals are now kept alive (instead of being
7677 `destroyed'), we now sometimes examine them, and store information
7678 related to them. Hence we need to know their number, and adjust
7681 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
7683 * src/LR0.c (allocate_itemsets): The memory allocated to
7684 `symbol_count' was used for two different purpose: once to count
7685 the number of occurrences of each symbol, and later reassigned to
7686 `shift_symbol', containing the symbol that can be shifted from a
7688 Deobfuscate, i.e., allocate, use and free `symbol_count' here
7690 (new_itemsets): Allocate `shift_symbol' here.
7691 (allocate_itemsets): symbol_count includes useless nonterminals.
7693 (free_storage): Use `free', not `XFREE', for pointers that cannot
7696 2001-12-05 Akim Demaille <akim@epita.fr>
7698 * src/nullable.c (set_nullable): Deobfuscate the handling of
7700 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
7702 2001-12-05 Akim Demaille <akim@epita.fr>
7704 * src/gram.c, src/gram.h (ritem_print): New.
7705 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
7706 (This useless function was defined only to work around VMS linkers
7707 that can't handle compilation units with variables only).
7708 * src/reduce.c (dump_grammar): Use it to trace the construction of
7711 2001-12-04 Paul Eggert <eggert@twinsun.com>
7713 * src/bison.simple (union yyalloc): Change member names
7714 to be the same as the stack names.
7715 (yyparse): yyptr is now union yyalloc *, not char *.
7716 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
7717 and may generate better code on some machines.
7718 (yystpcpy): Use prototype if __STDC__ is defined, not just
7719 if __cplusplus is defined.
7721 2001-11-30 Akim Demaille <akim@epita.fr>
7723 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
7724 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
7725 Gettext doesn't compile cleanly, and dies with -Werror.
7726 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
7727 Include WARNING_CFLAGS here.
7728 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
7729 before being defined.
7731 2001-11-27 Paul Eggert <eggert@twinsun.com>
7733 * lib/quotearg.h (quotearg_n, quotearg_n_style):
7734 First arg is int, not unsigned.
7735 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
7736 (SIZE_MAX, UINT_MAX): New macros.
7737 (quotearg_n_options): Abort if N is negative.
7738 Avoid overflow check on hosts where size_t is 64 bits and int
7739 is 32 bits, as overflow is impossible there.
7740 Fix off-by-one typo that caused unnecessary reallocation.
7742 2001-11-29 Paul Eggert <eggert@twinsun.com>
7744 Name space cleanup in generated parser.
7746 * doc/bison.texinfo (Bison Parser): Discuss system headers
7747 and their effect on the user name space.
7750 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
7751 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
7752 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
7754 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
7755 on user names when possible.
7757 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
7758 Simplify test for whather <alloca.h> exists.
7760 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
7762 (<stdio.h>): Include if YYDEBUG.
7764 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
7765 ! defined (yyoverflow) && ! defined (yymemcpy).
7767 (yymemcpy, yyparse): Rename local variables as needed so that
7768 they all begin with 'yy'.
7770 (yystrlen, yystpcpy): New functions.
7772 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
7775 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
7776 instead of relying on string.h functions. Use YYSTACK_ALLOC
7777 and YYSTACK_FREE instead of malloc and free.
7779 2001-11-30 Akim Demaille <akim@epita.fr>
7781 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
7782 before their first uses.
7783 (YYBISON, YYPURE): Move to the top of the output.
7785 2001-11-30 Akim Demaille <akim@epita.fr>
7787 * tests/reduce.at (Useless Nonterminals): Fix.
7789 2001-11-30 Akim Demaille <akim@epita.fr>
7791 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
7792 if body instead of `;' to pacify GCC's warnings.
7794 2001-11-30 Akim Demaille <akim@epita.fr>
7796 Instead of mapping the LHS of unused rules to -1, keep the LHS
7797 valid, but flag the rules as invalid.
7799 * src/gram.h (rule_t): `useful' is a new member.
7800 * src/print.c (print_grammar): Adjust.
7801 * src/derives.c (set_derives): Likewise.
7802 * src/reader.c (packgram, reduce_output): Likewise.
7803 * src/reduce.c (reduce_grammar_tables): Likewise.
7804 * tests/reduce.at (Underivable Rules, Useless Rules): New.
7806 2001-11-30 Akim Demaille <akim@epita.fr>
7808 * src/reduce.c (reduce_output): Formatting changes.
7809 * src/print.c (print_results, print_grammar): Likewise.
7810 * tests/regression.at (Rule Line Numbers)
7811 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
7813 2001-11-30 Akim Demaille <akim@epita.fr>
7815 * src/reduce.c (nonterminals_reduce): Instead of throwing away
7816 useless nonterminals, move them at the end of the symbol arrays.
7817 (reduce_output): Adjust.
7818 * tests/reduce.at (Useless Nonterminals): Adjust.
7820 2001-11-30 Akim Demaille <akim@epita.fr>
7822 * src/reduce.c: Various comment/formatting changes.
7823 (nonterminals_reduce): New, extracted from...
7824 (reduce_grammar_tables): here.
7825 (reduce_grammar): Call nonterminals_reduce.
7827 2001-11-29 Paul Eggert <eggert@twinsun.com>
7829 * src/bison.simple (YYSTACK_REALLOC): Remove.
7830 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
7831 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
7833 (union yyalloc): New type.
7834 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
7835 an arbitrary restriction on hosts where size_t is wider than int.
7837 (yyparse): Don't dump core if alloca or malloc fails; instead, report
7838 a parser stack overflow. Allocate just one block of memory for all
7839 three stacks, instead of allocating three blocks; this typically is
7840 faster and reduces fragmentation.
7842 Do not limit the number of items in the stack to a value that fits
7843 in 'int', as this is an arbitrary limit on hosts with 64-bit
7844 size_t and 32-bit int.
7846 2001-11-29 Marc Autret <autret_m@epita.fr>
7848 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
7849 of defining YYERROR_VERBOSE.
7850 [AT_DATA]: $4 is now out of C declarations in the prologue.
7852 2001-11-28 Marc Autret <autret_m@epita.fr>
7854 * src/reader.c (parse_dquoted_param): New.
7855 (parse_skel_decl): Use it.
7856 * src/lex.h: Add its prototype.
7857 * src/lex.c (literalchar): Become not static.
7859 2001-11-28 Marc Autret <autret_m@epita.fr>
7861 * src/output.h: And put its extern declaration here.
7862 * src/output.c (error_verbose): Define here.
7863 (prepare): Echo name modification.
7864 * src/getargs.h: Clean its extern declaration.
7865 * src/getargs.c (error_verbose_flag): Remove.
7866 (getargs): Remove case 'e'.
7867 * src/options.c (option_table): 'error-verbose' is now seen as simple
7871 * src/reader.c (read_declarations): Remove case tok_include.
7872 (parse_include_decl): Remove.
7873 * src/lex.h (token_t): Remove tok_include.
7874 * src/options.c (option_table): 'include' is now a simple command line
7877 2001-11-28 Marc Autret <autret_m@epita.fr>
7879 * src/bison.simple: Adjust muscle names.
7880 * src/muscle_tab.c (muscle_init): Also rename the muscles.
7881 * src/output.c (prepare): s/_/-/ for the muscles names.
7882 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
7884 2001-11-28 Marc Autret <autret_m@epita.fr>
7886 * src/bison.simple: Fix debug.
7887 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
7889 2001-11-28 Akim Demaille <akim@epita.fr>
7891 * src/LR0.c (shifts_new): New.
7892 (save_shifts, insert_start_shift, augment_automaton): Use it.
7894 2001-11-28 Akim Demaille <akim@epita.fr>
7896 * src/closure.c (closure): `b' and `ruleno' denote the same value:
7899 2001-11-28 Akim Demaille <akim@epita.fr>
7901 * src/closure.c (closure): Instead of looping over word in array
7902 then bits in words, loop over bits in array.
7904 2001-11-28 Akim Demaille <akim@epita.fr>
7906 * src/closure.c (closure): No longer optimize the special case
7907 where all the bits of `ruleset[r]' are set to 0, to make the code
7910 2001-11-28 Akim Demaille <akim@epita.fr>
7912 * src/closure.c (closure): `r' and `c' are new variables, used to
7913 de-obfuscate accesses to RULESET and CORE.
7915 2001-11-28 Akim Demaille <akim@epita.fr>
7917 * src/reduce.c (reduce_print): Use ngettext.
7918 (dump_grammar): Improve the trace accuracy.
7920 2001-11-28 Akim Demaille <akim@epita.fr>
7922 * src/reduce.c (dump_grammar): Don't translate trace messages.
7924 2001-11-28 Akim Demaille <akim@epita.fr>
7926 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
7927 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
7928 as all tags are free'ed afterwards.
7931 2001-11-27 Paul Eggert <eggert@twinsun.com>
7933 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
7934 use alloca when we didn't want to, and vice versa.
7936 2001-11-27 Marc Autret <autret_m@epita.fr>
7938 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
7940 * src/output.c (prepare): Remove its update.
7942 2001-11-27 Marc Autret <autret_m@epita.fr>
7944 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
7947 2001-11-27 Marc Autret <autret_m@epita.fr>
7949 * src/bison.simple: Remove YYERROR_VERBOSE using.
7950 Use %%error_verbose.
7951 (yyparse): Likewise.
7952 * src/output.c (prepare): Give its final value.
7953 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
7954 * src/getargs.h: Add its extern declaration.
7955 * src/getargs.c (error_verbose_flag): New int.
7956 (getargs): Update to catch new case.
7957 * src/options.c (option_table): 'error-verbose' is a new option.
7958 (shortopts): Update.
7960 2001-11-27 Akim Demaille <akim@epita.fr>
7962 * src/system.h: Use intl/libgettext.h.
7963 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
7965 2001-11-27 Akim Demaille <akim@epita.fr>
7967 * tests/torture.at (Exploding the Stack Size with Malloc):
7968 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
7970 2001-11-27 Akim Demaille <akim@epita.fr>
7972 * src/files.c: Include error.h.
7973 Reported by Hans Aberg.
7975 2001-11-26 Marc Autret <autret_m@epita.fr>
7977 * src/reader.c (parse_include_decl): New, not yet implemented.
7978 (read_declarations): Add case tok_include.
7979 * src/getargs.h (include): Add its extern definition.
7980 * src/getargs.c (include): New const char *.
7981 (getargs): Add case '-I'.
7982 * src/options.c (option_table): Add include as command line and
7984 * src/lex.h (token_t): Add tok_include.
7986 2001-11-26 Akim Demaille <akim@epita.fr>
7988 * src/reader.c (readgram): Make sure rules for mid-rule actions
7989 have a lineno equal to that of their host rule.
7990 Reported by Hans Aberg.
7991 * tests/regression.at (Rule Line Numbers): New.
7993 2001-11-26 Akim Demaille <akim@epita.fr>
7995 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
7998 2001-11-26 Akim Demaille <akim@epita.fr>
8000 * src/complain.c, src/complain.h (error): Remove, provided by
8003 2001-11-26 Akim Demaille <akim@epita.fr>
8005 * src/reader.c (read_declarations): Don't abort on tok_illegal,
8006 issue an error message.
8007 * tests/regression.at (Invalid %directive): New.
8008 Reported by Hans Aberg.
8010 2001-11-26 Akim Demaille <akim@epita.fr>
8012 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
8013 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
8015 2001-11-26 Akim Demaille <akim@epita.fr>
8017 * src/conflicts.c (conflicts_print): Don't complain at all when
8018 there are no reduce/reduce conflicts, and as many shift/reduce
8019 conflicts as expected.
8020 * tests/regression.at (%expect right): Adjust.
8022 2001-11-23 Akim Demaille <akim@epita.fr>
8024 * lib/alloca.c: Update, from fileutils.
8026 2001-11-23 Akim Demaille <akim@epita.fr>
8028 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
8030 2001-11-23 Akim Demaille <akim@epita.fr>
8032 * src/system.h: Include alloca.h.
8033 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
8035 2001-11-23 Akim Demaille <akim@epita.fr>
8037 * src/print_graph.c (print_actions): Remove `rule', unused.
8038 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
8039 pacify GCC's signed < unsigned warnings.
8040 * src/closure.c (itemsetsize): Likewise.
8041 * src/reader.c (symbol_list_new): Static.
8043 2001-11-23 Akim Demaille <akim@epita.fr>
8045 Attaching lineno to buckets is stupid, since only one copy of each
8046 symbol is kept, only the line of the first occurrence is kept too.
8048 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
8049 * src/reader.c (rline_allocated): Remove, unused.
8050 (symbol_list): Have a `line' member.
8051 (symbol_list_new): New.
8053 * src/print.c (print_grammar): Output the rule line numbers.
8054 * tests/regression.at (Solved SR Conflicts)
8055 (Unresolved SR Conflicts): Adjust.
8056 Reported by Hans Aberg.
8058 2001-11-22 Marc Autret <autret_m@epita.fr>
8060 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
8062 2001-11-22 Marc Autret <autret_m@epita.fr>
8064 * src/muscle_tab.c (muscle_init): Remove initialization of
8066 * src/output.c (output_master_parser): Do it here.
8068 2001-11-20 Akim Demaille <akim@epita.fr>
8071 * configure.in (ALL_LINGUAS): Adjust.
8072 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
8073 longer contains strings to translate.
8075 2001-11-19 Akim Demaille <akim@epita.fr>
8077 * src/conflicts.c (conflicts_print): Add a missing \n.
8079 2001-11-19 Akim Demaille <akim@epita.fr>
8081 * src/nullable.c (nullable_print): New.
8082 (set_nullable): Call it when tracing.
8083 Better locality of variables.
8085 2001-11-19 Akim Demaille <akim@epita.fr>
8087 * src/print.c (print_actions): Better locality of variables.
8089 2001-11-19 Akim Demaille <akim@epita.fr>
8091 * src/derives.c (print_derives): Fix and enrich.
8092 * src/closure.c (print_fderives): Likewise.
8094 2001-11-19 Akim Demaille <akim@epita.fr>
8096 * src/closure.c (itemsetend): Remove, replaced with...
8099 2001-11-19 Akim Demaille <akim@epita.fr>
8101 * src/LR0.c (kernel_end): Remove, replaced with...
8104 2001-11-19 Akim Demaille <akim@epita.fr>
8106 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
8109 2001-11-19 Akim Demaille <akim@epita.fr>
8111 * src/closure.c (closure): Use arrays instead of pointers to clarify.
8113 2001-11-19 Akim Demaille <akim@epita.fr>
8115 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
8117 * src/LR0.c: Likewise.
8118 (allocate_itemsets): Use arrays instead of pointers to clarify.
8120 2001-11-19 Akim Demaille <akim@epita.fr>
8122 * src/getargs.c (statistics_flag): Replace with...
8124 (longopts): Accept --trace instead of --statistics.
8125 * src/getargs.h, src/options.c: Adjust.
8126 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
8127 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
8129 2001-11-19 Akim Demaille <akim@epita.fr>
8131 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
8132 pointers to clarify the code.
8133 (save_reductions, save_shifts): Factor common parts of alternatives.
8135 2001-11-19 Akim Demaille <akim@epita.fr>
8137 * src/LR0.c (new_state, get_state): Complete TRACE code.
8138 * src/closure.c: Include `reader.h' to get `tags', needed by the
8140 Rename the conditional DEBUG as TRACE.
8141 Output consistently TRACEs to stderr, not stdout.
8142 * src/derives.c: Likewise.
8143 * src/reduce.c: (inaccessable_symbols): Using if is better style
8145 Use `#if TRACE' instead of `#if 0' for tracing code.
8147 2001-11-19 Akim Demaille <akim@epita.fr>
8149 * src/system.h (LIST_FREE, shortcpy): New.
8150 * src/LR0.c: Use them.
8151 * src/output.c (free_itemsets, free_reductions, free_shifts):
8152 Remove, replaced by LIST_FREE.
8154 2001-11-19 Akim Demaille <akim@epita.fr>
8156 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
8157 (REDUCTIONS_ALLOC): New.
8158 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
8161 2001-11-19 Akim Demaille <akim@epita.fr>
8163 * src/LR0.c (new_state): Complete trace code.
8164 * src/nullable.c (set_nullable): Don't translate traces.
8166 2001-11-19 Akim Demaille <akim@epita.fr>
8168 * src/print_graph.c (print_core): Better locality of variables.
8169 * src/print.c (print_core): Likewise.
8171 2001-11-19 Akim Demaille <akim@epita.fr>
8173 * src/vcg.c: You do the output, so you are responsible of the
8174 handling of VCG syntax, in particular: use quotearg.
8175 * src/print_graph.c: Don't.
8176 (print_actions): Don't output the actions as part of the nodes,
8177 since that's the job of the edges.
8178 (print_state): Don't output by hand: fill the node description,
8179 and ask for its output.
8181 2001-11-19 Akim Demaille <akim@epita.fr>
8183 * src/bison.simple (yyparse): When verbosely reporting an error,
8184 no longer put additional quotes around token names.
8185 * tests/calc.at: Adjust.
8187 2001-11-19 Akim Demaille <akim@epita.fr>
8189 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
8190 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
8191 * src/output.c: Adjust.
8193 2001-11-19 Akim Demaille <akim@epita.fr>
8195 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
8197 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
8199 2001-11-19 Akim Demaille <akim@epita.fr>
8201 * src/gram.h (rule_t): New.
8203 (rrhs, rlhs): Remove, part of state_t.
8204 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
8205 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8206 * src/reader.c, src/reduce.c: Adjust.
8208 2001-11-19 Akim Demaille <akim@epita.fr>
8210 * src/reader.c (symbols_output): New, extracted from...
8211 (packsymbols): Here.
8214 2001-11-19 Akim Demaille <akim@epita.fr>
8216 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
8217 (maxrhs): this new function.
8219 2001-11-19 Akim Demaille <akim@epita.fr>
8221 * src/lalr.c (F): New macro to access the variable F.
8224 2001-11-19 Akim Demaille <akim@epita.fr>
8226 * src/lalr.h (LA): New macro to access the variable LA.
8227 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8228 * src/lalr.c: Adjust.
8230 2001-11-19 Akim Demaille <akim@epita.fr>
8232 * src/lalr.c (initialize_LA): Only initialize LA. Let...
8233 (set_state_table): handle the `lookaheads' members.
8235 2001-11-19 Akim Demaille <akim@epita.fr>
8237 * src/lalr.h (lookaheads): Removed array, whose contents is now
8239 (state_t): this structure.
8240 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8243 2001-11-19 Akim Demaille <akim@epita.fr>
8245 * src/lalr.h (consistent): Removed array, whose contents is now
8247 (state_t): this structure.
8248 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8251 2001-11-19 Akim Demaille <akim@epita.fr>
8253 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
8254 contents are now members of...
8255 (state_t): this structure.
8256 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
8259 2001-11-19 Akim Demaille <akim@epita.fr>
8261 * src/lalr.h (state_t): New.
8262 (state_table): Be a state_t * instead of a core **.
8263 (accessing_symbol): Remove, part of state_t.
8264 * src/lalr.c: Adjust.
8265 (set_accessing_symbol): Merge into...
8266 (set_state_table): this.
8267 * src/print_graph.c, src/conflicts.c: Adjust.
8269 2001-11-14 Akim Demaille <akim@epita.fr>
8271 * tests/calc.at, tests/output.at, tests/regression.at,
8272 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
8273 now the tests are run in private dirs, therefore AC_CLEANUP and
8274 family can be simplified to 0-ary.
8275 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
8276 use abs. path to find config.h.
8277 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
8278 stderr, there can be way too much random noise.
8279 Instead pass -Werror to GCC and rely on the exit status.
8280 Reported by Wolfram Wagner.
8282 2001-11-14 Akim Demaille <akim@epita.fr>
8284 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
8285 defined only if yyoverflow is defined, to avoid `warning: unused
8287 Reported by The Test Suite.
8289 2001-11-14 Akim Demaille <akim@epita.fr>
8291 * src/print.c: Include reduce.h.
8292 Reported by Hans Aberg.
8294 2001-11-14 Akim Demaille <akim@epita.fr>
8296 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
8297 Revert a previous patch: these are really const.
8298 * src/conflicts.c (conflict_report): Additional useless pair of
8299 braces to pacify GCC's warnings for `if () if () {} else {}'.
8300 * src/lex.c (parse_percent_token): Replace equal_offset with
8303 Be sure to strdup `arg' when used, since there is no reason for
8304 token_buffer not to change.
8306 2001-11-14 Akim Demaille <akim@epita.fr>
8308 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
8310 * src/main.c (main): Use them.
8311 Suggested by Hans Aberg.
8313 2001-11-12 Akim Demaille <akim@epita.fr>
8315 * src/system.h (ngettext): Now that we use ngettext, be sure to
8316 provide a default definition when NLS are not used.
8318 2001-11-12 Akim Demaille <akim@epita.fr>
8320 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
8321 Use @kbd to denote user input.
8322 (Language and Grammar): ANSIfy the example.
8323 Adjust its layout for info/notinfo.
8324 (Location Tracking Calc): Output error messages to stderr.
8325 Output locations in a more GNUtically correct way.
8326 Fix a couple of Englishos.
8327 Adjust @group/@end group pairs.
8329 2001-11-12 Akim Demaille <akim@epita.fr>
8331 %expect was not functioning at all.
8333 * src/conflicts.c (expected_conflicts): Set to -1.
8334 (conflict_report): Use ngettext.
8335 (conflicts_print): Check %expect and make its violation an error.
8336 * doc/bison.texinfo (Expect Decl): Adjust.
8337 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
8338 * tests/regression.at (%expect not enough, %expect right)
8339 (%expect too much): New.
8341 2001-11-12 Akim Demaille <akim@epita.fr>
8343 * tests/regression.at (Conflicts): Rename as...
8344 (Unresolved SR Conflicts): this.
8345 (Solved SR Conflicts): New.
8347 2001-11-12 Akim Demaille <akim@epita.fr>
8349 * src/reduce.c (print_results): Rename as...
8350 (reduce_output): This.
8351 Output to OUT, passed as argument, instead of output_obstack.
8352 (dump_grammar): Likewise.
8355 (reduce_grammar): No longer call reduce_output, since...
8356 * src/print.c (print_results): do it.
8357 * src/main.c (main): Call reduce_free;
8359 2001-11-12 Akim Demaille <akim@epita.fr>
8361 * src/conflicts.c (print_reductions): Accept OUT as argument.
8362 Output to it, not to output_obstack.
8363 * src/print.c (print_actions): Adjust.
8365 2001-11-12 Akim Demaille <akim@epita.fr>
8367 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
8368 the result instead of using...
8369 (src_total, rrc_total, src_count, rrc_count): Remove.
8370 (any_conflicts): Remove.
8371 (print_conflicts): Split into...
8372 (conflicts_print, conflicts_output): New.
8373 * src/conflicts.h: Adjust.
8374 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
8375 * src/print.c (print_grammar): Issue `\n' between two rules.
8376 * tests/regression.at (Conflicts): New.
8377 Reported by Tom Lane.
8379 2001-11-12 Akim Demaille <akim@epita.fr>
8381 * tests/regression.at (Invalid input): Remove, duplicate with
8382 ``Invalid input: 1''.
8384 2001-11-12 Akim Demaille <akim@epita.fr>
8386 * tests/torture.at (AT_DATA_STACK_TORTURE)
8387 (Exploding the Stack Size with Alloca)
8388 (Exploding the Stack Size with Malloc): New.
8390 2001-11-12 Akim Demaille <akim@epita.fr>
8392 * src/bison.simple (YYSTACK_REALLOC): New.
8393 (yyparse) [!yyoverflow]: Use it and free the old stack.
8394 Reported by Per Allansson.
8396 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
8398 * src/bison.simple: Define type yystype instead of YYSTYPE, and
8399 define CPP macro, which substitute YYSTYPE by yystype.
8400 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
8401 with yyltype/YYLTYPE. This allows inclusion of the generated
8402 header within the parser if the compiler, such as GGC, accepts
8403 multiple equivalent #defines.
8406 2001-11-05 Akim Demaille <akim@epita.fr>
8408 * src/reader.c (symbols_output): New, extracted from...
8409 (packsymbols): here.
8412 2001-11-05 Akim Demaille <akim@epita.fr>
8414 * src/lex.c (parse_percent_token): s/quotearg/quote/.
8416 2001-11-05 Akim Demaille <akim@epita.fr>
8418 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
8421 2001-11-05 Akim Demaille <akim@epita.fr>
8423 * src/options.h (struct option_table_struct): set_flags is void*.
8424 * src/options.c (longopts): Support `--output' and `%output'.
8426 * src/lex.h (tok_setopt): Remove, replaced with...
8427 (tok_intopt, tok_stropt): these new guys.
8428 * src/lex.c (getopt.h): Not needed.
8429 (token_buffer, unlexed_token_buffer): Not const.
8430 (percent_table): Promote `-' over `_' in directive names.
8431 Active `%name-prefix', `file-prefix', and `output'.
8432 (parse_percent_token): Accept possible arguments to directives.
8433 Promote `-' over `_' in directive names.
8435 2001-11-04 Akim Demaille <akim@epita.fr>
8437 * doc/bison.texinfo (Decl Summary): Split the list into
8438 `directives for grammars' and `directives for bison'.
8440 Add description of `%name-prefix', `file-prefix', and `output'.
8441 Promote `-' over `_' in directive names.
8442 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
8443 Simplify the description of `--name-prefix'.
8444 Promote `-' over `_' in directive names.
8445 Promote `--output' over `--output-file'.
8446 Fix the description of `--defines'.
8447 * tests/output.at: Exercise %file-prefix and %output.
8449 2001-11-02 Akim Demaille <akim@epita.fr>
8451 * doc/refcard.tex: Update.
8453 2001-11-02 Akim Demaille <akim@epita.fr>
8455 * src/symtab.h (SUNDEF): New.
8456 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
8457 stand for `uninitialized', instead of 0.
8458 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
8459 * src/lex.c (lex): Adjust.
8461 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
8463 Let yylex return it instead of a plain 0.
8464 Reported by Dick Streefland.
8466 2001-11-02 Akim Demaille <akim@epita.fr>
8468 * tests/regression.at (Mixing %token styles): New test.
8470 2001-11-02 Akim Demaille <akim@epita.fr>
8472 * src/reader.c (parse_thong_decl): Formatting changes.
8473 (token_translations_init): New, extracted from...
8474 (packsymbols): Here.
8477 2001-11-01 Akim Demaille <akim@epita.fr>
8479 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
8480 Check that `9foo.y' produces correct cpp guards.
8481 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
8485 2001-11-01 Akim Demaille <akim@epita.fr>
8487 * tests/regression.at (Invalid input: 2): New.
8488 * src/lex.c (unlexed_token_buffer): New.
8489 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
8493 2001-11-01 Akim Demaille <akim@epita.fr>
8495 * tests/calc.at: Catch up with 1.30.
8496 * configure.in: Bump to 1.49a.
8497 Adjust to newer Autotest.
8499 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
8501 * src/conflicts.c: Move global variables rrc_total and src_total ...
8502 (print_conflicts): here.
8503 * src/output.c (output): Free global variable user_toknums.
8504 * src/lex.c (token_obstack): Become static.
8506 2001-10-18 Akim Demaille <akim@epita.fr>
8508 * tests/atlocal.in (GCC): Add.
8509 * tests/calc.at: s/m4_match/m4_bmatch/.
8510 s/m4_patsubst/m4_bpatsubst/.
8511 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
8512 * configure.in: AC_SUBST(GCC).
8514 2001-10-14 Marc Autret <autret_m@epita.fr>
8516 * src/options.c (create_long_option_table): Fix.
8518 2001-10-10 Akim Demaille <akim@epita.fr>
8520 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
8522 2001-10-04 Akim Demaille <akim@epita.fr>
8524 * src/reader.c (parse_union_decl): Push the caracters in
8525 union_obstack, not attrs_obstack.
8527 2001-10-04 Akim Demaille <akim@epita.fr>
8529 Merge in the branch 1.29.
8531 * src/reader.c (packsymbols): Use a temporary obstack for
8532 `%%tokendef', since output_stack is already used elsewhere.
8534 2001-10-02 Akim Demaille <akim@epita.fr>
8538 2001-10-02 Akim Demaille <akim@epita.fr>
8542 2001-10-02 Akim Demaille <akim@epita.fr>
8544 * tests/regression.at (Invalid CPP headers): New.
8545 From Alexander Belopolsky.
8546 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
8548 2001-10-02 Akim Demaille <akim@epita.fr>
8550 * tests/regression.at (Invalid input): New.
8551 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
8554 2001-10-02 Akim Demaille <akim@epita.fr>
8556 * tests/calc.at: Now that --debug works, the tests must be adjusted.
8558 2001-10-02 Akim Demaille <akim@epita.fr>
8560 * src/output.c (output_parser): Assert `skeleton'.
8561 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
8565 2001-10-01 Marc Autret <autret_m@epita.fr>
8567 * src/lex.h: Echo modifications.
8568 * src/lex.c (unlex): Parameter is now token_t.
8571 2001-10-01 Marc Autret <autret_m@epita.fr>
8573 * src/main.c: Include lex.h.
8576 2001-09-29 Akim Demaille <akim@epita.fr>
8578 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
8580 2001-09-28 Akim Demaille <akim@epita.fr>
8582 * tests/testsuite.at: Update to newer Autotest.
8583 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
8585 2001-09-27 Akim Demaille <akim@epita.fr>
8587 Position independent wrapper.
8589 * tests/bison: Remove.
8590 * tests/bison.in: New.
8591 * configure.in: Adjust.
8593 2001-09-27 Paul Eggert <eggert@twinsun.com>
8595 Port quotearg fixes from tar 1.13.24.
8597 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
8599 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
8600 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
8602 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
8603 * m4/mbrtowc.m4: New file.
8604 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
8605 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
8607 2001-09-27 Akim Demaille <akim@epita.fr>
8611 2001-09-27 Akim Demaille <akim@epita.fr>
8615 2001-09-25 Akim Demaille <akim@epita.fr>
8617 * src/system.h: Include `xalloc.h'.
8618 Remove it from the C files.
8619 * src/files.c (output_files): Free the obstacks.
8620 * src/lex.c (init_lex): Rename as...
8623 * src/main.c (main): Use it.
8625 2001-09-24 Marc Autret <autret_m@epita.fr>
8627 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
8628 to output informations in fout (FILE*).
8629 (open_graph, close_graph): Likewise.
8630 (output_graph, output_edge, output_node): Likewise.
8631 * src/vcg.h: Update function prototypes.
8632 * src/print_graph.c (print_graph): Open output graph file.
8633 (print_actions): Adjust.
8634 * src/files.h: Remove extern declaration.
8635 * src/files.c: Remove graph_obstack declaration.
8636 (open_files): Remove graph_obstack initialization.
8637 (output_files): Remove graph_obstack saving.
8639 2001-09-24 Marc Autret <autret_m@epita.fr>
8641 * src/files.c (compute_output_file_names): Fix.
8643 2001-09-24 Marc Autret <autret_m@epita.fr>,
8644 Akim Demaille <akim@epita.fr>
8646 * src/reader.c (reader): Remove call to free_symtab ().
8647 * src/main.c (main): Call it here.
8649 * src/conflicts.c (initialize_conflicts): Rename as...
8650 (solve_conflicts): this.
8651 * src/print.c (print_core, print_actions, print_state)
8652 (print_grammar): Dump to a file instead a `output_obstack'.
8653 (print_results): Dump `output_obstack', and then proceed with the
8655 * src/files.c (compute_output_file_names, close_files): New.
8656 (output_files): Adjust.
8657 * src/main.c (main): Adjust.
8659 2001-09-23 Marc Autret <autret_m@epita.fr>
8661 * src/files.c (compute_header_macro): Computes header macro name
8662 from spec_defines_file when given.
8664 2001-09-23 Marc Autret <autret_m@epita.fr>
8666 * src/files.c (output_files): Add default extensions.
8668 2001-09-22 Akim Demaille <akim@epita.fr>
8670 * src/conflicts.c (finalize_conflicts): Rename as...
8671 (free_conflicts): this.
8673 2001-09-22 Akim Demaille <akim@epita.fr>
8675 * src/gram.c (gram_free): Rename back as...
8677 (output_token_translations): Free `token_translations'.
8678 * src/symtab.c (free_symtab): Free the tag field.
8680 2001-09-22 Akim Demaille <akim@epita.fr>
8682 Remove `translations' as it is always set to true.
8684 * src/gram.h: Adjust.
8685 * src/reader.c (packsymbols, parse_token_decl): Adjust
8686 * src/print.c (print_grammar): Adjust.
8687 * src/output.c (output_token_translations): Adjust.
8688 * src/lex.c (lex): Adjust.
8689 * src/gram.c: Be sure the set pointers to NULL.
8690 (dummy): Rename as...
8693 2001-09-22 Akim Demaille <akim@epita.fr>
8695 * configure.in: Invoke AM_LIB_DMALLOC.
8696 * src/system.h: Use dmalloc.
8697 * src/LR0.c: Be sure to have pointers initialized to NULL.
8698 (allocate_itemsets): Allocate kernel_items only if needed.
8700 2001-09-22 Akim Demaille <akim@epita.fr>
8702 * configure.in: Bump to 1.29b.
8703 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
8704 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
8705 need xmalloc.c in calc.y.
8708 2001-09-21 Akim Demaille <akim@epita.fr>
8711 * Makefile.maint, config/config.guess, config/config.sub,
8712 * config/missing: Update from masters.
8713 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
8715 * configure.in (ALL_LINGUAS): Add `tr'.
8717 2001-09-21 Akim Demaille <akim@epita.fr>
8719 * tests/Makefile.am (package.m4): Move to...
8720 ($(srcdir)/$(TESTSUITE)): here.
8722 2001-09-20 Akim Demaille <akim@epita.fr>
8724 * src/complain.c: No longer try to be standalone: use system.h.
8725 Don't assume __STDC__ is defined to 1. Just test if it is defined.
8726 * src/complain.h: Likewise.
8727 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
8728 Remove the unused variable `n'.
8729 From Albert Chin-A-Young.
8731 2001-09-18 Marc Autret <autret_m@epita.fr>
8733 * doc/bison.1: Update.
8734 * doc/bison.texinfo (Bison Options): Update --defines and --graph
8736 (Option Cross Key): Update.
8739 2001-09-18 Marc Autret <autret_m@epita.fr>
8741 * tests/regression.at: New test (comment in %union).
8743 2001-09-18 Marc Autret <autret_m@epita.fr>
8745 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
8747 Reported by Keith Browne.
8749 2001-09-18 Marc Autret <autret_m@epita.fr>
8751 * tests/output.at: Add tests for --defines and --graph.
8753 2001-09-18 Marc Autret <autret_m@epita.fr>
8755 * tests/output.at: Removes tests of %{header,src}_extension features.
8757 2001-09-18 Akim Demaille <akim@epita.fr>
8759 * tests/Makefile.am (package.m4): New.
8760 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
8761 (_AT_CHECK_CALC_ERROR): Likewise.
8762 Factor the `, ' part of verbose error messages.
8764 2001-09-18 Marc Autret <autret_m@epita.fr>
8766 * src/getargs.c (longopts): Declare --defines and --graph as options
8767 with optional arguments.
8768 * src/files.h: Add extern declarations.
8769 * src/files.c (spec_graph_file, spec_defines_file): New.
8770 (output_files): Update.
8771 Remove CPP-outed code.
8773 2001-09-18 Marc Autret <autret_m@epita.fr>
8775 Turn off %{source,header}_extension feature.
8777 * src/files.c (compute_exts_from_gf): Update.
8778 (compute_exts_from_src): Update.
8779 (output_files): CPP-out useless code.
8780 * src/files.h: Remove {header,source}_extension extern declarations.
8781 * src/reader.c (parse_dquoted_param): CPP-out.
8782 (parse_header_extension_decl): Remove.
8783 (parse_source_extension_decl): Remove.
8784 (read_declarations): Remove cases tok_{hdrext,srcext}.
8785 * src/lex.c (percent_table): Remove {header,source}_extension entries.
8786 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
8788 2001-09-10 Akim Demaille <akim@epita.fr>
8790 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
8791 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
8792 (AT_CHECK_OUTPUT): this.
8793 Merely check ls' exit status, its output is useless.
8795 2001-09-10 Akim Demaille <akim@epita.fr>
8797 * tests/calc.at: Use m4_match.
8798 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
8800 2001-09-10 Marc Autret <autret_m@epita.fr>,
8801 Akim Demaille <akim@epita.fr>
8803 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
8805 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
8807 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
8808 * src/lex.h: Adjust prototype.
8809 (token_t): Add `tok_undef'.
8810 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
8811 (parse_percent_token): Now returns token_t.
8812 Add default statement in switch.
8813 (lex): Separate `c' as an input variable, from the token_t result
8815 (unlexed): Is a token_t.
8817 2001-09-10 Akim Demaille <akim@epita.fr>
8819 * configure.in: Bump to 1.29a.
8821 2001-09-07 Akim Demaille <akim@epita.fr>
8825 2001-08-30 Akim Demaille <akim@epita.fr>
8827 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
8828 * m4/atconfig.m4: Remove.
8829 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
8831 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
8832 m4_if, m4_patsubst, and m4_regexp.
8833 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
8834 `input' file instead of echo.
8836 2001-08-29 Akim Demaille <akim@epita.fr>
8840 2001-08-29 Akim Demaille <akim@epita.fr>
8844 2001-08-29 Paul Eggert <eggert@twinsun.com>
8846 * src/bison.simple (yyparse): Don't take the address of an
8847 item before the start of an array, as that doesn't conform to
8850 2001-08-29 Robert Anisko <anisko_r@epita.fr>
8852 * doc/bison.texinfo (Location Tracking Calc): New node.
8854 2001-08-29 Paul Eggert <eggert@twinsun.com>
8856 * src/output.c (output): Do not define const, as this now
8857 causes more problems than it cures.
8859 2001-08-29 Akim Demaille <akim@epita.fr>
8861 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
8863 Be sure to tag the `detailmenu'.
8865 2001-08-29 Akim Demaille <akim@epita.fr>
8867 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
8868 download in a tmp dir.
8870 2001-08-28 Marc Autret <autret_m@epita.fr>
8872 * config/depcomp: New file.
8874 2001-08-28 Marc Autret <autret_m@epita.fr>
8876 * doc/bison.1 (mandoc): Adjust.
8877 From Juan Manuel Guerrero.
8879 2001-08-28 Marc Autret <autret_m@epita.fr>
8881 * src/print_graph.c (print_state): Fix.
8883 2001-08-27 Marc Autret <autret_m@epita.fr>
8885 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
8887 Echo modifications to the functions prototypes.
8888 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
8890 2001-08-27 Marc Autret <autret_m@epita.fr>
8892 * src/vcg.c: Include `xalloc.h'.
8893 (add_colorentry): New.
8894 (add_classname): New.
8895 (add_infoname): New.
8896 * src/vcg.h: Add new prototypes.
8898 2001-08-27 Akim Demaille <akim@epita.fr>
8900 * Makefile.maint: Sync. again with CVS Autoconf.
8902 2001-08-27 Akim Demaille <akim@epita.fr>
8904 * Makefile.maint: Formatting changes.
8905 (po-update, cvs-update, update): New targets.
8908 2001-08-27 Akim Demaille <akim@epita.fr>
8910 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
8911 * Makefile.maint: Sync. with CVS Autoconf.
8913 2001-08-27 Marc Autret <autret_m@epita.fr>
8915 * src/vcg.h (struct infoname_s): New.
8916 (struct colorentry_s): New.
8917 (graph_s): New fields {vertical,horizontal}_order in structure.
8918 Add `infoname' field.
8919 Add `colorentry' field;
8920 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
8921 (G_HORIZONTAL_ORDER): New.
8923 (G_COLORENTRY): New.
8924 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
8925 Add output of `infoname'.
8926 Add output of `colorentry'.
8928 2001-08-27 Marc Autret <autret_m@epita.fr>
8930 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
8931 This one shadowed a global parameter.
8933 2001-08-24 Marc Autret <autret_m@epita.fr>
8935 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
8936 instead of `unsigned'.
8937 (print_state): Do not call obstack_object_size () in obstack_grow ()
8938 to avoid macro variables shadowing.
8940 2001-08-23 Marc Autret <autret_m@epita.fr>
8942 * src/lex.c (percent_table): Typo: s/naem/name/.
8944 Normalize new options declarations.
8946 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
8948 * tests/suite.at: Exercise %header_extension and %source_extension.
8950 2001-08-16 Marc Autret <autret_m@epita.fr>
8952 * src/reader.c (parse_dquoted_param): New.
8953 (parse_header_extension_decl): Use it.
8954 (parse_source_extension_decl): Likewise.
8956 2001-08-16 Marc Autret <autret_m@epita.fr>
8958 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
8959 (get_xxxx_str): Use assert () instead of complain ().
8960 Remove return invokations in default cases.
8961 (get_decision_str): Modify default behaviour. Remove second argument.
8962 Echo modifications on calls.
8963 (output_graph): Fix.
8965 2001-08-16 Marc Autret <autret_m@epita.fr>
8967 * src/getargs.c (usage): Update with ``-g, --graph''.
8969 2001-08-16 Marc Autret <autret_m@epita.fr>
8971 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
8972 (Option Cross Key): Likewise.
8973 * doc/bison.1: Update.
8975 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
8977 * src/output.c (output_master_parser): Don't finish action_obstack.
8978 (output_parser): Don't care about the muscle action, here.
8979 (prepare): Copy the action_obstack in the action muscle.
8980 (output): Free action_obstack.
8982 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
8984 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
8985 will contain `%union' declaration.
8986 (parse_union_decl): Delete #line directive output.
8987 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
8988 informations about %union.
8989 (parse_union_decl): Copy the union_obstack in the muscle stype.
8990 * src/bison.simple: Add new #line directive.
8991 Add typdef %%stype YYSTYPE.
8993 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
8995 * src/bison.simple: Add new `#line' directive.
8997 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
8999 * src/bison.simple: New `#line' directive.
9000 * src/output.c (output_parser): Support new dynamic muscle input_line.
9002 2001-09-22 Marc Autret <autret_m@epita.fr>
9004 * src/output.c (output_master_parser): New.
9005 (output_parser): Be more re-entrant.
9007 2001-09-21 Marc Autret <autret_m@epita.fr>
9009 * src/reader.c (copy_definition, parse_union_decl): Update and use
9011 (copy_action): Likewise.
9012 Use obstack_1grow ().
9013 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
9015 2001-09-21 Marc Autret <autret_m@epita.fr>
9017 * src/options.c (option_table): Adjust.
9018 * src/lex.c (parse_percent_token): Fix.
9020 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
9022 * src/options.c (symtab.h): Include it, need by lex.h.
9024 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
9026 * src/lex.c (parse_percent_token): Change type of variable `tx', which
9027 is now an option_table_struct*.
9028 (option_strcmp): New function option_strcmp.
9029 (parse_percent_token): Call option_strcmp.
9030 * src/getargs.c (xalloc.h, options.h): Include it.
9031 (getargs): Call create_long_option_table.
9032 (getargs): Free longopts at the end of the function.
9033 (shortopts): Move in options.c.
9034 * src/options.c (create_long_option_table): New function. Convert
9035 information from option_table to option structure.
9036 * src/reader.c (options.h): Include it.
9038 * src/Makefile.am: Adjust.
9039 * src/options.c (option_table): Create from longopts and percent_table.
9040 * src/getargs.c (longopts): Delete.
9041 * src/lex.c (struct percent_table_struct): Delete.
9042 (percent_table): Delete.
9043 (options.h): Include it.
9044 * src/options.c: Create.
9045 * src/options.h: Create.
9046 Declare enum opt_access_e.
9047 Define struct option_table_struct.
9049 2001-09-20 Marc Autret <autret_m@epita.fr>
9051 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
9054 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
9056 * src/bison.simple: s/%%filename/%%skeleton.
9057 * src/muscle_tab.c (getargs.h): Include it.
9058 (muscle_init): Insert new muscle skeleton.
9060 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
9062 * src/output.c (output_parser): Delete unused variable actions_dumped.
9064 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
9066 * src/output.c (output): Delete call to reader_output_yylsp.
9067 * src/reader.c (reader): Likewise.
9068 * src/reader.h: Delete declaration of reader_output_yylsp.
9070 2001-09-02 Marc Autret <autret_m@epita.fr>
9072 * src/reader.c: Include muscle_tab.h.
9073 (parse_union_decl): Update.
9074 (parse_macro_decl): Rename parse_muscle_decl.
9075 Update to use renamed functions and variable.
9076 (read_declarations, copy_action, read_additionnal_code, : Updated
9077 with correct variables and functions names.
9078 (packsymbols, reader): Likewise.
9080 * src/reader.h (muscle_obstack): Extern declaration update.
9082 * src/output.c: Include muscle_tab.h
9083 In all functions using macro_insert, change by using muscle_insert ().
9084 (macro_obstack): Rename muscle_obstack.
9085 Echo modifications in the whole file.
9086 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
9087 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
9088 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
9090 * src/muscle_tab.h: Update double inclusion macros.
9091 (macro_entry_s): Rename muscle_entry_s.
9094 * src/muscle_tab.c: Include muscle_tab.h.
9095 Rename macro_tabble to muscle_table.
9096 (mhash1, mhash2, mcmp): Use muscle_entry.
9097 (macro_init): Rename muscle_init. Update.
9098 (macro_insert): Rename muscle_insert. Update.
9099 (macro_find): Rename muscle_find. Update.
9101 * src/main.c: Include muscle_tab.h.
9102 (main): Call muscle_init ().
9103 * src/Makefile.am (bison_SOURCES): Echo modifications.
9105 2001-09-02 Marc Autret <autret_m@epita.fr>
9107 Now the files macro_tab.[ch] are named muscle_tab.[ch].
9109 * src/muscle_tab.c, src/muscle_tab.h: Add files.
9111 2001-09-02 Marc Autret <autret_m@epita.fr>
9113 * src/macrotab.c, src/macrotab.h: Remove.
9115 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
9117 * src/reader.c (copy_guard): Use muscle to specify the `#line'
9120 2001-09-01 Marc Autret <autret_m@epita.fr>
9122 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
9123 to an explicit value to activate the feature. We do it here.
9125 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9127 * src/output.c (prepare): Delete the `filename' muscule insertion.
9128 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
9129 (parse_union_decl): Likewise.
9130 * src/macrotab.c (macro_init): Initialize filename by infile.
9132 2001-08-31 Marc Autret <autret_m@epita.fr>
9134 * src/bison.simple (YYLSP_NEEDED): New definition.
9135 * src/output.c (prepare): Add macro insertion of `locations_flag'
9137 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9139 * src/output.c (prepare): Delete insertion of previous muscles,
9140 and insert the `prefix' muscles.
9141 * src/macrotab.c (macro_init): Likewise.
9142 (macro_init): Initialization prefix directive by `yy'.
9143 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
9144 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
9145 yylval, yydebug, yyerror, yynerrs and yyparse.
9146 New directive `#define' to substitute yydebug, ... with option
9149 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9151 * src/main.c (main): Standardize.
9152 * src/output.c (output_table_data, output_parser): Likewise.
9153 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
9155 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
9157 * src/reader.c (read_additionnal_code): Rename %%user_code to
9159 * src/output.c (output): Rename %%declarations to %%prologue.
9160 * src/bison.simple: Echo modifications.
9162 2001-08-31 Marc Autret <autret_m@epita.fr>
9164 * src/reader.c (readgram): CleanUp.
9165 (output_token_defines): Likewise.
9166 (packsymbols): Likewise.
9168 * src/output.c (output): CPP-out useless code.
9170 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
9172 * src/reader.c (reader): Delete obsolete call to function
9173 output_trailers and output_headers.
9174 * src/output.h: Remove obsolete functions prototypes of output_headers
9175 and output_trailers.
9177 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
9179 * src/main.c: Include macrotab.h.
9180 * src/macrotab.h (macro_entry_s): Constify fields.
9181 Adjust functions prototypes.
9182 * src/macrotab.c (macro_insert): Constify key and value.
9183 (macro_find): Constify key.
9184 (macro_insert): Include 'xalloc.h'
9185 (macro_insert): Use XMALLOC.
9186 (macro_find): Constify return value.
9187 * src/output.c (output_table_data): Rename table to table_data.
9188 (output_parser): Constify macro_key, macro_value.
9190 2001-08-30 Marc Autret <autret_m@epita.fr>
9192 * src/reader.c (parse_skel_decl): New.
9193 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
9194 * src/lex.h (token_t): New token `tok_skel'.
9195 * src/lex.c (percent_table): Add skeleton option entry.
9198 2001-08-29 Marc Autret <autret_m@epita.fr>
9200 * src/bison.simple: Add %%user_code directive at the end.
9201 * src/reader.c (read_additionnal_code): New.
9203 * src/output.c (output_program): Remove.
9206 2001-08-28 Marc Autret <autret_m@epita.fr>
9208 * src/output.c (output_actions): Clean up.
9209 (output_gram): CPP-out useless code.
9210 * src/reader.c (reader): Clean up, CPP-out useless code.
9212 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
9214 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
9216 * src/bison.simple: Add `%%definitions'.
9218 2001-08-28 Marc Autret <autret_m@epita.fr>
9220 * config/depcomp: New file.
9222 2001-08-27 Paul Eggert <eggert@twinsun.com>
9224 * src/bison.simple (yyparse): Don't take the address of an
9225 item before the start of an array, as that doesn't conform to
9228 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
9230 * src/output.c (output): Remove the initialization of the macro
9231 obstack. It was done too late here.
9233 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
9235 (reader): Initialize the macro obstack here, since we need it to grow
9236 '%define' directives.
9238 * src/reader.h: Declare the macro obstack as extern.
9240 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
9242 * src/output.c (output_parser): Fix. Store single '%' characters in
9243 the output obstack instead of throwing them away.
9245 2001-08-27 Akim Demaille <akim@epita.fr>
9247 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
9249 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9251 * lib/Makefile.am: Adjust.
9253 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9255 * src/bison.simple: Update and add '%%' directives.
9257 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9259 * src/reader.c (reader): Remove calls to 'output_headers' and
9260 'output_trailers'. Remove some C output.
9261 (readgram): Disable a piece of code that was writing a default
9262 definition for 'YYSTYPE'.
9263 (reader_output_yylsp): Remove.
9264 (packsymbols): Output token defintions to a macro.
9265 (copy_definition): Disable C output.
9267 * src/reader.c (parse_macro_decl): New function used to parse macro
9269 (copy_string2): Put the body of copy_string into this new function.
9270 Add a parameter to let the caller choose whether he wants to copy the
9271 string delimiters or not.
9272 (copy_string): Be a simple call to copy_string2 with the last argument
9274 (read_declarations): Add case for macro definition.
9275 (copy_identifier): New.
9276 (parse_macro_decl): Read macro identifiers using copy_identifier
9279 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9281 * src/output.c (prepare): Add prefixed names.
9282 (output_parser): Output semantic actions.
9283 (output_parser): Fix bug on '%%line' directives.
9285 * src/output.c (output_headers): Remove. The C code printed by this
9286 function should now be in the skeletons.
9287 (output_trailers): Remove.
9288 (output): Disable call to 'reader_output_yylsp'.
9289 (output_rule_data): Do not output tables to the table obstack.
9291 * src/output.c: Remove some C dedicated output.
9292 Improve the use of macro and output obstacks.
9293 (output_defines): Remove.
9295 * src/output.c (output_token_translations): Associate 'translate'
9296 table with a macro. No output to the table obstack.
9297 (output_gram): Same for 'rhs' and 'prhs'.
9298 (output_stos): Same for 'stos'.
9299 (output_rule_data): Same for 'r1' and 'r2'.
9300 (token_actions): Same for 'defact'.
9301 (goto_actions): Same for 'defgoto'.
9302 (output_base): Same for 'pact' and 'pgoto'.
9303 (output_table): Same for 'table'.
9304 (output_check): Same for 'check'.
9306 * src/output.c (output_table_data): New function.
9307 (output_short_table): Remove.
9308 (output_short_or_char_table): Remove.
9310 * src/output.c (output_parser): Replace most of the skeleton copy code
9311 with something new. Skeletons are now processed character by character
9312 rather than line by line, and Bison looks for '%%' macros. This is the
9313 first step in making Bison's output process (a lot) more flexible.
9314 (output_parser): Use the macro table.
9316 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9318 * src/main.c (main): Initialize the macro table.
9320 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9322 * src/lex.c (percent_table): Add tok_define.
9323 * src/lex.h: Add tok_define.
9325 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9327 * src/macrotab.c: New file.
9328 * src/macrotab.h: New file.
9329 * src/Makefile.am: Update.
9331 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
9333 * lib/hash.c: New file.
9334 * lib/hash.h: New file.
9335 * lib/Makefile.am: Update.
9337 2001-08-15 Akim Demaille <akim@epita.fr>
9341 2001-08-15 Marc Autret <autret_m@epita.fr>
9343 * src/reader.c (readgram): Indent output macro YYSTYPE.
9344 (packsymbols): Likewise.
9345 (output_token_defines): Likewise.
9346 * src/files.c: Standardize.
9347 (compute_header_macro): New.
9348 (defines_obstack_save): New. Use compute_header_macro.
9349 (output_files): Update. Use defines_obstack_save.
9351 2001-08-15 Akim Demaille <akim@epita.fr>
9353 * doc/bison.texinfo (Table of Symbols): Document
9356 2001-08-15 Akim Demaille <akim@epita.fr>
9358 * missing: Update from CVS Automake.
9359 * config/config.guess, config/config.sub, config/texinfo.tex:
9360 Update from gnu.org.
9362 2001-08-15 Akim Demaille <akim@epita.fr>
9364 * Makefile.maint: Sync with CVS Autoconf.
9366 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
9368 * doc/bison.texinfo: Include GNU Free Documentation License from
9370 * doc/fdl.texi: Add to package.
9372 2001-08-14 Marc Autret <autret_m@epita.fr>
9374 Turn on %{source,header}_extension features.
9376 * src/lex.c (percent_table): Un-CPP out header_extension and
9378 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
9379 (compute_exts_from_src): Remove conditions. It restores priorities
9382 2001-08-14 Marc Autret <autret_m@epita.fr>
9384 * src/files.c (compute_base_names): Add extensions computing when
9385 `--file-prefix' used.
9386 Standardize function calls.
9388 2001-08-13 Marc Autret <autret_m@epita.fr>
9390 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
9391 defining it (defined but null disables alloca).
9393 2001-08-13 Marc Autret <autret_m@epita.fr>
9395 * src/bison.simple (_yy_memcpy): CPP reformat.
9397 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
9399 * tests/atconfig.in (CPPFLAGS): Fix.
9401 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
9403 * doc/bison.texinfo: Include GNU General Public License from
9405 * doc/gpl.texi: Add to package.
9407 2001-08-10 Marc Autret <autret_m@epita.fr>
9409 * src/print_graph.h: Fix.
9410 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
9412 2001-08-10 Akim Demaille <akim@epita.fr>
9414 * src/system.h: Provide default declarations for stpcpy, strndup,
9417 2001-08-10 Robert Anisko <anisko_r@epita.fr>
9419 * doc/bison.texinfo (Locations): Update @$ stuff.
9421 2001-08-09 Robert Anisko <anisko_r@epita.fr>
9423 * src/bison.simple (YYLLOC_DEFAULT): Update.
9426 2001-08-08 Marc Autret <autret_m@epita.fr>
9428 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
9429 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
9430 Reported by Fabrice Bauzac.
9432 2001-08-08 Marc Autret <autret_m@epita.fr>
9434 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
9435 * src/vcg.c (output_node): Fix.
9436 * src/vcg.h: Cleanup.
9437 * src/print_graph.c: Add comments.
9438 (node_output_size): New global variable. Simplify the formatting of
9439 the VCG graph output.
9440 (print_actions): Unused code is now used. It notifies the final state
9441 and no action states in the VCG graph. It also give the reduce actions.
9442 The `shift and goto' edges are red and the `go to state' edges are
9444 Get the current node name and node_obstack by argument.
9445 (node_obstack): New variable.
9446 (print_state): Manage node_obstack.
9447 (print_core): Use node_obstack given by argument.
9448 A node is not only computed here but in print_actions also.
9449 (print_graph): CPP out useless code instead of commenting it.
9451 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
9453 * tests/atconfig.in (CPPFLAGS): Fix.
9455 2001-08-07 Akim Demaille <akim@epita.fr>
9457 * src/print_graph.c (quote): New.
9458 (print_core): Use it.
9460 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
9462 * src/vcg.c (complain.h): Include it.
9463 Unepitaize `return' invocations.
9464 [NDEBUG] (main): Remove.
9465 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
9466 * src/files.c (open_files): Initialize graph_obstack.
9467 * src/print_graph.c (print_actions): CPP out useless code.
9468 (print_core): Don't output the last `\n' in labels.
9470 * src/files.c (output_files): Output the VCG file.
9471 * src/main.c (main): Invoke print_graph ();
9473 2001-08-06 Marc Autret <autret_m@epita.fr>
9475 Automaton VCG graph output.
9476 Using option ``-g'' or long option ``--graph'', you can generate
9477 a gram_filename.vcg file containing a VCG description of the LALR (1)
9478 automaton of your grammar.
9480 * src/main.c: Call to print_graph() function.
9481 * src/getargs.h: Update.
9482 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
9483 (graph_flag): New flag.
9485 (getargs): Add case `g'.
9486 * src/files.c (graph_obstack): New obstack struct.
9487 (open_files): Initialize new obstack.
9488 (output_files): Saves graph_obstack if required.
9489 * src/files.h (graph_obstack): New extern declaration.
9490 * src/Makefile.am: Add new source files.
9492 2001-08-06 Marc Autret <autret_m@epita.fr>
9494 * src/print_graph.c, src/print_graph.h (graph): New.
9495 * src/vcg.h: New file.
9496 * src/vcg.c: New file, VCG graph handling.
9498 2001-08-06 Marc Autret <autret_m@epita.fr>
9500 Add of %source_extension and %header_extension which specify
9501 the source or/and the header output file extension.
9503 * src/files.c (compute_base_names): Remove initialisation of
9504 src_extension and header_extension.
9505 (compute_exts_from_gf): Update.
9506 (compute_exts_from_src): Update.
9507 (output_files): Update.
9508 * src/reader.c (parse_header_extension_decl): New.
9509 (parse_source_extension_decl): New.
9510 (read_declarations): New case statements for the new tokens.
9511 * src/lex.c (percent_table): Add entries for %source_extension
9512 and %header_extension.
9513 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
9515 2001-08-06 Marc Autret <autret_m@epita.fr>
9517 * configure.in: Bump to 1.28c.
9518 * doc/bison.texinfo: Texinfo thingies.
9520 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
9522 * tests/atconfig.in (CPPFLAGS): Add.
9523 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
9525 2001-08-03 Akim Demaille <akim@epita.fr>
9529 2001-08-03 Akim Demaille <akim@epita.fr>
9531 * tests/Makefile.am (check-local): Ship testsuite.
9532 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
9535 2001-08-03 Akim Demaille <akim@epita.fr>
9537 * configure.in: Try using -Wformat when compiling.
9539 2001-08-03 Akim Demaille <akim@epita.fr>
9541 * configure.in: Bump to 1.28b.
9543 2001-08-03 Akim Demaille <akim@epita.fr>
9545 * src/complain.c: Adjust strerror_r portability issues.
9547 2001-08-03 Akim Demaille <akim@epita.fr>
9551 2001-08-03 Akim Demaille <akim@epita.fr>
9553 * src/getargs.c, src/getarg.h (skeleton)): Constify.
9554 * src/lex.c (literalchar): Avoid name clashes on `buf'.
9555 * src/getargs.c: Include complain.h.
9556 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
9557 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
9559 2001-08-03 Akim Demaille <akim@epita.fr>
9561 * src/reader.c (readgram): Display hidden chars in error messages.
9563 2001-08-03 Akim Demaille <akim@epita.fr>
9565 Update to gettext 0.10.39.
9567 2001-08-03 Akim Demaille <akim@epita.fr>
9569 * lib/strspn.c: New.
9571 2001-08-01 Marc Autret <autret_m@epita.fr>
9573 * doc/bison.texinfo: Update.
9574 * doc/bison.1 (mandoc): Update.
9575 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
9576 * src/files.c: Support output files extensions computing.
9577 (src_extension): New static variable.
9578 (header_extension): New static variable.
9580 (get_extension_index): New function, gets the index of an extension
9581 filename in a string.
9582 (compute_exts_from_gf): New function, computes extensions from the
9583 grammar file extension.
9584 (compute_exts_from_src): New functions, computes extensions from the
9585 C source file extension, file given by ``-o'' option.
9586 (compute_base_names): Update.
9587 (output_files): Update.
9589 2001-08-01 Robert Anisko <anisko_r@epita.fr>
9591 * doc/bison.texi: Document @$.
9592 (Locations): New section.
9594 2001-07-18 Akim Demaille <akim@epita.fr>
9596 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
9597 * config/prev-version.txt, config/move-if-change: New.
9598 * Makefile.am: Adjust.
9600 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
9602 * src/bison.simple (yyparse): Suppress warning `comparaison
9603 between signed and unsigned'.
9605 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
9607 * src/getargs.h (raw_flag): Remove.
9608 * src/getargs.c: Die on `-r'/`--raw'.
9609 * src/lex.c (parse_percent_token): Die on `%raw'.
9610 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
9611 * tests/calc.at: Suppress test with option `--raw'.
9613 2001-07-14 Akim Demaille <akim@epita.fr>
9616 * configure.in: Require Autoconf 2.50.
9617 Update to gettext 0.10.38.
9619 2001-03-16 Akim Demaille <akim@epita.fr>
9621 * doc/bison.texinfo: ANSIfy the examples.
9623 2001-03-16 Akim Demaille <akim@epita.fr>
9625 * getargs.c (skeleton): New variable.
9626 (longopts): --skeleton is a new option.
9627 (shortopts, getargs): -S is a new option.
9628 * getargs.h: Declare skeleton.
9629 * output.c (output_parser): Use it.
9631 2001-03-16 Akim Demaille <akim@epita.fr>
9633 * m4/strerror_r.m4: New.
9634 * m4/error.m4: Run AC_FUNC_STRERROR_R.
9635 * lib/error.h, lib/error.c: Update.
9637 2001-03-16 Akim Demaille <akim@epita.fr>
9639 * src/getargs.c (longopts): Clean up.
9641 2001-02-21 Akim Demaille <akim@epita.fr>
9643 * src/reader.c (gensym): `gensym_count' is your own.
9644 Use a static buf to create the symbol name, as token_buffer is no
9647 2001-02-08 Akim Demaille <akim@epita.fr>
9649 * src/conflicts.c (conflict_report): Be sure not to append to res
9650 between two calls, which could happen if both first sprintf were
9651 skipped, but not the first cp += strlen.
9653 2001-02-08 Akim Demaille <akim@epita.fr>
9655 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
9656 New, from fileutils 4.0.37.
9657 * configure.in: Require Autoconf 2.49c. I took some time before
9658 making this decision. This is the only way out for portability
9659 issues in Bison, it would mean way too much duplicate effort to
9660 import in Bison features implemented in 2.49c since 2.13.
9661 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
9663 2001-02-02 Akim Demaille <akim@epita.fr>
9665 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
9666 * lib/xalloc.h, lib/xmalloc.c: Update.
9668 2001-01-19 Akim Demaille <akim@epita.fr>
9670 Get rid of the ad hoc handling of token_buffer in the scanner: use
9673 * src/lex.c (token_obstack): New.
9674 (init_lex): Initialize it. No longer call...
9675 (grow_token_buffer): this. Remove it.
9676 Adjust all the places which used it to use the obstack.
9678 2001-01-19 Akim Demaille <akim@epita.fr>
9680 * src/lex.h: Rename all the tokens:
9681 s/\bENDFILE\b/tok_eof/g;
9682 s/\bIDENTIFIER\b/tok_identifier/g;
9684 Let them be enums, not #define, to ease debugging.
9685 Adjust all the code.
9687 2001-01-18 Akim Demaille <akim@epita.fr>
9689 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
9690 * src/lex.c (maxtoken, grow_token_buffer): Static.
9692 2001-01-18 Akim Demaille <akim@epita.fr>
9694 Since we now use obstacks, more % directives can be enabled.
9696 * src/lex.c (percent_table): Also accept `%yacc',
9697 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
9699 Handle the actions for `%semantic_parser' and `%pure_parser' here,
9700 instead of returning a token.
9701 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
9702 * src/reader.c (read_declarations): Adjust.
9703 * src/files.c (open_files): Don't call `compute_base_names', don't
9704 compute `attrsfile' since they depend upon data which might be
9705 *in* the input file now.
9706 (output_files): Do it here.
9707 * src/output.c (output_headers): Document the fact that this patch
9708 introduces a guaranteed SEGV for semantic parsers.
9709 * doc/bison.texinfo: Document them.
9710 * tests/suite.at: Exercise these %options.
9712 2000-12-20 Akim Demaille <akim@epita.fr>
9714 Also handle the output file (--verbose) with obstacks.
9716 * files.c (foutput): Remove.
9717 (output_obstack): New.
9718 Adjust all dependencies.
9719 * src/conflicts.c: Return a string.
9720 * src/system.h (obstack_grow_string): Rename as...
9721 (obstack_sgrow): this. Be ready to work with non literals.
9722 (obstack_fgrow4): New.
9724 2000-12-20 Akim Demaille <akim@epita.fr>
9726 * src/files.c (open_files): Fix the computation of short_base_name
9727 in the case of `-o foo.tab.c'.
9729 2000-12-20 Akim Demaille <akim@epita.fr>
9731 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
9732 (copy_dollar): Now that everything uses obstacks, get rid of the
9735 2000-12-20 Akim Demaille <akim@epita.fr>
9737 * src/files.c (open_files): Actually the `.output' file is based
9738 on the short_base_name, not base_name.
9739 * tests/suite.at (Checking output file names): Adjust.
9741 2000-12-20 Akim Demaille <akim@epita.fr>
9743 * src/bison.s1: Remove, we now use directly...
9744 * src/bison.simple: this.
9745 * src/Makefile.am: Use pkgdata instead of data.
9747 2000-12-20 Akim Demaille <akim@epita.fr>
9749 * src/files.c (guard_obstack): New.
9750 (open_files): Initialize it.
9751 (output_files): Dump it...
9752 * src/files.h: Export it.
9753 * src/reader.c (copy_guard): Use it.
9755 2000-12-19 Akim Demaille <akim@epita.fr>
9757 * src/files.c (outfile, defsfile, actfile): Removed as global
9759 (open_files): Don't compute them.
9760 (output_files): Adjust.
9761 (base_name, short_base_name): Be global.
9762 Adjust dependencies.
9764 2000-12-19 Akim Demaille <akim@epita.fr>
9766 * src/files.c (strsuffix): New.
9767 (stringappend): Be just like strcat but allocate.
9768 (base_names): Eve out from open_files.
9769 Try to simplify the rather hairy computation of base_name and
9771 (open_files): Use it.
9772 * tests/suite.at (Checking output file names): New test.
9774 2000-12-19 Akim Demaille <akim@epita.fr>
9776 * src/system.h (obstack_grow_literal_string): Rename as...
9777 (obstack_grow_string): this.
9778 * src/output.c (output_parser): Recognize `%% actions' instead of
9780 * src/bison.s1: s/$/%% actions/.
9781 * src/bison.hairy: Likewise.
9783 2000-12-19 Akim Demaille <akim@epita.fr>
9785 * src/output.c (output_parser): Compute the `#line' lines when
9787 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
9788 Suggested by Hans Aberg.
9790 2000-12-19 Akim Demaille <akim@epita.fr>
9792 Let the handling of the skeleton files be local to the procedures
9795 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
9797 (fparser, open_extra_files): Remove.
9798 (open_files, output_files): Don't take care of fparser.
9799 * src/files.h: Adjust.
9800 * src/output.c (output_parser): Open and close the file to the
9802 * src/reader.c (read_declarations): When %semantic_parser, open
9805 2000-12-19 Akim Demaille <akim@epita.fr>
9807 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
9808 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
9810 2000-12-19 Akim Demaille <akim@epita.fr>
9812 * src/files.c (open_files): Yipee! We no longer need all the code
9813 looking for `/tmp' since we have no tmp file.
9815 2000-12-19 Akim Demaille <akim@epita.fr>
9817 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
9819 * src/files.c (open_files): Less dependency on MSDOS etc.
9821 2000-12-14 Akim Demaille <akim@epita.fr>
9823 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
9824 Provide a default definition.
9825 Use it when executing the default @ action.
9826 * src/reader.c (reader_output_yylsp): No longer include
9827 `timestamp' and `text' in the default YYLTYPE.
9829 2000-12-12 Akim Demaille <akim@epita.fr>
9831 * src/reader.c (copy_definition, parse_union_decl, copy_action)
9832 (copy_guard): Quote the file names.
9833 Reported by Laurent Mascherpa.
9835 2000-12-12 Akim Demaille <akim@epita.fr>
9837 * src/output.c (output_headers, output_program, output): Be sure
9838 to escape special characters when outputting filenames.
9839 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
9840 (output_headers): Don't depend on them, Use ACTSTR.
9842 2000-11-17 Akim Demaille <akim@epita.fr>
9844 * lib/obstack.h: Formatting changes.
9845 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
9846 prevents type checking.
9847 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
9848 cast the value to (void *): assigning a `foo *' to a `void *'
9850 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
9851 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
9854 2000-11-17 Akim Demaille <akim@epita.fr>
9856 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
9858 (suite.m4, regression.m4, calc.m4): these.
9859 * tests/atgeneral.m4: Update from CVS Autoconf.
9861 2000-11-17 Akim Demaille <akim@epita.fr>
9863 * tests/regression.m4 (%union and --defines): New test,
9864 demonstrating a current bug in the obstack implementation.
9866 2000-11-17 Akim Demaille <akim@epita.fr>
9868 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
9870 Use them to declare the variables which are global or local to
9873 2000-11-17 Akim Demaille <akim@epita.fr>
9875 * acconfig.h: Remove, no longer used.
9877 2000-11-07 Akim Demaille <akim@epita.fr>
9879 * src: s/Copyright (C)/Copyright/g.
9881 2000-11-07 Akim Demaille <akim@epita.fr>
9883 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
9885 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
9887 2000-11-07 Akim Demaille <akim@epita.fr>
9889 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
9890 Merge in a single CPP if/else.
9892 2000-11-07 Akim Demaille <akim@epita.fr>
9894 * src/output.c (output): Remove useless variables.
9895 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
9896 argument `data' for consistency with the prototypes.
9898 (obstack_copy, obstack_copy0): Rename the second argument as
9899 `address' for consistency. Qualify it `const'.
9900 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
9901 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
9902 `const' their input argument (`data' or `address').
9903 Adjust the corresponding macros to include `const' in casts.
9905 2000-11-03 Akim Demaille <akim@epita.fr>
9907 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
9908 s/PFILE1/BISON_HAIRY/.
9909 Adjust dependencies.
9911 2000-11-03 Akim Demaille <akim@epita.fr>
9913 For some reason, this was not applied.
9915 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
9916 `unlink': it's no longer used.
9918 2000-11-03 Akim Demaille <akim@epita.fr>
9920 * src/files.c (skeleton_find): New function, eved out of...
9921 (open_files, open_extra_files): here.
9923 2000-11-03 Akim Demaille <akim@epita.fr>
9927 * src/files.c (obstack_save): New function.
9928 (done): Rename as...
9929 (output_files): this.
9931 * src/main.c (main): Don't use `atexit' to register `done', since
9932 it no longer has to remove tmp files, just call `output_files'
9933 when there are no errors.
9935 2000-11-02 Akim Demaille <akim@epita.fr>
9937 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
9938 `unlink': it's no longer used.
9939 * src/files.h: Formatting changes.
9941 2000-11-02 Akim Demaille <akim@epita.fr>
9943 Remove the last uses of mktemp and unlink/delete.
9945 * src/files.c (fdefines, ftable): Removed.
9946 (defines_ostack, table_obstack): New.
9947 Adjust dependencies of the former into uses of the latter.
9948 * src/output.c (output_short_or_char_table, output_short_table):
9949 Convert to using obstacks.
9950 * src/reader.c (copy_comment2): Accept one FILE * and two
9952 (output_token_defines, reader_output_yylsp): Use obstacks.
9953 * src/system.h (obstack_fgrow3): New.
9955 2000-11-01 Akim Demaille <akim@epita.fr>
9957 Change each use of `fattrs' into a use of `attrs_obstack'.
9959 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
9960 * src/files.c (fattrs): Remove.
9961 (attrs_obstack): New.
9962 Adjust all dependencies.
9963 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
9965 2000-11-01 Akim Demaille <akim@epita.fr>
9968 Change each use of `faction' into a use of `action_obstack'.
9970 * lib/obstack.h, lib/obstack.c: New files.
9971 * src/files.c (faction): Remove.
9972 (action_obstack): New.
9973 Adjust all dependencies.
9975 2000-10-20 Akim Demaille <akim@epita.fr>
9977 * lib/quote.h (PARAMS): New macro. Use it.
9979 2000-10-16 Akim Demaille <akim@epita.fr>
9981 * src/output.c (output_short_or_char_table): New function.
9982 (output_short_table, output_token_translations): Use it.
9983 (goto_actions): Use output_short_table.
9985 2000-10-16 Akim Demaille <akim@epita.fr>
9987 * src/symtab.c (bucket_new): New function.
9990 * src/output.c (output_short_table): New argument to display the
9991 comment associated with the table.
9992 Adjust dependencies.
9993 (output_gram): Use it.
9994 (output_rule_data): Nicer output layout for YYTNAME.
9996 2000-10-16 Akim Demaille <akim@epita.fr>
9998 * src/lex.c (read_typename): New function.
10000 * src/reader.c (copy_dollar): Likewise.
10002 2000-10-16 Akim Demaille <akim@epita.fr>
10004 * src/reader.c (copy_comment2): Expect the input stream to be on
10005 the `/' which is suspected to open a comment, instead of being
10006 called after `//' or `/*' was read.
10007 (copy_comment, copy_definition, parse_union_decl, copy_action)
10008 (copy_guard): Adjust.
10010 2000-10-16 Akim Demaille <akim@epita.fr>
10012 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
10013 `read_signed_integer'.
10015 2000-10-16 Akim Demaille <akim@epita.fr>
10017 * src/reader.c (copy_dollar): New function.
10018 (copy_guard, copy_action): Use it.
10020 2000-10-16 Akim Demaille <akim@epita.fr>
10022 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
10023 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
10024 New files, from Fileutils 4.0.27.
10025 * src/main.c (printable_version): Remove.
10026 * src/lex.c, src/reader.c: Use `quote'.
10028 2000-10-04 Akim Demaille <akim@epita.fr>
10030 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
10032 2000-10-04 Akim Demaille <akim@epita.fr>
10034 * doc/bison.texinfo: Various typos spotted by Neil Booth.
10036 2000-10-04 Akim Demaille <akim@epita.fr>
10038 When a literal string is used to define two different tokens,
10039 `bison -v' segfaults.
10040 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
10042 * tests/regression.m4: New file.
10043 Include the core of the sample provided by Piotr Gackiewicz.
10044 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
10047 2000-10-04 Akim Demaille <akim@epita.fr>
10049 * src/reader.c (parse_expect_decl): Keep `count' within the size
10053 2000-10-02 Paul Eggert <eggert@twinsun.com>
10055 * bison.s1 (yyparse): Assign the default value
10056 unconditionally, to avoid a GCC warning and make the parser a
10059 2000-10-02 Akim Demaille <akim@epita.fr>
10061 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
10064 2000-10-02 Akim Demaille <akim@epita.fr>
10066 * src/derives.c, src/print.c, src/reduce.c: To ease the
10067 translation, move some `\n' out of the translated strings.
10069 2000-10-02 Akim Demaille <akim@epita.fr>
10071 The location tracking mechanism is precious for parse error
10072 messages. Nevertheless, it is enabled only when `@n' is used in
10073 the grammar, which is a different issue (you can use it in error
10074 message, but not in the grammar per se). Therefore, there should
10075 be another means to enable it.
10077 * src/getargs.c (getargs): Support `--locations'.
10078 (usage): Report it.
10079 * src/getargs.h (locationsflag): Export it.
10080 * src/lex.c (percent_table): Support `%locations'.
10081 * src/reader.c (yylsp_needed): Remove this variable, now replaced
10082 with `locationsflag'.
10083 * doc/bison.texinfo: Document `--locations' and `%locations'.
10085 * tests/calc.m4: Test it.
10087 For regularity of the names, replace each
10088 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
10089 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
10090 In addition replace each `flag' with `_flag'.
10092 2000-10-02 Akim Demaille <akim@epita.fr>
10094 Also test parse error messages, including with YYERROR_VERBOSE.
10096 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
10098 Use it to check the computations.
10099 Use it to check `nonassoc' is honored.
10100 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
10101 `--yyerror-verbose'.
10102 (_AT_CHECK_CALC): Adjust to this option.
10103 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
10105 2000-10-02 Akim Demaille <akim@epita.fr>
10107 Test also `--verbose', `--defines' and `--name-prefix'. Testing
10108 the latter demonstrates a flaw in the handling of non debugging
10109 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
10110 was used in order to simplify:
10126 unfortunately this leads to a CPP conflict when
10127 `--name-prefix=foo' is used since it produces `#define yydebug
10130 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
10131 (YYDPRINTF): New macro.
10133 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
10135 Also test `--verbose', `--defines' and `--name-prefix'.
10137 2000-10-02 Akim Demaille <akim@epita.fr>
10139 Improve the readability of the produced parsers.
10141 * src/bison.s1: Formatting changes.
10142 Improve the comment related to the `$' mark.
10143 (yydefault): Don't fall through to `yyresume': `goto' there.
10144 * src/output.c (output_parser): When the `$' is met, skip the end
10146 New variable, `number_of_dollar_signs', to check there's exactly
10147 one `$' in the parser skeleton.
10149 2000-10-02 Akim Demaille <akim@epita.fr>
10151 * lib/xstrdup.c: New file, from the fileutils.
10152 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
10153 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
10154 instead of strlen + xmalloc + strcpy.
10155 * src/symtab.c (copys): Remove, use xstrdup instead.
10157 2000-10-02 Akim Demaille <akim@epita.fr>
10159 * src/gram.h (associativity): New enum type which replaces the
10160 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
10161 `right_assoc', `left_assoc' and `non_assoc'.
10162 Adjust all dependencies.
10163 * src/reader.c: Formatting changes.
10164 (LTYPESTR): Don't define it, use it as a literal in
10165 `reader_output_yylsp'.
10166 * src/symtab.h (symbol_class): New enum type which replaces the
10167 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
10168 `sunknown', `stoken and `snterm'.
10170 2000-10-02 Akim Demaille <akim@epita.fr>
10172 * src/getargs.c (fixed_outfiles): Rename as...
10173 (yaccflag): for consistency and accuracy.
10174 Adjust dependencies.
10176 2000-10-02 Akim Demaille <akim@epita.fr>
10178 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
10179 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
10180 difficult and introduced a lot of core dump. It turns out that
10181 Bison used an implementation of `xmalloc' based on `calloc', and
10182 at various places it does depend upon the initialization to 0. I
10183 have not tried to isolate the pertinent places, and all the former
10184 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
10185 someone should address this issue.
10187 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
10188 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
10190 Adjust dependencies.
10191 * src/warshall.h: New file.
10194 2000-10-02 Akim Demaille <akim@epita.fr>
10196 Various anti-`extern in *.c' changes.
10198 * src/system.h: Include `assert.h'.
10200 2000-10-02 Akim Demaille <akim@epita.fr>
10202 * src/state.h (nstates, final_state, first_state, first_shift)
10203 (first_reduction): Move their exportation from here...
10204 * src/LR0.h: to here.
10205 Adjust dependencies.
10206 * src/getargs.c (statisticsflag): New variable.
10207 Add support for `--statistics'.
10208 Adjust dependencies.
10210 Remove a lot of now useless `extern' statements in most files.
10212 2000-10-02 Akim Demaille <akim@epita.fr>
10214 * src/LR0.h: New file.
10217 2000-10-02 Akim Demaille <akim@epita.fr>
10219 * src/print.h: New file.
10221 * src/print.c: Formatting and ordering changes.
10222 (verbose, terse): Replace with...
10223 (print_results): this new function.
10224 Adjust dependencies.
10226 2000-10-02 Akim Demaille <akim@epita.fr>
10228 * src/conflicts.c (conflict_report): New function.
10229 (conflict_log, verbose_conflict_log): Replace with...
10230 (print_conflicts): this function.
10231 Adjust dependencies.
10232 * src/conflicts.h: New file.
10233 Propagate its inclusion.
10235 2000-10-02 Akim Demaille <akim@epita.fr>
10237 * src/nullable.h: New file.
10238 Propagate its inclusion.
10239 * src/nullable.c: Formatting changes.
10241 2000-10-02 Akim Demaille <akim@epita.fr>
10243 * src/reduce.h: New file.
10244 Propagate its inclusion.
10245 * src/reduce.c: Topological sort and other formatting changes.
10246 (bool, TRUE, FALSE): Move their definition to...
10247 * src/system.h: here.
10249 2000-10-02 Akim Demaille <akim@epita.fr>
10251 * src/files.c: Formatting changes.
10252 (tryopen, tryclose, openfiles): Rename as...
10253 (xfopen, xfclose, open_files): this.
10254 (stringappend): static.
10255 * src/files.h: Complete the list of exported symbols.
10258 2000-10-02 Akim Demaille <akim@epita.fr>
10260 * src/reader.h: New file.
10261 Propagate its use instead of tedious list of `extern' and
10263 * src/reader.c: Formatting changes, topological sort,
10266 2000-10-02 Akim Demaille <akim@epita.fr>
10268 * src/lex.h: Prototype `lex.c' exported functions.
10269 * src/reader.c: Adjust.
10270 * src/lex.c: Formatting changes.
10271 (safegetc): Rename as...
10274 2000-10-02 Akim Demaille <akim@epita.fr>
10276 * src/lalr.h: New file.
10277 Propagate its inclusion instead of prototypes and `extern'.
10278 * src/lalr.c: Formatting changes, topological sorting etc.
10280 2000-10-02 Akim Demaille <akim@epita.fr>
10282 * src/output.c (token_actions): Introduce a temporary array,
10283 YYDEFACT, that makes it possible for this function to use
10284 output_short_table.
10286 2000-10-02 Akim Demaille <akim@epita.fr>
10288 `user_toknums' is output as a `short[]' in `output.c', while it is
10289 defined as a `int[]' in `reader.c'. For consistency with the
10290 other output tables, `user_toknums' is now defined as a table of
10293 * src/reader.c (user_toknums): Be a short table instead of an int
10295 Adjust dependencies.
10297 Factor the short table outputs.
10299 * src/output.c (output_short_table): New function.
10300 * src/output.c (output_gram, output_stos, output_rule_data)
10301 (output_base, output_table, output_check): Use it.
10303 2000-10-02 Akim Demaille <akim@epita.fr>
10305 * src/output.c (output): Topological sort of the functions, in
10306 order to get rid of the `static' prototypes.
10307 No longer use `register'.
10308 * src/output.h: New file.
10309 Propagate its inclusion in files explicitly prototyping functions
10312 2000-09-21 Akim Demaille <akim@epita.fr>
10314 * src/atgeneral.m4: Update from Autoconf.
10316 2000-09-21 Akim Demaille <akim@epita.fr>
10318 * src/closure.h: New file.
10319 * src/closure.c: Formatting changes, topological sort over the
10320 functions, use of closure.h.
10321 (initialize_closure, finalize_closure): Rename as...
10322 (new_closure, free_closure): these. Adjust dependencies.
10323 * src/LR0.c: Formatting changes, topological sort, use of
10325 (initialize_states): Rename as...
10326 (new_states): this.
10327 * src/Makefile.am (noinst_HEADERS): Adjust.
10329 2000-09-20 Akim Demaille <akim@epita.fr>
10331 * src/acconfig.h: Don't protect config.h against multiple
10333 Don't define PARAMS.
10334 * src/system.h: Define PARAMS.
10335 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
10336 purpose of config.h. system.h must not try to fix wrong
10337 definitions in config.h.
10339 2000-09-20 Akim Demaille <akim@epita.fr>
10341 * src/derives.h: New file.
10342 * src/main.c, src/derives.h: Use it.
10343 Formatting changes.
10344 * src/Makefile.am (noinst_HEADERS): Adjust.
10346 2000-09-20 Akim Demaille <akim@epita.fr>
10348 * tests/atgeneral.m4: Update from Autoconf.
10349 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
10350 (AT_CHECK_CALC): New macros.
10351 Use these macros to test bison with options `', `--raw',
10352 `--debug', `--yacc', `--yacc --debug'.
10354 2000-09-19 Akim Demaille <akim@epita.fr>
10356 * src/output.c: Formatting changes.
10357 * src/machine.h: Remove, leaving its contents in...
10358 * src/system.h: here.
10360 Adjust all dependencies on stdio.h and machine.h.
10361 * src/getargs.h: New file.
10362 Let all `extern' declarations about getargs.c be replaced with
10363 inclusion of `getargs.h'.
10364 * src/Makefile.am (noinst_HEADERS): Adjust.
10366 * tests/calc.m4 (yyin): Be initialized in main, not on the global
10368 (yyerror): Returns void, not int.
10369 * doc/bison.texinfo: Formatting changes.
10371 2000-09-19 Akim Demaille <akim@epita.fr>
10373 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
10376 2000-09-18 Akim Demaille <akim@epita.fr>
10378 * configure.in: Append WARNING_CFLAGS to CFLAGS.
10379 * src/Makefile.am (INCLUDES): Don't.
10380 Be ready to fetch headers in lib/.
10382 2000-09-18 Akim Demaille <akim@epita.fr>
10384 * doc/bison.texinfo: Update the copyright.
10385 ANSIfy and GNUify the examples.
10386 Remove the old menu.
10388 2000-09-18 Akim Demaille <akim@epita.fr>
10390 First set of tests: use the `calc' example from the documentation.
10392 * src/bison.s1 (yyparse): Condition the code using `yytname' which
10393 is defined only when YYDEBUG is.
10394 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
10395 * src/files.c (tryopen, tryclose): Formatting changes.
10396 Move to the top and be static.
10397 * src/reader.c (read_signed_integer): Likewise.
10398 * tests/calc.m4: New file.
10399 * Makefile.am, suite.m4: Adjust.
10400 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
10402 2000-09-18 Akim Demaille <akim@epita.fr>
10404 Add support for an Autotest test suite for Bison.
10406 * m4/m4.m4, m4/atconfig.m4: New files.
10407 * m4/Makefile.am (EXTRA_DIST): Adjust.
10408 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
10410 * src/getargs.c: Display a more standard --version message.
10411 * src/reader.c (reader): Formatting changes.
10412 No longer depend upon VERSION_STRING.
10413 * configure.in: No longer use `dnl'.
10414 Set up the test suite and the new directory `tests/.
10415 (VERSION_STRING): Remove.
10417 2000-04-14 Akim Demaille <akim@epita.fr>
10419 * src/reader.c (copy_comment2): New function, same as former
10420 `copy_comment', but outputs into two FILE *.
10421 (copy_comment): Use it.
10422 (parse_union_decl): Use it.
10423 (get_type, parse_start_decl): Use the same `invalid' message.
10424 (parse_start_decl, parse_union_decl): Use the same `multiple'
10426 (parse_union_decl, copy_guard, copy_action): Use the same
10427 `unmatched' message.
10428 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
10430 2000-03-31 Akim Demaille <akim@epita.fr>
10432 * src/files.c (tryopen, tryclose): Move to the top.
10435 2000-03-31 Akim Demaille <akim@epita.fr>
10437 * src/main.c (main): Don't call `done', exit does it.
10439 2000-03-31 Akim Demaille <akim@epita.fr>
10441 * allocate.c: s/return (foo)/return foo/.
10442 * lalr.c: Likewise.
10444 * output.c: Likewise.
10445 * reader.c: Likewise.
10446 * symtab.c: Likewise.
10447 * vmsgetargs.c: Likewise.
10449 2000-03-31 Akim Demaille <akim@epita.fr>
10451 Clean up the error reporting functions.
10453 * src/report.c: New file.
10454 * src/report.h: Likewise.
10455 * src/Makefile.am: Adjust.
10456 * m4/error.m4: New file.
10457 * m4/Makefile.am: Adjust.
10458 * configure.in (jm_PREREQ_ERROR): Call it.
10459 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
10461 (fatal, fatals): Remove. All callers use complain.c::fatal.
10462 (warn, warni, warns, warnss, warnss): Remove. All callers use
10463 complain.c::complain.
10464 (toomany): Remove, use fatal instead.
10465 * src/files.c (done): No argument, use complain_message_count.
10466 * src/main.c (main): Register `done' to `atexit'.
10468 * src/getargs.c (usage): More `fputs', less `fprintf'.
10470 2000-03-28 Akim Demaille <akim@epita.fr>
10472 * lib/: New directory.
10473 * Makefile.am (SUBDIRS): Adjust.
10474 * configure.in: Adjust.
10475 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
10477 * src/alloca.c: Moved to lib/.
10478 * src/getopt.c: Likewise.
10479 * src/getopt1.c: Likewise.
10480 * src/getopt.h: Likewise.
10481 * src/ansi2knr.c: Likewise.
10482 * src/ansi2knr.1: Likewise.
10483 * src/Makefile.am: Adjust.
10484 * lib/Makefile.am: New file.
10486 2000-03-28 Akim Demaille <akim@epita.fr>
10488 * src/getargs.c (usage): Refresh the help message.
10490 2000-03-17 Akim Demaille <akim@epita.fr>
10492 * src/getopt1.c: Updated from textutils 2.0e
10493 * src/getopt.c: Likewise.
10494 * src/getopt.h: Likewise.
10496 2000-03-17 Akim Demaille <akim@epita.fr>
10498 * src/Makefile.am (bison.simple): Fix the awk program: quote only
10499 the file name, not the whole `#line LINE FILE'.
10501 2000-03-17 Akim Demaille <akim@epita.fr>
10503 On syntax errors, report the token on which we choked.
10505 * src/bison.s1 (yyparse): In the label yyerrlab, when
10506 YYERROR_VERBOSE, add yychar in msg.
10508 2000-03-17 Akim Demaille <akim@epita.fr>
10510 * src/reader.c (copy_at): New function.
10511 (copy_guard): Use it.
10512 (copy_action): Use it.
10514 2000-03-17 Akim Demaille <akim@epita.fr>
10516 Be kind to translators, save some useless translations.
10518 * src/main.c (banner): New function.
10519 (fatal_banner): Use it.
10520 (warn_banner): Use it.
10522 2000-03-17 Akim Demaille <akim@epita.fr>
10524 * src/reader.c (copy_definition): Use copy_string and
10525 copy_comment. Removed now unused `match', `ended',
10527 (copy_comment, copy_string): Moved, to be visible from
10530 2000-03-17 Akim Demaille <akim@epita.fr>
10532 * src/reader.c (copy_string): Declare `static inline'. No
10533 problems with inline, since it is checked by configure.
10534 (copy_comment): Likewise.
10536 2000-03-17 Akim Demaille <akim@epita.fr>
10538 * src/reader.c (packsymbols): Formatting changes.
10540 2000-03-17 Akim Demaille <akim@epita.fr>
10542 * src/reader.c (copy_comment): New function, factored out from:
10543 (copy_action): Use it. Removed now unused `match', `ended',
10545 (copy_guard): Likewise.
10547 2000-03-17 Akim Demaille <akim@epita.fr>
10549 * src/reader.c (copy_string): New function, factored out from:
10550 (copy_action): Use it.
10551 (copy_guard): Likewise.
10553 2000-03-17 Akim Demaille <akim@epita.fr>
10555 Change the handling of @s so that they behave exactly like $s.
10556 There is now a pseudo variable @$ (readble and writable), location
10557 of the lhs of the rule (by default ranging from the location of
10558 the first symbol of the rhs, to the location of the last symbol,
10559 or, if the rhs is empty, YYLLOC).
10561 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
10563 (yyparse): When providing a default semantic action, provide a
10564 default location action.
10565 (after the $): No longer change `*YYLSP', just stack YYLOC the
10566 same way you stack YYVAL.
10567 * src/reader.c (read_declarations): Use warns.
10568 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
10569 (copy_action, case '@'): Likewise.
10570 Use a standard error message, to save useless work from
10573 2000-03-17 Akim Demaille <akim@epita.fr>
10575 * src/bison.s1: Formatting and cosmetics changes.
10576 * src/reader.c: Likewise.
10577 Update the Copyright notice.
10579 2000-03-17 Akim Demaille <akim@epita.fr>
10581 * src/bison.s1 (#line): All set to `#line' only, since the
10582 Makefile now handles them.
10584 2000-03-16 Akim Demaille <akim@epita.fr>
10586 * src/output.c (output_rule_data): Output the documentation of
10587 some of the tables.
10588 (Copyright notice): Update.
10589 Formatting changes.
10591 2000-03-16 Akim Demaille <akim@epita.fr>
10593 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
10594 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
10595 One `#if YYDEBUG' remains, since it uses variables which are
10596 defined only if `YYDEBUG != 0'.
10598 2000-03-16 Akim Demaille <akim@epita.fr>
10600 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
10601 and related variables so that the similarities are highlighted.
10603 2000-03-16 Akim Demaille <akim@epita.fr>
10605 * src/bison.s1: Properly indent CPP directives.
10607 2000-03-16 Akim Demaille <akim@epita.fr>
10609 * src/bison.s1: Properly indent the `alloca' CPP section.
10611 2000-03-16 Akim Demaille <akim@epita.fr>
10613 Do not hard code values of directories in `configure.in'.
10614 Update the `configure' tool chain.
10616 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
10618 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
10619 (AC_OUTPUT): Add m4/Makefile.
10620 Bump to bison 1.28a, 1.29 has never been released.
10621 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
10622 handled via src/Makefile.am.
10623 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
10624 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
10626 * Makefile.am (SUBDIRS): Add m4.
10627 (ACLOCAL_AM_FLAGS): New variable.
10628 (AUTOMAKE_OPTIONS): Add check-news.
10629 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
10630 the proper line number and file name.
10631 (DEFS): Propagate the location of bison library files and of the
10633 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
10635 * acinclude.m4: Remove, replaced by the directory m4.
10636 * m4/Makefile.am (EXTRA_DIST): New variable.
10637 * m4/gettext.m4: New file, from the fileutils.
10638 * m4/lcmessage.m4: Likewise
10639 * m4/progtest.m4: Likewise.
10640 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
10642 2000-03-10 Akim Demaille <akim@epita.fr>
10645 Formatting changes of various comments.
10646 Respect the GNU coding standards at various places.
10647 Don't use `_()' when no translation is needed.
10649 1999-12-13 Jesse Thilo <jthilo@gnu.org>
10652 OS/2 honors TMPDIR environment variable.
10654 1999-12-13 Jesse Thilo <jthilo@gnu.org>
10656 * doc/bison.texinfo: Tweaked spelling and grammar.
10658 Removed reference to price of printed copy.
10659 Mention BISON_SIMPLE and BISON_HAIRY.
10661 1999-12-13 Jesse Thilo <jthilo@gnu.org>
10663 * configure.in, NEWS:
10664 Bison 1.29 released.
10666 1999-10-27 Jesse Thilo <jthilo@gnu.org>
10668 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
10669 Added reference card.
10671 1999-07-26 Jesse Thilo <jthilo@gnu.org>
10673 * po/ru.po: Added Russian translation.
10675 1999-07-26 Jesse Thilo <jthilo@gnu.org>
10677 * configure.in: Added Russian translation.
10679 1999-07-06 Jesse Thilo <jthilo@gnu.org>
10681 * configure.in, NEWS, README:
10682 Released version 1.28.
10684 1999-06-14 Jesse Thilo <jthilo@gnu.org>
10687 Squashed redefinition warning on some systems.
10689 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
10690 Have configure build version string instead of relying on ANSI string
10693 1999-06-14 Jesse Thilo <jthilo@gnu.org>
10695 * po/POTFILES.in: Got rid of version.c.
10697 1999-06-14 Jesse Thilo <jthilo@gnu.org>
10699 * acconfig.h, configure.in:
10700 Have configure build version string instead of relying on ANSI string
10703 1999-06-08 Jesse Thilo <jthilo@gnu.org>
10706 Dropped mention of `+' for long-named options.
10708 1999-05-30 Jesse Thilo <jthilo@gnu.org>
10710 * src/files.c: Added <unistd.h> for unlink().
10712 * src/Makefile.am, src/system.h:
10715 1999-05-30 Jesse Thilo <jthilo@gnu.org>
10717 * README: Added a FAQ list.
10719 * configure.in, acconfig.h:
10722 1999-05-30 Jesse Thilo <jthilo@gnu.org>
10724 * doc/FAQ, doc/Makefile.am:
10727 1999-05-19 Jesse Thilo <jthilo@gnu.org>
10729 * src/alloc.h, src/symtab.h, src/version.c:
10730 Protected inclusion of "config.h" with HAVE_CONFIG_H.
10732 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10734 * src/.cvsignore, src/Makefile.am:
10735 Reorganized: sources in `src', documentation in `doc'.
10737 * src/lex.c (literalchar):
10738 fixed the code for escaping double quotes (thanks
10741 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10743 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
10744 Adjusted paths to reflect directory reorganization.
10746 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10748 * doc/.cvsignore, doc/Makefile.am:
10749 Reorganized: sources in `src', documentation in `doc'.
10751 1999-04-18 Jesse Thilo <jthilo@gnu.org>
10754 Updated AC_INIT file to reflect directory reorganization.
10756 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
10757 Reorganized: sources in `src', documentation in `doc'.
10759 1999-04-13 Jesse Thilo <jthilo@gnu.org>
10762 Don't declare calloc() and realloc() if not necessary.
10764 1999-04-13 Jesse Thilo <jthilo@gnu.org>
10766 * configure.in, acconfig.h, acinclude.m4:
10767 Don't declare calloc() and realloc() if not necessary.
10769 1999-03-23 Jesse Thilo <jthilo@gnu.org>
10771 * po/.cvsignore: Added i18n support.
10773 1999-03-23 Jesse Thilo <jthilo@gnu.org>
10775 * acconfig.h, configure.in, Makefile.am:
10776 Added i18n support.
10778 1999-03-22 Jesse Thilo <jthilo@gnu.org>
10780 * src/bison.s1: Fixed #line numbers.
10782 1999-03-15 Jesse Thilo <jthilo@gnu.org>
10784 * po/es.po, po/fr.po, po/nl.po, po/de.po:
10785 Added PO files from Translation Project.
10787 1999-03-03 Jesse Thilo <jthilo@gnu.org>
10790 Added support for non-ANSI compilers (ansi2knr).
10792 1999-02-16 Jesse Thilo <jthilo@gnu.org>
10794 * configure.in: Bumped version number to 1.27.
10797 Added `bison.simple' to list of files removed by `make distclean'.
10799 1999-02-12 Jesse Thilo <jthilo@gnu.org>
10801 * src/files.c, src/files.h:
10802 Defined locations of parser files in config.h instead of Makefile.
10804 1999-02-12 Jesse Thilo <jthilo@gnu.org>
10806 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
10807 Defined locations of parser files in config.h instead of Makefile.
10809 1999-02-09 Jesse Thilo <jthilo@gnu.org>
10812 Removed inappropriate use of $< macro.
10814 1999-02-05 Jesse Thilo <jthilo@gnu.org>
10816 * po/Makefile.in.in, po/POTFILES.in:
10817 Add `po' directory skeleton.
10819 1999-01-27 Jesse Thilo <jthilo@gnu.org>
10821 * README: Document help-bison list.
10823 * configure.in: Add check for mkstemp().
10825 1999-01-20 Jesse Thilo <jthilo@gnu.org>
10827 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
10828 Hush a few compiler warnings.
10831 Add tryclose(), which verifies that fclose was successful.
10832 Hush a couple of compiler warnings.
10834 1999-01-20 Jesse Thilo <jthilo@gnu.org>
10836 * Makefile.am, OChangeLog:
10837 ChangeLog is now automatically generated. Include the old version as
10840 1999-01-14 Jesse Thilo <jthilo@gnu.org>
10842 * 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:
10843 Update FSF address.
10845 1999-01-14 Jesse Thilo <jthilo@gnu.org>
10847 * doc/bison.texinfo: Fix formatting glitch.
10849 * doc/bison.texinfo: Update FSF address.
10851 1999-01-14 Jesse Thilo <jthilo@gnu.org>
10853 * acconfig.h: Update FSF address.
10855 1999-01-08 Jesse Thilo <jthilo@gnu.org>
10858 Don't define PACKAGE here, since config.h defines it.
10860 1998-12-30 Jesse Thilo <jthilo@gnu.org>
10862 * src/reader.c: Update copyright date.
10865 Ditch sprintf to statically-sized buffers in fatal/warn functions in
10866 favor of output directly to stderr (avoids buffer overruns).
10868 * src/reader.c: Some checks for premature EOF.
10870 * 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:
10871 Use prototypes if the compiler understands them.
10873 * src/files.c: Honor TMPDIR on Unix hosts.
10874 Use prototypes if the compiler understands them.
10877 Fix a couple of buffer overrun bugs.
10878 Use prototypes if the compiler understands them.
10880 * src/system.h: Include unistd.h and ctype.h.
10881 Use #ifdef instead of #if for NLS symbols.
10883 1998-12-30 Jesse Thilo <jthilo@gnu.org>
10885 * doc/bison.texinfo:
10886 Delete comment "consider using @set for edition number, etc..." since
10887 we now are doing so.
10889 1998-12-30 Jesse Thilo <jthilo@gnu.org>
10892 Use prototypes if the compiler understands them.
10894 * NEWS: Document 1.26 highlights.
10896 * Makefile.am: Require Automake 1.3 or later.
10899 Use prototypes if the compiler understands them.
10901 1998-12-29 Jesse Thilo <jthilo@gnu.org>
10904 Use VERSION symbol from automake for version number.
10906 1998-12-29 Jesse Thilo <jthilo@gnu.org>
10908 * acconfig.h, configure.in, version.cin:
10909 Use VERSION symbol from automake for version number.
10911 1998-11-28 Jesse Thilo <jthilo@gnu.org>
10914 Distribute original version of simple parser (bison.s1), not built
10915 version (bison.simple).
10917 1998-11-28 Jesse Thilo <jthilo@gnu.org>
10919 * doc/bison.texinfo: Add info dir entry.
10921 * doc/bison.texinfo:
10922 Let automake put version number into documentation.
10924 1998-11-26 Jesse Thilo <jthilo@gnu.org>
10926 * src/bison.cld, src/build.com, src/vmshlp.mar:
10927 Add non-RCS files from /gd/gnu/bison.
10929 1998-11-26 Jesse Thilo <jthilo@gnu.org>
10932 Document the BISON_HAIRY and BISON_SIMPLE variables.
10934 1998-11-25 Jesse Thilo <jthilo@gnu.org>
10936 * src/version.c: Build version.c automatically.
10939 Fix token numbering (used to start at 258, not 257).
10941 * src/system.h: Include config.h.
10943 * src/getargs.c: Update bug report address.
10945 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
10946 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
10948 1998-11-25 Jesse Thilo <jthilo@gnu.org>
10951 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
10953 * configure.in, version.cin:
10954 Build version.c automatically.
10956 * AUTHORS: Add AUTHORS file.
10958 * README: Update bug report address.
10961 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
10963 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
10964 Add automake stuff.
10966 1998-11-25 Jesse Thilo <jthilo@gnu.org>
10968 * doc/bison.texinfo: Clean up some formatting.
10970 1998-05-05 Richard Stallman <rms@gnu.org>
10972 * doc/bison.texinfo:
10973 Explain better why to make a pure parser.
10975 1998-01-05 Richard Stallman <rms@gnu.org>
10977 * src/files.c (openfiles):
10978 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
10979 find a temporary directory, if possible. Do not unlink files while
10982 1997-08-25 Richard Stallman <rms@gnu.org>
10984 * src/reader.c (stack_offset;):
10985 Change some warni to warns.
10987 * src/lex.c (literalchar): Use warns, not warni.
10989 1997-06-28 Richard Stallman <rms@gnu.org>
10991 * src/bison.s1: Add a Bison version comment.
10993 * src/main.c (fatal, warn, berror):
10996 1997-06-28 Richard Stallman <rms@gnu.org>
10998 * Makefile.in (bison_version): New variable.
10999 (dist): Use that variable.
11000 (bison.s1): Substitute the Bison version into bison.simple.
11002 * bison.simple: Add a Bison version comment.
11004 1997-06-18 Richard Stallman <rms@gnu.org>
11006 * src/main.c (fatal, warn, berror):
11007 Make error messages standard.
11008 (toomany): Improve error message text.
11010 * 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:
11011 new.h renamed to alloc.h.
11013 1997-06-18 Richard Stallman <rms@gnu.org>
11015 * Makefile.in: new.h renamed to alloc.h.
11017 1997-05-24 Richard Stallman <rms@gnu.org>
11019 * src/lex.c (literalchar):
11020 Fix the code for escaping \, " and '.
11022 (lex): Avoid trouble when there are many chars
11023 to discard in a char literal with just several chars in it.
11025 1997-05-17 Richard Stallman <rms@gnu.org>
11028 Use malloc, if using alloca is troublesome.
11029 (YYSTACK_USE_ALLOCA): New flag macro.
11030 Define it for some systems and compilers.
11031 (YYSTACK_ALLOC): New macro.
11032 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11033 If it was malloc'd, free it.
11035 1997-05-17 Richard Stallman <rms@gnu.org>
11038 Use malloc, if using alloca is troublesome.
11039 (YYSTACK_USE_ALLOCA): New flag macro.
11040 Define it for some systems and compilers.
11041 (YYSTACK_ALLOC): New macro.
11042 (yyparse): Use YYSTACK_ALLOC to allocate stack.
11043 If it was malloc'd, free it.
11045 1997-04-23 Richard Stallman <rms@gnu.org>
11048 (alloca) [__hpux]: Always define as __builtin_alloca.
11050 1997-04-23 Richard Stallman <rms@gnu.org>
11053 (alloca) [__hpux]: Always define as __builtin_alloca.
11055 1997-04-22 Richard Stallman <rms@gnu.org>
11058 [__hpux]: Include alloca.h (right for HPUX 10)
11059 instead of declaring alloca (right for HPUX 9).
11061 * src/bison.s1 (__yy_memcpy):
11062 Declare arg `count' as unsigned int.
11063 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11065 1997-04-22 Richard Stallman <rms@gnu.org>
11068 [__hpux]: Include alloca.h (right for HPUX 10)
11069 instead of declaring alloca (right for HPUX 9).
11071 * bison.simple (__yy_memcpy):
11072 Declare arg `count' as unsigned int.
11073 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
11075 1997-01-03 Richard Stallman <rms@gnu.org>
11077 * src/allocate.c: [__STDC__ or _MSC_VER]:
11078 Declare calloc and realloc to return void *.
11080 1997-01-02 Richard Stallman <rms@gnu.org>
11083 [_MSC_VER]: Include stdlib.h and process.h.
11084 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
11086 * src/main.c (main): Return FAILURE as a value.
11087 (printable_version): Declare arg as int, not char.
11089 1997-01-02 Richard Stallman <rms@gnu.org>
11091 * Makefile.in (dist):
11092 Explicitly check for symlinks, and copy them.
11094 1996-12-19 Richard Stallman <rms@gnu.org>
11097 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
11099 1996-12-18 Paul Eggert <eggert@gnu.org>
11101 * src/bison.s1 (yyparse):
11102 If __GNUC__ and YYPARSE_PARAM are both defined,
11103 declare yyparse to have a void * argument.
11105 1996-12-18 Paul Eggert <eggert@gnu.org>
11107 * bison.simple (yyparse):
11108 If __GNUC__ and YYPARSE_PARAM are both defined,
11109 declare yyparse to have a void * argument.
11111 1996-12-17 Richard Stallman <rms@gnu.org>
11113 * src/reduce.c (nbits): Add some casts.
11115 1996-08-12 Richard Stallman <rms@gnu.org>
11117 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
11119 1996-08-12 Richard Stallman <rms@gnu.org>
11121 * bison.simple: Test _MSDOS as well as _MSDOS_.
11123 1996-07-31 Richard Stallman <rms@gnu.org>
11126 [__sun && __i386]: Include alloca.h.
11128 1996-07-31 Richard Stallman <rms@gnu.org>
11131 [__sun && __i386]: Include alloca.h.
11133 1996-07-30 Richard Stallman <rms@gnu.org>
11135 * src/bison.s1: Comment change.
11137 * src/bison.s1: Test _MSDOS_, not MSDOS.
11139 1996-07-30 Richard Stallman <rms@gnu.org>
11141 * bison.simple: Comment change.
11143 * bison.simple: Test _MSDOS_, not MSDOS.
11145 1996-06-01 Richard Stallman <rms@gnu.org>
11147 * 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:
11148 Insert `_' macro around many string constants.
11151 Insert `_' macro around many string constants.
11153 (main): Call setlocale, bindtextdomain and textdomain.
11155 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
11156 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
11157 [ENABLE_NLS]: Include libintl.h.
11158 [ENABLE_NLS] (gettext): Define.
11159 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
11160 (N_, PACKAGE, LOCALEDIR): New macros.
11162 1996-06-01 Richard Stallman <rms@gnu.org>
11164 * POTFILES.in: New file.
11166 * Makefile.in (allocate.o):
11167 Define target explicitly.
11169 * Makefile.in (CFLAGS): Set to @CFLAGS@.
11170 (LDFLAGS): Set to @LDFLAGS@.
11171 (configure): Run autoconf only if preceding `cd' succeeds.
11172 (bison.s1): Redirect output to temporary file then move the
11173 temporary to the target, rather than redirecting directly to bison.s1.
11174 (clean): Remove config.status and config.log.
11175 (distclean): Don't remove config.status here.
11177 1996-05-12 Richard Stallman <rms@gnu.org>
11180 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11182 1996-05-12 Richard Stallman <rms@gnu.org>
11185 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
11187 1996-05-11 Richard Stallman <rms@gnu.org>
11189 * src/bison.s1 (__yy_memcpy):
11190 Really reorder the args, as was supposedly done on Feb 14 1995.
11191 (yyparse): Calls changed accordingly.
11193 1996-05-11 Richard Stallman <rms@gnu.org>
11195 * Makefile.in (dist): Don't use $(srcdir).
11197 * bison.simple (__yy_memcpy):
11198 Really reorder the args, as was supposedly done on Feb 14 1995.
11199 (yyparse): Calls changed accordingly.
11201 1996-01-27 Richard Stallman <rms@gnu.org>
11203 * src/output.c (output_rule_data):
11204 Test YYERROR_VERBOSE in the conditional
11205 around the definition of ttyname.
11207 1995-12-29 Richard Stallman <rms@gnu.org>
11210 Fix line numbers in #line commands.
11212 1995-12-29 Richard Stallman <rms@gnu.org>
11215 Fix line numbers in #line commands.
11217 1995-12-27 Richard Stallman <rms@gnu.org>
11219 * src/bison.s1 (YYPARSE_PARAM_DECL):
11220 In C++, make it always null.
11221 (YYPARSE_PARAM_ARG): New macro.
11222 (yyparse): Use YYPARSE_PARAM_ARG.
11224 1995-12-27 Richard Stallman <rms@gnu.org>
11226 * bison.simple (YYPARSE_PARAM_DECL):
11227 In C++, make it always null.
11228 (YYPARSE_PARAM_ARG): New macro.
11229 (yyparse): Use YYPARSE_PARAM_ARG.
11231 1995-11-29 Richard Stallman <rms@gnu.org>
11233 * doc/bison.texinfo:
11234 Describe literal string tokens, %raw, %no_lines, %token_table.
11236 1995-11-29 Daniel Hagerty <hag@gnu.org>
11238 * doc/bison.texinfo: Fixed update date
11240 1995-10-16 Richard Stallman <rms@gnu.org>
11242 * src/version.c: Version 1.25.
11244 1995-10-16 Richard Stallman <rms@gnu.org>
11246 * NEWS: *** empty log message ***
11248 1995-10-16 Richard Stallman <rms@gnu.org>
11250 * doc/bison.1, doc/bison.rnh:
11253 1995-10-15 Richard Stallman <rms@gnu.org>
11255 * src/vmsgetargs.c, src/getargs.c:
11256 Added -n, -k, and -raw switches.
11257 (noparserflag, toknumflag, rawtoknumflag): New variables.
11259 * src/symtab.h (SALIAS):
11260 New #define for adding aliases to %token.
11261 (struct bucket): Added `alias' field.
11263 * src/reduce.c (reduce_grammar):
11264 Revise error message.
11265 (print_notices): Remove final `.' from error message.
11267 * src/reader.c (reader_output_yylsp):
11269 (readgram): Use `#if 0' around code that accepted %command
11270 inside grammar rules: The documentation doesn't allow it,
11271 and it will fail since the %command processors scan for the next %.
11272 (parse_token_decl): Extended the %token
11273 declaration to allow a multi-character symbol as an alias.
11274 (parse_thong_decl): New function.
11275 (read_declarations): Added %thong declarations.
11276 (read_declarations): Handle NOOP to deal with allowing
11277 % declarations as another means to specify the flags.
11278 (readgram): Allow %prec prior to semantics embedded in a rule.
11279 (skip_to_char, read_declarations, copy_definition)
11280 (parse_token_decl, parse_start_decl, parse_type_decl)
11281 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
11282 (get_type_name, copy_guard, copy_action, readgram)
11283 (get_type, packsymbols): Revised most error messages.
11284 Changed `fatal' to `warnxxx' to avoid aborting for error.
11285 Revised and use multiple warnxxx functions to avoid using VARARGS1.
11286 (read_declarations): Improve the error message for
11287 an invalid character. Do not abort.
11288 (read_declarations, copy_guard, copy_action): Use
11289 printable_version to avoid unprintable characters in printed output.
11290 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
11291 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
11292 Allow the type of a non-terminal can be given
11293 more than once, as long as all specifications give the same type.
11296 (output_headers, output_trailers, output, output_gram)
11297 (output_rule_data): Implement noparserflag variable.
11298 Implement toknumflag variable.
11299 (output): Call reader_output_yylsp to output LTYPESTR.
11301 * src/main.c (main):
11302 If reader sees an error, don't process the grammar.
11303 (fatals): Updated to not use VARARGS1.
11304 (printable_version, int_to_string, warn, warni, warns, warnss)
11305 (warnsss): New error reporting functions. Avoid abort for error.
11308 Added THONG and NOOP for alias processing.
11309 Added SETOPT for the new code that allows setting options with %flags.
11312 Include getopt.h. Add some extern decls.
11313 (safegetc): New function to deal with EOF gracefully.
11314 (literalchar); new function to deal with reading \ escapes.
11315 (lex): Use literalchar.
11316 (lex): Implemented "..." tokens.
11317 (literalchar, lex, parse_percent_token): Made tokenbuffer
11318 always contain the token. This includes growing the token
11319 buffer while reading an integer.
11320 (parse_percent_token): Replaced if-else statement with percent_table.
11321 (parse_percent_token): Added % declarations as another
11322 way to specify the flags -n, -l, and -r. Also added hooks for
11323 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
11324 major changes to files.c.
11325 (lex) Retain in the incoming stream a character following
11327 (skip_white_space, lex): Revised most error messages
11328 and changed fatal to warn to avoid aborting.
11329 (percent_table): Added %thong declarations.
11331 * src/gram.h: Comment changes.
11333 * src/files.c (openfiles, open_extra_files, done):
11335 and actfile file. Handle noparserflag. Both for -n switch.
11337 * src/conflicts.c (resolve_sr_conflict):
11338 Remove use of alloca.
11340 1995-06-01 Jim Meyering <meyering@gnu.org>
11342 * doc/bison.texinfo: *** empty log message ***
11344 1995-05-06 Richard Stallman <rms@gnu.org>
11346 * src/bison.s1: Comment change.
11348 1995-05-06 Richard Stallman <rms@gnu.org>
11350 * bison.simple: Comment change.
11352 1995-05-03 Richard Stallman <rms@gnu.org>
11354 * src/version.c: Version now 1.24.
11356 * src/bison.s1: Change distribution terms.
11358 * src/version.c: Version now 1.23.
11360 1995-05-03 Richard Stallman <rms@gnu.org>
11362 * doc/bison.texinfo:
11363 Rewrite "Conditions for Using Bison".
11364 Update version to 1.24.
11366 1995-05-03 Richard Stallman <rms@gnu.org>
11368 * bison.simple: Change distribution terms.
11370 1995-02-23 Richard Stallman <rms@gnu.org>
11372 * src/files.c: Test __VMS_POSIX as well as VMS.
11374 1995-02-14 Jim Meyering <meyering@gnu.org>
11376 * src/bison.s1 (__yy_memcpy):
11377 Renamed from __yy_bcopy to avoid
11378 confusion. Reverse FROM and TO arguments to be consistent with
11381 1995-02-14 Jim Meyering <meyering@gnu.org>
11383 * bison.simple (__yy_memcpy):
11384 Renamed from __yy_bcopy to avoid
11385 confusion. Reverse FROM and TO arguments to be consistent with
11388 1994-11-10 David J. MacKenzie <djm@gnu.org>
11394 * Makefile.in (DISTFILES): Include NEWS.
11396 * Makefile.in (DISTFILES):
11397 Include install-sh, not install.sh.
11399 * configure.in: Update to Autoconf v2 macro names.
11401 1994-10-05 David J. MacKenzie <djm@gnu.org>
11403 * Makefile.in: fix typo
11405 * Makefile.in (prefix, exec_prefix):
11406 Let configure set them.
11408 1994-09-28 David J. MacKenzie <djm@gnu.org>
11410 * Makefile.in: Set datadir to $(prefix)/share.
11412 1994-09-15 Richard Stallman <rms@gnu.org>
11415 Update copyright notice and GPL version.
11417 1994-09-15 Richard Stallman <rms@gnu.org>
11420 Update copyright notice and GPL version.
11422 1994-07-12 Richard Stallman <rms@gnu.org>
11424 * src/reduce.c, src/reader.c:
11427 1994-05-05 David J. MacKenzie <djm@gnu.org>
11429 * Makefile.in: entered into RCS
11431 1994-03-26 Richard Stallman <rms@gnu.org>
11433 * src/bison.s1: entered into RCS
11435 1994-03-26 Richard Stallman <rms@gnu.org>
11437 * bison.simple: entered into RCS
11439 1994-03-25 Richard Stallman <rms@gnu.org>
11441 * src/main.c: entered into RCS
11443 1994-03-24 Richard Stallman <rms@gnu.org>
11445 * src/conflicts.c: entered into RCS
11447 1994-01-02 Richard Stallman <rms@gnu.org>
11449 * Makefile.in: *** empty log message ***
11451 1993-11-21 Richard Stallman <rms@gnu.org>
11453 * src/bison.s1: *** empty log message ***
11455 1993-11-21 Richard Stallman <rms@gnu.org>
11457 * doc/bison.texinfo: entered into RCS
11459 * doc/bison.texinfo: *** empty log message ***
11461 1993-11-21 Richard Stallman <rms@gnu.org>
11463 * bison.simple: *** empty log message ***
11465 1993-10-25 David J. MacKenzie <djm@gnu.org>
11467 * doc/bison.texinfo: *** empty log message ***
11469 1993-10-19 Richard Stallman <rms@gnu.org>
11471 * src/bison.s1: *** empty log message ***
11473 1993-10-19 Richard Stallman <rms@gnu.org>
11475 * bison.simple: *** empty log message ***
11477 1993-10-14 Richard Stallman <rms@gnu.org>
11479 * src/bison.s1: *** empty log message ***
11481 1993-10-14 Richard Stallman <rms@gnu.org>
11483 * bison.simple: *** empty log message ***
11485 1993-09-14 David J. MacKenzie <djm@gnu.org>
11487 * doc/bison.texinfo: *** empty log message ***
11489 1993-09-13 Noah Friedman <friedman@gnu.org>
11491 * Makefile.in: *** empty log message ***
11493 1993-09-10 Richard Stallman <rms@gnu.org>
11495 * src/conflicts.c: *** empty log message ***
11497 * src/system.h: entered into RCS
11499 1993-09-10 Richard Stallman <rms@gnu.org>
11501 * doc/bison.1: entered into RCS
11503 1993-09-06 Noah Friedman <friedman@gnu.org>
11505 * src/version.c: entered into RCS
11507 1993-09-06 Noah Friedman <friedman@gnu.org>
11509 * Makefile.in: *** empty log message ***
11511 1993-07-30 David J. MacKenzie <djm@gnu.org>
11513 * Makefile.in: *** empty log message ***
11515 1993-07-24 Richard Stallman <rms@gnu.org>
11517 * src/bison.s1: *** empty log message ***
11519 1993-07-24 Richard Stallman <rms@gnu.org>
11521 * bison.simple: *** empty log message ***
11523 1993-07-08 David J. MacKenzie <djm@gnu.org>
11525 * Makefile.in: *** empty log message ***
11527 1993-07-04 Richard Stallman <rms@gnu.org>
11529 * src/bison.s1: *** empty log message ***
11531 1993-07-04 Richard Stallman <rms@gnu.org>
11533 * bison.simple: *** empty log message ***
11535 1993-06-26 David J. MacKenzie <djm@gnu.org>
11537 * src/getargs.c: entered into RCS
11539 1993-06-26 David J. MacKenzie <djm@gnu.org>
11541 * doc/bison.texinfo: *** empty log message ***
11543 * doc/bison.1: New file.
11545 1993-06-25 Richard Stallman <rms@gnu.org>
11547 * src/getargs.c: New file.
11549 1993-06-16 Richard Stallman <rms@gnu.org>
11551 * src/bison.s1: *** empty log message ***
11553 1993-06-16 Richard Stallman <rms@gnu.org>
11555 * bison.simple: *** empty log message ***
11557 1993-06-03 Richard Stallman <rms@gnu.org>
11559 * src/bison.s1: New file.
11561 1993-06-03 Richard Stallman <rms@gnu.org>
11563 * doc/bison.texinfo: *** empty log message ***
11565 1993-06-03 Richard Stallman <rms@gnu.org>
11567 * bison.simple: New file.
11569 1993-05-19 Richard Stallman <rms@gnu.org>
11571 * doc/bison.texinfo: New file.
11573 1993-05-07 Noah Friedman <friedman@gnu.org>
11575 * Makefile.in: *** empty log message ***
11577 1993-04-28 Noah Friedman <friedman@gnu.org>
11579 * src/reader.c: *** empty log message ***
11581 1993-04-23 Noah Friedman <friedman@gnu.org>
11583 * src/alloc.h: entered into RCS
11585 1993-04-20 David J. MacKenzie <djm@gnu.org>
11587 * src/version.c: *** empty log message ***
11589 * src/files.c, src/allocate.c:
11592 * src/reader.c: *** empty log message ***
11594 * src/lex.c: entered into RCS
11596 * src/conflicts.c: New file.
11598 * src/symtab.c: entered into RCS
11600 * src/alloc.h: New file.
11602 * src/LR0.c: entered into RCS
11604 1993-04-18 Noah Friedman <friedman@gnu.org>
11606 * src/reader.c: New file.
11608 * src/version.c: *** empty log message ***
11610 1993-04-18 Noah Friedman <friedman@gnu.org>
11612 * Makefile.in: *** empty log message ***
11614 1993-04-17 Noah Friedman <friedman@gnu.org>
11616 * Makefile.in: *** empty log message ***
11618 1993-04-15 Richard Stallman <rms@gnu.org>
11620 * src/main.c, src/files.c:
11623 1993-04-15 Noah Friedman <friedman@gnu.org>
11625 * configure.in: entered into RCS
11627 * configure.in: *** empty log message ***
11629 * configure.in: New file.
11631 1993-04-14 Richard Stallman <rms@gnu.org>
11633 * Makefile.in: New file.
11635 1993-04-13 Richard Stallman <rms@gnu.org>
11637 * src/version.c: New file.
11639 1993-03-25 Richard Stallman <rms@gnu.org>
11641 * src/output.c: entered into RCS
11643 1992-09-25 Richard Stallman <rms@gnu.org>
11645 * configure.bat: entered into RCS
11647 1992-06-22 Richard Stallman <rms@gnu.org>
11649 * src/vmsgetargs.c: entered into RCS
11651 1992-06-22 Richard Stallman <rms@gnu.org>
11653 * doc/bison.rnh: entered into RCS
11655 1992-04-20 David J. MacKenzie <djm@gnu.org>
11657 * README: entered into RCS
11659 1992-01-22 Richard Stallman <rms@gnu.org>
11661 * src/machine.h: entered into RCS
11663 1991-12-21 Richard Stallman <rms@gnu.org>
11665 * src/lalr.c, src/closure.c:
11668 1991-12-20 Richard Stallman <rms@gnu.org>
11670 * src/state.h: entered into RCS
11672 1991-12-18 Richard Stallman <rms@gnu.org>
11674 * src/print.c, src/nullable.c, src/derives.c:
11677 1991-11-03 David J. MacKenzie <djm@gnu.org>
11679 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
11682 1988-09-09 Richard Stallman <rms@gnu.org>
11684 * src/bison.hairy: entered into RCS
11686 1987-12-16 Richard Stallman <rms@gnu.org>
11688 * REFERENCES: entered into RCS
11692 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
11693 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
11695 This file is part of Bison, the GNU Compiler Compiler.
11697 Bison is free software; you can redistribute it and/or modify
11698 it under the terms of the GNU General Public License as published by
11699 the Free Software Foundation; either version 2, or (at your option)
11702 Bison is distributed in the hope that it will be useful,
11703 but WITHOUT ANY WARRANTY; without even the implied warranty of
11704 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11705 GNU General Public License for more details.
11707 You should have received a copy of the GNU General Public License
11708 along with Bison; see the file COPYING. If not, write to
11709 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
11710 Boston, MA 02111-1307, USA.