1 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
3 More portability fixes for problems summarized by Nelson H. F. Beebe.
5 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
6 than #include "...", and compile with -I'.'. The old method was
7 not portable, according to Posix and the C standard, and it does
8 not work with Sun C 5.7, where previous #line directives affect
9 the working directory used in later #include "..." directives.
11 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
13 Various DJGGP specific issues in /djgpp
15 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
17 More portability fixes for problems summarized by Nelson H. F. Beebe.
19 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
20 '#include <map>' works and that you can apply ++ to iterators.
22 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
24 Work around portability problems summarized by Nelson H. F. Beebe in
25 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
27 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
28 that '#include <string>' works.
30 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
31 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
32 "warning: sorry: semantics of inline function static data `const
33 unsigned char translate_table[262]' are wrong (you'll wind up with
36 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
37 or, xor to not_, and_, or_, and xor_, respectively. This works
38 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
39 random system header somewhere that includes the equivalent of
42 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
43 -E" works; it apparently doesn't work with PathScale EKO Compiler
46 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
48 During deterministic GLR operation, user actions should be able to
49 influence the parse by changing yychar. To make this easier to fix and
50 to make glr.c easier to evolve in general, don't maintain yytoken in
51 parallel with yychar; just compute yytoken when needed.
52 * tests/glr-regression.at (Incorrect lookahead during deterministic
53 GLR): Check that setting yychar in a user action has the intended
55 * data/glr.c (yyGLRStack): Remove yytokenp member.
56 (yyclearin): Don't set *yytokenp.
57 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
58 yychar rather than *yytokenp to determine the current lookahead.
59 Compute yytoken locally when needed.
60 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
63 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
64 after `--report' documentation.
66 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
68 * src/parse-gram.y (grammar_declaration): Location of printer
69 symbol is @1, not list->location. Bug reported by twlevo.
70 * tests/input.at (Incompatible Aliases): Adjust to above change.
72 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
74 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
75 all the test at once. This makes the output easier to read in the
78 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
79 got from <http://bro-ids.org/download.html>. The bug is that
80 when two actions appeared in succession, the second one was
81 scanned before the first one was added to the grammar rule
82 as a midrule action. Bison then output the incorrect warning
83 "parse.y:905.17-906.36: warning: unused value: $3".
84 * src/parse-gram.y (BRACED_CODE, action): These are no longer
85 associated with a value.
86 (rhs): Don't invoke grammar_current_rule_action_append.
87 (action): Invoke it here instead.
88 * src/reader.c (grammar_midrule_action): Now extern.
89 (grammar_current_rule_action_append): Don't invoke
90 grammar_midrule_action; that is now the scanner's job.
91 * src/reader.h (last_string, last_braced_code_loc):
92 (grammar_midrule_action): New decls.
93 * src/scan-gram.l (last_string): Now extern, sigh.
94 (last_braced_code_loc): New extern variable.
95 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
96 rule already has an action.
97 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
98 * tests/input.at (AT_CHECK_UNUSED_VALUES):
99 Add some tests to check that the above changes fixed the bug.
101 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
103 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
104 All used changed. Check whether the symbol has a destructor,
105 not whether it is typed.
106 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
107 that the values are still reported as unused. All line numbers
110 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
112 Work around a bug in bro 0.8, which underparenthesizes its
113 definition of YYLLOC_DEFAULT.
114 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
116 * data/lalr1.cc: Likewise.
117 * data/yacc.cc: Likewise.
119 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
121 Work around a bug in Pike 7.0, and give the Pike folks a
122 better way to override the usual int widths.
123 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
124 user can override the types.
125 (short): #undef, to work around a bug in Pike 7.0.
126 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
127 (union yyalloc.yyss): Use yytype_int16 rather than short.
129 (yysigned_char): Remove.
130 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
131 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
132 * tests/regression.at (Web2c Actions): Adjust to above changes.
134 * src/reader.c (check_and_convert_grammar): New function.
135 (reader): Close the input file even if something went wrong during
136 parsing. Minor file descriptor leak reported by twlevo.
138 * src/assoc.c (assoc_to_string): Use a default: abort (); case
139 to pacify gcc -Wswitch-default.
140 * src/scan-gram.l (adjust_location): Use a default: break; case
141 to pacify gcc -Wswitch-default.
142 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
143 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
144 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
145 Move these decls to scan-skel.l, since they don't need to be
147 * src/scan-skel.l: Accept the above decls.
148 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
151 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
153 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
154 since we don't want to insist on a version number at the start
155 of the changelog every time.
156 * Makefile.maint: Sync from coreutils a bit better.
157 (sc_trailing_blank): Renamed from sc_trailing_space.
159 (sc_no_if_have_config_h, sc_require_config_h):
160 (sc_prohibit_assert_without_use): New rules.
161 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
162 (sc_dd_max_sym_length): Fix leading spaces in rule.
163 (sc_system_h_headers): Prefix with @.
164 (sc_useless_cpp_parens, m4-check): Output line numbers.
165 (changelog-check): Allow version only in head.
166 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
167 satisfy new Makefile.maint rule.
168 * data/glr.c: Likewise.
169 * data/glr.cc: Likewise.
170 * data/lalr1.cc: Likewise.
171 * data/yacc.c: Likewise.
172 * lib/ebitsetv.c: Likewise.
173 * lib/lbitset.c: Likewise.
174 * lib/subpipe.c: Likewise.
175 * lib/timevar.c: Likewise.
176 * src/system.h: Likewise.
177 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
178 * djgpp/Makefile.maint: Add copyright notice.
179 * djgpp/README.in: Likewise.
180 * djgpp/config.bat: Likewise.
181 * djgpp/config.site: Likewise.
182 * djgpp/config_h.sed: Likewise.
183 * djgpp/djunpack.bat: Likewise.
184 * djgpp/config.sed: Fix copyright notice to match standard format.
185 * djgpp/subpipe.h: Likewise.
186 * lib/bitsetv-print.c: Likewise.
187 * lib/bitsetv.c: Likewise.
188 * lib/subpipe.h: Likewise.
189 * lib/timevar.c: Likewise.
190 * lib/timevar.h: Likewise.
191 * djgpp/subpipe.c: Use standard recipe for config.h.
192 * lib/abitset.c: Likewise.
193 * lib/bitset.c: Likewise.
194 * lib/bitset_stats.c: Likewise.
195 * lib/bitsetv-print.c: Likewise.
196 * lib/bitsetv.c: Likewise.
197 * lib/ebitsetv.c: Likewise.
198 * lib/get-errno.c: Likewise.
199 * lib/lbitset.c: Likewise.
200 * lib/subpipe.c: Likewise.
201 * lib/timevar.c: Likewise.
202 * lib/vbitset.c: Likewise.
203 * tests/local.at: Likewise.
204 * src/scan-gram.l: Don't include verify.h, since system.h does
206 * .x-sc_require_config_h: New file.
207 * .x-sc_unmarked_diagnostics: New file.
209 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
211 Be a bit more systematic about using 'abort'.
212 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
213 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
214 Put 'default: abort ();' before some other case, to satisfy older
216 * lib/bitset_stats.c (bitset_stats_init): Likewise.
217 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
218 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
219 * src/conflicts.c (resolve_sr_conflict): Likewise.
220 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
221 (get_decision_str, get_orientation_str, get_node_alignment_str):
222 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
223 (get_linestyle_str, get_arrowstyle_str): Likewise.
224 * src/conflicts.c (resolve_sr_conflict):
225 Use a default case rather than one for the one remaining enum
226 value, to catch invalid enum values as well.
227 * src/lalr.c (set_goto_map, map_goto):
228 Prefer "assert (FOO);" to "if (!FOO) abort ();".
229 * src/nullable.c (nullable_compute, token_definitions_output):
231 * src/reader.c (packgram, reader): Likewise.
232 * src/state.c (transitions_to, state_new, state_reduction_find):
234 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
235 (symbol_pack): Likewise.
236 * src/tables.c (conflict_row, pack_vector): Likewise.
237 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
238 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
239 * src/system.h: Don't include <assert.h>.
242 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
243 (Destructor Decl, Parser Function, Pure Calling):
244 Describe rules for braces inside C code more carefully.
246 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
248 Fix some porting glitches found by Nelson H. F. Beebe.
249 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
250 compilers that don't understand that abort () does not return.
251 * src/state.c (transitions_to): Likewise.
252 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
253 that '#include <cstdlib>' works.
254 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
255 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
256 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
257 for the benefit of some pre-C99 compilers.
259 * bootstrap: Undo changes to gnulib files that autoreconf made.
261 Minor fixups to get 'make maintainer-check' to work.
262 * configure.ac: Don't use -Wnested-externs, as it's incompatible
263 with the new verify.h implementation.
264 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
265 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
266 * data/yacc.c (YYUSE): Likewise.
267 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
268 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
269 * src/parse-gram.y (declaration): Don't pass a string constant
270 to a function that expects char *, since GCC might complain
271 about the constant value.
272 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
273 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
274 before #defining them.
275 * tests/glr-regression.at
276 (Incorrectly initialized location for empty right-hand side in GLR):
277 In yyerror, use the msg arg.
278 (Corrupted semantic options if user action cuts parse):
279 (Incorrect lookahead during deterministic GLR):
280 (Incorrect lookahead during nondeterministic GLR):
281 Don't name a local var 'index'; it shadows string.h's 'index'.
283 2006-01-19 Akim Demaille <akim@epita.fr>
285 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
286 location, not just parts of it.
288 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
290 * NEWS: Document the fact that multiple %unions are now allowed.
291 * doc/bison.texinfo (Union Decl): Likewise.
292 * TODO: This feature is now implemented, so remove it from
295 * Makefile.maint: Merge with coreutils Makefile.maint.
296 (CVS_LIST): Use build-aux version if available.
297 (VERSION_REGEXP): New macro.
298 (syntax-check-rules): Add sc_no_if_have_config_h,
299 sc_prohibit_assert_without_use, sc_require_config_h,
300 sc_useless_cpp_parens.
301 (sc_obsolete_symbols): Check for O_NDELAY.
302 (sc_dd_max_sym_length): Track coreutils.
303 (sc_unmarked_diagnostics): Look in all files, not just *.c.
304 (sc_useless_cpp_parens): New rule.
305 (news-date-check): Look for version or today's date.
306 (changelog-check): Don't require version number near head.
307 (copyright-check): Use current year instead of hardwiring 2005.
308 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
309 (announcement): Add --gpg-key-ID.
311 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
314 Avoid undefined behavior that addressed just before the start of an
315 array. Problem reported by twlevo.
316 * src/reader.c (packgram): Prepend a new sentinel before ritem.
317 * src/lalr.c (build_relations): Rely on new sentinel.
318 * src/gram.c (gram_free): Adjust to new sentinel.
320 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
322 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
323 yylookaheadNeeds. All uses updated.
324 (yysplitStack): Rename local yynewLookaheadStatuses to
326 * data/glr-regression.at (Incorrect lookahead during nondeterministic
327 GLR): In comments, change `lookahead status' to `lookahead need'.
329 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
331 * data/glr.c (yysplitStack): A little stylistic rewrite.
333 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
335 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
337 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
339 * doc/bison.texinfo: Fix some typos.
340 (GLR Semantic Actions): New subsection discussing special
341 considerations because GLR semantic actions might be deferred.
342 (Actions): Mention look-ahead usage of yylval.
343 (Actions and Locations): Mention look-ahead usage of yylloc.
344 (Special Features for Use in Actions): Add YYEOF entry and mention it
346 In the yychar entry, remove mention of the local yychar case (pure
347 parser) since this is irrelevant information when writing semantic
348 actions and since it's already discussed in `Bison Symbols' where
349 yychar is otherwise described as an external variable.
350 In the yychar entry, don't call it the `current' look-ahead since it
351 isn't when semantic actions are deferred.
352 In the yychar and yyclearin entries, add note about deferred semantic
354 Add yylloc and yylval entries discussing look-ahead usage.
355 (Look-Ahead Tokens): When discussing yychar, don't call it the
356 `current' look-ahead, and do mention yylval and yylloc.
357 (Error Recovery): Cross-reference `Action Features' when mentioning
359 (Bison Symbols): In the yychar entry, don't call it the `current'
361 In the yylloc and yylval entries, mention look-ahead usage.
363 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
365 * tests/glr-regression.at: Update copyright year to 2006.
367 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
369 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
370 use during nondeterministic operation to track which stacks have
371 actually needed the current lookahead.
372 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
373 Allocate, deallocate, resize, and otherwise shuffle space for
374 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
375 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
376 appropriately during nondeterministic operation.
377 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
378 members to store the current lookahead to be used by the deferred
380 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
381 from which the RHS is taken. Set the lookahead members of the new
382 yySemanticOption according to the lookahead status for stack yyk.
383 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
385 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
386 members of yySemanticOption before invoking yyuserAction, and then set
387 them back to their current values afterward.
388 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
389 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
390 * tests/glr-regression.at: Remove `.' from the ends of recent test case
391 titles for consistency.
392 (Leaked merged semantic value if user action cuts parse): In order to
393 suppress lint warnings, use arguments in merge function, and assign
394 char value < 128 in main.
395 (Incorrect lookahead during deterministic GLR): New test case.
396 (Incorrect lookahead during nondeterministic GLR): New test case.
398 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
400 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
401 !yyvaluep as signal that no semantic value is available to print.
402 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
403 to print a semantic value.
405 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
407 * tests/glr-regression.at: For consistency with my newer test cases,
410 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
412 * data/glr.c (yyresolveValue): When merging semantic options, if at
413 least one user action succeeds but a later one cuts the parse, then
414 destroy the semantic value before returning rather than leaking it.
415 (yyresolveStates): If a user action cuts the parse and thus
416 yyresolveValue fails, ignore the (unset) semantic value rather than
417 corrupting the yyGLRState, and empty the semantic options list since
418 the user actions should have called all necessary destructors.
419 Simplify code with YYCHK.
420 * tests/glr-regression.at (Corrupted semantic options if user action
421 cuts parse): New test case.
422 (Undesirable destructors if user action cuts parse): New test case.
423 Before applying any of this patch, this test case never actually failed
424 for me... but only because the corrupted semantic options usually
426 (Leaked merged semantic value if user action cuts parse): New test
429 2006-01-05 Akim Demaille <akim@epita.fr>
431 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
433 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
435 * data/c.m4 (b4_c_modern): New macro, with a new provision for
436 _MSC_VER. Problem reported by Cenzato Marco.
437 (b4_c_function_def): Use it.
438 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
440 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
441 than rolling our own.
443 2006-01-04 Akim Demaille <akim@epita.fr>
445 Also warn about non-used mid-rule values.
446 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
448 (symbol_list_new): Adjust.
449 * src/reader.c (symbol_typed_p): New.
450 (grammar_rule_check): Use it.
451 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
453 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
455 * tests/actions.at (Exotic Dollars): Adjust.
457 2006-01-04 Akim Demaille <akim@epita.fr>
459 * src/reader.c (grammar_midrule_action): If $$ is set in a
460 mid-rule, move the `used' bit to its lhs.
461 * tests/input.at (Unused values): New.
462 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
464 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
466 * doc/bison.texinfo (Bison Options): Say more accurately what
468 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
469 about declarations in the grammar when in Yacc mode, as POSIX does
470 not require a diagnostic when the grammar uses extensions.
472 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
474 Warn about dubious constructions like "%token T T".
476 * src/symtab.h (struct symbol.declared): New member.
477 * src/symtab.c (symbol_new): Initialize it to false.
478 (symbol_class_set): New arg DECLARING, specifying whether
479 this is a declaration that we want to warn about, if there
480 is more than one of them. All uses changed.
482 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
483 Allow multiple %union directives, whose contents concatenate.
484 * src/parse-gram.y (grammar_declaration): Likewise.
485 Use muscle_code_grow, so that we don't need stype_line any more.
488 * src/muscle_tab.c (muscle_grow): Fix comment.
490 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
491 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
492 Update copyright year to 2006.
494 2006-01-03 Akim Demaille <akim@epita.fr>
496 Have glr.cc pass (some of) the calc.at tests.
497 * data/glr.cc (b4_parse_param_orig): New.
498 (b4_parse_param): Improve its definition, and bound it more
499 clearly in the skeleton.
500 (b4_epilogue): Append, instead of prepending, in order to keep
502 Simplify the generation of auxiliary functions: locations and
504 (b4_global_tokens_and_yystype): Honor it.
505 * data/location.cc (c++.m4): Don't include it.
506 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
508 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
510 Be sure to initialize the first position's filename.
511 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
513 (AT_CHECK_CALC_GLR_CC): New.
514 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
516 2006-01-02 Akim Demaille <akim@epita.fr>
518 * src/output.c (output_skeleton): Don't hard wire the inclusion of
520 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
521 * data/glr.cc: Do not include stack.hh.
523 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
525 * data/glr.c: Reformat whitespace with tabs.
526 (b4_lpure_formals): Remove this unused m4 macro.
527 * tests/cxx-type.at: Reformat whitespace with tabs.
528 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
529 since it's a member. Rename type to isNterm for clarity.
531 2005-12-29 Akim <akim@sulaco.local>
533 Let glr.cc catch up with symbol_value_print.
534 * data/glr.cc (b4_yysymprint_generate): Replace by...
535 (b4_yy_symbol_print_generate): this.
536 (yy_symbol_print, yy_symbol_value_print): Declare them.
538 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
540 * src/location.h (boundary): Note that a line or column equal
541 to INT_MAX indicates an overflow.
542 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
543 (rule_length_overflow, increment_rule_length, add_column_width):
545 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
546 (<SC_BRACED_CODE>"}"):
547 Use increment_rule_length rather than incrementing it by hand.
548 (adjust_location, handle_syncline): Diagnose overflow.
549 (handle_action_dollar, handle_action_at):
550 Fix bug with monstrosities like $-2147483648.
551 Remove now-unnecessary checks.
552 (scan_integer): Verify assumptions and remove now-unnecessary checks.
553 (convert_ucn_to_byte): Verify assumptions.
554 (handle_syncline): New arg LOC. All callers changed.
555 Don't store through a value derived from char const * pointer.
557 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
560 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
562 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
563 Remove unnecessary forward static decls.
565 2005-12-27 Akim Demaille <akim@epita.fr>
567 * src/reader.c (grammar_current_rule_check): Also check that $$
569 Take the rule to check as argument, hence rename as...
570 (grammar_rule_check): this.
571 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
573 (grammar_rule_begin, grammar_rule_end): these, for consistency.
574 (grammar_midrule_action, grammar_symbol_append): Now static.
575 * tests/torture.at (input): Don't rely on the default action
576 being always performed.
577 * tests/calc.at: "Set" $$ even when the action is "cut" with
579 * tests/actions.at (Exotic Dollars): Instead of using unused
580 values, check that the warning is issued.
582 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
584 * NEWS: Improve wording for unused-value warnings.
586 2005-12-22 Akim Demaille <akim@epita.fr>
588 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
589 (b4_yysymprint_generate): Rename as...
590 (b4_yy_symbol_print_generate): this.
591 Generate yy_symbol_print instead of yysymprint.
592 Generate also yy_symbol_value_print, and use it.
594 2005-12-22 Akim Demaille <akim@epita.fr>
596 * NEWS: Warn about unused values.
597 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
599 (symbol_list_n_get, symbol_list_n_used_set): New.
600 (symbol_list_n_type_name_get): Use symbol_list_n_get.
601 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
602 * src/reader.c (grammar_current_rule_check): Check that values are
604 * src/symtab.c (symbol_print): Accept 0.
605 * tests/existing.at: Remove the type information.
607 Remove useless actions (beware of mid-rule actions: perl -000
608 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
609 * tests/actions.at (Exotic Dollars): Use unused values.
610 * tests/calc.at: Likewise.
611 * tests/glr-regression.at (No users destructors if stack 0 deleted):
614 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
617 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
619 Undo 2005-12-01 tentative license wording change. The wording is
620 still being reviewed by the lawyers, and we don't want to wait for
621 them before publishing a test release. For now, revert to the
623 * NEWS: Undo 2005-12-01 change.
624 * data/glr.c: Revert to previous license wording.
625 * data/glr.cc: Likewise.
626 * data/lalr1.cc: Likewise.
627 * data/location.cc: Likewise.
628 * data/yacc.c: Likewise.
630 * NEWS: Reword %destructor vs YYABORT etc.
631 * data/glr.c: Use American spacing, for consistency.
632 * data/glr.cc: Likewise.
633 * data/lalr1.cc: Likewise.
634 * data/yacc.c: Likewise.
635 * data/yacc.c: Reformat comments slightly.
636 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
637 for consistency. Fix some spelling errors and reword recently-included
639 * tests/cxx-type.at: Cast results of malloc, for C++.
641 2005-12-21 Joel E. Denny <address@hidden>
643 * tests/cxx-type.at: Construct a tree, count the parents of shared
644 nodes, and free each node once and only once. Previously, the memory
645 for semantic values was leaked instead.
647 2005-12-21 Joel E. Denny <address@hidden>
649 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
650 (yylval, yylloc): If pure, #define to yystackp->yyval and
651 yystackp->yyloc similar to yychar and yynerrs.
652 (yyparse): If pure, remove local yylval and yylloc. Add local
653 yystackp to accommodate pure definitions of yylval and yylloc.
654 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
655 yylvalp and yyllocp to &yylval and &yylloc.
656 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
657 namespace. Previously, nerrs and char were missing, but lval and lloc
659 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
660 yylvalp and yyllocp parameters since, if pure, these are now always
661 accessible through yystackp. If not pure, they are still accessible
663 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
664 `if (YYID (N))' to pacify lint.
666 2005-12-21 Akim Demaille <akim@epita.fr>
668 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
669 destroy the RHS symbols of a rule.
670 * data/yacc.c (yylen): Initialize to 0.
671 Keep its value to the number of items to possibly shift.
672 In particular, a regular successful parse that ends on YYFINAL by
673 a (internal) YYACCEPT must not have yylen != 0.
674 (yyerrorlab, yyreturn): Pop the RHS.
675 Reorder a bit to emphasize the `shifting' bits of code.
676 (YYPOPSTACK): Now accept a number of items to pop.
677 * data/lalr1.cc: Likewise.
678 * data/glr.c: Formatting changes.
679 Use goto instead of fall through.
680 * doc/bison.texinfo (Destructor Decl): Complete.
682 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
684 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
685 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
686 * djgpp/config.bat: Replace every occurence of the file name
687 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
688 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
689 * djgpp/config.sed: Replace every occurence of the file name
690 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
691 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
692 * djgpp/djunpack.bat: DJGPP specific file.
693 * djgpp/fnchange.lst: DJGPP specific file.
694 * djgpp/README.in: Add new information about how to unpack the bison
695 source on MSDOS and other systems which have 8.3 file name restrictions
696 using djunpack.bat and fnchange.lst.
698 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
700 * bootstrap (build_cvs_prefix): Remove; unused.
701 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
704 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
706 * data/glr.c: Reorder typedef declarations for structs to match order
707 of struct declarations.
708 Rename yystack everywhere to yystackp except in yyparse where it's not
710 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
712 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
713 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
714 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
717 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
719 * tests/sets.at (Accept): Fix typos in regular expression used to
720 sed out the final state number.
722 Work around portability problem on Solaris 10: flex-generated
723 files include <stdio.h> before <config.h>, which messes up
724 because the latter defines __EXTENSIONS__. Address the problem
725 by creating two new little files that include <config.h> first,
726 then include the flex-generated files. Rewrite everyone else
727 to include <config.h> first, as well.
728 * lib/timevar.c: Always include "config.h".
729 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
730 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
731 (EXTRA_bison_SOURCES): New macro.
732 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
733 * src/system.h: Don't include config.h.
734 * src/LR0.c: Include <config.h> first.
735 * src/assoc.c: Likewise.
736 * src/closure.c: Likewise.
737 * src/complain.c: Likewise.
738 * src/conflicts.c: Likewise.
739 * src/derives.c: Likewise.
740 * src/files.c: Likewise.
741 * src/getargs.c: Likewise.
742 * src/gram.c: Likewise.
743 * src/lalr.c: Likewise.
744 * src/location.c: Likewise.
745 * src/main.c: Likewise.
746 * src/muscle_tab.c: Likewise.
747 * src/nullable.c: Likewise.
748 * src/output.c: Likewise.
749 * src/parse-gram.y: Likewise.
750 * src/print.c: Likewise.
751 * src/print_graph.c: Likewise.
752 * src/reader.c: Likewise.
753 * src/reduce.c: Likewise.
754 * src/relation.c: Likewise.
755 * src/state.c: Likewise.
756 * src/symlist.c: Likewise.
757 * src/symtab.c: Likewise.
758 * src/tables.c: Likewise.
759 * src/uniqstr.c: Likewise.
760 * src/vcg.c: Likewise.
762 * src/parse-gram.y: Fix minor problems uncovered by lint.
763 (current_lhs, current_lhs_location): Now static.
764 (current_assoc): Remove unused variable.
766 Cleanups so that Bison-generated parsers have less lint.
767 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
768 Prepend /*ARGSUSED*/, for lint's sake.
769 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
770 definition if 'lint' is defined.
771 (YYID): New macro (or function, if lint).
772 All uses of /*CONSTCOND*/0 replaced by YYID(0).
773 * data/yacc.c: Likewise.
774 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
775 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
776 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
778 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
779 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
780 Use YYID(0) rather than 0, for lint.
781 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
782 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
784 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
786 * tests/glr-regression.at
787 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
788 Close memory leak reported by twlevo.
790 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
792 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
794 (yyparse): Iterate another stack in order to call user destructors.
795 * tests/glr-regression.at (No users destructors if stack 0 deleted):
797 (Duplicated user destructor for lookahead): This test now is expected
800 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
802 * NEWS: Document the following change.
803 * data/yacc.c: Say "parser skeleton" rather than "file", since
804 it's no longer just a file.
805 * data/glr.c: Grant a special exception for C GLR parsers, that
806 reads like the already-existing exception for C LALR(1) parsers.
807 * data/glr.cc: Likewise.
808 * data/lalr1.cc: Likewise.
809 * data/location.cc: Likewise.
810 * data/yacc.c: Reword the "written by" statement to clarify that
811 it was the parser skeleton, not the entire output file.
812 * data/glr.c: Written by Paul Hilfinger.
813 * data/glr.cc: Written by Akim Demaille.
814 * data/lalr1.cc: Likewise.
816 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
818 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
819 Fix typos in previous change that broke 'make check'.
820 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
822 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
823 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
824 We can revert this once things settle down.
826 * src/conflicts.c (conflicts_print): Don't print file name twice
827 when %expect fails because there were no conflicts.
828 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
830 * tests/conflicts.at (%expect not enough, %expect too much):
831 (%expect with reduce conflicts): Adjust to new behavior.
833 2005-11-18 Akim Demaille <akim@epita.fr>
835 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
837 * NEWS: Document this.
838 * doc/bison.texinfo (Expect Decl): Likewise.
840 2005-11-16 Akim Demaille <akim@epita.fr>
842 Generalize the display of semantic values and locations in traces.
843 * data/glr.c (yy_reduce_print): Fix indices (again).
844 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
846 * data/lalr1.cc (yyreduce_print): Rename as...
847 (yy_reduce_print): this.
848 Display values and locations.
849 * data/yacc.c (yy_reduce_print): Likewise.
850 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
851 (yysymprint): Move higher to be visible from yy_reduce_print).
853 * tests/calc.at: Adjust the expected length of the traces.
855 2005-11-14 Akim Demaille <akim@epita.fr>
857 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
858 from 1 to N, while values and location start at 0.
859 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
861 2005-11-14 Akim Demaille <akim@epita.fr>
863 * data/glr.c (yy_reduce_print): Fix the $ number.
865 2005-11-14 Akim Demaille <akim@epita.fr>
867 "Use" parse parameters.
868 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
869 * data/glr.c, data/glr.cc: Use them.
870 * data/glr.c (YYUSE): Have a C++ definition that supports
873 2005-11-14 Akim Demaille <akim@epita.fr>
875 * data/glr.c (yyexpandGLRStack): Declare only if defined.
877 2005-11-14 Akim Demaille <akim@epita.fr>
880 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
882 2005-11-12 Akim Demaille <akim@epita.fr>
884 Let position and location be PODs.
885 * data/location.cc (position::initialize, location::initialize): New.
886 (position::position, location::location): Define only if
887 b4_location_constructors is defined.
888 * data/lalr1.cc (b4_location_constructors): Define it for backward
890 * doc/bison.texinfo (Initial Action Decl): Use initialize.
892 2005-11-12 Akim Demaille <akim@epita.fr>
894 * data/lalr1.cc: Move the body of the ctor and dtor into the
895 parser file (instead of the header).
896 Wrap the implementations in a "namespace yy".
898 2005-11-12 Akim Demaille <akim@epita.fr>
900 Have glr.c include its header file when created.
901 * data/glr.c (b4_shared_declarations): New.
902 Output them verbatim in the parser if !%defines, otherwise
903 output then in the header file, and include it instead.
905 2005-11-11 Akim Demaille <akim@epita.fr>
907 * data/glr.c: Comment changes.
909 2005-11-11 Akim Demaille <akim@epita.fr>
911 When yydebug, report semantic and location values for reductions.
912 * data/glr.c (yy_reduce_print): Report the semantic values and the
914 (YY_REDUCE_PRINT): Adjust.
915 (yyglrReduce): Use them.
916 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
917 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
918 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
921 2005-11-10 Akim Demaille <akim@epita.fr>
923 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
924 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
925 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
927 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
929 * m4/cxx.m4, examples/Makefile.am: Don't build
930 examples/calc++ if no C++ compiler is available. (trivial change)
932 2005-11-09 Akim Demaille <akim@epita.fr>
934 * src/scan-skel.l: Use a couple of asserts.
936 2005-11-03 Akim Demaille <akim@epita.fr>
938 In some (weird) cases, the final state number is incorrect.
939 Reported by Alexandre Duret-Lutz.
940 * src/LR0.c (state_list_append): Remove the computation of
942 (save_reductions): Do it here.
943 (get_state): Alpha conversion.
944 (generate_states): Use a for loop.
945 * src/gram.h (item_number_is_rule_number)
946 (item_number_is_symbol_number): New.
947 * src/state.c: Use assert.
948 * src/system.h: Include assert.h.
949 * tests/sets.at (Accept): New.
951 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
953 * data/glr.c (yyfill): Adjust comment.
954 (yyresolveAction): Initialize default location properly
955 for empty right-hand sides.
957 Add comment explaining apparently dead code.
958 * tests/glr-regression.at
959 (Incorrectly initialized location for empty right-hand side in GLR):
962 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
964 * bootstrap (cleanup_gnulib): New function. Use it to clean up
965 gnulib when interrupted. This fixes some race conditions and
966 works around some portability problems (one noted by Paul
969 2005-10-22 Akim <akim@epita.fr>
971 * Makefile.cfg: Adjust to config -> build-aux.
974 2005-10-21 Akim Demaille <akim@epita.fr>
976 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
978 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
979 * data/yacc.c (b4_Pure_if): Rename as...
980 (b4_yacc_pure_if): this.
981 (YY_SYMBOL_PRINT, yyparse): Adjust.
982 * doc/bison.texinfo: Formatting changes.
984 2005-10-21 Akim Demaille <akim@epita.fr>
986 Finish the transition config -> build-aux.
987 * configure.ac, Makefile.am: Use build-aux.
988 * config/prev-version, config/announce-gen, config/Makefile.am:
990 * build-aux/prev-version, build-aux/announce-gen,
991 * build-aux/Makefile.am: here.
993 2005-10-14 Akim Demaille <akim@epita.fr>
995 * examples/calc++/test: Use set -x only when VERBOSE.
997 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
999 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
1000 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
1002 2005-10-13 Akim Demaille <akim@epita.fr>
1004 * src/scan-skel.l: Output the base name parts of the parser and
1006 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
1008 Use this to exercise C++ outputs in subdirs.
1009 Reported by Oleg Smolsky.
1011 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
1013 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
1014 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
1015 Problem reported by John P. Hartmann.
1016 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
1019 2005-10-12 Akim Demaille <akim@epita.fr>
1021 * src/parse-gram.y (version_check): Exit 63 to please missing
1022 (stands for "version mismatch).
1023 * tests/input.at, doc/bison.texinfo: Adjust.
1025 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
1027 Work around portability problems with Visual Age C compiler
1028 (xlc and xlC_r) reported by John P. Hartmann.
1029 * data/location.cc (initial_column, initial_line): Remove.
1030 All uses replaced by 0 and 1.
1031 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
1032 that xlc complains about.
1033 * src/scan-skel.l (skel_wrap): Likewise.
1034 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
1036 * data/yacc.c (YYMODERN_C): New macro, which also looks at
1037 __STDC_VERSION__. Use it everywhere instead of looking at
1038 __STDC__ and __cplusplus.
1040 2005-10-10 Akim Demaille <akim@epita.fr>
1042 * examples/calc++/test: Be quiet unless VERBOSE.
1044 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
1046 * data/c.m4 (yydestruct, yysymprint):
1047 Use YYUSE instead of casting to void.
1048 * data/glr.c (YYUSE): New macro.
1049 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
1050 Use it instead of rolling our own.
1051 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
1053 Use /*CONSTCOND*/ to suppress lint warnings.
1054 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
1055 (YY_STACK_PRINT): Use 'false' not '0'.
1057 (yysymprint_, yydestruct_): Use it instead of rolling our own.
1058 * data/yacc.c (YYUSE): New macro.
1059 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
1060 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
1061 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
1064 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
1065 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
1067 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
1069 Undo the parts of the unlocked-I/O change that substituted
1070 putc or puts for printf. This might hurt performance a bit,
1071 but some people prefer the printf style.
1072 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
1073 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
1074 All uses replaced by YYFPRINTF and YYDPRINTF.
1075 * data/yacc.c: Likewise.
1076 * lib/bitset.c (bitset_print): Likewise.
1077 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
1079 * lib/lbitset.c (debug_lbitset): Likewise.
1080 * src/closure.c (print_firsts, print_fderives): Likewise.
1081 * src/gram.c (grammar_dump): Likewise.
1082 * src/lalr.c (look_ahead_tokens_print): Likewise.
1083 * src/output.c (escaped_output): Likewise.
1084 (user_actions_output): Break apart two printfs.
1085 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
1086 * src/reduce.c (reduce_print): Likewise.
1087 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
1088 * src/system.h: Include unlocked-io.h rathe than stdio.h.
1090 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
1091 Use assignments rather than casts-to-void to suppress
1092 unused-variable warnings. This pacifies 'lint'.
1093 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
1094 unused-variable warnings.
1096 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1098 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
1100 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
1102 Use unlocked I/O for a minor performance improvement on hosts like
1103 GNU/Linux and Solaris that support unlocked I/O. The basic idea
1104 is to use the gnlib unlocked-io module, and to prefer putc and
1105 puts to printf when either will work (since the latter doesn't
1106 come in an unlocked flavor).
1107 * bootstrap (gnulib_modules): Add unlocked-io.
1108 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
1109 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
1110 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
1111 and similarly for puts and putc and printf.
1112 * data/yacc.c: Likewise.
1113 * lib/bitset.c (bitset_print): Likewise.
1114 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
1115 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
1117 * lib/lbitset.c (debug_lbitset): Likewise.
1118 * src/closure.c (print_firsts, print_fderives): Likewise.
1119 * src/gram.c (grammar_dump): Likewise.
1120 * src/lalr.c (look_ahead_tokens_print): Likewise.
1121 * src/output.c (escaped_output): Likewise.
1122 (user_actions_output): Coalesce two printfs.
1123 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
1124 * src/reduce.c (reduce_print): Likewise.
1125 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
1126 * src/system.h: Include unlocked-io.h rather than stdio.h.
1128 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
1129 this confuses xgettext.
1131 2005-10-02 Akim Demaille <akim@epita.fr>
1133 * bootstrap (gnulib_modules): Add strverscmp.
1134 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
1135 * m4/.cvsignore: Add strverscmp.m4.
1136 * src/parse-gram.y (%require): New token, new rule.
1137 (version_check): New.
1138 * src/scan-gram.l (%require): Adjust.
1139 * tests/input.at (AT_REQUIRE): New.
1141 * doc/bison.texinfo (Require Decl): New.
1142 (Calc++ Parser): Use %require.
1144 2005-10-02 Akim Demaille <akim@epita.fr>
1146 * data/location.cc: New.
1148 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
1149 Akim Demaille <akim@epita.fr>
1151 Make sure -odir/foo.cc creates dir/location.hh etc.
1152 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
1153 (spec_file_prefix, spec_verbose_file, spec_graph_file)
1154 (spec_defines_file): Now const.
1156 (short_base_name): Remove.
1157 * src/files.c: Adjust.
1158 (dirname.h): Include.
1159 (base_name): Don't prototype it.
1160 (finput): Remove, duplicates gram_in.
1161 (full_base_name, short_base_name): Replace by...
1162 (all_but_ext, all_but_tab_ext): these.
1163 (compute_base_names): Rename as...
1164 (compute_file_name_parts): this.
1165 Update to compute the new variables, including dir_prefix.
1166 Adjust dependencies.
1167 * src/output.c (prepare): Output them.
1168 * src/reader.c: Adjust to use gram_in, not finput.
1169 * src/scan-skel.l (@dir_prefix@): New.
1171 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1173 * lib/subpipe.c: New function end_of_output_subpipe() added
1174 to allow support for non-posix systems. This is a no-op function
1177 * lib/subpipe.h: New function end_of_output_subpipe() added
1178 to allow support for non-posix systems. This is a no-op function
1181 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
1182 handle the lack of pipe/fork functionality on non-posix systems.
1184 * djgpp/Makefile.maint: DJGPP specific file.
1186 * djgpp/README.in: DJGPP specific file.
1188 * djgpp/config.bat: DJGPP specific configuration file.
1190 * djgpp/config.sed: DJGPP specific configuration file.
1192 * djgpp/config.site: DJGPP specific configuration file.
1194 * djgpp/config_h.sed: DJGPP specific configuration file.
1196 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
1198 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
1200 2005-10-02 Akim Demaille <akim@epita.fr>
1202 * data/location.cc: New, extract from...
1203 * data/lalr1.cc: here.
1204 (location.hh): Include it after the user prologue, in case the
1205 filename type is defined by the user.
1206 Forward declation location and position before the pre-prologue.
1207 (yyresult_): Rename as...
1208 (yyresult): this, it's a local variable, not an attribute.
1209 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
1211 2005-10-01 Akim Demaille <akim@epita.fr>
1213 * examples/extexi: Restore the #line generation.
1215 2005-09-30 Akim Demaille <akim@epita.fr>,
1216 Alexandre Duret-Lutz <adl@gnu.org>
1218 Move the token type and YYSTYPE in the parser class.
1219 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
1220 (parser::token): New, from the moved free definition of tokens.
1221 (parser::semantic_value): Now a full definition instead of an
1222 indirection to YYSTYPE.
1223 (b4_post_prologue): No longer included in the header file, but
1224 in the implementation file.
1225 * doc/bison.texi (C+ Language Interface): Update.
1226 * src/parse-gram.y: Support unary %define.
1227 * tests/actions.at: Define global_tokens_and_yystype for backward
1228 compatibility until we update the tests.
1229 * tests/calc.at: Idem.
1230 (first_line, first_column, last_line, last_column): Define for lalr1.cc
1231 to simplify the code.
1233 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
1235 Port to SunOS 4.1.4, which lacks strtoul and strerror.
1236 Ah, the good old days! Problem reported by Peter Klein.
1237 * bootstrap (gnulib_modules): Add strerror, strtoul.
1238 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
1239 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
1241 2005-09-29 Akim Demaille <akim@epita.fr>
1243 * data/c.m4 (b4_error_verbose_if): New.
1244 * data/lalr1.cc: Use it.
1245 (YYERROR_VERBOSE_IF): Remove.
1246 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
1247 parser members, replaced by...
1248 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
1250 (yysyntax_error_): Takes the state number as argument.
1251 (yyreduce_print_): Use the argument yyrule, not the former
1254 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
1256 * bootstrap (gnulib_modules): Add verify.
1257 * lib/.cvsignore: Add verify.h.
1258 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
1259 * src/system.h (verify): Remove.
1260 Include verify.h instead.
1261 * src/tables.c (tables_generate): Use new API for 'verify'.
1263 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
1265 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
1266 local variables whose names begin with 'yy'.
1267 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
1268 Trivial changes from Joel E. Denny.
1270 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
1272 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
1273 don't use alloca any more.
1275 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
1276 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
1277 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
1278 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
1279 to match yacc.c, to test more hosts.
1281 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
1283 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
1284 doesn't affect behavior.
1285 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
1287 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
1288 This works a bit better with glibc, if user code has already included
1290 * doc/bison.texinfo (Bison Parser): Document that users can't
1291 arbitrarily use malloc and free for other purposes. Document
1292 that <alloca.h> and <malloc.h> might be included.
1293 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
1294 user must declare alloca.
1296 * HACKING (release): Forwarn the Translation Project about
1299 2005-09-20 Akim Demaille <akim@epita.fr>
1301 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
1303 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
1305 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
1306 (YYSTACK_ALLOC_MAXIMUM): Use it.
1307 (yysyntax_error): New function.
1308 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
1309 multiple syntax errors are reported, and alloca is being used.
1310 Instead, reallocate buffers twice as big each time, so that
1311 we waste at most half the allocated memory. Start with a small
1312 (128-byte) buffer that will suffice in most cases anyway.
1313 Use yysyntax_error to do most of the work.
1315 * doc/bison.texinfo (Error Reporting, Table of Symbols):
1316 yynerrs is the number of errors reported, not the number of
1319 * tests/glr-regression.at (Duplicated user destructor for lookahead):
1320 Mark it as expected to fail.
1321 Cast result of malloc; problem reported by twlevo@xs4all.nl.
1322 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
1323 Don't start user-code symbols with "yy", to avoid name space problems.
1325 2005-09-19 Akim Demaille <akim@epita.fr>
1327 Remove the traits, failed experiment.
1328 It never proved useful, and anyway because of the current
1329 definition, it was not possible to have several specialization of
1330 this traits, making it useless.
1331 * data/lalr1.cc (yy:traits): Remove.
1332 Inline its definitions in the parser class.
1334 2005-09-19 Akim Demaille <akim@epita.fr>
1336 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
1337 least Mac OSX with a /usr/local install of gettext.
1339 2005-09-19 Akim Demaille <akim@epita.fr>
1341 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
1342 and yytoken for similarity with the other skeletons.
1344 2005-09-19 Akim Demaille <akim@epita.fr>
1346 * NEWS, configure.ac: Version 2.1a.
1348 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
1350 * NEWS: Version 2.1.
1352 * NEWS: Remove notice of yytname change, since it was never in an
1354 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
1356 * src/output.c (prepare): Likewise.
1357 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
1358 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
1359 is not defined. This is an awful hack, but it's enough for now.
1360 All callers changed.
1361 * tests/glr-regression-at (make_value): Args are const pointers now,
1362 to avoid GCC warning.
1363 (Duplicated user destructor for lookahead): New test. Currently
1364 skipped. It fails on my host but I'm not sure it'll always fail.
1366 2005-09-16 Akim Demaille <akim@epita.fr>
1368 * src/symtab.h (struct symbol): Declare the printer and destructor
1369 as const, to avoid accidental calls to free.
1370 (symbol_destructor_set, symbol_printer_set): Adjust.
1371 * src/symtab.c: Adjust.
1373 2005-09-16 Akim Demaille <akim@epita.fr>
1375 * data/c.m4 (b4_token_enums): New.
1376 (b4_token_defines): Rename as...
1377 (b4_token_enums_defines): this.
1378 (b4_token_defines): New, output only the #defines.
1379 * data/yacc.c, data/glr.c: Adjust.
1380 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
1381 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
1384 2005-09-16 Akim Demaille <akim@epita.fr>
1386 * data/lalr1.cc (yylex_): Remove, inline its code.
1387 (yyreport_syntax_error_): Remove, replaced by...
1388 (yysyntax_error_): this which returns a string and leaves to the
1389 caller the call to the users' error function.
1390 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
1391 Move from members of the parser object...
1392 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
1393 to local variables of the parse function.
1395 2005-09-16 Akim Demaille <akim@epita.fr>
1397 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
1398 since it's in Bison's name space.
1400 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
1402 * data/glr.c (yyresolveValue): Add default case to pacify
1403 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
1405 * NEWS: Document when yyparse started to return 2.
1406 * doc/bison.texinfo (Parser Function): Document when yyparse
1409 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
1410 (b4_filename_type): Renamed back from b4_file_name_type. All uses
1412 (class position): file_name -> filename (reverting). All uses changed.
1414 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
1416 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
1417 do anything if $@ exists. This reverts part of the 2005-07-07
1420 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
1422 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
1423 contains obsolete information and isn't worth distributing as a
1424 separate file anyway.
1425 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
1426 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
1427 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
1428 (yyparse): Abort if user code uses longjmp to throw an unexpected
1431 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
1433 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
1434 Suggested by twlevo@xs4all.nl.
1436 * data/glr.c (YYCHK1): Do not assume YYE is in range.
1437 This avoids a diagnostic from gcc -Wswitch-enum.
1438 Problem reported by twlevo@xs4all.nl.
1440 * doc/bison.texinfo: Don't use "filename", as per GNU coding
1441 standards. Use "file name" or "file" or "name", depending on
1443 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
1444 not to hack/foo.tab.c.
1445 (Calc++ Top Level): 2nd arg of main is not const.
1446 * data/glr.c: b4_filename -> b4_file_name.
1447 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
1449 (class position): filename -> file_name. All uses changed.
1450 * data/yacc.c: b4_filename -> b4_file_name.
1451 * lib/bitset.h: filename -> file_name in local vars.
1452 * lib/bitset_stats.c: Likewise.
1453 * src/files.c: Likewise.
1454 * src/scan-skel.l ("@output ".*\n): Likewise.
1455 * src/files.c (file_name_split): Renamed from filename_split.
1456 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
1458 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
1460 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
1461 to accommodate latest gnulib.
1463 * tests/glr-regression.at (Duplicate representation of merged trees):
1464 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
1466 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
1469 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
1471 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
1472 All uses changed. Invoke user destructor after an error during a
1473 split parse (trivial change from Joel E. Denny).
1475 * tests/glr-regression.at
1476 (User destructor after an error during a split parse): New test case.
1477 Problem reported by Joel E. Denny in:
1478 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
1480 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1482 * README-cvs: Give URLs for recommended tools.
1483 Mention Gzip version problem, and bootstrapping issues.
1484 Remove troubleshooting section, as it's somewhat obsolete.
1486 * bootstrap (no_cache): New var, to accommodate different wget
1487 variants. Use it instead of '-C off'. Problem reported by
1490 * data/glr.c (yydestroyStackItem): New function.
1491 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
1492 debugging information. Problem reported by Joel E. Denny.
1494 2005-08-25 Akim Demaille <akim@epita.fr>
1496 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
1498 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
1500 * data/glr.c (yyrecoverSyntaxError, yyreturn):
1501 Don't invoke destructor on unresolved entries.
1502 * tests/glr-regression.at
1503 (User destructor for unresolved GLR semantic value): New test case.
1504 Problem reported by Joel E. Denny in:
1505 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
1507 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
1509 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
1511 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
1512 lib-prefix.m4, po.m4.
1514 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
1515 in yydestruct diagnostic, since it might not be an error.
1516 Problem reported by Joel Denny near end of
1517 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
1518 * data/lalr1.cc (yyerturn): Likewise.
1519 * data/yacc.c (yyreturn): Likewise.
1520 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
1522 * src/files.c: Remove obsolete FIXME comment.
1524 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
1525 with the other templates, and to fix bogus run-on messages such
1526 as the one reported at the end of
1527 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
1528 All callers changed to avoid the newline.
1529 (yyprocessOneStack): Output two lines rather than one, to accommodate
1530 the above change. This changes the debug output format slightly.
1532 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
1533 reported by Joel E. Denny in
1534 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
1536 * tests/glr-regression.at (Duplicate representation of merged trees):
1537 New test, from Joel E. Denny in:
1538 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
1539 * THANKS: Add Joel E. Denny.
1541 * configure.ac (AC_INIT): Bump to 2.0c.
1543 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
1545 * NEWS: Version 2.0b.
1547 * Makefile.am (SUBDIRS): Put examples before tests, so that
1548 "make check" doesn't finish with "All 1 tests passed".
1550 * tests/regression.at (Token definitions): Don't rely on
1551 AT_PARSER_CHECK for data that contains backslashes. It currently
1552 uses 'echo', and 'echo' isn't portable if its argument contains
1553 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
1554 that the byte '\0xff' is not printable in the C locale; it is,
1555 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
1556 not printable, so use '\0x81' to test.
1558 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
1559 version of GCC, since the macro is used with non-GCC compilers.
1561 Fix core dump reported by Pablo De Napoli in
1562 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
1563 * tests/regression.at (Invalid inputs with {}): New test.
1564 * src/parse-gram.y (token_name): Translate type before using
1567 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
1568 the user's name space. All uses changed to __attribute__
1570 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
1571 Add __attribute__ ((__noreturn__)).
1573 * etc/clcommit: Remove. We weren't using it, and it failed
1574 "make maintainer-distcheck".
1575 * Makefile.maint: Merge from coreutils.
1576 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
1577 (syntax-check-rules): Change list of rules as described below.
1578 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
1579 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
1580 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
1581 (sc_trailing_space): New rules.
1582 (sc_xalloc_h_in_src): Remove.
1583 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
1584 (sc_space_tab, sc_error_exit_success, sc_changelog):
1585 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
1586 (makefile-check, po-check, author_mark_check):
1587 (makefile_path_separator_check, copyright-check):
1588 Use grep -n, to make it easier to find violations.
1589 Use CVS_LIST and CVS_LIST_EXCEPT.
1590 (header_regexp, h_re): Remove.
1592 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
1593 (my-distcheck): Use more-modern GCC flags.
1594 (signatures, %.asc): Remove.
1595 (rel-files, announcement): Remove signatures.
1596 Restore old updating code, even though we don't use it, so
1597 that we're the same as coreutils.
1598 (alpha, beta, major): Depend on news-date-check.
1599 Make the upload commands.
1601 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
1602 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
1603 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
1604 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
1605 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
1606 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
1607 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
1608 * tests/sets.at: Likewise.
1610 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
1611 we comment out the Autoconf version number.
1612 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
1613 it's error-prone and "make maintainer-distcheck" rejects it.
1615 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
1616 Indent calls to "error" to pacify "make maintainer-distcheck",
1617 when the calls are not intended to be translated.
1618 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
1620 * src/Makefile.am (DEFS): Use +=, to pacify
1621 "make maintainer-distcheck".
1622 (bison_SOURCES): Add scan-skel.h.
1623 (sc_tight_scope): New rule, from coreutils.
1625 * src/files.c (src_extension, header_extension):
1626 Now static, not extern.
1627 * src/getargs.c (short_options): Likewise.
1628 * src/muscle_tab.c (muscle_table): Likewise.
1629 * src/parse-gram.y (current_class, current_type, current_prec):
1631 * src/reader.c (grammar_end, previous_rule_end): Likewise.
1632 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
1633 * src/main.c (main): Cast bindtextdomain and textdomain calls to
1634 void, to avoid warning when NLS is disabled.
1635 * src/output.c: Include scan-skel.h.
1636 (scan_skel): Remove decl, since scan-skel.h does this.
1638 Indent calls to "error" to pacify "make maintainer-distcheck".
1639 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
1640 * src/reader.h (gram_end, gram_lineno): New decls to pacify
1641 "make maintainer-distcheck".
1642 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
1643 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
1644 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
1645 (skel_lex_destroy, scan_skel): Move these decls to...
1646 * src/scan-skel.h: New file.
1647 * src/uniqstr.c (uniqstr_assert):
1648 Indent calls to "error" to pacify "make maintainer-distcheck".
1650 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
1653 * tests/torture.at: Revamp to avoid misuse of atoi that
1654 "make maintainer-distcheck" complained about.
1656 * examples/extexi (message): Don't print a message more than once,
1657 and omit line-number decoration that makes Emacs compile think
1658 that informative messages are worth worrying about.
1660 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
1662 * configure.ac: Update version number.
1664 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
1666 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
1667 autogenerated by the maintainer.
1668 * examples/calc++/.cvsignore: Add *.yy.
1670 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
1671 * lib/bitset_stats.c (bitset_stats_init): Likewise.
1672 * lib/bitsetv.c (bitsetv_alloc): Likewise.
1674 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
1676 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
1677 from maintainer-distcheck about casting the argument of 'free'.
1679 * NEWS: Mention recent yytname changes.
1680 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
1682 * bootstrap: For translations that have not yet been upgraded to
1683 the new runtime-po domain, prime the pump by extracting the
1684 relevant strings from the obsolete translations. This code can be
1685 removed once the bison-runtime domain has been translated by each
1688 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
1689 now that token names are already quoted.
1691 Fix problem reported by Anthony Heading.
1692 * data/glr.c (YYTOKEN_TABLE): New macro.
1693 (yytname): Define if YYTOKEN_TABLE.
1694 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
1695 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
1696 (YYERROR_VERBOSE): Define the same way the other skeletons do.
1697 * src/output.c (prepare_symbols): Output token_table_flag.
1699 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
1701 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
1702 again if the first call fails.
1704 * data/glr.c (yytnamerr): New function.
1705 (yyreportSyntaxError): Use it to dequote most string literals.
1706 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
1707 with other skeletons. All uses changed.
1708 (yytnameerr_): New function.
1709 (yyreport_syntax_error): Use it to dequote most string literals.
1710 * data/yacc.c (yytnamerr): New function.
1711 (yyerrlab): Use it to decode most string literals.
1712 * doc/bison.texinfo (Decl Summary, Calling Convention):
1713 Clarify quoting convention of yytname.
1714 * src/output.c (prepare_symbols): Quote all names. This undoes
1715 the 2005-04-17 change, which is now accomplished (mostly) via
1716 changes in the parsers as described above.
1717 * tests/regression.at (Token definitions, Web2c Actions):
1718 Undo most 2005-04-17 change here, too.
1720 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
1722 Fix more problems reported by twlevo@xs4all.nl.
1723 * tests/cxx-type.at: Don't pipe output of ./types through sed to
1724 remove trailing spaces. This loses the exit status of ./types,
1725 and isn't needed since ./types shouldn't be emitting trailing
1727 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
1728 as the stack isn't valid in that case.
1730 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1731 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1732 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1733 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
1735 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
1736 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
1737 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
1740 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
1741 overly-picky compilers that reject 'char *foo = "bar";'.
1743 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
1744 to FILE * parameter, not to stderr. This fixes a typo introduced
1745 in the 2005-07-12 change.
1747 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
1748 warnings from GCC 4.
1750 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
1751 (yyglrShiftDefer, yysplitStack):
1752 Remove unused parameters b4_pure_formals. All uses changed.
1753 (yyglrShift): Remove unused parameters b4_user_formals.
1755 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
1757 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
1759 Destructor cleanups and regularization among the three skeletons.
1760 * NEWS: Document the behavior changes.
1761 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
1762 stack before failing, as the cleanup code will do it for us now.
1763 * data/lalr1.cc (yyerrlab): Likewise.
1764 * data/glr.c (yyparse): Pop everything off the stack before
1765 freeing it, so that destructors get called properly.
1766 * data/lalr1.cc (yyreturn): Likewise.
1767 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
1768 This is more consistent.
1769 * doc/bison.texinfo (Destructor Decl): Mention more reasons
1770 why destructors might be called. 1.875 -> 2.1.
1771 (Destructor Decl, Decl Summary, Table of Symbols):
1772 Some English-language cleanups for %destructor.
1773 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1774 Add output line for destructor of start symbol.
1775 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
1776 because of that same extra output line.
1778 * NEWS: Document minor wording changes in diagnostics of
1779 Bison-generated parsers.
1780 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
1781 Remove unused formals. All uses changed.
1782 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
1783 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
1784 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
1785 Rename yyoverflowab to yyexhaustedlab.
1786 When memory exhaustion occurs during syntax-error reporting,
1787 report it separately rather than in a single diagnostic; this
1789 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
1790 (Memory Exhausted): Renamed from Parser Stack Overflow.
1791 Revamp wording slightly to prefer "memory exhaustion".
1792 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
1794 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
1796 Add i18n support to the GLR skeleton. Partially fix the C++
1797 skeleton; a C++ expert needs to finish this. Remove debugging
1798 msgids; there's little point to having them translated, since they
1799 can be understood only by someone who can read the
1800 (English-language) source code.
1802 Generate runtime-po/bison-runtime.pot automatically, so that we
1803 don't have to worry about garbage getting in that file. We'll
1804 make sure after the next official release that old msgids don't
1806 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
1808 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
1810 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
1811 Fix typos in explanations of the runtime file.
1812 * bootstrap: Change gettext keyword from YYI18N to YY_.
1813 Use standard Makefile.in.in in runtime-po, since we'll arrange
1814 for backward-compatible bison-runtime.po files in a different way.
1815 * data/glr.c (YY_): New macro, from yacc.c.
1816 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
1817 Translate messages intended for users.
1818 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
1819 the wording in the other skeletons. We don't know that the memory
1821 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
1822 Use same method that yacc.c uses.
1823 Don't translate debugging messages.
1824 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
1825 it doesn't work (yet), and requires C++ expertise to fix.
1826 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
1827 Move defn to a more logical place, to be consistent with other
1829 Don't translate debugging messages.
1830 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
1831 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
1832 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
1833 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
1835 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
1836 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
1838 * tests/glr-regression.at (Badly Collapsed GLR States):
1840 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
1841 yylex should return 0 at EOF rather than aborting.
1843 Improve tests for stack overflow in GLR parser.
1844 Problem reported by twlevo@xs4all.nl.
1845 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
1847 (yyStackOverflow): Just longjmp, but with value 2 so that caller
1848 can handle the problem.
1849 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
1850 (yyparse): New local variable yyresult to record the result.
1851 Use result of setjmp to set it, rather than storing itinto
1853 (yyDone): Remove label.
1854 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
1855 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
1856 if YYABORT is used).
1857 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
1858 yyparse status; put status > 1 into diagnostic.
1859 Check that status==2 works.
1860 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
1861 Use exit status 3 for failure to open (which shouldn't happen).
1863 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
1865 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
1866 1 on syntax error; just let yyparse do its thing.
1867 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
1868 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
1869 (Exploding the Stack Size with Alloca):
1870 (Exploding the Stack Size with Malloc):
1871 Expect exit status 2, not 1, since the parser is supposed to blow
1872 its stack. Problem reported by twlevo@xs4all.nl.
1874 * data/glr.c (yyparse): Don't assume that the initial calls
1875 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
1876 Print a stack-overflow message and fail instead.
1877 Initialize the line-number information before creating the stack,
1878 so that the stack-overflow message can report line zero safely.
1880 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
1882 Fix problems reported by twlevo@xs4all.nl.
1883 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
1884 (yyuserMerge): Provide a default case if b4_mergers is empty.
1885 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
1886 * tests/glr-regression.at
1887 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
1888 Add casts to pacify C++ compilers.
1889 * tests/glr-regression.at (Improper merging of GLR delayed action
1890 sets): Declare yylex before using it.
1891 * tests/Makefile.am (maintainer-check-g++): Fix a stray
1892 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
1893 test for valgrind; valgrind is independent of g++.
1894 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
1895 for compatibility with POSIX 1003.1-2001 (if running coreutils).
1896 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
1897 Use a destructor, so that we can expand the stack. Change
1898 YYSTYPE to char * so that we can free it. Cast result of malloc.
1900 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
1902 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
1903 a valgrind failure. Problem reported by twlevo@xs4all.nl.
1905 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
1907 * PACKAGING: New file, suggested by Bruno Haible and taken from
1908 similar wording in gettext's PACKAGING file.
1909 * NEWS: Mention PACKAGING.
1910 * Makefile.am (EXTRA_DIST): Add PACKAGING.
1912 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
1914 * NEWS: Document recent i18n improvements.
1915 * bootstrap: Get runtime translations into runtime-po.
1916 Create runtime-po files automatically, if possible.
1917 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
1918 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
1919 does not infringe on the user's name space.
1920 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
1921 * doc/bison.texinfo (Internationalization): Revamp the English
1922 and Texinfo syntax a bit, to try to make it clearer.
1923 (Bison Options, Option Cross Key): Mention --print-localedir.
1924 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
1925 YYENABLE_NLS. Quote a bit more.
1926 * runtime-po/.cvsignore: New file.
1927 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
1928 * runtime-po/Rules-quot: Remove; now created by bootstrap.
1929 * runtime-po/quot.sed: Likewise.
1930 * runtime-po/boldquot.sed: Likewise.
1931 * runtime-po/en@quot.header: Likewise.
1932 * runtime-po/en@boldquot.header: Likewise.
1933 * runtime-po/insert-header.sin: Likewise.
1934 * runtime-po/remove-potcdate.sin: Likewise.
1935 * runtime-po/Makevars: Likewise.
1936 * runtime-po/LINGUAS: Likewise.
1937 * runtime-po/de.po: Likewise; we will rely on the translation project
1938 to maintain this, so "bootstrap" should get it.
1939 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
1941 * src/main.c (main): Bind the bison-runtime domain, too.
1943 2005-07-12 Bruno Haible <bruno@clisp.org>
1945 * data/yacc.c: Include <libintl.h> when NLS is enabled.
1946 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
1947 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
1948 * runtime-po: New directory.
1949 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
1950 $(DOMAIN).pot-update rule, so that old messages are never dropped.
1951 * runtime-po/Rules-quot: New file, copied from po/.
1952 * runtime-po/quot.sed: Likewise.
1953 * runtime-po/boldquot.sed: Likewise.
1954 * runtime-po/en@quot.header: Likewise.
1955 * runtime-po/en@boldquot.header: Likewise.
1956 * runtime-po/insert-header.sin: Likewise.
1957 * runtime-po/remove-potcdate.sin: Likewise.
1958 * runtime-po/Makevars: New file.
1959 * runtime-po/POTFILES.in: New file.
1960 * runtime-po/LINGUAS: New file.
1961 * runtime-po/bison-runtime.pot: New file.
1962 * runtime-po/de.po: New file.
1963 * m4/bison.m4: New file.
1964 * Makefile.am (SUBDIRS): Add runtime-po.
1965 (aclocaldir, aclocal_DATA): New variables.
1966 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
1968 * src/getargs.c (usage): Document --print-localedir option.
1969 (PRINT_LOCALEDIR_OPTION): New enum item.
1970 (long_options): Add --print-localedir option.
1971 (getargs): Handle --print-localedir option.
1972 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
1973 (Internationalization): New section.
1975 2005-07-12 Akim Demaille <akim@epita.fr>
1977 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
1978 for consistency with the rest of the code.
1979 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
1982 2005-07-12 Akim Demaille <akim@epita.fr>
1984 * src/parse-gram.y: Use %printer instead of YYPRINT.
1986 2005-07-12 Akim Demaille <akim@epita.fr>
1988 * src/symtab.h, src/symtab.c (symbol_print): New.
1989 * src/symlist.h, src/symlist.c (symbol_list_print): New.
1990 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
1992 2005-07-12 Akim Demaille <akim@epita.fr>
1994 * data/glr.c (b4_syncline): Fix (swap) the definitions of
1995 b4_at_dollar and b4_dollar_dollar.
1997 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
1999 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
2000 and Pennello's paper.
2002 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
2004 * data/yacc.c (yyparse): Undo previous patch. Instead,
2005 set yylsp[0] and yyvsp[0] only if the initial action
2006 sets yylloc and yylval, respectively.
2008 * data/yacc.c (yyparse): In the initial action, set
2009 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
2010 This avoids the use of undefined variables if the initial
2011 action does not set yylloc and/or yylval.
2013 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
2015 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
2016 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
2017 Remove from CVS. These files are automatically generated.
2018 * examples/extexi: Clarify that this file is now part of Bison,
2019 not GNU M4, and that it works with any POSIX-compatible Awk.
2020 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
2021 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
2022 so that we also get calc++-parser.yy. Geneate it.
2023 Use $(AWK), not gawk, since any conforming Awk will do.
2024 Put comment before action, since older 'make' can't handle comment
2026 $(BUILT_SOURCES): List all built sources, not just some of them.
2027 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
2028 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
2029 $($(calc_sources_generated)): Remove unnecessary test for existence
2030 of target. (This had a shell syntax error anyway; a stray "x".)
2031 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
2033 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
2035 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
2036 implied by the other modules.
2038 2005-07-06 Akim Demaille <akim@epita.fr>
2040 Bind examples/calc++ to the package.
2041 * examples/calc++/Makefile: Remove, replaced by...
2042 * examples/calc++/Makefile.am: ... this new file.
2043 * examples/calc++/test: Remove input.
2044 * examples/calc++/compile: Remove.
2045 * examples/Makefile.am: New.
2046 * configure.ac, Makefile.am: Adjust.
2047 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
2049 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
2051 * data/glr.c (yyFail): Drastically simplify; since the format argument
2052 never had any % directives, we can simply pass it to yyerror.
2053 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
2054 be modified later, as that is the usual style in glr.c.
2055 Problems reported by Paul Hilfinger.
2057 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
2058 and size overflow errors.
2059 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
2060 in case the user prolog sets feature-test macros like _GNU_SOURCE.
2061 (YYSIZEMAX): New macro.
2062 (yystpcpy): New function, taken from yacc.c.
2063 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
2064 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
2065 so that we don't have to maintain their signatures.
2066 (yyFail): Check for buffer overflow, by using vsnprintf rather
2067 than vsprintf. Allocate a bigger buffer if possible.
2068 Report an error if buffer allocation fails.
2069 (yyStackOverflow): New function.
2070 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
2071 the initialization was successful. It might fail if storage was
2073 (yyexpandGLRStack): Add more checks for storage allocation failure.
2074 Use yyStackOverflow to report failures.
2075 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
2076 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
2077 Don't assume stack number fits in int.
2078 (yysplitStack): Check for storage allocation failure.
2079 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
2080 can print diagnostics on storage allocation failure. All callers
2082 (yyresolveValue): Use yybool for boolean.
2083 (yyreportSyntaxError): Check for size-calculation overflow.
2084 This code is taken from yacc.c.
2085 (yyparse): Check for storage allocation errors when allocating
2088 2005-07-05 Akim Demaille <akim@epita.fr>
2090 Extract calc++ from the documentation.
2091 * doc/bison.texinfo (Calc++): Add the extraction marks.
2092 * examples/extexi: New, from the aborted GNU Programming 2E.
2093 Separate the different paragraph of a file with empty lines.
2094 * examples/Makefile: Use it to extract the whole calc++ example.
2096 2005-06-24 Akim Demaille <akim@epita.fr>
2098 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
2101 2005-06-22 Akim Demaille <akim@epita.fr>
2103 * doc/bison.texinfo (C++ Language Interface): First stab.
2104 (C++ Parsers): Remove.
2106 2005-06-22 Akim Demaille <akim@epita.fr>
2108 * data/lalr1.cc (yylex_): Honor %lex-param.
2110 2005-06-22 Akim Demaille <akim@epita.fr>
2112 Start a set of simple examples.
2113 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
2114 * examples/calc++/calc++-driver.hh,
2115 * examples/calc++/calc++-parser.yy,
2116 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
2117 * examples/calc++/compile, examples/calc++/test: New.
2119 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
2121 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
2122 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
2123 which stems from the 2005-05-27 patch.
2125 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2127 * data/glr.c: Modify treatment of unused parameters to permit use
2128 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
2130 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
2132 Fix infringement on user name space reported by Janos Zoltan Szabo.
2133 * data/yacc.c (yyparse): strlen -> yystrlen.
2135 2005-05-30 Akim Demaille <akim@epita.fr>
2137 * data/lalr1.cc (_): New.
2138 Translate the various messages.
2140 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
2142 Fix infringement on user name space reported by Bruno Haible.
2143 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
2144 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
2145 the user's name space.
2146 (alloca): Include <stdlib.h> to get it, if it's not built in.
2147 (YYMALLOC, YYFREE): Define only if needed.
2148 (malloc, free): Declare, but only if needed, as this infringes on
2149 the user name space.
2151 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
2153 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
2154 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
2156 * lib/ebitset.c (min, max): Undef before defining.
2157 * lib/vbitset.c (min, max): Likewise.
2158 * lib/subpipe.c (create_subpipe): Save local variables in case
2159 vfork clobbers them.
2161 2005-05-24 Bruno Haible <bruno@clisp.org>
2163 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
2164 error message syntax used by gcc-4.0.
2166 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
2168 * README: Mention m4 1.4.3. Remove obsolete advice about
2169 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
2171 * bootstrap: Remove workaround for problem I encountered with
2172 gettext 0.14.1; it seems to be fixed now.
2174 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
2176 * NEWS: Version 2.0a.
2178 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
2179 the previous change.
2181 Various maintainer cleanups.
2182 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
2183 conftest*, for benefit of CVS commands run at the same time as
2184 "configure". Add build-aux, since "bootstrap" now creates it and
2186 * Makefile.cfg (move_if_change): Remove.
2187 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
2188 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
2189 (po_repo, do-po-update, po-update, wget_files, get-targets):
2190 (config.guess-url_prefix, config.sub-url_prefix):
2191 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
2192 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
2193 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
2195 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
2196 this is now the recommended name.
2197 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
2198 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
2199 ylwrap. These files now go into build-aux.
2200 * config/move-if-change: Remove.
2201 * config/prev-version.txt: Bump from 1.75 to 2.0.
2203 * bootstrap: Add stdio-safer, unistd-safer modules.
2204 Remove m4/glibc2.m4 (introduced by latest gnulib, but
2206 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
2207 fopen-safer.c, stdio-safer.h, unistd-safer.h.
2208 * lib/subpipe.c: Include "unistd-safer.h".
2209 (create_subpipe): Make sure all the newly-created
2210 file descriptors are > 2, so that diagnostics don't
2211 get sent down them (which might cause Bison to hang, in theory).
2212 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
2213 * src/files.c (xfopen): Use fopen_safer, not fopen.
2215 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
2216 yesterday's yacc.c fix.
2218 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
2220 * data/glr.c, data/lalr1.cc: Update copyright date.
2222 Fix a destructor bug reported by Wolfgang Spraul in
2223 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
2224 * data/yacc.c (yyabortlab): Don't call destructor, and
2225 don't set yychar to EMPTY.
2226 (yyoverflowlab): Don't call destructor.
2227 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
2228 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
2229 since we no longer output the message "discarding lookahead token
2232 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
2234 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
2235 fix a small glitch in debugging output.
2236 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
2237 after YY_SYMBOL_PRINT where needed.
2239 (struct yyGLRState): Add some comments.
2240 (struct yySemanticOption): Add some comments.
2241 (union yyGLRStackItem): Add comment.
2243 (yymergeOptionSets): Correct this to properly perform the union,
2244 avoiding infinite reported by Michael Rosien.
2247 * tests/glr-regression.at: Add test for GLR merging error reported
2250 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
2252 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
2253 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
2254 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
2255 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
2256 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
2257 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
2258 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
2259 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
2260 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
2261 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
2262 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
2263 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
2264 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
2265 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
2266 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
2267 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
2268 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
2269 src/derives.h, src/files.c, src/files.h, src/getargs.c,
2270 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
2271 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
2272 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
2273 src/output.h, src/parse-gram.c, src/parse-gram.h,
2274 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
2275 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
2276 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
2277 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
2278 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
2279 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
2280 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
2281 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
2282 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
2283 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
2284 tests/reduce.at, tests/regression.at, tests/sets.at,
2285 tests/synclines.at, tests/testsuite.at, tests/torture.at:
2286 Update FSF postal mail address.
2288 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
2290 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
2291 Problem reported by Ralf Menzel.
2293 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
2295 * tests/actions.at: Test that stack overflow invokes destructors.
2296 From Marcus Holland-Moritz.
2297 * data/yacc.c (yyerrlab): Move the code that destroys the stack
2299 (yyreturn): to here. That way, destructors are called properly
2300 even if the stack overflows, or the user calls YYACCEPT or
2301 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
2302 (yyoverflowlab): Destroy the lookahead.
2304 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
2306 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
2308 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
2310 * NEWS: Bison-generated C parsers no longer quote literal strings
2311 associated with tokens.
2312 * src/output.c (prepare_symbols): Don't escape strings,
2313 since users don't want to see C escapes.
2314 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
2316 * tests/input.at (Torturing the Scanner): Likewise.
2317 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
2319 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
2321 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
2322 the data size is known to be too small and we can't increase it.
2323 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
2325 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
2327 * src/parse-gram.y: Include quotearg.h.
2328 (string_as_id): Quote $1 before using it as a key, since the
2329 lexer no longer quotes it for us.
2330 (string_content): Don't strip quotes, since lexer no longer
2332 * src/scan-gram.l: Include quotearg.h.
2334 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
2335 a key, since the rest of the lexer doesn't quote it.
2336 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
2337 * tests/regression.at (Token definitions): Check for backslashes
2340 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
2341 (YYSIZE_T): Define to unsigned long int when using an older compiler.
2342 (yyparse): Revamp code to generate long syntax error message, to
2343 make it easier to translate, and to avoid problems with arithmetic
2344 overflow. Change "virtual memory" to "memory" in diagnostic, since
2345 we don't know whether the memory is virtual.
2347 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
2349 * NEWS: Bison-generated C parsers now use the _ macro to
2351 * data/yacc.c (_) [!defined _]: New macro.
2352 All English strings wrapped inside this macro.
2353 * doc/bison.texinfo (Bison Parser): Document _.
2354 * po/POTFILES.in: Include src/parse-gram.c, since it now
2355 includes translateable strings that parse-gram.y doesn't.
2357 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
2359 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
2360 reverting the 2004-10-11 change to this function.
2361 (symbol_check_alias_consistency): Don't call symbol_type_set
2362 if the type name is already correct.
2363 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
2365 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
2367 * tests/regression.at (Token definitions): Don't use a token named
2368 c, as that generates a "#define c ..." that runs afoul of buggy
2369 stdlib.h that uses the identifier c as a member of struct
2370 drand48_data. Problem reported by Horst Wente.
2372 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
2374 * bootstrap: Change translation URL from
2375 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
2376 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
2377 redirection glitches. Problem reported by twlevo@xs4all.nl.
2379 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
2381 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
2382 after operands; POSIX says this isn't portable for the c99 command.
2384 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
2386 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
2387 immediately if a data overrun has occurred; this may help us track
2388 down what may be a spurious failure on MacOS.
2390 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
2392 Respond to problems reported by twlevo@xs4all.nl.
2394 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
2396 * src/vcg.h: Comment fix.
2397 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
2398 (G_CMAX): Change to -1 instead of INT_MAX.
2400 * data/yacc.c (yyparse): Omit spaces before #line.
2402 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
2404 * src/tables.c (state_number_to_vector_number): Put it inside an
2405 "#if 0", since it's not currently used. Problem reported by
2408 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
2410 * src/output.c (escaped_output): Renamed from
2411 escaped_file_name_output, since we now use it for symbol tags as
2412 well. All uses changed.
2413 (symbol_destructors_output, symbol_printers_output):
2414 Escape symbol tags too.
2415 Problem reported by Matyas Forstner in
2416 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
2418 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
2420 * src/output.c (user_actions_output, token_definitions_output,
2421 symbol_destructors_output, symbol_printers_output): Likewise.
2422 * src/reader.c (prologue_augment): Likewise.
2423 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
2425 * src/vcg.c (output_edge): Don't quote linestyle arg.
2426 Problem reported by twlevo@xs4all.nl.
2428 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
2430 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
2431 example, reported by Derek M Jones. Also, make the example even
2432 more outrageous, to better illustrate how bad the problem is.
2434 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
2436 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
2437 putsym. Typo reported by Sebastian Piping.
2439 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
2441 * doc/bison.texinfo (Language and Grammar): some -> same
2442 (Epilogue): int he -> in the
2443 Typos reported by Sebastian Piping via Justin Pence.
2445 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
2447 * tests/glr-regression.at (Improper handling of embedded actions
2448 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
2449 embedded actions and $-N in GLR parsers", work around an Autoconf bug
2450 with dollar signs in test names.
2451 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
2452 for a similar reason.
2454 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
2456 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
2457 wants to redefine G_VIEW.
2459 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
2461 * src/vcg.c (get_view_str): Remove case for normal_view.
2462 Problem reported by twlevo@xs4all.nl.
2464 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
2466 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
2467 Problem reported by twlevo@xs4all.nl.
2469 * doc/bison.texinfo: Change @dircategory from "GNU programming
2470 tools" to "Software development". Requested by Richard Stallman
2473 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
2475 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
2476 Problem reported by twlevo@xs4all.nl.
2478 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
2480 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
2481 keyword; it's not needed with modern compilers, and it doesn't
2482 affect correctness with older compilers. Suggested by
2485 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
2487 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
2488 gcc -Wswitch-default.
2489 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
2490 * data/yacc.c (yyparse): Likewise.
2492 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
2494 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
2495 already. Let config.h define any nonstandard values.
2497 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
2499 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
2500 for the benefit of slower hosts. Problem reported by
2503 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
2505 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
2506 being defined and not used.
2507 * data/lalr1.cc (yyparse): Likewise.
2508 Use "if (false)" rather than "if (0)".
2510 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
2512 * TODO: Mention that we should allow NUL bytes in tokens.
2514 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
2516 * src/scan-skel.l (<<EOF>>): Don't close standard output.
2517 Problem reported by Hans Aberg.
2519 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
2521 * src/getargs.c (version): Happy new year; update overall
2522 program copyright date from 2004 to 2005.
2524 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
2525 Problem reported by Hans Aberg.
2526 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
2527 (Output file names.): Add a test for the case when standard output
2530 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
2532 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
2533 to fix an oversight in the Bison 2.0 manual.
2535 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
2537 * NEWS: Version 2.0. Reformat the existing news items since
2538 1.875, so that related items are grouped together.
2539 * configure.ac (AC_INIT): Bump version to 2.0.
2540 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
2542 * tests/torture.at (Exploding the Stack Size with Alloca): Set
2543 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
2544 otherwise, we're not testing alloca. Unfortunately there's no
2545 simple way to consult HAVE_ALLOCA here.
2547 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
2550 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
2551 hand. This avoids a warning about comparing int to size_t when
2552 GCC warnings are enabled.
2554 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
2556 * NEWS: Bison-generated parsers no longer default to using the
2557 alloca function (when available) to extend the parser stack, due
2558 to widespread problems in unchecked stack-overflow detection.
2559 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
2560 responsibility to set it to a positive value. This lets the user
2561 specify a value that is not a preprocessor constant.
2562 * data/yacc.c (YYMAXDEPTH): Likewise.
2563 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
2564 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
2565 to be a compile-time constant. However, explain the constraints on it.
2566 Also, explain the constraints on YYINITDEPTH.
2567 (Table of Symbols): Explain that alloca is no longer the default.
2568 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
2571 * doc/bison.texinfo (Location Default Action): Mention that n must
2572 be zero when k is zero. Suggested by Frank Heckenbach.
2574 2004-12-22 Akim Demaille <akim@epita.fr>
2576 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
2577 (parser::state_type, parser::semantic_type, parser::location_type):
2578 Private, not public.
2579 (parser::parse): Return ints, not bool.
2580 Returning a bool introduces a problem: 0 corresponds to false, and
2581 it seems weird to return false on success. Returning true changes
2582 the conventions for yyparse.
2583 Alternatively we could return void and send an exception.
2584 There is no clear consensus (yet?).
2585 (state_stack, semantic_stack, location_stack): Rename as...
2586 (state_stack_type, semantic_stack_type, location_stack_type): these.
2587 Private, not public.
2588 * tests/c++.at: New.
2589 * tests/testsuite.at, tests/Makefile.am: Adjust.
2591 2004-12-21 Akim Demaille <akim@epita.fr>
2593 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
2595 2004-12-21 Akim Demaille <akim@epita.fr>
2597 Don't impose std::string for filenames.
2599 * data/lalr1.cc (b4_filename_type): New.
2600 (position::filename): Use it.
2601 (parser.hh): Move the inclusion of stack.hh and location.hh below
2602 the user code, so that needed headers for the filename type can be
2604 Forward declare them before the user code.
2605 * tests/Makefile.am (check-local, installcheck-local): Pass
2606 TESTSUITEFLAGS to the TESTSUITE.
2608 2004-12-20 Akim Demaille <akim@epita.fr>
2610 Use more STL like names: my_class instead of MyClass.
2612 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
2613 (SemanticStack, SemanticType, StateStack, StateType)
2614 (TokenNumberType, Stack, Slice, Traits, Parser::location)
2615 (Parser::value): Rename as...
2616 (location_stack, location_type, rhs_number_type, semantic_stack)
2617 (semantic_type, state_stack, state_type, token_number_type, stack)
2618 (slice, traits, parser::yylloc, parser::yylval): these.
2620 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
2622 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
2624 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
2625 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
2627 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
2629 Remove uses of 'short int' and 'unsigned short int'. This raises
2630 some arbitrary limits. It uses more memory but nowadays that's
2631 not much of an issue.
2633 This change does not affect the generated parsers; that's a different
2634 task, as some users will want to conserve memory there.
2636 Ideally we should use size_t to represent all object counts, and
2637 something like ptrdiff_t to represent signed differences of object
2638 counts; but that will require more code-cleanup than I have the
2639 time to do right now.
2641 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
2642 Use size_t, not int or short int, to count objects.
2643 * src/closure.c (nritemset, closure): Likewise.
2644 * src/closure.h (nritemset, closure): Likewise.
2645 * src/nullable.c (nullable_compute): Likewise.
2646 * src/print.c (print_core): Likewise.
2647 * src/print_graph.c (print_core): Likewise.
2648 * src/state.c (state_compare, state_hash): Likewise.
2649 * src/state.h (struct state): Likewise.
2650 * src/tables.c (default_goto, goto_actions): Likewise.
2652 * src/gram.h (rule_number, rule): Use int, not short int.
2653 * src/output.c (prepare_rules): Likewise.
2654 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
2655 errs, reductions): Likewise.
2656 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
2658 * src/tables.c (vector_number, tally, action_number,
2659 ACTION_NUMBER_MINIMUM): Likewise.
2660 * src/output.c (muscle_insert_short_int_table): Remove.
2662 2004-12-17 Akim Demaille <akim@epita.fr>
2664 * data/lalr1.cc: Extensive Doxygenation.
2665 (error_): Rename as...
2666 (error): this, since it is visible to the user.
2668 (Parser::message): Now an automatic variable from...
2669 (Parser::yyreport_syntax_error_): here.
2670 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
2672 * tests/input.at: Escape $.
2674 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
2676 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
2677 Parenthesize rhs to avoid obscure problems with mistakes like
2678 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
2679 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
2680 b4_rhs_location): Likewise.
2681 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
2682 b4_rhs_location): Likewise.
2684 2004-12-16 Akim Demaille <akim@epita.fr>
2686 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
2687 yacc.c: be sure to stay within yycheck_.
2688 * tests/actions.at: Re-enable C++ tests.
2690 2004-12-16 Akim Demaille <akim@epita.fr>
2692 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
2695 2004-12-16 Akim Demaille <akim@epita.fr>
2697 Use #define to handle the %name-prefix.
2699 * data/glr.c, data/yacc.c: Comment changes.
2700 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
2701 so that one can refer to yylex in the parser file, and have it
2702 renamed, as is the case with other skeletons.
2704 2004-12-16 Akim Demaille <akim@epita.fr>
2706 Move lalr1.cc internals into yy*.
2708 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
2709 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
2710 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
2711 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
2712 (empty_, final_, terror_, errcode_, ntokens_)
2713 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
2714 (looka_, ilooka_, error_range_, nerrs_):
2716 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
2717 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
2718 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
2719 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
2720 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
2721 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
2722 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
2723 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
2726 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
2728 Fix some problems reported by twlevo at xs4all.
2729 * src/symtab.c (symbol_new): Report an error if the input grammar
2730 contains too many symbols. This is better than calling abort() later.
2731 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
2732 (struct node, struct graph):
2733 Rename member expand to stretch. All uses changed.
2734 (struct graph): Remove member layoutalgorithm. All uses removed.
2735 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
2736 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
2738 (N_STRETCH): Rename from N_EXPAND. All uses changed.
2740 2004-12-15 Akim Demaille <akim@epita.fr>
2742 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
2743 Add more Doxygen comments.
2744 (symprint_, stack_print_, reduce_print_, destruct_, pop)
2745 (report_syntax_error_, translate_): Rename as...
2746 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
2747 (yypop_, yyreport_syntax_error_, yytranslate_): this.
2749 2004-12-15 Akim Demaille <akim@epita.fr>
2751 * data/lalr1.cc (lex_): Rename as...
2753 Move the trace here.
2754 Take the %name-prefix into account.
2755 Reported by Alexandre Duret-Lutz.
2757 2004-12-15 Akim Demaille <akim@epita.fr>
2759 Simplify the C++ parser constructor.
2761 * data/lalr1.cc (debug_): Rename as...
2762 (yydebug_): so that the parser's internals are always in the yy*
2765 (b4_parse_param_decl): Remove the leading comma as it is now only
2766 called as unique argument list.
2767 (Parser::Parser): Remove the constructor accepting a location and
2768 an initial debugging level.
2769 Remove from the other ctor the argument for the debugging level.
2770 (debug_level_type, debug_level, set_debug_level): New.
2772 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
2775 2004-12-15 Akim Demaille <akim@epita.fr>
2777 Remove b4_root related material: failure experiment
2778 (which goal was to allow to derive from a class).
2780 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
2781 definitions and uses.
2783 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
2785 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
2786 not 2, since it's not portable to subtract 1 from the start of an
2787 array. The new item 0 is never set or used. All uses changed.
2789 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
2790 the default definition of YYLLOC_DEFAULT. Problem reported
2791 by Frank Heckenbach.
2793 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
2795 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
2796 the normal case and one for the error case. Just use the
2797 first one uniformly. Problem reported by Frank Heckenbach.
2798 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
2799 use exactly the same macro in both places.
2800 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
2801 so that the normal-case YYRHSLOC works for the error case too.
2803 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
2804 (YYLLOC_DEFAULT): Use the same macro as glr.c.
2805 * doc/bison.texinfo (Location Default Action): Don't claim that
2806 we have an array of locations. Use the same macro for both glr
2807 and lalr parsers. Mention YYRHSLOC. Mention what happens when
2810 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
2812 * HACKING: Update email addresses to send announcements to.
2814 * configure.ac (AC_INIT): Bump version to 1.875f.
2816 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
2818 * NEWS: Version 1.875e.
2819 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
2821 * src/scan-skel.l: Include "complain.h", for "fatal".
2823 * src/relation.h (relation_print, relation_digraph):
2824 Relation sizes are of type relation_node, not size_t (this is
2825 merely a doc fix, since the two types are equivalent).
2826 (relation_transpose): Relation sizes are of type relation_node,
2828 * src/relation.c: Likewise.
2829 (top, infinity): Now of type relation_node, not int.
2830 (traverse, relation_transpose): Use relation_node, not int.
2832 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
2833 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
2834 (yyparse): Remove unused local introduced in 2004-10-25 patch.
2836 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
2837 specifying whether the test should be skipped. Use it tp
2838 specify that the [%defines %skeleton "lalr1.cc"] tests currently
2839 fail on some hosts, and should be skipped.
2841 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2843 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
2844 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
2845 unless otherwise specified below.
2847 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
2848 to allocate kernel_base, kernel_items, kernel_size, since
2849 they needn't be initialized to 0.
2850 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
2851 * src/closure.c (new_closure): Likewise, for itemset.
2852 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
2853 * src/lalr.c (set_goto_map): Likewise, for temp_map.
2854 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
2855 (build_relations): Likewise for edge, states1, includes.
2856 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
2857 * src/reader.c (packgram): Likewise, for ritem, rules.
2858 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
2859 * src/relation.c (relation_digraph): Likewise for VERTICES.
2860 (relation_transpose): Likewise for new_R, end_R.
2861 * src/symtab.c (symbols_token_translations_init): Likewise for
2863 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
2864 (token_actions): Likewise for yydefact, actrow, conflrow,
2866 (save_column): Likewise for froms[symno], tos[symno].
2867 (goto_actions): Likewise for state_count.
2868 (pack_table): Likewise for base, pos, check.
2869 (tables_generate): Likewise for width.
2871 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
2872 for initial core. Just have a separate core, so we needn't worry
2873 about whether kernel_size and kernel_base are initialized.
2875 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
2876 kernel_size, kernel_items): Remove unnecessary initialization.
2877 * src/conflicts.c (conflicts): Likewise.
2878 * src/derives.c (derives): Likewise.
2879 * src/muscle_tablc (muscle_insert): Likewise.
2880 * src/relation.c (relation_digraph): Likewise.
2881 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
2882 conflrow, conflict_table, conflict_list, table, check):
2885 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
2886 This is because all callers pass unsigned int.
2887 * src/closure.h (new_closure): Likewise.
2889 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
2890 (build_relations): Initialize includes[i] in all cases.
2891 * src/reader.c (packgram): Always initialize rules[ruleno].prec
2892 and rules[ruleno].precsym. Initialize members in order.
2893 * src/relation.c (relation_transpose): Always initialize new_R[i]
2895 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
2897 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
2898 conflict_list[0] was always 0, but now it isn't initialized.
2900 * src/table.c (table_grow): When conflict_table grew, the grown
2901 area wasn't cleared. Fix this.
2903 * lib/.cvsignore: Add strdup.c, strdup.h.
2904 * m4/.cvsignore: Add strdup.m4.
2906 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
2908 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
2909 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
2910 GOTO_NUMBER_MAXIMUM, since we occasionally compute
2911 ngotos + 1 without checking for overflow.
2912 (build_relations): Use END_NODE, not -1, to denote end of edges.
2913 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
2914 build_relations): Use goto_number, not int, for goto numbers.
2915 * src/tables.c (save_column, default_goto): Likewise.
2917 2004-11-23 Akim Demaille <akim@epita.fr>
2919 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
2920 of #defining from yystype.
2921 Don't typedef yystype, C++ does not need it.
2922 This lets it possible to forward declare it as union.
2924 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
2926 * bootstrap (gnulib_modules): Add extensions.
2927 Problem reported by Jim Meyering.
2929 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
2931 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
2932 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
2933 src/system.h, src/tables.c: XFREE -> free, to accommodate
2934 recent change to gnulib xalloc.h.
2935 Problem reported by Jim Meyering.
2937 2004-11-17 Akim Demaille <akim@epita.fr>
2939 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
2941 2004-10-28 Akim Demaille <akim@epita.fr>,
2942 Alexandre Duret-Lutz <adl@gnu.org>
2944 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
2947 Use it instead of cdebug_.
2948 (Parser::debug_stream, Parser::set_debug_stream): New.
2949 (Parser::symprint_): Define cdebug_ for temporary backward
2951 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
2954 2004-11-17 Akim Demaille <akim@epita.fr>
2956 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
2957 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
2958 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
2959 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
2961 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
2963 * data/glr.c (yyloc_default): Remove; not used.
2964 Problem reported by Frank Heckenbach.
2966 2004-10-25 Akim Demaille <akim@epita.fr>
2968 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
2969 Introduce another definition to address simple location arrays.
2970 (yyGLRStack): New member: yyerror_range.
2971 (yyrecoverSyntaxError, yyparse): Update it.
2972 (yyrecoverSyntaxError): Use it when shifting the error token to
2973 have an accurate range, equivalent to the one computed by both
2974 yacc.c and lalr1.cc.
2975 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
2976 that column numbers start at column 0, as per GNU Coding
2977 Standards, the others tests, and the doc.
2978 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
2979 Adjust to the above change (first column is 0).
2980 And adjust the location of the "<error>", now covering the whole
2983 2004-10-22 Akim Demaille <akim@epita.fr>
2984 and Paul Eggert <eggert@cs.ucla.edu>
2986 Remove some arbitrary limits on goto numbers and relations.
2987 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
2988 initial values, since they're never used.
2989 (set_goto_map): ngotos is now unsigned, so test for overflow
2990 by seeing whether it wraps around to zero.
2991 * src/lalr.h (goto_number): Now size_t, not short int.
2992 (GOTO_NUMBER_MAXIMUM): Remove.
2993 * src/relation.c (relation_print, traverse, relation_transpose):
2994 Check for END_NODE rather than looking at sign.
2995 * src/relation.h (END_NODE): New macro.
2996 (relation_node): Now size_t, not short int.
2998 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
3000 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
3001 keyword, not an identifier. Problem reported by Baron Schwartz in
3002 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
3004 2004-10-11 Akim Demaille <akim@epita.fr>
3006 * src/symtab.c (symbol_check_alias_consistency): Also check
3007 type names, destructors, and printers.
3008 Reported by Alexandre Duret-Lutz.
3009 Recode the handling of associativity and precedence in terms
3010 of symbol_precedence_set.
3011 Accept no redeclaration at all, not even equal to the previous
3013 (redeclaration): New.
3014 Use it to factor redeclaration complaints.
3015 (symbol_make_alias): Don't set the type of the alias, let
3016 symbol_check_alias_consistency do it as for other features.
3017 * src/symtab.h (symbol): Add new member prec_location, and
3019 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
3020 * tests/input.at (Incompatible Aliases): New.
3022 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
3024 .cvsignore fixes to accommodate gnulib changes,
3025 and the practice of naming build directories "_build".
3026 * .cvsignore: Add "_*". Sort.
3027 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
3028 * m4/.cvsignore: Add "*_gl.m4".
3030 2004-10-06 Akim Demaille <akim@epita.fr>
3032 * src/parse-gram.y (add_param): Fix the truncation of trailing
3035 2004-10-05 Akim Demaille <akim@epita.fr>
3037 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
3038 whether the reducion was empty or not. This leaves room to
3039 improve the use of YYLLOC_DEFAULT in such a case.
3040 lalr1.cc is still experimental, so changing this is acceptable.
3041 And finally, there are probably not many users who changed the
3042 handling of locations in GLR, so changing is admissible too.
3044 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
3045 empty reduction, set @$ to an empty location ending the previously
3047 Adjust uses to make sure the code is triggered on empty
3049 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
3050 expected output: empty reductions have empty locations.
3052 2004-09-29 Akim Demaille <akim@epita.fr>
3054 * data/lalr1.cc: Move towards a more standard C++ coding style
3055 for templates: Class < T > -> Class<T>.
3057 2004-09-29 Akim Demaille <akim@epita.fr>
3059 * data/lalr1.cc: Reinstall the former ctor, for sake of
3060 compatibility, but warn it will be removed.
3061 Move towards a more standard C++ coding style (i.e., type *var ->
3064 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
3066 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
3067 since it's less likely to work if NULs are involved in the future.
3069 2004-09-27 Akim Demaille <akim@epita.fr>
3071 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
3073 2004-09-27 Akim Demaille <akim@epita.fr>
3075 * data/lalr1.cc (b4_parse_param_decl_1): New.
3076 (b4_parse_param_decl): Use it to have different names between attribute
3078 (b4_cc_constructor_call): Likewise.
3080 2004-09-24 Akim Demaille <akim@epita.fr>
3082 * src/parse-gram.y (add_param): Strip the leading and trailing
3083 blanks from a formal argument declaration.
3084 (YY_LOCATION_PRINT): New.
3086 2004-09-24 Akim Demaille <akim@epita.fr>
3088 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
3091 2004-09-24 Akim Demaille <akim@epita.fr>
3093 * doc/bison.texinfo (Table of Symbols): Sort.
3095 2004-09-21 Akim Demaille <akim@epita.fr>
3097 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
3098 the useless parentheses.
3099 Suggested by Paul Eggert.
3101 2004-09-20 Akim Demaille <akim@epita.fr>
3103 Let the initial-action act on the look-ahead, and use it for the
3104 "initial push" (corresponding to an hypothetical beginning-of-file).
3105 And let lalr1.cc honor %initial-action.
3107 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
3109 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
3110 (Parser::Parser): Remove the ctor that used to initialize it.
3111 (Parser::parse): Like in the other skeletons, issue the "starting
3112 parse" message before any action.
3113 Honor %initial-action.
3114 Initialize the stacks with the lookahead.
3115 * data/yacc.c: Let $$ and @$ in %initial-action designate the
3117 Push them in the stacks.
3118 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
3120 2004-09-20 Akim Demaille <akim@epita.fr>
3122 * doc/bison.texinfo (Initial Action Decl): New.
3124 2004-09-20 Akim Demaille <akim@epita.fr>
3126 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
3127 clearer criterion to define it.
3128 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
3129 When reducing on an empty RHS, use the latest stacked location as
3131 yylloc is not always available.
3132 * data/glr.c: Likewise.
3133 Also, honor initial-actions.
3135 2004-09-20 Akim Demaille <akim@epita.fr>
3137 * data/yacc.c (YY_LOCATION_PRINT): New.
3138 Define when we know YYLTYPE's structure, i.e., when the default
3139 YYLLOC_DEFAULT is used.
3140 * data/c.m4 (b4_yysymprint_generate): Use it.
3141 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
3142 value of the result.
3143 (error_start_): Replace with...
3144 (error_range_): this location array.
3145 This allows to replace code relying on the implementation of
3146 locations by portable code.
3147 * data/yacc.c (yylerrsp): Replace with...
3148 (yyerror_range): this.
3149 Every time a token is popped, update yyerror_range[0], to have an
3150 accurate location for the error token.
3151 * data/glr.c (YY_LOCATION_PRINT): New.
3152 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
3153 deference a pointer.
3154 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
3155 report the location in %printers.
3157 * src/scan-skel.l: Instead of abort, report error messages to ease
3158 understanding skeleton scanning failures.
3160 2004-09-16 Akim Demaille <akim@epita.fr>
3162 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
3163 (iterator, const_iterator): these, to be more in the C++ spirit.
3164 Also, return reverse iterators so that when displaying the stack
3165 we display its bottom first.
3166 (Parser::stack_print_, Parser::reduce_print_): Match the messages
3168 We should probably use vector here though.
3170 2004-09-16 Akim Demaille <akim@epita.fr>
3172 Have more complete shift traces.
3174 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
3175 to report Shifts instead of ad hoc YYDPRINTF invocations,
3176 including for the error token.
3177 * data/lalr1.cc (symprint_): Output the location.
3178 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
3179 output the location within the %printer.
3180 Activate GLR tests, at least to make sure they compile properly.
3181 They still don't pass though.
3182 * tests/calc.at: Adjust expect verbose output, since now "Entering
3183 state..." is on a different line than the "Shifting" message.
3185 2004-09-08 Akim Demaille <akim@epita.fr>
3187 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
3188 Bison directive from the Bison file to the invocation of this
3189 macro, so that these directives are passed to
3190 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
3191 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
3192 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
3193 the extra Bison directives instead of the whole series.
3194 Change the grammar so that there are recoverable errors, and
3195 unrecoverable errors. Now we can have the parser give up before
3196 consuming the whole input. As a result we now can observe that
3197 the lookahead is freed when needed.
3198 Change the parser source to parse argv[1] instead of a hard coded
3200 Simplify yylex, and give a value and location to EOF.
3201 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
3202 passed directives already coded in the file.
3203 Add some tests to check the location of "error".
3204 For some tests, the C++ parser is correct, and not yacc.c.
3205 For other tests, they provide different, but unsatisfying, values,
3206 so keep the C++ value so that at least one parser is "correct"
3207 according to the test suite.
3208 (Actions after errors): Remove, this is subsumed by the
3209 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
3211 2004-09-06 Akim Demaille <akim@epita.fr>
3213 * data/lalr1.cc: Adjust the indentation of the labels.
3217 2004-09-06 Akim Demaille <akim@epita.fr>
3219 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
3220 argument, an informative message.
3221 Call YY_SYMBOL_PRINT.
3222 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
3223 * data/lalr1.cc (destruct_): Likewise.
3224 In addition, no longer depend on b4_yysymprint_generate and
3225 b4_yydestruct_generate to generate these functions, do it "by
3228 2004-09-03 Akim Demaille <akim@epita.fr>
3230 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
3231 invoked, yydestruct the lookahead.
3232 * tests/calc.at (Calculator $1): Update the expected lengths of
3233 traces: there is an added line for the discarded lookahead.
3234 * doc/bison.texinfo (Destructor Decl): Some rewording.
3235 Define "discarded" symbols.
3237 2004-09-02 Akim Demaille <akim@epita.fr>
3239 * data/lalr1.cc (translate_, destruct_): No reason to be static.
3241 2004-09-02 Akim Demaille <akim@epita.fr>
3243 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
3244 (YYDSYMPRINTF): Rename as...
3245 (YY_SYMBOL_PRINT): this.
3246 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
3248 Use it instead of direct symprint_ calls.
3249 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
3252 2004-09-02 Akim Demaille <akim@epita.fr>
3254 * data/lalr1.cc (b4_yysymprint_generate): New.
3255 (symprint_): New member function, defined when YYDEBUG.
3256 Use it consistently instead of token/nterm debugging output by
3258 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
3259 %printer calls to use cdebug_ when using lalr1.cc.
3261 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
3263 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
3264 with #ifdef YYDEBUG.
3266 2004-08-26 Akim Demaille <akim@epita.fr>
3268 * doc/bison.texinfo (Implementing Loops): Rename as...
3269 (Implementing Gotos/Loops): this.
3271 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
3273 Adjust to latest gnulib.
3274 * bootstrap (gnulib_modules): Add xalloc-die.
3275 Set LC_ALL=C so that file names sort consistently.
3276 Prefer the gnulib copies of gettext.m4, glibc21.m4,
3277 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
3278 uintmax_t.m4, ulonglong.m4.
3279 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
3280 po.m4 since we are now using _gl.m4 instead.
3282 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
3284 * src/scan-action.l: Remove. Scanning of semantic actions is
3285 handled in scan-gram.l.
3287 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
3289 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
3291 * src/location.h (struct): The file member is a uniqstr.
3292 (equal_boundaries): Use UNIQSTR_EQ for comparison.
3294 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
3296 Fix bug with non-%union parsers that have printers or destructors,
3297 which led to a Bison core dump. Reported by Peter Fales in
3298 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
3300 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
3301 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
3302 not to our own type.
3303 * src/output.c (symbol_destructors_output, symbol_printers_output):
3304 Don't assume %union.
3305 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
3306 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
3307 UNION-FLAG. All callers changed.
3308 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
3309 Use type char, not unsigned int, when declaring an array of char;
3310 this lets us remove a cast.
3311 (Printers and Destructors): Add non-%union test cases.
3313 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
3315 * doc/bison.texinfo: Minor editorial changes, mostly to the new
3316 GLR writeups. E.g., avoid frenchspacing and the future tense,
3317 change "lookahead" to "look-ahead", and change "wrt" to "with
3320 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3322 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
3323 New sections, split off from the GLR Parsers section. Put the new
3324 Simple GLR Parser near the start of the GLR section, for clarity.
3325 Rewrite connective text.
3327 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
3329 * doc/bison.texinfo (Simple GLR Parsers): New section.
3331 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
3333 * NEWS, TODO, doc/bison.texinfo:
3334 Use "look-ahead" instead of "lookahead", to be consistent.
3335 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
3336 while we're fixing "look-ahead".
3337 * src/conflicts.c (shift_set): Renamed from shiftset.
3338 (look_ahead_set): Renamed from lookaheadset.
3339 * src/print.c: Likewise.
3340 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
3341 name for "lookahead".
3342 (report_types, usage): Likewise.
3343 * src/getargs.h (report_look_ahead_tokens): Renamed from
3345 * src/lalr.c (compute_look_ahead_tokens): Renamed from
3347 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
3348 (look_ahead_tokens_print): Renamed from lookaheads_print.
3349 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
3350 state_rule_lookaheads_print.
3351 * src/state.h: Likewise.
3352 (reductions.look_ahead_tokens): Renamed from lookaheads.
3353 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
3354 AT_DATA_LOOKAHEADS_GRAMMAR.
3356 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
3358 * README: Update location of patched M4 distribution.
3360 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
3362 Don't assume the C++ compiler takes the same arguments as the C compiler
3364 * configure.ac (O0CXXFLAGS): New var.
3365 * tests/atlocal.in (CXXFLAGS): Use it.
3367 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
3369 Fix some "make check" problems with C++ reported by
3370 Albert Chin-A-Young for Tru64 C++ in this thread:
3371 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
3373 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
3374 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
3375 Output to a .cc file for C++, not to a .c file.
3376 * tests/calc.at (AT_CHECK_CALC): Likewise.
3377 * tests/regression.at (AT_CHECK_DANCER): Likewise.
3378 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
3380 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
3382 * tests/calc.at, tests/actions.at: Workaround for SGI
3383 C++ compiler. (trivial change)
3385 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
3387 Spent a few hours checking out which prerequisite versions the
3388 current sources actually require. I went all the way back to
3389 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
3390 a seemingly endless set of combinations of versions more recent
3391 than that. The bottom line is that the current sources require
3392 fairly recent versions of the build tools, and it'll be some work
3394 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
3395 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
3396 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
3397 Add comments explaining why those particular versions are
3400 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
3401 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
3402 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
3404 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
3405 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
3407 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
3409 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
3410 0.11.5. Suggested by Bruno Haible.
3411 * bootstrap: Remove gettext version checking.
3413 * doc/bison.texinfo (Decl Summary): Also mention that %union
3414 can depend on prerequisite types. Problem reported by Tim
3417 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
3419 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
3420 * README-alpha: Don't tell people not to package this.
3422 * bootstrap: Don't assume $(...) works; use `...` instead.
3423 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
3426 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
3427 put into the -d output file, and mention what to do if YYSTYPE is
3430 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
3432 Undo change made earlier today: it caused autopoint to not bring
3433 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
3436 * bootstrap: Check that gettext version matches what's in
3437 configure.ac. Warn users to ignore robots.txt ERROR 404.
3438 * bootstrap: Undo today's earlier change (logged below).
3439 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
3441 The gettext version checking is causing more trouble than it's
3442 curing; remove it. Problem reported by Paul Hilfinger.
3444 * bootstrap: Issue a warning that one can expect a message
3445 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
3446 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
3448 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
3450 Ensure that the C++ compiler used for testing actually works on a
3451 simple test program; if not, skip the C++-related tests. Problem
3452 reported by Vin Shelton in:
3453 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
3455 * m4/cxx.m4: New file.
3456 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
3457 * tests/atlocal.in (BISON_CXX_WORKS): Add.
3458 * tests/local.at (AT_COMPILE_CXX): Use it.
3460 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
3462 * data/glr.c (yylloc): Output this macro even if locations are not
3463 being generated, as the GLR parser needs it even in that case.
3464 Problem reported by Troy A. Johnson
3465 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
3467 * configure.ac (AC_INIT): Update to 1.875e.
3469 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
3471 * NEWS: Version 1.875d.
3472 * configure.ac (AC_INIT): Likewise.
3473 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
3475 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
3476 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
3477 lalr1.cc runs afoul of the first, and the last two are no longer
3478 supported by GCC 3.4.0.
3479 * README: Mention GNU m4 1.4 or later; mention m4 patches.
3480 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
3482 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
3484 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
3485 unsigned int, for compatibility with latest gnulib hash module.
3486 * src/state.c (state_hash, state_hasher): Likewise.
3487 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
3488 * src/uniqstr.c (hash_uniqstr): Likewise.
3490 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
3492 * NEWS: Unescaped newlines are no longer allowed in char & strings.
3494 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
3495 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
3496 character and string literals.
3497 (unexpected_end): New function.
3498 (unexpected_eof): Use it.
3499 (unexpected_newline): New function.
3500 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
3503 * NEWS: Document %expect-rr.
3505 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
3506 Fix typo by replacing $1 with $option.
3507 Remove more 'intl'-related files.
3508 Don't DEFUN AM_INTL_SUBDIR twice.
3510 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
3511 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
3513 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
3514 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
3515 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
3516 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
3517 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
3518 * src/.cvsignore: Add *.output.
3520 * src/parse-gram.y: Put copyright notice inside %{ %} so it
3521 gets copied to the output file.
3523 2004-04-28 Paul Eggert <eggert@twinsun.com>
3525 Get files from the gnulib and po repositories, instead of relying
3526 on them being in our CVS. Upgrade to latest versions of gnulib
3529 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
3530 * bootstrap: Bootstrap from gnulib and po repositories.
3531 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
3532 * README-cvs: Document these changes. Remove version numbers from
3533 mentions of build tools, since they change so often. Mention Flex.
3535 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
3536 (gl_USE_SYSTEM_EXTENSIONS): Add.
3537 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
3538 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
3540 (AC_ISC_POSIX): Remove; we no longer support this
3541 ancient OS, as it gets in the way of latest Autoconf & gnulib.
3542 (AC_HEADER_STDC): Remove: we now assume C89 or better.
3543 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
3544 Do not check for C89 headers, except for locale.h which is used
3545 by the Yacc library and must port to K&R hosts.
3546 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
3547 Do not check for C89 functions, except for setlocale which is
3548 used by the Yacc library.
3549 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
3550 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
3551 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
3552 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
3553 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
3554 AM_GNU_GETTEXT): Remove; now done by:
3555 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
3556 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
3559 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
3560 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
3561 Define to empty, as gnulib.mk will do the rest for us.
3562 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
3564 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
3565 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
3567 * src/files.c: Include gnulib's xstrndup.h.
3569 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
3570 (REALLOC): Use xnrealloc, for likewise.
3571 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
3572 (strnlen, memrchr): Remove decls; functions no longer used.
3575 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
3576 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
3577 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
3578 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
3579 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
3580 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
3581 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
3582 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
3583 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
3584 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
3585 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
3586 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
3587 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
3588 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
3589 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
3590 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
3591 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
3592 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
3593 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
3594 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
3595 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
3596 Remove, as these files are now generated automatically
3597 by bootstrap or automake.
3599 * po/ChangeLog: Remove: all but one entry was a duplicate
3600 of this file, and I moved that 2000-11-02 entry here.
3602 * config/.cvsignore: Add Makefile, depcomp, install-sh.
3603 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
3604 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
3605 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
3606 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
3607 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
3608 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
3609 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
3610 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
3611 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
3612 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
3614 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
3615 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
3616 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
3617 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
3618 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
3619 * src/.cvsignore: Remove *_.c.
3622 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
3623 support it. (The latest stable gzip doesn't.)
3625 2004-04-27 Paul Eggert <eggert@twinsun.com>
3627 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
3628 case, as stos_ is now used by destructors due to the 2004-02-09
3631 Remove more K&R C support.
3632 * lib/libiberty.y (PARAMS): Remove. All uses removed.
3633 * lib/subpipe.c (errno): Remove decl.
3634 Include <stdlib.h> unconditionally.
3635 (EXIT_FAILURE): Remove macro.
3636 * src/complain.c (vfprintf, strerror): Remove.
3637 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
3639 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
3640 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
3641 (strchr, strspn, memchr): Remove decls.
3642 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
3643 unconditionally. Do not declare perror.
3644 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
3647 * src/complain.c (_): Remove useless defn, as system.h defines this.
3649 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
3650 with latest obstack.h.
3651 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
3652 to procedure types, as obstack.h now does that for us.
3653 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
3655 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
3656 so that this include file can stand alone.
3657 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
3658 does this now. Include subpipe.h first after config.h, to
3659 test whether it can stand alone.
3661 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
3662 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
3665 * tests/synclines.at (%union synch line): Put a dummy member in
3666 the union, because empty unions aren't allowed in C. Caught
3669 2004-04-13 Jim Meyering <jim@meyering.net>
3671 * src/conflicts.c (conflicts_print): Correct format string typo:
3672 use `%%' to produce literal `%'. (trivial change)
3674 2004-03-30 Paul Eggert <eggert@twinsun.com>
3676 * src/getargs.c (version): Update copyright year to 2004.
3678 * data/c.m4 (b4_int_type): Use 'short int' rather than
3679 'short', and similarly for 'long', 'unsigned', etc.
3680 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
3681 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
3682 yy_yypstack, yydumpstack): Likewise.
3683 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
3684 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
3686 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
3687 yy_stack_print, yyparse): Likewise.
3688 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
3689 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
3690 * lib/bitset.c (bitset_print): Likewise.
3691 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
3692 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3693 * lib/bitsetv.c (bitsetv_dump): Likewise.
3694 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
3695 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
3697 * src/LR0.c (allocate_itemsets): Likewise.
3698 * src/gram.h (rule_number, rule): Likewise.
3699 * src/lalr.h (goto_number): Likewise.
3700 * src/nullable.c (nullable_compute): Likewise.
3701 * src/output.c (prepare_rules): Likewise.
3702 * src/relation.c (relation_print, relation_digraph): Likewise.
3703 * src/relation.h (relation_node): Likewise.
3704 * src/state.h (state_number, transitions, errs, reductions,
3705 struct state): Likewise.
3706 * src/symtab.h (symbol_number, struct symbol): Likewise.
3707 * src/tables.c (vector_number, tally, action_number,
3708 default_goto, goto_actions): Likewise.
3709 * tests/existing.at (GNU Cim Grammar): Likewise.
3710 * tests/regression.at (Web2c Actions): Likewise.
3712 * src/output.c (muscle_insert_short_int_table): Renamed from
3713 muscle_insert_short_table. All uses changed.
3715 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3717 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
3718 (declaration): Replace expected_conflicts with expected_sr_conflicts.
3719 Add %expect-rr rule.
3721 * src/scan-gram.l: Recognize %expect-rr.
3723 * src/conflicts.h (expected_sr_conflicts): Rename from
3725 (expected_rr_conflicts): Declare.
3727 * src/conflicts.c (expected_sr_conflicts): Rename from
3729 (expected_rr_conflicts): Define.
3730 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
3732 Use expected_sr_conflicts in place of expected_conflicts.
3733 Warn if expected_rr_conflicts used in non-GLR parser.
3735 * doc/bison.texinfo: Add documentation for %expect-rr.
3737 2004-03-08 Paul Eggert <eggert@gnu.org>
3739 Add support for hex token numbers. Suggested by Odd Arild Olsen in
3740 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
3742 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
3744 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
3745 * src/scan-gram.l (scan_integer): New function.
3747 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
3748 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
3749 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
3750 Say "long int", not "long", for uniformity with GNU style.
3752 2004-02-25 Paul Eggert <eggert@twinsun.com>
3754 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
3755 compilers. This fixes a problem with Intel's C++ compiler being
3756 chatty, reported by Guido Trentalancia in
3757 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
3759 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
3761 Support %destructor and merge error locations in lalr1.cc.
3763 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
3764 (Parser::stos_): Define unconditionally.
3765 (Parser::destruct_): New method. Generate its body with
3766 b4_yydestruct_generate.
3767 (Parser::error_start_): New attribute.
3768 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
3769 token which are discarded.
3770 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
3771 error_start_ when erroneous token are discarded.
3772 (Parser::parse) <yyerrlab1>: Compute the location of the error
3773 token so that it covers all the discarded tokens.
3774 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
3775 it can be called with `%skeleton "lalr1.cc"', and do that.
3777 2004-02-02 Paul Eggert <eggert@twinsun.com>
3779 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
3780 $(top_srcdir)/lib and ../lib. This fixes a bug reported
3781 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
3782 There's no need to mention top_builddir since Automake does that
3784 (INCLUDES): Remove, as Automake says it's obsolescent.
3785 Contents migrated into AM_CPPFLAGS as described above.
3786 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
3788 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3790 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
3791 (yyreportSyntaxError): Handle case where lookahead token is
3794 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3796 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
3797 resulting parsers are compilable with C++.
3799 2003-12-23 Paul Eggert <eggert@twinsun.com>
3801 * config/depcomp, config/install-sh: Sync with Automake 1.8.
3802 * src/output.c (output_skeleton): Rename local var.
3803 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
3804 Bison tokens, as this runs afoul of the 2003-10-07 change that
3805 disallowed NUL bytes in character constants or string literals.
3807 * tests/local.at: Require Autoconf 2.59's Autotest.
3808 * tests/testsuite.at: Don't include local.at, since we now assume
3809 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
3811 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
3812 multiple inclusion warnings.
3814 2003-12-02 Akim Demaille <akim@epita.fr>
3816 * doc/bison.texinfo (How Can I Reset the Parser): More about start
3820 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
3822 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
3824 2003-10-07 Paul Eggert <eggert@twinsun.com>
3826 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
3827 if testsuite doesn't exist.
3829 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
3830 literals, unfortunately.
3831 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
3832 Complain about NUL bytes in character constants or string literals.
3834 2003-10-05 Paul Eggert <eggert@twinsun.com>
3836 * NEWS: Don't document %no-default-prec, as it's still
3838 * doc/bison.texinfo: Document %no-default-prec only if
3839 the defaultprec flag is set. Normally it's not.
3841 2003-10-04 Paul Eggert <eggert@twinsun.com>
3843 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
3844 non-modifiable lvalue, instead of a modifiable one.
3845 * doc/bison.texinfo (Actions): Document that $$ can
3846 be assigned to. Do not claim that $$ and $N are
3847 array element references: user code should not rely on this.
3849 2003-10-01 Paul Eggert <eggert@twinsun.com>
3851 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
3852 (grammar_declaration): Use it.
3853 * src/scan-gram.l: New token %no-default-prec.
3854 * tests/conflicts.at: Revamp tests to use %no-default-prec.
3855 * NEWS, doc/bison.texinfo: Document the above.
3857 2003-10-01 Akim Demaille <akim@epita.fr>
3859 VCG no longer supports long_straight_phase.
3861 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
3862 * src/print_graph.c (print_graph): Adjust.
3864 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
3865 and Paul Eggert <eggert@twinsun.com>
3867 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
3868 Table of Symbols): Document %default-prec.
3869 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
3870 (grammar_declaration): Set default_prec on %default-prec.
3871 * src/scan-gram.l (%default-prec): New token.
3872 * src/reader.h (default_prec): New flag.
3873 * src/reader.c: Likewise.
3874 (packgram): Handle it.
3875 * tests/conflicts.at (%default-prec without %prec,
3876 %default-prec with %prec, %default-prec 1): New tests.
3878 2003-09-30 Paul Eggert <eggert@twinsun.com>
3880 * tests/testsuite.at: Include local.at, not input.at, fixing
3881 a typo in the 2003-08-25 patch.
3883 2003-08-27 Akim Demaille <akim@epita.fr>
3885 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
3888 2003-08-26 Akim Demaille <akim@epita.fr>
3890 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
3891 "<\#" to avoid magic from Gnus when posting parts of this script.
3893 2003-08-26 Akim Demaille <akim@epita.fr>
3895 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
3896 (Parser::parse): here.
3897 Adjust: nerrs and errstatus is now replaced by...
3898 (Parser::nerrs_, Parser::errstatus_): New.
3900 2003-08-25 Akim Demaille <akim@epita.fr>
3902 * config/announce-gen, Makefile.cfg: New.
3903 * Makefile.am: Adjust.
3904 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
3905 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
3907 2003-08-25 Akim Demaille <akim@epita.fr>
3909 When reducing initial empty rules, Bison parser read an initial
3910 location that is not defined. This results in garbage, and that
3911 affects Bison's own parser. Therefore we need (i) to extend Bison
3912 to support a means to initialize this location, and (ii) to use
3913 this CVS Bison to fix CVS Bison's parser.
3915 * src/reader.h, reader.c (epilogue_augment): Remove, replace
3917 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
3918 * src/parse-gram.y: Adjust.
3919 (%initial-action): New.
3920 (%error-verbose): Since we require CVS Bison, there is no reason
3922 * src/scan-gram.l: Adjust.
3923 * src/Makefile.am (YACC): New, to make sure we use our own parser.
3924 * data/yacc.c (yyparse): Use b4_initial_action.
3926 2003-08-25 Akim Demaille <akim@epita.fr>
3928 * doc/bison.texinfo: Don't promote stdout for error messages.
3930 2003-08-25 Akim Demaille <akim@epita.fr>
3932 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
3933 From Alexandre Duret-Lutz.
3935 2003-08-25 Akim Demaille <akim@epita.fr>
3939 2003-08-25 Akim Demaille <akim@epita.fr>
3941 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
3944 2003-08-25 Akim Demaille <akim@epita.fr>
3946 * data/lalr1.cc (Parser::reduce_print_): New.
3949 2003-08-25 Akim Demaille <akim@epita.fr>
3951 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
3952 error recovery loops. This patch is based on
3953 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
3954 Also, augment the similarity between lalr1.cc and yacc.c.
3955 Note: the locations of error recovery rules are not correct yet.
3957 * data/lalr1.cc: Comment changes to augment the similarity between
3958 lalr1.cc and yacc.c.
3959 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
3960 (yyerrlab1): Remove, but where it used to be (now the bottom part of
3961 yyerrlab), when hitting EOF, pop the whole stack here instead of
3962 merely falling thru the default error handling mechanism.
3963 (yyerrorlab): New label, with the old contents of YYERROR,
3964 plus the following change: pop the stack of rhs corresponding
3965 to the production that invoked YYERROR. That is how Yacc
3966 behaves (required by POSIX).
3967 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
3970 2003-08-25 Akim Demaille <akim@epita.fr>
3972 Tune local.at so that people can "autom4te -l autotest calc.at -o
3973 calc" for instance, to extract a sub test suite.
3975 * tests/testsuite.at: Move the initialization, Autotest version
3976 requirement, and AT_TESTED invocation into...
3977 * tests/local.at: here.
3978 * tests/testsuite.at: Include it for compatibility with Autoconf
3980 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
3983 2003-08-04 Paul Eggert <eggert@twinsun.com>
3985 Rework code slightly to avoid gcc -Wtraditional warnings.
3986 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
3987 The returned value is now stored in *YY0. All callers changed.
3988 * src/output.c (merge_output): Adjust to the above change.
3990 2003-07-26 Paul Eggert <eggert@twinsun.com>
3992 * data/glr.c (YYASSERT): New macro.
3993 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
3994 yyresolveStates, yyprocessOneStack):
3995 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
3996 Derived from a suggestion by Frank Heckenbach.
3998 2003-07-25 Paul Eggert <eggert@twinsun.com>
4000 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
4001 for portability to K&R C (after ansi2knr, presumably). See
4002 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
4003 by Frank Heckenbach, though I have omitted the structure-initialization
4004 part of his glr-knr.diff patch since I recall that the Portable
4005 C Compiler didn't require that change.
4007 Let the user specify how to allocate and free memory.
4008 Derived from a suggestion by Frank Heckenbach in
4009 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
4010 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
4011 All uses of free, malloc, realloc changed to use these macros,
4012 and unnecessary casts removed.
4013 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
4015 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
4017 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
4018 use s.empty() rather than s == "" to test for empty string; see
4019 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
4022 2003-06-25 Akim Demaille <akim@epita.fr>
4024 * config/depcomp, config/install-sh: Update from masters.
4026 2003-06-20 Paul Eggert <eggert@twinsun.com>
4028 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
4029 and return properly parenthesized result.
4030 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
4031 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4032 Remove unnecessary parentheses from uses.
4033 * doc/bison.texinfo (Location Default Action): Describe the
4034 conventions for parentheses.
4036 2003-06-19 Paul Eggert <eggert@twinsun.com>
4038 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
4039 yyreportTree): Do not assume that size_t is the same width as int,
4040 when printing sizes. Print sizes using an unsigned format.
4041 Problem reported by Frank Heckenbach in
4042 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4044 Port to Forte Developer 7 C compiler.
4045 * data/glr.c (struct YYLTYPE): If locations are not being used,
4046 declare a single dummy member, as empty structs do not conform
4048 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
4049 the Forte Developer 7 C compiler complains that end-of-loop
4050 code is not reached.
4052 2003-06-17 Paul Eggert <eggert@twinsun.com>
4054 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
4055 avoid warnings from picky compilers about redefinition of PARAMS.
4057 2003-06-17 Paul Eggert <eggert@twinsun.com>
4061 * NEWS: Document 1.875b.
4063 * lib/bbitset.h: Do not include config.h; that's the includer's job.
4064 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
4065 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
4066 Don't use 'index' in comments, as it's a builtin fn on some hosts.
4067 * lib/bitset_stats.c: Include gettext.h unconditionally, as
4068 per recent gettext manual's suggestion.
4069 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
4070 Use prototypes, not old-style definitions.
4071 * lib/lbitset.c (lbitset_unused_clear): Likewise.
4072 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
4073 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
4074 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
4075 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
4076 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
4077 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
4078 vbitset_or_and_cmp, vbitset_copy): Likewise.
4080 * lib/libiberty.h: Do not include config.h; that's the includer's job.
4081 Do not include <stdlib.h>.
4082 (PARAMS): Define unconditionally for C89.
4083 (ATTRIBUTE_NORETURN): Remove.
4084 (ATTRIBUTE_UNUSED): Define unconditionally.
4086 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
4087 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
4088 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
4089 * lib/vbitset.c, lib/vbitset.h: New files.
4090 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
4091 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
4094 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
4095 `How Can I Reset @code{yyparse}', since texinfo does not allow
4096 arbitrary @ in node names.
4098 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
4099 shouldn't be needed according to the gettext 0.12.1 documentation
4100 but which seem to be needed anyway: codeset.m4 glibc21.m4
4101 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
4102 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
4103 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
4105 * lib/.cvsignore: Add stdbool.h.
4106 * m4/.cvsignore: Add nls.m4, po.m4.
4108 Upgrade to CVS gnulib.
4109 * stdbool_.h: File renamed from stdbool.h.in.
4110 * configure.ac (AM_STDBOOL_H): Invoke this instead of
4112 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
4113 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
4114 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
4115 (MOSTLYCLEANFILES): New var.
4116 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
4117 (stdbool.h): New rule.
4118 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
4119 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
4120 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
4121 m4/quote.m4: Upgrade to today's gnulib.
4123 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
4124 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
4125 the tests right now.
4126 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
4127 yyerror are declared before use; C99 requires this.
4129 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4131 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
4133 (yyrecoverSyntaxError): Correct the logic for setting and testing
4135 Correct comment on handling EOF.
4136 Allow states with only a default reduction, rather than failing
4137 (I can't quite reconstruct why these were not allowed before).
4139 Fixes to avoid problem that $-N rules in GLR parsers can cause
4140 buffer overruns, corrupting state.
4142 * src/output.c (prepare_rules): Output max_left_semantic_context
4144 * src/reader.h (max_left_semantic_context): New variable declaration.
4145 * src/scan-gram.l (max_left_semantic_context): Define.
4146 (handle_action_dollar): Update max_left_semantic_context.
4147 * data/glr.c (YYMAXLEFT): New definition.
4148 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
4149 (yyresolveAction): Ditto.
4151 Fixes to problems with location handling in GLR parsers reported by
4152 Frank Heckenbach (2003/06/05).
4154 * data/glr.c (YYLTYPE): Make trivial if locations not used.
4155 (YYRHSLOC): Add parentheses, and define only if locations used.
4156 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
4158 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
4159 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
4161 * tests/cxx-type.at: Exercise location information; update tests
4162 to differentiate output with and without locations.
4163 Remove forward declarations of yylex and yyerror---caused errors
4164 because default YYLTYPE not yet defined.
4165 Change semantic actions to compute strings, rather than printing
4166 them directly (to test proper passing of semantics values). Change
4167 output to prefix notation and update test data and expected results.
4168 (yylex): Track locations.
4169 (stmtMerge): Return value rather than printing, and include arguments
4172 2003-06-03 Paul Eggert <eggert@twinsun.com>
4174 Avoid warnings generated by GCC 2.95.4 when Bison is
4175 configured with --enable-gcc-warnings.
4176 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
4177 yy::]b4_parser_class_name[::translate_,
4178 yy::Stack::operator[] (unsigned),
4179 yy::Stack::operator[] (unsigned) const,
4180 yy::Slice::operator[] (unsigned),
4181 yy::Slice::operator[] (unsigned) const):
4182 Rename local vars to avoid warnings.
4183 * tests/glr-regression.at (Improper handling of embedded actions
4184 and $-N in GLR parsers): Remove unused local variable from yylex.
4185 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
4186 (void) as arg when not pure, since we now assume C89 when building
4187 Bison. Pacify GCC by using parameter.
4189 2003-06-02 Paul Eggert <eggert@twinsun.com>
4191 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
4192 yy::Location::lines, yy::Location::columns): Rename arguments
4193 to avoid shadowing; this removes a warning generated by GCC 3.3.
4195 2003-06-01 Paul Eggert <eggert@twinsun.com>
4197 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
4198 to g++, as GCC 3.3 complains if you do it.
4199 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
4200 everything that WARNING_CFLAGS has, except omit warnings
4201 not suitable for C++.
4202 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
4203 * tests/atlocal.in (CXXFLAGS): New var.
4204 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
4206 Fix a GLR parser bug I reported in February; see
4207 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
4208 The problem was that GLR parsers did not conform to the C standard,
4209 because actions like { $1 = $2 + $3; } expanded to expressions
4210 that invoked YYFILL in separate subexpressions, and YYFILL assigned
4211 to a local variable. The C standard says that expressions
4212 like (var = f ()) + (var = f ()) have undefined behavior.
4213 Another problem was that GCC sometimes issues warnings that
4214 yyfill and its parameters are unused.
4216 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
4218 (yyfill): New function.
4220 (yyuserAction): Change type of yynormal to bool, so that it matches
4221 the new yyfill signature. Mark it as possibly unused.
4224 Follow up on a bug I reported in February, where a Bison-generated
4225 parser can loop. Provide a test case and a fix for yacc.c. I
4226 don't have a fix for lalr1.cc or for glr.c, unfortunately.
4227 The original bug report is in:
4228 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
4230 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
4231 macro's size was becoming unwieldy.
4232 (yyerrlab): Do not discard an empty lookahead symbol, as this
4233 might destroy garbage.
4234 (yyerrorlab): New label, with the old contents of YYERROR,
4235 plus the following change: pop the stack of rhs corresponding
4236 to the production that invoked YYERROR. That is how Yacc
4237 behaves, and POSIX requires this behavior.
4238 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
4239 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
4240 Define 'alarm' to do nothing if unistd.h is not available.
4241 Add a new rule "exp: '-' error;" to test the above change to
4242 data/yacc.c. Use 'alarm' to abort any test taking longer than
4243 10 seconds, as it's probably looping.
4244 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
4245 Also, the new yacc.c generates two fewer diagnostics for an
4248 2003-05-24 Paul Eggert <eggert@twinsun.com>
4250 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
4251 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
4252 This fixes a problem reported by John Bowman when the Compaq/HP
4253 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
4255 * data/yacc.c (union yyalloc): Likewise.
4256 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
4258 Switch from 'int' to 'bool' where that makes sense.
4260 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
4261 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
4262 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
4263 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
4264 Return or accept bool, not int. All callers changed.
4265 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
4266 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
4267 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
4268 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
4269 bitset_or_and_cmp_): Likewise.
4270 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
4271 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
4272 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
4273 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
4274 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
4275 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
4276 bitset_stats_or_and_cmp): Likewise.
4277 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
4278 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
4279 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
4280 ebitset_xor_cmp): Likewise.
4281 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
4282 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
4283 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
4284 lbitset_xor_cmp): Likewise.
4285 * lib/bbitset.h: Include <stdbool.h>.
4286 (struct bitset_vtable): The following members now return bool, not
4287 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
4288 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
4290 * src/conflicts.c (count_rr_conflicts): Likewise.
4291 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
4293 * lib/ebitset.c (ebitset_obstack_init): Likewise.
4294 * lib/lbitset.c (lbitset_obstack_init): Likewise.
4295 * src/getargs.c (debug_flag, defines_flag, locations_flag,
4296 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
4297 graph_flag): Likewise.
4298 * src/getargs.h (debug_flag, defines_flag, locations_flag,
4299 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
4300 graph_flag): Likewise.
4301 * src/output.c (error_verbose): Likewise.
4302 * src/output.h (error_verbose): Likewise.
4303 * src/reader.c (start_flag, typed): Likewise.
4304 * src/reader.h (typed): Likewise.
4305 * src/getargs.c (LOCATIONS_OPTION): New constant.
4306 (long_options, getargs): Use it.
4307 * src/lalr.c (build_relations): Use bool, not int.
4308 * src/nullable.c (nullable_compute): Likewise.
4309 * src/print.c (print_reductions): Likewise.
4310 * src/tables.c (action_row, pack_vector): Likewise.
4311 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
4312 * src/output.c (prepare): Use it.
4313 * src/output.c (token_definitions_output,
4314 symbol_destructors_output, symbol_destructors_output): Use string,
4315 not boolean integer, to keep track of whether to output separator.
4316 * src/print_graph.c (print_core): Likewise.
4317 * src/state.c (state_rule_lookaheads_print): Likewise.
4319 * config/install-sh: Sync from automake 1.7.5.
4321 2003-05-14 Paul Eggert <eggert@twinsun.com>
4323 * src/parse-gram.y (rules_or_grammar_declaration): Require a
4324 semicolon after a grammar declaration, in the interest of possible
4325 future changes to the Bison input language.
4326 Do not allow a stray semicolon at the start of the grammar.
4327 (rhses.1): Allow one or more semicolons after any rule, including
4328 just before "|" as required by POSIX.
4329 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
4332 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
4334 %parse-param support for lalr1.cc.
4336 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
4337 b4_cc_constructor_calls, b4_cc_constructor_call,
4338 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
4340 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
4341 parse-param arguments.
4342 (yy::b4_parser_class_name): Declare instance variables to
4343 hold parse-param arguments.
4344 * tests/calc.at: s/value/semantic_value/ because value clashes
4345 with a member of yy::b4_parser_class_name. Adjust C++ code
4346 to handle %parse-param. Enable %parse-param test in C++.
4348 2003-05-12 Paul Eggert <eggert@twinsun.com>
4350 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
4351 English a bit. Fix fclose typo. Change "const char" to "char
4352 const", and use ANSI C rather than K&R for "main". Suggest
4353 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
4354 and suggest yy_switch_to_buffer.
4356 2003-05-05 Paul Eggert <eggert@twinsun.com>
4358 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
4359 C89. This avoids a diagnostic on compilers that define __STDC__
4360 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
4361 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
4363 2003-05-03 Paul Eggert <eggert@twinsun.com>
4365 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
4366 Do not overrun array bounds.
4367 This should fix a bug reported today by Olatunji Oluwabukunmi in
4368 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
4370 2003-04-29 Akim Demaille <akim@epita.fr>
4372 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
4373 * src/getargs.c, src/getargs.h: here, as bool, not int.
4374 (nondeterministic_parser): New.
4375 * src/parse-gram.y, src/scan-gram.l: Support
4376 %nondeterministic-parser.
4377 * src/output.c (prepare): Use nondeterministic_parser instead
4378 of glr_parser where appropriate.
4379 * src/tables.c (conflict_row, action_row, save_row)
4380 (token_actions, token_actions, pack_vector): Ditto.
4382 2003-04-29 Akim Demaille <akim@epita.fr>
4384 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
4386 2003-04-29 Akim Demaille <akim@epita.fr>
4388 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
4389 with %pure-parser and %locations to exercise the patch from Yakov
4392 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
4394 * data/yacc.c: (b4_lex_param): Corrected for the case where
4395 %lex-param is provided and %pure-parser isn't.
4397 2003-04-27 Paul Eggert <eggert@twinsun.com>
4399 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
4400 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
4401 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
4402 if it is not defined.
4403 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
4405 2003-04-26 Paul Eggert <eggert@twinsun.com>
4407 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
4408 Declare to be of type suitable for the ninf value itself, not of
4409 type suitable for the corresponding table, since the latter might
4410 be unsigned but the ninf value might be negative. This fixes a
4411 bug reported by Alexandre Duret-Lutz in
4412 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
4414 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
4415 invokes it. We shouldn't invoke it twice because it will attempt
4416 to put error.o in the archive twice. This fixes a glitch reported
4417 by Martin Mokrejs in
4418 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
4420 2003-04-21 Paul Eggert <eggert@twinsun.com>
4422 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
4425 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
4427 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
4428 Fix obvious typo that results in uncompilable GLR parsers
4429 when both %pure-parser and %locations are used. (trivial change)
4431 2003-04-17 Paul Eggert <eggert@twinsun.com>
4433 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
4434 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
4435 Do not insert the expected token via unput, as this runs afoul
4436 of a POSIX-compatibility bug in flex 2.5.31.
4437 All uses changed to BEGIN the parent state,
4438 since we no longer insert the expected token via unput.
4439 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
4440 that is no longer emitted after the above change.
4442 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
4443 the first one. This change is from Paul Hilfinger, and it fixes
4444 regression reported by Werner Lemberg in
4445 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
4447 (resolve_sr_conflict): Don't invoke state_errs_set
4448 unless one or more tokens have been explicitly made errors.
4449 Otherwise, the above change causes Bison to abort.
4451 * tests/existing.at (GNU pic Grammar): New test case, taken from
4454 2003-03-31 Akim Demaille <akim@epita.fr>
4456 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
4458 2003-03-31 Akim Demaille <akim@epita.fr>
4460 * src/output.c (prepare_symbols): Avoid trailing spaces in the
4463 2003-03-31 Akim Demaille <akim@epita.fr>
4465 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
4466 From Paul Hilfinger.
4468 2003-03-29 Akim Demaille <akim@epita.fr>
4470 * m4/error.m4: Do not put under dynamic conditions some code which
4471 expansion is under static control.
4473 2003-03-29 Akim Demaille <akim@epita.fr>
4475 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
4477 2003-03-29 Akim Demaille <akim@epita.fr>
4479 * doc/bison.texinfo (Strings are Destroyed): New.
4481 2003-03-13 Paul Eggert <eggert@twinsun.com>
4483 * .cvsignore: Add configure.lineno.
4484 * src/.cvsignore: Add yacc.
4485 * tests/.cvsignore: Add testsuite.log.
4486 * doc/fdl.texi: Sync with latest FSF version.
4488 2003-03-12 Paul Eggert <eggert@twinsun.com>
4490 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
4491 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
4492 cursor, instead of leaving it undefined. This fixes a bug
4493 reported by Tim Van Holder in
4494 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
4495 * tests/input.at (Torturing the Scanner): Test the scanner on
4496 an empty input file, which was Tim Van Holder's test case.
4498 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
4499 <sys/resource.h> can be included, include sys/time.h and
4500 sys/times.h first, if available. This works around the SunOS
4501 4.1.4 porting bug reported by Bruce Becker in
4502 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
4504 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
4505 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
4508 Merge changes from gnulib. This was prompted because the CVS
4509 snapshot didn't build on Solaris 7 due to strnlen problems.
4511 These changes need to be merged back into gnulib:
4512 * lib/hash.c: Include <stdbool.h> unconditionally.
4513 * m4/onceonly.m4 (m4_quote): New macro.
4514 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
4515 Quote AC_FOREACH variable-expansions properly.
4516 The 2003-01-03 obstack.h change also needs merging.
4517 {end of changes requiring merging}
4519 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
4520 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
4521 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
4522 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
4523 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
4524 New files, imported from gnulib.
4525 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
4528 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
4529 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
4532 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
4534 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
4535 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
4536 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
4537 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
4538 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
4539 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
4540 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
4541 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
4542 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
4543 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
4544 (jm_PREREQ_ARGMATCH): Remove.
4545 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
4546 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
4548 * src/system.h: Include <stdbool.h> unconditionally.
4550 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
4551 assuming at least C89 in the bitset code for some time now.
4553 2003-03-03 Akim Demaille <akim@epita.fr>
4557 2003-03-02 Akim Demaille <akim@epita.fr>
4559 * doc/bison.texinfo (Table of Symbols): Reactivate the
4560 documentation for %lex-param, and %parse-param.
4562 2003-03-02 Akim Demaille <akim@epita.fr>
4564 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
4565 generate verbose error messages.
4566 Use the number of tokens as an upper bound in yytname, as it
4567 cannot be a non terminal.
4569 2003-03-02 Akim Demaille <akim@epita.fr>
4571 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
4574 2003-03-02 Akim Demaille <akim@epita.fr>
4576 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
4577 Use them to exercise yycheck overrun.
4578 Based on Andrew Suffield's grammar.
4580 2003-03-02 Akim Demaille <akim@epita.fr>
4582 Create tests/local.at for Bison generic testing macros.
4584 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
4585 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
4587 * tests/calc.at (AT_CHECK_CALC): Adjust.
4588 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
4589 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
4590 * tests/local.at: here.
4591 (AT_COMPILE_CXX): Tags the tests using it as c++.
4592 Ignore the test if CXX is not functional.
4594 2003-03-01 Paul Eggert <eggert@twinsun.com>
4596 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
4597 not loc->end, since loc->end might contain garbage and this leads
4598 to undefined behavior on some platforms.
4599 (id_loc, token_start): Use (IF_LINTed) initial values that do not
4600 depend on *loc, so that the reader doesn't give the the false
4601 impression that *loc is initialized.
4602 (<INITIAL>"%%"): Do not bother setting code_start, since its value
4603 does not survive the return.
4605 2003-03-01 Akim Demaille <akim@epita.fr>
4607 * src/scan-gram.l (code_start): Always initialize it when entering
4608 into yylex, as SC_EPILOGUE is activated *before* the corresponding
4609 yylex invocation. An alternative would be making it static, but
4610 then it starts with the second %%'s beginning, instead of its end.
4612 2003-02-28 Paul Eggert <eggert@twinsun.com>
4614 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
4615 around a UnixWare 7.1.1 porting bug reported by John Hughes in
4616 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
4618 2003-02-26 Paul Eggert <eggert@twinsun.com>
4620 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
4621 Remove Sequent/Pyramid discussion (nobody uses them any more).
4622 Merge VMS and MS-DOS discussion; these ports may well be dead
4623 but let's keep mentioning them for now. Put <> around email
4624 addresses. Add copyright notice.
4626 2003-02-24 Paul Eggert <eggert@twinsun.com>
4628 * data/glr.c (yy_reduce_print): yylineno -> yylno,
4629 to avoid collision with flex use of yylineno.
4630 Problem reported by Bruce Lilly in
4631 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
4632 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4633 * data/yacc.c (yy_reduce_print): Likewise.
4635 * config/depcomp: Sync with Automake 1.7.3.
4637 2003-02-21 Akim Demaille <akim@epita.fr>
4639 * data/lalr1.cc: Use temporary variables instead of casts to
4640 change integer types.
4641 Suggested by Paul Eggert.
4643 2003-02-21 Akim Demaille <akim@epita.fr>
4645 * doc/bison.texinfo: Use "location" consistently to refer to @n,
4646 to avoid confusions with lalr1.cc's notion of Position.
4647 Suggested by Paul Eggert.
4649 2003-02-20 Akim Demaille <akim@epita.fr>
4651 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
4652 before initial_columns.
4653 (location.hh): Use consistent variable names when defining the
4655 Use "last" so that we subtract from Positions, not from unsigned.
4657 2003-02-20 Akim Demaille <akim@epita.fr>
4659 * data/lalr1.cc (position.hh): New subfile, including the extended
4660 and Doxygen'ed documentation of class Position.
4661 (location.hh): Use it.
4662 Document a` la Doxygen.
4663 With the help of Benoit Perrot.
4665 2003-02-20 Akim Demaille <akim@epita.fr>
4667 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
4669 Redefine AT_YYERROR_SEES_LOC_IF using it.
4670 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
4672 Don't use the location in yy::Parser::error_ and
4673 yy::Parser::print_ when not %locations.
4674 Activate more lalr1.cc tests.
4676 2003-02-19 Akim Demaille <akim@epita.fr>
4678 * data/lalr1.cc: When displaying a line number, be sure to make it
4681 2003-02-19 Akim Demaille <akim@epita.fr>
4683 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
4685 (YYABORT, YYACCEPT, YYERROR): New.
4686 * tests/calc.at: Renable the lalr1.cc test.
4688 2003-02-19 Akim Demaille <akim@epita.fr>
4690 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
4691 error recovery, mixing with/without pops and discarding of the
4694 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
4696 2003-02-17 Paul Eggert <eggert@twinsun.com>
4698 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
4699 * tests/testsuite.at (AT_COMPILE): Use them.
4700 This fixes the testsuite problem reported by Robert Lentz in
4701 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
4703 2003-02-12 Paul Eggert <eggert@twinsun.com>
4705 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
4706 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
4707 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
4708 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
4709 Check for malloc failure, for consistency with yacc.c.
4710 (yytname_size): Remove, for consistency with yacc.c.
4712 The bug still remains in data/lalr1.cc, as I didn't have time
4715 2003-02-06 Akim Demaille <akim@epita.fr>
4717 * configure.ac (GXX): Rename as...
4718 (CXX): this, to keep the original Autoconf semantics.
4720 * data/lalr1.cc: Fix b4_copyright invocations.
4721 If YYDEBUG is not defined, don't depend upon name_ being defined.
4722 (location.hh): Include string and iostream.
4723 (Position::filename): New member.
4724 (Position::Position ()): New.
4725 (operator<< (Position)): New.
4726 (operator- (Position, int)): New.
4727 (Location::first, Location::last): Rename as...
4728 (Location::begin, Location::end): these, to mock the conventional
4730 (operator<< (Location)): New.
4731 * tests/atlocal.in (CXX): New.
4732 * tests/testsuite.at (AT_COMPILE_CXX): New.
4733 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
4734 locations in a more synthetic way.
4735 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
4737 Adjust the C locations to match those from Emacs: first column is
4739 Change all the expected results.
4740 Conform to the GCS: simplify the locations when applicable.
4741 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
4742 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
4743 these CPP macros with the m4 macros new defined by...
4744 (AT_CHECK_PUSHDEFS): this, i.e.:
4745 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
4746 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
4748 (AT_CHECK_POPDEFS): Undefine them.
4749 (AT_CHECK_CALC_LALR1_CC): New.
4750 Use it for the first lalr1.cc test.
4752 2003-02-04 Akim Demaille <akim@epita.fr>
4754 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
4755 Location as is defined.
4757 2003-02-04 Akim Demaille <akim@epita.fr>
4759 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
4760 name_ being defined.
4762 2003-02-03 Paul Eggert <eggert@twinsun.com>
4764 * src/gram.h (start_symbol): Remove unused decl.
4766 Use more-consistent naming conventions for local vars.
4768 * src/derives.c (derives_compute): Change type of local var from
4770 * src/gram.c (grammar_rules_partial_print): Likewise.
4771 * src/print.c (print_core): Likewise.
4772 * src/reduce.c (reduce_grammar_tables): Likewise.
4774 * src/gram.c (grammar_dump): Change name of item_number *
4775 local var from r to rp.
4776 * src/nullable.c (nullable_compute): Likewise.
4778 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
4780 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
4781 for symbol or symbol_number var.
4782 * src/reader.c (grammar_start_symbol_set): Likewise.
4783 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
4785 * src/state.c (transitions_to): Likewise.
4786 * src/state.h: Likewise.
4787 * src/tables.c (symbol_number_to_vector_number): Likewise.
4789 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
4792 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
4795 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
4798 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
4799 Use str, not s, for char * var. Use ch, not c, for character var.
4800 Use size for size var.
4802 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
4804 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
4806 * src/uniqstr.h: Likewise.
4808 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
4809 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
4810 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
4811 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
4812 param to have same name as that of enum, so that we don't use
4813 "s" to stand for a non-state.
4815 2003-02-02 Akim Demaille <akim@epita.fr>
4817 * src/scan-skel.l: Scan more than one inert character per yylex
4820 2003-02-01 Paul Eggert <eggert@twinsun.com>
4824 * po/LINGUAS: Add ms.
4826 2003-01-30 Akim Demaille <akim@epita.fr>
4828 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
4830 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4832 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
4835 Changes in response to error report by S. Eken: GLR mode does not
4836 handle negative $ indices or $ indices in embedded rules correctly.
4837 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
4839 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
4840 (b4_rhs_location): Ditto.
4841 (yyfill): New function to copy from stack tree into array
4843 (yyuserAction): Modify to allow incremental move of semantic values
4844 to rhs array when in GLR mode.
4845 Define YYFILL to use in user-defined actions to fill semantic array
4847 Remove dummy use of yystack, as there is now a guaranteed use.
4848 (yydoAction): Modify to allow incremental move of semantic values
4849 to rhs array when in GLR mode.
4850 (yyresolveAction): Ditto.
4851 (yyglrShiftDefer): Update comment.
4852 (yyresolveStates): Use X == NULL for pointers, not !X.
4853 (yyglrReduce): Ditto.
4856 * tests/glr-regr1.at: Rename to ...
4857 * tests/glr-regression.at: Add new regression test for the problems
4858 described above (adapted from S. Eken).
4859 Update copyright notice.
4860 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
4861 * tests/Makefile.am: Ditto.
4863 2003-01-28 Paul Eggert <eggert@twinsun.com>
4865 * data/lalr1.cc: Do not use @output_header_name@ unless
4866 b4_defines_flag is set. This fixes two bugs reported by
4868 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
4869 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
4871 2003-01-21 Paul Eggert <eggert@twinsun.com>
4873 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
4874 we don't need to worry about yyerrlab1 being reported as an
4875 "unused label" by non-GCC C compilers. The downside is that if
4876 locations are used then a couple of statements are duplicated each
4877 time YYERROR is invoked, but the upside is that the warnings
4879 (yyerrlab1): Move code to YERROR.
4880 (yyerrlab2): Remove. Change uses back to yyerrlab1.
4881 This reverts some of the 2002-12-27 change.
4883 2003-01-17 Paul Eggert <eggert@twinsun.com>
4885 * src/output.c (symbol_printers_output): Fix typo that led
4886 to core dump. Problem reported by Antonio Rus in
4887 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4889 2003-01-13 Akim Demaille <akim@epita.fr>,
4890 Quoc Peyrot <chojin@lrde.epita.fr>,
4891 Robert Anisko <anisko_r@lrde.epita.fr>
4893 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
4894 when the stacks contain one element, as the loop would otherwise
4895 free the last state, and then use the top state (the one we just
4896 popped). This means that the initial elements will not be freed
4897 explicitly, as is the case in yacc.c; it is not a problem, as
4898 these elements have fake values.
4900 2003-01-11 Paul Eggert <eggert@twinsun.com>
4902 * NEWS: %expect-violations are now just warnings, reverting
4903 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
4904 bootstrapping problem reported by Matthias Klose; see
4905 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
4906 * src/conflicts.c (conflicts_print): Likewise.
4907 * tests/conflicts.at (%expect not enough, %expect too much,
4908 %expect with reduce conflicts): Likewise.
4909 * doc/bison.texinfo (Expect Decl): Document this. Also mention
4910 that the warning is enabled if the number of conflicts changes
4911 (not necessarily increases).
4913 * src/getargs.c (version): Update copyright year.
4915 2003-01-09 Akim Demaille <akim@epita.fr>
4917 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
4919 2003-01-08 Paul Eggert <eggert@twinsun.com>
4921 * Makefile.maint (WGETFLAGS):
4922 New macro, containing "-C off" to disable proxy caches.
4923 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
4924 (rel-check): Use $(WGET) instead of wget.
4926 2003-01-06 Paul Eggert <eggert@twinsun.com>
4928 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
4929 the GLR paper of Scott, Johnstone and Hussain.
4931 2003-01-04 Paul Eggert <eggert@twinsun.com>
4933 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
4934 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
4935 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
4936 (EXTRA_LIBRARIES): New var, for liby.a.
4937 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
4938 (EXTRA_SCRIPTS): New var, for yacc.
4940 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
4941 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
4942 Problem reported by Nelson H. F. Beebe.
4944 2003-01-03 Paul Eggert <eggert@twinsun.com>
4946 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
4947 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
4948 when compiling Bison 1.875's `bitset bset = obstack_alloc
4949 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
4951 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
4952 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
4953 grow to a huge size with typical invocation.
4955 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
4956 Use the pattern recommended by Autoconf 2.57, except also protect
4957 against double-definition.
4958 * src/system.h: Likewise.
4959 Portability issues reported by Nelson H. F. Beebe.
4961 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
4962 All uses changed. Provide a definition in both C and C++.
4963 (yytrue, yyfalse): Define even if defined (__cplusplus).
4965 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
4966 Reported by Nelson H. F. Beebe.
4968 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
4970 2003-01-02 Paul Eggert <eggert@twinsun.com>
4972 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
4973 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
4974 Bug reported by Nelson H. F. Beebe.
4976 2003-01-01 Paul Eggert <eggert@twinsun.com>
4980 2002-12-30 Paul Eggert <eggert@twinsun.com>
4982 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
4984 (<INITIAL>","): Here. This causes stray "," to be treated
4987 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
4988 last brace in braced code when not in Yacc mode, for compatibility
4989 with Bison 1.35. This resurrects the 2001-12-15 patch to
4992 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
4993 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
4995 2002-12-28 Paul Eggert <eggert@twinsun.com>
4997 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
4998 that of SYM's type. This fixes Debian bug 168069, reported by
5001 2002-12-28 Paul Eggert <eggert@twinsun.com>
5005 Switch back to the Yacc style of conflict reports, undoing some
5006 of the 2002-07-30 change.
5007 * doc/bison.texinfo (Understanding): Use Yacc style for
5008 conflict reports. Also, use new way of locating rules.
5009 * src/conflicts.c (conflict_report):
5010 Renamed from conflict_report_yacc, removing the old
5011 'conflict_report'. Translate the entire conflict report at once,
5012 so that we don't assume that "," has the same interpretation in
5014 (conflicts_output): Use Yacc-style conflict report for each state,
5015 instead of our more-complicated style.
5016 (conflicts_print): Use Yacc-style conflict report, except print
5017 the input file name when not emulating Yacc.
5018 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
5019 Conflicted Reduction, %expect not enough, %expect too much,
5020 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
5021 * tests/existing.at (GNU Cim Grammar): Likewise.
5022 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
5024 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
5025 fatal): Don't invoke fflush; it's not needed and it might even be
5026 harmful for stdout, as stdout might not be open.
5027 * src/reduce.c (reduce_print): Likewise.
5029 2002-12-27 Paul Eggert <eggert@twinsun.com>
5031 Fix a bug where error locations were not being recorded correctly.
5032 This problem was originally reported by Paul Hilfinger in
5033 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
5035 * data/yacc.c (yyparse): New local var yylerrsp, to record the
5036 top of the location stack's error locations.
5037 (yyerrlab): Set it. When discarding a token, push its location
5038 onto yylerrsp so that we don't lose track of the error's end.
5039 (yyerrlab1): Now is only the target of YYERROR, so that we can
5040 properly record the location of the action that failed. For GCC
5041 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
5042 GCC warning about yyerrlab1 being unused if YYERROR is unused.
5043 (yyerrlab2): New label, which yyerrlab now falls through to.
5044 Compute the error's location by applying YYLLOC_DEFAULT to
5045 the locations of all the symbols that went into the error.
5046 * doc/bison.texinfo (Location Default Action): Mention that
5047 YYLLOC_DEFAULT is also invoked for syntax errors.
5048 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5049 Error locations include the locations of all the tokens that were
5050 discarded, not just the last token.
5052 2002-12-26 Paul Eggert <eggert@twinsun.com>
5054 * src/files.c: Include quote.h.
5055 (compute_output_file_names): Warn if we detect conflicting
5056 outputs to the same file. This should catch the misunderstanding
5057 exemplified by Debian Bug 165349, reported by Bruce Stephens..
5059 * src/conflicts.c (conflicts_print): If the user specifies
5060 "%expect N", report an error if there are any reduce/reduce
5061 conflicts. This is what the manual says should happen.
5062 This fixes Debian bug 130890, reported by Anthony DeRobertis.
5063 * tests/conflicts.at (%expect with reduce conflicts): New test.
5065 Don't use m4_include on relative file names, as it doesn't work as
5066 desired if there happens to be a file with that name under ".".
5068 * m4sugar/version.m4: Remove; it was included but it wasn't used.
5069 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
5070 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
5071 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
5072 * src/output.c (output_skeleton): Use full path names when
5073 specifying a file to include; don't rely on include path, as
5074 it's unreliable when the working file contains a file with
5077 2002-12-25 Paul Eggert <eggert@twinsun.com>
5079 Remove obsolete references to bison.simple and bison.hairy.
5080 Problem mentioned by Aubin Mahe in
5081 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
5082 * data/glr.c: Comment fix.
5083 * doc/bison.1: Remove references. Also, mention "yacc".
5085 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
5088 * src/parse-gram.y (declaration): Use enum "report_states" rather
5089 than its numeric value 1.
5091 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
5092 opening a new one. This fixes Debian bug 165349, reported by
5095 2002-12-24 Paul Eggert <eggert@twinsun.com>
5099 * Makefile.maint (cvs-update): Don't assume that the shell
5100 supports $(...), as Solaris sh doesn't.
5102 * src/parse-gram.y (lloc_default): Remove test for empty
5103 nonterminals at the end, since it didn't change the result.
5105 2002-12-24 Paul Eggert <eggert@twinsun.com>
5107 If the user does not define YYSTYPE as a macro, Bison now declares it
5108 using typedef instead of defining it as a macro. POSIX requires this.
5109 For consistency, YYLTYPE is also declared instead of defined.
5111 %union directives can now have a tag before the `{', e.g., the
5112 directive `%union foo {...}' now generates the C code
5113 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
5114 The default union tag is `YYSTYPE', for compatibility with Solaris 9
5115 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
5116 instead of `yyltype'.
5118 `yystype' and `yyltype' are now obsolescent macros instead of being
5119 typedefs or tags; they are no longer documented and will be
5120 withdrawn in a future release.
5122 * data/glr.c (b4_location_type): Remove.
5123 (YYSTYPE): Renamed from yystype.
5124 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
5125 (struct YYLTYPE): Renamed from struct yyltype.
5126 (YYLTYPE): Renamed from yyltype.
5127 (yyltype, yystype): New (and obsolescent) macros,
5128 for backward compatibility.
5129 * data/yacc.c: Likewise.
5131 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
5132 does not specify a union tag. This is for compatibility with
5135 * src/parse-gram.y (add_param): 2nd arg is now char * not char
5136 const *, since it is now modified by stripping surrounding { }.
5137 (current_braced_code): Remove.
5138 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
5139 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
5140 trailing " {...}". Now of type <chars>.
5141 (grammar_declaration): Adjust to bundled tokens.
5142 (code_content): Remove; stripping is now done by add_param.
5143 (print_token_value): Print contents of bundled tokens.
5144 (token_name): New function.
5146 * src/reader.h (braced_code, current_braced_code): Remove.
5147 (token_name): New decl.
5149 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
5150 token_type, not braced_code code_kind. All uses changed.
5151 (SC_PRE_CODE): New state, for scanning after a keyword that
5152 has (or usually has) an immediately-following braced code.
5153 (token_type): New local var, to keep track of which token type
5154 to return when scanning braced code.
5155 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
5156 <INITIAL>"%parse-param", <INITIAL>"%printer",
5157 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
5158 instead of returning a token type immediately.
5159 (<INITIAL>"{"): Set token type.
5160 (<SC_BRACED_CODE>"}"): Use it.
5161 (handle_action_dollar, handle_action_at): Now returns bool
5162 indicating success. Fail if ! current_rule; this prevents a core dump.
5163 (handle_symbol_code_dollar, handle_symbol_code_at):
5164 Remove; merge body into caller.
5165 (handle_dollar, handle_at): Complain in invalid contexts.
5167 * NEWS, doc/bison.texinfo: Document the above.
5168 * NEWS: Fix years and program names in copyright notice.
5170 2002-12-17 Paul Eggert <eggert@twinsun.com>
5172 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
5173 Reporting, Table of Symbols): Omit mentions of %lex-param and
5174 %parse-param from the documentation for now.
5176 2002-12-15 Paul Eggert <eggert@twinsun.com>
5178 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
5179 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
5180 lookahead symbol, and which sets yychar in parser actions) and it
5181 disagreed with the Bison documentation. Bug
5182 reported by Andrew Walrond.
5184 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
5185 as the caller now does that.
5186 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
5187 (YYEMPTY): Parenthesize right hand side, since others use it.
5188 (yyparse): Don't assume that our generated code is the only code
5191 2002-12-13 Paul Eggert <eggert@twinsun.com>
5195 POSIX requires a "yacc" command.
5196 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
5197 (MOSTLYCLEANFILES): Add yacc.
5199 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
5200 as an alias for bison y.
5202 * po/LINGUAS: Add da.
5204 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
5205 problem with latest <getopt.h>.
5206 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
5208 * doc/fdl.texi: Upgrade to 1.2.
5209 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
5210 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
5211 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
5213 * config/install-sh: Sync with autotools.
5215 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
5216 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
5217 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
5218 locations are requested.
5219 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
5220 locations are requested.
5222 2002-12-12 Paul Eggert <eggert@twinsun.com>
5224 Remove unportable casts and storage allocation tricks.
5225 While we're at it, remove almost all casts, since they
5226 usually aren't needed and are a sign of trouble.
5228 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
5230 * src/derives.c (derives_compute): Do not subtract NTOKENS from
5231 the pointer DSET returned by malloc; this isn't portable.
5232 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
5233 Similarly for DERIVES.
5234 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
5235 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
5236 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
5238 * src/derives.c (derives_compute): Do not bother invoking
5239 int_of_rule_number, since rule numbers are integers.
5241 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
5242 rather than XMALLOC (char, N).
5244 * src/files.c (filename_split): Rewrite to avoid cast.
5246 * src/gram.h (symbol_number_as_item_number,
5247 item_number_as_symbol_number, rule_number_as_item_number,
5248 item_number_as_rule_number):
5249 Now inline functions rather than macros, to avoid casts.
5250 * src/state.h (state_number_as_int): Likewise.
5251 * src/tables.c (state_number_to_vector_number,
5252 symbol_number_to_vector_number): Likewise.
5254 * src/gram.h (int_of_rule_number): Remove; no longer used.
5256 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
5257 since the resulting storage is always stored into.
5259 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
5262 * src/muscle_tab.c (muscle_m4_output):
5263 Now inline. Return bool, not int.
5264 * src/state.c (state_compare): Likewise.
5265 * src/symtab.c (symbol_check_defined,
5266 symbol_check_alias_consistency, symbol_pack, symbol_translation,
5267 hash_compare_symbol, hash_symbol):
5269 * src/uniqstr.c (uniqstr_print): Likewise.
5270 * src/muscle_tab.c (muscle_m4_output_processor):
5271 New function, to avoid casts.
5272 * src/state.c (state_comparator, stage_hasher): Likewise.
5273 * src/symtab.c (symbol_check_defined_processor,
5274 symbol_check_alias_consistency_processor, symbol_pack_processor,
5275 symbol_translation_processor, hash_symbol_comparator,
5276 hash_symbol_hasher): Likewise.
5277 * src/uniqstr.c (uniqstr_print_processor): Likewise.
5278 * src/muscle_tab.c (muscles_m4_output):
5279 Use new functions instead of casting old functions unportably.
5280 * src/state.c (state_hash_new): Likewise.
5281 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
5282 symbols_token_translations_init):
5284 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
5286 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
5287 var instead of casting to long, to avoid casts.
5288 (prepare_states): Use MALLOC rather than alloca, so that we don't
5289 have to worry about alloca.
5290 * src/state.c (state_hash_lookup): Likewise.
5292 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
5293 local var instead of casting to unsigned char, to avoid casts.
5295 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
5296 STATE_ALLOC): Remove.
5297 (transitions_new, errs_new, reductions_new, state_new): Use malloc
5298 rather than calloc, and use offsetof to avoid allocating slightly
5300 (state_new): Initialize all members.
5302 * src/state.c (state_hash): Use unsigned accumulator, not signed.
5304 * src/symtab.c (symbol_free): Remove; unused.
5305 (symbol_get): Remove cast in lhs of assignment.
5306 (symbols_do): Now static. Accept generic arguments, not
5307 hashing-related ones.
5309 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
5310 (symbol_processor): Remove.
5311 (symbols_do): Remove decl; now static.
5313 * src/system.h (alloca): Remove; decl no longer needed.
5314 (<stddef.h>): Include, for offsetof.
5315 (<inttypes.>, <stdint.h>): Include if available.
5316 (uintptr_t): New type, if system lacks it.
5317 (CALLOC, MALLOC, REALLOC): New macros.
5318 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
5321 * src/tables.c (table_size): Now int, to pacify GCC.
5322 (table_grow, table_ninf_remap): Use signed table size.
5323 (save_row): Don't bother initializing locals when not needed.
5324 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
5325 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
5327 * src/vcg.h: Correct misspellings.
5329 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
5332 * src/getargs.c (getargs): Don't assume EOF == -1.
5334 2002-12-09 Paul Eggert <eggert@twinsun.com>
5336 Change identifier spellings to avoid collisions with names
5337 that are reserved by POSIX.
5339 Don't use names ending in _t, since POSIX reserves them.
5340 For consistency, remove _e and _s endings -- they're weren't
5341 needed to remove ambiguity. All uses changed.
5342 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
5343 turn was just renamed from struniq_t.
5344 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
5345 which in turn was just renamed from struniq_processor_t.
5346 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
5347 in turn was renamed from hash_compare_struniq_t.
5348 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
5349 (state_list): Renamed from state_list_t.
5350 * src/assoc.h (assoc): Renamed from assoc_t.
5351 * src/conflicts.c (enum conflict_resolution): Renamed from
5352 enum conflict_resolution_e.
5353 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
5354 (rule_list): Renamed from rule_list_t.
5355 * src/getargs.h (enum trace): Renamed from enum trace_e.
5356 (enum report): Renamed from enum report_e.
5357 * src/gram.h (item_number): Renamed from item_number_t.
5358 (rule_number): Renamed from rule_number_t.
5359 (struct rule_s): Remove the "rule_s" part; not used.
5360 (rule): Renamed from rule_t.
5361 (rule_filter): Renamed from rule_filter_t.
5362 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
5363 (goto_list): Renamed from goto_list_t.
5364 * src/lalr.h (goto_number): Renamed from goto_number_t.
5365 * src/location.h (location): Renamed from location_t.
5366 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
5367 and moved here from:
5368 * src/muscle_tab.h (muscle_entry_t): here.
5369 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
5370 (rule_list): Renamed from rule_list_t.
5371 * src/print_graph.c (static_graph): Renamed from graph.
5372 * src/reader.h (braced_code): Renamed from braced_code_t.
5373 Remove brace_code_e tag.
5374 * src/relation.h (relation_node): Renamed from relation_node_t.
5375 (relation_nodes): Renamed from relation_nodes_t.
5376 (relation): Renamed from relation_t.
5377 * src/state.h (state_number): Renamed from state_number_t.
5378 (struct state): Renamed from struct state_s.
5379 (state): Renamed from state_t.
5380 (transitions): Renamed from transitions_t. Unused (and
5381 misspelled) transtion_s tag removed.
5382 (errs): Renamed from errs_t. Unused errs_s tag removed.
5383 (reductions): Renamed from reductions_t. Unused tag
5384 reductions_s removed.
5385 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
5386 (struct symbol_list): Renamed from struct symbol_list_s.
5387 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
5388 (struct symbol): Renamed from struct symbol_s.
5389 (symbol): Renamed from symbol_t.
5390 * src/tables.c (vector_number): Renamed from vector_number_t.
5391 (action_number): Renamed from action_t.
5392 * src/tables.h (base_number): Renamed from base_t.
5393 * src/vcg.h (enum color): Renamed from enum color_e.
5394 (enum textmode): Renamed from enum textmode_e.
5395 (enum shape): Renamed from enum shape_e.
5396 (struct colorentry): Renamed from struct colorentry_s.
5397 (struct classname): Renamed from struct classname_s.
5398 (struct infoname): Renamed from struct infoname_s.
5399 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
5400 (enum decision): Renamed from enum decision_e.
5401 (enum orientation): Renamed from enum orientation_e.
5402 (enum alignment): Renamed from enum alignment_e.
5403 (enum arrow_mode): Renamed from enum arrow_mode_e.
5404 (enum crossing_type): Renamed from enum crossing_type_e.
5405 (enum view): Renamed from enum view_e.
5406 (struct node): Renamed from struct node_s.
5407 (node): Renamed from node_t.
5408 (enum linestyle): Renamed from enum linestyle_e.
5409 (enum arrowstyle): Renamed from enum arrowstyle_e.
5410 (struct edge): Renamed from struct edge.
5411 (edge): Renamed from edge_t.
5412 (struct graph): Renamed from struct graph_s.
5413 (graph): Renamed from graph_t.
5414 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
5415 Rename value_t -> value.
5416 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
5417 value_t_as_yystype -> value_as_yystype.
5419 Don't include <errno.h> in the mainstream code, since it
5420 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
5421 * lib/get-errno.c, lib/get-errno.h: New files.
5422 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
5424 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
5425 * src/output.c (output_skeleton): Likewise.
5426 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
5428 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
5430 (handle_action_dollar, handle_action_at): Likewise.
5431 * src/system.h: Do not include <errno.h>.
5432 (TAB_EXT): Renamed from EXT_TAB.
5433 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
5435 Avoid str[a-z]*, since <string.h> reserves that name space.
5436 Change all instances of "struniq" in names to "uniqstr", and
5437 likewise for "STRUNIQ" and "UNIQSTR".
5438 * src/uniqstr.c: Renamed from src/struniq.c.
5439 * src/uniqstr.h: Renamed from src/struniq.h.
5440 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
5441 * src/files.c (strsuffix): Remove; unused.
5442 (concat2): Renamed from stringappend. Now static.
5443 * src/files.h (strsuffix, stringappend): Remove; unused.
5444 * src/parse-gram.y (<chars>): Renamed from <string>.
5445 (<uniqstr>): Renamed from <struniq>.
5446 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
5447 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
5448 (struct graph_s.expand): Renamed from struct graph_s.stretch.
5449 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
5450 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
5451 (N_EXPAND): Renamed from N_STRETCH.
5453 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
5454 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
5455 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
5457 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
5458 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
5459 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
5460 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
5461 (BASE_MAXIMUM): Renamed from BASE_MAX.
5462 (BASE_MINIMUM): Renamed from BASE_MIN.
5463 (ACTION_MAX): Remove; unused.
5464 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
5465 Unnecessary casts removed from above defines.
5468 Fix misspelling in names.
5469 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
5470 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
5474 * lib/timevar.c (timevar_report): Renamed from time_report,
5475 for consistency with other names.
5476 * lib/timevar.h (timevar_report): New decl.
5477 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
5480 Sort include-file uses.
5482 Reorder all include files under src to be in the order "system.h".
5483 then the ../lib include files in angle brackets (alphabetized),
5484 then the . include files in double-quotes (alphabetized). Fix
5485 dependency breakages encountered in this process, as follows:
5486 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
5487 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
5488 * src/state.h: Include "symtab.h".
5490 2002-12-08 Paul Eggert <eggert@twinsun.com>
5492 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
5493 since this causes problems when __file__ contains character
5494 sequences like "@" that are treated specially by src/scan-skel.l.
5495 Instead, just use the file's basename. This fixes the bug
5496 reported by Martin Mokrejs in
5497 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
5499 2002-12-06 Paul Eggert <eggert@twinsun.com>
5501 Add support for rules that do not have trailing semicolons, as
5502 POSIX requires. Improve the quality of locations in Bison
5505 * src/location.c: Include <quotearg.h>.
5506 (empty_location): Now const.
5507 (location_print): New function. Follow the recommendation of the
5508 GNU Coding Standards for locations that span file boundaries.
5509 * src/location.h: Do not include <quotearg.h>; no longer needed.
5510 (boundary): New type.
5511 (location_t): Use it. This allows locations to span file boundaries.
5512 All member uses changed: file -> start.file or end.file (as needed),
5513 first_line -> start.line, first_column -> start.column,
5514 last_line -> end.line, last_column -> end.column.
5515 (equal_boundaries): New function.
5516 (LOCATION_RESET, LOCATION_STEP): Remove.
5517 (LOCATION_PRINT): Remove. All callers changed to use location_print.
5518 (empty_location): Now const.
5519 (location_print): New decl.
5520 * src/parse-gram.y (lloc_default): New function, which handles
5521 empty locations more accurately.
5522 (YYLLOC_DEFAULT): Use it.
5523 (%token COLON): Remove.
5524 (%token ID_COLON): New token.
5526 (declarations, rules): Remove trailing semicolon.
5527 (declaration, rules_or_grammar_declaration):
5528 Allow empty (";") declaration.
5529 (symbol_def): Remove empty actions; no longer needed.
5530 (rules_or_grammar_declaration): Remove trailing semicolon.
5531 (semi_colon.opt): Remove.
5532 * src/reader.h: Include location.h.
5533 (scanner_cursor): New decl.
5534 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
5536 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
5538 (STEP): Remove. No longer needed, now that adjust_location does
5539 the work. All uses removed.
5540 (scanner_cursor): New var.
5541 (adjust_location): Renamed from extend_location. It now sets
5542 *loc and adjusts the scanner cursor. All uses changed.
5543 Don't bother testing for CR.
5544 (handle_syncline): Remove location arg; now updates scanner cursor.
5545 All callers changed.
5546 (unexpected_end_of_file): Now accepts start boundary of token or
5547 comment, not location. All callers changed. Update scanner cursor,
5549 (SC_AFTER_IDENTIFIER): New state.
5550 (context_state): Renamed from c_context. All uses changed.
5551 (id_loc, code_start, token_start): New local vars.
5552 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
5553 processing of Yacc white space and equivalents here.
5554 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
5555 instead of returning ID immediately, since we need to search for
5557 (<INITIAL>"'", "\""): Save token_start.
5558 (<INITIAL>"%{", "{", "%%"): Save code_start.
5559 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
5560 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
5561 BEGIN context_state at end, not INITIAL.
5562 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
5563 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
5564 Return correct token start.
5565 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
5566 the start of a character, string or multiline comment is found.
5567 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
5568 Reduction): Adjust reported locations to match the more-precise
5569 results now expected.
5570 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
5571 * tests/reduce.at (Useless Rules, Reduced Automaton,
5572 Underivable Rules): Likewise.
5573 * tests/regression.at (Invalid inputs): No longer `expecting ";"
5574 or "|"' now that so many other tokens are allowed by the new grammar.
5576 * src/complain.h (current_file): Remove duplicate decl;
5577 current_file is now owned by files.h.
5578 * src/complain.c, src/scan-gram.l: Include files.h.
5580 2002-12-06 Paul Eggert <eggert@twinsun.com>
5582 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
5583 promotes to int; it might be unsigned int.
5584 * data/yacc.c (yy_reduce_print): Likewise.
5586 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
5587 be #defined in the prologue, not in the Bison declarations.
5588 This fixes Debian Bug 102878, reported by Shaul Karl.
5590 2002-12-02 Paul Eggert <eggert@twinsun.com>
5592 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
5593 * lib/strtoul.c: New file, from gnulib.
5594 This fixes a porting bug reported by Peter Klein in
5595 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
5597 2002-11-30 Paul Eggert <eggert@twinsun.com>
5599 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
5600 and put only a forward declaration in the prologue. This is for
5601 consistency with the other scanner helper functions.
5603 Type clashes now generate warnings, not errors, since it
5604 appears that POSIX may allow some grammars with type clashes.
5605 * src/reader.c (grammar_current_rule_check): Warn about
5606 type clashes instead of complaining.
5607 * tests/input.at (Type Clashes): Expect warnings, not complaints.
5609 Add Yacc library, since POSIX requires it.
5610 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
5611 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
5612 * lib/main.c, lib/yyerror.c: New files.
5614 gram_error can be static; it need not be extern.
5615 * src/reader.h (gram_error): Remove decl.
5616 * src/parse-gram.y (gram_error): Now static. Add static decl.
5617 (print_token_value): Omit parameter names from forward decl,
5620 2002-11-29 Paul Eggert <eggert@twinsun.com>
5622 * doc/bison.texinfo: Emphasize that yylex and yyerror must
5623 be declared before being used. E.g., one should typically
5624 declare them in the prologue. Use GNU coding style in examples.
5625 Put "const" consistently after the type it modifies. Mention
5626 that C99 supports "inline". Mention that yyerror traditionally
5629 %parse-param and %lex-param now take just one argument, the
5630 declaration; the argument name is deduced from the declaration.
5632 * doc/bison.texinfo (Parser Function, Pure Calling, Error
5633 Reporting, Table of Symbols): Document this.
5634 * src/parse-gram.y (add_param): New function.
5636 (declaration): Implement new rule for %parse-param and %lex-param.
5637 * src/scan-gram.l: "," now elicits a warning, rather than being
5638 a token; this is more compatible with byacc.
5639 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
5641 2002-11-27 Paul Eggert <eggert@twinsun.com>
5643 Rename identifiers to avoid real and potential collisions.
5645 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
5646 to avoid collision with lex macro described by Bruce Lilly in
5647 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
5648 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5649 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
5650 * src/parse-gram.y (print_token_value): Renamed from yyprint.
5652 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
5653 The name "yycontrol" violates the name space rules, and this stuff
5654 wasn't being used anyway.
5655 (input): Remove action; this stuff wasn't being used.
5656 (gram_error): Rename local variable yylloc -> loc.
5657 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
5658 (YY_DECL): Don't use "yy" at start of local variables.
5659 All uses changed, e.g., yylloc -> loc.
5660 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
5661 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
5662 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
5663 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
5665 * src/parse-gram.y (gram_error): loc is now const *.
5666 * src/reader.h (gram_error): Likewise.
5668 2002-11-24 Paul Eggert <eggert@twinsun.com>
5672 * tests/actions.at (Actions after errors): Use an output format
5673 more similar to that of the Printers and Destructors test.
5674 Test the position of the ';' token too.
5675 (Printers and Destructors): Likewise.
5676 (Printers and Destructors: %glr-parser): Remove for now, to avoid
5677 unnecessarily alarming people when the test fails.
5679 * data/yacc.c (yyerrlab1): Move this label down, so that the
5680 parser does not discard the lookahead token if the user code
5681 invokes YYERROR. This change is required for POSIX conformance.
5683 * lib/error.c: Sync with gnulib.
5685 2002-11-22 Paul Eggert <eggert@twinsun.com>
5687 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
5688 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
5689 * lib/xmalloc.c: Likewise.
5691 2002-11-20 Paul Eggert <eggert@twinsun.com>
5693 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
5695 2002-11-20 Paul Eggert <eggert@twinsun.com>
5697 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
5698 should use `if (! x) abort ();' rather than `assert (x);', and
5699 anyway it's one less thing to worry about configuring.
5701 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
5702 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
5703 and replace all instances of assert with abort.
5704 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5705 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
5707 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
5708 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
5709 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
5710 hash_find_entry, hash_rehash, hash_insert): Likewise.
5711 * src/conflicts.c (resolve_sr_conflict): Likewise.
5712 * src/lalr.c (set_goto_map, map_goto): Likewise.
5713 * src/nullable.c (nullable_compute): Likewise.
5714 * src/output.c (prepare_rules, token_definitions_output): Likewise.
5715 * src/reader.c (packgram, reader): Likewise.
5716 * src/state.c (state_new, state_free, state_transitions_set,
5717 state_reduction_find): Likewise.
5718 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
5719 symbol_pack): Likewise.
5720 * src/tables.c (conflict_row, pack_vector): Likewise.
5721 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
5722 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
5723 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
5724 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
5726 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
5727 (ARGMATCH_CONSTRAINT): New macro.
5728 (ARGMATCH_ASSERT): Use it.
5730 * src/system.h (verify): New macro.
5731 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
5733 * src/tables.c (tables_generate): Likewise.
5735 * src/struniq.c (struniq_assert): Now returns void, and aborts
5736 if the assertion is false.
5737 (struniq_assert_p): Remove.
5738 * src/struniq.h: Likewise.
5740 2002-11-18 Paul Eggert <eggert@twinsun.com>
5742 * data/glr.c (yygetLRActions): Replace `yyindex' with
5743 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
5744 This fixes the regression with Sun ONE Studio 7 cc that I reported in
5745 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
5747 2002-11-18 Akim Demaille <akim@epita.fr>
5749 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
5751 From Tim Van Holder.
5753 2002-11-17 Paul Eggert <eggert@twinsun.com>
5755 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
5756 to "SyntaxError" for consistency with my 2002-11-15 change.
5758 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
5759 not define to {}, since this breaks the common use of `YYDPRINTF
5760 ((...));' if a single statement is desired (e.g. before `else').
5761 Work around GCC warnings by surrounding corresponding calls with
5763 (yyhasResolvedValue): Remove unused function.
5764 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
5766 (yyreportSyntaxError): Renamed from yyreportParseError.
5767 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
5769 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
5770 extern when possible. Remove unused initializations.
5772 2002-11-16 Akim Demaille <akim@epita.fr>
5774 Augment the similarity between GLR and LALR traces.
5776 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
5777 (YY_REDUCE_PRINT): New.
5778 (yyparse): Use them.
5779 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
5781 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
5782 state reached after the reduction/recovery, since...
5783 (yyparse, yyprocessOneStack): Report the state we are entering in.
5785 2002-11-16 Akim Demaille <akim@epita.fr>
5787 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
5788 Add support for --trace=skeleton.
5789 * src/scan-skel.l: %option debug.
5790 Scan strings of non-@ or \n instead of character by character.
5791 (scan_skel): Handle trace_skeleton.
5793 (@output_parser_name@, @output_header_name@): ``Restore'' their
5794 support (used to be M4 macros).
5795 * data/yacc.c: Quote larger chunks, a la glr.c.
5796 * data/lalr1.cc: Likewise.
5797 The header guards are no longer available, so use some other
5798 string than `YYLSP_NEEDED'.
5800 2002-11-16 Akim Demaille <akim@epita.fr>
5802 Make the ``Printers and Destructors'' test more verbose, taking
5803 `yacc.c''s behavior as (possibly wrong) reference.
5805 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
5806 instead of fprint on stdout.
5807 Set and report the last_line of the symbols.
5808 Consistently display values and locations.
5810 2002-11-16 Paul Eggert <eggert@twinsun.com>
5812 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
5814 2002-11-15 Paul Eggert <eggert@twinsun.com>
5816 * tests/actions.at (Actions after errors): New test case.
5818 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
5819 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
5820 tests/action.at, tests/calc.at, tests/conflicts.at,
5821 tests/cxx-type.at, tests/regression.at:
5822 "parse error" -> "syntax error" for POSIX compatibility.
5823 "parsing stack overflow..." -> "parser stack overflow" so
5824 that code matches Bison documentation.
5826 2002-11-15 Akim Demaille <akim@epita.fr>
5828 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
5829 take two BRACED_CODE, not two string_content.
5830 Free the scanner's obstack when we are done.
5831 (code_content): New.
5832 * tests/calc.at: Adjust.
5833 * doc/bison.texinfo: Adjust.
5834 Also, make sure to include the `,' for these declarations.
5836 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
5838 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
5839 definition; avoids potential autoreconf problems.
5841 2002-11-15 Akim Demaille <akim@epita.fr>
5843 Always check the value returned by yyparse.
5845 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
5846 returned by yyparse.
5847 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
5849 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
5850 returned by yyparse.
5852 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5854 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
5857 2002-11-14 Paul Eggert <eggert@twinsun.com>
5859 * src/output.c (output_skeleton): Call xfopen instead of
5860 duplicating xfopen's body.
5862 Fix bugs reported by Nelson H. F. Beebe in
5863 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
5865 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
5866 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
5867 Group compiler. Instead, use "$CC -E bar.c". Include the .h
5868 file twice in the grammar, as an extra check.
5870 * tests/input.at (Torturing the Scanner): Surround the
5871 backslash-newline tests with "#if 0", to make it less likely that
5872 we'll run into compiler bugs. Bring back solitary \ inside
5873 comment, but add a closing comment to work around HP C bug. Don't
5874 test backslash-newline in C character constant.
5876 2002-11-14 Akim Demaille <akim@epita.fr>
5878 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
5879 status of the compiler.
5880 Calling `exit 1' is no longer needed.
5881 Reported by Nelson H. F. Beebe.
5883 2002-11-14 Akim Demaille <akim@epita.fr>
5885 * tests/atlocal.in (CPPFLAGS): We have config.h.
5886 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
5888 * tests/actions.at, tests/calc.at, tests/conflicts.at,
5889 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
5890 * tests/regression.at, tests/torture.at: Use them for all the
5891 grammars that are to be compiled.
5892 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
5893 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
5894 * doc/bison.texinfo (GLR Parsers): Document `inline'.
5896 2002-11-14 Akim Demaille <akim@epita.fr>
5898 * doc/bison.texinfo: Various formatting changes (alignments in
5899 samples, additional @group/@end group, GCS in samples.
5900 Use @deffn instead of simple @table to define the directives,
5901 macros, variables etc.
5903 2002-11-13 Paul Eggert <eggert@twinsun.com>
5905 Fix some bugs reported by Albert Chin-A-Young in
5906 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
5908 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
5909 -o c"; the HP C compiler chatters during compilation.
5910 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
5911 * tests/headers.at (export YYLTYPE): Likewise.
5913 * tests/input.at (Torturing the Scanner): Remove lines containing
5914 solitary backslashes, as they tickle a bug in the HP C compiler.
5916 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
5917 comments, since they're not portable. Use GNU coding style.
5919 2002-11-13 Akim Demaille <akim@epita.fr>
5921 * data/yacc.c: Leave bigger chunks of quoted text.
5922 (YYDSYMPRINTF): New.
5923 Use it to report symbol activities.
5924 * data/glr.c (YYDSYMPRINTF): New.
5927 2002-11-12 Paul Eggert <eggert@twinsun.com>
5931 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
5932 (yyglrReduce): Return yyok, not 0.
5933 This should avoid the enumerated-type warnings reported
5934 by Nelson H. F. Beebe in
5935 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
5937 * lib/bbitset.h (BITSET_INLINE): Remove.
5938 * lib/bitset.h [! BITSET_INLINE]: Remove.
5939 (bitset_set, bitset_reset, bitset_test): Rename local vars
5940 to avoid shadowing warnings by GCC.
5942 * data/glr.c (inline): Remove #define. It's the user's
5943 responsibility to #define it away, just like 'const'.
5944 This fixes one of the bugs reported by Nelson H. F. Beebe in
5945 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
5947 * Makefile.maint (po-check): Scan .l and .y files instead of the
5948 .c and the .h files that they generate. This fixes the bug
5949 reported by Tim Van Holder in:
5950 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
5951 Look for N_ as well as for _. Try to avoid matching #define for
5953 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
5954 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
5955 * src/scan-gram.l: Revamp regular expressions so that " and '
5956 do not confuse xgettext.
5958 * src/struniq.h (struniq_new): Do not declare the return type
5959 to be 'const'; this violates the C standard.
5960 * src/struniq.c (struniq_new): Likewise.
5962 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
5964 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
5965 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
5968 2002-11-12 Akim Demaille <akim@epita.fr>
5970 * Makefile.maint: Sync with Autoconf:
5971 (local_updates): New.
5973 2002-11-12 Akim Demaille <akim@epita.fr>
5975 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
5977 2002-11-12 Akim Demaille <akim@epita.fr>
5979 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
5982 2002-11-12 Akim Demaille <akim@epita.fr>
5984 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
5987 2002-11-12 Akim Demaille <akim@epita.fr>
5989 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
5990 Use it to test the GLR parser.
5992 2002-11-12 Akim Demaille <akim@epita.fr>
5994 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
5996 * data/glr.c (yystos): New.
5997 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
5999 (yyval): Don't define it, it is handled via M4.
6000 (yyrecoverParseError): Free verbosely the discarded symbols.
6001 * data/yacc.c (yysymprint): Remove, rather...
6002 (b4_yysymprint_generate): invoke.
6003 * data/c.m4 (b4_yysymprint_generate): New.
6004 Accept pointers as arguments, as opposed to the version from
6006 (b4_yydestruct_generate): Likewise.
6007 * tests/cations.at (Printers and Destructors): Use Bison directives
6008 instead of CPP macros.
6009 Don't rely on internal details.
6011 2002-11-12 Akim Demaille <akim@epita.fr>
6013 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
6014 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
6015 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
6016 it against YYEMPTY and so forth), work on yytoken (i.e., set
6017 it to YYEMPTY etc.).
6018 (yydestruct): Replace with a b4_yydestruct_generate invocation.
6019 (b4_symbol_actions): Remove.
6020 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
6021 for 0, end-of-input.
6023 2002-11-12 Akim Demaille <akim@epita.fr>
6025 * doc/bison.texinfo (Destructor Decl): New.
6027 2002-11-12 Akim Demaille <akim@epita.fr>
6029 * src/tables.c (tables_generate): Use free for pointers that
6030 cannot be NULL, not XFREE.
6031 (pack_vector): Use assert, not fatal, for bound violations.
6032 * src/state.c (state_new): Likewise.
6033 * src/reader.c (reader): Likewise.
6034 * src/lalr.c (set_goto_map): Likewise.
6035 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
6038 2002-11-12 Akim Demaille <akim@epita.fr>
6040 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
6042 * src/scan-gram.l (last_string): Is global to the file, not to
6044 * src/parse-gram.y (input): Don't append the epilogue here,
6045 (epilogue.opt): do it here, and free the scanner's obstack.
6046 * src/reader.c (epilogue_set): Rename as...
6047 (epilogue_augment): this.
6048 * data/c.m4 (b4_epilogue): Defaults to empty.
6050 2002-11-12 Akim Demaille <akim@epita.fr>
6052 * src/getargs.c (long_options): Remove duplicates.
6053 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
6055 * doc/bison.rnh: Remove.
6056 * doc/bison.texinfo (VMS Invocation): Remove.
6058 2002-11-12 Akim Demaille <akim@epita.fr>
6060 * src/struniq.h, src/struniq.c (struniq_t): Is const.
6061 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
6063 Use struniq for symbols.
6065 * src/symtab.h (symbol_t): The tag member is a struniq.
6066 (symbol_type_set): Adjust.
6067 * src/symtab.c (symbol_new): Takes a struniq.
6068 (symbol_free): Don't free the tag member.
6069 (hash_compare_symbol_t, hash_symbol_t): Rename as...
6070 (hash_compare_symbol, hash_symbol): these.
6071 Use the fact that tags as struniqs.
6072 (symbol_get): Use struniq_new.
6073 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
6075 * src/reader.h (merger_list, grammar_currentmerge_set): The name
6076 and type members are struniqs.
6077 * src/reader.c (get_merge_function)
6078 (grammar_current_rule_merge_set): Adjust.
6079 (TYPE, current_type): Are struniq.
6081 Use struniq for file names.
6083 * src/files.h, src/files.c (infile): Split into...
6084 (grammar_file, current_file): these.
6085 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
6086 * src/reduce.c (reduce_print): Likewise.
6087 * src/getargs.c (getargs): Likewise.
6088 * src/complain.h, src/complain.c: Likewise.
6089 * src/main.c (main): Call struniqs_new early enough to use it for
6091 Don't free the input file name.
6093 2002-11-12 Akim Demaille <akim@epita.fr>
6095 * src/symtab.c (symbol_free): Remove dead deactivated code:
6096 type_name are properly removed.
6097 Don't use XFREE to free items that cannot be NULL.
6098 * src/struniq.h, src/struniq.c: New.
6099 * src/main.c (main): Initialize/free struniqs.
6100 * src/parse-gram.y (%union): Add astruniq member.
6102 * src/scan-gram.l (<{tag}>): Return a struniq.
6103 Free the obstack bit that used to store it.
6104 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
6106 2002-11-11 Paul Eggert <eggert@twinsun.com>
6108 Revamp to fix many (but not all) of the C- and M4-related quoting
6109 problems. Among other things, this fixes the Bison bug reported
6110 by Jan Hubicka when processing the Bash grammar; see:
6111 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
6113 Use new @ escapes consistently. Represent brackets with @{ and @}
6114 rather than @<:@ and @:>@, since this works a bit better with dumb
6115 editors like vi. Represent @ with @@, since @ is now consistently
6116 an escape. Use @oline@ and @ofile@ rather than __oline__ and
6117 __ofile__, to avoid unexpected expansions. Similarly, use @output
6118 rather than #output.
6120 * data/c.m4 (b4_copyright): Omit file name from comment, since
6121 the file name could contain "*/".
6122 (b4_synclines_flag): Don't quote the 2nd argument; it should already
6123 be quoted. All uses changed.
6125 * data/glr.c: Use new @ escapes consistently.
6126 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
6127 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
6128 Remove, since they couldn't handle arbitrary characters in file
6130 * data/lalr1.cc: Likewise.
6131 * data/yacc.c: Likewise.
6133 * src/files.c (output_infix): Remove; all uses removed.
6134 * src/files.h: Likewise.
6136 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
6137 mishandled funny characters in file names, and anyway it isn't
6139 * data/yacc.c: Likewise.
6140 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
6142 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
6143 * data/yacc.c: Likewise.
6145 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
6147 (muscle_init): Quote filename as a C string.
6148 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
6149 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
6150 * src/output.c (escaped_file_name_output): New function.
6151 (prepare_symbols): Quote tokens for M4.
6152 (prepare): Don't insert output_infix, output_prefix,
6153 output_parser_name, output_header_name; this is now down by scan-skel.
6154 Insert skeleton as a C string.
6156 * src/output.c (user_actions_output, symbol_destructors_output,
6157 symbol_printers_output): Quote filenames for C and M4.
6158 * src/reader.c (prologue_augment, epilogue_set): Likewise.
6160 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
6161 escapes other than \\ and \'; this simplifies the code.
6162 (<SC_STRING>): Likewise, for \\ and \".
6163 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
6164 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
6165 Use new escapes @{ and @} for [ and ].
6167 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
6168 them with auto vars.
6169 Switch to new escape scheme, where @ is the escape character uniformly.
6170 Abort if a stray escape character is found. Avoid unbounded input
6171 buffer when parsing non-escaped text.
6173 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
6174 __oline__, #output, $@, and @{ do not have unintended meanings.
6176 2002-11-09 Paul Eggert <eggert@twinsun.com>
6178 Fix the test failure due to GCC warnings described in
6179 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
6180 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
6181 evaluate to 0 if it's impossible for NINF to be in the respective
6183 (yygetLRActions, yyrecoverParseError): Use them.
6185 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
6186 counted in the token inserted at end of file. Now takes
6187 location_t *, not location_t, so that the location can be
6188 adjusted. All uses changed.
6190 * tests/regression.at (Invalid inputs): Adjust wording in
6191 diagnostic to match the new behavior.
6193 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
6194 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
6195 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
6196 abort ();'. This reduces the runtime of the "Many lookaheads"
6197 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
6200 2002-11-07 Paul Eggert <eggert@twinsun.com>
6202 * src/parse-gram.y (CHARACTER): Remove unused token.
6205 * src/scan-gram.l: Remove stack option. We no longer use the
6206 stack, since the stack was never deeper than 1; instead, use the
6207 new auto var c_context to record the stacked value.
6209 Remove nounput option. At an unexpected end of file, we now unput
6210 the minimal input necessary to end cleanly; this simplifies the
6213 Avoid unbounded token sizes where this is easy.
6215 (unexpected_end_of_file): New function.
6216 Use it to systematize the error message on unexpected EOF.
6217 (last-string): Now auto, not static.
6218 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
6219 (scanner_last_string_free): Remove; not used.
6220 (percent_percent_count): Move decl to just before use.
6221 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
6222 not the (never otherwised-used) CHARACTER.
6224 2002-11-07 Akim Demaille <akim@epita.fr>
6226 Let yyerror always receive the msg as last argument, so that
6227 yyerror can be variadic.
6229 * data/yacc.c (b4_yyerror_args): New.
6230 Use it when calling yyerror.
6231 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
6232 Use it when calling yyerror.
6233 * doc/bison.texinfo (Error Reporting): Adjust.
6234 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
6235 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
6237 2002-11-06 Akim Demaille <akim@epita.fr>
6239 #line should have quoted strings.
6240 Ideally, this should be done by m4_quotearg.
6242 * src/scan-skel.l: Include quotearg.h.
6244 * src/output.c (symbol_printers_output)
6245 (symbol_destructors_output): Quote the file name.
6247 2002-11-06 Akim Demaille <akim@epita.fr>
6249 * tests/regression.at (Invalid inputs): Adjust to the recent
6252 2002-11-06 Akim Demaille <akim@epita.fr>
6255 Reported by Jim Kent.
6257 * data/c.m4 (b4_syncline): New.
6258 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
6259 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
6260 * src/output.c (user_actions_output): Likewise.
6261 (prepare): Define 'b4_synclines_flag'.
6262 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
6264 2002-11-06 Akim Demaille <akim@epita.fr>
6266 * src/main.c (main): Free `infile'.
6267 * src/scan-gram.l (handle_syncline): New.
6269 * src/output.c (user_actions_output, symbol_destructors_output)
6270 (symbol_printers_output): Use the location's file name, not
6272 * src/reader.c (prologue_augment, epilogue_set): Likewise.
6274 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6276 * src/tables.c (matching_state): Don't allow states to match if
6277 either has GLR conflict entries.
6279 2002-11-05 Paul Eggert <eggert@twinsun.com>
6281 * src/scan-gram.l: Use more accurate diagnostics, e.g.
6282 "integer out of range" rather than "invalid value".
6283 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
6286 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
6287 Also, remove one static variable in the scanner.
6289 * src/scan-gram.l (braces_level): Now auto, not static.
6290 Initialize to zero if the compiler is being picky.
6291 (INITIAL): Clear braces_level instead of incrementing it.
6292 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
6293 as POSIX 1003.1-2001 requires.
6294 * src/system.h (IF_LINT): New macro, taken from coreutils.
6295 * configure.ac: Define "lint" if --enable-gcc-warnings.
6297 2002-11-05 Akim Demaille <akim@epita.fr>
6299 * src/scan-gram.l: When it starts with `%', complain about the
6300 whole directive, not just that `invalid character: %'.
6302 2002-11-04 Akim Demaille <akim@epita.fr>
6304 * Makefile.maint: Update from Autoconf.
6305 (update, cvs-update, po-update, do-po-update): New.
6307 2002-11-04 Akim Demaille <akim@epita.fr>
6309 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
6311 Have yyerror `use' its arguments.
6312 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
6313 returns true when location & yacc & pure & parse-param.
6314 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
6316 2002-11-04 Akim Demaille <akim@epita.fr>
6318 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
6320 * src/scan-gram.l: Use [\'] instead of ['] to pacify
6323 Use quote, not quote_n since LOCATION_PRINT no longer uses the
6326 2002-11-03 Paul Eggert <eggert@twinsun.com>
6328 * src/reader.c (get_merge_function, grammar_current_rule_check):
6329 Use consistent diagnostics for reporting type name clashes.
6330 Quote the types with <>, for consistency with Yacc.
6331 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
6333 2002-11-03 Akim Demaille <akim@epita.fr>
6335 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
6337 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
6338 (b4_parse_param): Remove.
6339 Use b4_identification.
6340 Propagate b4_pure_args where needed to pass them to yyerror.
6341 * data/glr.m4 (b4_parse_param): Remove.
6342 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
6343 (b4_lpure_formals): New.
6344 Use b4_identification.
6345 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
6346 b4_user_formals and b4_user_args.
6347 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
6348 (yyreportAmbiguity): When using a pure parser, also need
6349 the location, and the parse-params.
6351 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
6352 When using a pure parser, also need the parse-params.
6354 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
6355 (%pure-parser + %parse-param) LALR and GLR parsers.
6356 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
6357 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
6358 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
6359 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
6360 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
6361 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
6362 * doc/bison.texinfo: Untabify the whole file.
6363 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
6364 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
6365 (Error Reporting): Adjust to these new directives.
6366 Document %error-verbose, deprecate YYERROR_VERBOSE.
6368 2002-11-03 Akim Demaille <akim@epita.fr>
6370 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
6371 AT_CHECK_CALC_GLR invocations to use % directives, instead of
6372 command line options.
6373 * tests/cxx-type.at: Formatting changes.
6375 2002-11-03 Paul Eggert <eggert@twinsun.com>
6377 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
6378 to count columns correctly, and to check for invalid inputs.
6380 Use mbsnwidth to count columns correctly. Account for tabs, too.
6382 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
6383 (extend_location): New function.
6386 Handle CRLF in C code rather than in Lex code.
6387 (YY_INPUT): New macro.
6388 (no_cr_read): New function.
6390 Scan UCNs, even though we don't fully handle them yet.
6391 (convert_ucn_to_byte): New function.
6393 Handle backslash-newline correctly in C code.
6394 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
6395 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
6397 (tag, splice): New EREs. Do not allow NUL or newline in tags.
6398 Use {splice} wherever C allows backslash-newline.
6399 YY_STEP after space, newline, vertical-tab.
6400 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
6402 (letter, id): Don't assume ASCII; e.g., spell out a-z.
6404 ({int}, handle_action_dollar, handle_action_at): Check for integer
6407 (YY_STEP): Omit trailing semicolon, so that it's more like C.
6409 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
6410 as well as \000. Check for UCHAR_MAX, not 255.
6411 Allow \x with an arbitrary positive number of digits, as in C.
6412 Check for overflow here.
6413 Allow \? and UCNs, for compatibility with C.
6415 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
6416 with quote slot used by complain_at.
6418 * tests/input.at: Add tests for backslash-newline, m4 quotes
6419 in symbols, long literals, and funny escapes in strings.
6421 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
6422 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
6423 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
6424 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
6425 * m4/mbswidth.m4: New file, from GNU coreutils.
6427 * doc/bison.texinfo (Grammar Outline): Document // comments.
6428 (Symbols): Document that trigraphs have no special meaning in Bison,
6429 nor is backslash-newline allowed.
6430 (Actions): Document that trigraphs have no special meaning.
6432 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
6435 2002-11-02 Paul Eggert <eggert@twinsun.com>
6437 * src/reader.c: Don't include quote.h; not needed.
6438 (get_merge_function): Reword warning to be consistent with
6439 type clash diagnostic in grammar_current_rule_check.
6441 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
6442 bug in trigraph handling.
6444 * src/output.c (prepare_symbols): When printing token names,
6445 escape "[" as "@<:@" and likewise for "]".
6447 * src/system.h (errno): Remove declaration, as we are now
6448 assuming C89 or better, and C89 guarantees errno.
6450 2002-10-30 Paul Eggert <eggert@twinsun.com>
6452 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
6453 Check for close failures.
6454 * src/files.h (xfclose): Return void, not int, since it always
6456 * src/files.c (xfclose): Likewise. Report I/O error if ferror
6458 * src/output.c (output_skeleton): Use xfclose rather than fclose
6459 and ferror. xfclose now checks ferror.
6461 * data/glr.c (YYLEFTMOST_STATE): Remove.
6462 (yyreportTree): Use a stack-based leftmost state. This avoids
6463 our continuing battles with bogus warnings about initializers.
6465 2002-10-30 Akim Demaille <akim@epita.fr>
6467 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
6470 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6472 * tests/glr-regr1.at: New test for reported regressions.
6473 * tests/testsuite.at: Add glr-regr1.at test.
6474 * tests/Makefile.am: Add glr-regr1.at test.
6476 2002-10-24 Paul Eggert <eggert@twinsun.com>
6480 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
6481 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
6482 we use malloc. Don't assume 'A' through 'Z' are contiguous.
6483 Don't assume strdup exists; POSIX says its an XSI extension.
6484 Check for buffer overflow on input.
6486 2002-10-24 Akim Demaille <akim@epita.fr>
6488 * src/output.c (output_skeleton): Don't disable M4sugar comments
6489 too soon: it results in comments being expanded.
6490 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
6493 2002-10-24 Akim Demaille <akim@epita.fr>
6495 * data/yacc.c (m4_int_type): New.
6496 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
6497 char' as only yacc.c wants K&R portability.
6498 * data/glr.c (yysigned_char): Remove.
6499 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
6500 Reported by Quoc Peyrot.
6502 2002-10-23 Paul Eggert <eggert@twinsun.com>
6504 * src/main.c (main): With --trace=time, report times even if a
6505 non-fatal error occurs. Formerly, the times were reported in some
6506 such cases but not in others.
6507 * src/reader.c (reader): Just return if a complaint has been issued,
6508 instead of exiting, so that 'main' can report times.
6510 2002-10-22 Akim Demaille <akim@epita.fr>
6512 * src/system.h: Include sys/types.
6513 Reported by Bert Deknuydt.
6515 2002-10-23 Paul Eggert <eggert@twinsun.com>
6517 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
6518 Suggested by Art Haas.
6520 2002-10-22 Paul Eggert <eggert@twinsun.com>
6522 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
6523 decl; not needed any more.
6524 * src/main.c (main): Use return to exit, undoing yesterday's change.
6525 The last OS that we could find where this wouldn't work is
6526 SunOS 3.5, and that's too old to worry about now.
6528 * data/glr.c (struct yyltype): Define members even when not
6529 doing locations. This is more consistent with yacc.c, and it
6530 works around the following bug reports:
6531 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
6532 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
6534 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
6535 @acronym consistently. Standardize on "Yacc" instead of "YACC",
6536 "Algol" instead of "ALGOL". Give a bit more history about BNF.
6538 2002-10-22 Akim Demaille <akim@epita.fr>
6542 2002-10-21 Paul Eggert <eggert@twinsun.com>
6544 Be consistent about 'bool'; the old code used an enum in one
6545 module and an int in another, and this violates the C standard.
6546 * m4/stdbool.m4: New file, from coreutils 4.5.3.
6547 * configure.ac (AC_HEADER_STDBOOL): Add.
6548 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
6549 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
6550 * src/symtab.c (hash_compare_symbol_t): Likewise.
6551 * src/system.h (bool, false, true): Use a definition consistent
6552 with ../lib/hash.c. All uses changed.
6554 * src/complain.c (warning_issued): Renamed from warn_message_count,
6555 so that we needn't worry about integer overflow (!).
6556 Now of type bool. All uses changed.
6557 (complaint_issued): Renamed from complain_message_count; likewise.
6559 * src/main.c (main): Use exit to exit with failure.
6561 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
6562 rather than 1 and 0.
6563 * src/main.c (main): Likewise.
6564 * src/getargs.c (getargs): Likewise.
6565 * src/reader.c (reader): Likewise.
6567 * src/getarg.c (getargs): Remove duplicate code for
6568 "Try `bison --help'".
6570 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
6571 What was that "2" for?
6573 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
6574 * src/getargs.c (usage): Likewise.
6576 * src/getargs.c (getargs): When there are too few operands, report
6577 the last one. When there are too many, report the first extra
6578 one. This is how diffutils does it.
6580 2002-10-20 Paul Eggert <eggert@twinsun.com>
6582 Remove K&R vestiges.
6583 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
6584 * src/complain.c (VA_START): Remove. Assume prototypes.
6585 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
6586 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
6587 fatal): Assume prototypes.
6588 * src/complain.h: Assume prototypes.
6589 * src/system.h (PARAMS): Remove.
6590 Include <limits.h> unconditionally, since it's guaranteeed even
6591 for a freestanding C89 compiler.
6592 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
6593 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
6595 2002-10-20 Akim Demaille <akim@epita.fr>
6597 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
6598 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
6599 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
6600 (yyresolveStates, yyresolveAction, yyresolveStack)
6601 (yyprocessOneStack): Use them.
6602 (yy_reduce_print): New.
6603 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
6605 2002-10-20 Akim Demaille <akim@epita.fr>
6607 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
6608 arguments and output `void'.
6609 (b4_c_function): Rename as...
6610 (b4_c_function_def): this.
6611 (b4_c_function_decl, b4_c_ansi_function_def)
6612 (b4_c_ansi_function_decl): New.
6613 Change the interpretation of the arguments: before `int, foo', now
6615 * data/yacc.c (yyparse): Prototype and define thanks to these.
6616 Adjust b4_c_function_def uses.
6617 * data/glr.c (yyparse): Likewise, but ANSI only.
6619 2002-10-20 Akim Demaille <akim@epita.fr>
6621 * src/output.c (prepare): Move the definition of `tokens_number',
6622 `nterms_number', `undef_token_number', `user_token_number_max'
6624 (prepare_tokens): Here.
6625 (prepare_tokens): Rename as...
6626 (prepare_symbols): this.
6627 (prepare): Move the definition of `rules_number' to...
6628 (prepare_rules): here.
6629 (prepare): Move the definition of `last', `final_state_number',
6630 `states_number' to...
6631 (prepare_states): here.
6632 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
6634 2002-10-20 Akim Demaille <akim@epita.fr>
6636 * src/tables.h, src/tables.c, src/output.c: Comment changes.
6638 2002-10-20 Akim Demaille <akim@epita.fr>
6640 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
6643 2002-10-20 Akim Demaille <akim@epita.fr>
6645 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
6646 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
6648 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
6650 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
6651 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
6654 2002-10-19 Paul Eggert <eggert@twinsun.com>
6656 Do not create a temporary file, as that involves security and
6657 cleanup headaches. Instead, use a pair of pipes.
6658 Derived from a suggestion by Florian Krohm.
6659 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
6660 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
6661 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
6662 (BISON_PREREQ_SUBPIPE): Add.
6663 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
6664 Add subpipe.h, subpipe.c.
6665 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
6666 * po/POTFILES.in: Add lib/subpipe.c.
6667 * src/output.c: Include "subpipe.h".
6668 (m4_invoke): Remove decl.
6669 (scan_skel): New decl.
6670 (output_skeleton): Use pipe rather than temporary file for m4 input.
6671 Check that m4sugar.m4 is readable, to avoid deadlock.
6672 Check for pipe I/O error.
6673 * src/scan-skel.l (readpipe): Remove decl.
6674 (scan_skel): New function, to be used in place of m4_invoke.
6675 Read from stream rather than file.
6677 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
6678 float, as this generates a warning on Solaris 8 + GCC 3.2 with
6679 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
6680 this generates a more-accurate value anyway.
6682 * lib/timevar.c (timervar_accumulate): Rename locals to
6683 avoid confusion with similarly-named more-global.
6684 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
6686 * src/output.c (prepare): Use xstrdup to convert char const *
6687 to char *, to avoid GCC warning.
6689 2002-10-19 Akim Demaille <akim@epita.fr>
6691 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
6692 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
6693 Use them to have `calc.y' ready for %pure-parser.
6694 * data/yacc.c (YYLEX): Pass a yylex return type to
6697 2002-10-19 Akim Demaille <akim@epita.fr>
6699 Prototype support of %lex-param and %parse-param.
6701 * src/parse-gram.y: Add the definition of the %lex-param and
6702 %parse-param tokens, plus their rules.
6703 Drop the `_' version of %glr-parser.
6705 * src/scan-gram.l (INITIAL): Scan them.
6706 * src/muscle_tab.c: Comment changes.
6707 (muscle_insert, muscle_find): Rename `pair' as `probe'.
6708 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
6709 (muscle_entry_s): The `value' member is no longer const.
6710 Adjust all dependencies.
6711 * src/muscle_tab.c (muscle_init): Adjust: use
6712 MUSCLE_INSERT_STRING.
6713 Initialize the obstack earlier.
6714 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
6715 (muscle_pair_list_grow): New.
6716 * data/c.m4 (b4_c_function_call, b4_c_args): New.
6717 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
6718 * tests/calc.at: Use %locations, not --locations.
6719 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
6721 2002-10-19 Akim Demaille <akim@epita.fr>
6723 * src/getargs.c (usage): Take status as argument and exit
6725 Report the traditional `Try ... --help' message when status != 0.
6726 (usage, version): Don't take a FILE * as arg, it is pointless.
6727 (getargs): When there is an incorrect number of arguments, make it
6728 an error, and report it GNUlically thanks to `usage ()'.
6730 2002-10-18 Paul Eggert <eggert@twinsun.com>
6732 * data/glr.c (yyreportParseError): Don't assume that sprintf
6733 yields the length of the printed string, as this is not true
6734 on SunOS 4.1.4. Reported by Peter Klein.
6736 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
6737 * tests/conflicts.at (%nonassoc and eof): Likewise.
6738 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
6740 2002-10-17 Akim Demaille <akim@epita.fr>
6742 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
6743 * src/getargs.c (trace_types, trace_args): Adjust.
6744 * src/reader.c (grammar_current_rule_prec_set)
6745 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
6746 Standardize error messages.
6748 (reader): Use trace_flag to enable scanner/parser debugging,
6749 instead of an adhoc scheme.
6750 * src/scan-gram.l: Remove trailing debugging code.
6752 2002-10-16 Paul Eggert <eggert@twinsun.com>
6754 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
6757 * NEWS: Officially drop support for building Bison with K&R C,
6758 since it didn't work anyway and it's not worth worrying about.
6759 * Makefile.maint (wget_files): Remove ansi2knr.c.
6760 (ansi2knr.c-url_prefix): Remove.
6761 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
6762 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
6763 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
6765 2002-10-15 Paul Eggert <eggert@twinsun.com>
6767 Stop using the "enum_" trick for K&R-style function definitions;
6768 it confused me, and I was the author! Instead, assume that people
6769 who want to use K&R C compilers (when using these modules in GCC,
6770 perhaps?) will run ansi2knr.
6772 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
6773 All uses of "enum_" changed to "enum ".
6774 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
6775 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
6777 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
6778 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
6779 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
6780 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
6781 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
6782 abitset_not, abitset_ones, abitset_or, abitset_or_and,
6783 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
6784 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
6785 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
6786 Use function prototypes; this removes the need for declaring
6787 static functions simply to provide their prototypes.
6788 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
6789 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
6790 bitset_count_, bitset_create, bitset_dump, bitset_first,
6791 bitset_free, bitset_init, bitset_last, bitset_next,
6792 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
6793 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
6794 bitset_print, bitset_release_memory, bitset_toggle_,
6795 bitset_type_choose, bitset_type_get, bitset_type_name_get,
6796 debug_bitset): Likewise.
6797 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
6798 * lib/bitset_stats.c (bitset_log_histogram_print,
6799 bitset_percent_histogram_print, bitset_stats_and,
6800 bitset_stats_and_cmp, bitset_stats_and_or,
6801 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
6802 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
6803 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
6804 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
6805 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
6806 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
6807 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
6808 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
6809 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
6810 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
6811 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
6812 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
6813 bitset_stats_zero): Likewise.
6814 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
6815 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
6816 bitsetv_dump, debug_bitsetv): Likewise.
6817 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
6818 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
6819 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
6820 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
6821 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
6822 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
6823 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
6824 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
6825 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
6826 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
6827 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
6829 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
6830 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
6831 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
6832 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
6833 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
6834 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
6835 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
6836 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
6837 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
6838 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
6839 lbitset_xor_cmp, lbitset_zero): Likewise.
6841 2002-10-14 Akim Demaille <akim@epita.fr>
6845 2002-10-14 Akim Demaille <akim@epita.fr>
6847 * tests/Makefile.am (maintainer-check-posix): New.
6849 2002-10-14 Akim Demaille <akim@epita.fr>
6851 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
6854 2002-10-14 Akim Demaille <akim@epita.fr>
6856 * src/tables.c (table_ninf_remap): base -> tab.
6857 Reported by Matt Rosing.
6859 2002-10-14 Paul Eggert <eggert@twinsun.com>
6861 * tests/action.at, tests/calc.at, tests/conflicts.at,
6862 tests/cxx-type.at, tests/headers.at, tests/input.at,
6863 tests/regression.at, tests/synclines.at, tests/torture.at:
6864 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
6865 so that the tests still work even if POSIXLY_CORRECT is set.
6866 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
6868 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
6869 for portability to K&R hosts. Fix typo: signed char is guaranteed
6870 only to 127, not to 128.
6871 * data/glr.c (yysigned_char): New type.
6872 * data/yacc.c (yysigned_char): Likewise.
6873 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
6875 2002-10-13 Paul Eggert <eggert@twinsun.com>
6877 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
6878 true due to limited range of data type" warning from GCC.
6880 * data/c.m4 (b4_token_defines): Protect against double-inclusion
6881 by wrapping enum yytokentype's definition inside #ifndef
6882 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
6884 2002-10-13 Akim Demaille <akim@epita.fr>
6886 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
6887 Un yy- yyrhs to avoid the name clash with the global YYRHS.
6889 2002-10-13 Akim Demaille <akim@epita.fr>
6891 * Makefile.maint: Update from Autoconf 2.54.
6892 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
6894 2002-10-13 Akim Demaille <akim@epita.fr>
6896 * src/print.c (print_state): Separate the list of solved conflicts
6897 from the other items.
6898 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
6900 2002-10-13 Akim Demaille <akim@epita.fr>
6902 Let nondeterministic skeletons be usable with deterministic
6905 With the patch, GAWK compiled by GCC without -O2 passes its test
6906 suite using a GLR parser driven by LALR tables. It fails with -O2
6907 because `struct stat' gives two different answers on my machine:
6908 88 (definition of an auto var) and later 96 (memset on this var).
6909 Hence the stack is badly corrumpted. The headers inclusion is to
6910 blame: if I move the awk.h inclusion before GLR's system header
6911 inclusion, the two struct stat have the same size.
6913 * src/tables.c (pack_table): Always create conflict_table.
6914 (token_actions): Always create conflict_list.
6915 * data/glr.c (YYFLAG): Remove, unused.
6917 2002-10-13 Akim Demaille <akim@epita.fr>
6919 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
6921 (VALGRIND, GXX): New.
6922 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
6923 * tests/bison.in: Run $PREBISON a pre-command.
6924 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
6925 (maintainer-check-g++): New.
6926 * Makefile.am (maintainer-check): New.
6928 2002-10-13 Akim Demaille <akim@epita.fr>
6930 * data/glr.c: Formatting changes.
6931 Tweak some trace messages to match yacc.c's.
6933 2002-10-13 Akim Demaille <akim@epita.fr>
6935 GLR parsers sometimes raise parse errors instead of performing the
6937 Reported by Charles-Henry de Boysson.
6939 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
6940 check the length of the traces when %glr.
6941 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
6943 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
6945 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
6946 (yyltype): Remove the yy prefix from the member names.
6947 (yytable): Complete its comment.
6948 (yygetLRActions): Map error action number from YYTABLE from
6950 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
6951 (which was a bug: it should have been YYTABEL_NINF, and yet it was
6952 not satisfying as we could compare an YYACTION computed from
6953 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
6954 only value for error actions.
6955 (yyreportParseError): In verbose parse error messages, don't issue
6956 `error' in the list of expected tokens.
6957 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
6958 next action to perform to match glr.c's decoding.
6959 (yytable): Complete its comment.
6961 2002-10-13 Paul Eggert <eggert@twinsun.com>
6963 Fix problem reported by Henrik Grubbstroem in
6964 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
6965 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
6966 because the Bison parser reads the second action before reducing
6968 * src/scan-gram.l (rule_length): New static var.
6969 Use it to keep track of the rule length in the scanner, since
6970 we can't expect the parser to be in lock-step sync with the scanner.
6971 (handle_action_dollar, handle_action_at): Use this var.
6972 * tests/actions.at (Exotic Dollars): Test for the problem.
6974 2002-10-12 Paul Eggert <eggert@twinsun.com>
6976 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
6977 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
6978 Include <sys/time.h> when checking for clock_t and struct tms.
6979 Use same include order as source.
6980 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
6981 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
6983 * lib/timevar.c: Update copyright date and clarify comments.
6984 (get_time) [IN_GCC]: Keep the GCC version for reference.
6986 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
6987 GCC version as of today, then merge Bison's changes.
6988 Change "GCC" to "Bison" in copyright notice. timevar.def's
6989 author is Akim, so change that too.
6991 * src/reader.c (grammar_current_rule_check):
6992 Don't worry about the default action if $$ is untyped.
6993 Prevents bogus warnings reported by Jim Gifford in
6994 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
6996 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
6997 * data/glr.c, data/lalr1.cc, data/yacc.c:
6998 Output token definitions before the first part of user declarations.
6999 Fixes compatibility problem reported by Jim Gifford for kbd in
7000 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
7002 2002-10-11 Paul Eggert <eggert@twinsun.com>
7004 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
7005 (yyparse): here. This undoes some of the 2002-07-25 change.
7006 Compatibility problem reported by Ralf S. Engelschall with
7007 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
7009 2002-10-11 Akim Demaille <akim@epita.fr>
7011 * tests/regression.at Characters Escapes): New.
7012 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
7014 Reported by Jan Nieuwenhuizen.
7016 2002-10-11 Akim Demaille <akim@epita.fr>
7020 2002-10-10 Paul Eggert <eggert@twinsun.com>
7022 Portability fixes for bitsets; this also avoids several GCC
7025 * lib/abitset.c: Include <stddef.h>, for offsetof.
7026 * lib/lbitset.c: Likewise.
7028 * lib/abitset.c (abitset_bytes): Return a size that is aligned
7029 properly for vectors of objects. Do not assume that adding a
7030 header size to a multiple of a word size yields a value that is
7031 properly aligned for the whole union.
7032 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7034 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
7035 unique names for structures.
7036 * lib/ebitset.c (ebitset_bytes): Likewise.
7037 * lib/lbitset.c (lbitset_bytes): Likewise.
7039 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
7040 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
7041 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
7042 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
7043 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
7044 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
7045 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
7046 to improve the type-checking that GCC can do.
7047 * lib/bitset.c (bitset_op4_cmp): Likewise.
7048 * lib/bitset_stats.c (bitset_stats_count,
7049 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
7050 bitset_stats_copy, bitset_stats_disjoint_p,
7051 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
7052 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
7053 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
7054 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
7055 bitset_stats_and_or_cmp, bitset_stats_andn_or,
7056 bitset_stats_andn_or_cmp, bitset_stats_or_and,
7057 bitset_stats_or_and_cmp): Likewise.
7058 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
7059 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
7060 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
7061 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
7063 * lib/abitset.h: Include bitset.h, not bbitset.h.
7064 * lib/ebitset.h: Likewise.
7065 * lib/lbitset.h: Likewise.
7067 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
7068 All instances of parameters of type enum bitset_opts are now of
7069 type enum_bitset_opts, to conform to the C Standard, and similarly
7070 for enum_bitset_type.
7071 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
7072 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
7074 Do not use "struct bitset_struct" to mean different things in
7075 different modules. Not only is this confusing, it violates
7076 the C Standard, which requires that structure types in different
7077 modules must be compatible if one is to be passed to the other.
7078 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
7079 All instances of "struct bitset_struct *" replaced with "bitset".
7080 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
7081 (union bitset_union, struct abitset_struct, struct ebitset_struct,
7082 struct lbitset_struct, struct bitset_stats_struct): New types.
7083 All uses of struct bitset_struct changed to union bitset_union,
7085 * lib/abitset.c (struct abitset_struct, abitset,
7086 struct bitset_struct): Remove.
7087 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
7088 struct bitset_struct): Remove.
7089 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
7090 bitset_struct): Remove.
7091 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
7094 Do not call a function of type T using a call that assumes the
7095 function is of a different type U. Standard C requires that a
7096 function must be called with a type that is compatible with its
7098 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
7100 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
7102 * lib/ebitset.c (PFV): Remove.
7103 * lib/lbitset.c (PFV): Likewise.
7104 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
7105 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
7107 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
7108 (ebitset_vtable): Use them.
7109 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
7110 lbitset_xor): New functions.
7111 (lbitset_vtable): Use them.
7113 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
7116 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
7118 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
7119 Use offsetof, for simplicity.
7121 2002-10-06 Paul Eggert <eggert@twinsun.com>
7123 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
7124 the same width as int. This reapplies a hunk of the 2002-08-12 patch
7125 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
7126 which was inadvertently undone by the 2002-09-30 patch.
7127 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
7128 the same width as int.
7130 2002-10-04 Paul Eggert <eggert@twinsun.com>
7134 * configure.ac (AC_INIT), NEWS: Increment version number.
7136 * doc/bison.texinfo: Minor spelling, grammar, and white space
7138 (Symbols): Mention that any negative value returned from yylex
7139 signifies end-of-input. Warn about negative chars. Mention
7140 the portable Standard C character set.
7142 The GNU coding standard says CFLAGS and YFLAGS are reserved
7143 for the installer to set.
7144 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
7145 * src/Makefile.am (AM_CFLAGS): Likewise.
7146 (AM_YFLAGS): Renamed from YFLAGS.
7148 Fix some MAX and MIN problems.
7149 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
7150 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
7151 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
7152 * src/reader.c (reader): Use it.
7154 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
7155 POSIX 1003.1-2001 has removed fgrep.
7157 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
7159 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
7160 interpreted as signed.
7161 * lib/ebitset.c (ebitset_list): Fix bug.
7163 2002-10-01 Paul Eggert <eggert@twinsun.com>
7165 More fixes for 64-bit hosts and large bitsets.
7167 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
7168 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
7169 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
7170 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
7171 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
7172 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
7173 bitset_count_): Likewise.
7174 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
7175 bitset_first, bitset_last): Likewise.
7176 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
7177 bitset_stats_list_reverse, bitset_stats_size,
7178 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
7180 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7181 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
7182 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
7183 bitsetv_reflexive_transitive_closure): Likewise.
7184 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
7185 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
7187 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
7190 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
7191 Use size_t, not unsigned int, to count bytes.
7192 * lib/abitset.h (abitset_bytes): Likewise.
7193 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
7195 * lib/bitset.h (bitset_bytes): Likewise.
7196 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
7197 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
7198 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7199 * lib/ebitset.c (ebitset_bytes): Likewise.
7200 * lib/ebitset.h (ebitset_bytes): Likewise.
7201 * lib/lbitset.c (lbitset_bytes): Likewise.
7202 * lib/lbitset.h (lbitset_bytes): Likewise.
7204 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
7205 abitset_subset_p, abitset_disjoint_p, abitset_and,
7206 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
7207 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
7208 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
7209 abitset_or_and, abitset_or_and_cmp):
7210 Use bitset_windex instead of unsigned int.
7211 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
7212 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
7213 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
7214 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
7216 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
7218 * lib/bitset.c (bitset_print):
7219 Use proper printf formats for widths of integer types.
7220 * lib/bitset_stats.c (bitset_percent_histogram_print,
7221 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
7222 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7223 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
7224 * lib/lbitset.c (lbitset_bytes): Likewise.
7226 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
7227 BITSET_SIZE_MAX): New macros.
7228 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
7229 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
7230 to BITSET_WINDEX_MAX.
7232 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
7233 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
7234 since we now return the bitset_bindex type (not int).
7236 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
7237 when computing sizes.
7238 * lib/ebitset.c (ebitset_elts_grow): Likewise.
7240 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
7241 and avoid cast to unsigned.
7243 2002-09-30 Akim Demaille <akim@epita.fr>
7245 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
7246 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
7247 Updates from Michael Hayes.
7249 2002-09-30 Art Haas <ahaas@neosoft.com>
7251 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
7253 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
7256 2002-09-27 Akim Demaille <akim@epita.fr>
7260 2002-09-27 Akim Demaille <akim@epita.fr>
7262 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
7263 (Because of AC_LIBSOURCE).
7265 2002-09-27 Akim Demaille <akim@epita.fr>
7267 Playing with Autoscan.
7269 * configure.ac: Remove the old LIBOBJ tweaks.
7270 (AC_REPLACE_FUNCS): Add strrchr and strtol.
7271 * lib/strrchr.c: New.
7272 * lib/strtol.c: New, from the Coreutils 4.5.1.
7274 2002-09-27 Akim Demaille <akim@epita.fr>
7276 Playing with Autoscan.
7278 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
7279 * lib/Makefile.am (libbison_a_SOURCES): No longer include
7280 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
7281 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
7284 2002-09-24 Akim Demaille <akim@epita.fr>
7286 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
7287 (Frequently Asked Questions, Parser Stack Overflow): New.
7289 2002-09-13 Akim Demaille <akim@epita.fr>
7291 Playing with autoscan.
7293 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
7294 * src/files.c (skeleton_find): Remove, unused.
7295 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
7296 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
7298 2002-09-13 Akim Demaille <akim@epita.fr>
7300 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
7301 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
7303 2002-09-13 Akim Demaille <akim@epita.fr>
7305 * configure.ac: Require 2.54.
7306 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
7307 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
7308 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
7309 Remove, provided by Autoconf macros.
7311 2002-09-12 Akim Demaille <akim@epita.fr>
7313 * m4/prereq.m4: Update, from Coreutils 4.5.1.
7315 2002-09-12 Akim Demaille <akim@epita.fr>
7317 * m4/prereq.m4: Update, from Fileutils 4.1.5.
7318 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
7319 Reported by Martin Mokrejs.
7321 2002-09-10 Akim Demaille <akim@epita.fr>
7323 * src/parse-gram.y: Associate a human readable string to each
7325 * tests/regression.at (Invalid inputs): Adjust.
7327 2002-09-10 Gary V. Vaughan <gary@gnu.org>
7329 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
7330 with an Autoconf-2.5x style configure.ac.
7332 2002-09-06 Paul Eggert <eggert@twinsun.com>
7334 * doc/bison.texinfo (Conditions): Make explicit that the GPL
7335 exception applies only to yacc.c. This is a modification of a
7336 patch originally suggested by Akim Demaille.
7338 2002-09-06 Akim Demaille <akim@epita.fr>
7340 * data/c.m4 (b4_copyright): Move the GPL exception comment from
7342 * data/yacc.c: here.
7344 * data/lalr1.cc (struct yyltype): Don't define it, since we use
7346 (b4_ltype): Default to yy::Location from location.hh.
7348 2002-09-04 Jim Meyering <jim@meyering.net>
7350 * data/yacc.c: Guard the declaration of yytoknum also with
7351 `#ifdef YYPRINT', so it is declared only when used.
7353 2002-09-04 Akim Demaille <akim@epita.fr>
7355 * configure.in: Rename as...
7356 * configure.ac: this.
7359 2002-09-04 Akim Demaille <akim@epita.fr>
7361 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
7362 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
7363 translate maintainer only messages.
7365 2002-08-12 Paul Eggert <eggert@twinsun.com>
7369 * Makefile.am (SUBDIRS): Remove intl.
7370 (DISTCLEANFILES): Remove.
7371 * NEWS: Mention that GNU M4 is now required. Clarify what is
7372 meant by "larger grammars". Mention the pt_BR translation.
7373 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
7374 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
7375 Bump version from 0.11.2 to 0.11.5.
7376 (BISON_PREREQ_STAGE): Remove.
7377 (AM_GNU_GETTEXT): Use external gettext.
7378 (AC_OUTPUT): Remove intl/Makefile.
7380 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
7382 * data/glr.c: Include string.h, for strlen.
7383 (yyreportParseError): Use size_t for yysize.
7384 (yy_yypstack): No longer nested inside yypstates, as nested
7385 functions are not portable. Do not assume size_t is the
7387 (yypstates): Do not assume that ptrdiff_t is the same width
7388 as int, and similarly for yyposn and YYINDEX.
7390 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
7392 * lib/Makefile.am (INCLUDES): Do not include from the intl
7393 directory, which has been removed.
7394 * src/Makefile.am (INCLUDES): Likewise.
7396 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
7397 (bitsets_sources, additional_bitsets_sources, timevars_sources):
7400 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
7401 * tests/Makefile.am (EXTRA_DIST): Likewise.
7403 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
7404 Do not assume that bitset_windex is the same width as unsigned.
7406 * lib/abitset.c (abitset_unused_clear): Do not assume that
7407 bitset_word is the same width as int.
7408 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
7409 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
7410 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
7411 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
7412 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
7414 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
7415 portability to one's complement hosts!).
7416 * lib/ebitset.c (ebitset_op1): Likewise.
7417 * lib/lbitset.c (lbitset_op1): Likewise.
7419 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
7420 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7421 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
7422 Sync with fileutils.
7423 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
7424 lib/gettext.h: Sync with diffutils.
7426 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
7427 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
7429 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
7430 PROTOTYPES to check for prototypes, and "defined __STDC__" to
7433 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
7434 size_t; the old version tried to do this but casted improperly.
7435 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
7436 (bitset_test): Now returns int, not unsigned long.
7438 * lib/bitset_stats.c: Include "gettext.h".
7440 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
7441 name locals "index", as it generates unnecessary warnings on some
7442 hosts that have an "index" function.
7444 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
7445 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
7446 they need translation.
7447 * src/LR0.c (state_list_append, new_itemsets, get_state,
7448 append_states, generate_states): Likewise.
7449 * src/assoc.c (assoc_to_string): Likewise.
7450 * src/closure.c (print_closure, set_firsts, closure): Likewise.
7451 * src/gram.c (grammar_dump): Likewise.
7452 * src/injections.c (injections_compute): Likewise.
7453 * src/lalr.c (lookaheads_print): Likewise.
7454 * src/relation.c (relation_transpose): Likewise.
7455 * src/scan-gram.l: Likewise.
7456 * src/tables.c (table_grow, pack_vector): Likewise.
7458 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
7459 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
7460 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
7461 * m4/mbstate_t.m4: Sync with fileutils.
7462 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
7464 * po/LINGUAS: Add pt_BR.
7465 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
7466 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
7468 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
7470 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
7472 * src/complain.c (strerror_r): Remove decl; not needed.
7473 (strerror): Use same pattern as ../lib/error.c.
7475 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
7477 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
7479 * src/main.c (main): Cast result of bindtextdomain and textdomain
7480 to void, to avoid a GCC warning when --disable-nls is in effect.
7482 * src/scan-gram.l: Use strings rather than escapes when possible,
7483 to minimize the number of warnings from xgettext.
7484 (handle_action_dollar, handle_action_at): Don't use isdigit,
7485 as it mishandles negative chars and it may not work as expected
7486 outside the C locale.
7488 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
7489 this is a GCC extension and is not portable to other compilers.
7491 * src/system.h (alloca): Use same pattern as ../lib/error.c.
7492 Do not include <ctype.h>; no longer needed.
7493 Do not include <malloc.h>; no longer needed (and generates
7494 warnings on OpenBSD 3.0).
7496 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
7499 * tests/regression.at: Do not use 'cc -c input.c -o input';
7500 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
7502 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
7503 exit status as failure, not just exit status 1. Sun C exits
7504 with status 2 sometimes.
7506 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
7507 Use it for the two large tests.
7509 2002-08-02 Akim Demaille <akim@epita.fr>
7511 * src/conflicts.c (conflicts_output): Don't output rules never
7512 reduced here, since anyway that computation doesn't work.
7513 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
7514 (rule_useless_p, rule_never_reduced_p): New.
7515 (grammar_rules_partial_print): Use a filter instead of a range.
7516 Display the title only if needed.
7517 (grammar_rules_print): Adjust.
7518 (grammar_rules_never_reduced_report): New.
7519 * src/tables.c (action_row): Move the computation of rules never
7521 (token_actions): here.
7522 * src/main.c (main): Make the parser before making the report, so
7523 that rules never reduced are computed.
7524 Call grammar_rules_never_reduced_report.
7525 * src/print.c (print_results): Report rules never reduced.
7526 * tests/conflicts.at, tests/reduce.at: Adjust.
7528 2002-08-01 Akim Demaille <akim@epita.fr>
7530 Instead of attaching lookaheads and duplicating the rules being
7531 reduced by a state, attach the lookaheads to the reductions.
7533 * src/state.h (state_t): Remove the `lookaheads',
7534 `lookaheads_rule' member.
7535 (reductions_t): Add a `lookaheads' member.
7536 Use a regular array for the `rules'.
7537 * src/state.c (reductions_new): Initialize the lookaheads member
7539 (state_rule_lookaheads_print): Adjust.
7540 * src/state.h, src/state.c (state_reductions_find): New.
7541 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
7542 (count_rr_conflicts): Adjust.
7543 * src/lalr.c (LArule): Remove.
7544 (add_lookback_edge): Adjust.
7545 (state_lookaheads_count): New.
7546 (states_lookaheads_initialize): Merge into...
7547 (initialize_LA): this.
7548 (lalr_free): Adjust.
7549 * src/main.c (main): Don't free nullable and derives too early: it
7550 is used by --verbose.
7551 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
7553 2002-08-01 Akim Demaille <akim@epita.fr>
7555 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
7557 (set_derives, free_derives): Rename as...
7558 (derives_compute, derives_free): this.
7559 Adjust all dependencies.
7560 * src/nullable.c (set_nullable, free_nullable): Rename as...
7561 (nullable_compute, nullable_free): these.
7562 (rule_list_t): Store rule_t *, not rule_number_t.
7563 * src/state.c (state_rule_lookaheads_print): Directly compare rule
7564 pointers, instead of their numbers.
7565 * src/main.c (main): Call nullable_free, and derives_free earlier,
7566 as they were lo longer used.
7568 2002-08-01 Akim Demaille <akim@epita.fr>
7570 * lib/timevar.c (get_time): Include children time.
7571 * src/lalr.h (LA, LArule): Don't export them: used with the
7573 * src/lalr.c (LA, LArule): Static.
7574 * src/lalr.h, src/lalr.c (lalr_free): New.
7575 * src/main.c (main): Call it.
7576 * src/tables.c (pack_vector): Check whether loc is >= to the
7578 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
7579 (tables_generate): do it, since that's also it which allocates
7581 Don't free LA and LArule, main does.
7583 2002-07-31 Akim Demaille <akim@epita.fr>
7585 Separate parser tables computation and output.
7587 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
7588 (conflict_list, conflict_list_cnt, table, check, table_ninf)
7589 (yydefgoto, yydefact, high): Move to...
7590 * src/tables.h, src/tables.c: here.
7591 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
7592 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
7593 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
7594 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
7595 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
7596 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
7597 (action_row, save_row, token_actions, save_column, default_goto)
7598 (goto_actions, sort_actions, matching_state, pack_vector)
7599 (table_ninf_remap, pack_table, prepare_actions): Move to...
7600 * src/tables.c: here.
7601 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
7602 * src/output.c (token_actions, output_base, output_conflicts)
7603 (output_check): Merge into...
7604 (prepare_actions): this.
7605 (actions_output): Rename as...
7606 (user_actions_output): this.
7607 * src/main.c (main): Call tables_generate and tables_free.
7609 2002-07-31 Akim Demaille <akim@epita.fr>
7611 Steal GCC's --time-report support.
7613 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
7614 stolen/adjusted from GCC.
7615 * m4/stage.m4: Remove time related checks.
7616 * m4/timevar.m4: New.
7617 * configure.in: Adjust.
7618 * src/system.h: Adjust to using timevar.h.
7619 * src/getargs.h, src/getargs.c: Support trace_time for
7621 * src/main.c (stage): Remove.
7622 (main): Replace `stage' invocations with timevar calls.
7623 * src/output.c: Insert pertinent timevar calls.
7625 2002-07-31 Akim Demaille <akim@epita.fr>
7627 Let --trace have arguments.
7629 * src/getargs.h (enum trace_e): New.
7630 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
7631 (long_options, short_options): --trace/-T takes an optional
7633 Change all the uses of trace_flag to reflect the new flags.
7634 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
7636 Strengthen `stage' portability.
7638 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
7639 * configure.in: Use it.
7640 Don't check for malloc.h and sys/times.h.
7641 * src/system.h: Include them when appropriate.
7642 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
7643 times and struct tms are available.
7645 2002-07-30 Akim Demaille <akim@epita.fr>
7647 In verbose parse error message, don't report `error' as an
7649 * tests/actions.at (Printers and Destructors): Adjust.
7650 * tests/calc.at (Calculator $1): Adjust.
7651 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
7652 error message, do not report the parser accepts the error token in
7655 2002-07-30 Akim Demaille <akim@epita.fr>
7657 Normalize conflict related messages.
7659 * src/complain.h, src/complain.c (warn, complain): New.
7660 * src/conflicts.c (conflicts_print): Use them.
7661 (conflict_report_yacc): New, extracted from...
7662 (conflicts_print): here.
7663 * tests/conflicts.at, tests/existing.at: Adjust.
7665 2002-07-30 Akim Demaille <akim@epita.fr>
7667 Report rules which are never reduced by the parser: those hidden
7670 * src/LR0.c (save_reductions): Don't make the final state too
7671 different: save its reduction (accept) instead of having a state
7672 without any action (no shift or goto, no reduce).
7673 Note: the final state is now a ``regular'' state, i.e., the
7674 parsers now contain `reduce 0' as default reduction.
7675 Nevertheless, since they decide to `accept' when yystate =
7676 final_state, they still will not reduce rule 0.
7677 * src/print.c (print_actions, print_reduction): Adjust.
7678 * src/output.c (action_row): Track reduced rules.
7679 (token_actions): Report rules never reduced.
7680 * tests/conflicts.at, tests/regression.at: Adjust.
7682 2002-07-30 Akim Demaille <akim@epita.fr>
7684 `stage' was accidently included in a previous patch.
7685 Initiate its autoconfiscation.
7687 * configure.in: Look for malloc.h and sys/times.h.
7688 * src/main.c (stage): Adjust.
7689 Report only when trace_flag.
7691 2002-07-29 Akim Demaille <akim@epita.fr>
7693 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
7695 (errs_t): symbol_t*, not symbol_number_t.
7696 (reductions_t): rule_t*, not rule_number_t.
7697 (FOR_EACH_SHIFT): New.
7698 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
7699 * src/print.c, src/print_graph.c: Adjust.
7701 2002-07-29 Akim Demaille <akim@epita.fr>
7703 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
7705 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
7706 (endtoken, accept): these.
7707 * src/reader.c (reader): Set endtoken's default tag to "$end".
7708 Set undeftoken's tag to "$undefined" instead of "$undefined.".
7709 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
7712 2002-07-29 Akim Demaille <akim@epita.fr>
7714 * src/reduce.c (reduce_grammar): When the language is empty,
7715 complain about the start symbol, not the axiom.
7717 * tests/reduce.at (Empty Language): New.
7719 2002-07-26 Akim Demaille <akim@epita.fr>
7721 * src/reader.h, src/reader.c (gram_error): ... can't get
7722 yycontrol without making too strong assumptions on the parser
7724 * src/output.c (prepare_tokens): Use the real 0th value of
7725 token_translations instead of `0'.
7726 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
7728 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
7729 for the time being: %locations ought to provide it to yyerror.
7731 2002-07-25 Akim Demaille <akim@epita.fr>
7733 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
7734 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
7735 * tests/regression.at (Web2c Actions): Adjust.
7737 2002-07-25 Akim Demaille <akim@epita.fr>
7739 Stop storing rules from 1 to nrules + 1.
7741 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
7742 * src/nullable.c, src/output.c, src/print.c, src/reader.c
7743 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
7744 Iterate from 0 to nrules.
7745 Use rule_number_as_item_number and item_number_as_rule_number.
7746 Adjust to `derive' now containing possibly 0.
7747 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
7748 Handle the `- 1' part in rule numbers from/to item numbers.
7749 * src/conflicts.c (log_resolution): Fix the message which reversed
7751 * src/output.c (action_row): Initialize default_rule to -1.
7752 (token_actions): Adjust.
7753 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
7755 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
7757 2002-07-25 Akim Demaille <akim@epita.fr>
7759 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
7760 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
7761 (b4_c_knr_arg_decl): New.
7762 * data/yacc.c: Use it to define yysymprint, yydestruct, and
7763 yyreport_parse_error.
7765 2002-07-25 Akim Demaille <akim@epita.fr>
7767 * data/yacc.c (yyreport_parse_error): New, extracted from...
7769 (yydestruct, yysymprint): Move above yyparse.
7772 2002-07-25 Akim Demaille <akim@epita.fr>
7774 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
7776 (b4_sint_type, b4_uint_type): these.
7777 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
7778 * tests/regression.at (Web2c Actions): Adjust.
7780 2002-07-25 Akim Demaille <akim@epita.fr>
7782 * src/gram.h (TIEM_NUMBER_MAX): New.
7783 (item_number_of_rule_number, rule_number_of_item_number): Rename
7785 (rule_number_as_item_number, item_number_as_rule_number): these.
7786 Adjust dependencies.
7787 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
7788 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
7789 (symbol_number_to_vector_number): New.
7790 (order): Of vector_number_t* type.
7791 (base_t, BASE_MAX, BASE_MIN): New.
7792 (froms, tos, width, pos, check): Of base_t type.
7793 (action_number_t, ACTION_MIN, ACTION_MAX): New.
7794 (actrow): Of action_number_t type.
7795 (conflrow): Of unsigned int type.
7796 (table_ninf, base_ninf): New.
7797 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
7798 (muscle_insert_int_table, muscle_insert_base_table)
7799 (muscle_insert_rule_number_table): New.
7800 (prepare_tokens): Output `toknum' as int_table.
7801 (action_row): Returns a rule_number_t.
7802 Use ACTION_MIN, not SHRT_MIN.
7803 (token_actions): yydefact is rule_number_t*.
7804 (table_ninf_remap): New.
7805 (pack_table): Use it for `base' and `table'.
7806 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
7808 (YYPACT_NINF, YYTABLE_NINF): these.
7809 (yypact, yytable): Compute their types instead of hard-coded
7811 * tests/regression.at (Web2c Actions): Adjust.
7813 2002-07-19 Akim Demaille <akim@epita.fr>
7815 * src/scan-gram.l (id): Can start with an underscore.
7817 2002-07-16 Akim Demaille <akim@epita.fr>
7819 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
7820 Adjust all former `associativity' dependencies.
7821 * src/symtab.c (symbol_new): Default associativity is `undef', not
7823 (symbol_check_alias_consistence): Adjust.
7825 2002-07-09 Akim Demaille <akim@epita.fr>
7827 * doc/bison.texinfo: Properly set the ``header'' part.
7828 Use @dircategory ``GNU programming tools'' as per Texinfo's
7832 2002-07-09 Akim Demaille <akim@epita.fr>
7834 * lib/quotearg.h: Protect against multiple inclusions.
7835 * src/location.h (location_t): Add a `file' member.
7836 (LOCATION_RESET, LOCATION_PRINT): Adjust.
7837 * src/complain.c (warn_at, complain_at, fatal_at): Drop
7838 `error_one_per_line' support.
7840 2002-07-09 Akim Demaille <akim@epita.fr>
7842 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
7843 * src/reader.c (lineno): Remove.
7844 Adjust all dependencies.
7845 (get_merge_function): Take a location and use complain_at.
7846 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
7847 * tests/regression.at (Invalid inputs, Mixing %token styles):
7850 2002-07-09 Akim Demaille <akim@epita.fr>
7852 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
7853 recovery rule, and forbid extensions when --yacc.
7854 (gram_error): Use complain_at.
7855 * src/reader.c (reader): Exit if there were parse errors.
7857 2002-07-09 Akim Demaille <akim@epita.fr>
7859 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
7860 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
7861 Reported by R Blake <blakers@mac.com>.
7863 2002-07-09 Akim Demaille <akim@epita.fr>
7865 * data/yacc.c: Output the copyright notive in the header.
7867 2002-07-03 Akim Demaille <akim@epita.fr>
7869 * src/output.c (froms, tos): Are state_number_t.
7870 (save_column): sp, sp1, and sp2 are state_number_t.
7871 (prepare): Rename `final' as `final_state_number', `nnts' as
7872 `nterms_number', `nrules' as `rules_number', `nstates' as
7873 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
7875 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
7876 * data/lalr1.cc (nsym_): Remove, unused.
7878 2002-07-03 Akim Demaille <akim@epita.fr>
7880 * src/lalr.h, src/lalr.c (goto_number_t): New.
7881 * src/lalr.c (goto_list_t): New.
7883 * src/nullable.c (rule_list_t): New.
7885 * src/types.h: Remove.
7887 2002-07-03 Akim Demaille <akim@epita.fr>
7889 * src/closure.c (print_fderives): Use rule_rhs_print.
7890 * src/derives.c (print_derives): Use rule_rhs_print.
7891 (rule_list_t): New, replaces `shorts'.
7892 (set_derives): Add comments.
7893 * tests/sets.at (Nullable, Firsts): Adjust.
7895 2002-07-03 Akim Demaille <akim@epita.fr>
7897 * src/output.c (prepare_actions): Free `tally' and `width'.
7898 (prepare_actions): Allocate and free `order'.
7899 * src/symtab.c (symbols_free): Free `symbols'.
7900 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
7901 * src/output.c (m4_invoke): Move to...
7902 * src/scan-skel.l: here.
7903 (<<EOF>>): Close yyout, and free its name.
7905 2002-07-03 Akim Demaille <akim@epita.fr>
7907 Fix some memory leaks, and fix a bug: state 0 was examined twice.
7909 * src/LR0.c (new_state): Merge into...
7910 (state_list_append): this.
7911 (new_states): Merge into...
7912 (generate_states): here.
7913 (set_states): Don't ensure a proper `errs' state member here, do it...
7914 * src/conflicts.c (conflicts_solve): here.
7915 * src/state.h, src/state.c: Comment changes.
7916 (state_t): Rename member `shifts' as `transitions'.
7917 Adjust all dependencies.
7918 (errs_new): For consistency, also take the values as argument.
7920 (state_errs_set): New.
7921 (state_reductions_set, state_transitions_set): Assert that no
7922 previous value was assigned.
7924 (states_free): Use it.
7925 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
7926 temporary storage: use `errs' and `nerrs' as elsewhere.
7927 (set_conflicts): Allocate and free this `errs'.
7929 2002-07-02 Akim Demaille <akim@epita.fr>
7931 * lib/libiberty.h: New.
7932 * lib: Update the bitset implementation from upstream.
7933 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
7934 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
7935 * src/main.c: Adjust bitset stats calls.
7937 2002-07-01 Paul Eggert <eggert@twinsun.com>
7939 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
7940 char, so that negative chars don't collide with $.
7942 2002-06-30 Akim Demaille <akim@epita.fr>
7944 Have the GLR tests be `warning' checked, and fix the warnings.
7946 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
7947 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
7948 (yyremoveDeletes): `yyi' and `yyj' are size_t.
7949 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
7950 (yyaddDeferredAction): static.
7951 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
7952 (yyreportParseError): yyprefix is const.
7953 yytokenp is used only when verbose.
7954 (yy__GNUC__): Replace with __GNUC__.
7955 (yypdumpstack): yyi is size_t.
7956 (yypreference): Un-yy local variables and arguments, to avoid
7957 clashes with `yyr1'. Anyway, we are not in the user name space.
7958 (yytname_size): be an int, as is compared with ints.
7959 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
7961 * tests/cxx-gram.at: Use quotation to protect $1.
7962 Use AT_COMPILE to enable warnings hunts.
7963 Prototype yylex and yyerror.
7965 Include `string.h', not `strings.h'.
7966 Produce and prototype stmtMerge only when used.
7967 yylex takes a location.
7969 2002-06-30 Akim Demaille <akim@epita.fr>
7971 We spend a lot of time in quotearg, in particular when --verbose.
7973 * src/symtab.c (symbol_get): Store a quoted version of the key.
7974 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
7977 2002-06-30 Akim Demaille <akim@epita.fr>
7979 * src/state.h (reductions_t): Rename member `nreds' as num.
7980 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
7981 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
7983 2002-06-30 Akim Demaille <akim@epita.fr>
7985 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
7986 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
7987 (shifts_to): Rename as...
7988 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
7989 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
7990 (TRANSITION_IS_DISABLED, transitions_to): these.
7992 2002-06-30 Akim Demaille <akim@epita.fr>
7994 * src/print.c (print_shifts, print_gotos): Merge into...
7995 (print_transitions): this.
7996 (print_transitions, print_errs, print_reductions): Align the
7998 (print_core, print_transitions, print_errs, print_state,
7999 print_grammar): Output empty lines separator before, not after.
8000 (state_default_rule_compute): Rename as...
8001 (state_default_rule): this.
8002 * tests/conflicts.at (Defaulted Conflicted Reduction),
8003 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
8004 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
8006 2002-06-30 Akim Demaille <akim@epita.fr>
8008 Display items as we display rules.
8010 * src/gram.h, src/gram.c (rule_lhs_print): New.
8011 * src/gram.c (grammar_rules_partial_print): Use it.
8012 * src/print.c (print_core): Likewise.
8013 * tests/conflicts.at (Defaulted Conflicted Reduction),
8014 (Unresolved SR Conflicts): Adjust.
8015 (Unresolved SR Conflicts): Adjust and rename as...
8016 (Resolved SR Conflicts): this, as was meant.
8017 * tests/regression.at (Web2c Report): Adjust.
8019 2002-06-30 Akim Demaille <akim@epita.fr>
8021 * src/print.c (state_default_rule_compute): New, extracted from...
8022 (print_reductions): here.
8023 Pessimize, but clarify the code.
8024 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
8026 2002-06-30 Akim Demaille <akim@epita.fr>
8028 * src/output.c (action_row): Let default_rule be always a rule
8031 2002-06-30 Akim Demaille <akim@epita.fr>
8033 * src/closure.c (print_firsts, print_fderives, closure):
8035 * src/lalr.c (lookaheads_print): Likewise.
8036 * src/state.c (state_rule_lookaheads_print): Likewise.
8037 * src/print_graph.c (print_core): Likewise.
8038 * src/print.c (print_reductions): Likewise.
8039 * src/output.c (action_row): Likewise.
8040 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
8042 2002-06-30 Akim Demaille <akim@epita.fr>
8044 * src/print_graph.c: Use report_flag.
8046 2002-06-30 Akim Demaille <akim@epita.fr>
8048 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
8050 * src/relation.h, src/relation.c (traverse, relation_digraph)
8051 (relation_print, relation_transpose): New.
8053 2002-06-30 Akim Demaille <akim@epita.fr>
8055 * src/state.h, src/state.c (shifts_to): New.
8056 * src/lalr.c (build_relations): Use it.
8058 2002-06-30 Akim Demaille <akim@epita.fr>
8060 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
8061 (item_number_of_rule_number, rule_number_of_item_number): New.
8062 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
8063 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8064 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
8065 Propagate their use.
8066 Much remains to be done, in particular wrt `shorts' from types.h.
8068 2002-06-30 Akim Demaille <akim@epita.fr>
8070 * src/symtab.c (symbol_new): Initialize the `printer' member.
8072 2002-06-30 Akim Demaille <akim@epita.fr>
8074 * src/LR0.c (save_reductions): Remove, replaced by...
8075 * src/state.h, src/state.c (state_reductions_set): New.
8076 (reductions, errs): Rename as...
8077 (reductions_t, errs_t): these.
8078 Adjust all dependencies.
8080 2002-06-30 Akim Demaille <akim@epita.fr>
8082 * src/LR0.c (state_list_t, state_list_append): New.
8083 (first_state, last_state): Now symbol_list_t.
8084 (this_state): Remove.
8085 (new_itemsets, append_states, save_reductions): Take a state_t as
8087 (set_states, generate_states): Adjust.
8088 (save_shifts): Remove, replaced by...
8089 * src/state.h, src/state.c (state_shifts_set): New.
8090 (shifts): Rename as...
8092 Adjust all dependencies.
8093 * src/state.h (state_t): Remove the `next' member.
8095 2002-06-30 Akim Demaille <akim@epita.fr>
8097 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
8100 2002-06-30 Akim Demaille <akim@epita.fr>
8102 Use hash.h for the state hash table.
8104 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
8105 (allocate_storage): Use state_hash_new.
8106 (free_storage): Use state_hash_free.
8107 (new_state, get_state): Adjust.
8108 * src/lalr.h, src/lalr.c (states): Move to...
8109 * src/states.h (state_t): Remove the `link' member, no longer
8111 * src/states.h, src/states.c: here.
8112 (state_hash_new, state_hash_free, state_hash_lookup)
8113 (state_hash_insert, states_free): New.
8114 * src/states.c (state_table, state_compare, state_hash): New.
8115 * src/output.c (output_actions): Do not free states now, since we
8116 still need to know the final_state number in `prepare', called
8117 afterwards. Do it...
8118 * src/main.c (main): here: call states_free after `output'.
8120 2002-06-30 Akim Demaille <akim@epita.fr>
8122 * src/state.h, src/state.c (state_new): New, extracted from...
8123 * src/LR0.c (new_state): here.
8124 * src/state.h (STATE_ALLOC): Move to...
8125 * src/state.c: here.
8126 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
8127 * src/state.h, src/state.c: here.
8129 2002-06-30 Akim Demaille <akim@epita.fr>
8131 * src/reader.c (gensym): Rename as...
8132 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
8133 (getsym): Rename as...
8136 2002-06-30 Akim Demaille <akim@epita.fr>
8138 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
8139 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
8140 * src/output.c, src/print.c, src/print_graph.c: Propagate.
8141 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
8143 2002-06-30 Akim Demaille <akim@epita.fr>
8145 Make the test suite pass with warnings checked.
8147 * tests/actions.at (Printers and Destructors): Improve.
8148 Avoid unsigned vs. signed issues.
8149 * tests/calc.at: Don't exercise the scanner here, do it...
8150 * tests/input.at (Torturing the Scanner): here.
8152 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8154 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
8155 reorganize first lines parallel to yacc.c.
8157 2002-06-28 Akim Demaille <akim@epita.fr>
8159 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
8160 (b4_token_enum, b4_token_defines): New, factored from...
8161 * data/lalr1.cc, data/yacc.c, glr.c: here.
8163 2002-06-28 Akim Demaille <akim@epita.fr>
8165 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
8167 * src/output.c (merger_output): static.
8169 2002-06-28 Akim Demaille <akim@epita.fr>
8171 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
8172 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
8174 * src/output.c (save_row): Initialize all the variables to pacify GCC.
8176 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8178 Accumulated changelog for new GLR parsing features.
8180 * src/conflicts.c (count_total_conflicts): Change name to
8181 conflicts_total_count.
8182 * src/conflicts.h: Ditto.
8183 * src/output.c (token_actions): Use the new name.
8184 (output_conflicts): Change conflp => conflict_list_heads, and
8185 confl => conflict_list for better readability.
8186 * data/glr.c: Use the new names.
8187 * NEWS: Add self to GLR announcement.
8189 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
8191 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
8194 * data/bison.glr: Change name to glr.c
8195 * data/glr.c: Renamed from bison.glr.
8196 * data/Makefile.am: Add glr.c
8200 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
8201 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
8203 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8205 * data/bison.glr: Be sure to restore the
8206 current #line when returning to the skeleton contents after having
8207 exposed the input file's #line.
8209 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8211 * data/bison.glr: Bring up to date with changes to bison.simple.
8213 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8215 * data/bison.glr: Correct definitions that use b4_prefix.
8216 Various reformatting.
8217 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
8218 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
8219 yytokenp argument; now part of stack.
8220 (yychar): Define to behave as documented.
8223 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8225 * src/reader.h: Add declaration for free_merger_functions.
8227 * src/reader.c (merge_functions): New variable.
8228 (get_merge_function): New function.
8229 (free_merger_functions): New function.
8230 (readgram): Check for %prec that is not followed by a symbol.
8231 Handle %dprec and %merge declarations.
8232 (packgram): Initialize dprec and merger fields in rules array.
8234 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
8235 conflict_list_cnt, conflict_list_free): New variables.
8236 (table_grow): Also grow conflict_table.
8237 (prepare_rules): Output dprec and merger tables.
8238 (conflict_row): New function.
8239 (action_row): Output conflict lists for GLR parser. Don't use
8240 default reduction in conflicted states for GLR parser so that there
8241 are spaces for the conflict lists.
8242 (save_row): Also save conflict information.
8243 (token_actions): Allocate conflict list.
8244 (merger_output): New function.
8245 (pack_vector): Pack conflict table, too.
8246 (output_conflicts): New function to output yyconflp and yyconfl.
8247 (output_check): Allocate conflict_tos.
8248 (output_actions): Output conflict tables, also.
8249 (output_skeleton): Output b4_mergers definition.
8250 (prepare): Output b4_max_rhs_length definition.
8251 Use 'bison.glr' as default skeleton for GLR parsers.
8253 * src/gram.c (glr_parser): New flag.
8254 (grammar_free): Call free_merger_functions.
8256 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
8257 all pairs of conflicting reductions, rather than just all tokens
8258 causing conflicts. Needed to size conflict tables.
8259 (conflicts_output): Modify call to count_rr_conflicts for new
8261 (conflicts_print): Ditto.
8262 (count_total_conflicts): New function.
8264 * src/reader.h (merger_list): New type.
8265 (merge_functions): New variable.
8267 * src/lex.h (tok_dprec, tok_merge): New token types.
8269 * src/gram.h (rule_s): Add dprec and merger fields.
8270 (glr_parser): New flag.
8272 * src/conflicts.h (count_total_conflicts): New function.
8274 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
8276 * doc/bison.texinfo (Generalized LR Parsing): New section.
8277 (GLR Parsers): New section.
8278 (Language and Grammar): Mention GLR parsing.
8279 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
8280 Correct typo ("tge" -> "the").
8282 * data/bison.glr: New skeleton for GLR parsing.
8284 * tests/cxx-gram.at: New tests for GLR parsing.
8286 * tests/testsuite.at: Include cxx-gram.at.
8288 * tests/Makefile.am: Add cxx-gram.at.
8292 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
8294 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
8296 2002-06-27 Akim Demaille <akim@epita.fr>
8298 * src/options.h, src/options.c: Remove.
8299 * src/getargs.c (short_options, long_options): New.
8301 2002-06-27 Akim Demaille <akim@epita.fr>
8303 * data/bison.simple, data/bison.c++: Rename as...
8304 * data/yacc.c, data/lalr1.cc: these.
8305 * doc/bison.texinfo (Environment Variables): Remove.
8307 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
8309 * src/getargs.c (report_argmatch): Initialize strtok().
8311 2002-06-20 Akim Demaille <akim@epita.fr>
8313 * data/bison.simple (b4_symbol_actions): New, replaces...
8314 (b4_symbol_destructor, b4_symbol_printer): these.
8315 (yysymprint): Be sure to call YYPRINT only for tokens, and using
8318 2002-06-20 Akim Demaille <akim@epita.fr>
8320 * data/bison.simple (yydestructor): Rename as...
8323 2002-06-20 Akim Demaille <akim@epita.fr>
8325 * src/symtab.h, src/symtab.c (symbol_type_set)
8326 (symbol_destructor_set, symbol_precedence_set): The location is
8330 2002-06-20 Akim Demaille <akim@epita.fr>
8332 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
8334 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
8336 * src/symtab.h, src/symtab.c (symbol_class_set)
8337 (symbol_user_token_number_set): Likewise.
8339 Promote complain_at.
8340 * tests/input.at (Type Clashes): Adjust.
8342 2002-06-20 Akim Demaille <akim@epita.fr>
8344 * data/bison.simple (YYLEX): Fix the declaration when
8347 2002-06-20 Akim Demaille <akim@epita.fr>
8349 * data/bison.simple (yysymprint): Don't print the token number,
8351 * tests/actions.at (Destructors): Rename as...
8352 (Printers and Destructors): this.
8353 Also exercise %printer.
8355 2002-06-20 Akim Demaille <akim@epita.fr>
8357 * data/bison.simple (YYDSYMPRINT): New.
8358 Use it to remove many of the #if YYDEBUG/if (yydebug).
8360 2002-06-20 Akim Demaille <akim@epita.fr>
8362 * src/symtab.h, src/symtab.c (symbol_t): printer and
8363 printer_location are new members.
8364 (symbol_printer_set): New.
8365 * src/parse-gram.y (PERCENT_PRINTER): New token.
8366 Handle its associated rule.
8367 * src/scan-gram.l: Adjust.
8368 (handle_destructor_at, handle_destructor_dollar): Rename as...
8369 (handle_symbol_code_at, handle_symbol_code_dollar): these.
8370 * src/output.c (symbol_printers_output): New.
8371 (output_skeleton): Call it.
8372 * data/bison.simple (yysymprint): New. Cannot be named yyprint
8373 since there are already many grammar files with a user `yyprint'.
8374 Replace the calls to YYPRINT to calls to yysymprint.
8375 * tests/calc.at: Adjust.
8376 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
8377 taking advantage of parser very internal details (stack size!).
8379 2002-06-20 Akim Demaille <akim@epita.fr>
8381 * src/scan-gram.l: Complete the scanner with the missing patterns
8383 Use `quote' and `symbol_tag_get' where appropriate.
8385 2002-06-19 Akim Demaille <akim@epita.fr>
8387 * tests/actions.at (Destructors): Augment to test locations.
8388 * data/bison.simple (yydestructor): Pass it the current location
8389 if locations are enabled.
8390 Prototype only when __STDC__ or C++.
8391 Change the argument names to move into the yy name space: there is
8394 2002-06-19 Akim Demaille <akim@epita.fr>
8396 * data/bison.simple (b4_pure_if): New.
8397 Use it instead of #ifdef YYPURE.
8399 2002-06-19 Akim Demaille <akim@epita.fr>
8401 * data/bison.simple (b4_location_if): New.
8402 Use it instead of #ifdef YYLSP_NEEDED.
8404 2002-06-19 Akim Demaille <akim@epita.fr>
8406 Prepare @$ in %destructor, but currently don't bind it in the
8407 skeleton, as %location use is not cleaned up yet.
8409 * src/scan-gram.l (handle_dollar, handle_destructor_at)
8410 (handle_action_at): New.
8411 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
8412 a braced_code_t and a location as additional arguments.
8413 (handle_destructor_dollar): Instead of requiring `b4_eval', just
8414 unquote one when outputting `b4_dollar_dollar'.
8416 * data/bison.simple (b4_eval): Remove.
8417 (b4_symbol_destructor): Adjust.
8418 * tests/input.at (Invalid @n): Adjust.
8420 2002-06-19 Zack Weinberg <zack@codesourcery.com>
8422 * doc/bison.texinfo: Document ability to have multiple
8425 2002-06-18 Akim Demaille <akim@epita.fr>
8427 * src/files.c (compute_base_names): When computing the output file
8428 names from the input file name, strip the directory part.
8430 2002-06-18 Akim Demaille <akim@epita.fr>
8432 * data/bison.simple.new: Comment changes.
8433 Reported by Andreas Schwab.
8435 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
8437 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
8438 there are no `label `yyoverflowlab' defined but not used' warnings
8439 when yyoverflow is defined.
8441 2002-06-18 Akim Demaille <akim@epita.fr>
8443 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
8445 (symbol_destructor_set): Adjust.
8446 * src/output.c (symbol_destructors_output): Output the destructor
8448 Output the symbol name.
8449 * data/bison.simple (b4_symbol_destructor): Adjust.
8451 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
8452 and Akim Demaille <akim@epita.fr>
8454 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
8455 what's left on the stack when the error recovery hits EOF.
8456 * tests/actions.at (Destructors): Complete to exercise this case.
8458 2002-06-17 Akim Demaille <akim@epita.fr>
8460 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
8461 arguments is really empty, not only equal to `[]'.
8462 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
8464 (symbol_destructor_set): New.
8465 * src/output.c (symbol_destructors_output): New.
8466 * src/reader.h (brace_code_t, current_braced_code): New.
8467 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
8468 (handle_dollar): Rename as...
8469 (handle_action_dollar): this.
8470 (handle_destructor_dollar): New.
8471 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
8472 (grammar_declaration): Use it.
8473 * data/bison.simple (yystos): Is always defined.
8474 (yydestructor): New.
8475 * tests/actions.at (Destructors): New.
8476 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
8478 2002-06-17 Akim Demaille <akim@epita.fr>
8480 * src/symlist.h, src/symlist.c (symbol_list_length): New.
8481 * src/scan-gram.l (handle_dollar, handle_at): Compute the
8482 rule_length only when needed.
8483 * src/output.c (actions_output, token_definitions_output): Output
8485 * src/symtab.c: Don't access directly to the symbol tag, use
8487 * src/parse-gram.y: Use symbol_list_free.
8489 2002-06-17 Akim Demaille <akim@epita.fr>
8491 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
8492 (symbol_list_prepend, get_type_name): Move to...
8493 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
8494 (symbol_list_prepend, symbol_list_n_type_name_get): here.
8496 (symbol_list_free): New.
8497 * src/scan-gram.l (handle_dollar): Takes a location.
8498 * tests/input.at (Invalid $n): Adjust.
8500 2002-06-17 Akim Demaille <akim@epita.fr>
8502 * src/reader.h, src/reader.c (symbol_list_new): Export it.
8503 (symbol_list_prepend): New.
8504 * src/parse-gram.y (%union): `list' is a new member.
8505 (symbols.1): New, replaces...
8506 (terms_to_prec.1, nterms_to_type.1): these.
8507 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
8508 Take a location as additional argument.
8511 2002-06-15 Akim Demaille <akim@epita.fr>
8513 * src/parse-gram.y: Move %token in the declaration section so that
8514 we don't depend upon CVS Bison.
8516 2002-06-15 Akim Demaille <akim@epita.fr>
8518 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
8519 * src/print.c (print_core): Use it.
8521 2002-06-15 Akim Demaille <akim@epita.fr>
8523 * src/conflicts.c (log_resolution): Accept the rule involved in
8524 the sr conflicts instead of the lookahead number that points to
8526 (flush_reduce): Accept the current lookahead vector as argument,
8527 instead of the index in LA.
8528 (resolve_sr_conflict): Accept the current number of lookahead
8529 bitset to consider for the STATE, instead of the index in LA.
8530 (set_conflicts): Adjust.
8531 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
8533 2002-06-15 Akim Demaille <akim@epita.fr>
8535 * src/state.h (state_t): Replace the `lookaheadsp' member, a
8536 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
8537 Adjust all dependencies.
8538 * src/lalr.c (initialize_lookaheads): Split into...
8539 (states_lookaheads_count, states_lookaheads_initialize): these.
8542 2002-06-15 Akim Demaille <akim@epita.fr>
8544 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
8546 (grammar_rules_print): here.
8547 * src/reduce.c (reduce_output): Use it.
8548 * tests/reduce.at (Useless Rules, Reduced Automaton)
8549 (Underivable Rules): Adjust.
8551 2002-06-15 Akim Demaille <akim@epita.fr>
8553 Copy BYacc's nice way to report the grammar.
8555 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
8557 Don't print the rules' location, it is confusing and useless.
8558 (rule_print): Use grammar_rhs_print.
8559 * src/print.c (print_grammar): Use grammar_rules_print.
8561 2002-06-15 Akim Demaille <akim@epita.fr>
8563 Complete and rationalize `useless thing' warnings.
8565 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
8566 (symbol_tag_print): New.
8567 Use them everywhere in place of accessing directly the tag member.
8568 * src/gram.h, src/gram.c (rule_print): New.
8569 Use it where a rule used to be printed `by hand'.
8570 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
8571 (reduce_grammar_tables): Report the useless rules.
8572 (reduce_print): Useless things are a warning, not an error.
8574 * tests/reduce.at (Useless Nonterminals, Useless Rules):
8575 (Reduced Automaton, Underivable Rules): Adjust.
8576 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
8577 * tests/conflicts.at (Unresolved SR Conflicts)
8578 (Solved SR Conflicts): Adjust.
8580 2002-06-15 Akim Demaille <akim@epita.fr>
8582 Let symbols have a location.
8584 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
8587 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
8588 Use location_t, not int.
8589 * src/symtab.c (symbol_check_defined): Take advantage of the
8591 * tests/regression.at (Invalid inputs): Adjust.
8593 2002-06-15 Akim Demaille <akim@epita.fr>
8595 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
8596 (input): Don't try to initialize yylloc here, do it in the
8598 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
8599 * src/gram.h (rule_t): Change line and action_line into location
8600 and action_location, of location_t type.
8601 Adjust all dependencies.
8602 * src/location.h, src/location.c (empty_location): New.
8603 * src/reader.h, src/reader.c (grammar_start_symbol_set)
8604 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
8605 (grammar_current_rule_symbol_append)
8606 (grammar_current_rule_action_append): Expect a location as argument.
8607 * src/reader.c (grammar_midrule_action): Adjust to attach an
8608 action's location as dummy symbol location.
8609 * src/symtab.h, src/symtab.c (startsymbol_location): New.
8610 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
8613 2002-06-14 Akim Demaille <akim@epita.fr>
8615 Grammar declarations may be found in the grammar section.
8617 * src/parse-gram.y (rules_or_grammar_declaration): New.
8618 (declarations): Each declaration may end with a semicolon, not
8620 (grammar_declaration): `"%union"'.
8621 (grammar): Branch to rules_or_grammar_declaration.
8623 2002-06-14 Akim Demaille <akim@epita.fr>
8625 * src/main.c (main): Invoke scanner_free.
8627 2002-06-14 Akim Demaille <akim@epita.fr>
8629 * src/output.c (m4_invoke): Extracted from...
8630 (output_skeleton): here.
8633 2002-06-14 Akim Demaille <akim@epita.fr>
8635 * src/parse-gram.y (directives, directive, gram)
8636 (grammar_directives, precedence_directives, precedence_directive):
8638 (declarations, declaration, grammar, grammar_declaration)
8639 (precedence_declaration, precedence_declarator): these.
8640 (symbol_declaration): New.
8642 2002-06-14 Akim Demaille <akim@epita.fr>
8644 * src/files.c (action_obstack): Remove, unused.
8645 (output_obstack): Remove it, and all its dependencies, as it is no
8647 * src/reader.c (epilogue_set): Build the epilogue in the
8649 * src/output.h, src/output.c (muscle_obstack): Move to...
8650 * src/muscle_tab.h, src/muscle_tab.h: here.
8651 (muscle_init): Initialize muscle_obstack.
8653 * src/main.c (main): Call it.
8655 2002-06-14 Akim Demaille <akim@epita.fr>
8657 * src/location.h: New, extracted from...
8658 * src/reader.h: here.
8659 * src/Makefile.am (noinst_HEADERS): Merge into
8660 (bison_SOURCES): this.
8662 * src/parse-gram.y: Use location_t instead of Bison's.
8663 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
8664 Use location_t instead of ints.
8666 2002-06-14 Akim Demaille <akim@epita.fr>
8668 * data/bison.simple, data/bison.c++: Be sure to restore the
8669 current #line when returning to the skeleton contents after having
8670 exposed the input file's #line.
8672 2002-06-12 Akim Demaille <akim@epita.fr>
8674 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
8676 * tests/actions.at (Exotic Dollars): New.
8678 2002-06-12 Akim Demaille <akim@epita.fr>
8680 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
8682 * tests/input.at (Torturing the Scanner): New.
8684 2002-06-11 Akim Demaille <akim@epita.fr>
8686 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
8687 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
8688 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
8689 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
8690 * src/reader.c (reader): Use it.
8692 2002-06-11 Akim Demaille <akim@epita.fr>
8694 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
8696 (scanner_last_string_free): New.
8698 2002-06-11 Akim Demaille <akim@epita.fr>
8700 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
8701 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
8702 (last_string, YY_OBS_FREE): New.
8703 Use them when returning an ID.
8705 2002-06-11 Akim Demaille <akim@epita.fr>
8707 Have Bison grammars parsed by a Bison grammar.
8709 * src/reader.c, src/reader.h (prologue_augment): New.
8710 * src/reader.c (copy_definition): Remove.
8712 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
8713 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
8714 (grammar_current_rule_prec_set, grammar_current_rule_check)
8715 (grammar_current_rule_symbol_append)
8716 (grammar_current_rule_action_append): Export.
8717 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
8718 (symbol_list_action_append): Remove.
8719 Hook the routines from reader.
8720 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
8721 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
8723 * src/reader.c (read_declarations): Remove, unused.
8725 * src/parse-gram.y: Handle the epilogue.
8726 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
8727 (grammar_start_symbol_set): this.
8728 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
8729 * src/reader.c (readgram): Remove, unused.
8730 (reader): Adjust to insert eoftoken and axiom where appropriate.
8732 * src/reader.c (copy_dollar): Replace with...
8733 * src/scan-gram.h (handle_dollar): this.
8734 * src/parse-gram.y: Remove `%thong'.
8736 * src/reader.c (copy_at): Replace with...
8737 * src/scan-gram.h (handle_at): this.
8739 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
8742 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
8745 * src/reader.h, src/reader.c (grammar_rule_end): New.
8747 * src/parse.y (current_type, current_class): New.
8748 Implement `%nterm', `%token' support.
8749 Merge `%term' into `%token'.
8750 (string_as_id): New.
8751 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
8754 * src/parse-gram.y: Be sure to handle properly the beginning of
8757 * src/parse-gram.y: Handle %type.
8758 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
8760 * src/parse-gram.y: More directives support.
8761 * src/options.c: No longer handle source directives.
8763 * src/parse-gram.y: Fix %output.
8765 * src/parse-gram.y: Handle %union.
8766 Use the prologue locations.
8767 * src/reader.c (parse_union_decl): Remove.
8769 * src/reader.h, src/reader.c (epilogue_set): New.
8770 * src/parse-gram.y: Use it.
8772 * data/bison.simple, data/bison.c++: b4_stype is now either not
8773 defined, then default to int, or to the contents of %union,
8774 without `union' itself.
8776 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
8778 * src/output.c (actions_output): Don't output braces, as they are
8779 already handled by the scanner.
8781 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
8782 characters to themselves.
8784 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
8785 that the epilogue has a proper #line.
8787 * src/parse-gram.y: Handle precedence/associativity.
8789 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
8791 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
8792 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
8793 at all to define terminals that cannot be emitted.
8795 * src/scan-gram.l: Escape M4 characters.
8797 * src/scan-gram.l: Working properly with escapes in user
8800 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
8801 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
8803 Use more modest sizes, as for the time being the parser does not
8804 release memory, and therefore the process swallows a huge amount
8807 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
8808 stricter %token grammar.
8810 * src/symtab.h (associativity): Add `undef_assoc'.
8811 (symbol_precedence_set): Do nothing when passed an undef_assoc.
8812 * src/symtab.c (symbol_check_alias_consistence): Adjust.
8814 * tests/regression.at (Invalid %directive): Remove, as it is now
8816 (Invalid inputs): Adjust to the new error messages.
8817 (Token definitions): The new grammar doesn't allow too many
8820 * src/lex.h, src/lex.c: Remove.
8821 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
8822 (copy_character, copy_string2, copy_string, copy_identifier)
8823 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
8824 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
8825 (parse_action): Remove.
8826 * po/POTFILES.in: Adjust.
8828 2002-06-11 Akim Demaille <akim@epita.fr>
8830 * src/reader.c (parse_action): Don't store directly into the
8831 rule's action member: return the action as a string.
8832 Don't require `rule_length' as an argument: compute it.
8833 (grammar_current_rule_symbol_append)
8834 (grammar_current_rule_action_append): New, eved out from
8836 Remove `action_flag', `rulelength', unused now.
8838 2002-06-11 Akim Demaille <akim@epita.fr>
8840 * src/reader.c (grammar_current_rule_prec_set).
8841 (grammar_current_rule_check): New, eved out from...
8843 Remove `xaction', `first_rhs': useless.
8844 * tests/input.at (Type clashes): New.
8845 * tests/existing.at (GNU Cim Grammar): Adjust.
8847 2002-06-11 Akim Demaille <akim@epita.fr>
8849 * src/reader.c (grammar_midrule_action): New, Eved out from
8852 2002-06-11 Akim Demaille <akim@epita.fr>
8854 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
8856 (readgram): Use them as replacement of inlined code, crule and
8859 2002-06-11 Akim Demaille <akim@epita.fr>
8861 * src/reader.c (grammar_end, grammar_symbol_append): New.
8862 (readgram): Use them.
8863 Make the use of `p' as local as possible.
8865 2002-06-10 Akim Demaille <akim@epita.fr>
8867 GCJ's parser requires the tokens to be defined before the prologue.
8869 * data/bison.simple: Output the token definition before the user's
8871 * tests/regression.at (Braces parsing, Duplicate string)
8872 (Mixing %token styles): Check the output from bison.
8873 (Early token definitions): New.
8875 2002-06-10 Akim Demaille <akim@epita.fr>
8877 * src/symtab.c (symbol_user_token_number_set): Don't complain when
8878 assigning twice the same user number to a token, so that we can
8880 * src/lex.c (lex): here.
8881 Also use `symbol_class_set' instead of hand written code.
8882 * src/reader.c (parse_assoc_decl): Likewise.
8884 2002-06-10 Akim Demaille <akim@epita.fr>
8886 * src/symtab.c, src/symtab.c (symbol_class_set)
8887 (symbol_user_token_number_set): New.
8888 * src/reader.c (parse_token_decl): Use them.
8889 Use a switch instead of ifs.
8890 Use a single argument.
8892 2002-06-10 Akim Demaille <akim@epita.fr>
8894 Remove `%thong' support as it is undocumented, unused, duplicates
8895 `%token's job, and creates useless e-mail traffic with people who
8896 want to know what it is, why it is undocumented, unused, and
8897 duplicates `%token's job.
8899 * src/reader.c (parse_thong_decl): Remove.
8900 * src/options.c (option_table): Remove "thong".
8901 * src/lex.h (tok_thong): Remove.
8903 2002-06-10 Akim Demaille <akim@epita.fr>
8905 * src/symtab.c, src/symtab.c (symbol_type_set)
8906 (symbol_precedence_set): New.
8907 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
8908 (value_components_used): Remove, unused.
8910 2002-06-09 Akim Demaille <akim@epita.fr>
8912 Move symbols handling code out of the reader.
8914 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
8916 * src/symtab.h, src/symtab.c: here.
8918 * src/gram.c (start_symbol): Remove: use startsymbol->number.
8919 * src/reader.c (startval): Rename as...
8920 * src/symtab.h, src/symtab.c (startsymbol): this.
8921 * src/reader.c: Adjust.
8923 * src/reader.c (symbol_check_defined, symbol_make_alias)
8924 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
8925 (token_translations_init)
8927 * src/symtab.c: here.
8928 * src/reader.c (packsymbols): Move to...
8929 * src/symtab.h, src/symtab.c (symbols_pack): here.
8930 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
8933 2002-06-03 Akim Demaille <akim@epita.fr>
8935 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
8938 2002-06-03 Akim Demaille <akim@epita.fr>
8940 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
8941 structs with non literals.
8942 * src/scan-skel.l: never-interactive.
8943 * src/conflicts.c (enum conflict_resolution_e): No trailing
8945 * src/getargs.c (usage): Split long literal strings.
8946 Reported by Hans Aberg.
8948 2002-05-28 Akim Demaille <akim@epita.fr>
8950 * data/bison.c++: Use C++ ostreams.
8951 (cdebug_): New member.
8953 2002-05-28 Akim Demaille <akim@epita.fr>
8955 * src/output.c (output_skeleton): Be sure to allocate enough room
8956 for `/' _and_ for `\0' in full_skeleton.
8958 2002-05-28 Akim Demaille <akim@epita.fr>
8960 * data/bison.c++: Catch up with bison.simple:
8961 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8962 and Paul Eggert <eggert@twinsun.com>: `error' handing.
8963 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
8966 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8968 * src/output.c (output_skeleton): Put an explicit path in front of
8969 the skeleton file name, rather than relying on the -I directory,
8970 to partially alleviate effects of having a skeleton file lying around
8971 in the current directory.
8973 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8975 * src/conflicts.c (log_resolution): Correct typo:
8976 obstack_printf should be obstack_fgrow1.
8978 2002-05-26 Akim Demaille <akim@epita.fr>
8980 * src/state.h (state_t): `solved_conflicts' is a new member.
8981 * src/LR0.c (new_state): Set it to 0.
8982 * src/conflicts.h, src/conflicts.c (print_conflicts)
8983 (free_conflicts, solve_conflicts): Rename as...
8984 (conflicts_print, conflicts_free, conflicts_solve): these.
8986 * src/conflicts.c (enum conflict_resolution_e)
8987 (solved_conflicts_obstack): New, used by...
8988 (log_resolution): this.
8989 Adjust to attach the conflict resolution to each state.
8990 Complete the description with the precedence/associativity
8992 (resolve_sr_conflict): Adjust.
8993 * src/print.c (print_state): Output its solved_conflicts.
8994 * tests/conflicts.at (Unresolved SR Conflicts)
8995 (Solved SR Conflicts): Exercise --report=all.
8997 2002-05-26 Akim Demaille <akim@epita.fr>
8999 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
9000 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
9001 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
9002 (token_number_t, item_number_as_token_number)
9003 (token_number_as_item_number, muscle_insert_token_number_table):
9005 (symbol_number_t, item_number_as_symbol_number)
9006 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
9007 these, since it is more appropriate.
9009 2002-05-26 Akim Demaille <akim@epita.fr>
9011 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
9013 * data/bison.simple (yystos) [YYDEBUG]: New.
9014 (yyparse) [YYDEBUG]: Display the symbols which are popped during
9016 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
9018 2002-05-25 Akim Demaille <akim@epita.fr>
9020 * doc/bison.texinfo (Debugging): Split into...
9021 (Tracing): this new section, its former contents, and...
9022 (Understanding): this new section.
9023 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
9025 (report_flag): this.
9026 Adjust all dependencies.
9027 (report_args, report_types, report_argmatch): New.
9028 (usage, getargs): Report/support -r, --report.
9030 (struct option_table_struct): Rename as..,
9031 (struct option_table_s): this.
9032 Rename the `set_flag' member to `flag' to match with getopt_long's
9034 * src/options.c (option_table): Split verbose into an entry for
9035 %verbose, and another for --verbose.
9036 Support --report/-r, so remove -r from the obsolete --raw.
9037 * src/print.c: Attach full item sets and lookaheads reports to
9038 report_flag instead of trace_flag.
9039 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
9041 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9042 and Paul Eggert <eggert@twinsun.com>
9044 * data/bison.simple (yyparse): Correct error handling to conform to
9045 POSIX and yacc. Specifically, after syntax error is discovered,
9046 do not reduce further before shifting the error token.
9047 Clean up the code a bit by removing the labels yyerrdefault,
9048 yyerrhandle, yyerrpop.
9049 * NEWS: Document the above.
9051 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9053 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
9054 type; it isn't always big enough, since it doesn't necessarily
9055 include non-terminals.
9056 (yytranslate): Expand definition of yy_token_number_type, so that
9057 the latter can be removed.
9058 (yy_token_number_type): Remove, only one use.
9059 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
9060 don't use TokenNumberType as element type.
9062 * tests/regression.at: Modify expected output to agree with change
9063 to yyr1 and yytranslate.
9065 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
9067 * src/reader.c (parse_action): Use copy_character instead of
9070 2002-05-13 Akim Demaille <akim@epita.fr>
9072 * tests/regression.at (Token definitions): Prototype yylex and
9075 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9077 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
9078 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
9080 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
9082 2002-05-07 Akim Demaille <akim@epita.fr>
9084 * tests/synclines.at: Be sure to prototype yylex and yyerror to
9087 2002-05-07 Akim Demaille <akim@epita.fr>
9091 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
9092 over the RHS of each rule.
9093 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
9094 * src/state.h (state_t): Member `nitems' is unsigned short.
9095 * src/LR0.c (get_state): Adjust.
9096 * src/reader.c (packgram): Likewise.
9097 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
9099 (muscle_insert_int_table): Remove, unused.
9100 (prepare_rules): Remove `max'.
9102 2002-05-06 Akim Demaille <akim@epita.fr>
9104 * src/closure.c (print_firsts): Display of the symbol tags.
9105 (bitmatrix_print): Move to...
9106 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
9108 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
9110 2002-05-06 Akim Demaille <akim@epita.fr>
9112 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
9115 2002-05-06 Akim Demaille <akim@epita.fr>
9117 * src/LR0.c (new_state, get_state): Instead of using the global
9118 `kernel_size' and `kernel_base', have two new arguments:
9119 `core_size' and `core'.
9122 2002-05-06 Akim Demaille <akim@epita.fr>
9124 * src/reader.c (packgram): No longer end `ritem' with a 0
9125 sentinel: it is not used.
9127 2002-05-05 Akim Demaille <akim@epita.fr>
9129 New experimental feature: display the lookaheads in the report and
9132 * src/print (print_core): When --trace-flag, display the rules
9134 * src/print_graph.c (print_core): Likewise.
9138 2002-05-05 Akim Demaille <akim@epita.fr>
9140 * tests/torture.at (Many lookaheads): New test.
9142 2002-05-05 Akim Demaille <akim@epita.fr>
9144 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
9145 (GENERATE_MUSCLE_INSERT_TABLE): this.
9146 (output_int_table, output_unsigned_int_table, output_short_table)
9147 (output_token_number_table, output_item_number_table): Replace with...
9148 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
9149 (muscle_insert_short_table, muscle_insert_token_number_table)
9150 (muscle_insert_item_number_table): these.
9152 (prepare_tokens): Don't free `translations', since...
9153 * src/reader.h, src/reader.c (grammar_free): do it.
9155 * src/gram.h, src/gram.c (grammar_free): here.
9156 * data/bison.simple, data/bison.c++: b4_token_number_max is now
9159 2002-05-05 Akim Demaille <akim@epita.fr>
9161 * src/output.c (output_unsigned_int_table): New.
9162 (prepare_rules): `i' is unsigned.
9163 `prhs', `rline', `r2' are unsigned int.
9164 Rename muscle `rhs_number_max' as `rhs_max'.
9165 Output muscles `prhs_max', `rline_max', and `r2_max'.
9167 * data/bison.simple, data/bison.c++: Adjust to use these muscles
9168 to compute types instead of constant types.
9169 * tests/regression.at (Web2c Actions): Adjust.
9171 2002-05-04 Akim Demaille <akim@epita.fr>
9173 * src/symtab.h (SALIAS, SUNDEF): Rename as...
9174 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
9175 Adjust dependencies.
9176 * src/output.c (token_definitions_output): Be sure not to output a
9177 `#define 'a'' when fed with `%token 'a' "a"'.
9178 * tests/regression.at (Token definitions): New.
9180 2002-05-03 Paul Eggert <eggert@twinsun.com>
9182 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
9185 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
9187 * Makefile.am (SUBDIRS): Remove intl.
9188 (EXTRA_DIST): Add config/config.rpath.
9190 2002-05-03 Akim Demaille <akim@epita.fr>
9192 * data/bison.simple (m4_if): Don't output empty enums.
9193 And actually, output valid enum definitions :(.
9195 2002-05-03 Akim Demaille <akim@epita.fr>
9197 * configure.bat: Remove, completely obsolete.
9198 * Makefile.am (EXTRA_DIST): Adjust.
9199 Don't distribute config.rpath...
9200 * config/Makefile.am (EXTRA_DIST): Do it.
9202 2002-05-03 Akim Demaille <akim@epita.fr>
9204 * configure.in (GETTEXT_VERSION): New.
9205 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
9207 2002-05-03 Akim Demaille <akim@epita.fr>
9209 * data/bison.simple (b4_token_enum): New.
9210 (b4_token_defines): Use it to output tokens both as #define and
9212 Suggested by Paul Eggert.
9213 * src/output.c (token_definitions_output): Don't output spurious
9216 2002-05-03 Akim Demaille <akim@epita.fr>
9218 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
9220 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
9222 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
9223 Update the stack class, give a try to deque as the default container.
9225 2002-05-02 Akim Demaille <akim@epita.fr>
9227 * data/bison.simple (yyparse): Do not implement @$ = @1.
9228 (YYLLOC_DEFAULT): Adjust to do it.
9229 * doc/bison.texinfo (Location Default Action): Fix.
9231 2002-05-02 Akim Demaille <akim@epita.fr>
9233 * src/reader.c (parse_braces): Merge into...
9234 (parse_action): this.
9236 2002-05-02 Akim Demaille <akim@epita.fr>
9238 * configure.in (ALL_LINGUAS): Remove.
9239 * po/LINGUAS, hr.po: New.
9241 2002-05-02 Akim Demaille <akim@epita.fr>
9243 Remove the so called hairy (semantic) parsers.
9245 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
9246 * src/gram.h, src/gram.c (semantic_parser): Remove.
9247 (rule_t): Remove the guard and guard_line members.
9248 * src/lex.h (token_t): remove tok_guard.
9249 * src/options.c (option_table): Remove %guard and %semantic_parser
9251 * src/output.c, src/output.h (guards_output): Remove.
9253 (token_definitions_output): Don't output the `T'
9255 (output_skeleton): Don't output the guards.
9256 * src/files.c, src/files.c (attrsfile): Remove.
9257 * src/reader.c (symbol_list): Remove the guard and guard_line
9259 Adjust dependencies.
9260 (parse_guard): Remove.
9261 * data/bison.hairy: Remove.
9262 * doc/bison.texinfo (Environment Variables): Remove occurrences of
9265 2002-05-02 Akim Demaille <akim@epita.fr>
9267 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
9268 (parse_guard): Rename the formal argument `stack_offset' as
9269 `rule_length', which is more readable.
9271 (copy_at, copy_dollar): Instead of outputting the hard coded
9272 values of $$, $n and so forth, output invocation to b4_lhs_value,
9273 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
9274 Note: this patch partially drops `semantic-parser' support: it
9275 always does `rule_length - n', where semantic parsers ought to
9277 * data/bison.simple, data/bison.c++ (b4_lhs_value)
9278 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
9280 2002-05-02 Akim Demaille <akim@epita.fr>
9282 * configure.in (AC_INIT): Bump to 1.49b.
9283 (AM_INIT_AUTOMAKE): Short invocation.
9285 2002-05-02 Akim Demaille <akim@epita.fr>
9289 2002-05-01 Akim Demaille <akim@epita.fr>
9291 * src/skeleton.h: Remove.
9293 2002-05-01 Akim Demaille <akim@epita.fr>
9295 * src/skeleton.h: Fix the #endif.
9296 Reported by Magnus Fromreide.
9298 2002-04-26 Paul Eggert <eggert@twinsun.com>
9300 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
9301 Define if we define YYSTYPE and YYLTYPE, respectively.
9302 (YYCOPY): Fix [] quoting problem in the non-GCC case.
9304 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
9306 * src/scan-skel.l: Postprocess quadrigraphs.
9308 * src/reader.c (copy_character): New function, used to output
9309 single characters while replacing `[' and `]' with quadrigraphs, to
9310 avoid troubles with M4 quotes.
9311 (copy_comment): Output characters with copy_character.
9312 (read_additionnal_code): Likewise.
9313 (copy_string2): Likewise.
9314 (copy_definition): Likewise.
9316 * tests/calc.at: Exercise M4 quoting.
9318 2002-04-25 Akim Demaille <akim@epita.fr>
9320 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
9321 between `!' and the command.
9322 Reported by Paul Eggert.
9324 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
9326 * tests/calc.at: Exercise prologue splitting.
9328 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
9329 `b4_post_prologue' instead of `b4_prologue'.
9331 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
9333 (output): Free pre_prologue_obstack and post_prologue_obstack.
9334 * src/files.h, src/files.c (attrs_obstack): Remove.
9335 (pre_prologue_obstack, post_prologue_obstack): New.
9336 * src/reader.c (copy_definition): Add a parameter to specify the
9337 obstack to fill, instead of using attrs_obstack unconditionally.
9338 (read_declarations): Pass pre_prologue_obstack to copy_definition if
9339 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
9341 2002-04-23 Paul Eggert <eggert@twinsun.com>
9343 * data/bison.simple: Remove unnecessary commentary and white
9344 space differences from 1_29-branch.
9345 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
9347 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
9348 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
9349 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
9350 constructors or destructors.
9352 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
9354 2002-04-23 Akim Demaille <akim@epita.fr>
9356 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
9357 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
9358 location with columns.
9359 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
9360 All reported by Paul Eggert.
9362 2002-04-22 Akim Demaille <akim@epita.fr>
9364 * src/reduce.c (dump_grammar): Move to...
9365 * src/gram.h, src/gram.c (grammar_dump): here.
9366 Be sure to separate long item numbers.
9367 Don't read the members of a rule's prec if its nil.
9369 2002-04-22 Akim Demaille <akim@epita.fr>
9371 * src/output.c (table_size, table_grow): New.
9372 (MAXTABLE): Remove, replace uses with table_size.
9373 (pack_vector): Instead of dying when the table is too big, grow it.
9375 2002-04-22 Akim Demaille <akim@epita.fr>
9377 * data/bison.simple (yyr1): Its type is that of a token number.
9378 * data/bison.c++ (r1_): Likewise.
9379 * tests/regression.at (Web2c Actions): Adjust.
9381 2002-04-22 Akim Demaille <akim@epita.fr>
9383 * src/reader.c (token_translations_init): 256 is now the default
9384 value for the error token, i.e., it will be assigned another
9385 number if the user assigned 256 to one of her tokens.
9386 (reader): Don't force 256 to error.
9387 * doc/bison.texinfo (Symbols): Adjust.
9388 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
9389 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
9390 etc. instead of 10, 20, 30 (which was used to `jump' over error
9391 (256) and undefined (2)).
9393 2002-04-22 Akim Demaille <akim@epita.fr>
9395 Propagate more token_number_t.
9397 * src/gram.h (token_number_as_item_number)
9398 (item_number_as_token_number): New.
9399 * src/output.c (GENERATE_OUTPUT_TABLE): New.
9400 Use it to create output_item_number_table and
9401 output_token_number_table.
9402 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
9403 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
9404 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
9405 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
9407 2002-04-22 Akim Demaille <akim@epita.fr>
9409 * src/output.h, src/output.c (get_lines_number): Remove.
9411 2002-04-19 Akim Demaille <akim@epita.fr>
9413 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
9415 (Debugging): More details about enabling the debugging features.
9416 (Table of Symbols): Describe $$, $n, @$, and @n.
9417 Suggested by Tim Josling.
9419 2002-04-19 Akim Demaille <akim@epita.fr>
9421 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
9423 2002-04-10 Akim Demaille <akim@epita.fr>
9425 * src/system.h: Rely on HAVE_LIMITS_H.
9426 Suggested by Paul Eggert.
9428 2002-04-09 Akim Demaille <akim@epita.fr>
9430 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
9431 full stderr, and strip it according to the bison options, instead
9432 of composing the error message from different bits.
9433 This makes it easier to check for several error messages.
9434 Adjust all the invocations.
9435 Add an invocation exercising the error token.
9436 Add an invocation demonstrating a stupid error message.
9437 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
9439 Error message are for stderr, not stdout.
9441 2002-04-09 Akim Demaille <akim@epita.fr>
9443 * src/gram.h, src/gram.c (error_token_number): Remove, use
9445 * src/reader.c (reader): Don't specify the user token number (2)
9446 for $undefined, as it uselessly prevents using it.
9447 * src/gram.h (token_number_t): Move to...
9448 * src/symtab.h: here.
9449 (state_t.number): Is a token_number_t.
9450 * src/print.c, src/reader.c: Use undeftoken->number instead of
9452 (Even though this 2 is not the same as above: the number of the
9453 undeftoken remains being 2, it is its user token number which
9455 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
9456 `user_token_number_max'.
9457 Output `undef_token_number'.
9458 * data/bison.simple, data/bison.c++: Use them.
9459 Be sure to map invalid yylex return values to
9460 `undef_token_number'. This saves us from gratuitous SEGV.
9462 * tests/conflicts.at (Solved SR Conflicts)
9463 (Unresolved SR Conflicts): Adjust.
9464 * tests/regression.at (Web2c Actions): Adjust.
9466 2002-04-08 Akim Demaille <akim@epita.fr>
9468 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
9470 Remove the duplicate `typedefs'.
9471 (RhsNumberType): Fix the declaration and various other typos.
9473 * data/bison.simple: Use __ofile__.
9474 * src/scan-skel.l: Handle __ofile__.
9476 2002-04-08 Akim Demaille <akim@epita.fr>
9478 * src/gram.h (item_number_t): New, the type of item numbers in
9479 RITEM. Note that it must be able to code symbol numbers as
9480 positive number, and the negation of rule numbers as negative
9482 Adjust all dependencies (pretty many).
9483 * src/reduce.c (rule): Remove this `short *' pointer: use
9485 * src/system.h (MINSHORT, MAXSHORT): Remove.
9487 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
9489 (MAXTABLE): Move to...
9490 * src/output.c (MAXTABLE): here.
9491 (prepare_rules): Use output_int_table to output rhs.
9492 * data/bison.simple, data/bison.c++: Adjust.
9493 * tests/torture.at (Big triangle): Move the limit from 254 to
9495 * tests/regression.at (Web2c Actions): Ajust.
9497 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
9498 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
9499 passes, but produces negative #line number, once fixed, GCC is
9500 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
9502 * src/state.h (state_h): Code input lines on ints, not shorts.
9504 2002-04-08 Akim Demaille <akim@epita.fr>
9506 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
9507 and then the grammar.
9509 2002-04-08 Akim Demaille <akim@epita.fr>
9511 * src/system.h: No longer using strndup.
9513 2002-04-07 Akim Demaille <akim@epita.fr>
9515 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
9516 * src/output.c (output_table_data): Return the longest number.
9517 (prepare_tokens): Output `token_number_max').
9518 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
9520 Use them to define yy_token_number_type/TokenNumberType.
9521 Use this type for yytranslate.
9522 * tests/torture.at (Big triangle): Push the limit from 124 to
9524 * tests/regression.at (Web2c Actions): Adjust.
9526 2002-04-07 Akim Demaille <akim@epita.fr>
9528 * tests/torture.at (Big triangle): New.
9529 (GNU AWK Grammar, GNU Cim Grammar): Move to...
9530 * tests/existing.at: here.
9532 2002-04-07 Akim Demaille <akim@epita.fr>
9534 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
9536 Adjust dependencies.
9538 2002-04-07 Akim Demaille <akim@epita.fr>
9540 * src/reader.c: Normalize increments to prefix form.
9542 2002-04-07 Akim Demaille <akim@epita.fr>
9544 * src/reader.c, symtab.c: Remove debugging code.
9546 2002-04-07 Akim Demaille <akim@epita.fr>
9548 Rename all the `bucket's as `symbol_t'.
9550 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
9551 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
9552 * src/symtab.c, src/symtab.h (bucket): Rename as...
9554 (symbol_list_new, bucket_check_defined, bucket_make_alias)
9555 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
9556 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
9557 (buckets_new, buckets_free, buckets_do): Rename as...
9558 (symbol_list_new, symbol_check_defined, symbol_make_alias)
9559 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
9560 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
9561 (symbols_new, symbols_free, symbols_do): these.
9563 2002-04-07 Akim Demaille <akim@epita.fr>
9565 Use lib/hash for the symbol table.
9567 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
9569 * src/lex.c (lex): Set the `number' member of new terminals.
9570 * src/reader.c (bucket_check_defined, bucket_make_alias)
9571 (bucket_check_alias_consistence, bucket_translation): New.
9572 (reader, grammar_free, readgram, token_translations_init)
9573 (packsymbols): Adjust.
9574 (reader): Number the predefined tokens.
9575 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
9576 for predefined tokens.
9577 * src/symtab.h (bucket): Remove all the hash table related
9579 * src/symtab.c (symtab): Replace by...
9580 (bucket_table): this.
9581 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
9582 (buckets_new, buckets_do): New.
9584 2002-04-07 Akim Demaille <akim@epita.fr>
9586 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
9587 (start_symbol, max_user_token_number, semantic_parser)
9588 (error_token_number): Initialize.
9589 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
9592 (errtoken, eoftoken, undeftoken, axiom): Extern.
9594 2002-04-07 Akim Demaille <akim@epita.fr>
9596 * src/gram.h (rule_s): prec and precsym are now pointers
9597 to the bucket giving the priority/associativity.
9598 Member `associativity' removed: useless.
9599 * src/reduce.c, src/conflicts.c: Adjust.
9601 2002-04-07 Akim Demaille <akim@epita.fr>
9603 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
9604 Properly escape the symbols' TAG when outputting them.
9606 2002-04-07 Akim Demaille <akim@epita.fr>
9608 * src/lalr.h (LA): Is a bitsetv, not bitset*.
9610 2002-04-07 Akim Demaille <akim@epita.fr>
9612 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
9613 (LArule): this, which is an array to rule_t*.
9614 * src/print.c, src/conflicts.c: Adjust.
9616 2002-04-07 Akim Demaille <akim@epita.fr>
9618 * src/gram.h (rule_t): Rename `number' as `user_number'.
9619 `number' is a new member.
9620 Adjust dependencies.
9621 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
9623 2002-04-07 Akim Demaille <akim@epita.fr>
9625 As a result of the previous patch, it is no longer needed
9626 to reorder ritem itself.
9628 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
9630 2002-04-07 Akim Demaille <akim@epita.fr>
9632 Be sure never to walk through RITEMS, but use only data related to
9633 the rules themselves. RITEMS should be banished.
9635 * src/output.c (output_token_translations): Rename as...
9636 (prepare_tokens): this.
9637 In addition to `translate', prepare the muscles `tname' and
9638 `toknum', which were handled by...
9639 (output_rule_data): this.
9640 Remove, and move the remainder of its outputs into...
9641 (prepare_rules): this new routines, which also merges content from
9642 (output_gram): this.
9643 (prepare_rules): Be sure never to walk through RITEMS.
9644 (output_stos): Rename as...
9645 (prepare_stos): this.
9646 (output): Always invoke prepare_states, after all, just don't use it
9647 in the output if you don't need it.
9649 2002-04-07 Akim Demaille <akim@epita.fr>
9651 * src/LR0.c (new_state): Display `nstates' as the name of the
9652 newly created state.
9653 Adjust to initialize first_state and last_state if needed.
9654 Be sure to distinguish the initial from the final state.
9655 (new_states): Create the itemset of the initial state, and use
9657 * src/closure.c (closure): Now that the initial state has its
9658 items properly set, there is no need for a special case when
9661 As a result, now the rule 0, reducing to $axiom, is visible in the
9662 outputs. Adjust the test suite.
9664 * tests/conflicts.at (Solved SR Conflicts)
9665 (Unresolved SR Conflicts): Adjust.
9666 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
9667 * tests/conflicts.at (S/R in initial): New.
9669 2002-04-07 Akim Demaille <akim@epita.fr>
9671 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
9672 the RHS of the rules.
9673 * src/output.c (output_gram): Likewise.
9675 2002-04-07 Akim Demaille <akim@epita.fr>
9677 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
9679 Adjust all dependencies.
9680 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
9681 `number' of the buckets too.
9682 * src/gram.h: Include `symtab.h'.
9683 (associativity): Move to...
9684 * src/symtab.h: here.
9685 No longer include `gram.h'.
9687 2002-04-07 Akim Demaille <akim@epita.fr>
9689 * src/gram.h, src/gram.c (rules_rhs_length): New.
9690 (ritem_longest_rhs): Use it.
9691 * src/gram.h (rule_t): `number' is a new member.
9692 * src/reader.c (packgram): Set it.
9693 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
9694 the end of `rules', and count them out of `nrules'.
9695 (reduce_output, dump_grammar): Adjust.
9696 * src/print.c (print_grammar): It is no longer needed to check for
9697 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
9698 * tests/reduce.at (Reduced Automaton): New test.
9700 2002-04-07 Akim Demaille <akim@epita.fr>
9702 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
9703 lacking `+ 1' to nrules, Bison reported as useless a token if it
9704 was used solely to set the precedence of the last rule...
9706 2002-04-07 Akim Demaille <akim@epita.fr>
9708 * data/bison.c++, data/bison.simple: Don't output the current file
9709 name in #line, to avoid useless diffs between two identical
9710 outputs under different names.
9712 2002-04-07 Akim Demaille <akim@epita.fr>
9714 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
9715 Normalize loops to using `< nrules + 1', not `<= nrules'.
9717 2002-04-07 Akim Demaille <akim@epita.fr>
9721 2002-04-07 Akim Demaille <akim@epita.fr>
9723 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
9724 bucket.value as bucket.number.
9726 2002-04-07 Akim Demaille <akim@epita.fr>
9728 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
9729 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
9730 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
9731 RHS, instead of being an index in RITEMS.
9733 2002-04-04 Paul Eggert <eggert@twinsun.com>
9735 * doc/bison.texinfo: Update copyright date.
9736 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
9737 (Symbols): Warn about running Bison in one character set,
9738 but compiling and/or running in an incompatible one.
9739 Warn about character code 256, too.
9741 2002-04-03 Paul Eggert <eggert@twinsun.com>
9743 * src/bison.data (YYSTACK_ALLOC): Depend on whether
9744 YYERROR_VERBOSE is nonzero, not whether it is defined.
9746 Merge changes from bison-1_29-branch.
9748 2002-03-20 Paul Eggert <eggert@twinsun.com>
9750 Merge fixes from Debian bison_1.34-1.diff.
9752 * configure.in (AC_PREREQ): 2.53.
9754 2002-03-20 Akim Demaille <akim@epita.fr>
9756 * src/conflicts.c (log_resolution): Argument `resolution' is const.
9758 2002-03-19 Paul Eggert <eggert@twinsun.com>
9760 * src/bison.simple (YYCOPY): New macro.
9761 (YYSTACK_RELOCATE): Use it.
9762 Remove Type arg; no longer needed. All callers changed.
9763 (yymemcpy): Remove; no longer needed.
9765 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
9766 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9768 2002-03-19 Akim Demaille <akim@epita.fr>
9770 Test and fix the #line outputs.
9772 * tests/atlocal.at (GCC): New.
9773 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
9774 (Prologue synch line, %union synch line, Postprologue synch line)
9775 (Action synch line, Epilogue synch line): New tests.
9776 * src/reader.c (parse_union_decl): Define the muscle stype_line.
9777 * data/bison.simple, data/bison.c++: Use it.
9779 2002-03-19 Akim Demaille <akim@epita.fr>
9781 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
9782 (Solved SR Conflicts, %expect not enough, %expect right)
9783 (%expect too much): Move to...
9784 * tests/conflicts.at: this new file.
9786 2002-03-19 Akim Demaille <akim@epita.fr>
9788 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
9789 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
9790 that we can move to enums for instance.
9791 * src/output.c (token_definitions_output): Output a list of
9792 `token-name, token-number' instead of the #define.
9793 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
9795 2002-03-14 Akim Demaille <akim@epita.fr>
9799 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
9801 * data/bison.c++: Make the user able to add members to the generated
9802 parser by subclassing.
9804 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
9806 * src/reader.c (read_additionnal_code): `c' should be an integer, not
9808 Reported by Nicolas Tisserand and Nicolas Burrus.
9810 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
9812 * src/reader.c: Warn about lacking semi-colons, do not complain.
9814 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
9816 * data/bison.c++: Remove a debug line.
9818 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
9820 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
9821 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
9822 provide a default implementation.
9824 2002-03-04 Akim Demaille <akim@epita.fr>
9826 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
9827 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
9828 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
9829 * tests/semantic.at (Parsing Guards): Similarly.
9830 * src/reader.at (readgram): Complain if the last rule is not ended
9833 2002-03-04 Akim Demaille <akim@epita.fr>
9835 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
9836 * src/closure.c: here.
9837 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
9839 * src/warshall.h, src/warshall.c: Remove.
9840 * tests/sets.at (Broken Closure): Adjust.
9842 2002-03-04 Akim Demaille <akim@epita.fr>
9844 * src/output.c (output_skeleton): tempdir is const.
9845 bytes_read is unused.
9847 2002-03-04 Akim Demaille <akim@epita.fr>
9849 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
9850 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
9854 2002-03-04 Akim Demaille <akim@epita.fr>
9856 * src/closure.c (closure): `r' is unused.
9858 2002-03-04 Akim Demaille <akim@epita.fr>
9860 * tests/sets.at (Broken Closure): Add the ending `;'.
9861 * src/reader.at (readgram): Complain if a rule is not ended with a
9864 2002-03-04 Akim Demaille <akim@epita.fr>
9866 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
9867 (count_sr_conflicts): Use bitset_count.
9868 * src/reduce.c (inaccessable_symbols): Ditto.
9869 (bits_size): Remove.
9870 * src/warshall.h, src/warshall.c: Convert to bitsetv.
9872 2002-03-04 Akim Demaille <akim@epita.fr>
9874 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
9875 * src/reduce.c: Remove the `bitset_zero's following the
9876 `bitset_create's, as now it is performed by the latter.
9878 2002-03-04 Akim Demaille <akim@epita.fr>
9880 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
9881 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
9882 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
9883 latest sources from Michael.
9885 2002-03-04 Akim Demaille <akim@epita.fr>
9887 * src/output.c (output): Don't free the grammar.
9888 * src/reader.c (grammar_free): New.
9889 * src/main.c (main): Call it and don't free symtab here.
9891 2002-03-04 Akim Demaille <akim@epita.fr>
9893 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
9895 Reported by Benoit Perrot.
9897 2002-03-04 Akim Demaille <akim@epita.fr>
9899 Use bitset operations when possible, not loops over bits.
9901 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
9903 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
9904 * src/reduce.c (useless_nonterminals): Formatting changes.
9905 * src/warshall.c (TC): Use bitset_or.
9907 2002-03-04 Akim Demaille <akim@epita.fr>
9909 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
9910 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
9913 2002-03-04 Akim Demaille <akim@epita.fr>
9915 * src/lalr.c (F): Now a bitset*.
9916 Adjust all dependencies.
9918 2002-03-04 Akim Demaille <akim@epita.fr>
9920 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
9921 Adjust all dependencies.
9923 2002-03-04 Akim Demaille <akim@epita.fr>
9925 * src/L0.c, src/LR0.h (nstates): Be size_t.
9926 Adjust comparisons (signed vs unsigned).
9927 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
9929 Adjust all dependencies.
9931 2002-03-04 Akim Demaille <akim@epita.fr>
9933 * src/closure.c (firsts): Now, also a bitset.
9934 Adjust all dependencies.
9935 (varsetsize): Remove, now unused.
9936 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
9938 2002-03-04 Akim Demaille <akim@epita.fr>
9940 * src/print.c: Convert to use bitset.h, not hand coded iterations
9943 2002-03-04 Akim Demaille <akim@epita.fr>
9945 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
9947 2002-03-04 Akim Demaille <akim@epita.fr>
9949 * src/closure.c (ruleset): Be a bitset.
9950 (rulesetsize): Remove.
9952 2002-03-04 Akim Demaille <akim@epita.fr>
9954 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
9955 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
9956 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
9957 * src/closure.c (fderives): Be an array of bitsets.
9959 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
9961 * data/bison.c++: Merge the two generated headers. Insert a copyright
9962 notice in each output file.
9964 2002-02-28 Akim Demaille <akim@epita.fr>
9966 * data/bison.c++: Copy the prologue of bison.simple to fetch
9967 useful M4 definitions, such as b4_header_guard.
9969 2002-02-25 Akim Demaille <akim@epita.fr>
9971 * src/getargs.c (version): Give the name of the authors, and use a
9972 translator friendly scheme for the bgr
9975 2002-02-25 Akim Demaille <akim@epita.fr>
9977 * src/output.c (header_output): Remove, now handled completely via
9980 2002-02-25 Akim Demaille <akim@epita.fr>
9982 * m4/m4.m4: New, from CVS Autoconf.
9983 * configure.in: Invoke it.
9984 * src/output.c (output_skeleton): Use its result instead of the
9987 2002-02-25 Akim Demaille <akim@epita.fr>
9989 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
9991 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
9992 * src/output.c (output_skeleton): Use mkstemp to create a real
9994 Move the filling of `skeleton' and its muscle to...
9996 (output): Move the definition of the prologue muscle to...
9998 * src/system.h (DEFAULT_TMPDIR): New.
10000 2002-02-14 Paul Eggert <eggert@twinsun.com>
10002 Remove the support for C++ namespace cleanliness; it was
10003 causing more problems than it was curing, since it didn't work
10004 properly on some nonstandard C++ compilers. This can wait
10005 for a proper C++ parser.
10007 * NEWS: Document this.
10008 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
10009 of C++, as it's treated like C now.
10010 * src/bison.simple (YYSTD): Remove.
10011 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
10012 Treat C++ just like Standard C instead of trying to support
10013 namespace cleanliness.
10015 2002-02-14 Akim Demaille <akim@epita.fr>
10017 * tests/regression.at (else): Adjust to Andreas' change.
10019 2002-02-14 Akim Demaille <akim@epita.fr>
10021 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
10023 2002-02-13 Andreas Schwab <schwab@suse.de>
10025 * src/output.c (output_rule_data): Don't output NULL, it might
10026 not be defined yet.
10028 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
10030 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
10031 (Copyright notice): Update.
10033 2002-02-11 Akim Demaille <akim@epita.fr>
10035 * tests/regression.at (%nonassoc and eof): Don't include
10036 nonportable headers.
10038 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
10040 * data/bison.c++: Correct error recovery. Make the user able to
10041 initialize the starting location.
10043 2002-02-07 Akim Demaille <akim@epita.fr>
10045 * tests/input.at: New.
10047 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
10049 * data/bison.c++: Replace some direct m4 expansions by constants. Be
10050 more consistent when naming methods and variables. Put preprocessor
10051 directives around tables only needed for debugging.
10053 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
10055 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
10057 (yy::b4_name::parse): Use print_.
10059 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
10061 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
10063 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
10065 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
10067 (yy::b4_name::parse): Build verbose error messages, and use error_.
10069 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
10071 * data/bison.c++: Fix m4 quoting in comments.
10073 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
10075 * data/bison.c++: Adjust the parser code. Fix some muscles that were
10076 not expanded by m4.
10078 2002-02-05 Akim Demaille <akim@epita.fr>
10080 * data/bison.c++: Adjust to the M4 back end.
10081 More is certainly needed.
10083 2002-02-05 Akim Demaille <akim@epita.fr>
10085 Give a try to M4 as a back end.
10087 * lib/readpipe.c: New, from wdiff.
10088 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
10090 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
10091 specific values. Now it is m4 that performs the lookup.
10092 * src/parse-skel.y: Remove.
10093 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
10094 * src/output.c (actions_output, guards_output)
10095 (token_definitions_output): No longer keeps track of the output
10096 line number, hence remove the second argument.
10097 (guards_output): Check against the guard member of a rule, not the
10100 (output_skeleton): Don't look for the skeleton location, let m4 do
10102 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
10104 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
10105 (prepare): Given that for the time being changesyntax is not
10106 usable in M4, rename the muscles using `-' to `_'.
10107 Define `defines_flag', `output_parser_name' and `output_header_name'.
10108 * src/output.h (actions_output, guards_output)
10109 (token_definitions_output): Adjust prototypes.
10110 * src/scan-skel.l: Instead of scanning the skeletons, it now
10111 processes the output of m4: `__oline__' and `#output'.
10112 * data/bison.simple: Adjust to be used by M4(sugar).
10113 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
10115 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
10116 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
10117 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
10118 shamelessly stolen from CVS Autoconf.
10120 2002-02-05 Akim Demaille <akim@epita.fr>
10122 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
10123 * configure.in: Check for the declarations of free and malloc.
10124 * src/muscle_tab.c: Adjust.
10126 2002-02-05 Akim Demaille <akim@epita.fr>
10128 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
10129 which have no values.
10131 2002-02-05 Akim Demaille <akim@epita.fr>
10133 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
10136 2002-01-29 Paul Eggert <eggert@twinsun.com>
10138 * src/bison.simple (YYSIZE_T): Do not define merely because
10139 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
10140 On some platforms, <alloca.h> does not declare YYSTD (size_t).
10142 2002-01-27 Akim Demaille <akim@epita.fr>
10144 Fix `%nonassoc and eof'.
10146 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
10147 which were not properly copied! Replace
10148 memcpy (res->errs, src->errs, src->nerrs);
10150 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
10152 * tests/regression.at (%nonassoc and eof): Adjust to newest
10153 Autotest: `.' is not in the PATH.
10155 2002-01-27 Akim Demaille <akim@epita.fr>
10157 * tests/sets.at (AT_EXTRACT_SETS): New.
10158 (Nullable): Use it.
10161 2002-01-26 Akim Demaille <akim@epita.fr>
10163 * tests/actions.at, tests/calc.at, tests/headers.at,
10164 * tests/torture.at: Adjust to the newest Autotest which no longer
10165 forces `.' in the PATH.
10167 2002-01-25 Akim Demaille <akim@epita.fr>
10169 * tests/regression.at (%nonassoc and eof): New.
10170 Suggested by Robert Anisko.
10172 2002-01-24 Akim Demaille <akim@epita.fr>
10174 Bison dumps core when trying to complain about broken input files.
10175 Reported by Cris van Pelt.
10177 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
10178 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
10180 (Invalid inputs): Strengthen: exercise parse_percent_token.
10182 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
10184 * src/Makefile.am: Add bison.c++.
10185 * src/bison.c++: New skeleton.
10187 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
10191 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
10193 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
10195 2002-01-20 Marc Autret <marc@gnu.org>
10197 * src/files.c (compute_output_file_names): Fix
10199 2002-01-20 Marc Autret <marc@gnu.org>
10201 * tests/output.at: New test.
10202 * src/files.c (compute_base_names): Don't map extensions when
10203 the YACC flag is set, use defaults.
10204 Reported by Evgeny Stambulchik.
10206 2002-01-20 Marc Autret <marc@gnu.org>
10208 * src/system.h: Need to define __attribute__ away for non-GCC
10209 compilers as well (i.e., the vendor C compiler).
10210 Suggested by Albert Chin-A-Young.
10212 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
10214 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
10215 canonical definition.
10216 * src/system.h: Use the canonical definition for PARAMS (avoids
10217 a conflict with the macro from lib/hash.h).
10219 2002-01-11 Akim Demaille <akim@epita.fr>
10221 * configure.in: Use AC_FUNC_STRNLEN.
10222 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
10224 2002-01-09 Akim Demaille <akim@epita.fr>
10226 * src/files.c, src/files.h (output_infix): New.
10227 (tab_extension): Remove.
10228 (compute_base_names): Compute the former, drop the latter.
10229 * src/output.c (prepare): Insert the muscles `output-infix', and
10231 * src/parse-skel.y (string, string.1): New.
10232 (section.header): Use it.
10233 (section.yacc): Remove.
10234 (prefix): Remove too.
10235 * src/scan-skel.l: Adjust.
10236 * src/bison.simple, src/bison.hairy: Adjust.
10238 2002-01-09 Akim Demaille <akim@epita.fr>
10240 * configure.in (WERROR_CFLAGS): Compute it.
10241 * src/Makefile.am (CFLAGS): Pass it.
10242 * tests/atlocal.in (CFLAGS): Idem.
10243 * src/files.c: Fix a few warnings.
10244 (get_extension_index): Remove, unused.
10246 2002-01-08 Akim Demaille <akim@epita.fr>
10248 * src/getargs.c (AS_FILE_NAME): New.
10249 (getargs): Use it to convert DOSish file names.
10250 * src/files.c (base_name): Rename as full_base_name to avoid
10251 clashes with `base_name ()'.
10252 (filename_split): New.
10253 (compute_base_names): N-th rewrite, using filename_split.
10255 2002-01-08 Akim Demaille <akim@epita.fr>
10257 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
10258 New, stolen from the Fileutils 4.1.
10259 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
10260 * configure.in: Check for the presence of memrchr, and of its
10263 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
10265 * lib/hash.h (__P): Added definition for this macro.
10266 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
10267 BUILT_SOURCES, to ensure they are generated first.
10268 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
10269 %error-verbose to allow bootstrapping with bison 1.30x.
10271 2002-01-06 Akim Demaille <akim@epita.fr>
10273 * src/reader.c (parse_braces): Don't fetch the next char, the
10274 convention is to fetch on entry.
10275 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
10276 'switch' without a following semicolon.
10277 * tests/regression.at (braces parsing): New.
10279 2002-01-06 Akim Demaille <akim@epita.fr>
10281 Bison is dead wrong in its RR conflict reports.
10283 * tests/torture.at (GNU Cim Grammar): New.
10284 * src/conflicts.c (count_rr_conflicts): Fix.
10286 2002-01-06 Akim Demaille <akim@epita.fr>
10288 Creating package.m4 from configure.ac causes too many problems.
10290 * tests/Makefile.am (package.m4): Create it by hand,
10291 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
10293 2002-01-06 Akim Demaille <akim@epita.fr>
10295 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
10298 2002-01-04 Paul Eggert <eggert@twinsun.com>
10300 * doc/bison.texinfo (Debugging):
10301 Remove YYSTDERR; it's no longer defined or used.
10302 Also, s/cstdio.h/cstdio/.
10304 2002-01-03 Akim Demaille <akim@epita.fr>
10306 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
10308 2002-01-03 Akim Demaille <akim@epita.fr>
10310 * src/parse-skel.y (process_skeleton): Don't bind the parser's
10311 tracing code to --trace, wait for a better --trace option, with
10314 2002-01-03 Akim Demaille <akim@epita.fr>
10316 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
10317 The ISO C++ standard is extremely clear about it: stderr is
10318 considered a macro, not a regular symbol (see table 94 `Header
10319 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
10320 Therefore std:: does not apply to it. It still does with fprintf.
10321 Also, s/cstdio.h/cstdio/.
10323 2002-01-03 Akim Demaille <akim@epita.fr>
10325 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
10326 for non system headers.
10328 2002-01-02 Akim Demaille <akim@epita.fr>
10330 Equip the skeleton chain with location tracking, runtime trace,
10331 pure parser and scanner.
10333 * src/parse-skel.y: Request a pure parser, locations, and prefix
10335 (%union): Having several members with the same type does not help
10336 type mismatches, simplify.
10337 (YYPRINT, yyprint): New.
10338 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
10339 (skel_error): this.
10341 * src/scan-skel.l: Adjust to these changes.
10342 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
10343 (LOCATION_PRINT, skel_control_t): New.
10345 2001-12-30 Akim Demaille <akim@epita.fr>
10347 * src/parse-skel.y: Get rid of the shift/reduce conflict:
10348 replace `gb' with BLANKS.
10349 * src/scan-skel.l: Adjust.
10351 2001-12-30 Akim Demaille <akim@epita.fr>
10353 * src/system.h: We don't need nor want bcopy.
10354 Throw away MS-DOS crap: we don't need getpid.
10355 * configure.in: We don't need strndup. It was even causing
10356 problems: because Flex includes the headers *before* us,
10357 _GNU_SOURCE is not defined by config.h, and therefore strndup was
10359 * lib/xstrndup.c: New.
10360 * src/scan-skel.l: Use it.
10361 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
10362 * src/parse-skel.y: Use %directives instead of #defines.
10364 2001-12-30 Akim Demaille <akim@epita.fr>
10366 * src/skeleton.h: New.
10367 * src/output.c (output_parser, output_master_parser): Remove, dead
10369 * src/output.h (get_lines_number, actions_output, guards_output)
10370 (token_definitions_output): Prototype them.
10371 * src/parse-skel.y: Add the license notice.
10372 Include output.h and skeleton.h.
10373 (process_skeleton): Returns void, and takes a single parameter.
10374 * src/scan-skel.l: Add the license notice.
10375 Include skeleton.h.
10376 Don't use %option yylineno: it seems that then Flex imagines
10377 REJECT has been used, and therefore it won't reallocate its
10378 buffers (which makes no other sense to me than a bug). It results
10379 in warnings for `unused: yy_flex_realloc'.
10381 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
10383 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
10384 (MUSCLE_INSERT_PREFIX): ...to there.
10385 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
10386 (MUSCLE_INSERT_PREFIX): Move from here...
10388 * src/bison.hairy: Add a section directive. Put braces around muscle
10389 names. This parser skeleton is still broken, but Bison should not
10390 choke on a bad muscle 'syntax'.
10391 * src/bison.simple: Add a section directive. Put braces around muscle
10394 * src/files.h (strsuffix, stringappend): Add declarations.
10395 (tab_extension): Add declaration.
10396 (short_base_name): Add declaration.
10398 * src/files.c (strsuffix, stringappend): No longer static. These
10399 functions are used in the skeleton parser.
10400 (tab_extension): New.
10401 (compute_base_names): Use the computations done in this function
10402 to guess if the generated parsers should have '.tab' in their
10404 (short_base_name): No longer static.
10406 * src/output.c (output_skeleton): New.
10407 (output): Disable call to output_master_parser, and give a try to
10408 a new skeleton handling system.
10409 (guards_output, actions_output): No longer static.
10410 (token_definitions_output, get_lines_number): No longer static.
10412 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
10414 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
10417 * src/parse-skel.y: New file.
10418 * src/scan-skel.l: New file.
10420 2001-12-29 Akim Demaille <akim@epita.fr>
10422 %name-prefix is broken.
10424 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
10425 Adjust all dependencies.
10426 * tests/headers.at (export YYLTYPE): Strengthen this test: use
10429 Renaming yylval but not yylloc is not consistent. Now we do.
10431 * src/bison.simple: Prefix yylloc if used.
10432 * doc/bison.texinfo (Decl Summary): Document that.
10434 2001-12-29 Akim Demaille <akim@epita.fr>
10436 * doc/bison.texinfo: Promote `%long-directive' over
10438 Remove all references to fixed-output-files, yacc is enough.
10440 2001-12-29 Akim Demaille <akim@epita.fr>
10442 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
10443 user prologue. These are defaults.
10444 * tests/actions.at (Mid-rule actions): Make sure the user can
10445 define YYDEBUG and YYERROR_VERBOSE.
10447 2001-12-29 Akim Demaille <akim@epita.fr>
10449 * src/output.c (header_output): Don't forget to export YYLTYPE and
10451 * tests/headers.at (export YYLTYPE): New, make sure it does.
10452 * tests/regression.at (%union and --defines, Invalid CPP headers):
10454 * tests/headers.at: here.
10456 2001-12-29 Akim Demaille <akim@epita.fr>
10458 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
10460 2001-12-29 Akim Demaille <akim@epita.fr>
10462 * tests/actions.at (Mid-rule actions): Output on a single line
10463 instead of several.
10465 2001-12-29 Akim Demaille <akim@epita.fr>
10467 * doc/bison.texinfo: Formatting changes.
10469 2001-12-29 Akim Demaille <akim@epita.fr>
10471 Don't store the token defs in a muscle, just be ready to output it
10472 on command. Now possible via `symbols'. Fixes a memory leak.
10474 * src/output.c (token_definitions_output): New.
10475 (output_parser, header_output): Use it.
10476 * src/reader.c (symbols_save): Remove.
10478 2001-12-29 Akim Demaille <akim@epita.fr>
10480 * src/bison.simple: Do not provide a default for YYSTYPE and
10481 YYLTYPE before the user's prologue. Otherwise it's hardly... a
10484 2001-12-29 Akim Demaille <akim@epita.fr>
10486 Mid-rule actions are simply... ignored!
10488 * src/reader.c (readgram): Be sure to attach mid-rule actions to
10489 the empty-rule associated to the dummy symbol, not to the host
10491 * tests/actions.at (Mid-rule actions): New.
10493 2001-12-29 Akim Demaille <akim@epita.fr>
10497 * src/reader.c (reader): Free grammar.
10499 2001-12-29 Akim Demaille <akim@epita.fr>
10503 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
10504 since it allocates it for each state, although only one is needed.
10505 (allocate_storage): Do it here.
10507 2001-12-29 Akim Demaille <akim@epita.fr>
10509 * src/options.h, src/options.c (create_long_option_table): Rename
10511 (long_option_table_new): this, with a clearer prototype.
10512 (percent_table): Remove, unused,
10513 * src/getargs.c (getargs): Adjust.
10515 2001-12-29 Akim Demaille <akim@epita.fr>
10517 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
10518 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
10521 2001-12-29 Akim Demaille <akim@epita.fr>
10523 * src/lalr.c (build_relations): Rename `states' as `states1'.
10524 Sorry, I don't understand exactly what it is, no better name...
10526 2001-12-29 Akim Demaille <akim@epita.fr>
10528 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
10529 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
10530 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
10533 2001-12-29 Akim Demaille <akim@epita.fr>
10535 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
10538 2001-12-29 Akim Demaille <akim@epita.fr>
10540 * src/reader.c, src/reader.h (user_toknums): Remove.
10541 Adjust all users to use symbols[i]->user_token_number.
10543 2001-12-29 Akim Demaille <akim@epita.fr>
10545 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
10546 Adjust all users to use symbols[i]->prec or ->assoc.
10548 2001-12-29 Akim Demaille <akim@epita.fr>
10550 * src/reader.c, src/reader.h (tags): Remove.
10551 Adjust all users to use symbols[i]->tag.
10553 2001-12-29 Akim Demaille <akim@epita.fr>
10555 * src/gram.h, src/gram.c (symbols): New, similar to state_table
10557 * src/reader.c (packsymbols): Fill this table.
10559 * src/conflicts.c (resolve_sr_conflict): Adjust.
10560 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
10562 Use symbols[i]->tag instead of tags[i].
10564 2001-12-29 Akim Demaille <akim@epita.fr>
10566 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
10567 In addition, put a comment in there, to replace...
10568 * tests/regression.at (%union and C comments): Remove.
10570 2001-12-29 Akim Demaille <akim@epita.fr>
10572 * tests/regression.at (Web2c Actions): Blindly move the actual
10573 output as expected output. The contents *seem* right to me, but I
10574 can't pretend reading perfectly parser tables... Nonetheless, all
10575 the other tests pass correctly, the table look OK, even though the
10576 presence of `$axiom' is to be noted: AFAICS it is useless (but
10579 2001-12-29 Akim Demaille <akim@epita.fr>
10581 * src/reader.c (readgram): Don't add the rule 0 if there were no
10582 rules read. In other words, add it _after_ having performed
10583 grammar sanity checks.
10584 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
10586 2001-12-29 Akim Demaille <akim@epita.fr>
10588 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
10589 visible, and some states have now a different number.
10591 2001-12-29 Akim Demaille <akim@epita.fr>
10593 * src/reader.c (readgram): Bind the initial rule's lineno to that
10595 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
10596 (Solved SR Conflicts): Adjust rule 0's line number.
10598 2001-12-29 Akim Demaille <akim@epita.fr>
10600 Fix the `GAWK Grammar' failure.
10602 * src/LR0.c (final_state): Initialize to -1 so that we do compute
10603 the reductions of the first state which was mistakenly confused
10604 with the final state because precisely final_state was initialized
10606 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
10607 now noticed by Bison.
10608 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
10609 have a reduction on $default.
10611 2001-12-29 Akim Demaille <akim@epita.fr>
10613 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
10615 * src/closure.c (print_closure): Likewise.
10616 * src/derives.c (print_derives): Likewise.
10617 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
10620 2001-12-29 Akim Demaille <akim@epita.fr>
10622 * src/lalr.c (lookaheads_print): New.
10623 (lalr): Call it when --trace-flag.
10624 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
10627 2001-12-29 Akim Demaille <akim@epita.fr>
10629 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
10630 when walking through ritem, even via rule->rhs.
10631 * src/reduce.c (dump_grammar, useful_production, reduce_output)
10632 (useful_production, useless_nonterminals): Likewise.
10633 (reduce_grammar_tables): Likewise, plus update nritems.
10634 * src/nullable.c (set_nullable): Likewise.
10635 * src/lalr.c (build_relations): Likewise.
10636 * tests/sets.at (Nullable): Adjust.
10637 Fortunately, now, the $axiom is no longer nullable.
10639 2001-12-29 Akim Demaille <akim@epita.fr>
10641 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
10643 * src/gram.c (ritem_longest_rhs): Likewise.
10644 * src/reduce.c (nonterminals_reduce): Likewise.
10645 * src/print_graph.c (print_graph): Likewise.
10646 * src/output.c (output_rule_data): Likewise.
10647 * src/nullable.c (set_nullable): Likewise.
10649 2001-12-29 Akim Demaille <akim@epita.fr>
10651 * src/output.c: Comment changes.
10653 2001-12-27 Paul Eggert <eggert@twinsun.com>
10655 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
10656 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
10657 Sparc, as they were causing more porting problems than the
10658 (minor) performance improvement was worth.
10660 Also, catch up with 1.31's YYSTD.
10662 2001-12-27 Akim Demaille <akim@epita.fr>
10664 * src/output.c (output_gram): Rely on nritems, not the
10665 0-sentinel. See below.
10666 Use -1 as separator, not 0.
10667 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
10668 Rely on -1 as separator in yyrhs, instead of 0.
10669 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
10670 twice `Now at end of input', therefore there are two lines less to
10673 2001-12-27 Akim Demaille <akim@epita.fr>
10675 * tests/regression.at (Unresolved SR Conflicts):
10676 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
10679 2001-12-27 Akim Demaille <akim@epita.fr>
10681 * src/LR0.c (new_state): Recognize the final state by the fact it
10682 is reached by eoftoken.
10683 (insert_start_shifting_state, insert_eof_shifting_state)
10684 (insert_accepting_state, augment_automaton): Remove, since now
10685 these states are automatically computed from the initial state.
10686 (generate_states): Adjust.
10687 * src/print.c: When reporting a rule number to the user, substract
10688 1, so that the axiom rule is rule 0, and the first user rule is 1.
10689 * src/reduce.c: Likewise.
10690 * src/print_graph.c (print_core): For the time being, just as for
10691 the report, depend upon --trace-flags to dump the full set of
10693 * src/reader.c (readgram): Once the grammar read, insert the rule
10694 0: `$axiom: START-SYMBOL $'.
10695 * tests/set.at: Adjust: rule 0 is now displayed, and since the
10696 number of the states has changed (the final state is no longer
10697 necessarily the last), catch up.
10699 2001-12-27 Akim Demaille <akim@epita.fr>
10701 Try to make the use of the eoftoken valid. Given that its value
10702 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
10703 is used instead of > 0 where appropriate, (ii), depend upon nritems
10704 instead of the 0-sentinel.
10706 * src/gram.h, src/gram.c (nritems): New.
10707 Expected to be duplication of nitems, but for the time being...
10708 * src/reader.c (packgram): Assert nritems and nitems are equal.
10709 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
10710 * src/closure.c (print_closure, print_fderives): Likewise.
10711 * src/gram.c (ritem_print): Likewise.
10712 * src/print.c (print_core, print_grammar): Likewise.
10713 * src/print_graph.c: Likewise.
10715 2001-12-27 Akim Demaille <akim@epita.fr>
10717 * src/main.c (main): If there are complains after grammar
10718 reductions, then output the report anyway if requested, then die.
10719 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
10720 * src/reader.c (eoftoken): New.
10721 (parse_token_decl): If the token being defined has value `0', it
10723 (packsymbols): No longer hack `tags' to insert `$' by hand.
10724 Be sure to preserve the value of the eoftoken.
10725 (reader): Make sure eoftoken is defined.
10726 Initialize nsyms to 0: now eoftoken is created just like the others.
10727 * src/print.c (print_grammar): Don't special case the eof token.
10728 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
10729 lie anyway, albeit pleasant.
10730 * tests/calc.at: Exercise error messages with eoftoken.
10731 Change the grammar so that empty input is invalid.
10732 Adjust expectations.
10733 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
10735 2001-12-27 Akim Demaille <akim@epita.fr>
10737 * configure.in: Check the protos of strchr ans strspn.
10738 Replace strchr if needed.
10739 * src/system.h: Provide the protos of strchr, strspn and memchr if
10741 * lib/strchr.c: New.
10742 * src/reader.c (symbols_save): Use strchr.
10744 2001-12-27 Akim Demaille <akim@epita.fr>
10746 * src/print.c, src/print_graph.c (escape): New.
10747 Use it to quote the TAGS outputs.
10748 * src/print_graph.c (print_state): Now errors are in red, and
10749 reductions in green.
10750 Prefer high to wide: output the state number on a line of its own.
10752 2001-12-27 Akim Demaille <akim@epita.fr>
10754 * src/state.h, src/state.c (reductions_new): New.
10755 * src/LR0.c (set_state_table): Let all the states have a
10756 `reductions', even if reduced to 0.
10757 (save_reductions): Adjust.
10758 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
10759 * src/print.c (print_reductions, print_actions): Adjust.
10760 * src/output.c (action_row): Adjust.
10762 2001-12-27 Akim Demaille <akim@epita.fr>
10764 * src/state.h, src/state.c (errs_new, errs_dup): New.
10765 * src/LR0.c (set_state_table): Let all the states have an errs,
10766 even if reduced to 0.
10767 * src/print.c (print_errs, print_reductions): Adjust.
10768 * src/output.c (output_actions, action_row): Adjust.
10769 * src/conflicts.c (resolve_sr_conflict): Adjust.
10771 2001-12-27 Akim Demaille <akim@epita.fr>
10773 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
10775 2001-12-27 Akim Demaille <akim@epita.fr>
10777 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
10778 * src/print.c: here.
10779 (lookaheadset, shiftset): New, used as additional storage by
10781 (print_results): Adjust.
10782 (print_shifts, print_gotos, print_errs): New, extracted from...
10783 (print_actions): here.
10784 * src/print_graph.c (print_actions): Remove dead code.
10786 2001-12-27 Akim Demaille <akim@epita.fr>
10788 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
10791 2001-12-27 Akim Demaille <akim@epita.fr>
10793 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
10794 (build_relations): Adjust.
10796 2001-12-27 Akim Demaille <akim@epita.fr>
10798 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
10801 2001-12-27 Akim Demaille <akim@epita.fr>
10803 * src/reader.c (packgram): Catch nitems overflows.
10805 2001-12-27 Akim Demaille <akim@epita.fr>
10807 * src/files.c, src/files.h (guard_obstack): Remove.
10808 * src/output.c (output): Adjust.
10809 * src/reader.c (parse_braces): New, factoring...
10810 (copy_action, copy_guard): these two which are renamed as...
10811 (parse_action, parse_guard): these.
10812 As a voluntary consequence, using braces around guards is now
10815 2001-12-27 Akim Demaille <akim@epita.fr>
10817 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
10818 * src/reader.c (symbol_list): `guard' and `guard_line' are new
10820 (symbol_list_new): Adjust.
10821 (copy_action): action_line is the first line, not the last.
10822 (copy_guard): Just as for actions, store the `action' only, not
10823 the switch/case/break flesh.
10824 Don't parse the user action that might follow the guard, let...
10825 (readgram): do it, i.e., now, there can be an action after a
10827 In other words the guard is just explicitly optional.
10828 (packgram): Adjust.
10829 * src/output.c (guards_output): New.
10830 (output_parser): Call it when needed.
10831 (output): Also free the guard and attrs obstacks.
10832 * src/files.c, src/files.h (obstack_save): Remove.
10833 (output_files): Remove.
10834 As a result, if one needs the former `.act' file, using an
10835 appropriate skeleton which requires actions and guards is now
10837 * src/main.c (main): Adjust.
10838 * tests/semantic.at: New.
10839 * tests/regression.at: Use `input.y' as input file name.
10840 Avoid 8+3 problems by requiring input.c when the test needs the
10843 2001-12-27 Akim Demaille <akim@epita.fr>
10845 * src/reader.c (symbol_list_new): Be sure to initialize all the
10848 2001-12-27 Akim Demaille <akim@epita.fr>
10850 All the hacks using a final pseudo state are now useless.
10852 * src/LR0.c (set_state_table): state_table holds exactly nstates.
10853 * src/lalr.c (nLA): New.
10854 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
10855 instead of lookaheadsp from the pseudo state (nstate + 1).
10857 2001-12-27 Akim Demaille <akim@epita.fr>
10859 * src/output.c (action_row, token_actions): Use a state_t instead
10860 of a integer, and nlookaheads instead of the following state's
10863 2001-12-27 Akim Demaille <akim@epita.fr>
10865 * src/conflicts.c (log_resolution, flush_shift)
10866 (resolve_sr_conflict, set_conflicts, solve_conflicts)
10867 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
10868 (conflicts_print, print_reductions): Use a state_t instead of an
10869 integer when referring to a state.
10870 As much as possible, depend upon nlookaheads, instead of the
10871 `lookaheadsp' member of the following state (since lookaheads of
10872 successive states are successive, the difference between state n + 1
10873 and n served as the number of lookaheads for state n).
10874 * src/lalr.c (add_lookback_edge): Likewise.
10875 * src/print.c (print_core, print_actions, print_state)
10876 (print_results): Likewise.
10877 * src/print_graph.c (print_core, print_actions, print_state)
10878 (print_graph): Likewise.
10879 * src/conflicts.h: Adjust.
10881 2001-12-27 Akim Demaille <akim@epita.fr>
10883 * src/bison.hairy: Formatting/comment changes.
10885 Remove `register' indications.
10886 Add plenty of `static'.
10888 2001-12-27 Akim Demaille <akim@epita.fr>
10890 * src/output.c (prepare): Drop the muscle `ntbase' which
10891 duplicates ntokens.
10892 * src/bison.simple: Formatting/comment changes.
10893 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
10894 is an undocumented synonym.
10896 2001-12-22 Akim Demaille <akim@epita.fr>
10898 * src/output.c (output_table_data): Change the prototype to use
10899 `int' for array ranges: some invocations do pass an int, not a
10901 Reported by Wayne Green.
10903 2001-12-22 Akim Demaille <akim@epita.fr>
10905 Some actions of web2c.y are improperly triggered.
10906 Reported by Mike Castle.
10908 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
10909 * tests/regression.at (Web2c): Rename as...
10910 (Web2c Report): this.
10911 (Web2c Actions): New.
10913 2001-12-22 Akim Demaille <akim@epita.fr>
10915 Reductions in web2c.y are improperly reported.
10916 Reported by Mike Castle.
10918 * src/conflicts.c (print_reductions): Fix.
10919 * tests/regression.at (Web2c): New.
10921 2001-12-18 Akim Demaille <akim@epita.fr>
10923 Some host fail on `assert (!"foo")', which expands to
10924 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
10925 Reported by Nelson Beebee.
10927 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
10928 `#define it_succeeded 0' and `assert (it_succeeded)'.
10930 2001-12-17 Marc Autret <autret_m@epita.fr>
10932 * src/bison.simple: Don't hard code the skeleton line and filename.
10933 * src/output.c (output_parser): Rename 'line' as 'output_line'.
10934 New line counter 'skeleton_line' (skeleton-line muscle).
10936 2001-12-17 Paul Eggert <eggert@twinsun.com>
10938 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
10939 YYDEBUG must be defined to a nonzero value.
10941 * src/bison.simple (yytname): Do not assume that the user defines
10942 YYDEBUG to a properly parenthesized expression.
10944 2001-12-17 Akim Demaille <akim@epita.fr>
10946 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
10947 nlookaheads is a new member.
10949 * src/lalr.h (nlookaheads): Remove this orphan declaration.
10950 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
10953 2001-12-17 Akim Demaille <akim@epita.fr>
10955 * src/files.h, src/files.c (open_files, close_files): Remove.
10956 * src/main.c (main): Don't open/close files, nor invoke lex_free,
10958 * src/reader.c (reader): Do it.
10960 2001-12-17 Akim Demaille <akim@epita.fr>
10962 * src/conflicts.c (print_reductions): Formatting changes.
10964 2001-12-17 Akim Demaille <akim@epita.fr>
10966 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
10967 (flush_reduce): New.
10968 (resolve_sr_conflict): Adjust.
10970 2001-12-17 Akim Demaille <akim@epita.fr>
10972 * src/output.c (output_obstack): Be static and rename as...
10973 (format_obstack): this, to avoid any confusion with files.c's
10975 * src/reader.h (muscle_obstack): Move to...
10976 * src/output.h: here, since it's defined in output.c.
10978 2001-12-17 Akim Demaille <akim@epita.fr>
10980 * src/output.c (action_row, save_column, default_goto)
10981 (sort_actions, matching_state, pack_vector): Better variable
10984 2001-12-17 Akim Demaille <akim@epita.fr>
10986 * src/output.c: Various formatting changes.
10988 2001-12-17 Akim Demaille <akim@epita.fr>
10990 * src/files.c (output_files): Free the output_obstack.
10991 * src/main.c (main): Call print and print_graph conditionally.
10992 * src/print.c (print): Work unconditionally.
10993 * src/print_graph.c (print_graph): Work unconditionally.
10994 * src/conflicts.c (log_resolution): Output only if verbose_flag.
10996 2001-12-16 Marc Autret <autret_m@epita.fr>
10998 * src/output.c (actions_output): Fix. When we use %no-lines,
10999 there is one less line per action.
11001 2001-12-16 Marc Autret <autret_m@epita.fr>
11003 * src/bison.simple: Remove a useless #line directive.
11004 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
11005 * src/output.c (get_lines_number): New.
11006 (output_parser): Adjust, now takes care about the lines of a
11008 Fix line numbering.
11009 (actions_output): Computes the number of lines taken by actions.
11010 (output_master_parser): Insert new skeleton which is the name of
11011 the output parser file name.
11013 2001-12-15 Marc Autret <autret_m@epita.fr>
11015 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
11017 2001-12-15 Marc Autret <autret_m@epita.fr>
11019 * src/output.c (output_gram): Keep track of the hairy one.
11021 2001-12-15 Akim Demaille <akim@epita.fr>
11023 Make `make distcheck' work.
11025 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
11026 system.h which uses libgettext.h.
11028 2001-12-15 Akim Demaille <akim@epita.fr>
11030 * src/nullable.c (set_nullable): Useless rules must be skipped,
11031 otherwise, since we range over their symbols, we might look at a
11032 nonterminal which no longer ``exists'', i.e., it is not counted in
11033 `nvars', hence we overflow our arrays.
11035 2001-12-15 Akim Demaille <akim@epita.fr>
11037 The header can also be produced directly, without any obstack!
11040 * src/files.c, src/files.h (defines_obstack): Remove.
11041 (compute_header_macro): Global.
11042 (defines_obstack_save): Remove.
11043 * src/reader.c (parse_union_decl): No longer output to
11044 defines_obstack: its content can be found in the `stype' muscle
11046 (output_token_translations): Merge into...
11047 (symbols_output): this.
11049 (symbols_save): this.
11051 * src/output.c (header_output): New.
11054 2001-12-15 Akim Demaille <akim@epita.fr>
11056 * src/reader.c (parse_union_decl): Instead of handling two obstack
11057 simultaneously, use one to define the `stype' muscle, and use the
11058 value of the latter to fill defines_obstack.
11059 (copy_comment): Remove.
11060 (copy_comment2): Work for a single obstack.
11062 (copy_comment): this.
11064 2001-12-15 Akim Demaille <akim@epita.fr>
11066 * src/lex.c, src/lex.h (xgetc): No longer static.
11067 * src/reader.c (parse_union_decl): Revamp.
11069 2001-12-15 Akim Demaille <akim@epita.fr>
11071 Still making progress in separating Bison into (i) input, (ii)
11072 process, (iii) output: now we can directly output the parser file
11073 without using table_obstack at all.
11075 * src/files.c, src/files.h (table_obstack): Bye bye.
11076 (parser_file_name): New.
11077 * src/files.c (compute_output_file_names): Compute it.
11078 * src/output.c (actions_output, output_parser)
11079 (output_master_parser): To a file instead of an obstack.
11081 2001-12-15 Akim Demaille <akim@epita.fr>
11083 Attach actions to rules, instead of pre-outputting them to
11086 * src/gram.h (rule_t): action and action_line are new members.
11087 * src/reader.c (symbol_list): Likewise.
11088 (copy_action): Save the actions within the rule.
11089 (packgram): Save them in rule_table.
11090 * src/output.c (actions_output): New.
11091 (output_parser): Use it on `%%actions'.
11092 (output_rule_data): Don't free rule_table.
11094 (prepare): Don't save the `action' muscle.
11095 * src/bison.simple: s/%%action/%%actions/.
11097 2001-12-15 Akim Demaille <akim@epita.fr>
11099 * src/reader.c (copy_action): When --yacc, don't append a `;'
11100 to the user action: let it fail if lacking.
11101 Suggested by Arnold Robbins and Tom Tromey.
11103 2001-12-14 Akim Demaille <akim@epita.fr>
11105 * src/lex.c (literalchar): Simply return the char you decoded, non
11106 longer mess around with obstacks and int pointers.
11107 Adjust all callers.
11109 2001-12-14 Akim Demaille <akim@epita.fr>
11111 * src/lex.c (literalchar): Don't escape the special characters,
11112 just decode them, and keep them as char (before, eol was output as
11113 the 2 char string `\n' etc.).
11114 * src/output.c (output_rule_data): Use quotearg to output the
11117 2001-12-13 Paul Eggert <eggert@twinsun.com>
11119 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
11120 Do not infringe on the global user namespace when using C++.
11121 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
11122 All uses of `fprintf' and `stderr' changed.
11124 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
11126 2001-12-13 Akim Demaille <akim@epita.fr>
11128 The computation of nullable is broken: it doesn't handle empty
11131 * tests/torture.at (GNU AWK Grammar): New.
11132 * tests/sets.at (Nullable): New.
11133 * src/nullable.c (set_nullable): Instead of blindly looping over
11134 `ritems', loop over the rules, and then over their rhs's.
11136 Work around Autotest bugs.
11138 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
11139 frame, because Autotest understand lines starting with a `+' as
11140 traces from the shell. Then, they are not processed properly.
11141 Admittedly an Autotest bug, but we don't have time to wait for
11142 Autotest to catch up.
11143 * tests/regression.at (Broken Closure): Adjust to the new table
11146 * tests/sets.at: here.
11148 2001-12-13 Akim Demaille <akim@epita.fr>
11150 * src/closure.c (closure): Use nrules instead of playing tricks
11151 with BITS_PER_WORD.
11153 2001-12-13 Akim Demaille <akim@epita.fr>
11155 * src/print.c (print_actions): Output the handling of `$' as the
11156 traces do: shifting the token EOF. Before EOF was treated as a
11158 * tests/regression.at: Adjust some tests.
11159 * src/print_graph.c (print_core): Complete the set of items via
11160 closure. The next-to-final and final states are still unsatisfying,
11161 but that's to be addressed elsewhere.
11162 No longer output the rule numbers, but do output the state number.
11163 A single loop for the shifts + gotos is enough, but picked a
11164 distinct color for each.
11165 (print_graph): Initialize and finalize closure.
11167 2001-12-13 Akim Demaille <akim@epita.fr>
11169 * src/reader.c (readgram): Remove dead code, an strip useless
11171 (get_type): Remove, unused.
11173 2001-12-12 Akim Demaille <akim@epita.fr>
11175 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
11176 on that of lib/error.c.
11178 2001-12-12 Akim Demaille <akim@epita.fr>
11180 Some hosts don't like `/' in includes.
11182 * src/system.h: Include libgettext.h without qualifying the path.
11183 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
11186 2001-12-11 Marc Autret <autret_m@epita.fr>
11188 * src/output.c (output_parser): Remove useless muscle.
11190 2001-12-11 Marc Autret <autret_m@epita.fr>
11192 * src/bison.simple: Remove #line just before %%epilogue. It
11193 is now handled in ...
11194 * src/reader.c (read_additionnal_code): Add the output of a
11195 #line for the epilogue.
11197 2001-12-10 Marc Autret <autret_m@epita.fr>
11199 * src/reader.c (copy_definition): Re-use CPP-outed code which
11200 replace precedent remove.
11201 * src/bison.simple: Remove #line before %%prologue because
11202 %%input-line is wrong at this time.
11204 2001-12-10 Marc Autret <autret_m@epita.fr>
11206 * src/reader.c (symbols_output): Clean up.
11207 * src/output.c (output_gram, output): Clean up.
11209 2001-12-10 Akim Demaille <akim@epita.fr>
11211 * src/lalr.c (initialize_lookaheads): New. Extracted from...
11212 * src/LR0.c (set_state_table): here.
11213 * src/lalr.c (lalr): Call it.
11215 2001-12-10 Akim Demaille <akim@epita.fr>
11217 * src/state.h (shifts): Remove the `number' member: shifts are
11218 attached to state, hence no longer need to be labelled with a
11221 2001-12-10 Akim Demaille <akim@epita.fr>
11223 Now that states have a complete set of members, the linked list of
11224 shifts is useless: just fill directly the state's shifts member.
11226 * src/state.h (shifts): Remove the `next' member.
11227 * src/LR0.c (first_state, last_state): Remove.
11228 Adjust the callers.
11229 (augment_automaton): Don't look for the shifts that must be added
11230 a shift on EOF: it is those of the state we looked for! But now,
11231 since shifts are attached, it is no longer needed to looking
11232 merely by its id: its number.
11234 2001-12-10 Akim Demaille <akim@epita.fr>
11236 * src/LR0.c (augment_automaton): Better variable locality.
11237 Remove an impossible branch: if there is a state corresponding to
11238 the start symbol being shifted, then there is shift for the start
11239 symbol from the initial state.
11241 2001-12-10 Akim Demaille <akim@epita.fr>
11243 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
11244 only when appropriate: when insert_start_shifting_state' is not
11246 * tests/regression.at (Rule Line Numbers): Adjust.
11248 2001-12-10 Akim Demaille <akim@epita.fr>
11250 * src/LR0.c (augment_automaton): Now that all states have shifts,
11251 merge the two cases addition shifts to the initial state.
11253 2001-12-10 Akim Demaille <akim@epita.fr>
11255 * src/lalr.c (set_state_table): Move to...
11257 * src/lalr.c (lalr): Don't call it...
11258 * src/LR0.c (generate_states): do it.
11259 * src/LR0.h (first_state): Remove, only the table is used.
11261 2001-12-10 Akim Demaille <akim@epita.fr>
11263 * src/LR0.h (first_shift, first_reduction): Remove.
11264 * src/lalr.c: Don't use first_shift: find shifts through the
11267 2001-12-10 Akim Demaille <akim@epita.fr>
11269 * src/LR0.c: Attach shifts to states as soon as they are
11271 * src/lalr.c (set_state_table): Instead of assigning shifts to
11272 state, just assert that the mapping was properly done.
11274 2001-12-10 Akim Demaille <akim@epita.fr>
11276 * src/LR0.c (insert_start_shift): Rename as...
11277 (insert_start_shifting_state): this.
11278 (insert_eof_shifting_state, insert_accepting_state): New.
11279 (augment_automaton): Adjust.
11280 Better locality of the variables.
11281 When looking if the start_symbol is shifted from the initial
11282 state, using `while (... symbol != start_symbol ...)' sounds
11283 better than `while (... symbol < start_symbol ...)': If fail
11284 to see how the order between symbols could be relevant!
11286 2001-12-10 Akim Demaille <akim@epita.fr>
11288 * src/getargs.h: Don't declare `spec_name_prefix' and
11289 `spec_file_prefix', declared by src/files.h.
11290 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
11291 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
11292 * src/output.c (prepare): Adjust.
11293 * src/reader.c (symbols_output): Likewise.
11294 * src/vmsgetargs.c: Vaguely adjust, but who cares?
11296 2001-12-10 Akim Demaille <akim@epita.fr>
11298 * src/muscle_tab.c (muscle_init): NULL is a better default than
11301 2001-12-10 Akim Demaille <akim@epita.fr>
11303 * src/reader.c (reader): Calling symbols_output once is enough.
11305 2001-12-10 Akim Demaille <akim@epita.fr>
11307 Now that states have a complete set of members, the linked list of
11308 reductions is useless: just fill directly the state's reductions
11311 * src/state.h (struct reductions): Remove member `number' and
11313 * src/LR0.c (first_reduction, last_reduction): Remove.
11314 (save_reductions): Don't link the new reductions, store them in
11316 * src/lalr.c (set_state_table): No need to attach reductions to
11317 states, it's already done.
11318 * src/output.c (output_actions): No longer free the shifts, then
11319 the reductions, then the states: free all the states and their
11322 2001-12-10 Akim Demaille <akim@epita.fr>
11324 * src/options.c (OPTN, DRTV, BOTH): New.
11325 (option_table): Use them.
11327 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
11328 the job of system.h.
11329 * src/options.c: Don't include stdio.h and xalloc.h for the same
11332 2001-12-10 Akim Demaille <akim@epita.fr>
11334 * src/output.c (output, prepare): Make sure the values of the
11335 muscles `action' and `prologue' are 0-terminated.
11337 2001-12-10 Akim Demaille <akim@epita.fr>
11339 Clean up GCC warnings.
11341 * src/reader.c (copy_action): `buf' is not used.
11342 (parse_skel_decl): Be static.
11343 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
11344 * src/options.h (create_long_option_table): Have a real prototype.
11345 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
11346 (hash_delete_at): Return const void *.
11347 Adjust casts to preserve the const.
11349 2001-12-10 Akim Demaille <akim@epita.fr>
11351 * configure.in: Require 2.52g.
11352 M4 is not needed, but AUTOM4TE is.
11353 * m4/m4.m4: Remove.
11354 * tests/Makefile.am: Adjust.
11356 2001-12-10 Akim Demaille <akim@epita.fr>
11358 One structure for states is enough, even though theoretically
11359 there are LR(0) states and LALR(1) states.
11361 * src/lalr.h (state_t): Remove.
11362 (state_table): Be state_t **, not state_t *.
11363 * src/state.h (core, CORE_ALLOC): Rename as...
11364 (state_t, STATE_ALLOC): this.
11365 Add the LALR(1) members: shifts, reductions, errs.
11366 * src/LR0.c (state_table): Rename as...
11367 (state_hash): this, to avoid name clashes with the global
11369 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
11370 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
11372 2001-12-10 Akim Demaille <akim@epita.fr>
11374 Bison dumps core on bash.y.
11375 Reported by Pascal Bart.
11377 * src/warshall.c (bitmatrix_print): New.
11379 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
11380 j must be the outer loop.
11381 * tests/regression.at (Broken Closure): New.
11383 2001-12-05 Akim Demaille <akim@epita.fr>
11385 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
11387 Reported by Peter Hamorsky.
11389 2001-12-05 Akim Demaille <akim@epita.fr>
11391 * src/conflicts.c (err_table): Remove.
11392 (resolve_sr_conflict): Adjust.
11393 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
11395 (state_t.reductions, state_t.shifts): this.
11397 2001-12-05 Akim Demaille <akim@epita.fr>
11399 * src/reduce.c (reduce_grammar_tables): No longer disable the
11400 removal of useless rules via CPP but via `if (0)', so that the
11401 compiler still check the code is valid.
11402 For instance, it should have noticed `rline' no longer exists: use
11403 the `line' member of rule_t.
11404 * src/gram.c (dummy, rline): Remove, unused.
11406 2001-12-05 Akim Demaille <akim@epita.fr>
11408 * src/output.c (pack_vector): Use assert, not berror.
11409 * src/main.c (berror): Remove, unused.
11411 2001-12-05 Akim Demaille <akim@epita.fr>
11413 New experimental feature: if --verbose --trace output all the
11414 items of a state, not only its kernel.
11416 * src/print.c (print_core): If `trace_flag', then invoke closure
11417 before outputting the items of the state (print_core is no longer
11418 a correct name them).
11419 (print_results): Invoke new_closure/free_closure if needed.
11421 2001-12-05 Akim Demaille <akim@epita.fr>
11423 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
11424 * src/closure.c, src/closure.h (itemsetsize): Rename as...
11425 (nitemset): for consistency with the rest of the project.
11427 2001-12-05 Akim Demaille <akim@epita.fr>
11429 * src/closure.c (print_closure): Improve.
11430 (closure): Use it for printing input and output.
11432 2001-12-05 Akim Demaille <akim@epita.fr>
11434 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
11435 indexed by nonterminals.
11437 2001-12-05 Akim Demaille <akim@epita.fr>
11439 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
11441 * src/warshall.h: Remove accidental duplication of the content.
11443 2001-12-05 Akim Demaille <akim@epita.fr>
11445 * src/closure.c (set_fderives): De-obfuscate.
11447 2001-12-05 Akim Demaille <akim@epita.fr>
11449 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
11451 2001-12-05 Akim Demaille <akim@epita.fr>
11453 * src/closure.c (set_firsts): De-obfuscate.
11455 2001-12-05 Akim Demaille <akim@epita.fr>
11457 * src/output.c (action_row): De-obfuscate
11458 using the good o' techniques: arrays not pointers, variable
11459 locality, BITISSET, RESETBIT etc.
11461 2001-12-05 Akim Demaille <akim@epita.fr>
11463 Pessimize the code to simplify it: from now on, all the states
11464 have a valid SHIFTS, which NSHIFTS is possibly 0.
11466 * src/LR0.c (shifts_new): Be global and move to..
11467 * src/state.c, src/state.h: here.
11468 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
11469 * src/print_graph: Adjust.
11471 2001-12-05 Akim Demaille <akim@epita.fr>
11473 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
11474 * src/conflicts.c: Use it.
11475 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
11476 incorrectly ``simplified''.
11478 2001-12-05 Akim Demaille <akim@epita.fr>
11480 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
11481 using the good o' techniques: arrays not pointers, variable
11482 locality, BITISSET, RESETBIT etc.
11484 2001-12-05 Akim Demaille <akim@epita.fr>
11486 * src/state.h (SHIFT_SYMBOL): New.
11487 * src/conflicts.c: Use it to deobfuscate.
11489 2001-12-05 Akim Demaille <akim@epita.fr>
11491 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
11492 (print_reductions): De-obfuscate using the good o' techniques:
11493 arrays not pointers, variable locality, BITISSET.
11495 2001-12-05 Akim Demaille <akim@epita.fr>
11497 * src/conflicts.c (print_reductions): Arrays, not pointers.
11500 2001-12-05 Akim Demaille <akim@epita.fr>
11502 * src/conflicts.c (print_reductions): Pessimize, but clarify.
11504 2001-12-05 Akim Demaille <akim@epita.fr>
11506 * src/conflicts.c (print_reductions): Improve variable locality.
11508 2001-12-05 Akim Demaille <akim@epita.fr>
11510 * src/conflicts.c (print_reductions): Pessimize, but clarify.
11512 2001-12-05 Akim Demaille <akim@epita.fr>
11514 * src/conflicts.c (print_reductions): Improve variable locality.
11516 2001-12-05 Akim Demaille <akim@epita.fr>
11518 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
11519 * src/lalr.c: Use them.
11521 2001-12-05 Akim Demaille <akim@epita.fr>
11523 * src/LR0.c (augment_automaton): Formatting changes.
11524 Better variable locality.
11526 2001-12-05 Akim Demaille <akim@epita.fr>
11528 * src/lalr.c (matrix_print): New.
11529 (transpose): Use it.
11530 Use arrays instead of pointers.
11532 2001-12-05 Akim Demaille <akim@epita.fr>
11534 * src/lalr.c (maxrhs): Move to...
11535 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
11536 * src/lalr.c (build_relations): Adjust.
11538 2001-12-05 Akim Demaille <akim@epita.fr>
11540 * src/lalr.c (transpose): Free the memory allocated to the
11541 argument, as it is replaced by the results by the unique caller.
11542 (build_relations): Merely invoke transpose: it handles the memory
11544 Improve variable locality.
11545 Avoid variables used as mere abbreviations.
11546 (compute_lookaheads): Use arrays instead of pointers.
11548 2001-12-05 Akim Demaille <akim@epita.fr>
11550 * src/lalr.c (initialize_F): Improve variable locality.
11551 Avoid variables used as mere abbreviations.
11553 2001-12-05 Akim Demaille <akim@epita.fr>
11555 * src/derives.c (print_derives): Display the ruleno.
11556 * src/lalr.c (initialize_F, transpose): Better variable locality
11557 to improve readability.
11558 Avoid variables used as mere abbreviations.
11560 2001-12-05 Akim Demaille <akim@epita.fr>
11562 * src/lalr.c (traverse): Use arrays instead of pointers.
11564 2001-12-05 Akim Demaille <akim@epita.fr>
11566 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
11567 the handling of squeue.
11568 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
11570 2001-12-05 Akim Demaille <akim@epita.fr>
11572 Because useless nonterminals are now kept alive (instead of being
11573 `destroyed'), we now sometimes examine them, and store information
11574 related to them. Hence we need to know their number, and adjust
11575 memory allocations.
11577 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
11579 * src/LR0.c (allocate_itemsets): The memory allocated to
11580 `symbol_count' was used for two different purpose: once to count
11581 the number of occurrences of each symbol, and later reassigned to
11582 `shift_symbol', containing the symbol that can be shifted from a
11584 Deobfuscate, i.e., allocate, use and free `symbol_count' here
11586 (new_itemsets): Allocate `shift_symbol' here.
11587 (allocate_itemsets): symbol_count includes useless nonterminals.
11588 Make room for them.
11589 (free_storage): Use `free', not `XFREE', for pointers that cannot
11592 2001-12-05 Akim Demaille <akim@epita.fr>
11594 * src/nullable.c (set_nullable): Deobfuscate the handling of
11596 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
11598 2001-12-05 Akim Demaille <akim@epita.fr>
11600 * src/gram.c, src/gram.h (ritem_print): New.
11601 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
11602 (This useless function was defined only to work around VMS linkers
11603 that can't handle compilation units with variables only).
11604 * src/reduce.c (dump_grammar): Use it to trace the construction of
11607 2001-12-04 Paul Eggert <eggert@twinsun.com>
11609 * src/bison.simple (union yyalloc): Change member names
11610 to be the same as the stack names.
11611 (yyparse): yyptr is now union yyalloc *, not char *.
11612 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
11613 and may generate better code on some machines.
11614 (yystpcpy): Use prototype if __STDC__ is defined, not just
11615 if __cplusplus is defined.
11617 2001-11-30 Akim Demaille <akim@epita.fr>
11619 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
11620 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
11621 Gettext doesn't compile cleanly, and dies with -Werror.
11622 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
11623 Include WARNING_CFLAGS here.
11624 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
11625 before being defined.
11627 2001-11-27 Paul Eggert <eggert@twinsun.com>
11629 * lib/quotearg.h (quotearg_n, quotearg_n_style):
11630 First arg is int, not unsigned.
11631 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
11632 (SIZE_MAX, UINT_MAX): New macros.
11633 (quotearg_n_options): Abort if N is negative.
11634 Avoid overflow check on hosts where size_t is 64 bits and int
11635 is 32 bits, as overflow is impossible there.
11636 Fix off-by-one typo that caused unnecessary reallocation.
11638 2001-11-29 Paul Eggert <eggert@twinsun.com>
11640 Name space cleanup in generated parser.
11642 * doc/bison.texinfo (Bison Parser): Discuss system headers
11643 and their effect on the user name space.
11645 * src/bison.simple:
11646 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
11647 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
11648 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
11650 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
11651 on user names when possible.
11653 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
11654 Simplify test for whather <alloca.h> exists.
11656 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
11658 (<stdio.h>): Include if YYDEBUG.
11660 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
11661 ! defined (yyoverflow) && ! defined (yymemcpy).
11663 (yymemcpy, yyparse): Rename local variables as needed so that
11664 they all begin with 'yy'.
11666 (yystrlen, yystpcpy): New functions.
11668 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
11671 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
11672 instead of relying on string.h functions. Use YYSTACK_ALLOC
11673 and YYSTACK_FREE instead of malloc and free.
11675 2001-11-30 Akim Demaille <akim@epita.fr>
11677 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
11678 before their first uses.
11679 (YYBISON, YYPURE): Move to the top of the output.
11681 2001-11-30 Akim Demaille <akim@epita.fr>
11683 * tests/reduce.at (Useless Nonterminals): Fix.
11685 2001-11-30 Akim Demaille <akim@epita.fr>
11687 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
11688 if body instead of `;' to pacify GCC's warnings.
11690 2001-11-30 Akim Demaille <akim@epita.fr>
11692 Instead of mapping the LHS of unused rules to -1, keep the LHS
11693 valid, but flag the rules as invalid.
11695 * src/gram.h (rule_t): `useful' is a new member.
11696 * src/print.c (print_grammar): Adjust.
11697 * src/derives.c (set_derives): Likewise.
11698 * src/reader.c (packgram, reduce_output): Likewise.
11699 * src/reduce.c (reduce_grammar_tables): Likewise.
11700 * tests/reduce.at (Underivable Rules, Useless Rules): New.
11702 2001-11-30 Akim Demaille <akim@epita.fr>
11704 * src/reduce.c (reduce_output): Formatting changes.
11705 * src/print.c (print_results, print_grammar): Likewise.
11706 * tests/regression.at (Rule Line Numbers)
11707 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
11709 2001-11-30 Akim Demaille <akim@epita.fr>
11711 * src/reduce.c (nonterminals_reduce): Instead of throwing away
11712 useless nonterminals, move them at the end of the symbol arrays.
11713 (reduce_output): Adjust.
11714 * tests/reduce.at (Useless Nonterminals): Adjust.
11716 2001-11-30 Akim Demaille <akim@epita.fr>
11718 * src/reduce.c: Various comment/formatting changes.
11719 (nonterminals_reduce): New, extracted from...
11720 (reduce_grammar_tables): here.
11721 (reduce_grammar): Call nonterminals_reduce.
11723 2001-11-29 Paul Eggert <eggert@twinsun.com>
11725 * src/bison.simple (YYSTACK_REALLOC): Remove.
11726 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
11727 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
11729 (union yyalloc): New type.
11730 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
11731 an arbitrary restriction on hosts where size_t is wider than int.
11733 (yyparse): Don't dump core if alloca or malloc fails; instead, report
11734 a parser stack overflow. Allocate just one block of memory for all
11735 three stacks, instead of allocating three blocks; this typically is
11736 faster and reduces fragmentation.
11738 Do not limit the number of items in the stack to a value that fits
11739 in 'int', as this is an arbitrary limit on hosts with 64-bit
11740 size_t and 32-bit int.
11742 2001-11-29 Marc Autret <autret_m@epita.fr>
11744 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
11745 of defining YYERROR_VERBOSE.
11746 [AT_DATA]: $4 is now out of C declarations in the prologue.
11748 2001-11-28 Marc Autret <autret_m@epita.fr>
11750 * src/reader.c (parse_dquoted_param): New.
11751 (parse_skel_decl): Use it.
11752 * src/lex.h: Add its prototype.
11753 * src/lex.c (literalchar): Become not static.
11755 2001-11-28 Marc Autret <autret_m@epita.fr>
11757 * src/output.h: And put its extern declaration here.
11758 * src/output.c (error_verbose): Define here.
11759 (prepare): Echo name modification.
11760 * src/getargs.h: Clean its extern declaration.
11761 * src/getargs.c (error_verbose_flag): Remove.
11762 (getargs): Remove case 'e'.
11763 * src/options.c (option_table): 'error-verbose' is now seen as simple
11767 * src/reader.c (read_declarations): Remove case tok_include.
11768 (parse_include_decl): Remove.
11769 * src/lex.h (token_t): Remove tok_include.
11770 * src/options.c (option_table): 'include' is now a simple command line
11773 2001-11-28 Marc Autret <autret_m@epita.fr>
11775 * src/bison.simple: Adjust muscle names.
11776 * src/muscle_tab.c (muscle_init): Also rename the muscles.
11777 * src/output.c (prepare): s/_/-/ for the muscles names.
11778 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
11780 2001-11-28 Marc Autret <autret_m@epita.fr>
11782 * src/bison.simple: Fix debug.
11783 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
11785 2001-11-28 Akim Demaille <akim@epita.fr>
11787 * src/LR0.c (shifts_new): New.
11788 (save_shifts, insert_start_shift, augment_automaton): Use it.
11790 2001-11-28 Akim Demaille <akim@epita.fr>
11792 * src/closure.c (closure): `b' and `ruleno' denote the same value:
11795 2001-11-28 Akim Demaille <akim@epita.fr>
11797 * src/closure.c (closure): Instead of looping over word in array
11798 then bits in words, loop over bits in array.
11800 2001-11-28 Akim Demaille <akim@epita.fr>
11802 * src/closure.c (closure): No longer optimize the special case
11803 where all the bits of `ruleset[r]' are set to 0, to make the code
11806 2001-11-28 Akim Demaille <akim@epita.fr>
11808 * src/closure.c (closure): `r' and `c' are new variables, used to
11809 de-obfuscate accesses to RULESET and CORE.
11811 2001-11-28 Akim Demaille <akim@epita.fr>
11813 * src/reduce.c (reduce_print): Use ngettext.
11814 (dump_grammar): Improve the trace accuracy.
11816 2001-11-28 Akim Demaille <akim@epita.fr>
11818 * src/reduce.c (dump_grammar): Don't translate trace messages.
11820 2001-11-28 Akim Demaille <akim@epita.fr>
11822 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
11823 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
11824 as all tags are free'ed afterwards.
11825 From Enrico Scholz.
11827 2001-11-27 Paul Eggert <eggert@twinsun.com>
11829 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
11830 use alloca when we didn't want to, and vice versa.
11832 2001-11-27 Marc Autret <autret_m@epita.fr>
11834 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
11836 * src/output.c (prepare): Remove its update.
11838 2001-11-27 Marc Autret <autret_m@epita.fr>
11840 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
11841 Use %error-verbose.
11843 2001-11-27 Marc Autret <autret_m@epita.fr>
11845 * src/bison.simple: Remove YYERROR_VERBOSE using.
11846 Use %%error_verbose.
11847 (yyparse): Likewise.
11848 * src/output.c (prepare): Give its final value.
11849 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
11850 * src/getargs.h: Add its extern declaration.
11851 * src/getargs.c (error_verbose_flag): New int.
11852 (getargs): Update to catch new case.
11853 * src/options.c (option_table): 'error-verbose' is a new option.
11854 (shortopts): Update.
11856 2001-11-27 Akim Demaille <akim@epita.fr>
11858 * src/system.h: Use intl/libgettext.h.
11859 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
11861 2001-11-27 Akim Demaille <akim@epita.fr>
11863 * tests/torture.at (Exploding the Stack Size with Malloc):
11864 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
11866 2001-11-27 Akim Demaille <akim@epita.fr>
11868 * src/files.c: Include error.h.
11869 Reported by Hans Aberg.
11871 2001-11-26 Marc Autret <autret_m@epita.fr>
11873 * src/reader.c (parse_include_decl): New, not yet implemented.
11874 (read_declarations): Add case tok_include.
11875 * src/getargs.h (include): Add its extern definition.
11876 * src/getargs.c (include): New const char *.
11877 (getargs): Add case '-I'.
11878 * src/options.c (option_table): Add include as command line and
11880 * src/lex.h (token_t): Add tok_include.
11882 2001-11-26 Akim Demaille <akim@epita.fr>
11884 * src/reader.c (readgram): Make sure rules for mid-rule actions
11885 have a lineno equal to that of their host rule.
11886 Reported by Hans Aberg.
11887 * tests/regression.at (Rule Line Numbers): New.
11889 2001-11-26 Akim Demaille <akim@epita.fr>
11891 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
11894 2001-11-26 Akim Demaille <akim@epita.fr>
11896 * src/complain.c, src/complain.h (error): Remove, provided by
11899 2001-11-26 Akim Demaille <akim@epita.fr>
11901 * src/reader.c (read_declarations): Don't abort on tok_illegal,
11902 issue an error message.
11903 * tests/regression.at (Invalid %directive): New.
11904 Reported by Hans Aberg.
11906 2001-11-26 Akim Demaille <akim@epita.fr>
11908 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
11909 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
11911 2001-11-26 Akim Demaille <akim@epita.fr>
11913 * src/conflicts.c (conflicts_print): Don't complain at all when
11914 there are no reduce/reduce conflicts, and as many shift/reduce
11915 conflicts as expected.
11916 * tests/regression.at (%expect right): Adjust.
11918 2001-11-23 Akim Demaille <akim@epita.fr>
11920 * lib/alloca.c: Update, from fileutils.
11922 2001-11-23 Akim Demaille <akim@epita.fr>
11924 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
11926 2001-11-23 Akim Demaille <akim@epita.fr>
11928 * src/system.h: Include alloca.h.
11929 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
11931 2001-11-23 Akim Demaille <akim@epita.fr>
11933 * src/print_graph.c (print_actions): Remove `rule', unused.
11934 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
11935 pacify GCC's signed < unsigned warnings.
11936 * src/closure.c (itemsetsize): Likewise.
11937 * src/reader.c (symbol_list_new): Static.
11939 2001-11-23 Akim Demaille <akim@epita.fr>
11941 Attaching lineno to buckets is stupid, since only one copy of each
11942 symbol is kept, only the line of the first occurrence is kept too.
11944 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
11945 * src/reader.c (rline_allocated): Remove, unused.
11946 (symbol_list): Have a `line' member.
11947 (symbol_list_new): New.
11948 (readgram): Use it.
11949 * src/print.c (print_grammar): Output the rule line numbers.
11950 * tests/regression.at (Solved SR Conflicts)
11951 (Unresolved SR Conflicts): Adjust.
11952 Reported by Hans Aberg.
11954 2001-11-22 Marc Autret <autret_m@epita.fr>
11956 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
11958 2001-11-22 Marc Autret <autret_m@epita.fr>
11960 * src/muscle_tab.c (muscle_init): Remove initialization of
11962 * src/output.c (output_master_parser): Do it here.
11964 2001-11-20 Akim Demaille <akim@epita.fr>
11967 * configure.in (ALL_LINGUAS): Adjust.
11968 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
11969 longer contains strings to translate.
11971 2001-11-19 Akim Demaille <akim@epita.fr>
11973 * src/conflicts.c (conflicts_print): Add a missing \n.
11975 2001-11-19 Akim Demaille <akim@epita.fr>
11977 * src/nullable.c (nullable_print): New.
11978 (set_nullable): Call it when tracing.
11979 Better locality of variables.
11981 2001-11-19 Akim Demaille <akim@epita.fr>
11983 * src/print.c (print_actions): Better locality of variables.
11985 2001-11-19 Akim Demaille <akim@epita.fr>
11987 * src/derives.c (print_derives): Fix and enrich.
11988 * src/closure.c (print_fderives): Likewise.
11990 2001-11-19 Akim Demaille <akim@epita.fr>
11992 * src/closure.c (itemsetend): Remove, replaced with...
11993 (itemsetsize): new.
11995 2001-11-19 Akim Demaille <akim@epita.fr>
11997 * src/LR0.c (kernel_end): Remove, replaced with...
11998 (kernel_size): new.
12000 2001-11-19 Akim Demaille <akim@epita.fr>
12002 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
12005 2001-11-19 Akim Demaille <akim@epita.fr>
12007 * src/closure.c (closure): Use arrays instead of pointers to clarify.
12009 2001-11-19 Akim Demaille <akim@epita.fr>
12011 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
12013 * src/LR0.c: Likewise.
12014 (allocate_itemsets): Use arrays instead of pointers to clarify.
12016 2001-11-19 Akim Demaille <akim@epita.fr>
12018 * src/getargs.c (statistics_flag): Replace with...
12020 (longopts): Accept --trace instead of --statistics.
12021 * src/getargs.h, src/options.c: Adjust.
12022 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
12023 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
12025 2001-11-19 Akim Demaille <akim@epita.fr>
12027 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
12028 pointers to clarify the code.
12029 (save_reductions, save_shifts): Factor common parts of alternatives.
12031 2001-11-19 Akim Demaille <akim@epita.fr>
12033 * src/LR0.c (new_state, get_state): Complete TRACE code.
12034 * src/closure.c: Include `reader.h' to get `tags', needed by the
12036 Rename the conditional DEBUG as TRACE.
12037 Output consistently TRACEs to stderr, not stdout.
12038 * src/derives.c: Likewise.
12039 * src/reduce.c: (inaccessable_symbols): Using if is better style
12041 Use `#if TRACE' instead of `#if 0' for tracing code.
12043 2001-11-19 Akim Demaille <akim@epita.fr>
12045 * src/system.h (LIST_FREE, shortcpy): New.
12046 * src/LR0.c: Use them.
12047 * src/output.c (free_itemsets, free_reductions, free_shifts):
12048 Remove, replaced by LIST_FREE.
12050 2001-11-19 Akim Demaille <akim@epita.fr>
12052 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
12053 (REDUCTIONS_ALLOC): New.
12054 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
12057 2001-11-19 Akim Demaille <akim@epita.fr>
12059 * src/LR0.c (new_state): Complete trace code.
12060 * src/nullable.c (set_nullable): Don't translate traces.
12062 2001-11-19 Akim Demaille <akim@epita.fr>
12064 * src/print_graph.c (print_core): Better locality of variables.
12065 * src/print.c (print_core): Likewise.
12067 2001-11-19 Akim Demaille <akim@epita.fr>
12069 * src/vcg.c: You do the output, so you are responsible of the
12070 handling of VCG syntax, in particular: use quotearg.
12071 * src/print_graph.c: Don't.
12072 (print_actions): Don't output the actions as part of the nodes,
12073 since that's the job of the edges.
12074 (print_state): Don't output by hand: fill the node description,
12075 and ask for its output.
12077 2001-11-19 Akim Demaille <akim@epita.fr>
12079 * src/bison.simple (yyparse): When verbosely reporting an error,
12080 no longer put additional quotes around token names.
12081 * tests/calc.at: Adjust.
12083 2001-11-19 Akim Demaille <akim@epita.fr>
12085 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
12086 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
12087 * src/output.c: Adjust.
12089 2001-11-19 Akim Demaille <akim@epita.fr>
12091 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
12093 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
12095 2001-11-19 Akim Demaille <akim@epita.fr>
12097 * src/gram.h (rule_t): New.
12099 (rrhs, rlhs): Remove, part of state_t.
12100 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
12101 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12102 * src/reader.c, src/reduce.c: Adjust.
12104 2001-11-19 Akim Demaille <akim@epita.fr>
12106 * src/reader.c (symbols_output): New, extracted from...
12107 (packsymbols): Here.
12110 2001-11-19 Akim Demaille <akim@epita.fr>
12112 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
12113 (maxrhs): this new function.
12115 2001-11-19 Akim Demaille <akim@epita.fr>
12117 * src/lalr.c (F): New macro to access the variable F.
12120 2001-11-19 Akim Demaille <akim@epita.fr>
12122 * src/lalr.h (LA): New macro to access the variable LA.
12123 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12124 * src/lalr.c: Adjust.
12126 2001-11-19 Akim Demaille <akim@epita.fr>
12128 * src/lalr.c (initialize_LA): Only initialize LA. Let...
12129 (set_state_table): handle the `lookaheads' members.
12131 2001-11-19 Akim Demaille <akim@epita.fr>
12133 * src/lalr.h (lookaheads): Removed array, whose contents is now
12135 (state_t): this structure.
12136 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12139 2001-11-19 Akim Demaille <akim@epita.fr>
12141 * src/lalr.h (consistent): Removed array, whose contents is now
12143 (state_t): this structure.
12144 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12147 2001-11-19 Akim Demaille <akim@epita.fr>
12149 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
12150 contents are now members of...
12151 (state_t): this structure.
12152 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12155 2001-11-19 Akim Demaille <akim@epita.fr>
12157 * src/lalr.h (state_t): New.
12158 (state_table): Be a state_t * instead of a core **.
12159 (accessing_symbol): Remove, part of state_t.
12160 * src/lalr.c: Adjust.
12161 (set_accessing_symbol): Merge into...
12162 (set_state_table): this.
12163 * src/print_graph.c, src/conflicts.c: Adjust.
12165 2001-11-14 Akim Demaille <akim@epita.fr>
12167 * tests/calc.at, tests/output.at, tests/regression.at,
12168 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
12169 now the tests are run in private dirs, therefore AC_CLEANUP and
12170 family can be simplified to 0-ary.
12171 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
12172 use abs. path to find config.h.
12173 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
12174 stderr, there can be way too much random noise.
12175 Instead pass -Werror to GCC and rely on the exit status.
12176 Reported by Wolfram Wagner.
12178 2001-11-14 Akim Demaille <akim@epita.fr>
12180 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
12181 defined only if yyoverflow is defined, to avoid `warning: unused
12183 Reported by The Test Suite.
12185 2001-11-14 Akim Demaille <akim@epita.fr>
12187 * src/print.c: Include reduce.h.
12188 Reported by Hans Aberg.
12190 2001-11-14 Akim Demaille <akim@epita.fr>
12192 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
12193 Revert a previous patch: these are really const.
12194 * src/conflicts.c (conflict_report): Additional useless pair of
12195 braces to pacify GCC's warnings for `if () if () {} else {}'.
12196 * src/lex.c (parse_percent_token): Replace equal_offset with
12199 Be sure to strdup `arg' when used, since there is no reason for
12200 token_buffer not to change.
12202 2001-11-14 Akim Demaille <akim@epita.fr>
12204 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
12206 * src/main.c (main): Use them.
12207 Suggested by Hans Aberg.
12209 2001-11-12 Akim Demaille <akim@epita.fr>
12211 * src/system.h (ngettext): Now that we use ngettext, be sure to
12212 provide a default definition when NLS are not used.
12214 2001-11-12 Akim Demaille <akim@epita.fr>
12216 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
12217 Use @kbd to denote user input.
12218 (Language and Grammar): ANSIfy the example.
12219 Adjust its layout for info/notinfo.
12220 (Location Tracking Calc): Output error messages to stderr.
12221 Output locations in a more GNUtically correct way.
12222 Fix a couple of Englishos.
12223 Adjust @group/@end group pairs.
12225 2001-11-12 Akim Demaille <akim@epita.fr>
12227 %expect was not functioning at all.
12229 * src/conflicts.c (expected_conflicts): Set to -1.
12230 (conflict_report): Use ngettext.
12231 (conflicts_print): Check %expect and make its violation an error.
12232 * doc/bison.texinfo (Expect Decl): Adjust.
12233 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
12234 * tests/regression.at (%expect not enough, %expect right)
12235 (%expect too much): New.
12237 2001-11-12 Akim Demaille <akim@epita.fr>
12239 * tests/regression.at (Conflicts): Rename as...
12240 (Unresolved SR Conflicts): this.
12241 (Solved SR Conflicts): New.
12243 2001-11-12 Akim Demaille <akim@epita.fr>
12245 * src/reduce.c (print_results): Rename as...
12246 (reduce_output): This.
12247 Output to OUT, passed as argument, instead of output_obstack.
12248 (dump_grammar): Likewise.
12249 (reduce_free): New.
12251 (reduce_grammar): No longer call reduce_output, since...
12252 * src/print.c (print_results): do it.
12253 * src/main.c (main): Call reduce_free;
12255 2001-11-12 Akim Demaille <akim@epita.fr>
12257 * src/conflicts.c (print_reductions): Accept OUT as argument.
12258 Output to it, not to output_obstack.
12259 * src/print.c (print_actions): Adjust.
12261 2001-11-12 Akim Demaille <akim@epita.fr>
12263 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
12264 the result instead of using...
12265 (src_total, rrc_total, src_count, rrc_count): Remove.
12266 (any_conflicts): Remove.
12267 (print_conflicts): Split into...
12268 (conflicts_print, conflicts_output): New.
12269 * src/conflicts.h: Adjust.
12270 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
12271 * src/print.c (print_grammar): Issue `\n' between two rules.
12272 * tests/regression.at (Conflicts): New.
12273 Reported by Tom Lane.
12275 2001-11-12 Akim Demaille <akim@epita.fr>
12277 * tests/regression.at (Invalid input): Remove, duplicate with
12278 ``Invalid input: 1''.
12280 2001-11-12 Akim Demaille <akim@epita.fr>
12282 * tests/torture.at (AT_DATA_STACK_TORTURE)
12283 (Exploding the Stack Size with Alloca)
12284 (Exploding the Stack Size with Malloc): New.
12286 2001-11-12 Akim Demaille <akim@epita.fr>
12288 * src/bison.simple (YYSTACK_REALLOC): New.
12289 (yyparse) [!yyoverflow]: Use it and free the old stack.
12290 Reported by Per Allansson.
12292 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
12294 * src/bison.simple: Define type yystype instead of YYSTYPE, and
12295 define CPP macro, which substitute YYSTYPE by yystype.
12296 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
12297 with yyltype/YYLTYPE. This allows inclusion of the generated
12298 header within the parser if the compiler, such as GGC, accepts
12299 multiple equivalent #defines.
12302 2001-11-05 Akim Demaille <akim@epita.fr>
12304 * src/reader.c (symbols_output): New, extracted from...
12305 (packsymbols): here.
12308 2001-11-05 Akim Demaille <akim@epita.fr>
12310 * src/lex.c (parse_percent_token): s/quotearg/quote/.
12312 2001-11-05 Akim Demaille <akim@epita.fr>
12314 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
12317 2001-11-05 Akim Demaille <akim@epita.fr>
12319 * src/options.h (struct option_table_struct): set_flags is void*.
12320 * src/options.c (longopts): Support `--output' and `%output'.
12322 * src/lex.h (tok_setopt): Remove, replaced with...
12323 (tok_intopt, tok_stropt): these new guys.
12324 * src/lex.c (getopt.h): Not needed.
12325 (token_buffer, unlexed_token_buffer): Not const.
12326 (percent_table): Promote `-' over `_' in directive names.
12327 Active `%name-prefix', `file-prefix', and `output'.
12328 (parse_percent_token): Accept possible arguments to directives.
12329 Promote `-' over `_' in directive names.
12331 2001-11-04 Akim Demaille <akim@epita.fr>
12333 * doc/bison.texinfo (Decl Summary): Split the list into
12334 `directives for grammars' and `directives for bison'.
12336 Add description of `%name-prefix', `file-prefix', and `output'.
12337 Promote `-' over `_' in directive names.
12338 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
12339 Simplify the description of `--name-prefix'.
12340 Promote `-' over `_' in directive names.
12341 Promote `--output' over `--output-file'.
12342 Fix the description of `--defines'.
12343 * tests/output.at: Exercise %file-prefix and %output.
12345 2001-11-02 Akim Demaille <akim@epita.fr>
12347 * doc/refcard.tex: Update.
12349 2001-11-02 Akim Demaille <akim@epita.fr>
12351 * src/symtab.h (SUNDEF): New.
12352 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
12353 stand for `uninitialized', instead of 0.
12354 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
12355 * src/lex.c (lex): Adjust.
12357 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
12359 Let yylex return it instead of a plain 0.
12360 Reported by Dick Streefland.
12362 2001-11-02 Akim Demaille <akim@epita.fr>
12364 * tests/regression.at (Mixing %token styles): New test.
12366 2001-11-02 Akim Demaille <akim@epita.fr>
12368 * src/reader.c (parse_thong_decl): Formatting changes.
12369 (token_translations_init): New, extracted from...
12370 (packsymbols): Here.
12373 2001-11-01 Akim Demaille <akim@epita.fr>
12375 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
12376 Check that `9foo.y' produces correct cpp guards.
12377 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
12381 2001-11-01 Akim Demaille <akim@epita.fr>
12383 * tests/regression.at (Invalid input: 2): New.
12384 * src/lex.c (unlexed_token_buffer): New.
12385 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
12389 2001-11-01 Akim Demaille <akim@epita.fr>
12391 * tests/calc.at: Catch up with 1.30.
12392 * configure.in: Bump to 1.49a.
12393 Adjust to newer Autotest.
12395 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
12397 * src/conflicts.c: Move global variables rrc_total and src_total ...
12398 (print_conflicts): here.
12399 * src/output.c (output): Free global variable user_toknums.
12400 * src/lex.c (token_obstack): Become static.
12402 2001-10-18 Akim Demaille <akim@epita.fr>
12404 * tests/atlocal.in (GCC): Add.
12405 * tests/calc.at: s/m4_match/m4_bmatch/.
12406 s/m4_patsubst/m4_bpatsubst/.
12407 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
12408 * configure.in: AC_SUBST(GCC).
12410 2001-10-14 Marc Autret <autret_m@epita.fr>
12412 * src/options.c (create_long_option_table): Fix.
12414 2001-10-10 Akim Demaille <akim@epita.fr>
12416 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
12418 2001-10-04 Akim Demaille <akim@epita.fr>
12420 * src/reader.c (parse_union_decl): Push the caracters in
12421 union_obstack, not attrs_obstack.
12423 2001-10-04 Akim Demaille <akim@epita.fr>
12425 Merge in the branch 1.29.
12427 * src/reader.c (packsymbols): Use a temporary obstack for
12428 `%%tokendef', since output_stack is already used elsewhere.
12430 2001-10-02 Akim Demaille <akim@epita.fr>
12434 2001-10-02 Akim Demaille <akim@epita.fr>
12438 2001-10-02 Akim Demaille <akim@epita.fr>
12440 * tests/regression.at (Invalid CPP headers): New.
12441 From Alexander Belopolsky.
12442 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
12444 2001-10-02 Akim Demaille <akim@epita.fr>
12446 * tests/regression.at (Invalid input): New.
12447 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
12450 2001-10-02 Akim Demaille <akim@epita.fr>
12452 * tests/calc.at: Now that --debug works, the tests must be adjusted.
12454 2001-10-02 Akim Demaille <akim@epita.fr>
12456 * src/output.c (output_parser): Assert `skeleton'.
12457 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
12461 2001-10-01 Marc Autret <autret_m@epita.fr>
12463 * src/lex.h: Echo modifications.
12464 * src/lex.c (unlex): Parameter is now token_t.
12467 2001-10-01 Marc Autret <autret_m@epita.fr>
12469 * src/main.c: Include lex.h.
12472 2001-09-29 Akim Demaille <akim@epita.fr>
12474 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
12476 2001-09-28 Akim Demaille <akim@epita.fr>
12478 * tests/testsuite.at: Update to newer Autotest.
12479 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
12481 2001-09-27 Akim Demaille <akim@epita.fr>
12483 Position independent wrapper.
12485 * tests/bison: Remove.
12486 * tests/bison.in: New.
12487 * configure.in: Adjust.
12489 2001-09-27 Paul Eggert <eggert@twinsun.com>
12491 Port quotearg fixes from tar 1.13.24.
12493 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
12495 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
12496 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
12498 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
12499 * m4/mbrtowc.m4: New file.
12500 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
12501 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
12503 2001-09-27 Akim Demaille <akim@epita.fr>
12507 2001-09-27 Akim Demaille <akim@epita.fr>
12511 2001-09-25 Akim Demaille <akim@epita.fr>
12513 * src/system.h: Include `xalloc.h'.
12514 Remove it from the C files.
12515 * src/files.c (output_files): Free the obstacks.
12516 * src/lex.c (init_lex): Rename as...
12519 * src/main.c (main): Use it.
12521 2001-09-24 Marc Autret <autret_m@epita.fr>
12523 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
12524 to output informations in fout (FILE*).
12525 (open_graph, close_graph): Likewise.
12526 (output_graph, output_edge, output_node): Likewise.
12527 * src/vcg.h: Update function prototypes.
12528 * src/print_graph.c (print_graph): Open output graph file.
12529 (print_actions): Adjust.
12530 * src/files.h: Remove extern declaration.
12531 * src/files.c: Remove graph_obstack declaration.
12532 (open_files): Remove graph_obstack initialization.
12533 (output_files): Remove graph_obstack saving.
12535 2001-09-24 Marc Autret <autret_m@epita.fr>
12537 * src/files.c (compute_output_file_names): Fix.
12539 2001-09-24 Marc Autret <autret_m@epita.fr>,
12540 Akim Demaille <akim@epita.fr>
12542 * src/reader.c (reader): Remove call to free_symtab ().
12543 * src/main.c (main): Call it here.
12545 * src/conflicts.c (initialize_conflicts): Rename as...
12546 (solve_conflicts): this.
12547 * src/print.c (print_core, print_actions, print_state)
12548 (print_grammar): Dump to a file instead a `output_obstack'.
12549 (print_results): Dump `output_obstack', and then proceed with the
12551 * src/files.c (compute_output_file_names, close_files): New.
12552 (output_files): Adjust.
12553 * src/main.c (main): Adjust.
12555 2001-09-23 Marc Autret <autret_m@epita.fr>
12557 * src/files.c (compute_header_macro): Computes header macro name
12558 from spec_defines_file when given.
12560 2001-09-23 Marc Autret <autret_m@epita.fr>
12562 * src/files.c (output_files): Add default extensions.
12564 2001-09-22 Akim Demaille <akim@epita.fr>
12566 * src/conflicts.c (finalize_conflicts): Rename as...
12567 (free_conflicts): this.
12569 2001-09-22 Akim Demaille <akim@epita.fr>
12571 * src/gram.c (gram_free): Rename back as...
12573 (output_token_translations): Free `token_translations'.
12574 * src/symtab.c (free_symtab): Free the tag field.
12576 2001-09-22 Akim Demaille <akim@epita.fr>
12578 Remove `translations' as it is always set to true.
12580 * src/gram.h: Adjust.
12581 * src/reader.c (packsymbols, parse_token_decl): Adjust
12582 * src/print.c (print_grammar): Adjust.
12583 * src/output.c (output_token_translations): Adjust.
12584 * src/lex.c (lex): Adjust.
12585 * src/gram.c: Be sure the set pointers to NULL.
12586 (dummy): Rename as...
12589 2001-09-22 Akim Demaille <akim@epita.fr>
12591 * configure.in: Invoke AM_LIB_DMALLOC.
12592 * src/system.h: Use dmalloc.
12593 * src/LR0.c: Be sure to have pointers initialized to NULL.
12594 (allocate_itemsets): Allocate kernel_items only if needed.
12596 2001-09-22 Akim Demaille <akim@epita.fr>
12598 * configure.in: Bump to 1.29b.
12599 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
12600 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
12601 need xmalloc.c in calc.y.
12604 2001-09-21 Akim Demaille <akim@epita.fr>
12607 * Makefile.maint, config/config.guess, config/config.sub,
12608 * config/missing: Update from masters.
12609 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
12611 * configure.in (ALL_LINGUAS): Add `tr'.
12613 2001-09-21 Akim Demaille <akim@epita.fr>
12615 * tests/Makefile.am (package.m4): Move to...
12616 ($(srcdir)/$(TESTSUITE)): here.
12618 2001-09-20 Akim Demaille <akim@epita.fr>
12620 * src/complain.c: No longer try to be standalone: use system.h.
12621 Don't assume __STDC__ is defined to 1. Just test if it is defined.
12622 * src/complain.h: Likewise.
12623 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
12624 Remove the unused variable `n'.
12625 From Albert Chin-A-Young.
12627 2001-09-18 Marc Autret <autret_m@epita.fr>
12629 * doc/bison.1: Update.
12630 * doc/bison.texinfo (Bison Options): Update --defines and --graph
12632 (Option Cross Key): Update.
12635 2001-09-18 Marc Autret <autret_m@epita.fr>
12637 * tests/regression.at: New test (comment in %union).
12639 2001-09-18 Marc Autret <autret_m@epita.fr>
12641 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
12643 Reported by Keith Browne.
12645 2001-09-18 Marc Autret <autret_m@epita.fr>
12647 * tests/output.at: Add tests for --defines and --graph.
12649 2001-09-18 Marc Autret <autret_m@epita.fr>
12651 * tests/output.at: Removes tests of %{header,src}_extension features.
12653 2001-09-18 Akim Demaille <akim@epita.fr>
12655 * tests/Makefile.am (package.m4): New.
12656 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
12657 (_AT_CHECK_CALC_ERROR): Likewise.
12658 Factor the `, ' part of verbose error messages.
12660 2001-09-18 Marc Autret <autret_m@epita.fr>
12662 * src/getargs.c (longopts): Declare --defines and --graph as options
12663 with optional arguments.
12664 * src/files.h: Add extern declarations.
12665 * src/files.c (spec_graph_file, spec_defines_file): New.
12666 (output_files): Update.
12667 Remove CPP-outed code.
12669 2001-09-18 Marc Autret <autret_m@epita.fr>
12671 Turn off %{source,header}_extension feature.
12673 * src/files.c (compute_exts_from_gf): Update.
12674 (compute_exts_from_src): Update.
12675 (output_files): CPP-out useless code.
12676 * src/files.h: Remove {header,source}_extension extern declarations.
12677 * src/reader.c (parse_dquoted_param): CPP-out.
12678 (parse_header_extension_decl): Remove.
12679 (parse_source_extension_decl): Remove.
12680 (read_declarations): Remove cases tok_{hdrext,srcext}.
12681 * src/lex.c (percent_table): Remove {header,source}_extension entries.
12682 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
12684 2001-09-10 Akim Demaille <akim@epita.fr>
12686 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
12687 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
12688 (AT_CHECK_OUTPUT): this.
12689 Merely check ls' exit status, its output is useless.
12691 2001-09-10 Akim Demaille <akim@epita.fr>
12693 * tests/calc.at: Use m4_match.
12694 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
12696 2001-09-10 Marc Autret <autret_m@epita.fr>,
12697 Akim Demaille <akim@epita.fr>
12699 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
12701 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
12703 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
12704 * src/lex.h: Adjust prototype.
12705 (token_t): Add `tok_undef'.
12706 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
12707 (parse_percent_token): Now returns token_t.
12708 Add default statement in switch.
12709 (lex): Separate `c' as an input variable, from the token_t result
12711 (unlexed): Is a token_t.
12713 2001-09-10 Akim Demaille <akim@epita.fr>
12715 * configure.in: Bump to 1.29a.
12717 2001-09-07 Akim Demaille <akim@epita.fr>
12721 2001-08-30 Akim Demaille <akim@epita.fr>
12723 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
12724 * m4/atconfig.m4: Remove.
12725 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
12726 * tests/bison: New.
12727 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
12728 m4_if, m4_patsubst, and m4_regexp.
12729 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
12730 `input' file instead of echo.
12732 2001-08-29 Akim Demaille <akim@epita.fr>
12736 2001-08-29 Akim Demaille <akim@epita.fr>
12740 2001-08-29 Paul Eggert <eggert@twinsun.com>
12742 * src/bison.simple (yyparse): Don't take the address of an
12743 item before the start of an array, as that doesn't conform to
12746 2001-08-29 Robert Anisko <anisko_r@epita.fr>
12748 * doc/bison.texinfo (Location Tracking Calc): New node.
12750 2001-08-29 Paul Eggert <eggert@twinsun.com>
12752 * src/output.c (output): Do not define const, as this now
12753 causes more problems than it cures.
12755 2001-08-29 Akim Demaille <akim@epita.fr>
12757 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
12759 Be sure to tag the `detailmenu'.
12761 2001-08-29 Akim Demaille <akim@epita.fr>
12763 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
12764 download in a tmp dir.
12766 2001-08-28 Marc Autret <autret_m@epita.fr>
12768 * config/depcomp: New file.
12770 2001-08-28 Marc Autret <autret_m@epita.fr>
12772 * doc/bison.1 (mandoc): Adjust.
12773 From Juan Manuel Guerrero.
12775 2001-08-28 Marc Autret <autret_m@epita.fr>
12777 * src/print_graph.c (print_state): Fix.
12779 2001-08-27 Marc Autret <autret_m@epita.fr>
12781 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
12783 Echo modifications to the functions prototypes.
12784 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
12786 2001-08-27 Marc Autret <autret_m@epita.fr>
12788 * src/vcg.c: Include `xalloc.h'.
12789 (add_colorentry): New.
12790 (add_classname): New.
12791 (add_infoname): New.
12792 * src/vcg.h: Add new prototypes.
12794 2001-08-27 Akim Demaille <akim@epita.fr>
12796 * Makefile.maint: Sync. again with CVS Autoconf.
12798 2001-08-27 Akim Demaille <akim@epita.fr>
12800 * Makefile.maint: Formatting changes.
12801 (po-update, cvs-update, update): New targets.
12804 2001-08-27 Akim Demaille <akim@epita.fr>
12806 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
12807 * Makefile.maint: Sync. with CVS Autoconf.
12809 2001-08-27 Marc Autret <autret_m@epita.fr>
12811 * src/vcg.h (struct infoname_s): New.
12812 (struct colorentry_s): New.
12813 (graph_s): New fields {vertical,horizontal}_order in structure.
12814 Add `infoname' field.
12815 Add `colorentry' field;
12816 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
12817 (G_HORIZONTAL_ORDER): New.
12819 (G_COLORENTRY): New.
12820 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
12821 Add output of `infoname'.
12822 Add output of `colorentry'.
12824 2001-08-27 Marc Autret <autret_m@epita.fr>
12826 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
12827 This one shadowed a global parameter.
12829 2001-08-24 Marc Autret <autret_m@epita.fr>
12831 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
12832 instead of `unsigned'.
12833 (print_state): Do not call obstack_object_size () in obstack_grow ()
12834 to avoid macro variables shadowing.
12836 2001-08-23 Marc Autret <autret_m@epita.fr>
12838 * src/lex.c (percent_table): Typo: s/naem/name/.
12840 Normalize new options declarations.
12842 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
12844 * tests/suite.at: Exercise %header_extension and %source_extension.
12846 2001-08-16 Marc Autret <autret_m@epita.fr>
12848 * src/reader.c (parse_dquoted_param): New.
12849 (parse_header_extension_decl): Use it.
12850 (parse_source_extension_decl): Likewise.
12852 2001-08-16 Marc Autret <autret_m@epita.fr>
12854 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
12855 (get_xxxx_str): Use assert () instead of complain ().
12856 Remove return invokations in default cases.
12857 (get_decision_str): Modify default behaviour. Remove second argument.
12858 Echo modifications on calls.
12859 (output_graph): Fix.
12861 2001-08-16 Marc Autret <autret_m@epita.fr>
12863 * src/getargs.c (usage): Update with ``-g, --graph''.
12865 2001-08-16 Marc Autret <autret_m@epita.fr>
12867 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
12868 (Option Cross Key): Likewise.
12869 * doc/bison.1: Update.
12871 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
12873 * src/output.c (output_master_parser): Don't finish action_obstack.
12874 (output_parser): Don't care about the muscle action, here.
12875 (prepare): Copy the action_obstack in the action muscle.
12876 (output): Free action_obstack.
12878 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
12880 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
12881 will contain `%union' declaration.
12882 (parse_union_decl): Delete #line directive output.
12883 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
12884 informations about %union.
12885 (parse_union_decl): Copy the union_obstack in the muscle stype.
12886 * src/bison.simple: Add new #line directive.
12887 Add typdef %%stype YYSTYPE.
12889 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
12891 * src/bison.simple: Add new `#line' directive.
12893 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
12895 * src/bison.simple: New `#line' directive.
12896 * src/output.c (output_parser): Support new dynamic muscle input_line.
12898 2001-09-22 Marc Autret <autret_m@epita.fr>
12900 * src/output.c (output_master_parser): New.
12901 (output_parser): Be more re-entrant.
12903 2001-09-21 Marc Autret <autret_m@epita.fr>
12905 * src/reader.c (copy_definition, parse_union_decl): Update and use
12907 (copy_action): Likewise.
12908 Use obstack_1grow ().
12909 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
12911 2001-09-21 Marc Autret <autret_m@epita.fr>
12913 * src/options.c (option_table): Adjust.
12914 * src/lex.c (parse_percent_token): Fix.
12916 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
12918 * src/options.c (symtab.h): Include it, need by lex.h.
12920 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
12922 * src/lex.c (parse_percent_token): Change type of variable `tx', which
12923 is now an option_table_struct*.
12924 (option_strcmp): New function option_strcmp.
12925 (parse_percent_token): Call option_strcmp.
12926 * src/getargs.c (xalloc.h, options.h): Include it.
12927 (getargs): Call create_long_option_table.
12928 (getargs): Free longopts at the end of the function.
12929 (shortopts): Move in options.c.
12930 * src/options.c (create_long_option_table): New function. Convert
12931 information from option_table to option structure.
12932 * src/reader.c (options.h): Include it.
12934 * src/Makefile.am: Adjust.
12935 * src/options.c (option_table): Create from longopts and percent_table.
12936 * src/getargs.c (longopts): Delete.
12937 * src/lex.c (struct percent_table_struct): Delete.
12938 (percent_table): Delete.
12939 (options.h): Include it.
12940 * src/options.c: Create.
12941 * src/options.h: Create.
12942 Declare enum opt_access_e.
12943 Define struct option_table_struct.
12945 2001-09-20 Marc Autret <autret_m@epita.fr>
12947 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
12950 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
12952 * src/bison.simple: s/%%filename/%%skeleton.
12953 * src/muscle_tab.c (getargs.h): Include it.
12954 (muscle_init): Insert new muscle skeleton.
12956 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
12958 * src/output.c (output_parser): Delete unused variable actions_dumped.
12960 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
12962 * src/output.c (output): Delete call to reader_output_yylsp.
12963 * src/reader.c (reader): Likewise.
12964 * src/reader.h: Delete declaration of reader_output_yylsp.
12966 2001-09-02 Marc Autret <autret_m@epita.fr>
12968 * src/reader.c: Include muscle_tab.h.
12969 (parse_union_decl): Update.
12970 (parse_macro_decl): Rename parse_muscle_decl.
12971 Update to use renamed functions and variable.
12972 (read_declarations, copy_action, read_additionnal_code, : Updated
12973 with correct variables and functions names.
12974 (packsymbols, reader): Likewise.
12976 * src/reader.h (muscle_obstack): Extern declaration update.
12978 * src/output.c: Include muscle_tab.h
12979 In all functions using macro_insert, change by using muscle_insert ().
12980 (macro_obstack): Rename muscle_obstack.
12981 Echo modifications in the whole file.
12982 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
12983 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
12984 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
12986 * src/muscle_tab.h: Update double inclusion macros.
12987 (macro_entry_s): Rename muscle_entry_s.
12990 * src/muscle_tab.c: Include muscle_tab.h.
12991 Rename macro_tabble to muscle_table.
12992 (mhash1, mhash2, mcmp): Use muscle_entry.
12993 (macro_init): Rename muscle_init. Update.
12994 (macro_insert): Rename muscle_insert. Update.
12995 (macro_find): Rename muscle_find. Update.
12997 * src/main.c: Include muscle_tab.h.
12998 (main): Call muscle_init ().
12999 * src/Makefile.am (bison_SOURCES): Echo modifications.
13001 2001-09-02 Marc Autret <autret_m@epita.fr>
13003 Now the files macro_tab.[ch] are named muscle_tab.[ch].
13005 * src/muscle_tab.c, src/muscle_tab.h: Add files.
13007 2001-09-02 Marc Autret <autret_m@epita.fr>
13009 * src/macrotab.c, src/macrotab.h: Remove.
13011 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
13013 * src/reader.c (copy_guard): Use muscle to specify the `#line'
13016 2001-09-01 Marc Autret <autret_m@epita.fr>
13018 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
13019 to an explicit value to activate the feature. We do it here.
13021 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
13023 * src/output.c (prepare): Delete the `filename' muscule insertion.
13024 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
13025 (parse_union_decl): Likewise.
13026 * src/macrotab.c (macro_init): Initialize filename by infile.
13028 2001-08-31 Marc Autret <autret_m@epita.fr>
13030 * src/bison.simple (YYLSP_NEEDED): New definition.
13031 * src/output.c (prepare): Add macro insertion of `locations_flag'
13033 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
13035 * src/output.c (prepare): Delete insertion of previous muscles,
13036 and insert the `prefix' muscles.
13037 * src/macrotab.c (macro_init): Likewise.
13038 (macro_init): Initialization prefix directive by `yy'.
13039 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
13040 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
13041 yylval, yydebug, yyerror, yynerrs and yyparse.
13042 New directive `#define' to substitute yydebug, ... with option
13045 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
13047 * src/main.c (main): Standardize.
13048 * src/output.c (output_table_data, output_parser): Likewise.
13049 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
13051 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
13053 * src/reader.c (read_additionnal_code): Rename %%user_code to
13055 * src/output.c (output): Rename %%declarations to %%prologue.
13056 * src/bison.simple: Echo modifications.
13058 2001-08-31 Marc Autret <autret_m@epita.fr>
13060 * src/reader.c (readgram): CleanUp.
13061 (output_token_defines): Likewise.
13062 (packsymbols): Likewise.
13063 (reader): Likewise.
13064 * src/output.c (output): CPP-out useless code.
13066 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
13068 * src/reader.c (reader): Delete obsolete call to function
13069 output_trailers and output_headers.
13070 * src/output.h: Remove obsolete functions prototypes of output_headers
13071 and output_trailers.
13073 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
13075 * src/main.c: Include macrotab.h.
13076 * src/macrotab.h (macro_entry_s): Constify fields.
13077 Adjust functions prototypes.
13078 * src/macrotab.c (macro_insert): Constify key and value.
13079 (macro_find): Constify key.
13080 (macro_insert): Include 'xalloc.h'
13081 (macro_insert): Use XMALLOC.
13082 (macro_find): Constify return value.
13083 * src/output.c (output_table_data): Rename table to table_data.
13084 (output_parser): Constify macro_key, macro_value.
13086 2001-08-30 Marc Autret <autret_m@epita.fr>
13088 * src/reader.c (parse_skel_decl): New.
13089 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
13090 * src/lex.h (token_t): New token `tok_skel'.
13091 * src/lex.c (percent_table): Add skeleton option entry.
13094 2001-08-29 Marc Autret <autret_m@epita.fr>
13096 * src/bison.simple: Add %%user_code directive at the end.
13097 * src/reader.c (read_additionnal_code): New.
13099 * src/output.c (output_program): Remove.
13102 2001-08-28 Marc Autret <autret_m@epita.fr>
13104 * src/output.c (output_actions): Clean up.
13105 (output_gram): CPP-out useless code.
13106 * src/reader.c (reader): Clean up, CPP-out useless code.
13108 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
13110 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
13112 * src/bison.simple: Add `%%definitions'.
13114 2001-08-28 Marc Autret <autret_m@epita.fr>
13116 * config/depcomp: New file.
13118 2001-08-27 Paul Eggert <eggert@twinsun.com>
13120 * src/bison.simple (yyparse): Don't take the address of an
13121 item before the start of an array, as that doesn't conform to
13124 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
13126 * src/output.c (output): Remove the initialization of the macro
13127 obstack. It was done too late here.
13129 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
13131 (reader): Initialize the macro obstack here, since we need it to grow
13132 '%define' directives.
13134 * src/reader.h: Declare the macro obstack as extern.
13136 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
13138 * src/output.c (output_parser): Fix. Store single '%' characters in
13139 the output obstack instead of throwing them away.
13141 2001-08-27 Akim Demaille <akim@epita.fr>
13143 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
13145 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
13147 * lib/Makefile.am: Adjust.
13149 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
13151 * src/bison.simple: Update and add '%%' directives.
13153 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
13155 * src/reader.c (reader): Remove calls to 'output_headers' and
13156 'output_trailers'. Remove some C output.
13157 (readgram): Disable a piece of code that was writing a default
13158 definition for 'YYSTYPE'.
13159 (reader_output_yylsp): Remove.
13160 (packsymbols): Output token defintions to a macro.
13161 (copy_definition): Disable C output.
13163 * src/reader.c (parse_macro_decl): New function used to parse macro
13165 (copy_string2): Put the body of copy_string into this new function.
13166 Add a parameter to let the caller choose whether he wants to copy the
13167 string delimiters or not.
13168 (copy_string): Be a simple call to copy_string2 with the last argument
13170 (read_declarations): Add case for macro definition.
13171 (copy_identifier): New.
13172 (parse_macro_decl): Read macro identifiers using copy_identifier
13175 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
13177 * src/output.c (prepare): Add prefixed names.
13178 (output_parser): Output semantic actions.
13179 (output_parser): Fix bug on '%%line' directives.
13181 * src/output.c (output_headers): Remove. The C code printed by this
13182 function should now be in the skeletons.
13183 (output_trailers): Remove.
13184 (output): Disable call to 'reader_output_yylsp'.
13185 (output_rule_data): Do not output tables to the table obstack.
13187 * src/output.c: Remove some C dedicated output.
13188 Improve the use of macro and output obstacks.
13189 (output_defines): Remove.
13191 * src/output.c (output_token_translations): Associate 'translate'
13192 table with a macro. No output to the table obstack.
13193 (output_gram): Same for 'rhs' and 'prhs'.
13194 (output_stos): Same for 'stos'.
13195 (output_rule_data): Same for 'r1' and 'r2'.
13196 (token_actions): Same for 'defact'.
13197 (goto_actions): Same for 'defgoto'.
13198 (output_base): Same for 'pact' and 'pgoto'.
13199 (output_table): Same for 'table'.
13200 (output_check): Same for 'check'.
13202 * src/output.c (output_table_data): New function.
13203 (output_short_table): Remove.
13204 (output_short_or_char_table): Remove.
13206 * src/output.c (output_parser): Replace most of the skeleton copy code
13207 with something new. Skeletons are now processed character by character
13208 rather than line by line, and Bison looks for '%%' macros. This is the
13209 first step in making Bison's output process (a lot) more flexible.
13210 (output_parser): Use the macro table.
13212 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
13214 * src/main.c (main): Initialize the macro table.
13216 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
13218 * src/lex.c (percent_table): Add tok_define.
13219 * src/lex.h: Add tok_define.
13221 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
13223 * src/macrotab.c: New file.
13224 * src/macrotab.h: New file.
13225 * src/Makefile.am: Update.
13227 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
13229 * lib/hash.c: New file.
13230 * lib/hash.h: New file.
13231 * lib/Makefile.am: Update.
13233 2001-08-15 Akim Demaille <akim@epita.fr>
13237 2001-08-15 Marc Autret <autret_m@epita.fr>
13239 * src/reader.c (readgram): Indent output macro YYSTYPE.
13240 (packsymbols): Likewise.
13241 (output_token_defines): Likewise.
13242 * src/files.c: Standardize.
13243 (compute_header_macro): New.
13244 (defines_obstack_save): New. Use compute_header_macro.
13245 (output_files): Update. Use defines_obstack_save.
13247 2001-08-15 Akim Demaille <akim@epita.fr>
13249 * doc/bison.texinfo (Table of Symbols): Document
13250 YYSTACK_USE_ALLOCA.
13252 2001-08-15 Akim Demaille <akim@epita.fr>
13254 * missing: Update from CVS Automake.
13255 * config/config.guess, config/config.sub, config/texinfo.tex:
13256 Update from gnu.org.
13258 2001-08-15 Akim Demaille <akim@epita.fr>
13260 * Makefile.maint: Sync with CVS Autoconf.
13262 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
13264 * doc/bison.texinfo: Include GNU Free Documentation License from
13266 * doc/fdl.texi: Add to package.
13268 2001-08-14 Marc Autret <autret_m@epita.fr>
13270 Turn on %{source,header}_extension features.
13272 * src/lex.c (percent_table): Un-CPP out header_extension and
13274 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
13275 (compute_exts_from_src): Remove conditions. It restores priorities
13278 2001-08-14 Marc Autret <autret_m@epita.fr>
13280 * src/files.c (compute_base_names): Add extensions computing when
13281 `--file-prefix' used.
13282 Standardize function calls.
13284 2001-08-13 Marc Autret <autret_m@epita.fr>
13286 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
13287 defining it (defined but null disables alloca).
13289 2001-08-13 Marc Autret <autret_m@epita.fr>
13291 * src/bison.simple (_yy_memcpy): CPP reformat.
13293 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
13295 * tests/atconfig.in (CPPFLAGS): Fix.
13297 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
13299 * doc/bison.texinfo: Include GNU General Public License from
13301 * doc/gpl.texi: Add to package.
13303 2001-08-10 Marc Autret <autret_m@epita.fr>
13305 * src/print_graph.h: Fix.
13306 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
13308 2001-08-10 Akim Demaille <akim@epita.fr>
13310 * src/system.h: Provide default declarations for stpcpy, strndup,
13313 2001-08-10 Robert Anisko <anisko_r@epita.fr>
13315 * doc/bison.texinfo (Locations): Update @$ stuff.
13317 2001-08-09 Robert Anisko <anisko_r@epita.fr>
13319 * src/bison.simple (YYLLOC_DEFAULT): Update.
13322 2001-08-08 Marc Autret <autret_m@epita.fr>
13324 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
13325 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
13326 Reported by Fabrice Bauzac.
13328 2001-08-08 Marc Autret <autret_m@epita.fr>
13330 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
13331 * src/vcg.c (output_node): Fix.
13332 * src/vcg.h: Cleanup.
13333 * src/print_graph.c: Add comments.
13334 (node_output_size): New global variable. Simplify the formatting of
13335 the VCG graph output.
13336 (print_actions): Unused code is now used. It notifies the final state
13337 and no action states in the VCG graph. It also give the reduce actions.
13338 The `shift and goto' edges are red and the `go to state' edges are
13340 Get the current node name and node_obstack by argument.
13341 (node_obstack): New variable.
13342 (print_state): Manage node_obstack.
13343 (print_core): Use node_obstack given by argument.
13344 A node is not only computed here but in print_actions also.
13345 (print_graph): CPP out useless code instead of commenting it.
13347 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
13349 * tests/atconfig.in (CPPFLAGS): Fix.
13351 2001-08-07 Akim Demaille <akim@epita.fr>
13353 * src/print_graph.c (quote): New.
13354 (print_core): Use it.
13356 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
13358 * src/vcg.c (complain.h): Include it.
13359 Unepitaize `return' invocations.
13360 [NDEBUG] (main): Remove.
13361 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
13362 * src/files.c (open_files): Initialize graph_obstack.
13363 * src/print_graph.c (print_actions): CPP out useless code.
13364 (print_core): Don't output the last `\n' in labels.
13366 * src/files.c (output_files): Output the VCG file.
13367 * src/main.c (main): Invoke print_graph ();
13369 2001-08-06 Marc Autret <autret_m@epita.fr>
13371 Automaton VCG graph output.
13372 Using option ``-g'' or long option ``--graph'', you can generate
13373 a gram_filename.vcg file containing a VCG description of the LALR (1)
13374 automaton of your grammar.
13376 * src/main.c: Call to print_graph() function.
13377 * src/getargs.h: Update.
13378 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
13379 (graph_flag): New flag.
13380 (longopts): Update.
13381 (getargs): Add case `g'.
13382 * src/files.c (graph_obstack): New obstack struct.
13383 (open_files): Initialize new obstack.
13384 (output_files): Saves graph_obstack if required.
13385 * src/files.h (graph_obstack): New extern declaration.
13386 * src/Makefile.am: Add new source files.
13388 2001-08-06 Marc Autret <autret_m@epita.fr>
13390 * src/print_graph.c, src/print_graph.h (graph): New.
13391 * src/vcg.h: New file.
13392 * src/vcg.c: New file, VCG graph handling.
13394 2001-08-06 Marc Autret <autret_m@epita.fr>
13396 Add of %source_extension and %header_extension which specify
13397 the source or/and the header output file extension.
13399 * src/files.c (compute_base_names): Remove initialisation of
13400 src_extension and header_extension.
13401 (compute_exts_from_gf): Update.
13402 (compute_exts_from_src): Update.
13403 (output_files): Update.
13404 * src/reader.c (parse_header_extension_decl): New.
13405 (parse_source_extension_decl): New.
13406 (read_declarations): New case statements for the new tokens.
13407 * src/lex.c (percent_table): Add entries for %source_extension
13408 and %header_extension.
13409 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
13411 2001-08-06 Marc Autret <autret_m@epita.fr>
13413 * configure.in: Bump to 1.28c.
13414 * doc/bison.texinfo: Texinfo thingies.
13416 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
13418 * tests/atconfig.in (CPPFLAGS): Add.
13419 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
13421 2001-08-03 Akim Demaille <akim@epita.fr>
13425 2001-08-03 Akim Demaille <akim@epita.fr>
13427 * tests/Makefile.am (check-local): Ship testsuite.
13428 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
13429 Include `string.h'.
13431 2001-08-03 Akim Demaille <akim@epita.fr>
13433 * configure.in: Try using -Wformat when compiling.
13435 2001-08-03 Akim Demaille <akim@epita.fr>
13437 * configure.in: Bump to 1.28b.
13439 2001-08-03 Akim Demaille <akim@epita.fr>
13441 * src/complain.c: Adjust strerror_r portability issues.
13443 2001-08-03 Akim Demaille <akim@epita.fr>
13447 2001-08-03 Akim Demaille <akim@epita.fr>
13449 * src/getargs.c, src/getarg.h (skeleton)): Constify.
13450 * src/lex.c (literalchar): Avoid name clashes on `buf'.
13451 * src/getargs.c: Include complain.h.
13452 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
13453 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
13455 2001-08-03 Akim Demaille <akim@epita.fr>
13457 * src/reader.c (readgram): Display hidden chars in error messages.
13459 2001-08-03 Akim Demaille <akim@epita.fr>
13461 Update to gettext 0.10.39.
13463 2001-08-03 Akim Demaille <akim@epita.fr>
13465 * lib/strspn.c: New.
13467 2001-08-01 Marc Autret <autret_m@epita.fr>
13469 * doc/bison.texinfo: Update.
13470 * doc/bison.1 (mandoc): Update.
13471 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
13472 * src/files.c: Support output files extensions computing.
13473 (src_extension): New static variable.
13474 (header_extension): New static variable.
13475 (tr): New function.
13476 (get_extension_index): New function, gets the index of an extension
13477 filename in a string.
13478 (compute_exts_from_gf): New function, computes extensions from the
13479 grammar file extension.
13480 (compute_exts_from_src): New functions, computes extensions from the
13481 C source file extension, file given by ``-o'' option.
13482 (compute_base_names): Update.
13483 (output_files): Update.
13485 2001-08-01 Robert Anisko <anisko_r@epita.fr>
13487 * doc/bison.texi: Document @$.
13488 (Locations): New section.
13490 2001-07-18 Akim Demaille <akim@epita.fr>
13492 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
13493 * config/prev-version.txt, config/move-if-change: New.
13494 * Makefile.am: Adjust.
13496 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
13498 * src/bison.simple (yyparse): Suppress warning `comparaison
13499 between signed and unsigned'.
13501 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
13503 * src/getargs.h (raw_flag): Remove.
13504 * src/getargs.c: Die on `-r'/`--raw'.
13505 * src/lex.c (parse_percent_token): Die on `%raw'.
13506 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
13507 * tests/calc.at: Suppress test with option `--raw'.
13509 2001-07-14 Akim Demaille <akim@epita.fr>
13512 * configure.in: Require Autoconf 2.50.
13513 Update to gettext 0.10.38.
13515 2001-03-16 Akim Demaille <akim@epita.fr>
13517 * doc/bison.texinfo: ANSIfy the examples.
13519 2001-03-16 Akim Demaille <akim@epita.fr>
13521 * getargs.c (skeleton): New variable.
13522 (longopts): --skeleton is a new option.
13523 (shortopts, getargs): -S is a new option.
13524 * getargs.h: Declare skeleton.
13525 * output.c (output_parser): Use it.
13527 2001-03-16 Akim Demaille <akim@epita.fr>
13529 * m4/strerror_r.m4: New.
13530 * m4/error.m4: Run AC_FUNC_STRERROR_R.
13531 * lib/error.h, lib/error.c: Update.
13533 2001-03-16 Akim Demaille <akim@epita.fr>
13535 * src/getargs.c (longopts): Clean up.
13537 2001-02-21 Akim Demaille <akim@epita.fr>
13539 * src/reader.c (gensym): `gensym_count' is your own.
13540 Use a static buf to create the symbol name, as token_buffer is no
13543 2001-02-08 Akim Demaille <akim@epita.fr>
13545 * src/conflicts.c (conflict_report): Be sure not to append to res
13546 between two calls, which could happen if both first sprintf were
13547 skipped, but not the first cp += strlen.
13549 2001-02-08 Akim Demaille <akim@epita.fr>
13551 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
13552 New, from fileutils 4.0.37.
13553 * configure.in: Require Autoconf 2.49c. I took some time before
13554 making this decision. This is the only way out for portability
13555 issues in Bison, it would mean way too much duplicate effort to
13556 import in Bison features implemented in 2.49c since 2.13.
13557 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
13559 2001-02-02 Akim Demaille <akim@epita.fr>
13561 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
13562 * lib/xalloc.h, lib/xmalloc.c: Update.
13564 2001-01-19 Akim Demaille <akim@epita.fr>
13566 Get rid of the ad hoc handling of token_buffer in the scanner: use
13569 * src/lex.c (token_obstack): New.
13570 (init_lex): Initialize it. No longer call...
13571 (grow_token_buffer): this. Remove it.
13572 Adjust all the places which used it to use the obstack.
13574 2001-01-19 Akim Demaille <akim@epita.fr>
13576 * src/lex.h: Rename all the tokens:
13577 s/\bENDFILE\b/tok_eof/g;
13578 s/\bIDENTIFIER\b/tok_identifier/g;
13580 Let them be enums, not #define, to ease debugging.
13581 Adjust all the code.
13583 2001-01-18 Akim Demaille <akim@epita.fr>
13585 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
13586 * src/lex.c (maxtoken, grow_token_buffer): Static.
13588 2001-01-18 Akim Demaille <akim@epita.fr>
13590 Since we now use obstacks, more % directives can be enabled.
13592 * src/lex.c (percent_table): Also accept `%yacc',
13593 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
13595 Handle the actions for `%semantic_parser' and `%pure_parser' here,
13596 instead of returning a token.
13597 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
13598 * src/reader.c (read_declarations): Adjust.
13599 * src/files.c (open_files): Don't call `compute_base_names', don't
13600 compute `attrsfile' since they depend upon data which might be
13601 *in* the input file now.
13602 (output_files): Do it here.
13603 * src/output.c (output_headers): Document the fact that this patch
13604 introduces a guaranteed SEGV for semantic parsers.
13605 * doc/bison.texinfo: Document them.
13606 * tests/suite.at: Exercise these %options.
13608 2000-12-20 Akim Demaille <akim@epita.fr>
13610 Also handle the output file (--verbose) with obstacks.
13612 * files.c (foutput): Remove.
13613 (output_obstack): New.
13614 Adjust all dependencies.
13615 * src/conflicts.c: Return a string.
13616 * src/system.h (obstack_grow_string): Rename as...
13617 (obstack_sgrow): this. Be ready to work with non literals.
13618 (obstack_fgrow4): New.
13620 2000-12-20 Akim Demaille <akim@epita.fr>
13622 * src/files.c (open_files): Fix the computation of short_base_name
13623 in the case of `-o foo.tab.c'.
13625 2000-12-20 Akim Demaille <akim@epita.fr>
13627 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
13628 (copy_dollar): Now that everything uses obstacks, get rid of the
13631 2000-12-20 Akim Demaille <akim@epita.fr>
13633 * src/files.c (open_files): Actually the `.output' file is based
13634 on the short_base_name, not base_name.
13635 * tests/suite.at (Checking output file names): Adjust.
13637 2000-12-20 Akim Demaille <akim@epita.fr>
13639 * src/bison.s1: Remove, we now use directly...
13640 * src/bison.simple: this.
13641 * src/Makefile.am: Use pkgdata instead of data.
13643 2000-12-20 Akim Demaille <akim@epita.fr>
13645 * src/files.c (guard_obstack): New.
13646 (open_files): Initialize it.
13647 (output_files): Dump it...
13648 * src/files.h: Export it.
13649 * src/reader.c (copy_guard): Use it.
13651 2000-12-19 Akim Demaille <akim@epita.fr>
13653 * src/files.c (outfile, defsfile, actfile): Removed as global
13655 (open_files): Don't compute them.
13656 (output_files): Adjust.
13657 (base_name, short_base_name): Be global.
13658 Adjust dependencies.
13660 2000-12-19 Akim Demaille <akim@epita.fr>
13662 * src/files.c (strsuffix): New.
13663 (stringappend): Be just like strcat but allocate.
13664 (base_names): Eve out from open_files.
13665 Try to simplify the rather hairy computation of base_name and
13667 (open_files): Use it.
13668 * tests/suite.at (Checking output file names): New test.
13670 2000-12-19 Akim Demaille <akim@epita.fr>
13672 * src/system.h (obstack_grow_literal_string): Rename as...
13673 (obstack_grow_string): this.
13674 * src/output.c (output_parser): Recognize `%% actions' instead of
13676 * src/bison.s1: s/$/%% actions/.
13677 * src/bison.hairy: Likewise.
13679 2000-12-19 Akim Demaille <akim@epita.fr>
13681 * src/output.c (output_parser): Compute the `#line' lines when
13683 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
13684 Suggested by Hans Aberg.
13686 2000-12-19 Akim Demaille <akim@epita.fr>
13688 Let the handling of the skeleton files be local to the procedures
13691 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
13693 (fparser, open_extra_files): Remove.
13694 (open_files, output_files): Don't take care of fparser.
13695 * src/files.h: Adjust.
13696 * src/output.c (output_parser): Open and close the file to the
13698 * src/reader.c (read_declarations): When %semantic_parser, open
13701 2000-12-19 Akim Demaille <akim@epita.fr>
13703 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
13704 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
13706 2000-12-19 Akim Demaille <akim@epita.fr>
13708 * src/files.c (open_files): Yipee! We no longer need all the code
13709 looking for `/tmp' since we have no tmp file.
13711 2000-12-19 Akim Demaille <akim@epita.fr>
13713 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
13715 * src/files.c (open_files): Less dependency on MSDOS etc.
13717 2000-12-14 Akim Demaille <akim@epita.fr>
13719 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
13720 Provide a default definition.
13721 Use it when executing the default @ action.
13722 * src/reader.c (reader_output_yylsp): No longer include
13723 `timestamp' and `text' in the default YYLTYPE.
13725 2000-12-12 Akim Demaille <akim@epita.fr>
13727 * src/reader.c (copy_definition, parse_union_decl, copy_action)
13728 (copy_guard): Quote the file names.
13729 Reported by Laurent Mascherpa.
13731 2000-12-12 Akim Demaille <akim@epita.fr>
13733 * src/output.c (output_headers, output_program, output): Be sure
13734 to escape special characters when outputting filenames.
13735 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
13736 (output_headers): Don't depend on them, Use ACTSTR.
13738 2000-11-17 Akim Demaille <akim@epita.fr>
13740 * lib/obstack.h: Formatting changes.
13741 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
13742 prevents type checking.
13743 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
13744 cast the value to (void *): assigning a `foo *' to a `void *'
13746 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
13747 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
13750 2000-11-17 Akim Demaille <akim@epita.fr>
13752 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
13754 (suite.m4, regression.m4, calc.m4): these.
13755 * tests/atgeneral.m4: Update from CVS Autoconf.
13757 2000-11-17 Akim Demaille <akim@epita.fr>
13759 * tests/regression.m4 (%union and --defines): New test,
13760 demonstrating a current bug in the obstack implementation.
13762 2000-11-17 Akim Demaille <akim@epita.fr>
13764 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
13766 Use them to declare the variables which are global or local to
13769 2000-11-17 Akim Demaille <akim@epita.fr>
13771 * acconfig.h: Remove, no longer used.
13773 2000-11-07 Akim Demaille <akim@epita.fr>
13775 * src: s/Copyright (C)/Copyright/g.
13777 2000-11-07 Akim Demaille <akim@epita.fr>
13779 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
13781 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
13783 2000-11-07 Akim Demaille <akim@epita.fr>
13785 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
13786 Merge in a single CPP if/else.
13788 2000-11-07 Akim Demaille <akim@epita.fr>
13790 * src/output.c (output): Remove useless variables.
13791 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
13792 argument `data' for consistency with the prototypes.
13793 Qualify it `const'.
13794 (obstack_copy, obstack_copy0): Rename the second argument as
13795 `address' for consistency. Qualify it `const'.
13796 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
13797 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
13798 `const' their input argument (`data' or `address').
13799 Adjust the corresponding macros to include `const' in casts.
13801 2000-11-03 Akim Demaille <akim@epita.fr>
13803 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
13804 s/PFILE1/BISON_HAIRY/.
13805 Adjust dependencies.
13807 2000-11-03 Akim Demaille <akim@epita.fr>
13809 For some reason, this was not applied.
13811 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
13812 `unlink': it's no longer used.
13814 2000-11-03 Akim Demaille <akim@epita.fr>
13816 * src/files.c (skeleton_find): New function, eved out of...
13817 (open_files, open_extra_files): here.
13819 2000-11-03 Akim Demaille <akim@epita.fr>
13821 Don't use `atexit'.
13823 * src/files.c (obstack_save): New function.
13824 (done): Rename as...
13825 (output_files): this.
13826 Use `obstack_save'.
13827 * src/main.c (main): Don't use `atexit' to register `done', since
13828 it no longer has to remove tmp files, just call `output_files'
13829 when there are no errors.
13831 2000-11-02 Akim Demaille <akim@epita.fr>
13833 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
13834 `unlink': it's no longer used.
13835 * src/files.h: Formatting changes.
13837 2000-11-02 Akim Demaille <akim@epita.fr>
13839 Remove the last uses of mktemp and unlink/delete.
13841 * src/files.c (fdefines, ftable): Removed.
13842 (defines_ostack, table_obstack): New.
13843 Adjust dependencies of the former into uses of the latter.
13844 * src/output.c (output_short_or_char_table, output_short_table):
13845 Convert to using obstacks.
13846 * src/reader.c (copy_comment2): Accept one FILE * and two
13848 (output_token_defines, reader_output_yylsp): Use obstacks.
13849 * src/system.h (obstack_fgrow3): New.
13850 * po/POTFILES.in: Adjust.
13852 2000-11-01 Akim Demaille <akim@epita.fr>
13854 Change each use of `fattrs' into a use of `attrs_obstack'.
13856 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
13857 * src/files.c (fattrs): Remove.
13858 (attrs_obstack): New.
13859 Adjust all dependencies.
13860 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
13862 2000-11-01 Akim Demaille <akim@epita.fr>
13864 Introduce obstacks.
13865 Change each use of `faction' into a use of `action_obstack'.
13867 * lib/obstack.h, lib/obstack.c: New files.
13868 * src/files.c (faction): Remove.
13869 (action_obstack): New.
13870 Adjust all dependencies.
13872 2000-10-20 Akim Demaille <akim@epita.fr>
13874 * lib/quote.h (PARAMS): New macro. Use it.
13876 2000-10-16 Akim Demaille <akim@epita.fr>
13878 * src/output.c (output_short_or_char_table): New function.
13879 (output_short_table, output_token_translations): Use it.
13880 (goto_actions): Use output_short_table.
13882 2000-10-16 Akim Demaille <akim@epita.fr>
13884 * src/symtab.c (bucket_new): New function.
13887 * src/output.c (output_short_table): New argument to display the
13888 comment associated with the table.
13889 Adjust dependencies.
13890 (output_gram): Use it.
13891 (output_rule_data): Nicer output layout for YYTNAME.
13893 2000-10-16 Akim Demaille <akim@epita.fr>
13895 * src/lex.c (read_typename): New function.
13897 * src/reader.c (copy_dollar): Likewise.
13899 2000-10-16 Akim Demaille <akim@epita.fr>
13901 * src/reader.c (copy_comment2): Expect the input stream to be on
13902 the `/' which is suspected to open a comment, instead of being
13903 called after `//' or `/*' was read.
13904 (copy_comment, copy_definition, parse_union_decl, copy_action)
13905 (copy_guard): Adjust.
13907 2000-10-16 Akim Demaille <akim@epita.fr>
13909 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
13910 `read_signed_integer'.
13912 2000-10-16 Akim Demaille <akim@epita.fr>
13914 * src/reader.c (copy_dollar): New function.
13915 (copy_guard, copy_action): Use it.
13917 2000-10-16 Akim Demaille <akim@epita.fr>
13919 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
13920 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
13921 New files, from Fileutils 4.0.27.
13922 * src/main.c (printable_version): Remove.
13923 * src/lex.c, src/reader.c: Use `quote'.
13925 2000-10-04 Akim Demaille <akim@epita.fr>
13927 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
13929 2000-10-04 Akim Demaille <akim@epita.fr>
13931 * doc/bison.texinfo: Various typos spotted by Neil Booth.
13933 2000-10-04 Akim Demaille <akim@epita.fr>
13935 When a literal string is used to define two different tokens,
13936 `bison -v' segfaults.
13937 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
13939 * tests/regression.m4: New file.
13940 Include the core of the sample provided by Piotr Gackiewicz.
13941 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
13944 2000-10-04 Akim Demaille <akim@epita.fr>
13946 * src/reader.c (parse_expect_decl): Keep `count' within the size
13950 2000-10-02 Paul Eggert <eggert@twinsun.com>
13952 * bison.s1 (yyparse): Assign the default value
13953 unconditionally, to avoid a GCC warning and make the parser a
13956 2000-10-02 Akim Demaille <akim@epita.fr>
13958 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
13961 2000-10-02 Akim Demaille <akim@epita.fr>
13963 * src/derives.c, src/print.c, src/reduce.c: To ease the
13964 translation, move some `\n' out of the translated strings.
13966 2000-10-02 Akim Demaille <akim@epita.fr>
13968 The location tracking mechanism is precious for parse error
13969 messages. Nevertheless, it is enabled only when `@n' is used in
13970 the grammar, which is a different issue (you can use it in error
13971 message, but not in the grammar per se). Therefore, there should
13972 be another means to enable it.
13974 * src/getargs.c (getargs): Support `--locations'.
13975 (usage): Report it.
13976 * src/getargs.h (locationsflag): Export it.
13977 * src/lex.c (percent_table): Support `%locations'.
13978 * src/reader.c (yylsp_needed): Remove this variable, now replaced
13979 with `locationsflag'.
13980 * doc/bison.texinfo: Document `--locations' and `%locations'.
13982 * tests/calc.m4: Test it.
13984 For regularity of the names, replace each
13985 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
13986 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
13987 In addition replace each `flag' with `_flag'.
13989 2000-10-02 Akim Demaille <akim@epita.fr>
13991 Also test parse error messages, including with YYERROR_VERBOSE.
13993 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
13995 Use it to check the computations.
13996 Use it to check `nonassoc' is honored.
13997 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
13998 `--yyerror-verbose'.
13999 (_AT_CHECK_CALC): Adjust to this option.
14000 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
14002 2000-10-02 Akim Demaille <akim@epita.fr>
14004 Test also `--verbose', `--defines' and `--name-prefix'. Testing
14005 the latter demonstrates a flaw in the handling of non debugging
14006 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
14007 was used in order to simplify:
14023 unfortunately this leads to a CPP conflict when
14024 `--name-prefix=foo' is used since it produces `#define yydebug
14027 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
14028 (YYDPRINTF): New macro.
14030 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
14032 Also test `--verbose', `--defines' and `--name-prefix'.
14034 2000-10-02 Akim Demaille <akim@epita.fr>
14036 Improve the readability of the produced parsers.
14038 * src/bison.s1: Formatting changes.
14039 Improve the comment related to the `$' mark.
14040 (yydefault): Don't fall through to `yyresume': `goto' there.
14041 * src/output.c (output_parser): When the `$' is met, skip the end
14043 New variable, `number_of_dollar_signs', to check there's exactly
14044 one `$' in the parser skeleton.
14046 2000-10-02 Akim Demaille <akim@epita.fr>
14048 * lib/xstrdup.c: New file, from the fileutils.
14049 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
14050 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
14051 instead of strlen + xmalloc + strcpy.
14052 * src/symtab.c (copys): Remove, use xstrdup instead.
14054 2000-10-02 Akim Demaille <akim@epita.fr>
14056 * src/gram.h (associativity): New enum type which replaces the
14057 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
14058 `right_assoc', `left_assoc' and `non_assoc'.
14059 Adjust all dependencies.
14060 * src/reader.c: Formatting changes.
14061 (LTYPESTR): Don't define it, use it as a literal in
14062 `reader_output_yylsp'.
14063 * src/symtab.h (symbol_class): New enum type which replaces the
14064 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
14065 `sunknown', `stoken and `snterm'.
14067 2000-10-02 Akim Demaille <akim@epita.fr>
14069 * src/getargs.c (fixed_outfiles): Rename as...
14070 (yaccflag): for consistency and accuracy.
14071 Adjust dependencies.
14073 2000-10-02 Akim Demaille <akim@epita.fr>
14075 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
14076 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
14077 difficult and introduced a lot of core dump. It turns out that
14078 Bison used an implementation of `xmalloc' based on `calloc', and
14079 at various places it does depend upon the initialization to 0. I
14080 have not tried to isolate the pertinent places, and all the former
14081 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
14082 someone should address this issue.
14084 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
14085 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
14087 Adjust dependencies.
14088 * src/warshall.h: New file.
14091 2000-10-02 Akim Demaille <akim@epita.fr>
14093 Various anti-`extern in *.c' changes.
14095 * src/system.h: Include `assert.h'.
14097 2000-10-02 Akim Demaille <akim@epita.fr>
14099 * src/state.h (nstates, final_state, first_state, first_shift)
14100 (first_reduction): Move their exportation from here...
14101 * src/LR0.h: to here.
14102 Adjust dependencies.
14103 * src/getargs.c (statisticsflag): New variable.
14104 Add support for `--statistics'.
14105 Adjust dependencies.
14107 Remove a lot of now useless `extern' statements in most files.
14109 2000-10-02 Akim Demaille <akim@epita.fr>
14111 * src/LR0.h: New file.
14114 2000-10-02 Akim Demaille <akim@epita.fr>
14116 * src/print.h: New file.
14118 * src/print.c: Formatting and ordering changes.
14119 (verbose, terse): Replace with...
14120 (print_results): this new function.
14121 Adjust dependencies.
14123 2000-10-02 Akim Demaille <akim@epita.fr>
14125 * src/conflicts.c (conflict_report): New function.
14126 (conflict_log, verbose_conflict_log): Replace with...
14127 (print_conflicts): this function.
14128 Adjust dependencies.
14129 * src/conflicts.h: New file.
14130 Propagate its inclusion.
14132 2000-10-02 Akim Demaille <akim@epita.fr>
14134 * src/nullable.h: New file.
14135 Propagate its inclusion.
14136 * src/nullable.c: Formatting changes.
14138 2000-10-02 Akim Demaille <akim@epita.fr>
14140 * src/reduce.h: New file.
14141 Propagate its inclusion.
14142 * src/reduce.c: Topological sort and other formatting changes.
14143 (bool, TRUE, FALSE): Move their definition to...
14144 * src/system.h: here.
14146 2000-10-02 Akim Demaille <akim@epita.fr>
14148 * src/files.c: Formatting changes.
14149 (tryopen, tryclose, openfiles): Rename as...
14150 (xfopen, xfclose, open_files): this.
14151 (stringappend): static.
14152 * src/files.h: Complete the list of exported symbols.
14155 2000-10-02 Akim Demaille <akim@epita.fr>
14157 * src/reader.h: New file.
14158 Propagate its use instead of tedious list of `extern' and
14160 * src/reader.c: Formatting changes, topological sort,
14163 2000-10-02 Akim Demaille <akim@epita.fr>
14165 * src/lex.h: Prototype `lex.c' exported functions.
14166 * src/reader.c: Adjust.
14167 * src/lex.c: Formatting changes.
14168 (safegetc): Rename as...
14171 2000-10-02 Akim Demaille <akim@epita.fr>
14173 * src/lalr.h: New file.
14174 Propagate its inclusion instead of prototypes and `extern'.
14175 * src/lalr.c: Formatting changes, topological sorting etc.
14177 2000-10-02 Akim Demaille <akim@epita.fr>
14179 * src/output.c (token_actions): Introduce a temporary array,
14180 YYDEFACT, that makes it possible for this function to use
14181 output_short_table.
14183 2000-10-02 Akim Demaille <akim@epita.fr>
14185 `user_toknums' is output as a `short[]' in `output.c', while it is
14186 defined as a `int[]' in `reader.c'. For consistency with the
14187 other output tables, `user_toknums' is now defined as a table of
14190 * src/reader.c (user_toknums): Be a short table instead of an int
14192 Adjust dependencies.
14194 Factor the short table outputs.
14196 * src/output.c (output_short_table): New function.
14197 * src/output.c (output_gram, output_stos, output_rule_data)
14198 (output_base, output_table, output_check): Use it.
14200 2000-10-02 Akim Demaille <akim@epita.fr>
14202 * src/output.c (output): Topological sort of the functions, in
14203 order to get rid of the `static' prototypes.
14204 No longer use `register'.
14205 * src/output.h: New file.
14206 Propagate its inclusion in files explicitly prototyping functions
14209 2000-09-21 Akim Demaille <akim@epita.fr>
14211 * src/atgeneral.m4: Update from Autoconf.
14213 2000-09-21 Akim Demaille <akim@epita.fr>
14215 * src/closure.h: New file.
14216 * src/closure.c: Formatting changes, topological sort over the
14217 functions, use of closure.h.
14218 (initialize_closure, finalize_closure): Rename as...
14219 (new_closure, free_closure): these. Adjust dependencies.
14220 * src/LR0.c: Formatting changes, topological sort, use of
14222 (initialize_states): Rename as...
14223 (new_states): this.
14224 * src/Makefile.am (noinst_HEADERS): Adjust.
14226 2000-09-20 Akim Demaille <akim@epita.fr>
14228 * src/acconfig.h: Don't protect config.h against multiple
14230 Don't define PARAMS.
14231 * src/system.h: Define PARAMS.
14232 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
14233 purpose of config.h. system.h must not try to fix wrong
14234 definitions in config.h.
14236 2000-09-20 Akim Demaille <akim@epita.fr>
14238 * src/derives.h: New file.
14239 * src/main.c, src/derives.h: Use it.
14240 Formatting changes.
14241 * src/Makefile.am (noinst_HEADERS): Adjust.
14243 2000-09-20 Akim Demaille <akim@epita.fr>
14245 * tests/atgeneral.m4: Update from Autoconf.
14246 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
14247 (AT_CHECK_CALC): New macros.
14248 Use these macros to test bison with options `', `--raw',
14249 `--debug', `--yacc', `--yacc --debug'.
14251 2000-09-19 Akim Demaille <akim@epita.fr>
14253 * src/output.c: Formatting changes.
14254 * src/machine.h: Remove, leaving its contents in...
14255 * src/system.h: here.
14257 Adjust all dependencies on stdio.h and machine.h.
14258 * src/getargs.h: New file.
14259 Let all `extern' declarations about getargs.c be replaced with
14260 inclusion of `getargs.h'.
14261 * src/Makefile.am (noinst_HEADERS): Adjust.
14263 * tests/calc.m4 (yyin): Be initialized in main, not on the global
14265 (yyerror): Returns void, not int.
14266 * doc/bison.texinfo: Formatting changes.
14268 2000-09-19 Akim Demaille <akim@epita.fr>
14270 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
14273 2000-09-18 Akim Demaille <akim@epita.fr>
14275 * configure.in: Append WARNING_CFLAGS to CFLAGS.
14276 * src/Makefile.am (INCLUDES): Don't.
14277 Be ready to fetch headers in lib/.
14279 2000-09-18 Akim Demaille <akim@epita.fr>
14281 * doc/bison.texinfo: Update the copyright.
14282 ANSIfy and GNUify the examples.
14283 Remove the old menu.
14285 2000-09-18 Akim Demaille <akim@epita.fr>
14287 First set of tests: use the `calc' example from the documentation.
14289 * src/bison.s1 (yyparse): Condition the code using `yytname' which
14290 is defined only when YYDEBUG is.
14291 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
14292 * src/files.c (tryopen, tryclose): Formatting changes.
14293 Move to the top and be static.
14294 * src/reader.c (read_signed_integer): Likewise.
14295 * tests/calc.m4: New file.
14296 * Makefile.am, suite.m4: Adjust.
14297 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
14299 2000-09-18 Akim Demaille <akim@epita.fr>
14301 Add support for an Autotest test suite for Bison.
14303 * m4/m4.m4, m4/atconfig.m4: New files.
14304 * m4/Makefile.am (EXTRA_DIST): Adjust.
14305 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
14307 * src/getargs.c: Display a more standard --version message.
14308 * src/reader.c (reader): Formatting changes.
14309 No longer depend upon VERSION_STRING.
14310 * configure.in: No longer use `dnl'.
14311 Set up the test suite and the new directory `tests/.
14312 (VERSION_STRING): Remove.
14314 2000-04-14 Akim Demaille <akim@epita.fr>
14316 * src/reader.c (copy_comment2): New function, same as former
14317 `copy_comment', but outputs into two FILE *.
14318 (copy_comment): Use it.
14319 (parse_union_decl): Use it.
14320 (get_type, parse_start_decl): Use the same `invalid' message.
14321 (parse_start_decl, parse_union_decl): Use the same `multiple'
14323 (parse_union_decl, copy_guard, copy_action): Use the same
14324 `unmatched' message.
14325 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
14327 2000-03-31 Akim Demaille <akim@epita.fr>
14329 * src/files.c (tryopen, tryclose): Move to the top.
14332 2000-03-31 Akim Demaille <akim@epita.fr>
14334 * src/main.c (main): Don't call `done', exit does it.
14336 2000-03-31 Akim Demaille <akim@epita.fr>
14338 * allocate.c: s/return (foo)/return foo/.
14339 * lalr.c: Likewise.
14341 * output.c: Likewise.
14342 * reader.c: Likewise.
14343 * symtab.c: Likewise.
14344 * vmsgetargs.c: Likewise.
14346 2000-03-31 Akim Demaille <akim@epita.fr>
14348 Clean up the error reporting functions.
14350 * src/report.c: New file.
14351 * src/report.h: Likewise.
14352 * src/Makefile.am: Adjust.
14353 * m4/error.m4: New file.
14354 * m4/Makefile.am: Adjust.
14355 * configure.in (jm_PREREQ_ERROR): Call it.
14356 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
14358 (fatal, fatals): Remove. All callers use complain.c::fatal.
14359 (warn, warni, warns, warnss, warnss): Remove. All callers use
14360 complain.c::complain.
14361 (toomany): Remove, use fatal instead.
14362 * src/files.c (done): No argument, use complain_message_count.
14363 * src/main.c (main): Register `done' to `atexit'.
14365 * src/getargs.c (usage): More `fputs', less `fprintf'.
14367 2000-03-28 Akim Demaille <akim@epita.fr>
14369 * lib/: New directory.
14370 * Makefile.am (SUBDIRS): Adjust.
14371 * configure.in: Adjust.
14372 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
14374 * src/alloca.c: Moved to lib/.
14375 * src/getopt.c: Likewise.
14376 * src/getopt1.c: Likewise.
14377 * src/getopt.h: Likewise.
14378 * src/ansi2knr.c: Likewise.
14379 * src/ansi2knr.1: Likewise.
14380 * src/Makefile.am: Adjust.
14381 * lib/Makefile.am: New file.
14383 2000-03-28 Akim Demaille <akim@epita.fr>
14385 * src/getargs.c (usage): Refresh the help message.
14387 2000-03-17 Akim Demaille <akim@epita.fr>
14389 * src/getopt1.c: Updated from textutils 2.0e
14390 * src/getopt.c: Likewise.
14391 * src/getopt.h: Likewise.
14393 2000-03-17 Akim Demaille <akim@epita.fr>
14395 * src/Makefile.am (bison.simple): Fix the awk program: quote only
14396 the file name, not the whole `#line LINE FILE'.
14398 2000-03-17 Akim Demaille <akim@epita.fr>
14400 On syntax errors, report the token on which we choked.
14402 * src/bison.s1 (yyparse): In the label yyerrlab, when
14403 YYERROR_VERBOSE, add yychar in msg.
14405 2000-03-17 Akim Demaille <akim@epita.fr>
14407 * src/reader.c (copy_at): New function.
14408 (copy_guard): Use it.
14409 (copy_action): Use it.
14411 2000-03-17 Akim Demaille <akim@epita.fr>
14413 Be kind to translators, save some useless translations.
14415 * src/main.c (banner): New function.
14416 (fatal_banner): Use it.
14417 (warn_banner): Use it.
14419 2000-03-17 Akim Demaille <akim@epita.fr>
14421 * src/reader.c (copy_definition): Use copy_string and
14422 copy_comment. Removed now unused `match', `ended',
14424 (copy_comment, copy_string): Moved, to be visible from
14427 2000-03-17 Akim Demaille <akim@epita.fr>
14429 * src/reader.c (copy_string): Declare `static inline'. No
14430 problems with inline, since it is checked by configure.
14431 (copy_comment): Likewise.
14433 2000-03-17 Akim Demaille <akim@epita.fr>
14435 * src/reader.c (packsymbols): Formatting changes.
14437 2000-03-17 Akim Demaille <akim@epita.fr>
14439 * src/reader.c (copy_comment): New function, factored out from:
14440 (copy_action): Use it. Removed now unused `match', `ended',
14442 (copy_guard): Likewise.
14444 2000-03-17 Akim Demaille <akim@epita.fr>
14446 * src/reader.c (copy_string): New function, factored out from:
14447 (copy_action): Use it.
14448 (copy_guard): Likewise.
14450 2000-03-17 Akim Demaille <akim@epita.fr>
14452 Change the handling of @s so that they behave exactly like $s.
14453 There is now a pseudo variable @$ (readble and writable), location
14454 of the lhs of the rule (by default ranging from the location of
14455 the first symbol of the rhs, to the location of the last symbol,
14456 or, if the rhs is empty, YYLLOC).
14458 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
14460 (yyparse): When providing a default semantic action, provide a
14461 default location action.
14462 (after the $): No longer change `*YYLSP', just stack YYLOC the
14463 same way you stack YYVAL.
14464 * src/reader.c (read_declarations): Use warns.
14465 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
14466 (copy_action, case '@'): Likewise.
14467 Use a standard error message, to save useless work from
14470 2000-03-17 Akim Demaille <akim@epita.fr>
14472 * src/bison.s1: Formatting and cosmetics changes.
14473 * src/reader.c: Likewise.
14474 Update the Copyright notice.
14476 2000-03-17 Akim Demaille <akim@epita.fr>
14478 * src/bison.s1 (#line): All set to `#line' only, since the
14479 Makefile now handles them.
14481 2000-03-16 Akim Demaille <akim@epita.fr>
14483 * src/output.c (output_rule_data): Output the documentation of
14484 some of the tables.
14485 (Copyright notice): Update.
14486 Formatting changes.
14488 2000-03-16 Akim Demaille <akim@epita.fr>
14490 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
14491 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
14492 One `#if YYDEBUG' remains, since it uses variables which are
14493 defined only if `YYDEBUG != 0'.
14495 2000-03-16 Akim Demaille <akim@epita.fr>
14497 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
14498 and related variables so that the similarities are highlighted.
14500 2000-03-16 Akim Demaille <akim@epita.fr>
14502 * src/bison.s1: Properly indent CPP directives.
14504 2000-03-16 Akim Demaille <akim@epita.fr>
14506 * src/bison.s1: Properly indent the `alloca' CPP section.
14508 2000-03-16 Akim Demaille <akim@epita.fr>
14510 Do not hard code values of directories in `configure.in'.
14511 Update the `configure' tool chain.
14513 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
14515 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
14516 (AC_OUTPUT): Add m4/Makefile.
14517 Bump to bison 1.28a, 1.29 has never been released.
14518 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
14519 handled via src/Makefile.am.
14520 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
14521 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
14523 * Makefile.am (SUBDIRS): Add m4.
14524 (ACLOCAL_AM_FLAGS): New variable.
14525 (AUTOMAKE_OPTIONS): Add check-news.
14526 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
14527 the proper line number and file name.
14528 (DEFS): Propagate the location of bison library files and of the
14530 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
14532 * acinclude.m4: Remove, replaced by the directory m4.
14533 * m4/Makefile.am (EXTRA_DIST): New variable.
14534 * m4/gettext.m4: New file, from the fileutils.
14535 * m4/lcmessage.m4: Likewise
14536 * m4/progtest.m4: Likewise.
14537 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
14539 2000-03-10 Akim Demaille <akim@epita.fr>
14542 Formatting changes of various comments.
14543 Respect the GNU coding standards at various places.
14544 Don't use `_()' when no translation is needed.
14546 1999-12-13 Jesse Thilo <jthilo@gnu.org>
14549 OS/2 honors TMPDIR environment variable.
14551 1999-12-13 Jesse Thilo <jthilo@gnu.org>
14553 * doc/bison.texinfo: Tweaked spelling and grammar.
14555 Removed reference to price of printed copy.
14556 Mention BISON_SIMPLE and BISON_HAIRY.
14558 1999-12-13 Jesse Thilo <jthilo@gnu.org>
14560 * configure.in, NEWS:
14561 Bison 1.29 released.
14563 1999-10-27 Jesse Thilo <jthilo@gnu.org>
14565 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
14566 Added reference card.
14568 1999-07-26 Jesse Thilo <jthilo@gnu.org>
14570 * po/ru.po: Added Russian translation.
14572 1999-07-26 Jesse Thilo <jthilo@gnu.org>
14574 * configure.in: Added Russian translation.
14576 1999-07-06 Jesse Thilo <jthilo@gnu.org>
14578 * configure.in, NEWS, README:
14579 Released version 1.28.
14581 1999-06-14 Jesse Thilo <jthilo@gnu.org>
14584 Squashed redefinition warning on some systems.
14586 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
14587 Have configure build version string instead of relying on ANSI string
14590 1999-06-14 Jesse Thilo <jthilo@gnu.org>
14592 * po/POTFILES.in: Got rid of version.c.
14594 1999-06-14 Jesse Thilo <jthilo@gnu.org>
14596 * acconfig.h, configure.in:
14597 Have configure build version string instead of relying on ANSI string
14600 1999-06-08 Jesse Thilo <jthilo@gnu.org>
14603 Dropped mention of `+' for long-named options.
14605 1999-05-30 Jesse Thilo <jthilo@gnu.org>
14607 * src/files.c: Added <unistd.h> for unlink().
14609 * src/Makefile.am, src/system.h:
14612 1999-05-30 Jesse Thilo <jthilo@gnu.org>
14614 * README: Added a FAQ list.
14616 * configure.in, acconfig.h:
14619 1999-05-30 Jesse Thilo <jthilo@gnu.org>
14621 * doc/FAQ, doc/Makefile.am:
14624 1999-05-19 Jesse Thilo <jthilo@gnu.org>
14626 * src/alloc.h, src/symtab.h, src/version.c:
14627 Protected inclusion of "config.h" with HAVE_CONFIG_H.
14629 1999-04-18 Jesse Thilo <jthilo@gnu.org>
14631 * src/.cvsignore, src/Makefile.am:
14632 Reorganized: sources in `src', documentation in `doc'.
14634 * src/lex.c (literalchar):
14635 fixed the code for escaping double quotes (thanks
14638 1999-04-18 Jesse Thilo <jthilo@gnu.org>
14640 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
14641 Adjusted paths to reflect directory reorganization.
14643 1999-04-18 Jesse Thilo <jthilo@gnu.org>
14645 * doc/.cvsignore, doc/Makefile.am:
14646 Reorganized: sources in `src', documentation in `doc'.
14648 1999-04-18 Jesse Thilo <jthilo@gnu.org>
14651 Updated AC_INIT file to reflect directory reorganization.
14653 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
14654 Reorganized: sources in `src', documentation in `doc'.
14656 1999-04-13 Jesse Thilo <jthilo@gnu.org>
14659 Don't declare calloc() and realloc() if not necessary.
14661 1999-04-13 Jesse Thilo <jthilo@gnu.org>
14663 * configure.in, acconfig.h, acinclude.m4:
14664 Don't declare calloc() and realloc() if not necessary.
14666 1999-03-23 Jesse Thilo <jthilo@gnu.org>
14668 * po/.cvsignore: Added i18n support.
14670 1999-03-23 Jesse Thilo <jthilo@gnu.org>
14672 * acconfig.h, configure.in, Makefile.am:
14673 Added i18n support.
14675 1999-03-22 Jesse Thilo <jthilo@gnu.org>
14677 * src/bison.s1: Fixed #line numbers.
14679 1999-03-15 Jesse Thilo <jthilo@gnu.org>
14681 * po/es.po, po/fr.po, po/nl.po, po/de.po:
14682 Added PO files from Translation Project.
14684 1999-03-03 Jesse Thilo <jthilo@gnu.org>
14687 Added support for non-ANSI compilers (ansi2knr).
14689 1999-02-16 Jesse Thilo <jthilo@gnu.org>
14691 * configure.in: Bumped version number to 1.27.
14694 Added `bison.simple' to list of files removed by `make distclean'.
14696 1999-02-12 Jesse Thilo <jthilo@gnu.org>
14698 * src/files.c, src/files.h:
14699 Defined locations of parser files in config.h instead of Makefile.
14701 1999-02-12 Jesse Thilo <jthilo@gnu.org>
14703 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
14704 Defined locations of parser files in config.h instead of Makefile.
14706 1999-02-09 Jesse Thilo <jthilo@gnu.org>
14709 Removed inappropriate use of $< macro.
14711 1999-02-05 Jesse Thilo <jthilo@gnu.org>
14713 * po/Makefile.in.in, po/POTFILES.in:
14714 Add `po' directory skeleton.
14716 1999-01-27 Jesse Thilo <jthilo@gnu.org>
14718 * README: Document help-bison list.
14720 * configure.in: Add check for mkstemp().
14722 1999-01-20 Jesse Thilo <jthilo@gnu.org>
14724 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
14725 Hush a few compiler warnings.
14728 Add tryclose(), which verifies that fclose was successful.
14729 Hush a couple of compiler warnings.
14731 1999-01-20 Jesse Thilo <jthilo@gnu.org>
14733 * Makefile.am, OChangeLog:
14734 ChangeLog is now automatically generated. Include the old version as
14737 1999-01-14 Jesse Thilo <jthilo@gnu.org>
14739 * 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:
14740 Update FSF address.
14742 1999-01-14 Jesse Thilo <jthilo@gnu.org>
14744 * doc/bison.texinfo: Fix formatting glitch.
14746 * doc/bison.texinfo: Update FSF address.
14748 1999-01-14 Jesse Thilo <jthilo@gnu.org>
14750 * acconfig.h: Update FSF address.
14752 1999-01-08 Jesse Thilo <jthilo@gnu.org>
14755 Don't define PACKAGE here, since config.h defines it.
14757 1998-12-30 Jesse Thilo <jthilo@gnu.org>
14759 * src/reader.c: Update copyright date.
14762 Ditch sprintf to statically-sized buffers in fatal/warn functions in
14763 favor of output directly to stderr (avoids buffer overruns).
14765 * src/reader.c: Some checks for premature EOF.
14767 * 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:
14768 Use prototypes if the compiler understands them.
14770 * src/files.c: Honor TMPDIR on Unix hosts.
14771 Use prototypes if the compiler understands them.
14774 Fix a couple of buffer overrun bugs.
14775 Use prototypes if the compiler understands them.
14777 * src/system.h: Include unistd.h and ctype.h.
14778 Use #ifdef instead of #if for NLS symbols.
14780 1998-12-30 Jesse Thilo <jthilo@gnu.org>
14782 * doc/bison.texinfo:
14783 Delete comment "consider using @set for edition number, etc..." since
14784 we now are doing so.
14786 1998-12-30 Jesse Thilo <jthilo@gnu.org>
14789 Use prototypes if the compiler understands them.
14791 * NEWS: Document 1.26 highlights.
14793 * Makefile.am: Require Automake 1.3 or later.
14796 Use prototypes if the compiler understands them.
14798 1998-12-29 Jesse Thilo <jthilo@gnu.org>
14801 Use VERSION symbol from automake for version number.
14803 1998-12-29 Jesse Thilo <jthilo@gnu.org>
14805 * acconfig.h, configure.in, version.cin:
14806 Use VERSION symbol from automake for version number.
14808 1998-11-28 Jesse Thilo <jthilo@gnu.org>
14811 Distribute original version of simple parser (bison.s1), not built
14812 version (bison.simple).
14814 1998-11-28 Jesse Thilo <jthilo@gnu.org>
14816 * doc/bison.texinfo: Add info dir entry.
14818 * doc/bison.texinfo:
14819 Let automake put version number into documentation.
14821 1998-11-26 Jesse Thilo <jthilo@gnu.org>
14823 * src/bison.cld, src/build.com, src/vmshlp.mar:
14824 Add non-RCS files from /gd/gnu/bison.
14826 1998-11-26 Jesse Thilo <jthilo@gnu.org>
14829 Document the BISON_HAIRY and BISON_SIMPLE variables.
14831 1998-11-25 Jesse Thilo <jthilo@gnu.org>
14833 * src/version.c: Build version.c automatically.
14836 Fix token numbering (used to start at 258, not 257).
14838 * src/system.h: Include config.h.
14840 * src/getargs.c: Update bug report address.
14842 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
14843 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
14845 1998-11-25 Jesse Thilo <jthilo@gnu.org>
14848 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
14850 * configure.in, version.cin:
14851 Build version.c automatically.
14853 * AUTHORS: Add AUTHORS file.
14855 * README: Update bug report address.
14858 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
14860 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
14861 Add automake stuff.
14863 1998-11-25 Jesse Thilo <jthilo@gnu.org>
14865 * doc/bison.texinfo: Clean up some formatting.
14867 1998-05-05 Richard Stallman <rms@gnu.org>
14869 * doc/bison.texinfo:
14870 Explain better why to make a pure parser.
14872 1998-01-05 Richard Stallman <rms@gnu.org>
14874 * src/files.c (openfiles):
14875 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
14876 find a temporary directory, if possible. Do not unlink files while
14879 1997-08-25 Richard Stallman <rms@gnu.org>
14881 * src/reader.c (stack_offset;):
14882 Change some warni to warns.
14884 * src/lex.c (literalchar): Use warns, not warni.
14886 1997-06-28 Richard Stallman <rms@gnu.org>
14888 * src/bison.s1: Add a Bison version comment.
14890 * src/main.c (fatal, warn, berror):
14893 1997-06-28 Richard Stallman <rms@gnu.org>
14895 * Makefile.in (bison_version): New variable.
14896 (dist): Use that variable.
14897 (bison.s1): Substitute the Bison version into bison.simple.
14899 * bison.simple: Add a Bison version comment.
14901 1997-06-18 Richard Stallman <rms@gnu.org>
14903 * src/main.c (fatal, warn, berror):
14904 Make error messages standard.
14905 (toomany): Improve error message text.
14907 * 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:
14908 new.h renamed to alloc.h.
14910 1997-06-18 Richard Stallman <rms@gnu.org>
14912 * Makefile.in: new.h renamed to alloc.h.
14914 1997-05-24 Richard Stallman <rms@gnu.org>
14916 * src/lex.c (literalchar):
14917 Fix the code for escaping \, " and '.
14919 (lex): Avoid trouble when there are many chars
14920 to discard in a char literal with just several chars in it.
14922 1997-05-17 Richard Stallman <rms@gnu.org>
14925 Use malloc, if using alloca is troublesome.
14926 (YYSTACK_USE_ALLOCA): New flag macro.
14927 Define it for some systems and compilers.
14928 (YYSTACK_ALLOC): New macro.
14929 (yyparse): Use YYSTACK_ALLOC to allocate stack.
14930 If it was malloc'd, free it.
14932 1997-05-17 Richard Stallman <rms@gnu.org>
14935 Use malloc, if using alloca is troublesome.
14936 (YYSTACK_USE_ALLOCA): New flag macro.
14937 Define it for some systems and compilers.
14938 (YYSTACK_ALLOC): New macro.
14939 (yyparse): Use YYSTACK_ALLOC to allocate stack.
14940 If it was malloc'd, free it.
14942 1997-04-23 Richard Stallman <rms@gnu.org>
14945 (alloca) [__hpux]: Always define as __builtin_alloca.
14947 1997-04-23 Richard Stallman <rms@gnu.org>
14950 (alloca) [__hpux]: Always define as __builtin_alloca.
14952 1997-04-22 Richard Stallman <rms@gnu.org>
14955 [__hpux]: Include alloca.h (right for HPUX 10)
14956 instead of declaring alloca (right for HPUX 9).
14958 * src/bison.s1 (__yy_memcpy):
14959 Declare arg `count' as unsigned int.
14960 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
14962 1997-04-22 Richard Stallman <rms@gnu.org>
14965 [__hpux]: Include alloca.h (right for HPUX 10)
14966 instead of declaring alloca (right for HPUX 9).
14968 * bison.simple (__yy_memcpy):
14969 Declare arg `count' as unsigned int.
14970 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
14972 1997-01-03 Richard Stallman <rms@gnu.org>
14974 * src/allocate.c: [__STDC__ or _MSC_VER]:
14975 Declare calloc and realloc to return void *.
14977 1997-01-02 Richard Stallman <rms@gnu.org>
14980 [_MSC_VER]: Include stdlib.h and process.h.
14981 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
14983 * src/main.c (main): Return FAILURE as a value.
14984 (printable_version): Declare arg as int, not char.
14986 1997-01-02 Richard Stallman <rms@gnu.org>
14988 * Makefile.in (dist):
14989 Explicitly check for symlinks, and copy them.
14991 1996-12-19 Richard Stallman <rms@gnu.org>
14994 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
14996 1996-12-18 Paul Eggert <eggert@gnu.org>
14998 * src/bison.s1 (yyparse):
14999 If __GNUC__ and YYPARSE_PARAM are both defined,
15000 declare yyparse to have a void * argument.
15002 1996-12-18 Paul Eggert <eggert@gnu.org>
15004 * bison.simple (yyparse):
15005 If __GNUC__ and YYPARSE_PARAM are both defined,
15006 declare yyparse to have a void * argument.
15008 1996-12-17 Richard Stallman <rms@gnu.org>
15010 * src/reduce.c (nbits): Add some casts.
15012 1996-08-12 Richard Stallman <rms@gnu.org>
15014 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
15016 1996-08-12 Richard Stallman <rms@gnu.org>
15018 * bison.simple: Test _MSDOS as well as _MSDOS_.
15020 1996-07-31 Richard Stallman <rms@gnu.org>
15023 [__sun && __i386]: Include alloca.h.
15025 1996-07-31 Richard Stallman <rms@gnu.org>
15028 [__sun && __i386]: Include alloca.h.
15030 1996-07-30 Richard Stallman <rms@gnu.org>
15032 * src/bison.s1: Comment change.
15034 * src/bison.s1: Test _MSDOS_, not MSDOS.
15036 1996-07-30 Richard Stallman <rms@gnu.org>
15038 * bison.simple: Comment change.
15040 * bison.simple: Test _MSDOS_, not MSDOS.
15042 1996-06-01 Richard Stallman <rms@gnu.org>
15044 * 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:
15045 Insert `_' macro around many string constants.
15048 Insert `_' macro around many string constants.
15050 (main): Call setlocale, bindtextdomain and textdomain.
15052 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
15053 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
15054 [ENABLE_NLS]: Include libintl.h.
15055 [ENABLE_NLS] (gettext): Define.
15056 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
15057 (N_, PACKAGE, LOCALEDIR): New macros.
15059 1996-06-01 Richard Stallman <rms@gnu.org>
15061 * POTFILES.in: New file.
15063 * Makefile.in (allocate.o):
15064 Define target explicitly.
15066 * Makefile.in (CFLAGS): Set to @CFLAGS@.
15067 (LDFLAGS): Set to @LDFLAGS@.
15068 (configure): Run autoconf only if preceding `cd' succeeds.
15069 (bison.s1): Redirect output to temporary file then move the
15070 temporary to the target, rather than redirecting directly to bison.s1.
15071 (clean): Remove config.status and config.log.
15072 (distclean): Don't remove config.status here.
15074 1996-05-12 Richard Stallman <rms@gnu.org>
15077 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
15079 1996-05-12 Richard Stallman <rms@gnu.org>
15082 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
15084 1996-05-11 Richard Stallman <rms@gnu.org>
15086 * src/bison.s1 (__yy_memcpy):
15087 Really reorder the args, as was supposedly done on Feb 14 1995.
15088 (yyparse): Calls changed accordingly.
15090 1996-05-11 Richard Stallman <rms@gnu.org>
15092 * Makefile.in (dist): Don't use $(srcdir).
15094 * bison.simple (__yy_memcpy):
15095 Really reorder the args, as was supposedly done on Feb 14 1995.
15096 (yyparse): Calls changed accordingly.
15098 1996-01-27 Richard Stallman <rms@gnu.org>
15100 * src/output.c (output_rule_data):
15101 Test YYERROR_VERBOSE in the conditional
15102 around the definition of ttyname.
15104 1995-12-29 Richard Stallman <rms@gnu.org>
15107 Fix line numbers in #line commands.
15109 1995-12-29 Richard Stallman <rms@gnu.org>
15112 Fix line numbers in #line commands.
15114 1995-12-27 Richard Stallman <rms@gnu.org>
15116 * src/bison.s1 (YYPARSE_PARAM_DECL):
15117 In C++, make it always null.
15118 (YYPARSE_PARAM_ARG): New macro.
15119 (yyparse): Use YYPARSE_PARAM_ARG.
15121 1995-12-27 Richard Stallman <rms@gnu.org>
15123 * bison.simple (YYPARSE_PARAM_DECL):
15124 In C++, make it always null.
15125 (YYPARSE_PARAM_ARG): New macro.
15126 (yyparse): Use YYPARSE_PARAM_ARG.
15128 1995-11-29 Richard Stallman <rms@gnu.org>
15130 * doc/bison.texinfo:
15131 Describe literal string tokens, %raw, %no_lines, %token_table.
15133 1995-11-29 Daniel Hagerty <hag@gnu.org>
15135 * doc/bison.texinfo: Fixed update date
15137 1995-10-16 Richard Stallman <rms@gnu.org>
15139 * src/version.c: Version 1.25.
15141 1995-10-16 Richard Stallman <rms@gnu.org>
15143 * NEWS: *** empty log message ***
15145 1995-10-16 Richard Stallman <rms@gnu.org>
15147 * doc/bison.1, doc/bison.rnh:
15150 1995-10-15 Richard Stallman <rms@gnu.org>
15152 * src/vmsgetargs.c, src/getargs.c:
15153 Added -n, -k, and -raw switches.
15154 (noparserflag, toknumflag, rawtoknumflag): New variables.
15156 * src/symtab.h (SALIAS):
15157 New #define for adding aliases to %token.
15158 (struct bucket): Added `alias' field.
15160 * src/reduce.c (reduce_grammar):
15161 Revise error message.
15162 (print_notices): Remove final `.' from error message.
15164 * src/reader.c (reader_output_yylsp):
15166 (readgram): Use `#if 0' around code that accepted %command
15167 inside grammar rules: The documentation doesn't allow it,
15168 and it will fail since the %command processors scan for the next %.
15169 (parse_token_decl): Extended the %token
15170 declaration to allow a multi-character symbol as an alias.
15171 (parse_thong_decl): New function.
15172 (read_declarations): Added %thong declarations.
15173 (read_declarations): Handle NOOP to deal with allowing
15174 % declarations as another means to specify the flags.
15175 (readgram): Allow %prec prior to semantics embedded in a rule.
15176 (skip_to_char, read_declarations, copy_definition)
15177 (parse_token_decl, parse_start_decl, parse_type_decl)
15178 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
15179 (get_type_name, copy_guard, copy_action, readgram)
15180 (get_type, packsymbols): Revised most error messages.
15181 Changed `fatal' to `warnxxx' to avoid aborting for error.
15182 Revised and use multiple warnxxx functions to avoid using VARARGS1.
15183 (read_declarations): Improve the error message for
15184 an invalid character. Do not abort.
15185 (read_declarations, copy_guard, copy_action): Use
15186 printable_version to avoid unprintable characters in printed output.
15187 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
15188 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
15189 Allow the type of a non-terminal can be given
15190 more than once, as long as all specifications give the same type.
15193 (output_headers, output_trailers, output, output_gram)
15194 (output_rule_data): Implement noparserflag variable.
15195 Implement toknumflag variable.
15196 (output): Call reader_output_yylsp to output LTYPESTR.
15198 * src/main.c (main):
15199 If reader sees an error, don't process the grammar.
15200 (fatals): Updated to not use VARARGS1.
15201 (printable_version, int_to_string, warn, warni, warns, warnss)
15202 (warnsss): New error reporting functions. Avoid abort for error.
15205 Added THONG and NOOP for alias processing.
15206 Added SETOPT for the new code that allows setting options with %flags.
15209 Include getopt.h. Add some extern decls.
15210 (safegetc): New function to deal with EOF gracefully.
15211 (literalchar); new function to deal with reading \ escapes.
15212 (lex): Use literalchar.
15213 (lex): Implemented "..." tokens.
15214 (literalchar, lex, parse_percent_token): Made tokenbuffer
15215 always contain the token. This includes growing the token
15216 buffer while reading an integer.
15217 (parse_percent_token): Replaced if-else statement with percent_table.
15218 (parse_percent_token): Added % declarations as another
15219 way to specify the flags -n, -l, and -r. Also added hooks for
15220 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
15221 major changes to files.c.
15222 (lex) Retain in the incoming stream a character following
15224 (skip_white_space, lex): Revised most error messages
15225 and changed fatal to warn to avoid aborting.
15226 (percent_table): Added %thong declarations.
15228 * src/gram.h: Comment changes.
15230 * src/files.c (openfiles, open_extra_files, done):
15232 and actfile file. Handle noparserflag. Both for -n switch.
15234 * src/conflicts.c (resolve_sr_conflict):
15235 Remove use of alloca.
15237 1995-06-01 Jim Meyering <meyering@gnu.org>
15239 * doc/bison.texinfo: *** empty log message ***
15241 1995-05-06 Richard Stallman <rms@gnu.org>
15243 * src/bison.s1: Comment change.
15245 1995-05-06 Richard Stallman <rms@gnu.org>
15247 * bison.simple: Comment change.
15249 1995-05-03 Richard Stallman <rms@gnu.org>
15251 * src/version.c: Version now 1.24.
15253 * src/bison.s1: Change distribution terms.
15255 * src/version.c: Version now 1.23.
15257 1995-05-03 Richard Stallman <rms@gnu.org>
15259 * doc/bison.texinfo:
15260 Rewrite "Conditions for Using Bison".
15261 Update version to 1.24.
15263 1995-05-03 Richard Stallman <rms@gnu.org>
15265 * bison.simple: Change distribution terms.
15267 1995-02-23 Richard Stallman <rms@gnu.org>
15269 * src/files.c: Test __VMS_POSIX as well as VMS.
15271 1995-02-14 Jim Meyering <meyering@gnu.org>
15273 * src/bison.s1 (__yy_memcpy):
15274 Renamed from __yy_bcopy to avoid
15275 confusion. Reverse FROM and TO arguments to be consistent with
15278 1995-02-14 Jim Meyering <meyering@gnu.org>
15280 * bison.simple (__yy_memcpy):
15281 Renamed from __yy_bcopy to avoid
15282 confusion. Reverse FROM and TO arguments to be consistent with
15285 1994-11-10 David J. MacKenzie <djm@gnu.org>
15291 * Makefile.in (DISTFILES): Include NEWS.
15293 * Makefile.in (DISTFILES):
15294 Include install-sh, not install.sh.
15296 * configure.in: Update to Autoconf v2 macro names.
15298 1994-10-05 David J. MacKenzie <djm@gnu.org>
15300 * Makefile.in: fix typo
15302 * Makefile.in (prefix, exec_prefix):
15303 Let configure set them.
15305 1994-09-28 David J. MacKenzie <djm@gnu.org>
15307 * Makefile.in: Set datadir to $(prefix)/share.
15309 1994-09-15 Richard Stallman <rms@gnu.org>
15312 Update copyright notice and GPL version.
15314 1994-09-15 Richard Stallman <rms@gnu.org>
15317 Update copyright notice and GPL version.
15319 1994-07-12 Richard Stallman <rms@gnu.org>
15321 * src/reduce.c, src/reader.c:
15324 1994-05-05 David J. MacKenzie <djm@gnu.org>
15326 * Makefile.in: entered into RCS
15328 1994-03-26 Richard Stallman <rms@gnu.org>
15330 * src/bison.s1: entered into RCS
15332 1994-03-26 Richard Stallman <rms@gnu.org>
15334 * bison.simple: entered into RCS
15336 1994-03-25 Richard Stallman <rms@gnu.org>
15338 * src/main.c: entered into RCS
15340 1994-03-24 Richard Stallman <rms@gnu.org>
15342 * src/conflicts.c: entered into RCS
15344 1994-01-02 Richard Stallman <rms@gnu.org>
15346 * Makefile.in: *** empty log message ***
15348 1993-11-21 Richard Stallman <rms@gnu.org>
15350 * src/bison.s1: *** empty log message ***
15352 1993-11-21 Richard Stallman <rms@gnu.org>
15354 * doc/bison.texinfo: entered into RCS
15356 * doc/bison.texinfo: *** empty log message ***
15358 1993-11-21 Richard Stallman <rms@gnu.org>
15360 * bison.simple: *** empty log message ***
15362 1993-10-25 David J. MacKenzie <djm@gnu.org>
15364 * doc/bison.texinfo: *** empty log message ***
15366 1993-10-19 Richard Stallman <rms@gnu.org>
15368 * src/bison.s1: *** empty log message ***
15370 1993-10-19 Richard Stallman <rms@gnu.org>
15372 * bison.simple: *** empty log message ***
15374 1993-10-14 Richard Stallman <rms@gnu.org>
15376 * src/bison.s1: *** empty log message ***
15378 1993-10-14 Richard Stallman <rms@gnu.org>
15380 * bison.simple: *** empty log message ***
15382 1993-09-14 David J. MacKenzie <djm@gnu.org>
15384 * doc/bison.texinfo: *** empty log message ***
15386 1993-09-13 Noah Friedman <friedman@gnu.org>
15388 * Makefile.in: *** empty log message ***
15390 1993-09-10 Richard Stallman <rms@gnu.org>
15392 * src/conflicts.c: *** empty log message ***
15394 * src/system.h: entered into RCS
15396 1993-09-10 Richard Stallman <rms@gnu.org>
15398 * doc/bison.1: entered into RCS
15400 1993-09-06 Noah Friedman <friedman@gnu.org>
15402 * src/version.c: entered into RCS
15404 1993-09-06 Noah Friedman <friedman@gnu.org>
15406 * Makefile.in: *** empty log message ***
15408 1993-07-30 David J. MacKenzie <djm@gnu.org>
15410 * Makefile.in: *** empty log message ***
15412 1993-07-24 Richard Stallman <rms@gnu.org>
15414 * src/bison.s1: *** empty log message ***
15416 1993-07-24 Richard Stallman <rms@gnu.org>
15418 * bison.simple: *** empty log message ***
15420 1993-07-08 David J. MacKenzie <djm@gnu.org>
15422 * Makefile.in: *** empty log message ***
15424 1993-07-04 Richard Stallman <rms@gnu.org>
15426 * src/bison.s1: *** empty log message ***
15428 1993-07-04 Richard Stallman <rms@gnu.org>
15430 * bison.simple: *** empty log message ***
15432 1993-06-26 David J. MacKenzie <djm@gnu.org>
15434 * src/getargs.c: entered into RCS
15436 1993-06-26 David J. MacKenzie <djm@gnu.org>
15438 * doc/bison.texinfo: *** empty log message ***
15440 * doc/bison.1: New file.
15442 1993-06-25 Richard Stallman <rms@gnu.org>
15444 * src/getargs.c: New file.
15446 1993-06-16 Richard Stallman <rms@gnu.org>
15448 * src/bison.s1: *** empty log message ***
15450 1993-06-16 Richard Stallman <rms@gnu.org>
15452 * bison.simple: *** empty log message ***
15454 1993-06-03 Richard Stallman <rms@gnu.org>
15456 * src/bison.s1: New file.
15458 1993-06-03 Richard Stallman <rms@gnu.org>
15460 * doc/bison.texinfo: *** empty log message ***
15462 1993-06-03 Richard Stallman <rms@gnu.org>
15464 * bison.simple: New file.
15466 1993-05-19 Richard Stallman <rms@gnu.org>
15468 * doc/bison.texinfo: New file.
15470 1993-05-07 Noah Friedman <friedman@gnu.org>
15472 * Makefile.in: *** empty log message ***
15474 1993-04-28 Noah Friedman <friedman@gnu.org>
15476 * src/reader.c: *** empty log message ***
15478 1993-04-23 Noah Friedman <friedman@gnu.org>
15480 * src/alloc.h: entered into RCS
15482 1993-04-20 David J. MacKenzie <djm@gnu.org>
15484 * src/version.c: *** empty log message ***
15486 * src/files.c, src/allocate.c:
15489 * src/reader.c: *** empty log message ***
15491 * src/lex.c: entered into RCS
15493 * src/conflicts.c: New file.
15495 * src/symtab.c: entered into RCS
15497 * src/alloc.h: New file.
15499 * src/LR0.c: entered into RCS
15501 1993-04-18 Noah Friedman <friedman@gnu.org>
15503 * src/reader.c: New file.
15505 * src/version.c: *** empty log message ***
15507 1993-04-18 Noah Friedman <friedman@gnu.org>
15509 * Makefile.in: *** empty log message ***
15511 1993-04-17 Noah Friedman <friedman@gnu.org>
15513 * Makefile.in: *** empty log message ***
15515 1993-04-15 Richard Stallman <rms@gnu.org>
15517 * src/main.c, src/files.c:
15520 1993-04-15 Noah Friedman <friedman@gnu.org>
15522 * configure.in: entered into RCS
15524 * configure.in: *** empty log message ***
15526 * configure.in: New file.
15528 1993-04-14 Richard Stallman <rms@gnu.org>
15530 * Makefile.in: New file.
15532 1993-04-13 Richard Stallman <rms@gnu.org>
15534 * src/version.c: New file.
15536 1993-03-25 Richard Stallman <rms@gnu.org>
15538 * src/output.c: entered into RCS
15540 1992-09-25 Richard Stallman <rms@gnu.org>
15542 * configure.bat: entered into RCS
15544 1992-06-22 Richard Stallman <rms@gnu.org>
15546 * src/vmsgetargs.c: entered into RCS
15548 1992-06-22 Richard Stallman <rms@gnu.org>
15550 * doc/bison.rnh: entered into RCS
15552 1992-04-20 David J. MacKenzie <djm@gnu.org>
15554 * README: entered into RCS
15556 1992-01-22 Richard Stallman <rms@gnu.org>
15558 * src/machine.h: entered into RCS
15560 1991-12-21 Richard Stallman <rms@gnu.org>
15562 * src/lalr.c, src/closure.c:
15565 1991-12-20 Richard Stallman <rms@gnu.org>
15567 * src/state.h: entered into RCS
15569 1991-12-18 Richard Stallman <rms@gnu.org>
15571 * src/print.c, src/nullable.c, src/derives.c:
15574 1991-11-03 David J. MacKenzie <djm@gnu.org>
15576 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
15579 1988-09-09 Richard Stallman <rms@gnu.org>
15581 * src/bison.hairy: entered into RCS
15583 1987-12-16 Richard Stallman <rms@gnu.org>
15585 * REFERENCES: entered into RCS
15590 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
15591 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
15592 Software Foundation, Inc.
15594 Copying and distribution of this file, with or without
15595 modification, are permitted provided the copyright notice and this
15596 notice are preserved.