]> git.saurik.com Git - bison.git/blame - ChangeLog
Don't leak semantic values for parent RHS when a user action cuts the
[bison.git] / ChangeLog
CommitLineData
520181ab
JD
12006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 Don't leak semantic values for parent RHS when a user action cuts the
4 parser, and clean up related code a bit.
5 * tests/glr-regression.at (Leaked merged semantic value if user action
6 cuts parse) Rename to...
7 (Leaked semantic values if user action cuts parse) ... this. Add check
8 for leaked parent RHS values.
9 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
10 between an unresolved state (non-empty chain of semantic options) and
11 an incomplete one (signaled by an empty chain).
12 (yyresolveStates): Document the interface. Move all manipulation of an
13 successfully or unsuccessfully resolved yyGLRState to...
14 (yyresolveValue): ... here so that yyresolveValue always leaves a
15 yyGLRState with consistent data and thus is easier to understand.
16 Remove the yyvalp and yylocp parameters since they are always just
17 taken from the yys parameter. When reporting a discarded merged value
18 in debugging output, note that it is incompletely merged. Document the
19 interface.
20 (yyresolveAction): If resolving any of the RHS states fails, destroy
21 them all rather than leaking them. Thus, as long as user actions are
22 written to clean up the RHS correctly, yyresolveAction always cleans up
23 the RHS of a semantic option. Document the interface.
24
18d9185c
PE
252006-02-27 Paul Eggert <eggert@cs.ucla.edu>
26
27 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
28 led to a segmentation fault in GNU Pascal. Problem reported
29 by Waldek Hebisch.
30
841a7737
JD
312006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
32
33 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
34 mid-rule action inside a nonterminal symbol in order to declare a
35 destructor for its semantic value.
36
fc3f467f
PE
372006-02-16 Paul Eggert <eggert@cs.ucla.edu>
38
39 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
40 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
41 __cplusplus && ! defined _STDLIB_H && !
42 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
43 defined free))]: Include <stdlib.h> rather than rolling our own
44 declarations of malloc and free, to avoid problems with
45 incompatible declarations (using 'throw') C++'s stdlib.h. This
46 should fix Debian bug 340012
47 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
48 reported by Guillaume Melquiond.
49
a3af26dd
PE
502006-02-13 Paul Eggert <eggert@cs.ucla.edu>
51
4d7bc38c
PE
52 * NEWS: Clarify symbols versus types in unused-value warnings.
53
a3af26dd
PE
54 * configure.ac (AC_INIT): Bump version number.
55
4e26c69e
PE
562006-02-13 Paul Eggert <eggert@cs.ucla.edu>
57
58 * NEWS: Version 2.1a.
59 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
60 since C99 requires this.
61
498e897c
PE
622006-02-11 Paul Eggert <eggert@cs.ucla.edu>
63
64 * m4/c-working.m4: New file.
65 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
66
57bb17ca
PE
672006-02-10 Paul Eggert <eggert@cs.ucla.edu>
68
69 * Makefile.maint: Merge from coreutils.
70
0be105dc
PE
712006-02-09 Paul Eggert <eggert@cs.ucla.edu>
72
73 More portability fixes for problems summarized by Nelson H. F. Beebe.
74
75 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
76 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
77 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
78 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
79 messes up because C++ code is compiled in 32-bit mode but linked
80 in 64-bit mode.
81
6fc0c024
PE
822006-02-08 Paul Eggert <eggert@cs.ucla.edu>
83
84 More portability fixes for problems summarized by Nelson H. F. Beebe.
85
7870f699
PE
86 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
87 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
88
6fc0c024
PE
89 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
90 nodist_PROGRAMS, since we don't need to actually compile the
91 example if we're just doing a plain 'make'. This avoids bothering
92 the installer unnecessarily about problems due to weird C++
93 compilers.
94
fe6c2fde
PE
952006-02-06 Paul Eggert <eggert@cs.ucla.edu>
96
97 More portability fixes for problems summarized by Nelson H. F. Beebe.
98
99 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
100 than #include "...", and compile with -I'.'. The old method was
101 not portable, according to Posix and the C standard, and it does
102 not work with Sun C 5.7, where previous #line directives affect
103 the working directory used in later #include "..." directives.
104
927b425b
JMG
1052006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
106
107 Various DJGGP specific issues in /djgpp
108
d9735e9e
PE
1092006-02-02 Paul Eggert <eggert@cs.ucla.edu>
110
111 More portability fixes for problems summarized by Nelson H. F. Beebe.
112
113 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
114 '#include <map>' works and that you can apply ++ to iterators.
115
5a6755af
PE
1162006-02-01 Paul Eggert <eggert@cs.ucla.edu>
117
67a0dc4f
PE
118 Work around portability problems summarized by Nelson H. F. Beebe in
119 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
120
8c86f0ef
PE
121 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
122 that '#include <string>' works.
123
de35dd59
PE
124 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
125 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
126 "warning: sorry: semantics of inline function static data `const
127 unsigned char translate_table[262]' are wrong (you'll wind up with
128 multiple copies)".
129
67a0dc4f
PE
130 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
131 or, xor to not_, and_, or_, and xor_, respectively. This works
132 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
133 random system header somewhere that includes the equivalent of
134 <iso646.h>.
135
5a6755af
PE
136 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
137 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 138 Suite Version 2.0.
5a6755af 139
3f001415
JD
1402006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
141
142 During deterministic GLR operation, user actions should be able to
143 influence the parse by changing yychar. To make this easier to fix and
144 to make glr.c easier to evolve in general, don't maintain yytoken in
145 parallel with yychar; just compute yytoken when needed.
146 * tests/glr-regression.at (Incorrect lookahead during deterministic
147 GLR): Check that setting yychar in a user action has the intended
148 effect.
149 * data/glr.c (yyGLRStack): Remove yytokenp member.
150 (yyclearin): Don't set *yytokenp.
151 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
152 yychar rather than *yytokenp to determine the current lookahead.
153 Compute yytoken locally when needed.
154 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
155 point to.
156
157 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
158 after `--report' documentation.
159
e2a8c0f5
PE
1602006-01-30 Paul Eggert <eggert@cs.ucla.edu>
161
162 * src/parse-gram.y (grammar_declaration): Location of printer
163 symbol is @1, not list->location. Bug reported by twlevo.
164 * tests/input.at (Incompatible Aliases): Adjust to above change.
165
6b702268
PE
1662006-01-29 Paul Eggert <eggert@cs.ucla.edu>
167
27622431
PE
168 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
169 all the test at once. This makes the output easier to read in the
170 normal case.
171
6b702268
PE
172 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
173 got from <http://bro-ids.org/download.html>. The bug is that
174 when two actions appeared in succession, the second one was
175 scanned before the first one was added to the grammar rule
176 as a midrule action. Bison then output the incorrect warning
177 "parse.y:905.17-906.36: warning: unused value: $3".
178 * src/parse-gram.y (BRACED_CODE, action): These are no longer
179 associated with a value.
180 (rhs): Don't invoke grammar_current_rule_action_append.
181 (action): Invoke it here instead.
182 * src/reader.c (grammar_midrule_action): Now extern.
183 (grammar_current_rule_action_append): Don't invoke
184 grammar_midrule_action; that is now the scanner's job.
185 * src/reader.h (last_string, last_braced_code_loc):
186 (grammar_midrule_action): New decls.
187 * src/scan-gram.l (last_string): Now extern, sigh.
188 (last_braced_code_loc): New extern variable.
189 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
190 rule already has an action.
191 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
192 * tests/input.at (AT_CHECK_UNUSED_VALUES):
193 Add some tests to check that the above changes fixed the bug.
194
d40ba6c2
PE
1952006-01-27 Paul Eggert <eggert@cs.ucla.edu>
196
197 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
198 All used changed. Check whether the symbol has a destructor,
199 not whether it is typed.
200 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
201 that the values are still reported as unused. All line numbers
202 adjusted.
203
401aace6
PE
2042006-01-23 Paul Eggert <eggert@cs.ucla.edu>
205
206 Work around a bug in bro 0.8, which underparenthesizes its
207 definition of YYLLOC_DEFAULT.
208 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
209 their arguments.
210 * data/lalr1.cc: Likewise.
211 * data/yacc.cc: Likewise.
212
06f01bc4
PE
2132006-01-22 Paul Eggert <eggert@cs.ucla.edu>
214
401aace6
PE
215 Work around a bug in Pike 7.0, and give the Pike folks a
216 better way to override the usual int widths.
217 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
218 user can override the types.
219 (short): #undef, to work around a bug in Pike 7.0.
220 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
221 (union yyalloc.yyss): Use yytype_int16 rather than short.
222 All uses changed.
223 (yysigned_char): Remove.
224 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
225 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
226 * tests/regression.at (Web2c Actions): Adjust to above changes.
227
228 * src/reader.c (check_and_convert_grammar): New function.
229 (reader): Close the input file even if something went wrong during
230 parsing. Minor file descriptor leak reported by twlevo.
231
06f01bc4
PE
232 * src/assoc.c (assoc_to_string): Use a default: abort (); case
233 to pacify gcc -Wswitch-default.
234 * src/scan-gram.l (adjust_location): Use a default: break; case
235 to pacify gcc -Wswitch-default.
236 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
237 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
238 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
239 Move these decls to scan-skel.l, since they don't need to be
240 visible elsewhere.
241 * src/scan-skel.l: Accept the above decls.
242 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
243 is used.
244
02650b7f
PE
2452006-01-21 Paul Eggert <eggert@cs.ucla.edu>
246
247 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
248 since we don't want to insist on a version number at the start
249 of the changelog every time.
250 * Makefile.maint: Sync from coreutils a bit better.
251 (sc_trailing_blank): Renamed from sc_trailing_space.
252 All uses changed.
253 (sc_no_if_have_config_h, sc_require_config_h):
254 (sc_prohibit_assert_without_use): New rules.
255 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
256 (sc_dd_max_sym_length): Fix leading spaces in rule.
257 (sc_system_h_headers): Prefix with @.
258 (sc_useless_cpp_parens, m4-check): Output line numbers.
259 (changelog-check): Allow version only in head.
260 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
261 satisfy new Makefile.maint rule.
262 * data/glr.c: Likewise.
263 * data/glr.cc: Likewise.
264 * data/lalr1.cc: Likewise.
265 * data/yacc.c: Likewise.
266 * lib/ebitsetv.c: Likewise.
267 * lib/lbitset.c: Likewise.
268 * lib/subpipe.c: Likewise.
269 * lib/timevar.c: Likewise.
270 * src/system.h: Likewise.
271 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
272 * djgpp/Makefile.maint: Add copyright notice.
273 * djgpp/README.in: Likewise.
274 * djgpp/config.bat: Likewise.
275 * djgpp/config.site: Likewise.
276 * djgpp/config_h.sed: Likewise.
277 * djgpp/djunpack.bat: Likewise.
278 * djgpp/config.sed: Fix copyright notice to match standard format.
279 * djgpp/subpipe.h: Likewise.
280 * lib/bitsetv-print.c: Likewise.
281 * lib/bitsetv.c: Likewise.
282 * lib/subpipe.h: Likewise.
283 * lib/timevar.c: Likewise.
284 * lib/timevar.h: Likewise.
285 * djgpp/subpipe.c: Use standard recipe for config.h.
286 * lib/abitset.c: Likewise.
287 * lib/bitset.c: Likewise.
288 * lib/bitset_stats.c: Likewise.
289 * lib/bitsetv-print.c: Likewise.
290 * lib/bitsetv.c: Likewise.
291 * lib/ebitsetv.c: Likewise.
292 * lib/get-errno.c: Likewise.
293 * lib/lbitset.c: Likewise.
294 * lib/subpipe.c: Likewise.
295 * lib/timevar.c: Likewise.
296 * lib/vbitset.c: Likewise.
297 * tests/local.at: Likewise.
298 * src/scan-gram.l: Don't include verify.h, since system.h does
299 that for us.
300 * .x-sc_require_config_h: New file.
301 * .x-sc_unmarked_diagnostics: New file.
302
287c78f6
PE
3032006-01-20 Paul Eggert <eggert@cs.ucla.edu>
304
287c78f6
PE
305 Be a bit more systematic about using 'abort'.
306 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
307 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
308 Put 'default: abort ();' before some other case, to satisfy older
309 pedantic compilers.
310 * lib/bitset_stats.c (bitset_stats_init): Likewise.
311 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
312 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
313 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
314 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
315 (get_decision_str, get_orientation_str, get_node_alignment_str):
316 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
317 (get_linestyle_str, get_arrowstyle_str): Likewise.
318 * src/conflicts.c (resolve_sr_conflict):
319 Use a default case rather than one for the one remaining enum
320 value, to catch invalid enum values as well.
321 * src/lalr.c (set_goto_map, map_goto):
322 Prefer "assert (FOO);" to "if (!FOO) abort ();".
323 * src/nullable.c (nullable_compute, token_definitions_output):
324 Likewise.
325 * src/reader.c (packgram, reader): Likewise.
326 * src/state.c (transitions_to, state_new, state_reduction_find):
327 Likewise.
328 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
329 (symbol_pack): Likewise.
330 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
331 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
332 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
333 * src/system.h: Don't include <assert.h>.
334 (assert): New macro.
335
336 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
337 (Destructor Decl, Parser Function, Pure Calling):
338 Describe rules for braces inside C code more carefully.
287c78f6 339
c66dfadd
PE
3402006-01-19 Paul Eggert <eggert@cs.ucla.edu>
341
c21493b8
PE
342 Fix some porting glitches found by Nelson H. F. Beebe.
343 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
344 compilers that don't understand that abort () does not return.
345 * src/state.c (transitions_to): Likewise.
346 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
347 that '#include <cstdlib>' works.
348 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
349 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
350 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
351 for the benefit of some pre-C99 compilers.
352
b6e3facf
PE
353 * bootstrap: Undo changes to gnulib files that autoreconf made.
354
c66dfadd
PE
355 Minor fixups to get 'make maintainer-check' to work.
356 * configure.ac: Don't use -Wnested-externs, as it's incompatible
357 with the new verify.h implementation.
358 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
359 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
360 * data/yacc.c (YYUSE): Likewise.
361 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
362 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
363 * src/parse-gram.y (declaration): Don't pass a string constant
364 to a function that expects char *, since GCC might complain
365 about the constant value.
366 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
367 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
368 before #defining them.
369 * tests/glr-regression.at
370 (Incorrectly initialized location for empty right-hand side in GLR):
371 In yyerror, use the msg arg.
372 (Corrupted semantic options if user action cuts parse):
373 (Incorrect lookahead during deterministic GLR):
374 (Incorrect lookahead during nondeterministic GLR):
375 Don't name a local var 'index'; it shadows string.h's 'index'.
376
ed94ef2a
AD
3772006-01-19 Akim Demaille <akim@epita.fr>
378
379 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
380 location, not just parts of it.
381
e9ad4aec
PE
3822006-01-18 Paul Eggert <eggert@cs.ucla.edu>
383
d6ca7905
PE
384 * NEWS: Document the fact that multiple %unions are now allowed.
385 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
386 * TODO: This feature is now implemented, so remove it from
387 the wishlist.
d6ca7905 388
ef1b70e0
PE
389 * Makefile.maint: Merge with coreutils Makefile.maint.
390 (CVS_LIST): Use build-aux version if available.
391 (VERSION_REGEXP): New macro.
392 (syntax-check-rules): Add sc_no_if_have_config_h,
393 sc_prohibit_assert_without_use, sc_require_config_h,
394 sc_useless_cpp_parens.
395 (sc_obsolete_symbols): Check for O_NDELAY.
396 (sc_dd_max_sym_length): Track coreutils.
397 (sc_unmarked_diagnostics): Look in all files, not just *.c.
398 (sc_useless_cpp_parens): New rule.
399 (news-date-check): Look for version or today's date.
400 (changelog-check): Don't require version number near head.
401 (copyright-check): Use current year instead of hardwiring 2005.
402 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
403 (announcement): Add --gpg-key-ID.
404
405 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
406 with "file system".
407
2073ce56 408 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
409 array. Problem reported by twlevo.
410 * src/reader.c (packgram): Prepend a new sentinel before ritem.
411 * src/lalr.c (build_relations): Rely on new sentinel.
412 * src/gram.c (gram_free): Adjust to new sentinel.
413
b7691f15
JD
4142006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
415
416 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
417 yylookaheadNeeds. All uses updated.
418 (yysplitStack): Rename local yynewLookaheadStatuses to
419 yynewLookaheadNeeds.
420 * data/glr-regression.at (Incorrect lookahead during nondeterministic
421 GLR): In comments, change `lookahead status' to `lookahead need'.
422
ddee1b06
PH
4232006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
424
425 * data/glr.c (yysplitStack): A little stylistic rewrite.
426
12f4614d
PH
4272006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
428
429 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
430
32c29292
JD
4312006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
432
433 * doc/bison.texinfo: Fix some typos.
434 (GLR Semantic Actions): New subsection discussing special
435 considerations because GLR semantic actions might be deferred.
436 (Actions): Mention look-ahead usage of yylval.
437 (Actions and Locations): Mention look-ahead usage of yylloc.
438 (Special Features for Use in Actions): Add YYEOF entry and mention it
439 in the yychar entry.
440 In the yychar entry, remove mention of the local yychar case (pure
441 parser) since this is irrelevant information when writing semantic
442 actions and since it's already discussed in `Bison Symbols' where
443 yychar is otherwise described as an external variable.
444 In the yychar entry, don't call it the `current' look-ahead since it
445 isn't when semantic actions are deferred.
446 In the yychar and yyclearin entries, add note about deferred semantic
447 actions.
448 Add yylloc and yylval entries discussing look-ahead usage.
449 (Look-Ahead Tokens): When discussing yychar, don't call it the
450 `current' look-ahead, and do mention yylval and yylloc.
451 (Error Recovery): Cross-reference `Action Features' when mentioning
452 yyclearin.
453 (Bison Symbols): In the yychar entry, don't call it the `current'
454 look-ahead.
455 In the yylloc and yylval entries, mention look-ahead usage.
456
de366a2f 4572006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
458
459 * tests/glr-regression.at: Update copyright year to 2006.
460
bf70fa87
JD
4612006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
462
463 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
464 use during nondeterministic operation to track which stacks have
465 actually needed the current lookahead.
466 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
467 Allocate, deallocate, resize, and otherwise shuffle space for
468 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
469 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
470 appropriately during nondeterministic operation.
471 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
472 members to store the current lookahead to be used by the deferred
473 user action.
474 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
475 from which the RHS is taken. Set the lookahead members of the new
476 yySemanticOption according to the lookahead status for stack yyk.
477 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
478 yyaddDeferredAction.
479 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
480 members of yySemanticOption before invoking yyuserAction, and then set
481 them back to their current values afterward.
482 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
483 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
484 * tests/glr-regression.at: Remove `.' from the ends of recent test case
485 titles for consistency.
486 (Leaked merged semantic value if user action cuts parse): In order to
487 suppress lint warnings, use arguments in merge function, and assign
488 char value < 128 in main.
489 (Incorrect lookahead during deterministic GLR): New test case.
490 (Incorrect lookahead during nondeterministic GLR): New test case.
491
05449a2c
JD
4922006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
493
de366a2f 494 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
495 !yyvaluep as signal that no semantic value is available to print.
496 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
497 to print a semantic value.
498
4158e0a1 4992006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 500
4158e0a1
JD
501 * tests/glr-regression.at: For consistency with my newer test cases,
502 don't thank myself.
503
d659304d
JD
5042006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
505
506 * data/glr.c (yyresolveValue): When merging semantic options, if at
507 least one user action succeeds but a later one cuts the parse, then
508 destroy the semantic value before returning rather than leaking it.
509 (yyresolveStates): If a user action cuts the parse and thus
510 yyresolveValue fails, ignore the (unset) semantic value rather than
511 corrupting the yyGLRState, and empty the semantic options list since
512 the user actions should have called all necessary destructors.
513 Simplify code with YYCHK.
514 * tests/glr-regression.at (Corrupted semantic options if user action
515 cuts parse): New test case.
516 (Undesirable destructors if user action cuts parse): New test case.
517 Before applying any of this patch, this test case never actually failed
518 for me... but only because the corrupted semantic options usually
519 masked this bug.
520 (Leaked merged semantic value if user action cuts parse): New test
521 case.
522
6ec2c0f2
AD
5232006-01-05 Akim Demaille <akim@epita.fr>
524
525 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
526
1b9c21fb
PE
5272006-01-04 Paul Eggert <eggert@cs.ucla.edu>
528
529 * data/c.m4 (b4_c_modern): New macro, with a new provision for
530 _MSC_VER. Problem reported by Cenzato Marco.
531 (b4_c_function_def): Use it.
532 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
533 b4_c_modern.
534 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
535 than rolling our own.
536
84866159
AD
5372006-01-04 Akim Demaille <akim@epita.fr>
538
539 Also warn about non-used mid-rule values.
540 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
541 member.
542 (symbol_list_new): Adjust.
543 * src/reader.c (symbol_typed_p): New.
544 (grammar_rule_check): Use it.
545 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
546 Check its rule.
547 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
548 Use it.
549 * tests/actions.at (Exotic Dollars): Adjust.
550
378f4bd8
AD
5512006-01-04 Akim Demaille <akim@epita.fr>
552
553 * src/reader.c (grammar_midrule_action): If $$ is set in a
554 mid-rule, move the `used' bit to its lhs.
555 * tests/input.at (Unused values): New.
556 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
557
e2a21b6f
PE
5582006-01-03 Paul Eggert <eggert@cs.ucla.edu>
559
54662697
PE
560 * doc/bison.texinfo (Bison Options): Say more accurately what
561 --yacc does.
562 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
563 about declarations in the grammar when in Yacc mode, as POSIX does
564 not require a diagnostic when the grammar uses extensions.
565
566 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
567
073f9288
PE
568 Warn about dubious constructions like "%token T T".
569 Reported by twlevo.
570 * src/symtab.h (struct symbol.declared): New member.
571 * src/symtab.c (symbol_new): Initialize it to false.
572 (symbol_class_set): New arg DECLARING, specifying whether
573 this is a declaration that we want to warn about, if there
574 is more than one of them. All uses changed.
575
1221b78a
PE
576 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
577 Allow multiple %union directives, whose contents concatenate.
578 * src/parse-gram.y (grammar_declaration): Likewise.
579 Use muscle_code_grow, so that we don't need stype_line any more.
580 All uses changed.
581
582 * src/muscle_tab.c (muscle_grow): Fix comment.
583
e2a21b6f
PE
584 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
585 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
586 Update copyright year to 2006.
587
8f7e3cf9
AD
5882006-01-03 Akim Demaille <akim@epita.fr>
589
590 Have glr.cc pass (some of) the calc.at tests.
591 * data/glr.cc (b4_parse_param_orig): New.
592 (b4_parse_param): Improve its definition, and bound it more
593 clearly in the skeleton.
594 (b4_epilogue): Append, instead of prepending, in order to keep
595 #line consistency.
596 Simplify the generation of auxiliary functions: locations and
597 purity are mandated.
598 (b4_global_tokens_and_yystype): Honor it.
599 * data/location.cc (c++.m4): Don't include it.
600 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
601 and AT_SKEL_CC_IF.
602 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
603 AT_LALR1_CC_IF.
604 Be sure to initialize the first position's filename.
605 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
606 mandated anyway.
607 (AT_CHECK_CALC_GLR_CC): New.
608 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
609
3953ed88
AD
6102006-01-02 Akim Demaille <akim@epita.fr>
611
612 * src/output.c (output_skeleton): Don't hard wire the inclusion of
613 c.m4.
0a96ba81 614 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
615 * data/glr.cc: Do not include stack.hh.
616
9ecafbbf
AD
6172006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
618
619 * data/glr.c: Reformat whitespace with tabs.
620 (b4_lpure_formals): Remove this unused m4 macro.
621 * tests/cxx-type.at: Reformat whitespace with tabs.
622 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
623 since it's a member. Rename type to isNterm for clarity.
624
c4d497a0
AD
6252005-12-29 Akim <akim@sulaco.local>
626
627 Let glr.cc catch up with symbol_value_print.
628 * data/glr.cc (b4_yysymprint_generate): Replace by...
629 (b4_yy_symbol_print_generate): this.
630 (yy_symbol_print, yy_symbol_value_print): Declare them.
631
4517da37
PE
6322005-12-28 Paul Eggert <eggert@cs.ucla.edu>
633
634 * src/location.h (boundary): Note that a line or column equal
635 to INT_MAX indicates an overflow.
636 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
637 (rule_length_overflow, increment_rule_length, add_column_width):
638 New functions.
639 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
640 (<SC_BRACED_CODE>"}"):
641 Use increment_rule_length rather than incrementing it by hand.
642 (adjust_location, handle_syncline): Diagnose overflow.
643 (handle_action_dollar, handle_action_at):
644 Fix bug with monstrosities like $-2147483648.
645 Remove now-unnecessary checks.
646 (scan_integer): Verify assumptions and remove now-unnecessary checks.
647 (convert_ucn_to_byte): Verify assumptions.
648 (handle_syncline): New arg LOC. All callers changed.
649 Don't store through a value derived from char const * pointer.
650
651 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
652 GCC warnings.
653
e3233bf6
PE
6542005-12-27 Paul Eggert <eggert@cs.ucla.edu>
655
656 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
657 Remove unnecessary forward static decls.
658
8f3596a6
AD
6592005-12-27 Akim Demaille <akim@epita.fr>
660
661 * src/reader.c (grammar_current_rule_check): Also check that $$
662 is used.
663 Take the rule to check as argument, hence rename as...
664 (grammar_rule_check): this.
665 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
666 Rename as...
667 (grammar_rule_begin, grammar_rule_end): these, for consistency.
668 (grammar_midrule_action, grammar_symbol_append): Now static.
669 * tests/torture.at (input): Don't rely on the default action
670 being always performed.
671 * tests/calc.at: "Set" $$ even when the action is "cut" with
672 YYERROR or other.
673 * tests/actions.at (Exotic Dollars): Instead of using unused
674 values, check that the warning is issued.
675
721be13c
PE
6762005-12-22 Paul Eggert <eggert@cs.ucla.edu>
677
678 * NEWS: Improve wording for unused-value warnings.
679
a0af42fc
AD
6802005-12-22 Akim Demaille <akim@epita.fr>
681
682 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
683 (b4_yysymprint_generate): Rename as...
684 (b4_yy_symbol_print_generate): this.
685 Generate yy_symbol_print instead of yysymprint.
686 Generate also yy_symbol_value_print, and use it.
687
affac613
AD
6882005-12-22 Akim Demaille <akim@epita.fr>
689
721be13c 690 * NEWS: Warn about unused values.
affac613
AD
691 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
692 a `used' member.
693 (symbol_list_n_get, symbol_list_n_used_set): New.
694 (symbol_list_n_type_name_get): Use symbol_list_n_get.
695 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
696 * src/reader.c (grammar_current_rule_check): Check that values are
697 used.
698 * src/symtab.c (symbol_print): Accept 0.
699 * tests/existing.at: Remove the type information.
700 Empty the actions.
701 Remove useless actions (beware of mid-rule actions: perl -000
702 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
703 * tests/actions.at (Exotic Dollars): Use unused values.
704 * tests/calc.at: Likewise.
705 * tests/glr-regression.at (No users destructors if stack 0 deleted):
706 Likewise.
707
708 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
709 rule_useful_p.
710
9d9b8b70
PE
7112005-12-21 Paul Eggert <eggert@cs.ucla.edu>
712
8bb4c753
PE
713 Undo 2005-12-01 tentative license wording change. The wording is
714 still being reviewed by the lawyers, and we don't want to wait for
715 them before publishing a test release. For now, revert to the
716 previous wording.
717 * NEWS: Undo 2005-12-01 change.
718 * data/glr.c: Revert to previous license wording.
719 * data/glr.cc: Likewise.
720 * data/lalr1.cc: Likewise.
721 * data/location.cc: Likewise.
722 * data/yacc.c: Likewise.
723
9d9b8b70
PE
724 * NEWS: Reword %destructor vs YYABORT etc.
725 * data/glr.c: Use American spacing, for consistency.
726 * data/glr.cc: Likewise.
727 * data/lalr1.cc: Likewise.
728 * data/yacc.c: Likewise.
729 * data/yacc.c: Reformat comments slightly.
730 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
731 for consistency. Fix some spelling errors and reword recently-included
732 text slightly.
733 * tests/cxx-type.at: Cast results of malloc, for C++.
734
2c3b392a
AD
7352005-12-21 Joel E. Denny <address@hidden>
736
737 * tests/cxx-type.at: Construct a tree, count the parents of shared
738 nodes, and free each node once and only once. Previously, the memory
739 for semantic values was leaked instead.
740
d6cff4dc
AD
7412005-12-21 Joel E. Denny <address@hidden>
742
743 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
744 (yylval, yylloc): If pure, #define to yystackp->yyval and
745 yystackp->yyloc similar to yychar and yynerrs.
746 (yyparse): If pure, remove local yylval and yylloc. Add local
747 yystackp to accommodate pure definitions of yylval and yylloc.
748 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
749 yylvalp and yyllocp to &yylval and &yylloc.
750 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
751 namespace. Previously, nerrs and char were missing, but lval and lloc
752 weren't necessary.
753 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
754 yylvalp and yyllocp parameters since, if pure, these are now always
755 accessible through yystackp. If not pure, they are still accessible
756 globally.
757 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
758 `if (YYID (N))' to pacify lint.
759
a85284cf
AD
7602005-12-21 Akim Demaille <akim@epita.fr>
761
762 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
763 destroy the RHS symbols of a rule.
764 * data/yacc.c (yylen): Initialize to 0.
765 Keep its value to the number of items to possibly shift.
766 In particular, a regular successful parse that ends on YYFINAL by
767 a (internal) YYACCEPT must not have yylen != 0.
768 (yyerrorlab, yyreturn): Pop the RHS.
769 Reorder a bit to emphasize the `shifting' bits of code.
770 (YYPOPSTACK): Now accept a number of items to pop.
771 * data/lalr1.cc: Likewise.
772 * data/glr.c: Formatting changes.
773 Use goto instead of fall through.
774 * doc/bison.texinfo (Destructor Decl): Complete.
775
d508c281
JMG
7762005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
777
778 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
779 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
780 * djgpp/config.bat: Replace every occurence of the file name
781 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
782 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
783 * djgpp/config.sed: Replace every occurence of the file name
784 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
785 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
786 * djgpp/djunpack.bat: DJGPP specific file.
787 * djgpp/fnchange.lst: DJGPP specific file.
788 * djgpp/README.in: Add new information about how to unpack the bison
789 source on MSDOS and other systems which have 8.3 file name restrictions
790 using djunpack.bat and fnchange.lst.
791
3e7a2cd9
PE
7922005-12-12 Paul Eggert <eggert@cs.ucla.edu>
793
794 * bootstrap (build_cvs_prefix): Remove; unused.
795 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
796 when getting gnulib.
797
7982005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
799
800 * data/glr.c: Reorder typedef declarations for structs to match order
801 of struct declarations.
802 Rename yystack everywhere to yystackp except in yyparse where it's not
803 a pointer.
804 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
805 consistency.
806 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
807 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
808 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
809 lint.
810
877519f8
PE
8112005-12-09 Paul Eggert <eggert@cs.ucla.edu>
812
0eca5a39
PE
813 * tests/sets.at (Accept): Fix typos in regular expression used to
814 sed out the final state number.
815
2cec9080
PE
816 Work around portability problem on Solaris 10: flex-generated
817 files include <stdio.h> before <config.h>, which messes up
818 because the latter defines __EXTENSIONS__. Address the problem
819 by creating two new little files that include <config.h> first,
820 then include the flex-generated files. Rewrite everyone else
821 to include <config.h> first, as well.
822 * lib/timevar.c: Always include "config.h".
823 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
824 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
825 (EXTRA_bison_SOURCES): New macro.
826 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
827 * src/system.h: Don't include config.h.
828 * src/LR0.c: Include <config.h> first.
829 * src/assoc.c: Likewise.
830 * src/closure.c: Likewise.
831 * src/complain.c: Likewise.
832 * src/conflicts.c: Likewise.
833 * src/derives.c: Likewise.
834 * src/files.c: Likewise.
835 * src/getargs.c: Likewise.
836 * src/gram.c: Likewise.
837 * src/lalr.c: Likewise.
838 * src/location.c: Likewise.
839 * src/main.c: Likewise.
840 * src/muscle_tab.c: Likewise.
841 * src/nullable.c: Likewise.
842 * src/output.c: Likewise.
843 * src/parse-gram.y: Likewise.
844 * src/print.c: Likewise.
845 * src/print_graph.c: Likewise.
846 * src/reader.c: Likewise.
847 * src/reduce.c: Likewise.
848 * src/relation.c: Likewise.
849 * src/state.c: Likewise.
850 * src/symlist.c: Likewise.
851 * src/symtab.c: Likewise.
852 * src/tables.c: Likewise.
853 * src/uniqstr.c: Likewise.
854 * src/vcg.c: Likewise.
855
877519f8
PE
856 * src/parse-gram.y: Fix minor problems uncovered by lint.
857 (current_lhs, current_lhs_location): Now static.
858 (current_assoc): Remove unused variable.
859
860 Cleanups so that Bison-generated parsers have less lint.
861 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
862 Prepend /*ARGSUSED*/, for lint's sake.
863 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
864 definition if 'lint' is defined.
865 (YYID): New macro (or function, if lint).
866 All uses of /*CONSTCOND*/0 replaced by YYID(0).
867 * data/yacc.c: Likewise.
868 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
869 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
870 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
871 is C++ only.
872 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
873 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
874 Use YYID(0) rather than 0, for lint.
875 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
876 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
877
f5228370
PE
8782005-12-07 Paul Eggert <eggert@cs.ucla.edu>
879
880 * tests/glr-regression.at
881 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
882 Close memory leak reported by twlevo.
883
69ce078b
PE
8842005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
885
6ff99711
PE
886 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
887 all stacks.
888 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
889 * tests/glr-regression.at (No users destructors if stack 0 deleted):
890 New test case.
891 (Duplicated user destructor for lookahead): This test now is expected
892 to succeed.
893
af3412cd
PE
8942005-12-01 Paul Eggert <eggert@cs.ucla.edu>
895
32b5b719 896 * NEWS: Document the following change.
af3412cd
PE
897 * data/yacc.c: Say "parser skeleton" rather than "file", since
898 it's no longer just a file.
899 * data/glr.c: Grant a special exception for C GLR parsers, that
900 reads like the already-existing exception for C LALR(1) parsers.
901 * data/glr.cc: Likewise.
902 * data/lalr1.cc: Likewise.
903 * data/location.cc: Likewise.
904 * data/yacc.c: Reword the "written by" statement to clarify that
905 it was the parser skeleton, not the entire output file.
906 * data/glr.c: Written by Paul Hilfinger.
907 * data/glr.cc: Written by Akim Demaille.
908 * data/lalr1.cc: Likewise.
909
035aa4a0
PE
9102005-11-18 Paul Eggert <eggert@cs.ucla.edu>
911
d9963c85
PE
912 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
913 Fix typos in previous change that broke 'make check'.
914 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
915 supported in C.
916 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
917 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
918 We can revert this once things settle down.
919
035aa4a0
PE
920 * src/conflicts.c (conflicts_print): Don't print file name twice
921 when %expect fails because there were no conflicts.
922 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
923 change.
924 * tests/conflicts.at (%expect not enough, %expect too much):
925 (%expect with reduce conflicts): Adjust to new behavior.
926
9272005-11-18 Akim Demaille <akim@epita.fr>
928
929 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
930 errors.
931 * NEWS: Document this.
932 * doc/bison.texinfo (Expect Decl): Likewise.
933
d1ff7a7c
AD
9342005-11-16 Akim Demaille <akim@epita.fr>
935
936 Generalize the display of semantic values and locations in traces.
937 * data/glr.c (yy_reduce_print): Fix indices (again).
938 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
939 literal integers.
940 * data/lalr1.cc (yyreduce_print): Rename as...
941 (yy_reduce_print): this.
942 Display values and locations.
943 * data/yacc.c (yy_reduce_print): Likewise.
944 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
945 (yysymprint): Move higher to be visible from yy_reduce_print).
946 (yyparse): Adjust.
947 * tests/calc.at: Adjust the expected length of the traces.
948
6de5398d
AD
9492005-11-14 Akim Demaille <akim@epita.fr>
950
951 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
952 from 1 to N, while values and location start at 0.
953 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
954
a1373f55
AD
9552005-11-14 Akim Demaille <akim@epita.fr>
956
957 * data/glr.c (yy_reduce_print): Fix the $ number.
958
613d8952
AD
9592005-11-14 Akim Demaille <akim@epita.fr>
960
961 "Use" parse parameters.
962 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
963 * data/glr.c, data/glr.cc: Use them.
964 * data/glr.c (YYUSE): Have a C++ definition that supports
965 non-pointer types.
966
b2741627
AD
9672005-11-14 Akim Demaille <akim@epita.fr>
968
969 * data/glr.c (yyexpandGLRStack): Declare only if defined.
970
5059b5c8
AD
9712005-11-14 Akim Demaille <akim@epita.fr>
972
42249483
AD
973 * data/glr.cc: New.
974 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 975
4626a15d
AD
9762005-11-12 Akim Demaille <akim@epita.fr>
977
978 Let position and location be PODs.
979 * data/location.cc (position::initialize, location::initialize): New.
980 (position::position, location::location): Define only if
981 b4_location_constructors is defined.
982 * data/lalr1.cc (b4_location_constructors): Define it for backward
983 compatibility.
984 * doc/bison.texinfo (Initial Action Decl): Use initialize.
985
9862005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
987
988 * data/lalr1.cc: Move the body of the ctor and dtor into the
989 parser file (instead of the header).
990 Wrap the implementations in a "namespace yy".
991
9922005-11-12 Akim Demaille <akim@epita.fr>
993
994 Have glr.c include its header file when created.
995 * data/glr.c (b4_shared_declarations): New.
996 Output them verbatim in the parser if !%defines, otherwise
997 output then in the header file, and include it instead.
998
1989d947
AD
9992005-11-11 Akim Demaille <akim@epita.fr>
1000
1001 * data/glr.c: Comment changes.
1002
10032005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
1004
1005 When yydebug, report semantic and location values for reductions.
1006 * data/glr.c (yy_reduce_print): Report the semantic values and the
1007 locations.
1008 (YY_REDUCE_PRINT): Adjust.
1009 (yyglrReduce): Use them.
1010 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
1011 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
1012 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
1013 traces.
1014
02998094
AD
10152005-11-10 Akim Demaille <akim@epita.fr>
1016
1017 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
1018 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
1019 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
1020
5210672f
PE
10212005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
1022
1023 * m4/cxx.m4, examples/Makefile.am: Don't build
1024 examples/calc++ if no C++ compiler is available. (trivial change)
1025
a8991a1d
AD
10262005-11-09 Akim Demaille <akim@epita.fr>
1027
1028 * src/scan-skel.l: Use a couple of asserts.
1029
36b5e963
AD
10302005-11-03 Akim Demaille <akim@epita.fr>
1031
1032 In some (weird) cases, the final state number is incorrect.
1033 Reported by Alexandre Duret-Lutz.
1034 * src/LR0.c (state_list_append): Remove the computation of
1035 final_state.
1036 (save_reductions): Do it here.
1037 (get_state): Alpha conversion.
1038 (generate_states): Use a for loop.
1039 * src/gram.h (item_number_is_rule_number)
1040 (item_number_is_symbol_number): New.
1041 * src/state.c: Use assert.
1042 * src/system.h: Include assert.h.
1043 * tests/sets.at (Accept): New.
1044
44e7ead1
PH
10452005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
1046
1047 * data/glr.c (yyfill): Adjust comment.
36b5e963 1048 (yyresolveAction): Initialize default location properly
44e7ead1
PH
1049 for empty right-hand sides.
1050 (yydoAction): Ditto.
1051 Add comment explaining apparently dead code.
36b5e963
AD
1052 * tests/glr-regression.at
1053 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 1054 New test.
36b5e963 1055
e10a80ee
PE
10562005-10-30 Paul Eggert <eggert@cs.ucla.edu>
1057
1058 * bootstrap (cleanup_gnulib): New function. Use it to clean up
1059 gnulib when interrupted. This fixes some race conditions and
1060 works around some portability problems (one noted by Paul
1061 Hilfinger).
1062
067b32ee
AD
10632005-10-22 Akim <akim@epita.fr>
1064
1065 * Makefile.cfg: Adjust to config -> build-aux.
1066 Reported by twledo.
1067
4b367315
AD
10682005-10-21 Akim Demaille <akim@epita.fr>
1069
1070 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
1071 the %parse-params.
1072 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
1073 * data/yacc.c (b4_Pure_if): Rename as...
1074 (b4_yacc_pure_if): this.
1075 (YY_SYMBOL_PRINT, yyparse): Adjust.
1076 * doc/bison.texinfo: Formatting changes.
1077
24cc23d9
AD
10782005-10-21 Akim Demaille <akim@epita.fr>
1079
1080 Finish the transition config -> build-aux.
1081 * configure.ac, Makefile.am: Use build-aux.
1082 * config/prev-version, config/announce-gen, config/Makefile.am:
1083 Move to...
1084 * build-aux/prev-version, build-aux/announce-gen,
1085 * build-aux/Makefile.am: here.
1086
d4476375
AD
10872005-10-14 Akim Demaille <akim@epita.fr>
1088
1089 * examples/calc++/test: Use set -x only when VERBOSE.
1090
302c0aee
PE
10912005-10-13 Paul Eggert <eggert@cs.ucla.edu>
1092
1093 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
1094 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
1095
7625ec2c
AD
10962005-10-13 Akim Demaille <akim@epita.fr>
1097
1098 * src/scan-skel.l: Output the base name parts of the parser and
1099 header file names.
302c0aee 1100 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
1101 additional checks.
1102 Use this to exercise C++ outputs in subdirs.
1103 Reported by Oleg Smolsky.
1104
ba0fe3c7
PE
11052005-10-12 Paul Eggert <eggert@cs.ucla.edu>
1106
1107 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
1108 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
1109 Problem reported by John P. Hartmann.
1110 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
1111 already defined it.
1112
9b8a5ce0
AD
11132005-10-12 Akim Demaille <akim@epita.fr>
1114
1115 * src/parse-gram.y (version_check): Exit 63 to please missing
1116 (stands for "version mismatch).
1117 * tests/input.at, doc/bison.texinfo: Adjust.
1118
4f6e011e
PE
11192005-10-10 Paul Eggert <eggert@cs.ucla.edu>
1120
1121 Work around portability problems with Visual Age C compiler
1122 (xlc and xlC_r) reported by John P. Hartmann.
1123 * data/location.cc (initial_column, initial_line): Remove.
1124 All uses replaced by 0 and 1.
1125 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
1126 that xlc complains about.
1127 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 1128 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 1129 as __STDC__.
4d7aa45e
PE
1130 * data/yacc.c (YYMODERN_C): New macro, which also looks at
1131 __STDC_VERSION__. Use it everywhere instead of looking at
1132 __STDC__ and __cplusplus.
4f6e011e 1133
a1b3bf8c
AD
11342005-10-10 Akim Demaille <akim@epita.fr>
1135
1136 * examples/calc++/test: Be quiet unless VERBOSE.
1137
412e44aa
PE
11382005-10-05 Paul Eggert <eggert@cs.ucla.edu>
1139
2a4647a3
PE
1140 * data/c.m4 (yydestruct, yysymprint):
1141 Use YYUSE instead of casting to void.
1142 * data/glr.c (YYUSE): New macro.
1143 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
1144 Use it instead of rolling our own.
1145 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
1146 (YYCHK1):
1147 Use /*CONSTCOND*/ to suppress lint warnings.
1148 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
1149 (YY_STACK_PRINT): Use 'false' not '0'.
1150 (YYUSE): New macro.
1151 (yysymprint_, yydestruct_): Use it instead of rolling our own.
1152 * data/yacc.c (YYUSE): New macro.
1153 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
1154 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
1155 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
1156
1157
412e44aa
PE
1158 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
1159 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
1160
88c6637f
PE
11612005-10-04 Paul Eggert <eggert@cs.ucla.edu>
1162
2f4f028d
PE
1163 Undo the parts of the unlocked-I/O change that substituted
1164 putc or puts for printf. This might hurt performance a bit,
1165 but some people prefer the printf style.
1166 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
1167 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
1168 All uses replaced by YYFPRINTF and YYDPRINTF.
1169 * data/yacc.c: Likewise.
1170 * lib/bitset.c (bitset_print): Likewise.
1171 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
1172 putc and puts.
1173 * lib/lbitset.c (debug_lbitset): Likewise.
1174 * src/closure.c (print_firsts, print_fderives): Likewise.
1175 * src/gram.c (grammar_dump): Likewise.
1176 * src/lalr.c (look_ahead_tokens_print): Likewise.
1177 * src/output.c (escaped_output): Likewise.
1178 (user_actions_output): Break apart two printfs.
1179 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
1180 * src/reduce.c (reduce_print): Likewise.
1181 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
1182 * src/system.h: Include unlocked-io.h rathe than stdio.h.
1183
88c6637f
PE
1184 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
1185 Use assignments rather than casts-to-void to suppress
1186 unused-variable warnings. This pacifies 'lint'.
1187 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
1188 unused-variable warnings.
1189
fb32e373
JMG
11902005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1191
1192 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
1193
edb8f44f
PE
11942005-10-02 Paul Eggert <eggert@cs.ucla.edu>
1195
fb9c0b33
PE
1196 Use unlocked I/O for a minor performance improvement on hosts like
1197 GNU/Linux and Solaris that support unlocked I/O. The basic idea
1198 is to use the gnlib unlocked-io module, and to prefer putc and
1199 puts to printf when either will work (since the latter doesn't
1200 come in an unlocked flavor).
1201 * bootstrap (gnulib_modules): Add unlocked-io.
1202 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
1203 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
1204 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
1205 and similarly for puts and putc and printf.
1206 * data/yacc.c: Likewise.
1207 * lib/bitset.c (bitset_print): Likewise.
1208 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
1209 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
1210 to printf.
1211 * lib/lbitset.c (debug_lbitset): Likewise.
1212 * src/closure.c (print_firsts, print_fderives): Likewise.
1213 * src/gram.c (grammar_dump): Likewise.
1214 * src/lalr.c (look_ahead_tokens_print): Likewise.
1215 * src/output.c (escaped_output): Likewise.
1216 (user_actions_output): Coalesce two printfs.
2f4f028d 1217 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
1218 * src/reduce.c (reduce_print): Likewise.
1219 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 1220 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 1221
edb8f44f
PE
1222 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
1223 this confuses xgettext.
1224
b50d2359
AD
12252005-10-02 Akim Demaille <akim@epita.fr>
1226
1227 * bootstrap (gnulib_modules): Add strverscmp.
1228 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
1229 * m4/.cvsignore: Add strverscmp.m4.
1230 * src/parse-gram.y (%require): New token, new rule.
1231 (version_check): New.
1232 * src/scan-gram.l (%require): Adjust.
1233 * tests/input.at (AT_REQUIRE): New.
1234 Use it.
1235 * doc/bison.texinfo (Require Decl): New.
1236 (Calc++ Parser): Use %require.
1237
21667f64
AD
12382005-10-02 Akim Demaille <akim@epita.fr>
1239
1240 * data/location.cc: New.
1241
2b81e969
AD
12422005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
1243 Akim Demaille <akim@epita.fr>
1244
1245 Make sure -odir/foo.cc creates dir/location.hh etc.
1246 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
1247 (spec_file_prefix, spec_verbose_file, spec_graph_file)
1248 (spec_defines_file): Now const.
1249 (dir_prefix): New.
1250 (short_base_name): Remove.
1251 * src/files.c: Adjust.
1252 (dirname.h): Include.
1253 (base_name): Don't prototype it.
1254 (finput): Remove, duplicates gram_in.
1255 (full_base_name, short_base_name): Replace by...
1256 (all_but_ext, all_but_tab_ext): these.
1257 (compute_base_names): Rename as...
1258 (compute_file_name_parts): this.
1259 Update to compute the new variables, including dir_prefix.
1260 Adjust dependencies.
1261 * src/output.c (prepare): Output them.
1262 * src/reader.c: Adjust to use gram_in, not finput.
1263 * src/scan-skel.l (@dir_prefix@): New.
1264
ad6a9b97
JMG
12652005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1266
1267 * lib/subpipe.c: New function end_of_output_subpipe() added
1268 to allow support for non-posix systems. This is a no-op function
1269 for posix systems.
1270
1271 * lib/subpipe.h: New function end_of_output_subpipe() added
1272 to allow support for non-posix systems. This is a no-op function
1273 for posix systems.
1274
1275 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
1276 handle the lack of pipe/fork functionality on non-posix systems.
1277
1278 * djgpp/Makefile.maint: DJGPP specific file.
1279
1280 * djgpp/README.in: DJGPP specific file.
1281
1282 * djgpp/config.bat: DJGPP specific configuration file.
1283
1284 * djgpp/config.sed: DJGPP specific configuration file.
1285
1286 * djgpp/config.site: DJGPP specific configuration file.
1287
1288 * djgpp/config_h.sed: DJGPP specific configuration file.
1289
1290 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
1291
1292 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
1293
fc695704
AD
12942005-10-02 Akim Demaille <akim@epita.fr>
1295
1296 * data/location.cc: New, extract from...
1297 * data/lalr1.cc: here.
1298 (location.hh): Include it after the user prologue, in case the
1299 filename type is defined by the user.
1300 Forward declation location and position before the pre-prologue.
1301 (yyresult_): Rename as...
1302 (yyresult): this, it's a local variable, not an attribute.
1303 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
1304
13052005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
1306
1307 * examples/extexi: Restore the #line generation.
1308
fb9712a9
AD
13092005-09-30 Akim Demaille <akim@epita.fr>,
1310 Alexandre Duret-Lutz <adl@gnu.org>
1311
1312 Move the token type and YYSTYPE in the parser class.
1313 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
1314 (parser::token): New, from the moved free definition of tokens.
1315 (parser::semantic_value): Now a full definition instead of an
1316 indirection to YYSTYPE.
1317 (b4_post_prologue): No longer included in the header file, but
1318 in the implementation file.
1319 * doc/bison.texi (C+ Language Interface): Update.
1320 * src/parse-gram.y: Support unary %define.
1321 * tests/actions.at: Define global_tokens_and_yystype for backward
1322 compatibility until we update the tests.
1323 * tests/calc.at: Idem.
1324 (first_line, first_column, last_line, last_column): Define for lalr1.cc
1325 to simplify the code.
1326
55f0c7b1
PE
13272005-09-29 Paul Eggert <eggert@cs.ucla.edu>
1328
1329 Port to SunOS 4.1.4, which lacks strtoul and strerror.
1330 Ah, the good old days! Problem reported by Peter Klein.
1331 * bootstrap (gnulib_modules): Add strerror, strtoul.
1332 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
1333 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
1334
fb9712a9 13352005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
1336
1337 * data/c.m4 (b4_error_verbose_if): New.
1338 * data/lalr1.cc: Use it.
1339 (YYERROR_VERBOSE_IF): Remove.
1340 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
1341 parser members, replaced by...
1342 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
1343 local variables.
1344 (yysyntax_error_): Takes the state number as argument.
1345 (yyreduce_print_): Use the argument yyrule, not the former
1346 attribute yyn_.
1347
8a6f72f3
PE
13482005-09-26 Paul Eggert <eggert@cs.ucla.edu>
1349
1350 * bootstrap (gnulib_modules): Add verify.
1351 * lib/.cvsignore: Add verify.h.
1352 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
1353 * src/system.h (verify): Remove.
1354 Include verify.h instead.
1355 * src/tables.c (tables_generate): Use new API for 'verify'.
1356
0d50976f
PE
13572005-09-21 Paul Eggert <eggert@cs.ucla.edu>
1358
ebc3737e
PE
1359 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
1360 local variables whose names begin with 'yy'.
1361 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
1362 Trivial changes from Joel E. Denny.
1363
0d50976f
PE
1364 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
1365 it itself.
1366 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
1367 don't use alloca any more.
1368
1369 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
1370 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 1371 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
1372 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
1373 to match yacc.c, to test more hosts.
1374
a05b79df
PE
13752005-09-20 Paul Eggert <eggert@cs.ucla.edu>
1376
55289366
PE
1377 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
1378 doesn't affect behavior.
1379 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
1380 Solaris, AIX, MSC.
1381 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
1382 This works a bit better with glibc, if user code has already included
1383 stdlib.h.
1384 * doc/bison.texinfo (Bison Parser): Document that users can't
1385 arbitrarily use malloc and free for other purposes. Document
1386 that <alloca.h> and <malloc.h> might be included.
1387 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
1388 user must declare alloca.
1389
a05b79df
PE
1390 * HACKING (release): Forwarn the Translation Project about
1391 stable releses.
1392
3ab2ca22
AD
13932005-09-20 Akim Demaille <akim@epita.fr>
1394
1395 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
1396
a9739e7c
PE
13972005-09-19 Paul Eggert <eggert@cs.ucla.edu>
1398
a702593e
PE
1399 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
1400 (YYSTACK_ALLOC_MAXIMUM): Use it.
1401 (yysyntax_error): New function.
1402 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
1403 multiple syntax errors are reported, and alloca is being used.
1404 Instead, reallocate buffers twice as big each time, so that
1405 we waste at most half the allocated memory. Start with a small
1406 (128-byte) buffer that will suffice in most cases anyway.
1407 Use yysyntax_error to do most of the work.
1408
1409 * doc/bison.texinfo (Error Reporting, Table of Symbols):
1410 yynerrs is the number of errors reported, not the number of
1411 errors encountered.
1412
a9739e7c
PE
1413 * tests/glr-regression.at (Duplicated user destructor for lookahead):
1414 Mark it as expected to fail.
1415 Cast result of malloc; problem reported by twlevo@xs4all.nl.
1416 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
1417 Don't start user-code symbols with "yy", to avoid name space problems.
1418
f479c6c6
AD
14192005-09-19 Akim Demaille <akim@epita.fr>
1420
1421 Remove the traits, failed experiment.
1422 It never proved useful, and anyway because of the current
1423 definition, it was not possible to have several specialization of
1424 this traits, making it useless.
1425 * data/lalr1.cc (yy:traits): Remove.
1426 Inline its definitions in the parser class.
1427
e2586f82
AD
14282005-09-19 Akim Demaille <akim@epita.fr>
1429
1430 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
1431 least Mac OSX with a /usr/local install of gettext.
1432
2e8cf949
AD
14332005-09-19 Akim Demaille <akim@epita.fr>
1434
1435 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
1436 and yytoken for similarity with the other skeletons.
1437
c7fb0b90
AD
14382005-09-19 Akim Demaille <akim@epita.fr>
1439
4e26c69e 1440 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 1441
1bd0deda
PE
14422005-09-16 Paul Eggert <eggert@cs.ucla.edu>
1443
1444 * NEWS: Version 2.1.
1445
1446 * NEWS: Remove notice of yytname change, since it was never in an
1447 official release.
1448 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
1449 diagnostic.
1450 * src/output.c (prepare): Likewise.
1451 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
1452 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
1453 is not defined. This is an awful hack, but it's enough for now.
1454 All callers changed.
1455 * tests/glr-regression-at (make_value): Args are const pointers now,
1456 to avoid GCC warning.
1457 (Duplicated user destructor for lookahead): New test. Currently
1458 skipped. It fails on my host but I'm not sure it'll always fail.
1459
14602005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
1461
1462 * src/symtab.h (struct symbol): Declare the printer and destructor
1463 as const, to avoid accidental calls to free.
1464 (symbol_destructor_set, symbol_printer_set): Adjust.
1465 * src/symtab.c: Adjust.
1466
1bd0deda 14672005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
1468
1469 * data/c.m4 (b4_token_enums): New.
1470 (b4_token_defines): Rename as...
1471 (b4_token_enums_defines): this.
1472 (b4_token_defines): New, output only the #defines.
1473 * data/yacc.c, data/glr.c: Adjust.
1474 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
1475 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
1476 as default values.
1477
dbcdae2d
AD
14782005-09-16 Akim Demaille <akim@epita.fr>
1479
1480 * data/lalr1.cc (yylex_): Remove, inline its code.
1481 (yyreport_syntax_error_): Remove, replaced by...
1482 (yysyntax_error_): this which returns a string and leaves to the
1483 caller the call to the users' error function.
1484 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
1485 Move from members of the parser object...
1486 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
1487 to local variables of the parse function.
1488
70d8f291
AD
14892005-09-16 Akim Demaille <akim@epita.fr>
1490
1491 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
1492 since it's in Bison's name space.
1493
b47dbebe
PE
14942005-09-15 Paul Eggert <eggert@cs.ucla.edu>
1495
ae199bf1
PE
1496 * data/glr.c (yyresolveValue): Add default case to pacify
1497 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
1498
b47dbebe
PE
1499 * NEWS: Document when yyparse started to return 2.
1500 * doc/bison.texinfo (Parser Function): Document when yyparse
1501 returns 2.
1502
1503 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
1504 (b4_filename_type): Renamed back from b4_file_name_type. All uses
1505 changed.
1506 (class position): file_name -> filename (reverting). All uses changed.
1507
15082005-09-14 Paul Eggert <eggert@cs.ucla.edu>
1509
1510 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
1511 do anything if $@ exists. This reverts part of the 2005-07-07
1512 patch.
1513
00292f66
PE
15142005-09-11 Paul Eggert <eggert@cs.ucla.edu>
1515
1516 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
1517 contains obsolete information and isn't worth distributing as a
1518 separate file anyway.
1519 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
1520 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
1521 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
1522 (yyparse): Abort if user code uses longjmp to throw an unexpected
1523 value.
1524
a420f962
PE
15252005-09-09 Paul Eggert <eggert@cs.ucla.edu>
1526
00292f66
PE
1527 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
1528 Suggested by twlevo@xs4all.nl.
1529
127287e9
PE
1530 * data/glr.c (YYCHK1): Do not assume YYE is in range.
1531 This avoids a diagnostic from gcc -Wswitch-enum.
1532 Problem reported by twlevo@xs4all.nl.
1533
a420f962
PE
1534 * doc/bison.texinfo: Don't use "filename", as per GNU coding
1535 standards. Use "file name" or "file" or "name", depending on
1536 the context.
1537 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
1538 not to hack/foo.tab.c.
1539 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
1540 * data/glr.c: b4_filename -> b4_file_name.
1541 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
1542 All uses changed.
1543 (class position): filename -> file_name. All uses changed.
1544 * data/yacc.c: b4_filename -> b4_file_name.
1545 * lib/bitset.h: filename -> file_name in local vars.
1546 * lib/bitset_stats.c: Likewise.
1547 * src/files.c: Likewise.
1548 * src/scan-skel.l ("@output ".*\n): Likewise.
1549 * src/files.c (file_name_split): Renamed from filename_split.
1550 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
1551
15522005-09-08 Paul Eggert <eggert@cs.ucla.edu>
1553
1554 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
1555 to accommodate latest gnulib.
1556
1557 * tests/glr-regression.at (Duplicate representation of merged trees):
1558 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
1559
1560 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
1561 needed.
1562
42a6501d
PE
15632005-08-26 Paul Eggert <eggert@cs.ucla.edu>
1564
1565 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
1566 All uses changed. Invoke user destructor after an error during a
1567 split parse (trivial change from Joel E. Denny).
1568
1569 * tests/glr-regression.at
1570 (User destructor after an error during a split parse): New test case.
1571 Problem reported by Joel E. Denny in:
1572 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
1573
ef9a1faf
PE
15742005-08-25 Paul Eggert <eggert@cs.ucla.edu>
1575
5b4aaf78
PE
1576 * README-cvs: Give URLs for recommended tools.
1577 Mention Gzip version problem, and bootstrapping issues.
1578 Remove troubleshooting section, as it's somewhat obsolete.
1579
b5240ba5
PE
1580 * bootstrap (no_cache): New var, to accommodate different wget
1581 variants. Use it instead of '-C off'. Problem reported by
1582 twlevo@xs4all.nl.
1583
ef9a1faf
PE
1584 * data/glr.c (yydestroyStackItem): New function.
1585 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
1586 debugging information. Problem reported by Joel E. Denny.
1587
e6efa9da
AD
15882005-08-25 Akim Demaille <akim@epita.fr>
1589
1590 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
1591
adc90f13
PE
15922005-08-24 Paul Eggert <eggert@cs.ucla.edu>
1593
1594 * data/glr.c (yyrecoverSyntaxError, yyreturn):
1595 Don't invoke destructor on unresolved entries.
1596 * tests/glr-regression.at
1597 (User destructor for unresolved GLR semantic value): New test case.
1598 Problem reported by Joel E. Denny in:
1599 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
1600
f9315de5
PE
16012005-08-21 Paul Eggert <eggert@cs.ucla.edu>
1602
15d29c1f
PE
1603 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
1604 Add strnlen.c.
1605 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
1606 lib-prefix.m4, po.m4.
1607
dd5f2af2
PE
1608 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
1609 in yydestruct diagnostic, since it might not be an error.
1610 Problem reported by Joel Denny near end of
1611 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 1612 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
1613 * data/yacc.c (yyreturn): Likewise.
1614 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
1615
1616 * src/files.c: Remove obsolete FIXME comment.
1617
1618 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
1619 with the other templates, and to fix bogus run-on messages such
1620 as the one reported at the end of
1621 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
1622 All callers changed to avoid the newline.
1623 (yyprocessOneStack): Output two lines rather than one, to accommodate
1624 the above change. This changes the debug output format slightly.
1625
f9315de5
PE
1626 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
1627 reported by Joel E. Denny in
1628 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
1629 (trivial change).
1630 * tests/glr-regression.at (Duplicate representation of merged trees):
1631 New test, from Joel E. Denny in:
1632 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
1633 * THANKS: Add Joel E. Denny.
1634
1635 * configure.ac (AC_INIT): Bump to 2.0c.
1636
04098407
PE
16372005-07-24 Paul Eggert <eggert@cs.ucla.edu>
1638
1639 * NEWS: Version 2.0b.
1640
ca5d2013
PE
1641 * Makefile.am (SUBDIRS): Put examples before tests, so that
1642 "make check" doesn't finish with "All 1 tests passed".
1643
3d54b576
PE
1644 * tests/regression.at (Token definitions): Don't rely on
1645 AT_PARSER_CHECK for data that contains backslashes. It currently
1646 uses 'echo', and 'echo' isn't portable if its argument contains
1647 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
1648 that the byte '\0xff' is not printable in the C locale; it is,
1649 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
1650 not printable, so use '\0x81' to test.
1651
d53ae497
PE
1652 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
1653 version of GCC, since the macro is used with non-GCC compilers.
1654
fc01665e
PE
1655 Fix core dump reported by Pablo De Napoli in
1656 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
1657 * tests/regression.at (Invalid inputs with {}): New test.
1658 * src/parse-gram.y (token_name): Translate type before using
1659 it as an index.
1660
04098407
PE
1661 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
1662 the user's name space. All uses changed to __attribute__
1663 ((__unused__)).
1664 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
1665 Add __attribute__ ((__noreturn__)).
1666
1667 * etc/clcommit: Remove. We weren't using it, and it failed
1668 "make maintainer-distcheck".
1669 * Makefile.maint: Merge from coreutils.
1670 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
1671 (syntax-check-rules): Change list of rules as described below.
1672 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
1673 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
1674 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
1675 (sc_trailing_space): New rules.
1676 (sc_xalloc_h_in_src): Remove.
1677 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
1678 (sc_space_tab, sc_error_exit_success, sc_changelog):
1679 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
1680 (makefile-check, po-check, author_mark_check):
1681 (makefile_path_separator_check, copyright-check):
1682 Use grep -n, to make it easier to find violations.
1683 Use CVS_LIST and CVS_LIST_EXCEPT.
1684 (header_regexp, h_re): Remove.
1685 (dd_c): New macro.
1686 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
1687 (my-distcheck): Use more-modern GCC flags.
1688 (signatures, %.asc): Remove.
1689 (rel-files, announcement): Remove signatures.
1690 Restore old updating code, even though we don't use it, so
1691 that we're the same as coreutils.
1692 (alpha, beta, major): Depend on news-date-check.
1693 Make the upload commands.
1694
1695 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
1696 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
1697 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
1698 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
1699 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
1700 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
1701 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
1702 * tests/sets.at: Likewise.
1703
1704 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
1705 we comment out the Autoconf version number.
1706 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
1707 it's error-prone and "make maintainer-distcheck" rejects it.
1708
1709 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
1710 Indent calls to "error" to pacify "make maintainer-distcheck",
1711 when the calls are not intended to be translated.
1712 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
1713
1714 * src/Makefile.am (DEFS): Use +=, to pacify
1715 "make maintainer-distcheck".
1716 (bison_SOURCES): Add scan-skel.h.
1717 (sc_tight_scope): New rule, from coreutils.
1718
1719 * src/files.c (src_extension, header_extension):
1720 Now static, not extern.
1721 * src/getargs.c (short_options): Likewise.
1722 * src/muscle_tab.c (muscle_table): Likewise.
1723 * src/parse-gram.y (current_class, current_type, current_prec):
1724 Likewise.
1725 * src/reader.c (grammar_end, previous_rule_end): Likewise.
1726 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
1727 * src/main.c (main): Cast bindtextdomain and textdomain calls to
1728 void, to avoid warning when NLS is disabled.
1729 * src/output.c: Include scan-skel.h.
1730 (scan_skel): Remove decl, since scan-skel.h does this.
1731 (output_skeleton):
1732 Indent calls to "error" to pacify "make maintainer-distcheck".
1733 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
1734 * src/reader.h (gram_end, gram_lineno): New decls to pacify
1735 "make maintainer-distcheck".
1736 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
1737 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
1738 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
1739 (skel_lex_destroy, scan_skel): Move these decls to...
1740 * src/scan-skel.h: New file.
1741 * src/uniqstr.c (uniqstr_assert):
1742 Indent calls to "error" to pacify "make maintainer-distcheck".
1743
1744 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
1745 not @VAR@.
1746
1747 * tests/torture.at: Revamp to avoid misuse of atoi that
1748 "make maintainer-distcheck" complained about.
1749
1750 * examples/extexi (message): Don't print a message more than once,
1751 and omit line-number decoration that makes Emacs compile think
1752 that informative messages are worth worrying about.
1753
17542005-07-22 Paul Eggert <eggert@cs.ucla.edu>
1755
1756 * configure.ac: Update version number.
1757
1758 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
1759 accidentally.
1760 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
1761 autogenerated by the maintainer.
1762 * examples/calc++/.cvsignore: Add *.yy.
1763
1764 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
1765 * lib/bitset_stats.c (bitset_stats_init): Likewise.
1766 * lib/bitsetv.c (bitsetv_alloc): Likewise.
1767
1768 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
1769
1770 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
1771 from maintainer-distcheck about casting the argument of 'free'.
1772
1773 * NEWS: Mention recent yytname changes.
1774 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
1775
1776 * bootstrap: For translations that have not yet been upgraded to
1777 the new runtime-po domain, prime the pump by extracting the
1778 relevant strings from the obsolete translations. This code can be
1779 removed once the bison-runtime domain has been translated by each
1780 team.
1781
1782 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
1783 now that token names are already quoted.
1784
1785 Fix problem reported by Anthony Heading.
1786 * data/glr.c (YYTOKEN_TABLE): New macro.
1787 (yytname): Define if YYTOKEN_TABLE.
1788 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
1789 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
1790 (YYERROR_VERBOSE): Define the same way the other skeletons do.
1791 * src/output.c (prepare_symbols): Output token_table_flag.
1792
0ffda363
PE
17932005-07-21 Paul Eggert <eggert@cs.ucla.edu>
1794
1795 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
1796 again if the first call fails.
1797
1798 * data/glr.c (yytnamerr): New function.
1799 (yyreportSyntaxError): Use it to dequote most string literals.
1800 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
1801 with other skeletons. All uses changed.
1802 (yytnameerr_): New function.
1803 (yyreport_syntax_error): Use it to dequote most string literals.
1804 * data/yacc.c (yytnamerr): New function.
1805 (yyerrlab): Use it to decode most string literals.
1806 * doc/bison.texinfo (Decl Summary, Calling Convention):
1807 Clarify quoting convention of yytname.
1808 * src/output.c (prepare_symbols): Quote all names. This undoes
1809 the 2005-04-17 change, which is now accomplished (mostly) via
1810 changes in the parsers as described above.
1811 * tests/regression.at (Token definitions, Web2c Actions):
1812 Undo most 2005-04-17 change here, too.
1813
18142005-07-20 Paul Eggert <eggert@cs.ucla.edu>
1815
1816 Fix more problems reported by twlevo@xs4all.nl.
1817 * tests/cxx-type.at: Don't pipe output of ./types through sed to
1818 remove trailing spaces. This loses the exit status of ./types,
1819 and isn't needed since ./types shouldn't be emitting trailing
1820 spaces.
1821 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
1822 as the stack isn't valid in that case.
1823
1824 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
1825 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
1826 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
1827 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
1828 is used.
1829 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
1830 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
1831 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
1832 Likewise.
1833
1834 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
1835 overly-picky compilers that reject 'char *foo = "bar";'.
1836
1837 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
1838 to FILE * parameter, not to stderr. This fixes a typo introduced
1839 in the 2005-07-12 change.
1840
1841 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
1842 warnings from GCC 4.
1843
1844 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
1845 (yyglrShiftDefer, yysplitStack):
1846 Remove unused parameters b4_pure_formals. All uses changed.
1847 (yyglrShift): Remove unused parameters b4_user_formals.
1848 All uses changed.
1849 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
1850
6100a9aa
PE
18512005-07-18 Paul Eggert <eggert@cs.ucla.edu>
1852
258b75ca
PE
1853 Destructor cleanups and regularization among the three skeletons.
1854 * NEWS: Document the behavior changes.
1855 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
1856 stack before failing, as the cleanup code will do it for us now.
1857 * data/lalr1.cc (yyerrlab): Likewise.
1858 * data/glr.c (yyparse): Pop everything off the stack before
1859 freeing it, so that destructors get called properly.
1860 * data/lalr1.cc (yyreturn): Likewise.
1861 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
1862 This is more consistent.
1863 * doc/bison.texinfo (Destructor Decl): Mention more reasons
1864 why destructors might be called. 1.875 -> 2.1.
1865 (Destructor Decl, Decl Summary, Table of Symbols):
1866 Some English-language cleanups for %destructor.
1867 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
1868 Add output line for destructor of start symbol.
1869 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
1870 because of that same extra output line.
1871
1a059451
PE
1872 * NEWS: Document minor wording changes in diagnostics of
1873 Bison-generated parsers.
1874 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
1875 Remove unused formals. All uses changed.
1876 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
1877 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
1878 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
1879 Rename yyoverflowab to yyexhaustedlab.
1880 When memory exhaustion occurs during syntax-error reporting,
1881 report it separately rather than in a single diagnostic; this
1882 eases translation.
1883 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
1884 (Memory Exhausted): Renamed from Parser Stack Overflow.
1885 Revamp wording slightly to prefer "memory exhaustion".
1886 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
1887
97460c78
PE
1888 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
1889
30757c8c
PE
1890 Add i18n support to the GLR skeleton. Partially fix the C++
1891 skeleton; a C++ expert needs to finish this. Remove debugging
1892 msgids; there's little point to having them translated, since they
1893 can be understood only by someone who can read the
1894 (English-language) source code.
1895
1896 Generate runtime-po/bison-runtime.pot automatically, so that we
1897 don't have to worry about garbage getting in that file. We'll
1898 make sure after the next official release that old msgids don't
1899 get lost. See
1900 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
1901
1902 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
1903 Now auto-generated.
1904 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
1905 Fix typos in explanations of the runtime file.
1906 * bootstrap: Change gettext keyword from YYI18N to YY_.
1907 Use standard Makefile.in.in in runtime-po, since we'll arrange
1908 for backward-compatible bison-runtime.po files in a different way.
1909 * data/glr.c (YY_): New macro, from yacc.c.
1910 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
1911 Translate messages intended for users.
1912 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
1913 the wording in the other skeletons. We don't know that the memory
1914 is virtual.
1915 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
1916 Use same method that yacc.c uses.
1917 Don't translate debugging messages.
1918 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
1919 it doesn't work (yet), and requires C++ expertise to fix.
1920 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
1921 Move defn to a more logical place, to be consistent with other
1922 skeletons.
1923 Don't translate debugging messages.
1924 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
1925 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
1926 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
1927 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
1928
ac8c5689
PE
1929 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
1930 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
1931 void, not int.
1932 * tests/glr-regression.at (Badly Collapsed GLR States):
1933 Likewise.
1934 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
1935 yylex should return 0 at EOF rather than aborting.
1936
6100a9aa
PE
1937 Improve tests for stack overflow in GLR parser.
1938 Problem reported by twlevo@xs4all.nl.
1939 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
1940 All uses removed.
1941 (yyStackOverflow): Just longjmp, but with value 2 so that caller
1942 can handle the problem.
1943 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
1944 (yyparse): New local variable yyresult to record the result.
1945 Use result of setjmp to set it, rather than storing itinto
1946 struct.
1947 (yyDone): Remove label.
1948 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
1949 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
1950 if YYABORT is used).
1951 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
1952 yyparse status; put status > 1 into diagnostic.
1953 Check that status==2 works.
1954 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
1955 Use exit status 3 for failure to open (which shouldn't happen).
1956
15f40952
PE
19572005-07-17 Paul Eggert <eggert@cs.ucla.edu>
1958
67fd79c4
PE
1959 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
1960 1 on syntax error; just let yyparse do its thing.
1961 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
1962 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
1963 (Exploding the Stack Size with Alloca):
1964 (Exploding the Stack Size with Malloc):
1965 Expect exit status 2, not 1, since the parser is supposed to blow
1966 its stack. Problem reported by twlevo@xs4all.nl.
1967
15f40952
PE
1968 * data/glr.c (yyparse): Don't assume that the initial calls
1969 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
1970 Print a stack-overflow message and fail instead.
1971 Initialize the line-number information before creating the stack,
1972 so that the stack-overflow message can report line zero safely.
1973
f32c66b5
PE
19742005-07-14 Paul Eggert <eggert@cs.ucla.edu>
1975
a22ff96f 1976 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
1977 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
1978 (yyuserMerge): Provide a default case if b4_mergers is empty.
1979 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
1980 * tests/glr-regression.at
1981 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 1982 Add casts to pacify C++ compilers.
1beb0b24
PE
1983 * tests/glr-regression.at (Improper merging of GLR delayed action
1984 sets): Declare yylex before using it.
f32c66b5 1985 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
1986 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
1987 test for valgrind; valgrind is independent of g++.
1988 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
1989 for compatibility with POSIX 1003.1-2001 (if running coreutils).
1990 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
1991 Use a destructor, so that we can expand the stack. Change
1992 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 1993
d741bd1b
PE
19942005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
1995
1996 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
1997 a valgrind failure. Problem reported by twlevo@xs4all.nl.
1998
0410a6e0
PE
19992005-07-13 Paul Eggert <eggert@cs.ucla.edu>
2000
2001 * PACKAGING: New file, suggested by Bruno Haible and taken from
2002 similar wording in gettext's PACKAGING file.
2003 * NEWS: Mention PACKAGING.
2004 * Makefile.am (EXTRA_DIST): Add PACKAGING.
2005
f7ab6a50
PE
20062005-07-12 Paul Eggert <eggert@cs.ucla.edu>
2007
baf785db 2008 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
2009 * bootstrap: Get runtime translations into runtime-po.
2010 Create runtime-po files automatically, if possible.
2011 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
2012 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
2013 does not infringe on the user's name space.
2014 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
2015 * doc/bison.texinfo (Internationalization): Revamp the English
2016 and Texinfo syntax a bit, to try to make it clearer.
2017 (Bison Options, Option Cross Key): Mention --print-localedir.
2018 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
2019 YYENABLE_NLS. Quote a bit more.
2020 * runtime-po/.cvsignore: New file.
2021 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
2022 * runtime-po/Rules-quot: Remove; now created by bootstrap.
2023 * runtime-po/quot.sed: Likewise.
2024 * runtime-po/boldquot.sed: Likewise.
2025 * runtime-po/en@quot.header: Likewise.
2026 * runtime-po/en@boldquot.header: Likewise.
2027 * runtime-po/insert-header.sin: Likewise.
2028 * runtime-po/remove-potcdate.sin: Likewise.
2029 * runtime-po/Makevars: Likewise.
2030 * runtime-po/LINGUAS: Likewise.
2031 * runtime-po/de.po: Likewise; we will rely on the translation project
2032 to maintain this, so "bootstrap" should get it.
0410a6e0 2033 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
2034 its value.
2035 * src/main.c (main): Bind the bison-runtime domain, too.
2036
20372005-07-12 Bruno Haible <bruno@clisp.org>
2038
2039 * data/yacc.c: Include <libintl.h> when NLS is enabled.
2040 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
2041 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
2042 * runtime-po: New directory.
2043 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
2044 $(DOMAIN).pot-update rule, so that old messages are never dropped.
2045 * runtime-po/Rules-quot: New file, copied from po/.
2046 * runtime-po/quot.sed: Likewise.
2047 * runtime-po/boldquot.sed: Likewise.
2048 * runtime-po/en@quot.header: Likewise.
2049 * runtime-po/en@boldquot.header: Likewise.
2050 * runtime-po/insert-header.sin: Likewise.
2051 * runtime-po/remove-potcdate.sin: Likewise.
2052 * runtime-po/Makevars: New file.
2053 * runtime-po/POTFILES.in: New file.
2054 * runtime-po/LINGUAS: New file.
2055 * runtime-po/bison-runtime.pot: New file.
2056 * runtime-po/de.po: New file.
2057 * m4/bison.m4: New file.
2058 * Makefile.am (SUBDIRS): Add runtime-po.
2059 (aclocaldir, aclocal_DATA): New variables.
2060 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
2061 Define aclocaldir.
2062 * src/getargs.c (usage): Document --print-localedir option.
2063 (PRINT_LOCALEDIR_OPTION): New enum item.
2064 (long_options): Add --print-localedir option.
2065 (getargs): Handle --print-localedir option.
2066 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
2067 (Internationalization): New section.
2068
22dda0f0
AD
20692005-07-12 Akim Demaille <akim@epita.fr>
2070
2071 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
2072 for consistency with the rest of the code.
2073 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
2074 Add separators.
2075
82b248ad
AD
20762005-07-12 Akim Demaille <akim@epita.fr>
2077
2078 * src/parse-gram.y: Use %printer instead of YYPRINT.
2079
fa0e9314
AD
20802005-07-12 Akim Demaille <akim@epita.fr>
2081
867a3e00
AD
2082 * src/symtab.h, src/symtab.c (symbol_print): New.
2083 * src/symlist.h, src/symlist.c (symbol_list_print): New.
2084 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
2085
20862005-07-12 Akim Demaille <akim@epita.fr>
2087
2088 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
2089 b4_at_dollar and b4_dollar_dollar.
2090
e054b190
PE
20912005-07-11 Paul Eggert <eggert@cs.ucla.edu>
2092
2093 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
2094 and Pennello's paper.
2095
34160ec4
PE
20962005-07-09 Paul Eggert <eggert@cs.ucla.edu>
2097
407d4a75
PE
2098 * data/yacc.c (yyparse): Undo previous patch. Instead,
2099 set yylsp[0] and yyvsp[0] only if the initial action
2100 sets yylloc and yylval, respectively.
2101
34160ec4
PE
2102 * data/yacc.c (yyparse): In the initial action, set
2103 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
2104 This avoids the use of undefined variables if the initial
2105 action does not set yylloc and/or yylval.
2106
c3d5a4a7
PE
21072005-07-07 Paul Eggert <eggert@cs.ucla.edu>
2108
b34d96c1
PE
2109 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
2110 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
2111 Remove from CVS. These files are automatically generated.
2112 * examples/extexi: Clarify that this file is now part of Bison,
2113 not GNU M4, and that it works with any POSIX-compatible Awk.
2114 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
2115 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
2116 so that we also get calc++-parser.yy. Geneate it.
2117 Use $(AWK), not gawk, since any conforming Awk will do.
2118 Put comment before action, since older 'make' can't handle comment
2119 in action.
2120 $(BUILT_SOURCES): List all built sources, not just some of them.
2121 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
2122 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
2123 $($(calc_sources_generated)): Remove unnecessary test for existence
2124 of target. (This had a shell syntax error anyway; a stray "x".)
2125 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
2126 calc++-parser.yy.
2127 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
2128
c3d5a4a7
PE
2129 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
2130 implied by the other modules.
2131
828c373b
AD
21322005-07-06 Akim Demaille <akim@epita.fr>
2133
2134 Bind examples/calc++ to the package.
2135 * examples/calc++/Makefile: Remove, replaced by...
2136 * examples/calc++/Makefile.am: ... this new file.
2137 * examples/calc++/test: Remove input.
2138 * examples/calc++/compile: Remove.
2139 * examples/Makefile.am: New.
2140 * configure.ac, Makefile.am: Adjust.
2141 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
2142
63cb01d6
PE
21432005-07-05 Paul Eggert <eggert@cs.ucla.edu>
2144
fd2df2ed
PE
2145 * data/glr.c (yyFail): Drastically simplify; since the format argument
2146 never had any % directives, we can simply pass it to yyerror.
2147 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
2148 be modified later, as that is the usual style in glr.c.
2149 Problems reported by Paul Hilfinger.
2150
63cb01d6
PE
2151 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
2152 and size overflow errors.
2153 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
2154 in case the user prolog sets feature-test macros like _GNU_SOURCE.
2155 (YYSIZEMAX): New macro.
2156 (yystpcpy): New function, taken from yacc.c.
2157 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
2158 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
2159 so that we don't have to maintain their signatures.
2160 (yyFail): Check for buffer overflow, by using vsnprintf rather
2161 than vsprintf. Allocate a bigger buffer if possible.
2162 Report an error if buffer allocation fails.
2163 (yyStackOverflow): New function.
2164 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
2165 the initialization was successful. It might fail if storage was
2166 exhausted.
2167 (yyexpandGLRStack): Add more checks for storage allocation failure.
2168 Use yyStackOverflow to report failures.
2169 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
2170 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
2171 Don't assume stack number fits in int.
2172 (yysplitStack): Check for storage allocation failure.
2173 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
2174 can print diagnostics on storage allocation failure. All callers
2175 changed.
2176 (yyresolveValue): Use yybool for boolean.
2177 (yyreportSyntaxError): Check for size-calculation overflow.
2178 This code is taken from yacc.c.
2179 (yyparse): Check for storage allocation errors when allocating
2180 the initial stack.
2181
1c59e0a1
AD
21822005-07-05 Akim Demaille <akim@epita.fr>
2183
2184 Extract calc++ from the documentation.
2185 * doc/bison.texinfo (Calc++): Add the extraction marks.
2186 * examples/extexi: New, from the aborted GNU Programming 2E.
2187 Separate the different paragraph of a file with empty lines.
2188 * examples/Makefile: Use it to extract the whole calc++ example.
2189
8a0adb01
AD
21902005-06-24 Akim Demaille <akim@epita.fr>
2191
2192 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
2193 class typedefs.
2194
12545799
AD
21952005-06-22 Akim Demaille <akim@epita.fr>
2196
2197 * doc/bison.texinfo (C++ Language Interface): First stab.
2198 (C++ Parsers): Remove.
2199
99be0235
AD
22002005-06-22 Akim Demaille <akim@epita.fr>
2201
2202 * data/lalr1.cc (yylex_): Honor %lex-param.
2203
0ffd4fd1
AD
22042005-06-22 Akim Demaille <akim@epita.fr>
2205
2206 Start a set of simple examples.
2207 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
2208 * examples/calc++/calc++-driver.hh,
2209 * examples/calc++/calc++-parser.yy,
2210 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
2211 * examples/calc++/compile, examples/calc++/test: New.
2212
0925ebb4
PE
22132005-06-09 Paul Eggert <eggert@cs.ucla.edu>
2214
2215 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
2216 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
2217 which stems from the 2005-05-27 patch.
2218
43d3b664
PH
22192005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
2220
2221 * data/glr.c: Modify treatment of unused parameters to permit use
2222 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
2223
3062864d
PE
22242005-05-30 Paul Eggert <eggert@cs.ucla.edu>
2225
2226 Fix infringement on user name space reported by Janos Zoltan Szabo.
2227 * data/yacc.c (yyparse): strlen -> yystrlen.
2228
989b5b8e
AD
22292005-05-30 Akim Demaille <akim@epita.fr>
2230
2231 * data/lalr1.cc (_): New.
2232 Translate the various messages.
2233
bedf57f5
PE
22342005-05-27 Paul Eggert <eggert@cs.ucla.edu>
2235
2236 Fix infringement on user name space reported by Bruno Haible.
2237 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
2238 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
2239 the user's name space.
2240 (alloca): Include <stdlib.h> to get it, if it's not built in.
2241 (YYMALLOC, YYFREE): Define only if needed.
2242 (malloc, free): Declare, but only if needed, as this infringes on
2243 the user name space.
2244
4d1801f1
PE
22452005-05-25 Paul Eggert <eggert@cs.ucla.edu>
2246
2247 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
2248 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
2249 with %d format.
2250 * lib/ebitset.c (min, max): Undef before defining.
2251 * lib/vbitset.c (min, max): Likewise.
2252 * lib/subpipe.c (create_subpipe): Save local variables in case
2253 vfork clobbers them.
2254
22552005-05-24 Bruno Haible <bruno@clisp.org>
2256
2257 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
2258 error message syntax used by gcc-4.0.
2259
b94a9e1e
PE
22602005-05-23 Paul Eggert <eggert@cs.ucla.edu>
2261
85ac3861
PE
2262 * README: Mention m4 1.4.3. Remove obsolete advice about
2263 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
2264
b94a9e1e
PE
2265 * bootstrap: Remove workaround for problem I encountered with
2266 gettext 0.14.1; it seems to be fixed now.
2267
51c30d21
PE
22682005-05-22 Paul Eggert <eggert@cs.ucla.edu>
2269
009ce67d
PE
2270 * NEWS: Version 2.0a.
2271
f2a97c62
PE
2272 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
2273 the previous change.
2274
c8775f93
PE
2275 Various maintainer cleanups.
2276 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
2277 conftest*, for benefit of CVS commands run at the same time as
2278 "configure". Add build-aux, since "bootstrap" now creates it and
2279 its subfiles.
2280 * Makefile.cfg (move_if_change): Remove.
2281 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
2282 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
2283 (po_repo, do-po-update, po-update, wget_files, get-targets):
2284 (config.guess-url_prefix, config.sub-url_prefix):
2285 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
2286 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
2287 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
2288 Remove.
2289 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
2290 this is now the recommended name.
2291 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
2292 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
2293 ylwrap. These files now go into build-aux.
2294 * config/move-if-change: Remove.
2295 * config/prev-version.txt: Bump from 1.75 to 2.0.
2296
3ea5f0ec
PE
2297 * bootstrap: Add stdio-safer, unistd-safer modules.
2298 Remove m4/glibc2.m4 (introduced by latest gnulib, but
2299 we don't need it).
2300 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
2301 fopen-safer.c, stdio-safer.h, unistd-safer.h.
2302 * lib/subpipe.c: Include "unistd-safer.h".
2303 (create_subpipe): Make sure all the newly-created
2304 file descriptors are > 2, so that diagnostics don't
2305 get sent down them (which might cause Bison to hang, in theory).
2306 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
2307 * src/files.c (xfopen): Use fopen_safer, not fopen.
2308
51c30d21
PE
2309 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
2310 yesterday's yacc.c fix.
2311
cea1469d
PE
23122005-05-21 Paul Eggert <eggert@cs.ucla.edu>
2313
3ea5f0ec
PE
2314 * data/glr.c, data/lalr1.cc: Update copyright date.
2315
cea1469d
PE
2316 Fix a destructor bug reported by Wolfgang Spraul in
2317 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
2318 * data/yacc.c (yyabortlab): Don't call destructor, and
2319 don't set yychar to EMPTY.
2320 (yyoverflowlab): Don't call destructor.
2321 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
2322 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
2323 since we no longer output the message "discarding lookahead token
2324 end of input ()".
2325
5e6f62f2
PH
23262005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
2327
2328 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
2329 fix a small glitch in debugging output.
2330 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
2331 after YY_SYMBOL_PRINT where needed.
2332
2333 (struct yyGLRState): Add some comments.
2334 (struct yySemanticOption): Add some comments.
2335 (union yyGLRStackItem): Add comment.
2336
2337 (yymergeOptionSets): Correct this to properly perform the union,
2338 avoiding infinite reported by Michael Rosien.
2339 Update comment.
2340
2341 * tests/glr-regression.at: Add test for GLR merging error reported
2342 by M. Rosien.
cea1469d 2343
0fb669f9
PE
23442005-05-13 Paul Eggert <eggert@cs.ucla.edu>
2345
2346 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
2347 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
2348 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
2349 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
2350 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
2351 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
2352 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
2353 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
2354 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
2355 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
2356 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
2357 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
2358 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
2359 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
2360 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
2361 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
2362 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
2363 src/derives.h, src/files.c, src/files.h, src/getargs.c,
2364 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
2365 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
2366 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
2367 src/output.h, src/parse-gram.c, src/parse-gram.h,
2368 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
2369 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
2370 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
2371 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
2372 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
2373 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
2374 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
2375 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
2376 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
2377 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
2378 tests/reduce.at, tests/regression.at, tests/sets.at,
2379 tests/synclines.at, tests/testsuite.at, tests/torture.at:
2380 Update FSF postal mail address.
2381
51f4735e
PE
23822005-05-11 Paul Eggert <eggert@cs.ucla.edu>
2383
2384 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
2385 Problem reported by Ralf Menzel.
2386
80ce3401
PE
23872005-05-01 Paul Eggert <eggert@cs.ucla.edu>
2388
2389 * tests/actions.at: Test that stack overflow invokes destructors.
2390 From Marcus Holland-Moritz.
2391 * data/yacc.c (yyerrlab): Move the code that destroys the stack
2392 from here....
2393 (yyreturn): to here. That way, destructors are called properly
2394 even if the stack overflows, or the user calls YYACCEPT or
2395 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
2396 (yyoverflowlab): Destroy the lookahead.
2397
23982005-04-24 Paul Eggert <eggert@cs.ucla.edu>
2399
2400 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
2401
72f000b0
PE
24022005-04-17 Paul Eggert <eggert@cs.ucla.edu>
2403
2404 * NEWS: Bison-generated C parsers no longer quote literal strings
2405 associated with tokens.
2406 * src/output.c (prepare_symbols): Don't escape strings,
2407 since users don't want to see C escapes.
2408 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
2409 in diagnostics.
c19683bb 2410 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
2411 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
2412
1094323f
PE
24132005-04-16 Paul Eggert <eggert@cs.ucla.edu>
2414
2415 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
2416 the data size is known to be too small and we can't increase it.
2417 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
2418
ca407bdf
PE
24192005-04-15 Paul Eggert <eggert@cs.ucla.edu>
2420
2421 * src/parse-gram.y: Include quotearg.h.
2422 (string_as_id): Quote $1 before using it as a key, since the
2423 lexer no longer quotes it for us.
2424 (string_content): Don't strip quotes, since lexer no longer
2425 quotes it for us.
2426 * src/scan-gram.l: Include quotearg.h.
2427 ("\""): Omit quote.
2428 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
2429 a key, since the rest of the lexer doesn't quote it.
2430 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
2431 * tests/regression.at (Token definitions): Check for backslashes
2432 in token strings.
2433
2434 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
2435 (YYSIZE_T): Define to unsigned long int when using an older compiler.
2436 (yyparse): Revamp code to generate long syntax error message, to
2437 make it easier to translate, and to avoid problems with arithmetic
2438 overflow. Change "virtual memory" to "memory" in diagnostic, since
2439 we don't know whether the memory is virtual.
2440
1ce59070
PE
24412005-04-13 Paul Eggert <eggert@cs.ucla.edu>
2442
2443 * NEWS: Bison-generated C parsers now use the _ macro to
2444 translate strings.
2445 * data/yacc.c (_) [!defined _]: New macro.
2446 All English strings wrapped inside this macro.
2447 * doc/bison.texinfo (Bison Parser): Document _.
2448 * po/POTFILES.in: Include src/parse-gram.c, since it now
2449 includes translateable strings that parse-gram.y doesn't.
2450
a749a695
PE
24512005-04-12 Paul Eggert <eggert@cs.ucla.edu>
2452
2453 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
2454 reverting the 2004-10-11 change to this function.
2455 (symbol_check_alias_consistency): Don't call symbol_type_set
2456 if the type name is already correct.
2457 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
2458
8fb1053b
PE
24592005-03-25 Paul Eggert <eggert@cs.ucla.edu>
2460
2461 * tests/regression.at (Token definitions): Don't use a token named
2462 c, as that generates a "#define c ..." that runs afoul of buggy
2463 stdlib.h that uses the identifier c as a member of struct
2464 drand48_data. Problem reported by Horst Wente.
2465
ff498c4a
PE
24662005-03-21 Paul Eggert <eggert@cs.ucla.edu>
2467
2468 * bootstrap: Change translation URL from
2469 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
2470 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
2471 redirection glitches. Problem reported by twlevo@xs4all.nl.
2472
65211d70
PE
24732005-03-20 Paul Eggert <eggert@cs.ucla.edu>
2474
2475 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
2476 after operands; POSIX says this isn't portable for the c99 command.
2477
9577fb1f
PE
24782005-03-18 Paul Eggert <eggert@cs.ucla.edu>
2479
2480 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
2481 immediately if a data overrun has occurred; this may help us track
2482 down what may be a spurious failure on MacOS.
2483
78b178f7
PE
24842005-03-17 Paul Eggert <eggert@cs.ucla.edu>
2485
a2599d0f
PE
2486 Respond to problems reported by twlevo@xs4all.nl.
2487
2488 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
2489
78b178f7
PE
2490 * src/vcg.h: Comment fix.
2491 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
2492 (G_CMAX): Change to -1 instead of INT_MAX.
2493
2494 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 2495
7296e729
PE
24962005-03-15 Paul Eggert <eggert@cs.ucla.edu>
2497
2498 * src/tables.c (state_number_to_vector_number): Put it inside an
2499 "#if 0", since it's not currently used. Problem reported by
2500 Roland McGrath.
2501
05ac60f3
PE
25022005-03-06 Paul Eggert <eggert@cs.ucla.edu>
2503
2504 * src/output.c (escaped_output): Renamed from
2505 escaped_file_name_output, since we now use it for symbol tags as
2506 well. All uses changed.
2507 (symbol_destructors_output, symbol_printers_output):
2508 Escape symbol tags too.
2509 Problem reported by Matyas Forstner in
2510 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
2511
2512 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
2513 not needed.
2514 * src/output.c (user_actions_output, token_definitions_output,
2515 symbol_destructors_output, symbol_printers_output): Likewise.
2516 * src/reader.c (prologue_augment): Likewise.
2517 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
2518
2519 * src/vcg.c (output_edge): Don't quote linestyle arg.
2520 Problem reported by twlevo@xs4all.nl.
2521
7eb453ac
PE
25222005-02-28 Paul Eggert <eggert@cs.ucla.edu>
2523
2524 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
2525 example, reported by Derek M Jones. Also, make the example even
2526 more outrageous, to better illustrate how bad the problem is.
2527
4c04c52a
PE
25282005-02-24 Paul Eggert <eggert@cs.ucla.edu>
2529
2530 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
2531 putsym. Typo reported by Sebastian Piping.
2532
a61e1620
PE
25332005-02-23 Paul Eggert <eggert@cs.ucla.edu>
2534
2535 * doc/bison.texinfo (Language and Grammar): some -> same
2536 (Epilogue): int he -> in the
2537 Typos reported by Sebastian Piping via Justin Pence.
2538
9ec93868
PE
25392005-02-07 Paul Eggert <eggert@cs.ucla.edu>
2540
2541 * tests/glr-regression.at (Improper handling of embedded actions
2542 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
2543 embedded actions and $-N in GLR parsers", work around an Autoconf bug
2544 with dollar signs in test names.
2545 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
2546 for a similar reason.
2547
73ce7e7e
PE
25482005-01-28 Paul Eggert <eggert@cs.ucla.edu>
2549
2550 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
2551 wants to redefine G_VIEW.
2552
2e72b98e
PE
25532005-01-27 Paul Eggert <eggert@cs.ucla.edu>
2554
2555 * src/vcg.c (get_view_str): Remove case for normal_view.
2556 Problem reported by twlevo@xs4all.nl.
2557
e0d634e5
PE
25582005-01-24 Paul Eggert <eggert@cs.ucla.edu>
2559
ccf830a4
PE
2560 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
2561 Problem reported by twlevo@xs4all.nl.
2562
e0d634e5
PE
2563 * doc/bison.texinfo: Change @dircategory from "GNU programming
2564 tools" to "Software development". Requested by Richard Stallman
2565 via Karl Berry.
2566
7bbc8cb0
PE
25672005-01-23 Paul Eggert <eggert@cs.ucla.edu>
2568
2569 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
2570 Problem reported by twlevo@xs4all.nl.
2571
08b770bc
PE
25722005-01-21 Paul Eggert <eggert@cs.ucla.edu>
2573
2574 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
2575 keyword; it's not needed with modern compilers, and it doesn't
2576 affect correctness with older compilers. Suggested by
2577 twlevo@xs4all.nl.
2578
95f22ad2
PE
25792005-01-17 Paul Eggert <eggert@cs.ucla.edu>
2580
2581 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
2582 gcc -Wswitch-default.
2583 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
2584 * data/yacc.c (yyparse): Likewise.
2585
d229d15c
PE
25862005-01-12 Paul Eggert <eggert@cs.ucla.edu>
2587
2588 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
2589 already. Let config.h define any nonstandard values.
2590
ecadd90f
PE
25912005-01-10 Paul Eggert <eggert@cs.ucla.edu>
2592
2593 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
2594 for the benefit of slower hosts. Problem reported by
2595 Nelson H. F. Beebe.
2596
213744b5
PE
25972005-01-07 Paul Eggert <eggert@cs.ucla.edu>
2598
2599 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
2600 being defined and not used.
2601 * data/lalr1.cc (yyparse): Likewise.
2602 Use "if (false)" rather than "if (0)".
2603
249d3236
PE
26042005-01-05 Paul Eggert <eggert@cs.ucla.edu>
2605
2606 * TODO: Mention that we should allow NUL bytes in tokens.
2607
987cc1fb
PE
26082005-01-02 Paul Eggert <eggert@cs.ucla.edu>
2609
2610 * src/scan-skel.l (<<EOF>>): Don't close standard output.
2611 Problem reported by Hans Aberg.
2612
08fe02d9
PE
26132005-01-01 Paul Eggert <eggert@cs.ucla.edu>
2614
2615 * src/getargs.c (version): Happy new year; update overall
2616 program copyright date from 2004 to 2005.
2617
2618 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
2619 Problem reported by Hans Aberg.
2620 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
2621 (Output file names.): Add a test for the case when standard output
2622 is closed.
2623
010c0266
PE
26242004-12-26 Paul Eggert <eggert@cs.ucla.edu>
2625
2626 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
2627 to fix an oversight in the Bison 2.0 manual.
2628
da12206a
PE
26292004-12-25 Paul Eggert <eggert@cs.ucla.edu>
2630
2631 * NEWS: Version 2.0. Reformat the existing news items since
2632 1.875, so that related items are grouped together.
3a4734aa 2633 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
2634 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
2635
c935d934
PE
2636 * tests/torture.at (Exploding the Stack Size with Alloca): Set
2637 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
2638 otherwise, we're not testing alloca. Unfortunately there's no
2639 simple way to consult HAVE_ALLOCA here.
2640
da12206a
PE
2641 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
2642 for yymsg, too.
2643
2644 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
2645 hand. This avoids a warning about comparing int to size_t when
2646 GCC warnings are enabled.
2647
0a2c5137
PE
26482004-12-22 Paul Eggert <eggert@cs.ucla.edu>
2649
d7e14fc0
PE
2650 * NEWS: Bison-generated parsers no longer default to using the
2651 alloca function (when available) to extend the parser stack, due
2652 to widespread problems in unchecked stack-overflow detection.
2653 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
2654 responsibility to set it to a positive value. This lets the user
2655 specify a value that is not a preprocessor constant.
2656 * data/yacc.c (YYMAXDEPTH): Likewise.
2657 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
2658 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
2659 to be a compile-time constant. However, explain the constraints on it.
2660 Also, explain the constraints on YYINITDEPTH.
2661 (Table of Symbols): Explain that alloca is no longer the default.
2662 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
2663 to 1.
2664
0a2c5137
PE
2665 * doc/bison.texinfo (Location Default Action): Mention that n must
2666 be zero when k is zero. Suggested by Frank Heckenbach.
2667
e019c247
AD
26682004-12-22 Akim Demaille <akim@epita.fr>
2669
2670 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
2671 (parser::state_type, parser::semantic_type, parser::location_type):
2672 Private, not public.
2673 (parser::parse): Return ints, not bool.
2674 Returning a bool introduces a problem: 0 corresponds to false, and
2675 it seems weird to return false on success. Returning true changes
2676 the conventions for yyparse.
2677 Alternatively we could return void and send an exception.
2678 There is no clear consensus (yet?).
2679 (state_stack, semantic_stack, location_stack): Rename as...
2680 (state_stack_type, semantic_stack_type, location_stack_type): these.
2681 Private, not public.
2682 * tests/c++.at: New.
2683 * tests/testsuite.at, tests/Makefile.am: Adjust.
2684
72731bb7
AD
26852004-12-21 Akim Demaille <akim@epita.fr>
2686
2687 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
2688
9a0d8bec
AD
26892004-12-21 Akim Demaille <akim@epita.fr>
2690
2691 Don't impose std::string for filenames.
2692
2693 * data/lalr1.cc (b4_filename_type): New.
2694 (position::filename): Use it.
2695 (parser.hh): Move the inclusion of stack.hh and location.hh below
2696 the user code, so that needed headers for the filename type can be
2697 included first.
72731bb7
AD
2698 Forward declare them before the user code.
2699 * tests/Makefile.am (check-local, installcheck-local): Pass
2700 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 2701
99880de5
AD
27022004-12-20 Akim Demaille <akim@epita.fr>
2703
2704 Use more STL like names: my_class instead of MyClass.
2705
2706 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
2707 (SemanticStack, SemanticType, StateStack, StateType)
2708 (TokenNumberType, Stack, Slice, Traits, Parser::location)
2709 (Parser::value): Rename as...
2710 (location_stack, location_type, rhs_number_type, semantic_stack)
2711 (semantic_type, state_stack, state_type, token_number_type, stack)
2712 (slice, traits, parser::yylloc, parser::yylval): these.
2713
2714 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
2715
9bec482e
PE
27162004-12-19 Paul Eggert <eggert@cs.ucla.edu>
2717
2718 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
2719 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
2720
f6fbd3da
PE
27212004-12-17 Paul Eggert <eggert@cs.ucla.edu>
2722
2723 Remove uses of 'short int' and 'unsigned short int'. This raises
2724 some arbitrary limits. It uses more memory but nowadays that's
2725 not much of an issue.
2726
2727 This change does not affect the generated parsers; that's a different
2728 task, as some users will want to conserve memory there.
2729
2730 Ideally we should use size_t to represent all object counts, and
2731 something like ptrdiff_t to represent signed differences of object
2732 counts; but that will require more code-cleanup than I have the
2733 time to do right now.
2734
2735 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
2736 Use size_t, not int or short int, to count objects.
2737 * src/closure.c (nritemset, closure): Likewise.
2738 * src/closure.h (nritemset, closure): Likewise.
2739 * src/nullable.c (nullable_compute): Likewise.
2740 * src/print.c (print_core): Likewise.
2741 * src/print_graph.c (print_core): Likewise.
2742 * src/state.c (state_compare, state_hash): Likewise.
2743 * src/state.h (struct state): Likewise.
2744 * src/tables.c (default_goto, goto_actions): Likewise.
2745
2746 * src/gram.h (rule_number, rule): Use int, not short int.
2747 * src/output.c (prepare_rules): Likewise.
2748 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
2749 errs, reductions): Likewise.
2750 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
2751 Likewise.
2752 * src/tables.c (vector_number, tally, action_number,
2753 ACTION_NUMBER_MINIMUM): Likewise.
2754 * src/output.c (muscle_insert_short_int_table): Remove.
2755
efeed023
AD
27562004-12-17 Akim Demaille <akim@epita.fr>
2757
2758 * data/lalr1.cc: Extensive Doxygenation.
2759 (error_): Rename as...
2760 (error): this, since it is visible to the user.
2761 Adjust callers.
2762 (Parser::message): Now an automatic variable from...
2763 (Parser::yyreport_syntax_error_): here.
2764 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
2765 Parser::error.
2766 * tests/input.at: Escape $.
2767
bc82c5a5
PE
27682004-12-16 Paul Eggert <eggert@cs.ucla.edu>
2769
2770 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
2771 Parenthesize rhs to avoid obscure problems with mistakes like
2772 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
2773 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
2774 b4_rhs_location): Likewise.
2775 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
2776 b4_rhs_location): Likewise.
2777
fd19f271
AD
27782004-12-16 Akim Demaille <akim@epita.fr>
2779
2780 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
2781 yacc.c: be sure to stay within yycheck_.
2782 * tests/actions.at: Re-enable C++ tests.
2783
10454ea4
AD
27842004-12-16 Akim Demaille <akim@epita.fr>
2785
2786 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
2787 real.
2788
c5b95ccf
AD
27892004-12-16 Akim Demaille <akim@epita.fr>
2790
2791 Use #define to handle the %name-prefix.
2792
2793 * data/glr.c, data/yacc.c: Comment changes.
2794 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
2795 so that one can refer to yylex in the parser file, and have it
2796 renamed, as is the case with other skeletons.
2797
617a8f12
AD
27982004-12-16 Akim Demaille <akim@epita.fr>
2799
2800 Move lalr1.cc internals into yy*.
2801
2802 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
2803 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
2804 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
2805 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
2806 (empty_, final_, terror_, errcode_, ntokens_)
2807 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
2808 (looka_, ilooka_, error_range_, nerrs_):
2809 Rename as...
2810 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
2811 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
2812 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
2813 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
2814 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
2815 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
2816 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
2817 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
2818 these.
2819
1e547e6e
PE
28202004-12-15 Paul Eggert <eggert@cs.ucla.edu>
2821
2822 Fix some problems reported by twlevo at xs4all.
2823 * src/symtab.c (symbol_new): Report an error if the input grammar
2824 contains too many symbols. This is better than calling abort() later.
2825 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
2826 (struct node, struct graph):
2827 Rename member expand to stretch. All uses changed.
2828 (struct graph): Remove member layoutalgorithm. All uses removed.
2829 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
2830 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
2831 All uses changed.
2832 (N_STRETCH): Rename from N_EXPAND. All uses changed.
2833
735d6bd4
AD
28342004-12-15 Akim Demaille <akim@epita.fr>
2835
2836 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
2837 Add more Doxygen comments.
2838 (symprint_, stack_print_, reduce_print_, destruct_, pop)
2839 (report_syntax_error_, translate_): Rename as...
2840 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
2841 (yypop_, yyreport_syntax_error_, yytranslate_): this.
2842
2e1f5829
AD
28432004-12-15 Akim Demaille <akim@epita.fr>
2844
2845 * data/lalr1.cc (lex_): Rename as...
2846 (yylex_): this.
2847 Move the trace here.
2848 Take the %name-prefix into account.
2849 Reported by Alexandre Duret-Lutz.
2850
a3cb6248
AD
28512004-12-15 Akim Demaille <akim@epita.fr>
2852
2853 Simplify the C++ parser constructor.
2854
2855 * data/lalr1.cc (debug_): Rename as...
2856 (yydebug_): so that the parser's internals are always in the yy*
2857 pseudo namespace.
2858 Adjust uses.
2859 (b4_parse_param_decl): Remove the leading comma as it is now only
2860 called as unique argument list.
2861 (Parser::Parser): Remove the constructor accepting a location and
2862 an initial debugging level.
2863 Remove from the other ctor the argument for the debugging level.
2864 (debug_level_type, debug_level, set_debug_level): New.
2865
2866 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
2867 constructor calls.
2868
07fed891
AD
28692004-12-15 Akim Demaille <akim@epita.fr>
2870
2871 Remove b4_root related material: failure experiment
a3cb6248 2872 (which goal was to allow to derive from a class).
07fed891
AD
2873
2874 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
2875 definitions and uses.
2876
e603eaa5
PE
28772004-12-14 Paul Eggert <eggert@cs.ucla.edu>
2878
2879 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
2880 not 2, since it's not portable to subtract 1 from the start of an
2881 array. The new item 0 is never set or used. All uses changed.
2882
2883 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
2884 the default definition of YYLLOC_DEFAULT. Problem reported
2885 by Frank Heckenbach.
2886
fafb007d
PE
28872004-12-12 Paul Eggert <eggert@cs.ucla.edu>
2888
2889 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
2890 the normal case and one for the error case. Just use the
2891 first one uniformly. Problem reported by Frank Heckenbach.
2892 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
2893 use exactly the same macro in both places.
2894 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
2895 so that the normal-case YYRHSLOC works for the error case too.
2896 All uses changed.
2897 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
2898 (YYLLOC_DEFAULT): Use the same macro as glr.c.
2899 * doc/bison.texinfo (Location Default Action): Don't claim that
2900 we have an array of locations. Use the same macro for both glr
2901 and lalr parsers. Mention YYRHSLOC. Mention what happens when
2902 the index is 0.
2903
48814dcd
PE
29042004-12-10 Paul Eggert <eggert@cs.ucla.edu>
2905
a4e1a53b
PE
2906 * HACKING: Update email addresses to send announcements to.
2907
48814dcd
PE
2908 * configure.ac (AC_INIT): Bump version to 1.875f.
2909
337116ba
PE
29102004-12-10 Paul Eggert <eggert@cs.ucla.edu>
2911
2912 * NEWS: Version 1.875e.
2913 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
2914
2915 * src/scan-skel.l: Include "complain.h", for "fatal".
2916
2917 * src/relation.h (relation_print, relation_digraph):
2918 Relation sizes are of type relation_node, not size_t (this is
2919 merely a doc fix, since the two types are equivalent).
2920 (relation_transpose): Relation sizes are of type relation_node,
2921 not int.
2922 * src/relation.c: Likewise.
2923 (top, infinity): Now of type relation_node, not int.
2924 (traverse, relation_transpose): Use relation_node, not int.
2925
2926 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
2927 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
2928 (yyparse): Remove unused local introduced in 2004-10-25 patch.
2929
2930 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 2931 specifying whether the test should be skipped. Use it tp
337116ba 2932 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 2933 fail on some hosts, and should be skipped.
337116ba 2934
da2a7671
PE
29352004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2936
2937 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
2938 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
2939 unless otherwise specified below.
2940
2941 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
2942 to allocate kernel_base, kernel_items, kernel_size, since
2943 they needn't be initialized to 0.
2944 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
2945 * src/closure.c (new_closure): Likewise, for itemset.
2946 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
2947 * src/lalr.c (set_goto_map): Likewise, for temp_map.
2948 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
2949 (build_relations): Likewise for edge, states1, includes.
2950 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
2951 * src/reader.c (packgram): Likewise, for ritem, rules.
2952 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
2953 * src/relation.c (relation_digraph): Likewise for VERTICES.
2954 (relation_transpose): Likewise for new_R, end_R.
2955 * src/symtab.c (symbols_token_translations_init): Likewise for
2956 token_translations.
2957 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
2958 (token_actions): Likewise for yydefact, actrow, conflrow,
2959 conflict_list.
2960 (save_column): Likewise for froms[symno], tos[symno].
2961 (goto_actions): Likewise for state_count.
2962 (pack_table): Likewise for base, pos, check.
2963 (tables_generate): Likewise for width.
2964
2965 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
2966 for initial core. Just have a separate core, so we needn't worry
2967 about whether kernel_size and kernel_base are initialized.
2968
2969 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
2970 kernel_size, kernel_items): Remove unnecessary initialization.
2971 * src/conflicts.c (conflicts): Likewise.
2972 * src/derives.c (derives): Likewise.
2973 * src/muscle_tablc (muscle_insert): Likewise.
2974 * src/relation.c (relation_digraph): Likewise.
2975 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
2976 conflrow, conflict_table, conflict_list, table, check):
2977 Likewise.
2978
2979 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
2980 This is because all callers pass unsigned int.
2981 * src/closure.h (new_closure): Likewise.
2982
2983 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
2984 (build_relations): Initialize includes[i] in all cases.
2985 * src/reader.c (packgram): Always initialize rules[ruleno].prec
2986 and rules[ruleno].precsym. Initialize members in order.
2987 * src/relation.c (relation_transpose): Always initialize new_R[i]
2988 and end_R[i].
2989 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
2990
2991 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
2992 conflict_list[0] was always 0, but now it isn't initialized.
2993
2994 * src/table.c (table_grow): When conflict_table grew, the grown
2995 area wasn't cleared. Fix this.
2996
2997 * lib/.cvsignore: Add strdup.c, strdup.h.
2998 * m4/.cvsignore: Add strdup.m4.
2999
00baeeac
PE
30002004-12-07 Paul Eggert <eggert@cs.ucla.edu>
3001
3002 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
3003 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
3004 GOTO_NUMBER_MAXIMUM, since we occasionally compute
3005 ngotos + 1 without checking for overflow.
3006 (build_relations): Use END_NODE, not -1, to denote end of edges.
3007 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
3008 build_relations): Use goto_number, not int, for goto numbers.
3009 * src/tables.c (save_column, default_goto): Likewise.
3010
be3d9d42
AD
30112004-11-23 Akim Demaille <akim@epita.fr>
3012
3013 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
3014 of #defining from yystype.
3015 Don't typedef yystype, C++ does not need it.
3016 This lets it possible to forward declare it as union.
3017
78e526d5
PE
30182004-11-23 Paul Eggert <eggert@cs.ucla.edu>
3019
3020 * bootstrap (gnulib_modules): Add extensions.
3021 Problem reported by Jim Meyering.
3022
afbb696d
PE
30232004-11-22 Paul Eggert <eggert@cs.ucla.edu>
3024
3025 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
3026 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
3027 src/system.h, src/tables.c: XFREE -> free, to accommodate
3028 recent change to gnulib xalloc.h.
78e526d5 3029 Problem reported by Jim Meyering.
afbb696d 3030
c1f8f16a
AD
30312004-11-17 Akim Demaille <akim@epita.fr>
3032
3033 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
3034
30352004-10-28 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
3036 Alexandre Duret-Lutz <adl@gnu.org>
3037
3038 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
3039 changes.
3040 (YYCDEBUG): Adjust.
3041 Use it instead of cdebug_.
3042 (Parser::debug_stream, Parser::set_debug_stream): New.
3043 (Parser::symprint_): Define cdebug_ for temporary backward
3044 compatibility.
3045 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
3046 debug_stream ().
3047
68e11668
AD
30482004-11-17 Akim Demaille <akim@epita.fr>
3049
3050 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
3051 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
3052 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
3053 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
3054
97cbc73e
PE
30552004-10-27 Paul Eggert <eggert@cs.ucla.edu>
3056
3057 * data/glr.c (yyloc_default): Remove; not used.
3058 Problem reported by Frank Heckenbach.
3059
e342c3be
AD
30602004-10-25 Akim Demaille <akim@epita.fr>
3061
3062 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
3063 Introduce another definition to address simple location arrays.
3064 (yyGLRStack): New member: yyerror_range.
3065 (yyrecoverSyntaxError, yyparse): Update it.
3066 (yyrecoverSyntaxError): Use it when shifting the error token to
3067 have an accurate range, equivalent to the one computed by both
3068 yacc.c and lalr1.cc.
3069 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
3070 that column numbers start at column 0, as per GNU Coding
3071 Standards, the others tests, and the doc.
3072 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
3073 Adjust to the above change (first column is 0).
3074 And adjust the location of the "<error>", now covering the whole
3075 line.
3076
93602feb 30772004-10-22 Akim Demaille <akim@epita.fr>
04098407 3078 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
3079
3080 Remove some arbitrary limits on goto numbers and relations.
3081 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
3082 initial values, since they're never used.
3083 (set_goto_map): ngotos is now unsigned, so test for overflow
3084 by seeing whether it wraps around to zero.
3085 * src/lalr.h (goto_number): Now size_t, not short int.
3086 (GOTO_NUMBER_MAXIMUM): Remove.
3087 * src/relation.c (relation_print, traverse, relation_transpose):
3088 Check for END_NODE rather than looking at sign.
3089 * src/relation.h (END_NODE): New macro.
3090 (relation_node): Now size_t, not short int.
3091
dba08b04
PE
30922004-10-22 Paul Eggert <eggert@cs.ucla.edu>
3093
3094 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
3095 keyword, not an identifier. Problem reported by Baron Schwartz in
3096 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
3097
df09ef2e
AD
30982004-10-11 Akim Demaille <akim@epita.fr>
3099
3100 * src/symtab.c (symbol_check_alias_consistency): Also check
3101 type names, destructors, and printers.
3102 Reported by Alexandre Duret-Lutz.
3103 Recode the handling of associativity and precedence in terms
3104 of symbol_precedence_set.
3105 Accept no redeclaration at all, not even equal to the previous
3106 value.
3107 (redeclaration): New.
3108 Use it to factor redeclaration complaints.
3109 (symbol_make_alias): Don't set the type of the alias, let
3110 symbol_check_alias_consistency do it as for other features.
3111 * src/symtab.h (symbol): Add new member prec_location, and
3112 type_location.
3113 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
3114 * tests/input.at (Incompatible Aliases): New.
3115
146bc99d
PE
31162004-10-09 Paul Eggert <eggert@cs.ucla.edu>
3117
3118 .cvsignore fixes to accommodate gnulib changes,
3119 and the practice of naming build directories "_build".
3120 * .cvsignore: Add "_*". Sort.
3121 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
3122 * m4/.cvsignore: Add "*_gl.m4".
3123
e503aa60
AD
31242004-10-06 Akim Demaille <akim@epita.fr>
3125
3126 * src/parse-gram.y (add_param): Fix the truncation of trailing
3127 spaces.
3128
b4a20338
AD
31292004-10-05 Akim Demaille <akim@epita.fr>
3130
3131 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
3132 whether the reducion was empty or not. This leaves room to
3133 improve the use of YYLLOC_DEFAULT in such a case.
3134 lalr1.cc is still experimental, so changing this is acceptable.
3135 And finally, there are probably not many users who changed the
3136 handling of locations in GLR, so changing is admissible too.
3137
3138 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
3139 empty reduction, set @$ to an empty location ending the previously
3140 stacked symbol.
3141 Adjust uses to make sure the code is triggered on empty
3142 reductions.
3143 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
3144 expected output: empty reductions have empty locations.
3145
f85a5e6f
AD
31462004-09-29 Akim Demaille <akim@epita.fr>
3147
3148 * data/lalr1.cc: Move towards a more standard C++ coding style
3149 for templates: Class < T > -> Class<T>.
3150
b203fc2c
AD
31512004-09-29 Akim Demaille <akim@epita.fr>
3152
3153 * data/lalr1.cc: Reinstall the former ctor, for sake of
3154 compatibility, but warn it will be removed.
3155 Move towards a more standard C++ coding style (i.e., type *var ->
3156 type* var).
3157
5b7e1e73
PE
31582004-09-27 Paul Eggert <eggert@cs.ucla.edu>
3159
3fee967f
PE
3160 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
3161 since it's less likely to work if NULs are involved in the future.
5b7e1e73 3162
0dcca5c2
AD
31632004-09-27 Akim Demaille <akim@epita.fr>
3164
3165 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
3166
6dde1c82
AD
31672004-09-27 Akim Demaille <akim@epita.fr>
3168
3169 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 3170 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
3171 and argument names.
3172 (b4_cc_constructor_call): Likewise.
3173
b233d555
AD
31742004-09-24 Akim Demaille <akim@epita.fr>
3175
3176 * src/parse-gram.y (add_param): Strip the leading and trailing
3177 blanks from a formal argument declaration.
3178 (YY_LOCATION_PRINT): New.
3179
619404e3
AD
31802004-09-24 Akim Demaille <akim@epita.fr>
3181
3182 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
3183 after the location.
3184
dd8d9022
AD
31852004-09-24 Akim Demaille <akim@epita.fr>
3186
3187 * doc/bison.texinfo (Table of Symbols): Sort.
3188
0092f063
AD
31892004-09-21 Akim Demaille <akim@epita.fr>
3190
3191 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
3192 the useless parentheses.
3193 Suggested by Paul Eggert.
3194
451364ed
AD
31952004-09-20 Akim Demaille <akim@epita.fr>
3196
3197 Let the initial-action act on the look-ahead, and use it for the
3198 "initial push" (corresponding to an hypothetical beginning-of-file).
3199 And let lalr1.cc honor %initial-action.
3200
3201 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
3202 example.
3203 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
3204 (Parser::Parser): Remove the ctor that used to initialize it.
3205 (Parser::parse): Like in the other skeletons, issue the "starting
3206 parse" message before any action.
3207 Honor %initial-action.
3208 Initialize the stacks with the lookahead.
3209 * data/yacc.c: Let $$ and @$ in %initial-action designate the
3210 look-ahead.
3211 Push them in the stacks.
3212 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
3213
18d192f0
AD
32142004-09-20 Akim Demaille <akim@epita.fr>
3215
3216 * doc/bison.texinfo (Initial Action Decl): New.
3217
b8458aa5
AD
32182004-09-20 Akim Demaille <akim@epita.fr>
3219
3220 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
3221 clearer criterion to define it.
3222 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
3223 When reducing on an empty RHS, use the latest stacked location as
3224 location.
3225 yylloc is not always available.
3226 * data/glr.c: Likewise.
3227 Also, honor initial-actions.
3228
3fc16193
AD
32292004-09-20 Akim Demaille <akim@epita.fr>
3230
3231 * data/yacc.c (YY_LOCATION_PRINT): New.
3232 Define when we know YYLTYPE's structure, i.e., when the default
3233 YYLLOC_DEFAULT is used.
3234 * data/c.m4 (b4_yysymprint_generate): Use it.
3235 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
3236 value of the result.
3237 (error_start_): Replace with...
3238 (error_range_): this location array.
3239 This allows to replace code relying on the implementation of
3240 locations by portable code.
3241 * data/yacc.c (yylerrsp): Replace with...
3242 (yyerror_range): this.
3243 Every time a token is popped, update yyerror_range[0], to have an
3244 accurate location for the error token.
3245 * data/glr.c (YY_LOCATION_PRINT): New.
3246 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
3247 deference a pointer.
3248 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
3249 report the location in %printers.
3250
3251 * src/scan-skel.l: Instead of abort, report error messages to ease
3252 understanding skeleton scanning failures.
3253
ecfe33e7
AD
32542004-09-16 Akim Demaille <akim@epita.fr>
3255
3256 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
3257 (iterator, const_iterator): these, to be more in the C++ spirit.
3258 Also, return reverse iterators so that when displaying the stack
3259 we display its bottom first.
3260 (Parser::stack_print_, Parser::reduce_print_): Match the messages
3261 from yacc.c.
3262 We should probably use vector here though.
3263
1576d44d
AD
32642004-09-16 Akim Demaille <akim@epita.fr>
3265
3266 Have more complete shift traces.
3267
3268 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
3269 to report Shifts instead of ad hoc YYDPRINTF invocations,
3270 including for the error token.
3271 * data/lalr1.cc (symprint_): Output the location.
3272 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
3273 output the location within the %printer.
3274 Activate GLR tests, at least to make sure they compile properly.
3275 They still don't pass though.
3276 * tests/calc.at: Adjust expect verbose output, since now "Entering
3277 state..." is on a different line than the "Shifting" message.
3278
9c66f418
AD
32792004-09-08 Akim Demaille <akim@epita.fr>
3280
3281 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
3282 Bison directive from the Bison file to the invocation of this
3283 macro, so that these directives are passed to
3284 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
3285 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
3286 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
3287 the extra Bison directives instead of the whole series.
3288 Change the grammar so that there are recoverable errors, and
3289 unrecoverable errors. Now we can have the parser give up before
3290 consuming the whole input. As a result we now can observe that
3291 the lookahead is freed when needed.
3292 Change the parser source to parse argv[1] instead of a hard coded
3293 string.
3294 Simplify yylex, and give a value and location to EOF.
3295 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
3296 passed directives already coded in the file.
3297 Add some tests to check the location of "error".
3298 For some tests, the C++ parser is correct, and not yacc.c.
3299 For other tests, they provide different, but unsatisfying, values,
3300 so keep the C++ value so that at least one parser is "correct"
3301 according to the test suite.
3302 (Actions after errors): Remove, this is subsumed by the
3303 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
3304
52d5733f
AD
33052004-09-06 Akim Demaille <akim@epita.fr>
3306
3307 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 3308 (Parser::pop): New.
52d5733f
AD
3309 Use it.
3310
a0e68930
AD
33112004-09-06 Akim Demaille <akim@epita.fr>
3312
3313 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
3314 argument, an informative message.
3315 Call YY_SYMBOL_PRINT.
3316 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
3317 * data/lalr1.cc (destruct_): Likewise.
3318 In addition, no longer depend on b4_yysymprint_generate and
3319 b4_yydestruct_generate to generate these functions, do it "by
3320 hand".
3321
e757bb10
AD
33222004-09-03 Akim Demaille <akim@epita.fr>
3323
3324 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
3325 invoked, yydestruct the lookahead.
3326 * tests/calc.at (Calculator $1): Update the expected lengths of
3327 traces: there is an added line for the discarded lookahead.
3328 * doc/bison.texinfo (Destructor Decl): Some rewording.
3329 Define "discarded" symbols.
3330
0fe1f06d
AD
33312004-09-02 Akim Demaille <akim@epita.fr>
3332
3333 * data/lalr1.cc (translate_, destruct_): No reason to be static.
3334
284acc8b
AD
33352004-09-02 Akim Demaille <akim@epita.fr>
3336
3337 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
3338 (YYDSYMPRINTF): Rename as...
3339 (YY_SYMBOL_PRINT): this.
3340 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
3341 two.
3342 Use it instead of direct symprint_ calls.
3343 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
3344 one.
3345
a5eb1ed2
AD
33462004-09-02 Akim Demaille <akim@epita.fr>
3347
b7c72fe1
AD
3348 * data/lalr1.cc (b4_yysymprint_generate): New.
3349 (symprint_): New member function, defined when YYDEBUG.
3350 Use it consistently instead of token/nterm debugging output by
3351 hand.
a5eb1ed2
AD
3352 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
3353 %printer calls to use cdebug_ when using lalr1.cc.
3354
417141dd
AD
33552004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
3356
3357 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
3358 with #ifdef YYDEBUG.
3359
2fa09258
AD
33602004-08-26 Akim Demaille <akim@epita.fr>
3361
3362 * doc/bison.texinfo (Implementing Loops): Rename as...
3363 (Implementing Gotos/Loops): this.
3364
9378b508
PE
33652004-08-13 Paul Eggert <eggert@cs.ucla.edu>
3366
3367 Adjust to latest gnulib.
3368 * bootstrap (gnulib_modules): Add xalloc-die.
3369 Set LC_ALL=C so that file names sort consistently.
3370 Prefer the gnulib copies of gettext.m4, glibc21.m4,
3371 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
3372 uintmax_t.m4, ulonglong.m4.
3373 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
3374 po.m4 since we are now using _gl.m4 instead.
3375
87a8ad5c
PE
33762004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
3377
3378 * src/scan-action.l: Remove. Scanning of semantic actions is
3379 handled in scan-gram.l.
3380
dca81a78
PE
33812004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
3382
3383 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
3384
3385 * src/location.h (struct): The file member is a uniqstr.
3386 (equal_boundaries): Use UNIQSTR_EQ for comparison.
3387
c9cbf7c5
PE
33882004-07-22 Paul Eggert <eggert@cs.ucla.edu>
3389
3390 Fix bug with non-%union parsers that have printers or destructors,
3391 which led to a Bison core dump. Reported by Peter Fales in
3392 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 3393
c9cbf7c5
PE
3394 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
3395 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
3396 not to our own type.
3397 * src/output.c (symbol_destructors_output, symbol_printers_output):
3398 Don't assume %union.
3399 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
3400 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
3401 UNION-FLAG. All callers changed.
3402 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
3403 Use type char, not unsigned int, when declaring an array of char;
3404 this lets us remove a cast.
3405 (Printers and Destructors): Add non-%union test cases.
3406
fa7e68c3
PE
34072004-06-21 Paul Eggert <eggert@cs.ucla.edu>
3408
3409 * doc/bison.texinfo: Minor editorial changes, mostly to the new
3410 GLR writeups. E.g., avoid frenchspacing and the future tense,
3411 change "lookahead" to "look-ahead", and change "wrt" to "with
3412 respect to".
2fa09258 3413
fa7e68c3
PE
34142004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3415
3416 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
3417 New sections, split off from the GLR Parsers section. Put the new
3418 Simple GLR Parser near the start of the GLR section, for clarity.
3419 Rewrite connective text.
3420
99a9344e
PE
34212004-06-21 Frank Heckenbach <frank@g-n-u.de>
3422
3423 * doc/bison.texinfo (Simple GLR Parsers): New section.
3424
8dd162d3
PE
34252004-06-21 Paul Eggert <eggert@cs.ucla.edu>
3426
3427 * NEWS, TODO, doc/bison.texinfo:
3428 Use "look-ahead" instead of "lookahead", to be consistent.
3429 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
3430 while we're fixing "look-ahead".
3431 * src/conflicts.c (shift_set): Renamed from shiftset.
3432 (look_ahead_set): Renamed from lookaheadset.
3433 * src/print.c: Likewise.
3434 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
3435 name for "lookahead".
3436 (report_types, usage): Likewise.
3437 * src/getargs.h (report_look_ahead_tokens): Renamed from
3438 report_lookaheads.
3439 * src/lalr.c (compute_look_ahead_tokens): Renamed from
3440 compute_lookaheads.
3441 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
3442 (look_ahead_tokens_print): Renamed from lookaheads_print.
3443 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
3444 state_rule_lookaheads_print.
3445 * src/state.h: Likewise.
3446 (reductions.look_ahead_tokens): Renamed from lookaheads.
3447 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
3448 AT_DATA_LOOKAHEADS_GRAMMAR.
3449
57a90331
PE
34502004-06-03 Paul Eggert <eggert@cs.ucla.edu>
3451
3452 * README: Update location of patched M4 distribution.
3453
8ed3234a
PE
34542004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
3455
3456 Don't assume the C++ compiler takes the same arguments as the C compiler
3457 (trivial change).
3458 * configure.ac (O0CXXFLAGS): New var.
3459 * tests/atlocal.in (CXXFLAGS): Use it.
3460
07971983
PE
34612004-05-29 Paul Eggert <eggert@cs.ucla.edu>
3462
3463 Fix some "make check" problems with C++ reported by
3464 Albert Chin-A-Young for Tru64 C++ in this thread:
3465 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
3466
3467 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
3468 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
3469 Output to a .cc file for C++, not to a .c file.
3470 * tests/calc.at (AT_CHECK_CALC): Likewise.
3471 * tests/regression.at (AT_CHECK_DANCER): Likewise.
3472 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
3473
29058652
PE
34742004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
3475
3476 * tests/calc.at, tests/actions.at: Workaround for SGI
3477 C++ compiler. (trivial change)
3478
62cb8a99
PE
34792004-05-27 Paul Eggert <eggert@cs.ucla.edu>
3480
fd418816
PE
3481 Spent a few hours checking out which prerequisite versions the
3482 current sources actually require. I went all the way back to
3483 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
3484 a seemingly endless set of combinations of versions more recent
3485 than that. The bottom line is that the current sources require
3486 fairly recent versions of the build tools, and it'll be some work
3487 to change this.
3488 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
3489 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
3490 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
3491 Add comments explaining why those particular versions are
3492 currently needed.
2fa09258 3493
62cb8a99
PE
3494 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
3495 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 3496 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
3497
3498 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
3499 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
3500
caa52c10
PE
35012004-05-26 Paul Eggert <eggert@cs.ucla.edu>
3502
3503 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
3504 0.11.5. Suggested by Bruno Haible.
3505 * bootstrap: Remove gettext version checking.
3506
3507 * doc/bison.texinfo (Decl Summary): Also mention that %union
3508 can depend on prerequisite types. Problem reported by Tim
3509 Van Holder.
3510
4bfd5e4e
PE
35112004-05-25 Paul Eggert <eggert@cs.ucla.edu>
3512
2cef3017
PE
3513 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
3514 * README-alpha: Don't tell people not to package this.
3515
b9c85d5c
PE
3516 * bootstrap: Don't assume $(...) works; use `...` instead.
3517 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
3518 gettext better.
3519
4bfd5e4e
PE
3520 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
3521 put into the -d output file, and mention what to do if YYSTYPE is
3522 defined as a macro.
3523
6a36ff94
PE
35242004-05-24 Paul Eggert <eggert@cs.ucla.edu>
3525
6712933e
PE
3526 Undo change made earlier today: it caused autopoint to not bring
3527 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
3528 autopoint's.
3529
3530 * bootstrap: Check that gettext version matches what's in
3531 configure.ac. Warn users to ignore robots.txt ERROR 404.
3532 * bootstrap: Undo today's earlier change (logged below).
3533 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 3534
6a36ff94
PE
3535 The gettext version checking is causing more trouble than it's
3536 curing; remove it. Problem reported by Paul Hilfinger.
3537
3538 * bootstrap: Issue a warning that one can expect a message
3539 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
3540 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
3541
209ea708
PE
35422004-05-23 Paul Eggert <eggert@cs.ucla.edu>
3543
3544 Ensure that the C++ compiler used for testing actually works on a
3545 simple test program; if not, skip the C++-related tests. Problem
3546 reported by Vin Shelton in:
161a71f3 3547 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
3548
3549 * m4/cxx.m4: New file.
3550 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
3551 * tests/atlocal.in (BISON_CXX_WORKS): Add.
3552 * tests/local.at (AT_COMPILE_CXX): Use it.
3553
41ca2549
PE
35542004-05-21 Paul Eggert <eggert@cs.ucla.edu>
3555
383e69dc
PE
3556 * data/glr.c (yylloc): Output this macro even if locations are not
3557 being generated, as the GLR parser needs it even in that case.
3558 Problem reported by Troy A. Johnson
3559 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
3560
41ca2549
PE
3561 * configure.ac (AC_INIT): Update to 1.875e.
3562
e476c87d
PE
35632004-05-21 Paul Eggert <eggert@cs.ucla.edu>
3564
3565 * NEWS: Version 1.875d.
3566 * configure.ac (AC_INIT): Likewise.
3567 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
3568
3569 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
3570 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
3571 lalr1.cc runs afoul of the first, and the last two are no longer
3572 supported by GCC 3.4.0.
3573 * README: Mention GNU m4 1.4 or later; mention m4 patches.
3574 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
3575
233a88ad
PE
35762004-05-06 Paul Eggert <eggert@cs.ucla.edu>
3577
3578 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
3579 unsigned int, for compatibility with latest gnulib hash module.
3580 * src/state.c (state_hash, state_hasher): Likewise.
3581 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
3582 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 3583
12ffdd28
PE
35842004-05-03 Paul Eggert <eggert@cs.ucla.edu>
3585
3586 * NEWS: Unescaped newlines are no longer allowed in char & strings.
3587
3588 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
3589 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
3590 character and string literals.
3591 (unexpected_end): New function.
3592 (unexpected_eof): Use it.
3593 (unexpected_newline): New function.
3594 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
3595 actions.
e476c87d 3596
12ffdd28
PE
3597 * NEWS: Document %expect-rr.
3598
3599 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
3600 Fix typo by replacing $1 with $option.
3601 Remove more 'intl'-related files.
9668e2be 3602 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
3603
3604 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
3605 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
3606 strtoul.c.
3607 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
3608 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
3609 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
3610 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
3611 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
3612 * src/.cvsignore: Add *.output.
3613
3614 * src/parse-gram.y: Put copyright notice inside %{ %} so it
3615 gets copied to the output file.
e476c87d 3616
1f65350a
PE
36172004-04-28 Paul Eggert <eggert@twinsun.com>
3618
3619 Get files from the gnulib and po repositories, instead of relying
3620 on them being in our CVS. Upgrade to latest versions of gnulib
3621 and Automake.
3622
3623 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
3624 * bootstrap: Bootstrap from gnulib and po repositories.
3625 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
3626 * README-cvs: Document these changes. Remove version numbers from
3627 mentions of build tools, since they change so often. Mention Flex.
3628
3629 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
3630 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
3631 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
3632 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 3633 does this for us.
12ffdd28
PE
3634 (AC_ISC_POSIX): Remove; we no longer support this
3635 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
3636 (AC_HEADER_STDC): Remove: we now assume C89 or better.
3637 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
3638 Do not check for C89 headers, except for locale.h which is used
3639 by the Yacc library and must port to K&R hosts.
3640 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
3641 Do not check for C89 functions, except for setlocale which is
3642 used by the Yacc library.
3643 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
3644 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
3645 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
3646 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
3647 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
3648 AM_GNU_GETTEXT): Remove; now done by:
3649 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
3650 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
3651 for us.
3652
3653 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
3654 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
3655 Define to empty, as gnulib.mk will do the rest for us.
3656 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
3657 for us.
3658 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
3659 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
3660
3661 * src/files.c: Include gnulib's xstrndup.h.
3662
3663 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
3664 (REALLOC): Use xnrealloc, for likewise.
3665 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
3666 (strnlen, memrchr): Remove decls; functions no longer used.
3667 Include <stpcpy.h>.
3668
3669 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
3670 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
3671 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
3672 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
3673 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
3674 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
3675 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
3676 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
3677 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
3678 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
3679 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
3680 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
3681 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
3682 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
3683 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
3684 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
3685 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
3686 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
3687 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
3688 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
3689 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
3690 Remove, as these files are now generated automatically
3691 by bootstrap or automake.
3692
3693 * po/ChangeLog: Remove: all but one entry was a duplicate
3694 of this file, and I moved that 2000-11-02 entry here.
3695
3696 * config/.cvsignore: Add Makefile, depcomp, install-sh.
3697 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
3698 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
3699 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
3700 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
3701 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
3702 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
3703 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
3704 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
3705 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
3706 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
3707 xstrndup.h.
3708 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
3709 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
3710 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
3711 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
3712 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
3713 * src/.cvsignore: Remove *_.c.
3714
3715
3716 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
3717 support it. (The latest stable gzip doesn't.)
3718
37192004-04-27 Paul Eggert <eggert@twinsun.com>
3720
3721 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
3722 case, as stos_ is now used by destructors due to the 2004-02-09
3723 change.
3724
3725 Remove more K&R C support.
3726 * lib/libiberty.y (PARAMS): Remove. All uses removed.
3727 * lib/subpipe.c (errno): Remove decl.
3728 Include <stdlib.h> unconditionally.
3729 (EXIT_FAILURE): Remove macro.
3730 * src/complain.c (vfprintf, strerror): Remove.
3731 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
3732 unconditionally.
3733 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
3734 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
3735 (strchr, strspn, memchr): Remove decls.
3736 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
3737 unconditionally. Do not declare perror.
3738 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
3739 unconditionally.
3740
3741 * src/complain.c (_): Remove useless defn, as system.h defines this.
3742
3743 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
3744 with latest obstack.h.
3745 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
3746 to procedure types, as obstack.h now does that for us.
3747 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
3748
3749 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
3750 so that this include file can stand alone.
3751 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
3752 does this now. Include subpipe.h first after config.h, to
3753 test whether it can stand alone.
3754
3755 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
3756 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
3757 unused declaration.
3758
3759 * tests/synclines.at (%union synch line): Put a dummy member in
3760 the union, because empty unions aren't allowed in C. Caught
3761 by GCC 3.4.0.
3762
4f16766c
PE
37632004-04-13 Jim Meyering <jim@meyering.net>
3764
3765 * src/conflicts.c (conflicts_print): Correct format string typo:
3766 use `%%' to produce literal `%'. (trivial change)
3767
779e7ceb
PE
37682004-03-30 Paul Eggert <eggert@twinsun.com>
3769
3770 * src/getargs.c (version): Update copyright year to 2004.
3771
3772 * data/c.m4 (b4_int_type): Use 'short int' rather than
3773 'short', and similarly for 'long', 'unsigned', etc.
3774 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
3775 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
3776 yy_yypstack, yydumpstack): Likewise.
3777 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
3778 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
3779 Likewise.
3780 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
3781 yy_stack_print, yyparse): Likewise.
3782 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
3783 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
3784 * lib/bitset.c (bitset_print): Likewise.
3785 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
3786 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
3787 * lib/bitsetv.c (bitsetv_dump): Likewise.
3788 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
3789 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
3790 Likewise.
3791 * src/LR0.c (allocate_itemsets): Likewise.
3792 * src/gram.h (rule_number, rule): Likewise.
3793 * src/lalr.h (goto_number): Likewise.
3794 * src/nullable.c (nullable_compute): Likewise.
3795 * src/output.c (prepare_rules): Likewise.
3796 * src/relation.c (relation_print, relation_digraph): Likewise.
3797 * src/relation.h (relation_node): Likewise.
3798 * src/state.h (state_number, transitions, errs, reductions,
3799 struct state): Likewise.
3800 * src/symtab.h (symbol_number, struct symbol): Likewise.
3801 * src/tables.c (vector_number, tally, action_number,
3802 default_goto, goto_actions): Likewise.
3803 * tests/existing.at (GNU Cim Grammar): Likewise.
3804 * tests/regression.at (Web2c Actions): Likewise.
3805
3806 * src/output.c (muscle_insert_short_int_table): Renamed from
3807 muscle_insert_short_table. All uses changed.
3808
d6328241
PH
38092004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
3810
3811 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
3812 (declaration): Replace expected_conflicts with expected_sr_conflicts.
3813 Add %expect-rr rule.
4f16766c 3814
d6328241
PH
3815 * src/scan-gram.l: Recognize %expect-rr.
3816
4f16766c 3817 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 3818 expected_conflicts.
4f16766c 3819 (expected_rr_conflicts): Declare.
d6328241
PH
3820
3821 * src/conflicts.c (expected_sr_conflicts): Rename from
3822 expected_conflicts.
3823 (expected_rr_conflicts): Define.
3824 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
3825 for GLR parsers.
3826 Use expected_sr_conflicts in place of expected_conflicts.
3827 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 3828
d6328241 3829 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 3830
1452af69
PE
38312004-03-08 Paul Eggert <eggert@gnu.org>
3832
3833 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 3834 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
3835
3836 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
3837 in lalr1.cc.
3838 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
3839 * src/scan-gram.l (scan_integer): New function.
3840 ({int}): Use it.
3841 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
3842 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
3843 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
3844 Say "long int", not "long", for uniformity with GNU style.
3845
006d217d
PE
38462004-02-25 Paul Eggert <eggert@twinsun.com>
3847
3848 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
3849 compilers. This fixes a problem with Intel's C++ compiler being
3850 chatty, reported by Guido Trentalancia in
161a71f3 3851 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 3852
c2729758
ADL
38532004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
3854
3855 Support %destructor and merge error locations in lalr1.cc.
3856
3857 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
3858 (Parser::stos_): Define unconditionally.
3859 (Parser::destruct_): New method. Generate its body with
3860 b4_yydestruct_generate.
3861 (Parser::error_start_): New attribute.
3862 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
3863 token which are discarded.
3864 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
3865 error_start_ when erroneous token are discarded.
3866 (Parser::parse) <yyerrlab1>: Compute the location of the error
3867 token so that it covers all the discarded tokens.
3868 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
3869 it can be called with `%skeleton "lalr1.cc"', and do that.
3870
dd0e0635
PE
38712004-02-02 Paul Eggert <eggert@twinsun.com>
3872
3873 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
3874 $(top_srcdir)/lib and ../lib. This fixes a bug reported
3875 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
3876 There's no need to mention top_builddir since Automake does that
3877 for us.
3878 (INCLUDES): Remove, as Automake says it's obsolescent.
3879 Contents migrated into AM_CPPFLAGS as described above.
3880 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
3881
38822004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
3883
3884 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
3885 (yyreportSyntaxError): Handle case where lookahead token is
3886 YYEMPTY.
3887
be16239b
PH
38882004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3889
3890 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
3891 resulting parsers are compilable with C++.
3892
5fa90832
PE
38932003-12-23 Paul Eggert <eggert@twinsun.com>
3894
3895 * config/depcomp, config/install-sh: Sync with Automake 1.8.
3896 * src/output.c (output_skeleton): Rename local var.
3897 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
3898 Bison tokens, as this runs afoul of the 2003-10-07 change that
3899 disallowed NUL bytes in character constants or string literals.
3900
3901 * tests/local.at: Require Autoconf 2.59's Autotest.
3902 * tests/testsuite.at: Don't include local.at, since we now assume
3903 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
3904 including it.
3905 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
3906 multiple inclusion warnings.
dd0e0635 3907
b165c324
AD
39082003-12-02 Akim Demaille <akim@epita.fr>
3909
3910 * doc/bison.texinfo (How Can I Reset the Parser): More about start
3911 conditions.
3912 From Bruno Haible.
3913
26e06a21
ADL
39142003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
3915
3916 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
3917
92ac3705
PE
39182003-10-07 Paul Eggert <eggert@twinsun.com>
3919
6a5ecb38
PE
3920 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
3921 if testsuite doesn't exist.
3922
92ac3705
PE
3923 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
3924 literals, unfortunately.
3925 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
3926 Complain about NUL bytes in character constants or string literals.
3927
91d2c560
PE
39282003-10-05 Paul Eggert <eggert@twinsun.com>
3929
3930 * NEWS: Don't document %no-default-prec, as it's still
3931 too experimental.
3932 * doc/bison.texinfo: Document %no-default-prec only if
3933 the defaultprec flag is set. Normally it's not.
3934
0cc3da3a
PE
39352003-10-04 Paul Eggert <eggert@twinsun.com>
3936
3937 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
3938 non-modifiable lvalue, instead of a modifiable one.
3939 * doc/bison.texinfo (Actions): Document that $$ can
3940 be assigned to. Do not claim that $$ and $N are
3941 array element references: user code should not rely on this.
3942
22fccf95
PE
39432003-10-01 Paul Eggert <eggert@twinsun.com>
3944
3945 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
3946 (grammar_declaration): Use it.
3947 * src/scan-gram.l: New token %no-default-prec.
3948 * tests/conflicts.at: Revamp tests to use %no-default-prec.
3949 * NEWS, doc/bison.texinfo: Document the above.
3950
fc8f2965
AD
39512003-10-01 Akim Demaille <akim@epita.fr>
3952
3953 VCG no longer supports long_straight_phase.
3954
3955 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
3956 * src/print_graph.c (print_graph): Adjust.
3957
39a06c25
PE
39582003-09-30 Frank Heckenbach <frank@g-n-u.de>
3959 and Paul Eggert <eggert@twinsun.com>
3960
3961 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
3962 Table of Symbols): Document %default-prec.
3963 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
3964 (grammar_declaration): Set default_prec on %default-prec.
3965 * src/scan-gram.l (%default-prec): New token.
3966 * src/reader.h (default_prec): New flag.
3967 * src/reader.c: Likewise.
3968 (packgram): Handle it.
3969 * tests/conflicts.at (%default-prec without %prec,
3970 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 3971
39a06c25
PE
39722003-09-30 Paul Eggert <eggert@twinsun.com>
3973
3974 * tests/testsuite.at: Include local.at, not input.at, fixing
3975 a typo in the 2003-08-25 patch.
3976
62b6aef9
AD
39772003-08-27 Akim Demaille <akim@epita.fr>
3978
3979 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
3980 GCC warnings.
3981
89e1cc61
AD
39822003-08-26 Akim Demaille <akim@epita.fr>
3983
3984 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
3985 "<\#" to avoid magic from Gnus when posting parts of this script.
3986
a08460b0
AD
39872003-08-26 Akim Demaille <akim@epita.fr>
3988
3989 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
3990 (Parser::parse): here.
3991 Adjust: nerrs and errstatus is now replaced by...
3992 (Parser::nerrs_, Parser::errstatus_): New.
3993
603f1cfd
AD
39942003-08-25 Akim Demaille <akim@epita.fr>
3995
3996 * config/announce-gen, Makefile.cfg: New.
3997 * Makefile.am: Adjust.
3998 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
3999 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
4000
cd3684cf
AD
40012003-08-25 Akim Demaille <akim@epita.fr>
4002
4003 When reducing initial empty rules, Bison parser read an initial
4004 location that is not defined. This results in garbage, and that
4005 affects Bison's own parser. Therefore we need (i) to extend Bison
4006 to support a means to initialize this location, and (ii) to use
4007 this CVS Bison to fix CVS Bison's parser.
4008
4009 * src/reader.h, reader.c (epilogue_augment): Remove, replace
4010 with...
4011 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
4012 * src/parse-gram.y: Adjust.
4013 (%initial-action): New.
4014 (%error-verbose): Since we require CVS Bison, there is no reason
4015 not to use it.
4016 * src/scan-gram.l: Adjust.
4017 * src/Makefile.am (YACC): New, to make sure we use our own parser.
4018 * data/yacc.c (yyparse): Use b4_initial_action.
4019
4e03e201
AD
40202003-08-25 Akim Demaille <akim@epita.fr>
4021
4022 * doc/bison.texinfo: Don't promote stdout for error messages.
4023
8c182d05
AD
40242003-08-25 Akim Demaille <akim@epita.fr>
4025
4026 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
4027 From Alexandre Duret-Lutz.
4028
6a60c4cf
PE
40292003-08-25 Akim Demaille <akim@epita.fr>
4030
4031 Version 1.875c.
4032
25f66e1a
AD
40332003-08-25 Akim Demaille <akim@epita.fr>
4034
4035 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
4036 Use them.
4037
5348bfbe
AD
40382003-08-25 Akim Demaille <akim@epita.fr>
4039
4040 * data/lalr1.cc (Parser::reduce_print_): New.
4041 Use it.
4042
47301314
AD
40432003-08-25 Akim Demaille <akim@epita.fr>
4044
4045 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
4046 error recovery loops. This patch is based on
161a71f3 4047 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
4048 Also, augment the similarity between lalr1.cc and yacc.c.
4049 Note: the locations of error recovery rules are not correct yet.
4050
4051 * data/lalr1.cc: Comment changes to augment the similarity between
4052 lalr1.cc and yacc.c.
4053 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
4054 (yyerrlab1): Remove, but where it used to be (now the bottom part of
4055 yyerrlab), when hitting EOF, pop the whole stack here instead of
4056 merely falling thru the default error handling mechanism.
4057 (yyerrorlab): New label, with the old contents of YYERROR,
4058 plus the following change: pop the stack of rhs corresponding
4059 to the production that invoked YYERROR. That is how Yacc
4060 behaves (required by POSIX).
4061 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
4062 fail.
4063
1f7a61ff
AD
40642003-08-25 Akim Demaille <akim@epita.fr>
4065
4066 Tune local.at so that people can "autom4te -l autotest calc.at -o
4067 calc" for instance, to extract a sub test suite.
4068
4069 * tests/testsuite.at: Move the initialization, Autotest version
4070 requirement, and AT_TESTED invocation into...
4071 * tests/local.at: here.
4072 * tests/testsuite.at: Include it for compatibility with Autoconf
4073 2.57.
4074 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
4075 be ignore.
4076
327b5b56
PE
40772003-08-04 Paul Eggert <eggert@twinsun.com>
4078
4079 Rework code slightly to avoid gcc -Wtraditional warnings.
4080 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
4081 The returned value is now stored in *YY0. All callers changed.
4082 * src/output.c (merge_output): Adjust to the above change.
4083
0051e3ed
PE
40842003-07-26 Paul Eggert <eggert@twinsun.com>
4085
4086 * data/glr.c (YYASSERT): New macro.
4087 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
4088 yyresolveStates, yyprocessOneStack):
4089 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
4090 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 4091
137437c6
PE
40922003-07-25 Paul Eggert <eggert@twinsun.com>
4093
5b620e06
PE
4094 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
4095 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 4096 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
4097 by Frank Heckenbach, though I have omitted the structure-initialization
4098 part of his glr-knr.diff patch since I recall that the Portable
4099 C Compiler didn't require that change.
4100
137437c6
PE
4101 Let the user specify how to allocate and free memory.
4102 Derived from a suggestion by Frank Heckenbach in
161a71f3 4103 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
4104 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
4105 All uses of free, malloc, realloc changed to use these macros,
4106 and unnecessary casts removed.
4107 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
4108
ddb85ca5
PE
41092003-07-06 Matthias Mann <MatthiasMann@gmx.de>
4110
4111 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
4112 use s.empty() rather than s == "" to test for empty string; see
161a71f3 4113 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
4114 (trivial change)
4115
39910e09
AD
41162003-06-25 Akim Demaille <akim@epita.fr>
4117
4118 * config/depcomp, config/install-sh: Update from masters.
4119
0ae99356
PE
41202003-06-20 Paul Eggert <eggert@twinsun.com>
4121
4122 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
4123 and return properly parenthesized result.
4124 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
4125 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
4126 Remove unnecessary parentheses from uses.
4127 * doc/bison.texinfo (Location Default Action): Describe the
4128 conventions for parentheses.
4129
cd05d13c
PE
41302003-06-19 Paul Eggert <eggert@twinsun.com>
4131
81fd08ca
PE
4132 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
4133 yyreportTree): Do not assume that size_t is the same width as int,
4134 when printing sizes. Print sizes using an unsigned format.
4135 Problem reported by Frank Heckenbach in
161a71f3 4136 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 4137
cd05d13c
PE
4138 Port to Forte Developer 7 C compiler.
4139 * data/glr.c (struct YYLTYPE): If locations are not being used,
4140 declare a single dummy member, as empty structs do not conform
4141 to the C standard.
4142 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
4143 the Forte Developer 7 C compiler complains that end-of-loop
4144 code is not reached.
4145
4dcf140b
PE
41462003-06-17 Paul Eggert <eggert@twinsun.com>
4147
4148 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
4149 avoid warnings from picky compilers about redefinition of PARAMS.
4150
8dd76bee
PE
41512003-06-17 Paul Eggert <eggert@twinsun.com>
4152
4153 Version 1.875b.
4154
4155 * NEWS: Document 1.875b.
4156
4157 * lib/bbitset.h: Do not include config.h; that's the includer's job.
4158 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
4159 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
4160 Don't use 'index' in comments, as it's a builtin fn on some hosts.
4161 * lib/bitset_stats.c: Include gettext.h unconditionally, as
4162 per recent gettext manual's suggestion.
4163 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
4164 Use prototypes, not old-style definitions.
4165 * lib/lbitset.c (lbitset_unused_clear): Likewise.
4166 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
4167 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
4168 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
4169 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
4170 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
4171 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
4172 vbitset_or_and_cmp, vbitset_copy): Likewise.
4173
4174 * lib/libiberty.h: Do not include config.h; that's the includer's job.
4175 Do not include <stdlib.h>.
4176 (PARAMS): Define unconditionally for C89.
4177 (ATTRIBUTE_NORETURN): Remove.
4178 (ATTRIBUTE_UNUSED): Define unconditionally.
4179
4180 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 4181 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
4182 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
4183 * lib/vbitset.c, lib/vbitset.h: New files.
4184 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
4185 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
4186 from libbitset.
4187
4188 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
4189 `How Can I Reset @code{yyparse}', since texinfo does not allow
4190 arbitrary @ in node names.
4191
4192 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
4193 shouldn't be needed according to the gettext 0.12.1 documentation
4194 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 4195 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 4196 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 4197 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 4198
8dd76bee
PE
4199 * lib/.cvsignore: Add stdbool.h.
4200 * m4/.cvsignore: Add nls.m4, po.m4.
4201
4202 Upgrade to CVS gnulib.
4203 * stdbool_.h: File renamed from stdbool.h.in.
4204 * configure.ac (AM_STDBOOL_H): Invoke this instead of
4205 AC_HEADER_STDBOOL.
4206 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
4207 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
4208 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
4209 (MOSTLYCLEANFILES): New var.
4210 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
4211 (stdbool.h): New rule.
4212 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
4213 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
4214 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
4215 m4/quote.m4: Upgrade to today's gnulib.
4216
4217 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
4218 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
4219 the tests right now.
4220 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
4221 yyerror are declared before use; C99 requires this.
4222
25005f6a
PH
42232003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4224
4225 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
4226 first.
4227 (yyrecoverSyntaxError): Correct the logic for setting and testing
4228 yyerrState.
4229 Correct comment on handling EOF.
4230 Allow states with only a default reduction, rather than failing
8dd76bee 4231 (I can't quite reconstruct why these were not allowed before).
25005f6a 4232
137437c6 4233 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 4234 buffer overruns, corrupting state.
8dd76bee
PE
4235
4236 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
4237 definition.
4238 * src/reader.h (max_left_semantic_context): New variable declaration.
4239 * src/scan-gram.l (max_left_semantic_context): Define.
4240 (handle_action_dollar): Update max_left_semantic_context.
4241 * data/glr.c (YYMAXLEFT): New definition.
4242 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
4243 (yyresolveAction): Ditto.
4244
4245 Fixes to problems with location handling in GLR parsers reported by
4246 Frank Heckenbach (2003/06/05).
4247
4248 * data/glr.c (YYLTYPE): Make trivial if locations not used.
4249 (YYRHSLOC): Add parentheses, and define only if locations used.
4250 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
4251 locations not used.
4252 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
4253 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 4254
25005f6a
PH
4255 * tests/cxx-type.at: Exercise location information; update tests
4256 to differentiate output with and without locations.
8dd76bee 4257 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
4258 because default YYLTYPE not yet defined.
4259 Change semantic actions to compute strings, rather than printing
4260 them directly (to test proper passing of semantics values). Change
4261 output to prefix notation and update test data and expected results.
4262 (yylex): Track locations.
4263 (stmtMerge): Return value rather than printing, and include arguments
4264 in value.
8dd76bee 4265
711f40b7
PE
42662003-06-03 Paul Eggert <eggert@twinsun.com>
4267
4268 Avoid warnings generated by GCC 2.95.4 when Bison is
4269 configured with --enable-gcc-warnings.
4270 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
4271 yy::]b4_parser_class_name[::translate_,
4272 yy::Stack::operator[] (unsigned),
4273 yy::Stack::operator[] (unsigned) const,
4274 yy::Slice::operator[] (unsigned),
4275 yy::Slice::operator[] (unsigned) const):
4276 Rename local vars to avoid warnings.
4277 * tests/glr-regression.at (Improper handling of embedded actions
4278 and $-N in GLR parsers): Remove unused local variable from yylex.
4279 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
4280 (void) as arg when not pure, since we now assume C89 when building
4281 Bison. Pacify GCC by using parameter.
4282
ac695f7d
PE
42832003-06-02 Paul Eggert <eggert@twinsun.com>
4284
4285 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
4286 yy::Location::lines, yy::Location::columns): Rename arguments
4287 to avoid shadowing; this removes a warning generated by GCC 3.3.
4288
26ec81e0
PE
42892003-06-01 Paul Eggert <eggert@twinsun.com>
4290
4291 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
4292 to g++, as GCC 3.3 complains if you do it.
4293 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
4294 everything that WARNING_CFLAGS has, except omit warnings
4295 not suitable for C++.
4296 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
4297 * tests/atlocal.in (CXXFLAGS): New var.
4298 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
4299
4300 Fix a GLR parser bug I reported in February; see
161a71f3 4301 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
4302 The problem was that GLR parsers did not conform to the C standard,
4303 because actions like { $1 = $2 + $3; } expanded to expressions
4304 that invoked YYFILL in separate subexpressions, and YYFILL assigned
4305 to a local variable. The C standard says that expressions
4306 like (var = f ()) + (var = f ()) have undefined behavior.
4307 Another problem was that GCC sometimes issues warnings that
4308 yyfill and its parameters are unused.
4309
4310 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
4311 as possibly unused.
4312 (yyfill): New function.
4313 (YYFILL): Use it.
4314 (yyuserAction): Change type of yynormal to bool, so that it matches
4315 the new yyfill signature. Mark it as possibly unused.
4316
4317
4318 Follow up on a bug I reported in February, where a Bison-generated
4319 parser can loop. Provide a test case and a fix for yacc.c. I
4320 don't have a fix for lalr1.cc or for glr.c, unfortunately.
4321 The original bug report is in:
161a71f3 4322 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
4323
4324 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
4325 macro's size was becoming unwieldy.
4326 (yyerrlab): Do not discard an empty lookahead symbol, as this
4327 might destroy garbage.
4328 (yyerrorlab): New label, with the old contents of YYERROR,
4329 plus the following change: pop the stack of rhs corresponding
4330 to the production that invoked YYERROR. That is how Yacc
4331 behaves, and POSIX requires this behavior.
4332 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
4333 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
4334 Define 'alarm' to do nothing if unistd.h is not available.
4335 Add a new rule "exp: '-' error;" to test the above change to
4336 data/yacc.c. Use 'alarm' to abort any test taking longer than
4337 10 seconds, as it's probably looping.
4338 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
4339 Also, the new yacc.c generates two fewer diagnostics for an
4340 existing test.
4341
d0829076
PE
43422003-05-24 Paul Eggert <eggert@twinsun.com>
4343
c6ae27df
PE
4344 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
4345 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
4346 This fixes a problem reported by John Bowman when the Compaq/HP
4347 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
4348 -ansi -Wall -gall).
4349 * data/yacc.c (union yyalloc): Likewise.
4350 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 4351
d0829076
PE
4352 Switch from 'int' to 'bool' where that makes sense.
4353
4354 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
4355 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
4356 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
4357 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
4358 Return or accept bool, not int. All callers changed.
4359 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
4360 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
4361 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
4362 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
4363 bitset_or_and_cmp_): Likewise.
4364 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
4365 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
4366 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
4367 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
4368 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
4369 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
4370 bitset_stats_or_and_cmp): Likewise.
4371 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
4372 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
4373 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
4374 ebitset_xor_cmp): Likewise.
4375 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
4376 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
4377 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
4378 lbitset_xor_cmp): Likewise.
4379 * lib/bbitset.h: Include <stdbool.h>.
4380 (struct bitset_vtable): The following members now return bool, not
4381 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
4382 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
4383 or_and_cmp).
4384 * src/conflicts.c (count_rr_conflicts): Likewise.
4385 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
4386 All uses changed.
4387 * lib/ebitset.c (ebitset_obstack_init): Likewise.
4388 * lib/lbitset.c (lbitset_obstack_init): Likewise.
4389 * src/getargs.c (debug_flag, defines_flag, locations_flag,
4390 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
4391 graph_flag): Likewise.
4392 * src/getargs.h (debug_flag, defines_flag, locations_flag,
4393 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
4394 graph_flag): Likewise.
4395 * src/output.c (error_verbose): Likewise.
4396 * src/output.h (error_verbose): Likewise.
4397 * src/reader.c (start_flag, typed): Likewise.
4398 * src/reader.h (typed): Likewise.
4399 * src/getargs.c (LOCATIONS_OPTION): New constant.
4400 (long_options, getargs): Use it.
4401 * src/lalr.c (build_relations): Use bool, not int.
4402 * src/nullable.c (nullable_compute): Likewise.
4403 * src/print.c (print_reductions): Likewise.
4404 * src/tables.c (action_row, pack_vector): Likewise.
4405 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
4406 * src/output.c (prepare): Use it.
4407 * src/output.c (token_definitions_output,
4408 symbol_destructors_output, symbol_destructors_output): Use string,
4409 not boolean integer, to keep track of whether to output separator.
4410 * src/print_graph.c (print_core): Likewise.
4411 * src/state.c (state_rule_lookaheads_print): Likewise.
4412
4413 * config/install-sh: Sync from automake 1.7.5.
4414
6b2584b7
PE
44152003-05-14 Paul Eggert <eggert@twinsun.com>
4416
4417 * src/parse-gram.y (rules_or_grammar_declaration): Require a
4418 semicolon after a grammar declaration, in the interest of possible
4419 future changes to the Bison input language.
4420 Do not allow a stray semicolon at the start of the grammar.
4421 (rhses.1): Allow one or more semicolons after any rule, including
4422 just before "|" as required by POSIX.
4423 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
4424 grammar.
4425
caf37a36
ADL
44262003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
4427
4428 %parse-param support for lalr1.cc.
4429
4430 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
4431 b4_cc_constructor_calls, b4_cc_constructor_call,
4432 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
4433 definitions.
4434 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
4435 parse-param arguments.
4436 (yy::b4_parser_class_name): Declare instance variables to
4437 hold parse-param arguments.
4438 * tests/calc.at: s/value/semantic_value/ because value clashes
4439 with a member of yy::b4_parser_class_name. Adjust C++ code
4440 to handle %parse-param. Enable %parse-param test in C++.
4441
3ab37077
PE
44422003-05-12 Paul Eggert <eggert@twinsun.com>
4443
4444 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
4445 English a bit. Fix fclose typo. Change "const char" to "char
4446 const", and use ANSI C rather than K&R for "main". Suggest
4447 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
4448 and suggest yy_switch_to_buffer.
4449
44502003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
4451
4452 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
4453 C89. This avoids a diagnostic on compilers that define __STDC__
4454 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 4455 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 4456
e743727f
PE
44572003-05-03 Paul Eggert <eggert@twinsun.com>
4458
4459 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
4460 Do not overrun array bounds.
4461 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 4462 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 4463
916708d5
AD
44642003-04-29 Akim Demaille <akim@epita.fr>
4465
4466 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
4467 * src/getargs.c, src/getargs.h: here, as bool, not int.
4468 (nondeterministic_parser): New.
4469 * src/parse-gram.y, src/scan-gram.l: Support
4470 %nondeterministic-parser.
4471 * src/output.c (prepare): Use nondeterministic_parser instead
4472 of glr_parser where appropriate.
4473 * src/tables.c (conflict_row, action_row, save_row)
4474 (token_actions, token_actions, pack_vector): Ditto.
4475
a06ea4aa
AD
44762003-04-29 Akim Demaille <akim@epita.fr>
4477
4478 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
4479
211074ca
AD
44802003-04-29 Akim Demaille <akim@epita.fr>
4481
4482 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
4483 with %pure-parser and %locations to exercise the patch from Yakov
4484 Markovitch below.
4485
6175ffe3
PE
44862003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
4487
4488 * data/yacc.c: (b4_lex_param): Corrected for the case where
4489 %lex-param is provided and %pure-parser isn't.
4490
b1e95857
PE
44912003-04-27 Paul Eggert <eggert@twinsun.com>
4492
4493 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 4494 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
4495 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
4496 if it is not defined.
4497 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
4498
acda9df6
PE
44992003-04-26 Paul Eggert <eggert@twinsun.com>
4500
3470c57b
PE
4501 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
4502 Declare to be of type suitable for the ninf value itself, not of
4503 type suitable for the corresponding table, since the latter might
4504 be unsigned but the ninf value might be negative. This fixes a
4505 bug reported by Alexandre Duret-Lutz in
161a71f3 4506 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 4507
acda9df6
PE
4508 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
4509 invokes it. We shouldn't invoke it twice because it will attempt
4510 to put error.o in the archive twice. This fixes a glitch reported
4511 by Martin Mokrejs in
161a71f3 4512 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 4513
b5250f26
PE
45142003-04-21 Paul Eggert <eggert@twinsun.com>
4515
4516 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
4517 to gnulib.
4518
089ac0f1
PE
45192003-04-21 Yakov Markovitch <Markovitch@iso.ru>
4520
4521 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
4522 Fix obvious typo that results in uncompilable GLR parsers
4523 when both %pure-parser and %locations are used. (trivial change)
4524
5ededac6
PE
45252003-04-17 Paul Eggert <eggert@twinsun.com>
4526
1b8f2fff
PE
4527 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
4528 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
4529 Do not insert the expected token via unput, as this runs afoul
4530 of a POSIX-compatibility bug in flex 2.5.31.
4531 All uses changed to BEGIN the parent state,
4532 since we no longer insert the expected token via unput.
4533 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
4534 that is no longer emitted after the above change.
4535
5ededac6
PE
4536 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
4537 the first one. This change is from Paul Hilfinger, and it fixes
4538 regression reported by Werner Lemberg in
161a71f3 4539 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
4540
4541 (resolve_sr_conflict): Don't invoke state_errs_set
4542 unless one or more tokens have been explicitly made errors.
4543 Otherwise, the above change causes Bison to abort.
4544
4545 * tests/existing.at (GNU pic Grammar): New test case, taken from
4546 Lemberg's email.
4547
b8be9132
AD
45482003-03-31 Akim Demaille <akim@epita.fr>
4549
4550 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
4551
d423d460
AD
45522003-03-31 Akim Demaille <akim@epita.fr>
4553
4554 * src/output.c (prepare_symbols): Avoid trailing spaces in the
4555 output.
4556
c7e441b4
AD
45572003-03-31 Akim Demaille <akim@epita.fr>
4558
4559 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
4560 From Paul Hilfinger.
4561
231897ad
AD
45622003-03-29 Akim Demaille <akim@epita.fr>
4563
4564 * m4/error.m4: Do not put under dynamic conditions some code which
4565 expansion is under static control.
4566
5b066063
AD
45672003-03-29 Akim Demaille <akim@epita.fr>
4568
4569 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
4570
22a74fec
AD
45712003-03-29 Akim Demaille <akim@epita.fr>
4572
4573 * doc/bison.texinfo (Strings are Destroyed): New.
4574
0eee27e7
PE
45752003-03-13 Paul Eggert <eggert@twinsun.com>
4576
4577 * .cvsignore: Add configure.lineno.
4578 * src/.cvsignore: Add yacc.
4579 * tests/.cvsignore: Add testsuite.log.
4580 * doc/fdl.texi: Sync with latest FSF version.
4581
f61aad93
PE
45822003-03-12 Paul Eggert <eggert@twinsun.com>
4583
537636c7
PE
4584 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
4585 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
4586 cursor, instead of leaving it undefined. This fixes a bug
4587 reported by Tim Van Holder in
161a71f3 4588 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
4589 * tests/input.at (Torturing the Scanner): Test the scanner on
4590 an empty input file, which was Tim Van Holder's test case.
4591
4592 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
4593 <sys/resource.h> can be included, include sys/time.h and
4594 sys/times.h first, if available. This works around the SunOS
4595 4.1.4 porting bug reported by Bruce Becker in
161a71f3 4596 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
4597
4598 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
4599 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
4600 AC_HEADER_SYS_WAIT.
4601
f61aad93
PE
4602 Merge changes from gnulib. This was prompted because the CVS
4603 snapshot didn't build on Solaris 7 due to strnlen problems.
4604
4605 These changes need to be merged back into gnulib:
4606 * lib/hash.c: Include <stdbool.h> unconditionally.
4607 * m4/onceonly.m4 (m4_quote): New macro.
4608 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
4609 Quote AC_FOREACH variable-expansions properly.
4610 The 2003-01-03 obstack.h change also needs merging.
4611 {end of changes requiring merging}
5b066063 4612
f61aad93
PE
4613 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
4614 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
4615 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
4616 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
4617 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
4618 New files, imported from gnulib.
4619 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
4620 above.
4621
4622 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
4623 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
4624 gnulib sources.
4625
4626 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
4627 Add.
4628 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
4629 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
4630 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
4631 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
4632 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
4633 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
4634 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
4635 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
4636 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
4637 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
4638 (jm_PREREQ_ARGMATCH): Remove.
4639 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
4640 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
4641
4642 * src/system.h: Include <stdbool.h> unconditionally.
4643
4644 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
4645 assuming at least C89 in the bitset code for some time now.
4646
d2ffe116
AD
46472003-03-03 Akim Demaille <akim@epita.fr>
4648
4649 * ro.po: New.
4650
052826fd
AD
46512003-03-02 Akim Demaille <akim@epita.fr>
4652
4653 * doc/bison.texinfo (Table of Symbols): Reactivate the
4654 documentation for %lex-param, and %parse-param.
4655
c4749565
AD
46562003-03-02 Akim Demaille <akim@epita.fr>
4657
4658 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
4659 generate verbose error messages.
4660 Use the number of tokens as an upper bound in yytname, as it
4661 cannot be a non terminal.
4662
d5286af1
AD
46632003-03-02 Akim Demaille <akim@epita.fr>
4664
4665 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
4666 message.
4667
22e304a6
AD
46682003-03-02 Akim Demaille <akim@epita.fr>
4669
22e304a6
AD
4670 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
4671 Use them to exercise yycheck overrun.
4672 Based on Andrew Suffield's grammar.
4673
67a25fed
AD
46742003-03-02 Akim Demaille <akim@epita.fr>
4675
4676 Create tests/local.at for Bison generic testing macros.
4677
4678 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
4679 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
4680 This new file.
4681 * tests/calc.at (AT_CHECK_CALC): Adjust.
4682 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
4683 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
4684 * tests/local.at: here.
4685 (AT_COMPILE_CXX): Tags the tests using it as c++.
4686 Ignore the test if CXX is not functional.
4687
9c2b381f
PE
46882003-03-01 Paul Eggert <eggert@twinsun.com>
4689
4690 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
4691 not loc->end, since loc->end might contain garbage and this leads
4692 to undefined behavior on some platforms.
4693 (id_loc, token_start): Use (IF_LINTed) initial values that do not
4694 depend on *loc, so that the reader doesn't give the the false
4695 impression that *loc is initialized.
4696 (<INITIAL>"%%"): Do not bother setting code_start, since its value
4697 does not survive the return.
4698
0433ba88
AD
46992003-03-01 Akim Demaille <akim@epita.fr>
4700
4701 * src/scan-gram.l (code_start): Always initialize it when entering
4702 into yylex, as SC_EPILOGUE is activated *before* the corresponding
4703 yylex invocation. An alternative would be making it static, but
4704 then it starts with the second %%'s beginning, instead of its end.
4705
b305ea69
PE
47062003-02-28 Paul Eggert <eggert@twinsun.com>
4707
4708 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
4709 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 4710 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 4711
c3d25e01
PE
47122003-02-26 Paul Eggert <eggert@twinsun.com>
4713
4714 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
4715 Remove Sequent/Pyramid discussion (nobody uses them any more).
4716 Merge VMS and MS-DOS discussion; these ports may well be dead
4717 but let's keep mentioning them for now. Put <> around email
4718 addresses. Add copyright notice.
4719
c267ffbc
PE
47202003-02-24 Paul Eggert <eggert@twinsun.com>
4721
4722 * data/glr.c (yy_reduce_print): yylineno -> yylno,
4723 to avoid collision with flex use of yylineno.
4724 Problem reported by Bruce Lilly in
161a71f3 4725 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
4726 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
4727 * data/yacc.c (yy_reduce_print): Likewise.
4728
4729 * config/depcomp: Sync with Automake 1.7.3.
4730
f939fc12
AD
47312003-02-21 Akim Demaille <akim@epita.fr>
4732
4733 * data/lalr1.cc: Use temporary variables instead of casts to
4734 change integer types.
4735 Suggested by Paul Eggert.
4736
95923bd6
AD
47372003-02-21 Akim Demaille <akim@epita.fr>
4738
4739 * doc/bison.texinfo: Use "location" consistently to refer to @n,
4740 to avoid confusions with lalr1.cc's notion of Position.
4741 Suggested by Paul Eggert.
4742
2cdc240e
AD
47432003-02-20 Akim Demaille <akim@epita.fr>
4744
4745 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
4746 before initial_columns.
4747 (location.hh): Use consistent variable names when defining the
4748 operator<<.
4749 Use "last" so that we subtract from Positions, not from unsigned.
4750
5d003116
AD
47512003-02-20 Akim Demaille <akim@epita.fr>
4752
4753 * data/lalr1.cc (position.hh): New subfile, including the extended
4754 and Doxygen'ed documentation of class Position.
4755 (location.hh): Use it.
4756 Document a` la Doxygen.
ba1ecc07 4757 With the help of Benoit Perrot.
5d003116 4758
d02b25f9
AD
47592003-02-20 Akim Demaille <akim@epita.fr>
4760
4761 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
4762 AT_YACC_IF.
4763 Redefine AT_YYERROR_SEES_LOC_IF using it.
4764 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
4765 not defined.
4766 Don't use the location in yy::Parser::error_ and
4767 yy::Parser::print_ when not %locations.
4768 Activate more lalr1.cc tests.
4769
0d1c3a04
AD
47702003-02-19 Akim Demaille <akim@epita.fr>
4771
4772 * data/lalr1.cc: When displaying a line number, be sure to make it
4773 an int.
4774
60a777aa
AD
47752003-02-19 Akim Demaille <akim@epita.fr>
4776
4777 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
4778 Remove, useless.
4779 (YYABORT, YYACCEPT, YYERROR): New.
4780 * tests/calc.at: Renable the lalr1.cc test.
4781
0b86fc41
AD
47822003-02-19 Akim Demaille <akim@epita.fr>
4783
4784 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
4785 error recovery, mixing with/without pops and discarding of the
4786 lookahead.
4787 Exercise YYERROR.
4788 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
4789
da99a5dc
PE
47902003-02-17 Paul Eggert <eggert@twinsun.com>
4791
4792 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
4793 * tests/testsuite.at (AT_COMPILE): Use them.
4794 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 4795 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 4796
93b8c255
PE
47972003-02-12 Paul Eggert <eggert@twinsun.com>
4798
4799 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
4800 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 4801 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
4802 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
4803 Check for malloc failure, for consistency with yacc.c.
4804 (yytname_size): Remove, for consistency with yacc.c.
4805
4806 The bug still remains in data/lalr1.cc, as I didn't have time
4807 to fix it there.
4808
7548fed2
AD
48092003-02-06 Akim Demaille <akim@epita.fr>
4810
4811 * configure.ac (GXX): Rename as...
4812 (CXX): this, to keep the original Autoconf semantics.
4813 Require 2.57.
4814 * data/lalr1.cc: Fix b4_copyright invocations.
4815 If YYDEBUG is not defined, don't depend upon name_ being defined.
4816 (location.hh): Include string and iostream.
4817 (Position::filename): New member.
4818 (Position::Position ()): New.
4819 (operator<< (Position)): New.
4820 (operator- (Position, int)): New.
4821 (Location::first, Location::last): Rename as...
4822 (Location::begin, Location::end): these, to mock the conventional
4823 iterator names.
4824 (operator<< (Location)): New.
4825 * tests/atlocal.in (CXX): New.
4826 * tests/testsuite.at (AT_COMPILE_CXX): New.
4827 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
4828 locations in a more synthetic way.
4829 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
4830 lalr1.cc is used.
4831 Adjust the C locations to match those from Emacs: first column is
4832 column 0.
4833 Change all the expected results.
4834 Conform to the GCS: simplify the locations when applicable.
4835 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
4836 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
4837 these CPP macros with the m4 macros new defined by...
4838 (AT_CHECK_PUSHDEFS): this, i.e.:
4839 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 4840 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
4841 New macros.
4842 (AT_CHECK_POPDEFS): Undefine them.
4843 (AT_CHECK_CALC_LALR1_CC): New.
4844 Use it for the first lalr1.cc test.
4845
43a176ef
AD
48462003-02-04 Akim Demaille <akim@epita.fr>
4847
4848 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
4849 Location as is defined.
4850
fc049e9c
AD
48512003-02-04 Akim Demaille <akim@epita.fr>
4852
4853 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
4854 name_ being defined.
4855
a737b216
PE
48562003-02-03 Paul Eggert <eggert@twinsun.com>
4857
4858 * src/gram.h (start_symbol): Remove unused decl.
4859
4860 Use more-consistent naming conventions for local vars.
4861
4862 * src/derives.c (derives_compute): Change type of local var from
4863 int to rule_number.
4864 * src/gram.c (grammar_rules_partial_print): Likewise.
4865 * src/print.c (print_core): Likewise.
4866 * src/reduce.c (reduce_grammar_tables): Likewise.
4867
4868 * src/gram.c (grammar_dump): Change name of item_number *
4869 local var from r to rp.
4870 * src/nullable.c (nullable_compute): Likewise.
4871
4872 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
4873
4874 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
4875 for symbol or symbol_number var.
4876 * src/reader.c (grammar_start_symbol_set): Likewise.
4877 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
4878 Likewise.
4879 * src/state.c (transitions_to): Likewise.
4880 * src/state.h: Likewise.
4881 * src/tables.c (symbol_number_to_vector_number): Likewise.
4882
4883 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
4884 char * var.
4885
4886 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
4887 var.
4888
4889 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
4890 var.
4891
4892 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
4893 Use str, not s, for char * var. Use ch, not c, for character var.
4894 Use size for size var.
4895
4896 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
4897 char * var.
4898 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
4899 uniqstr var.
4900 * src/uniqstr.h: Likewise.
4901
4902 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
4903 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
4904 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
4905 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
4906 param to have same name as that of enum, so that we don't use
4907 "s" to stand for a non-state.
4908
68e93ad5
AD
49092003-02-02 Akim Demaille <akim@epita.fr>
4910
4911 * src/scan-skel.l: Scan more than one inert character per yylex
4912 invocation.
4913
92898986
PE
49142003-02-01 Paul Eggert <eggert@twinsun.com>
4915
4916 Version 1.875a.
4917
1d9d5d71
PE
4918 * po/LINGUAS: Add ms.
4919
0435d061
AD
49202003-01-30 Akim Demaille <akim@epita.fr>
4921
4922 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
4923
6029a57f
PH
49242003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4925
4926 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
4927 of $1.
0435d061
AD
4928
4929 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 4930 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 4931 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 4932
6029a57f
PH
4933 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
4934 (b4_rhs_location): Ditto.
0435d061 4935 (yyfill): New function to copy from stack tree into array
6029a57f 4936 incrementally.
0435d061
AD
4937 (yyuserAction): Modify to allow incremental move of semantic values
4938 to rhs array when in GLR mode.
4939 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
4940 as needed.
4941 Remove dummy use of yystack, as there is now a guaranteed use.
4942 (yydoAction): Modify to allow incremental move of semantic values
4943 to rhs array when in GLR mode.
4944 (yyresolveAction): Ditto.
4945 (yyglrShiftDefer): Update comment.
0435d061 4946 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
4947 (yyglrReduce): Ditto.
4948 (yydoAction): Ditto
0435d061 4949
6029a57f
PH
4950 * tests/glr-regr1.at: Rename to ...
4951 * tests/glr-regression.at: Add new regression test for the problems
4952 described above (adapted from S. Eken).
4953 Update copyright notice.
4954 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
4955 * tests/Makefile.am: Ditto.
4956
6cee6297
PE
49572003-01-28 Paul Eggert <eggert@twinsun.com>
4958
4959 * data/lalr1.cc: Do not use @output_header_name@ unless
4960 b4_defines_flag is set. This fixes two bugs reported by
4961 Tim Van Holder in
161a71f3
PE
4962 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
4963 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 4964
b2a836b5
PE
49652003-01-21 Paul Eggert <eggert@twinsun.com>
4966
4967 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
4968 we don't need to worry about yyerrlab1 being reported as an
4969 "unused label" by non-GCC C compilers. The downside is that if
4970 locations are used then a couple of statements are duplicated each
4971 time YYERROR is invoked, but the upside is that the warnings
4972 should vanish.
4973 (yyerrlab1): Move code to YERROR.
4974 (yyerrlab2): Remove. Change uses back to yyerrlab1.
4975 This reverts some of the 2002-12-27 change.
4976
4196b931
PE
49772003-01-17 Paul Eggert <eggert@twinsun.com>
4978
4979 * src/output.c (symbol_printers_output): Fix typo that led
4980 to core dump. Problem reported by Antonio Rus in
161a71f3 4981 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 4982
3ae831b4
AD
49832003-01-13 Akim Demaille <akim@epita.fr>,
4984 Quoc Peyrot <chojin@lrde.epita.fr>,
4985 Robert Anisko <anisko_r@lrde.epita.fr>
4986
4987 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
4988 when the stacks contain one element, as the loop would otherwise
4989 free the last state, and then use the top state (the one we just
4990 popped). This means that the initial elements will not be freed
4991 explicitly, as is the case in yacc.c; it is not a problem, as
4992 these elements have fake values.
4993
e3aa65c5
PE
49942003-01-11 Paul Eggert <eggert@twinsun.com>
4995
4996 * NEWS: %expect-violations are now just warnings, reverting
4997 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
4998 bootstrapping problem reported by Matthias Klose; see
161a71f3 4999 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
5000 * src/conflicts.c (conflicts_print): Likewise.
5001 * tests/conflicts.at (%expect not enough, %expect too much,
5002 %expect with reduce conflicts): Likewise.
5003 * doc/bison.texinfo (Expect Decl): Document this. Also mention
5004 that the warning is enabled if the number of conflicts changes
5005 (not necessarily increases).
5006
5007 * src/getargs.c (version): Update copyright year.
5008
f0057011
AD
50092003-01-09 Akim Demaille <akim@epita.fr>
5010
5011 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
5012
1ee6d2a0
PE
50132003-01-08 Paul Eggert <eggert@twinsun.com>
5014
5015 * Makefile.maint (WGETFLAGS):
5016 New macro, containing "-C off" to disable proxy caches.
5017 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
5018 (rel-check): Use $(WGET) instead of wget.
5019
d4fd77c4
PE
50202003-01-06 Paul Eggert <eggert@twinsun.com>
5021
5022 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
5023 the GLR paper of Scott, Johnstone and Hussain.
5024
464c6927
PE
50252003-01-04 Paul Eggert <eggert@twinsun.com>
5026
d600ee67
PE
5027 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
5028 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
5029 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
5030 (EXTRA_LIBRARIES): New var, for liby.a.
5031 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
5032 (EXTRA_SCRIPTS): New var, for yacc.
5033
464c6927
PE
5034 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
5035 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
5036 Problem reported by Nelson H. F. Beebe.
5037
50382003-01-03 Paul Eggert <eggert@twinsun.com>
5039
5040 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
5041 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5042 when compiling Bison 1.875's `bitset bset = obstack_alloc
5043 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
5044
5045 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
5046 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
5047 grow to a huge size with typical invocation.
d600ee67 5048
464c6927
PE
5049 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
5050 Use the pattern recommended by Autoconf 2.57, except also protect
5051 against double-definition.
5052 * src/system.h: Likewise.
5053 Portability issues reported by Nelson H. F. Beebe.
d600ee67 5054
464c6927
PE
5055 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
5056 All uses changed. Provide a definition in both C and C++.
5057 (yytrue, yyfalse): Define even if defined (__cplusplus).
5058
5059 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
5060 Reported by Nelson H. F. Beebe.
d600ee67 5061
464c6927
PE
5062 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
5063
0f42c7d5
PE
50642003-01-02 Paul Eggert <eggert@twinsun.com>
5065
5066 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
5067 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
5068 Bug reported by Nelson H. F. Beebe.
5069
dc546b0f
PE
50702003-01-01 Paul Eggert <eggert@twinsun.com>
5071
5072 * Version 1.875.
5073
2c09b6a7
PE
50742002-12-30 Paul Eggert <eggert@twinsun.com>
5075
5076 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
5077 Moved here from...
5078 (<INITIAL>","): Here. This causes stray "," to be treated
5079 more uniformly.
5080
dc546b0f 5081 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
5082 last brace in braced code when not in Yacc mode, for compatibility
5083 with Bison 1.35. This resurrects the 2001-12-15 patch to
5084 src/reader.c.
5085
5086 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
5087 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
5088
535c0f63
PE
50892002-12-28 Paul Eggert <eggert@twinsun.com>
5090
5091 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
5092 that of SYM's type. This fixes Debian bug 168069, reported by
5093 Thomas Olsson.
d600ee67 5094
963fcc17
PE
50952002-12-28 Paul Eggert <eggert@twinsun.com>
5096
5097 Version 1.75f.
5098
5099 Switch back to the Yacc style of conflict reports, undoing some
5100 of the 2002-07-30 change.
5101 * doc/bison.texinfo (Understanding): Use Yacc style for
5102 conflict reports. Also, use new way of locating rules.
5103 * src/conflicts.c (conflict_report):
5104 Renamed from conflict_report_yacc, removing the old
5105 'conflict_report'. Translate the entire conflict report at once,
5106 so that we don't assume that "," has the same interpretation in
5107 all languages.
5108 (conflicts_output): Use Yacc-style conflict report for each state,
5109 instead of our more-complicated style.
5110 (conflicts_print): Use Yacc-style conflict report, except print
5111 the input file name when not emulating Yacc.
5112 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
5113 Conflicted Reduction, %expect not enough, %expect too much,
5114 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
5115 * tests/existing.at (GNU Cim Grammar): Likewise.
5116 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
5117
5118 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
5119 fatal): Don't invoke fflush; it's not needed and it might even be
5120 harmful for stdout, as stdout might not be open.
5121 * src/reduce.c (reduce_print): Likewise.
5122
b1efe548
PE
51232002-12-27 Paul Eggert <eggert@twinsun.com>
5124
5125 Fix a bug where error locations were not being recorded correctly.
5126 This problem was originally reported by Paul Hilfinger in
161a71f3 5127 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
5128
5129 * data/yacc.c (yyparse): New local var yylerrsp, to record the
5130 top of the location stack's error locations.
5131 (yyerrlab): Set it. When discarding a token, push its location
5132 onto yylerrsp so that we don't lose track of the error's end.
5133 (yyerrlab1): Now is only the target of YYERROR, so that we can
5134 properly record the location of the action that failed. For GCC
5135 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
5136 GCC warning about yyerrlab1 being unused if YYERROR is unused.
5137 (yyerrlab2): New label, which yyerrlab now falls through to.
5138 Compute the error's location by applying YYLLOC_DEFAULT to
5139 the locations of all the symbols that went into the error.
5140 * doc/bison.texinfo (Location Default Action): Mention that
5141 YYLLOC_DEFAULT is also invoked for syntax errors.
5142 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
5143 Error locations include the locations of all the tokens that were
5144 discarded, not just the last token.
d600ee67 5145
983c5c2c
PE
51462002-12-26 Paul Eggert <eggert@twinsun.com>
5147
b1efe548
PE
5148 * src/files.c: Include quote.h.
5149 (compute_output_file_names): Warn if we detect conflicting
5150 outputs to the same file. This should catch the misunderstanding
5151 exemplified by Debian Bug 165349, reported by Bruce Stephens..
5152
5153 * src/conflicts.c (conflicts_print): If the user specifies
5154 "%expect N", report an error if there are any reduce/reduce
5155 conflicts. This is what the manual says should happen.
5156 This fixes Debian bug 130890, reported by Anthony DeRobertis.
5157 * tests/conflicts.at (%expect with reduce conflicts): New test.
5158
983c5c2c
PE
5159 Don't use m4_include on relative file names, as it doesn't work as
5160 desired if there happens to be a file with that name under ".".
d600ee67 5161
983c5c2c
PE
5162 * m4sugar/version.m4: Remove; it was included but it wasn't used.
5163 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
5164 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
5165 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
5166 * src/output.c (output_skeleton): Use full path names when
5167 specifying a file to include; don't rely on include path, as
5168 it's unreliable when the working file contains a file with
5169 that name.
d600ee67 5170
983c5c2c
PE
51712002-12-25 Paul Eggert <eggert@twinsun.com>
5172
5173 Remove obsolete references to bison.simple and bison.hairy.
5174 Problem mentioned by Aubin Mahe in
161a71f3 5175 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
5176 * data/glr.c: Comment fix.
5177 * doc/bison.1: Remove references. Also, mention "yacc".
5178
5179 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
5180 with -g option.
5181
5182 * src/parse-gram.y (declaration): Use enum "report_states" rather
5183 than its numeric value 1.
5184
5185 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
5186 opening a new one. This fixes Debian bug 165349, reported by
5187 Bruce Stephens.
5188
23f2d9dc
PE
51892002-12-24 Paul Eggert <eggert@twinsun.com>
5190
5191 Version 1.75e.
5192
5193 * Makefile.maint (cvs-update): Don't assume that the shell
5194 supports $(...), as Solaris sh doesn't.
5195
5196 * src/parse-gram.y (lloc_default): Remove test for empty
5197 nonterminals at the end, since it didn't change the result.
5198
51992002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
5200
5201 If the user does not define YYSTYPE as a macro, Bison now declares it
5202 using typedef instead of defining it as a macro. POSIX requires this.
5203 For consistency, YYLTYPE is also declared instead of defined.
5204
5205 %union directives can now have a tag before the `{', e.g., the
5206 directive `%union foo {...}' now generates the C code
5207 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
5208 The default union tag is `YYSTYPE', for compatibility with Solaris 9
5209 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
5210 instead of `yyltype'.
5211
5212 `yystype' and `yyltype' are now obsolescent macros instead of being
5213 typedefs or tags; they are no longer documented and will be
5214 withdrawn in a future release.
5215
5216 * data/glr.c (b4_location_type): Remove.
5217 (YYSTYPE): Renamed from yystype.
5218 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
5219 (struct YYLTYPE): Renamed from struct yyltype.
5220 (YYLTYPE): Renamed from yyltype.
5221 (yyltype, yystype): New (and obsolescent) macros,
5222 for backward compatibility.
5223 * data/yacc.c: Likewise.
5224
5225 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
5226 does not specify a union tag. This is for compatibility with
5227 Solaris 9 yacc.
5228
5229 * src/parse-gram.y (add_param): 2nd arg is now char * not char
5230 const *, since it is now modified by stripping surrounding { }.
5231 (current_braced_code): Remove.
5232 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
5233 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
5234 trailing " {...}". Now of type <chars>.
5235 (grammar_declaration): Adjust to bundled tokens.
5236 (code_content): Remove; stripping is now done by add_param.
5237 (print_token_value): Print contents of bundled tokens.
5238 (token_name): New function.
5239
5240 * src/reader.h (braced_code, current_braced_code): Remove.
5241 (token_name): New decl.
5242
5243 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
5244 token_type, not braced_code code_kind. All uses changed.
5245 (SC_PRE_CODE): New state, for scanning after a keyword that
5246 has (or usually has) an immediately-following braced code.
5247 (token_type): New local var, to keep track of which token type
5248 to return when scanning braced code.
5249 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 5250 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
5251 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
5252 instead of returning a token type immediately.
5253 (<INITIAL>"{"): Set token type.
5254 (<SC_BRACED_CODE>"}"): Use it.
5255 (handle_action_dollar, handle_action_at): Now returns bool
5256 indicating success. Fail if ! current_rule; this prevents a core dump.
5257 (handle_symbol_code_dollar, handle_symbol_code_at):
5258 Remove; merge body into caller.
5259 (handle_dollar, handle_at): Complain in invalid contexts.
5260
5261 * NEWS, doc/bison.texinfo: Document the above.
5262 * NEWS: Fix years and program names in copyright notice.
5263
879ca4f8
PE
52642002-12-17 Paul Eggert <eggert@twinsun.com>
5265
5266 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
5267 Reporting, Table of Symbols): Omit mentions of %lex-param and
5268 %parse-param from the documentation for now.
5269
1c5fe69d
PE
52702002-12-15 Paul Eggert <eggert@twinsun.com>
5271
5272 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
5273 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
5274 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
5275 disagreed with the Bison documentation. Bug
5276 reported by Andrew Walrond.
d600ee67 5277
1c5fe69d
PE
5278 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
5279 as the caller now does that.
5280 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
5281 (YYEMPTY): Parenthesize right hand side, since others use it.
5282 (yyparse): Don't assume that our generated code is the only code
5283 that sets yychar.
5284
d1de5372
PE
52852002-12-13 Paul Eggert <eggert@twinsun.com>
5286
5287 Version 1.75d.
5288
5289 POSIX requires a "yacc" command.
5290 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
5291 (MOSTLYCLEANFILES): Add yacc.
5292 (yacc): New rule.
1c5fe69d 5293 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
5294 as an alias for bison y.
5295
5296 * po/LINGUAS: Add da.
d600ee67 5297
d1de5372
PE
5298 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
5299 problem with latest <getopt.h>.
5300 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
5301
5302 * doc/fdl.texi: Upgrade to 1.2.
5303 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
5304 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
5305 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
5306 gnulib.
5307 * config/install-sh: Sync with autotools.
5308
5309 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 5310 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
5311 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
5312 locations are requested.
5313 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
5314 locations are requested.
5315
d0f3fe23
PE
53162002-12-12 Paul Eggert <eggert@twinsun.com>
5317
5318 Remove unportable casts and storage allocation tricks.
5319 While we're at it, remove almost all casts, since they
5320 usually aren't needed and are a sign of trouble.
5321
5322 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
5323
5324 * src/derives.c (derives_compute): Do not subtract NTOKENS from
5325 the pointer DSET returned by malloc; this isn't portable.
5326 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
5327 Similarly for DERIVES.
5328 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
5329 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
5330 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
5331
5332 * src/derives.c (derives_compute): Do not bother invoking
5333 int_of_rule_number, since rule numbers are integers.
5334
5335 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
5336 rather than XMALLOC (char, N).
5337
5338 * src/files.c (filename_split): Rewrite to avoid cast.
5339
5340 * src/gram.h (symbol_number_as_item_number,
5341 item_number_as_symbol_number, rule_number_as_item_number,
5342 item_number_as_rule_number):
5343 Now inline functions rather than macros, to avoid casts.
5344 * src/state.h (state_number_as_int): Likewise.
5345 * src/tables.c (state_number_to_vector_number,
5346 symbol_number_to_vector_number): Likewise.
5347
5348 * src/gram.h (int_of_rule_number): Remove; no longer used.
5349
5350 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
5351 since the resulting storage is always stored into.
5352
5353 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
5354 where it's needed.
5355
5356 * src/muscle_tab.c (muscle_m4_output):
5357 Now inline. Return bool, not int.
5358 * src/state.c (state_compare): Likewise.
5359 * src/symtab.c (symbol_check_defined,
5360 symbol_check_alias_consistency, symbol_pack, symbol_translation,
5361 hash_compare_symbol, hash_symbol):
5362 Likewise.
5363 * src/uniqstr.c (uniqstr_print): Likewise.
5364 * src/muscle_tab.c (muscle_m4_output_processor):
5365 New function, to avoid casts.
5366 * src/state.c (state_comparator, stage_hasher): Likewise.
5367 * src/symtab.c (symbol_check_defined_processor,
5368 symbol_check_alias_consistency_processor, symbol_pack_processor,
5369 symbol_translation_processor, hash_symbol_comparator,
5370 hash_symbol_hasher): Likewise.
5371 * src/uniqstr.c (uniqstr_print_processor): Likewise.
5372 * src/muscle_tab.c (muscles_m4_output):
5373 Use new functions instead of casting old functions unportably.
5374 * src/state.c (state_hash_new): Likewise.
5375 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
5376 symbols_token_translations_init):
5377 Likewise.
5378 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
5379
5380 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
5381 var instead of casting to long, to avoid casts.
5382 (prepare_states): Use MALLOC rather than alloca, so that we don't
5383 have to worry about alloca.
5384 * src/state.c (state_hash_lookup): Likewise.
5385
5386 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
5387 local var instead of casting to unsigned char, to avoid casts.
5388
5389 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
5390 STATE_ALLOC): Remove.
5391 (transitions_new, errs_new, reductions_new, state_new): Use malloc
5392 rather than calloc, and use offsetof to avoid allocating slightly
5393 too much storage.
5394 (state_new): Initialize all members.
5395
5396 * src/state.c (state_hash): Use unsigned accumulator, not signed.
5397
5398 * src/symtab.c (symbol_free): Remove; unused.
5399 (symbol_get): Remove cast in lhs of assignment.
5400 (symbols_do): Now static. Accept generic arguments, not
5401 hashing-related ones.
5402
5403 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
5404 (symbol_processor): Remove.
5405 (symbols_do): Remove decl; now static.
5406
5407 * src/system.h (alloca): Remove; decl no longer needed.
5408 (<stddef.h>): Include, for offsetof.
5409 (<inttypes.>, <stdint.h>): Include if available.
5410 (uintptr_t): New type, if system lacks it.
5411 (CALLOC, MALLOC, REALLOC): New macros.
5412 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
5413 new macros.
5414
5415 * src/tables.c (table_size): Now int, to pacify GCC.
5416 (table_grow, table_ninf_remap): Use signed table size.
5417 (save_row): Don't bother initializing locals when not needed.
5418 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
5419 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
5420
5421 * src/vcg.h: Correct misspellings.
5422
5423 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
5424
5425
5426 * src/getargs.c (getargs): Don't assume EOF == -1.
5427
26b4a969
PE
54282002-12-09 Paul Eggert <eggert@twinsun.com>
5429
5430 Change identifier spellings to avoid collisions with names
5431 that are reserved by POSIX.
5432
5433 Don't use names ending in _t, since POSIX reserves them.
5434 For consistency, remove _e and _s endings -- they're weren't
5435 needed to remove ambiguity. All uses changed.
5436 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
5437 turn was just renamed from struniq_t.
5438 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
5439 which in turn was just renamed from struniq_processor_t.
5440 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
5441 in turn was renamed from hash_compare_struniq_t.
5442 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
5443 (state_list): Renamed from state_list_t.
5444 * src/assoc.h (assoc): Renamed from assoc_t.
5445 * src/conflicts.c (enum conflict_resolution): Renamed from
5446 enum conflict_resolution_e.
5447 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
5448 (rule_list): Renamed from rule_list_t.
5449 * src/getargs.h (enum trace): Renamed from enum trace_e.
5450 (enum report): Renamed from enum report_e.
5451 * src/gram.h (item_number): Renamed from item_number_t.
5452 (rule_number): Renamed from rule_number_t.
5453 (struct rule_s): Remove the "rule_s" part; not used.
5454 (rule): Renamed from rule_t.
5455 (rule_filter): Renamed from rule_filter_t.
5456 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
5457 (goto_list): Renamed from goto_list_t.
5458 * src/lalr.h (goto_number): Renamed from goto_number_t.
5459 * src/location.h (location): Renamed from location_t.
5460 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
5461 and moved here from:
5462 * src/muscle_tab.h (muscle_entry_t): here.
5463 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
5464 (rule_list): Renamed from rule_list_t.
5465 * src/print_graph.c (static_graph): Renamed from graph.
5466 * src/reader.h (braced_code): Renamed from braced_code_t.
5467 Remove brace_code_e tag.
5468 * src/relation.h (relation_node): Renamed from relation_node_t.
5469 (relation_nodes): Renamed from relation_nodes_t.
5470 (relation): Renamed from relation_t.
5471 * src/state.h (state_number): Renamed from state_number_t.
5472 (struct state): Renamed from struct state_s.
5473 (state): Renamed from state_t.
5474 (transitions): Renamed from transitions_t. Unused (and
5475 misspelled) transtion_s tag removed.
5476 (errs): Renamed from errs_t. Unused errs_s tag removed.
5477 (reductions): Renamed from reductions_t. Unused tag
5478 reductions_s removed.
5479 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
5480 (struct symbol_list): Renamed from struct symbol_list_s.
5481 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
5482 (struct symbol): Renamed from struct symbol_s.
5483 (symbol): Renamed from symbol_t.
5484 * src/tables.c (vector_number): Renamed from vector_number_t.
5485 (action_number): Renamed from action_t.
5486 * src/tables.h (base_number): Renamed from base_t.
5487 * src/vcg.h (enum color): Renamed from enum color_e.
5488 (enum textmode): Renamed from enum textmode_e.
5489 (enum shape): Renamed from enum shape_e.
5490 (struct colorentry): Renamed from struct colorentry_s.
5491 (struct classname): Renamed from struct classname_s.
5492 (struct infoname): Renamed from struct infoname_s.
5493 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
5494 (enum decision): Renamed from enum decision_e.
5495 (enum orientation): Renamed from enum orientation_e.
5496 (enum alignment): Renamed from enum alignment_e.
5497 (enum arrow_mode): Renamed from enum arrow_mode_e.
5498 (enum crossing_type): Renamed from enum crossing_type_e.
5499 (enum view): Renamed from enum view_e.
5500 (struct node): Renamed from struct node_s.
5501 (node): Renamed from node_t.
5502 (enum linestyle): Renamed from enum linestyle_e.
5503 (enum arrowstyle): Renamed from enum arrowstyle_e.
5504 (struct edge): Renamed from struct edge.
5505 (edge): Renamed from edge_t.
5506 (struct graph): Renamed from struct graph_s.
5507 (graph): Renamed from graph_t.
5508 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
5509 Rename value_t -> value.
5510 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
5511 value_t_as_yystype -> value_as_yystype.
5512
5513 Don't include <errno.h> in the mainstream code, since it
5514 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
5515 * lib/get-errno.c, lib/get-errno.h: New files.
5516 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
5517 get-errno.c.
5518 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
5519 * src/output.c (output_skeleton): Likewise.
5520 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
5521 instead of errno.
5522 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
5523 Likewise.
5524 (handle_action_dollar, handle_action_at): Likewise.
5525 * src/system.h: Do not include <errno.h>.
5526 (TAB_EXT): Renamed from EXT_TAB.
5527 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
5528
5529 Avoid str[a-z]*, since <string.h> reserves that name space.
5530 Change all instances of "struniq" in names to "uniqstr", and
5531 likewise for "STRUNIQ" and "UNIQSTR".
5532 * src/uniqstr.c: Renamed from src/struniq.c.
5533 * src/uniqstr.h: Renamed from src/struniq.h.
5534 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
5535 * src/files.c (strsuffix): Remove; unused.
5536 (concat2): Renamed from stringappend. Now static.
5537 * src/files.h (strsuffix, stringappend): Remove; unused.
5538 * src/parse-gram.y (<chars>): Renamed from <string>.
5539 (<uniqstr>): Renamed from <struniq>.
5540 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
5541 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
5542 (struct graph_s.expand): Renamed from struct graph_s.stretch.
5543 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
5544 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
5545 (N_EXPAND): Renamed from N_STRETCH.
5546
5547 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
5548 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
5549 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
5550 Remove; unused.
5551 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
5552 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
5553 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
5554 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
5555 (BASE_MAXIMUM): Renamed from BASE_MAX.
5556 (BASE_MINIMUM): Renamed from BASE_MIN.
5557 (ACTION_MAX): Remove; unused.
5558 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
5559 Unnecessary casts removed from above defines.
5560
5561
5562 Fix misspelling in names.
5563 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
5564 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
5565 G_NODE_ALIGNEMENT.
5566
5567
5568 * lib/timevar.c (timevar_report): Renamed from time_report,
5569 for consistency with other names.
5570 * lib/timevar.h (timevar_report): New decl.
5571 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
5572
5573
5574 Sort include-file uses.
5575
5576 Reorder all include files under src to be in the order "system.h".
5577 then the ../lib include files in angle brackets (alphabetized),
5578 then the . include files in double-quotes (alphabetized). Fix
5579 dependency breakages encountered in this process, as follows:
5580 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
5581 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
5582 * src/state.h: Include "symtab.h".
5583
996b1c7e
PE
55842002-12-08 Paul Eggert <eggert@twinsun.com>
5585
5586 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
5587 since this causes problems when __file__ contains character
5588 sequences like "@" that are treated specially by src/scan-skel.l.
5589 Instead, just use the file's basename. This fixes the bug
5590 reported by Martin Mokrejs in
161a71f3 5591 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 5592
e19c4e5d
PE
55932002-12-06 Paul Eggert <eggert@twinsun.com>
5594
5595 Add support for rules that do not have trailing semicolons, as
5596 POSIX requires. Improve the quality of locations in Bison
5597 diagnostics.
26b4a969 5598
e19c4e5d
PE
5599 * src/location.c: Include <quotearg.h>.
5600 (empty_location): Now const.
5601 (location_print): New function. Follow the recommendation of the
5602 GNU Coding Standards for locations that span file boundaries.
5603 * src/location.h: Do not include <quotearg.h>; no longer needed.
5604 (boundary): New type.
5605 (location_t): Use it. This allows locations to span file boundaries.
5606 All member uses changed: file -> start.file or end.file (as needed),
5607 first_line -> start.line, first_column -> start.column,
5608 last_line -> end.line, last_column -> end.column.
5609 (equal_boundaries): New function.
5610 (LOCATION_RESET, LOCATION_STEP): Remove.
5611 (LOCATION_PRINT): Remove. All callers changed to use location_print.
5612 (empty_location): Now const.
5613 (location_print): New decl.
5614 * src/parse-gram.y (lloc_default): New function, which handles
5615 empty locations more accurately.
5616 (YYLLOC_DEFAULT): Use it.
5617 (%token COLON): Remove.
5618 (%token ID_COLON): New token.
26b4a969 5619 (rules): Use it.
e19c4e5d
PE
5620 (declarations, rules): Remove trailing semicolon.
5621 (declaration, rules_or_grammar_declaration):
5622 Allow empty (";") declaration.
5623 (symbol_def): Remove empty actions; no longer needed.
5624 (rules_or_grammar_declaration): Remove trailing semicolon.
5625 (semi_colon.opt): Remove.
5626 * src/reader.h: Include location.h.
5627 (scanner_cursor): New decl.
5628 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
5629 rolling our own.
5630 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
5631 of *loc.
5632 (STEP): Remove. No longer needed, now that adjust_location does
5633 the work. All uses removed.
5634 (scanner_cursor): New var.
5635 (adjust_location): Renamed from extend_location. It now sets
5636 *loc and adjusts the scanner cursor. All uses changed.
5637 Don't bother testing for CR.
5638 (handle_syncline): Remove location arg; now updates scanner cursor.
5639 All callers changed.
5640 (unexpected_end_of_file): Now accepts start boundary of token or
5641 comment, not location. All callers changed. Update scanner cursor,
5642 not the location.
5643 (SC_AFTER_IDENTIFIER): New state.
5644 (context_state): Renamed from c_context. All uses changed.
5645 (id_loc, code_start, token_start): New local vars.
5646 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
5647 processing of Yacc white space and equivalents here.
5648 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
5649 instead of returning ID immediately, since we need to search for
5650 a subsequent colon.
5651 (<INITIAL>"'", "\""): Save token_start.
5652 (<INITIAL>"%{", "{", "%%"): Save code_start.
5653 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
5654 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
5655 BEGIN context_state at end, not INITIAL.
5656 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
5657 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
5658 Return correct token start.
5659 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
5660 the start of a character, string or multiline comment is found.
5661 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
5662 Reduction): Adjust reported locations to match the more-precise
5663 results now expected.
5664 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
5665 * tests/reduce.at (Useless Rules, Reduced Automaton,
5666 Underivable Rules): Likewise.
5667 * tests/regression.at (Invalid inputs): No longer `expecting ";"
5668 or "|"' now that so many other tokens are allowed by the new grammar.
5669
5670 * src/complain.h (current_file): Remove duplicate decl;
5671 current_file is now owned by files.h.
5672 * src/complain.c, src/scan-gram.l: Include files.h.
5673
56742002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 5675
e19c4e5d
PE
5676 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
5677 promotes to int; it might be unsigned int.
5678 * data/yacc.c (yy_reduce_print): Likewise.
5679
5680 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
5681 be #defined in the prologue, not in the Bison declarations.
5682 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 5683
b64755e3
PE
56842002-12-02 Paul Eggert <eggert@twinsun.com>
5685
5686 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
5687 * lib/strtoul.c: New file, from gnulib.
5688 This fixes a porting bug reported by Peter Klein in
161a71f3 5689 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 5690
6e746484
PE
56912002-11-30 Paul Eggert <eggert@twinsun.com>
5692
b64755e3
PE
5693 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
5694 and put only a forward declaration in the prologue. This is for
5695 consistency with the other scanner helper functions.
5696
6ba55592
PE
5697 Type clashes now generate warnings, not errors, since it
5698 appears that POSIX may allow some grammars with type clashes.
5699 * src/reader.c (grammar_current_rule_check): Warn about
5700 type clashes instead of complaining.
5701 * tests/input.at (Type Clashes): Expect warnings, not complaints.
5702
6e746484
PE
5703 Add Yacc library, since POSIX requires it.
5704 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
5705 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
5706 * lib/main.c, lib/yyerror.c: New files.
5707
5708 gram_error can be static; it need not be extern.
5709 * src/reader.h (gram_error): Remove decl.
5710 * src/parse-gram.y (gram_error): Now static. Add static decl.
5711 (print_token_value): Omit parameter names from forward decl,
5712 for consistency.
5713
88510f9c
PE
57142002-11-29 Paul Eggert <eggert@twinsun.com>
5715
6e746484
PE
5716 * doc/bison.texinfo: Emphasize that yylex and yyerror must
5717 be declared before being used. E.g., one should typically
5718 declare them in the prologue. Use GNU coding style in examples.
5719 Put "const" consistently after the type it modifies. Mention
5720 that C99 supports "inline". Mention that yyerror traditionally
5721 returns "int".
5722
88510f9c
PE
5723 %parse-param and %lex-param now take just one argument, the
5724 declaration; the argument name is deduced from the declaration.
5725
5726 * doc/bison.texinfo (Parser Function, Pure Calling, Error
5727 Reporting, Table of Symbols): Document this.
5728 * src/parse-gram.y (add_param): New function.
5729 (COMMA): Remove.
5730 (declaration): Implement new rule for %parse-param and %lex-param.
5731 * src/scan-gram.l: "," now elicits a warning, rather than being
5732 a token; this is more compatible with byacc.
5733 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
5734
bb92250c
PE
57352002-11-27 Paul Eggert <eggert@twinsun.com>
5736
5737 Rename identifiers to avoid real and potential collisions.
5738
5739 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
5740 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 5741 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
5742 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
5743 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
5744 * src/parse-gram.y (print_token_value): Renamed from yyprint.
5745 All uses changed.
5746 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
5747 The name "yycontrol" violates the name space rules, and this stuff
5748 wasn't being used anyway.
5749 (input): Remove action; this stuff wasn't being used.
5750 (gram_error): Rename local variable yylloc -> loc.
5751 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
5752 (YY_DECL): Don't use "yy" at start of local variables.
5753 All uses changed, e.g., yylloc -> loc.
5754 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
5755 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
5756 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
5757 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
5758
5759 * src/parse-gram.y (gram_error): loc is now const *.
5760 * src/reader.h (gram_error): Likewise.
5761
3af4feb2
PE
57622002-11-24 Paul Eggert <eggert@twinsun.com>
5763
5764 Version 1.75c.
5765
5766 * tests/actions.at (Actions after errors): Use an output format
5767 more similar to that of the Printers and Destructors test.
5768 Test the position of the ';' token too.
5769 (Printers and Destructors): Likewise.
5770 (Printers and Destructors: %glr-parser): Remove for now, to avoid
5771 unnecessarily alarming people when the test fails.
5772
5773 * data/yacc.c (yyerrlab1): Move this label down, so that the
5774 parser does not discard the lookahead token if the user code
5775 invokes YYERROR. This change is required for POSIX conformance.
5776
5777 * lib/error.c: Sync with gnulib.
5778
57792002-11-22 Paul Eggert <eggert@twinsun.com>
5780
5781 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
5782 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
5783 * lib/xmalloc.c: Likewise.
26b4a969 5784
58004308
PE
57852002-11-20 Paul Eggert <eggert@twinsun.com>
5786
5787 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
5788
57892002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 5790
58004308
PE
5791 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
5792 should use `if (! x) abort ();' rather than `assert (x);', and
5793 anyway it's one less thing to worry about configuring.
5794
5795 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
5796 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
5797 and replace all instances of assert with abort.
5798 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5799 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
5800
5801 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
5802 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
5803 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
5804 hash_find_entry, hash_rehash, hash_insert): Likewise.
5805 * src/conflicts.c (resolve_sr_conflict): Likewise.
5806 * src/lalr.c (set_goto_map, map_goto): Likewise.
5807 * src/nullable.c (nullable_compute): Likewise.
5808 * src/output.c (prepare_rules, token_definitions_output): Likewise.
5809 * src/reader.c (packgram, reader): Likewise.
5810 * src/state.c (state_new, state_free, state_transitions_set,
5811 state_reduction_find): Likewise.
5812 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
5813 symbol_pack): Likewise.
5814 * src/tables.c (conflict_row, pack_vector): Likewise.
5815 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
5816 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
5817 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
5818 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
5819
5820 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
5821 (ARGMATCH_CONSTRAINT): New macro.
5822 (ARGMATCH_ASSERT): Use it.
5823
5824 * src/system.h (verify): New macro.
5825 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
5826 rather than assert.
5827 * src/tables.c (tables_generate): Likewise.
5828
5829 * src/struniq.c (struniq_assert): Now returns void, and aborts
5830 if the assertion is false.
5831 (struniq_assert_p): Remove.
5832 * src/struniq.h: Likewise.
5833
76ae8198
PE
58342002-11-18 Paul Eggert <eggert@twinsun.com>
5835
5836 * data/glr.c (yygetLRActions): Replace `yyindex' with
5837 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
5838 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 5839 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 5840
d3c4e709
AD
58412002-11-18 Akim Demaille <akim@epita.fr>
5842
5843 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
5844 space.
5845 From Tim Van Holder.
5846
8d8a7238
PE
58472002-11-17 Paul Eggert <eggert@twinsun.com>
5848
5849 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
5850 to "SyntaxError" for consistency with my 2002-11-15 change.
5851
5852 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
5853 not define to {}, since this breaks the common use of `YYDPRINTF
5854 ((...));' if a single statement is desired (e.g. before `else').
5855 Work around GCC warnings by surrounding corresponding calls with
5856 {} if needed.
5857 (yyhasResolvedValue): Remove unused function.
5858 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
5859 loop body.
5860 (yyreportSyntaxError): Renamed from yyreportParseError.
5861 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
5862 All uses changed.
5863 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
5864 extern when possible. Remove unused initializations.
5865
b0937b22
AD
58662002-11-16 Akim Demaille <akim@epita.fr>
5867
5868 Augment the similarity between GLR and LALR traces.
5869
5870 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
5871 (YY_REDUCE_PRINT): New.
5872 (yyparse): Use them.
5873 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
5874 YYDPRINT here.
5875 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
5876 state reached after the reduction/recovery, since...
5877 (yyparse, yyprocessOneStack): Report the state we are entering in.
5878
c5e3e510
AD
58792002-11-16 Akim Demaille <akim@epita.fr>
5880
5881 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
5882 Add support for --trace=skeleton.
5883 * src/scan-skel.l: %option debug.
5884 Scan strings of non-@ or \n instead of character by character.
5885 (scan_skel): Handle trace_skeleton.
5886 (QPUTS): New.
5887 (@output_parser_name@, @output_header_name@): ``Restore'' their
5888 support (used to be M4 macros).
5889 * data/yacc.c: Quote larger chunks, a la glr.c.
5890 * data/lalr1.cc: Likewise.
5891 The header guards are no longer available, so use some other
5892 string than `YYLSP_NEEDED'.
5893
4c6cc1db
AD
58942002-11-16 Akim Demaille <akim@epita.fr>
5895
5896 Make the ``Printers and Destructors'' test more verbose, taking
5897 `yacc.c''s behavior as (possibly wrong) reference.
5898
5899 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
5900 instead of fprint on stdout.
5901 Set and report the last_line of the symbols.
5902 Consistently display values and locations.
5903
6d9e8019
PE
59042002-11-16 Paul Eggert <eggert@twinsun.com>
5905
5906 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
5907
6e649e65
PE
59082002-11-15 Paul Eggert <eggert@twinsun.com>
5909
b25d88f6
PE
5910 * tests/actions.at (Actions after errors): New test case.
5911
6e649e65
PE
5912 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
5913 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
5914 tests/action.at, tests/calc.at, tests/conflicts.at,
5915 tests/cxx-type.at, tests/regression.at:
5916 "parse error" -> "syntax error" for POSIX compatibility.
5917 "parsing stack overflow..." -> "parser stack overflow" so
5918 that code matches Bison documentation.
5919
0f39aab9
AD
59202002-11-15 Akim Demaille <akim@epita.fr>
5921
5922 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
5923 take two BRACED_CODE, not two string_content.
5924 Free the scanner's obstack when we are done.
5925 (code_content): New.
5926 * tests/calc.at: Adjust.
5927 * doc/bison.texinfo: Adjust.
5928 Also, make sure to include the `,' for these declarations.
5929
761c1926
AD
59302002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
5931
5932 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
5933 definition; avoids potential autoreconf problems.
5934
b0f98b10
AD
59352002-11-15 Akim Demaille <akim@epita.fr>
5936
5937 Always check the value returned by yyparse.
5938
5939 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
5940 returned by yyparse.
5941 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
5942 Adjust calls.
5943 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
5944 returned by yyparse.
5945
970785f1
PH
59462002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
5947
5948 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
5949 on input.at test.
5950
8fcc7db1
PE
59512002-11-14 Paul Eggert <eggert@twinsun.com>
5952
7ec1b48e
PE
5953 * src/output.c (output_skeleton): Call xfopen instead of
5954 duplicating xfopen's body.
5955
cfff7583 5956 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 5957 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 5958
8fcc7db1
PE
5959 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
5960 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
5961 Group compiler. Instead, use "$CC -E bar.c". Include the .h
5962 file twice in the grammar, as an extra check.
5963
5964 * tests/input.at (Torturing the Scanner): Surround the
5965 backslash-newline tests with "#if 0", to make it less likely that
5966 we'll run into compiler bugs. Bring back solitary \ inside
5967 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 5968 test backslash-newline in C character constant.
8fcc7db1 5969
4e8d992c
AD
59702002-11-14 Akim Demaille <akim@epita.fr>
5971
5972 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
5973 status of the compiler.
f32b346d 5974 Calling `exit 1' is no longer needed.
4e8d992c
AD
5975 Reported by Nelson H. F. Beebe.
5976
9501dc6e
AD
59772002-11-14 Akim Demaille <akim@epita.fr>
5978
5979 * tests/atlocal.in (CPPFLAGS): We have config.h.
5980 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
5981 New.
5982 * tests/actions.at, tests/calc.at, tests/conflicts.at,
5983 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
5984 * tests/regression.at, tests/torture.at: Use them for all the
5985 grammars that are to be compiled.
5986 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
5987 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
5988 * doc/bison.texinfo (GLR Parsers): Document `inline'.
5989
18b519c0
AD
59902002-11-14 Akim Demaille <akim@epita.fr>
5991
5992 * doc/bison.texinfo: Various formatting changes (alignments in
5993 samples, additional @group/@end group, GCS in samples.
5994 Use @deffn instead of simple @table to define the directives,
5995 macros, variables etc.
5996
9a86cdb9
PE
59972002-11-13 Paul Eggert <eggert@twinsun.com>
5998
daa33def 5999 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 6000 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 6001
daa33def 6002 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 6003 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
6004 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
6005 * tests/headers.at (export YYLTYPE): Likewise.
6006
6007 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 6008 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 6009
9a86cdb9
PE
6010 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
6011 comments, since they're not portable. Use GNU coding style.
6012
9c1e26bd
AD
60132002-11-13 Akim Demaille <akim@epita.fr>
6014
6015 * data/yacc.c: Leave bigger chunks of quoted text.
6016 (YYDSYMPRINTF): New.
6017 Use it to report symbol activities.
6018 * data/glr.c (YYDSYMPRINTF): New.
6019 Use it.
6020
87f721cc
PE
60212002-11-12 Paul Eggert <eggert@twinsun.com>
6022
6023 Version 1.75b.
6024
6025 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
6026 (yyglrReduce): Return yyok, not 0.
6027 This should avoid the enumerated-type warnings reported
464c6927 6028 by Nelson H. F. Beebe in
161a71f3 6029 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
6030
6031 * lib/bbitset.h (BITSET_INLINE): Remove.
6032 * lib/bitset.h [! BITSET_INLINE]: Remove.
6033 (bitset_set, bitset_reset, bitset_test): Rename local vars
6034 to avoid shadowing warnings by GCC.
6035
6036 * data/glr.c (inline): Remove #define. It's the user's
6037 responsibility to #define it away, just like 'const'.
464c6927 6038 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 6039 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 6040
87f721cc
PE
6041 * Makefile.maint (po-check): Scan .l and .y files instead of the
6042 .c and the .h files that they generate. This fixes the bug
6043 reported by Tim Van Holder in:
161a71f3 6044 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
6045 Look for N_ as well as for _. Try to avoid matching #define for
6046 N_ and _.
6047 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
6048 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
6049 * src/scan-gram.l: Revamp regular expressions so that " and '
6050 do not confuse xgettext.
6051
6052 * src/struniq.h (struniq_new): Do not declare the return type
6053 to be 'const'; this violates the C standard.
6054 * src/struniq.c (struniq_new): Likewise.
6055
be14ade5
AD
60562002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
6057
6058 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
6059 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
6060 linker.
6061
05291fbc
AD
60622002-11-12 Akim Demaille <akim@epita.fr>
6063
6064 * Makefile.maint: Sync with Autoconf:
6065 (local_updates): New.
6066
1f5fd52e
AD
60672002-11-12 Akim Demaille <akim@epita.fr>
6068
6069 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
6070
283f1e64
AD
60712002-11-12 Akim Demaille <akim@epita.fr>
6072
6073 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
6074 locations.
6075
886b69d1
AD
60762002-11-12 Akim Demaille <akim@epita.fr>
6077
6078 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
6079 not yyvalue.
6080
3df37415
AD
60812002-11-12 Akim Demaille <akim@epita.fr>
6082
6083 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
6084 Use it to test the GLR parser.
6085
7bd6c77e
AD
60862002-11-12 Akim Demaille <akim@epita.fr>
6087
6088 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
6089 defines it.
6090 * data/glr.c (yystos): New.
6091 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
6092 (YYDSYMPRINT): New.
6093 (yyval): Don't define it, it is handled via M4.
6094 (yyrecoverParseError): Free verbosely the discarded symbols.
6095 * data/yacc.c (yysymprint): Remove, rather...
6096 (b4_yysymprint_generate): invoke.
6097 * data/c.m4 (b4_yysymprint_generate): New.
6098 Accept pointers as arguments, as opposed to the version from
6099 yacc.c.
6100 (b4_yydestruct_generate): Likewise.
6101 * tests/cations.at (Printers and Destructors): Use Bison directives
6102 instead of CPP macros.
6103 Don't rely on internal details.
6104
b0400cc6
AD
61052002-11-12 Akim Demaille <akim@epita.fr>
6106
6107 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
6108 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
6109 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
6110 it against YYEMPTY and so forth), work on yytoken (i.e., set
6111 it to YYEMPTY etc.).
6112 (yydestruct): Replace with a b4_yydestruct_generate invocation.
6113 (b4_symbol_actions): Remove.
6114 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
6115 for 0, end-of-input.
6116
72f889cc
AD
61172002-11-12 Akim Demaille <akim@epita.fr>
6118
6119 * doc/bison.texinfo (Destructor Decl): New.
6120
b1ae9233
AD
61212002-11-12 Akim Demaille <akim@epita.fr>
6122
6123 * src/tables.c (tables_generate): Use free for pointers that
6124 cannot be NULL, not XFREE.
6125 (pack_vector): Use assert, not fatal, for bound violations.
6126 * src/state.c (state_new): Likewise.
6127 * src/reader.c (reader): Likewise.
6128 * src/lalr.c (set_goto_map): Likewise.
72f889cc 6129 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
6130 the file name.
6131
7ec2d4cd
AD
61322002-11-12 Akim Demaille <akim@epita.fr>
6133
6134 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
6135 Restore.
6136 * src/scan-gram.l (last_string): Is global to the file, not to
6137 yylex.
6138 * src/parse-gram.y (input): Don't append the epilogue here,
6139 (epilogue.opt): do it here, and free the scanner's obstack.
6140 * src/reader.c (epilogue_set): Rename as...
6141 (epilogue_augment): this.
6142 * data/c.m4 (b4_epilogue): Defaults to empty.
6143
573a6cd3
AD
61442002-11-12 Akim Demaille <akim@epita.fr>
6145
6146 * src/getargs.c (long_options): Remove duplicates.
6147 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
6148 Remove.
6149 * doc/bison.rnh: Remove.
6150 * doc/bison.texinfo (VMS Invocation): Remove.
6151
95612cfa
AD
61522002-11-12 Akim Demaille <akim@epita.fr>
6153
6154 * src/struniq.h, src/struniq.c (struniq_t): Is const.
6155 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
6156
6157 Use struniq for symbols.
6158
6159 * src/symtab.h (symbol_t): The tag member is a struniq.
6160 (symbol_type_set): Adjust.
6161 * src/symtab.c (symbol_new): Takes a struniq.
6162 (symbol_free): Don't free the tag member.
6163 (hash_compare_symbol_t, hash_symbol_t): Rename as...
6164 (hash_compare_symbol, hash_symbol): these.
6165 Use the fact that tags as struniqs.
6166 (symbol_get): Use struniq_new.
6167 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
6168 Returns a strniq.
6169 * src/reader.h (merger_list, grammar_currentmerge_set): The name
6170 and type members are struniqs.
6171 * src/reader.c (get_merge_function)
6172 (grammar_current_rule_merge_set): Adjust.
6173 (TYPE, current_type): Are struniq.
6174
6175 Use struniq for file names.
6176
6177 * src/files.h, src/files.c (infile): Split into...
6178 (grammar_file, current_file): these.
6179 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
6180 * src/reduce.c (reduce_print): Likewise.
6181 * src/getargs.c (getargs): Likewise.
6182 * src/complain.h, src/complain.c: Likewise.
6183 * src/main.c (main): Call struniqs_new early enough to use it for
6184 file names.
6185 Don't free the input file name.
6186
3e6656f9
AD
61872002-11-12 Akim Demaille <akim@epita.fr>
6188
6189 * src/symtab.c (symbol_free): Remove dead deactivated code:
6190 type_name are properly removed.
6191 Don't use XFREE to free items that cannot be NULL.
6192 * src/struniq.h, src/struniq.c: New.
6193 * src/main.c (main): Initialize/free struniqs.
6194 * src/parse-gram.y (%union): Add astruniq member.
6195 (yyprint): Adjust.
6196 * src/scan-gram.l (<{tag}>): Return a struniq.
6197 Free the obstack bit that used to store it.
6198 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
6199
7672019c
PE
62002002-11-11 Paul Eggert <eggert@twinsun.com>
6201
6202 Revamp to fix many (but not all) of the C- and M4-related quoting
6203 problems. Among other things, this fixes the Bison bug reported
6204 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 6205 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
6206
6207 Use new @ escapes consistently. Represent brackets with @{ and @}
6208 rather than @<:@ and @:>@, since this works a bit better with dumb
6209 editors like vi. Represent @ with @@, since @ is now consistently
6210 an escape. Use @oline@ and @ofile@ rather than __oline__ and
6211 __ofile__, to avoid unexpected expansions. Similarly, use @output
6212 rather than #output.
6213
6214 * data/c.m4 (b4_copyright): Omit file name from comment, since
6215 the file name could contain "*/".
6216 (b4_synclines_flag): Don't quote the 2nd argument; it should already
6217 be quoted. All uses changed.
6218
6219 * data/glr.c: Use new @ escapes consistently.
6220 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
6221 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
6222 Remove, since they couldn't handle arbitrary characters in file
6223 names.
6224 * data/lalr1.cc: Likewise.
6225 * data/yacc.c: Likewise.
6226
6227 * src/files.c (output_infix): Remove; all uses removed.
6228 * src/files.h: Likewise.
6229
6230 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
6231 mishandled funny characters in file names, and anyway it isn't
6232 needed any more.
6233 * data/yacc.c: Likewise.
6234 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
6235
6236 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
6237 * data/yacc.c: Likewise.
6238
6239 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
6240 strings now.
6241 (muscle_init): Quote filename as a C string.
6242 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
6243 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
6244 * src/output.c (escaped_file_name_output): New function.
6245 (prepare_symbols): Quote tokens for M4.
6246 (prepare): Don't insert output_infix, output_prefix,
6247 output_parser_name, output_header_name; this is now down by scan-skel.
6248 Insert skeleton as a C string.
6249
6250 * src/output.c (user_actions_output, symbol_destructors_output,
6251 symbol_printers_output): Quote filenames for C and M4.
6252 * src/reader.c (prologue_augment, epilogue_set): Likewise.
6253
6254 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
6255 escapes other than \\ and \'; this simplifies the code.
6256 (<SC_STRING>): Likewise, for \\ and \".
6257 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
6258 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
6259 Use new escapes @{ and @} for [ and ].
6260
6261 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
6262 them with auto vars.
6263 Switch to new escape scheme, where @ is the escape character uniformly.
6264 Abort if a stray escape character is found. Avoid unbounded input
6265 buffer when parsing non-escaped text.
6266
6267 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
6268 __oline__, #output, $@, and @{ do not have unintended meanings.
6269
acea4f3b
PE
62702002-11-09 Paul Eggert <eggert@twinsun.com>
6271
6272 Fix the test failure due to GCC warnings described in
161a71f3 6273 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
6274 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
6275 evaluate to 0 if it's impossible for NINF to be in the respective
6276 table.
6277 (yygetLRActions, yyrecoverParseError): Use them.
6278
6279 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
6280 counted in the token inserted at end of file. Now takes
6281 location_t *, not location_t, so that the location can be
6282 adjusted. All uses changed.
6283
6284 * tests/regression.at (Invalid inputs): Adjust wording in
6285 diagnostic to match the new behavior.
6286
6287 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
6288 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
6289 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
6290 abort ();'. This reduces the runtime of the "Many lookaheads"
6291 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
6292 GCC 3.2.
6293
20ef1ad5
PE
62942002-11-07 Paul Eggert <eggert@twinsun.com>
6295
6296 * src/parse-gram.y (CHARACTER): Remove unused token.
6297 All uses removed.
6298
6299 * src/scan-gram.l: Remove stack option. We no longer use the
6300 stack, since the stack was never deeper than 1; instead, use the
6301 new auto var c_context to record the stacked value.
6302
6303 Remove nounput option. At an unexpected end of file, we now unput
6304 the minimal input necessary to end cleanly; this simplifies the
6305 code.
6306
6307 Avoid unbounded token sizes where this is easy.
6308
6309 (unexpected_end_of_file): New function.
6310 Use it to systematize the error message on unexpected EOF.
6311 (last-string): Now auto, not static.
6312 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
6313 (scanner_last_string_free): Remove; not used.
6314 (percent_percent_count): Move decl to just before use.
6315 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
6316 not the (never otherwised-used) CHARACTER.
6317
93724f13
AD
63182002-11-07 Akim Demaille <akim@epita.fr>
6319
6320 Let yyerror always receive the msg as last argument, so that
6321 yyerror can be variadic.
6322
6323 * data/yacc.c (b4_yyerror_args): New.
6324 Use it when calling yyerror.
6325 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
6326 Use it when calling yyerror.
6327 * doc/bison.texinfo (Error Reporting): Adjust.
6328 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
6329 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
6330
6e40b4eb
AD
63312002-11-06 Akim Demaille <akim@epita.fr>
6332
6333 #line should have quoted strings.
6334 Ideally, this should be done by m4_quotearg.
6335
6336 * src/scan-skel.l: Include quotearg.h.
6337 Quote __ofile__.
6338 * src/output.c (symbol_printers_output)
6339 (symbol_destructors_output): Quote the file name.
6340
2dfbfc12
AD
63412002-11-06 Akim Demaille <akim@epita.fr>
6342
6343 * tests/regression.at (Invalid inputs): Adjust to the recent
6344 messages.
6345
437c2d80
AD
63462002-11-06 Akim Demaille <akim@epita.fr>
6347
6348 Restore --no-lines.
6349 Reported by Jim Kent.
6350
6351 * data/c.m4 (b4_syncline): New.
6352 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
6353 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
6354 * src/output.c (user_actions_output): Likewise.
6355 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 6356 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 6357
900c5db5
AD
63582002-11-06 Akim Demaille <akim@epita.fr>
6359
6360 * src/main.c (main): Free `infile'.
6361 * src/scan-gram.l (handle_syncline): New.
6362 Recognize `#line'.
6363 * src/output.c (user_actions_output, symbol_destructors_output)
6364 (symbol_printers_output): Use the location's file name, not
6365 infile.
6366 * src/reader.c (prologue_augment, epilogue_set): Likewise.
6367
e183b123 63682002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 6369
e183b123 6370 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 6371 either has GLR conflict entries.
e183b123 6372
193eb6b7
PE
63732002-11-05 Paul Eggert <eggert@twinsun.com>
6374
e183b123
PE
6375 * src/scan-gram.l: Use more accurate diagnostics, e.g.
6376 "integer out of range" rather than "invalid value".
6377 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
6378 accordingly.
6379
193eb6b7
PE
6380 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
6381 Also, remove one static variable in the scanner.
6382
6383 * src/scan-gram.l (braces_level): Now auto, not static.
6384 Initialize to zero if the compiler is being picky.
6385 (INITIAL): Clear braces_level instead of incrementing it.
6386 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
6387 as POSIX 1003.1-2001 requires.
6388 * src/system.h (IF_LINT): New macro, taken from coreutils.
6389 * configure.ac: Define "lint" if --enable-gcc-warnings.
6390
29c01725
AD
63912002-11-05 Akim Demaille <akim@epita.fr>
6392
6393 * src/scan-gram.l: When it starts with `%', complain about the
6394 whole directive, not just that `invalid character: %'.
6395
8aeac3ca
AD
63962002-11-04 Akim Demaille <akim@epita.fr>
6397
6398 * Makefile.maint: Update from Autoconf.
6399 (update, cvs-update, po-update, do-po-update): New.
6400
793a58bb
AD
64012002-11-04 Akim Demaille <akim@epita.fr>
6402
6403 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
6404 and yyerror.
6405 Have yyerror `use' its arguments.
6406 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
6407 returns true when location & yacc & pure & parse-param.
6408 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
6409
c4d720cd
AD
64102002-11-04 Akim Demaille <akim@epita.fr>
6411
6412 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
6413 clashes.
6414 * src/scan-gram.l: Use [\'] instead of ['] to pacify
6415 font-lock-mode.
6416 Use complain_at.
6417 Use quote, not quote_n since LOCATION_PRINT no longer uses the
6418 slot 0.
6419
613a0dc5
PE
64202002-11-03 Paul Eggert <eggert@twinsun.com>
6421
6422 * src/reader.c (get_merge_function, grammar_current_rule_check):
6423 Use consistent diagnostics for reporting type name clashes.
6424 Quote the types with <>, for consistency with Yacc.
6425 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
6426
2a8d363a
AD
64272002-11-03 Akim Demaille <akim@epita.fr>
6428
6429 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
6430 New.
6431 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
6432 (b4_parse_param): Remove.
6433 Use b4_identification.
6434 Propagate b4_pure_args where needed to pass them to yyerror.
6435 * data/glr.m4 (b4_parse_param): Remove.
6436 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
6437 (b4_lpure_formals): New.
6438 Use b4_identification.
6439 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
6440 b4_user_formals and b4_user_args.
6441 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
6442 (yyreportAmbiguity): When using a pure parser, also need
6443 the location, and the parse-params.
6444 Adjust callers.
6445 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
6446 When using a pure parser, also need the parse-params.
6447 Adjust callers.
6448 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
6449 (%pure-parser + %parse-param) LALR and GLR parsers.
6450 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
6451 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
6452 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
6453 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
6454 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
6455 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
6456 * doc/bison.texinfo: Untabify the whole file.
6457 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
6458 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
6459 (Error Reporting): Adjust to these new directives.
6460 Document %error-verbose, deprecate YYERROR_VERBOSE.
6461
9e32add8
AD
64622002-11-03 Akim Demaille <akim@epita.fr>
6463
6464 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
6465 AT_CHECK_CALC_GLR invocations to use % directives, instead of
6466 command line options.
6467 * tests/cxx-type.at: Formatting changes.
6468
b02d90a5
PE
64692002-11-03 Paul Eggert <eggert@twinsun.com>
6470
6471 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
6472 to count columns correctly, and to check for invalid inputs.
9e32add8 6473
b02d90a5
PE
6474 Use mbsnwidth to count columns correctly. Account for tabs, too.
6475 Include mbswidth.h.
6476 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
6477 (extend_location): New function.
6478 (YY_LINES): Remove.
6479
6480 Handle CRLF in C code rather than in Lex code.
6481 (YY_INPUT): New macro.
6482 (no_cr_read): New function.
6483
6484 Scan UCNs, even though we don't fully handle them yet.
6485 (convert_ucn_to_byte): New function.
6486
6487 Handle backslash-newline correctly in C code.
6488 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
6489 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
6490 all uses changed.
6491 (tag, splice): New EREs. Do not allow NUL or newline in tags.
6492 Use {splice} wherever C allows backslash-newline.
6493 YY_STEP after space, newline, vertical-tab.
6494 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 6495
b02d90a5
PE
6496 (letter, id): Don't assume ASCII; e.g., spell out a-z.
6497
6498 ({int}, handle_action_dollar, handle_action_at): Check for integer
6499 overflow.
9e32add8 6500
b02d90a5
PE
6501 (YY_STEP): Omit trailing semicolon, so that it's more like C.
6502
6503 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
6504 as well as \000. Check for UCHAR_MAX, not 255.
6505 Allow \x with an arbitrary positive number of digits, as in C.
6506 Check for overflow here.
6507 Allow \? and UCNs, for compatibility with C.
6508
6509 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
6510 with quote slot used by complain_at.
6511
6512 * tests/input.at: Add tests for backslash-newline, m4 quotes
6513 in symbols, long literals, and funny escapes in strings.
6514
6515 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
6516 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
6517 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
6518 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
6519 * m4/mbswidth.m4: New file, from GNU coreutils.
6520
6521 * doc/bison.texinfo (Grammar Outline): Document // comments.
6522 (Symbols): Document that trigraphs have no special meaning in Bison,
6523 nor is backslash-newline allowed.
6524 (Actions): Document that trigraphs have no special meaning.
6525
6526 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
6527 no longer used.
6528
65292002-11-02 Paul Eggert <eggert@twinsun.com>
6530
6531 * src/reader.c: Don't include quote.h; not needed.
6532 (get_merge_function): Reword warning to be consistent with
6533 type clash diagnostic in grammar_current_rule_check.
6534
6535 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
6536 bug in trigraph handling.
6537
6538 * src/output.c (prepare_symbols): When printing token names,
6539 escape "[" as "@<:@" and likewise for "]".
6540
6541 * src/system.h (errno): Remove declaration, as we are now
6542 assuming C89 or better, and C89 guarantees errno.
6543
762b212b
PE
65442002-10-30 Paul Eggert <eggert@twinsun.com>
6545
6546 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
6547 Check for close failures.
6548 * src/files.h (xfclose): Return void, not int, since it always
6549 returned zero.
6550 * src/files.c (xfclose): Likewise. Report I/O error if ferror
6551 indicates one.
6552 * src/output.c (output_skeleton): Use xfclose rather than fclose
6553 and ferror. xfclose now checks ferror.
6554
6555 * data/glr.c (YYLEFTMOST_STATE): Remove.
6556 (yyreportTree): Use a stack-based leftmost state. This avoids
6557 our continuing battles with bogus warnings about initializers.
6558
56100c60
AD
65592002-10-30 Akim Demaille <akim@epita.fr>
6560
6561 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
6562 #if.
6563
51b4a04c
PH
65642002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
6565
6566 * tests/glr-regr1.at: New test for reported regressions.
6567 * tests/testsuite.at: Add glr-regr1.at test.
6568 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 6569
bf1ebda2
PE
65702002-10-24 Paul Eggert <eggert@twinsun.com>
6571
5c16c6b1
PE
6572 Version 1.75a.
6573
bf1ebda2
PE
6574 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
6575 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
6576 we use malloc. Don't assume 'A' through 'Z' are contiguous.
6577 Don't assume strdup exists; POSIX says its an XSI extension.
6578 Check for buffer overflow on input.
6579
b526ee61
AD
65802002-10-24 Akim Demaille <akim@epita.fr>
6581
6582 * src/output.c (output_skeleton): Don't disable M4sugar comments
6583 too soon: it results in comments being expanded.
6584 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
6585 first output.
6586
f1886bb2
AD
65872002-10-24 Akim Demaille <akim@epita.fr>
6588
6589 * data/yacc.c (m4_int_type): New.
6590 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
6591 char' as only yacc.c wants K&R portability.
6592 * data/glr.c (yysigned_char): Remove.
6593 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
6594 Reported by Quoc Peyrot.
6595
c5576256
PE
65962002-10-23 Paul Eggert <eggert@twinsun.com>
6597
6598 * src/main.c (main): With --trace=time, report times even if a
6599 non-fatal error occurs. Formerly, the times were reported in some
6600 such cases but not in others.
6601 * src/reader.c (reader): Just return if a complaint has been issued,
6602 instead of exiting, so that 'main' can report times.
6603
27b0ffea
AD
66042002-10-22 Akim Demaille <akim@epita.fr>
6605
6606 * src/system.h: Include sys/types.
6607 Reported by Bert Deknuydt.
6608
223a7883
PE
66092002-10-23 Paul Eggert <eggert@twinsun.com>
6610
6611 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
6612 Suggested by Art Haas.
6613
66142002-10-22 Paul Eggert <eggert@twinsun.com>
6615
6616 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
6617 decl; not needed any more.
6618 * src/main.c (main): Use return to exit, undoing yesterday's change.
6619 The last OS that we could find where this wouldn't work is
6620 SunOS 3.5, and that's too old to worry about now.
6621
6622 * data/glr.c (struct yyltype): Define members even when not
6623 doing locations. This is more consistent with yacc.c, and it
6624 works around the following bug reports:
161a71f3
PE
6625 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
6626 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 6627
223a7883
PE
6628 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
6629 @acronym consistently. Standardize on "Yacc" instead of "YACC",
6630 "Algol" instead of "ALGOL". Give a bit more history about BNF.
6631
8b76775a
AD
66322002-10-22 Akim Demaille <akim@epita.fr>
6633
6634 * data/README: New.
6635
6db10d14
PE
66362002-10-21 Paul Eggert <eggert@twinsun.com>
6637
6638 Be consistent about 'bool'; the old code used an enum in one
6639 module and an int in another, and this violates the C standard.
6640 * m4/stdbool.m4: New file, from coreutils 4.5.3.
6641 * configure.ac (AC_HEADER_STDBOOL): Add.
6642 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
6643 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
6644 * src/symtab.c (hash_compare_symbol_t): Likewise.
6645 * src/system.h (bool, false, true): Use a definition consistent
6646 with ../lib/hash.c. All uses changed.
6647
6648 * src/complain.c (warning_issued): Renamed from warn_message_count,
6649 so that we needn't worry about integer overflow (!).
6650 Now of type bool. All uses changed.
6651 (complaint_issued): Renamed from complain_message_count; likewise.
6652
6653 * src/main.c (main): Use exit to exit with failure.
27b0ffea 6654
6db10d14
PE
6655 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
6656 rather than 1 and 0.
6657 * src/main.c (main): Likewise.
6658 * src/getargs.c (getargs): Likewise.
6659 * src/reader.c (reader): Likewise.
6660
6661 * src/getarg.c (getargs): Remove duplicate code for
6662 "Try `bison --help'".
6663
6664 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
6665 What was that "2" for?
6666
6667 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
6668 * src/getargs.c (usage): Likewise.
6669
6670 * src/getargs.c (getargs): When there are too few operands, report
6671 the last one. When there are too many, report the first extra
6672 one. This is how diffutils does it.
6673
92a060fd
PE
66742002-10-20 Paul Eggert <eggert@twinsun.com>
6675
6676 Remove K&R vestiges.
6677 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
6678 * src/complain.c (VA_START): Remove. Assume prototypes.
6679 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
6680 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
6681 fatal): Assume prototypes.
6682 * src/complain.h: Assume prototypes.
6683 * src/system.h (PARAMS): Remove.
6684 Include <limits.h> unconditionally, since it's guaranteeed even
6685 for a freestanding C89 compiler.
6686 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
6687 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 6688
e7cb57c0
AD
66892002-10-20 Akim Demaille <akim@epita.fr>
6690
6691 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
6692 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
6693 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
6694 (yyresolveStates, yyresolveAction, yyresolveStack)
6695 (yyprocessOneStack): Use them.
6696 (yy_reduce_print): New.
6697 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
6698
0245f82d
AD
66992002-10-20 Akim Demaille <akim@epita.fr>
6700
6701 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
6702 arguments and output `void'.
6703 (b4_c_function): Rename as...
6704 (b4_c_function_def): this.
6705 (b4_c_function_decl, b4_c_ansi_function_def)
6706 (b4_c_ansi_function_decl): New.
6707 Change the interpretation of the arguments: before `int, foo', now
6708 `int foo, foo'.
6709 * data/yacc.c (yyparse): Prototype and define thanks to these.
6710 Adjust b4_c_function_def uses.
6711 * data/glr.c (yyparse): Likewise, but ANSI only.
6712
39912f52
AD
67132002-10-20 Akim Demaille <akim@epita.fr>
6714
6715 * src/output.c (prepare): Move the definition of `tokens_number',
6716 `nterms_number', `undef_token_number', `user_token_number_max'
6717 to...
6718 (prepare_tokens): Here.
6719 (prepare_tokens): Rename as...
6720 (prepare_symbols): this.
6721 (prepare): Move the definition of `rules_number' to...
6722 (prepare_rules): here.
6723 (prepare): Move the definition of `last', `final_state_number',
6724 `states_number' to...
6725 (prepare_states): here.
6726 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
6727
20c1e2ad
AD
67282002-10-20 Akim Demaille <akim@epita.fr>
6729
6730 * src/tables.h, src/tables.c, src/output.c: Comment changes.
6731
21964f43
AD
67322002-10-20 Akim Demaille <akim@epita.fr>
6733
6734 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
6735 * data/c.m4: here.
6736
66d30cd4
AD
67372002-10-20 Akim Demaille <akim@epita.fr>
6738
6739 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
6740 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
6741 `pair'.
6742 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
6743 `name' to...
6744 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
6745 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
6746 These.
6747
95f2c9fe
PE
67482002-10-19 Paul Eggert <eggert@twinsun.com>
6749
6750 Do not create a temporary file, as that involves security and
6751 cleanup headaches. Instead, use a pair of pipes.
6752 Derived from a suggestion by Florian Krohm.
6753 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
6754 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
6755 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
6756 (BISON_PREREQ_SUBPIPE): Add.
6757 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
6758 Add subpipe.h, subpipe.c.
6759 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
6760 * po/POTFILES.in: Add lib/subpipe.c.
6761 * src/output.c: Include "subpipe.h".
6762 (m4_invoke): Remove decl.
6763 (scan_skel): New decl.
6764 (output_skeleton): Use pipe rather than temporary file for m4 input.
6765 Check that m4sugar.m4 is readable, to avoid deadlock.
6766 Check for pipe I/O error.
6767 * src/scan-skel.l (readpipe): Remove decl.
6768 (scan_skel): New function, to be used in place of m4_invoke.
6769 Read from stream rather than file.
66d30cd4 6770
95f2c9fe
PE
6771 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
6772 float, as this generates a warning on Solaris 8 + GCC 3.2 with
6773 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
6774 this generates a more-accurate value anyway.
6775
6776 * lib/timevar.c (timervar_accumulate): Rename locals to
6777 avoid confusion with similarly-named more-global.
6778 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
6779
6780 * src/output.c (prepare): Use xstrdup to convert char const *
6781 to char *, to avoid GCC warning.
6782
c19988b7
AD
67832002-10-19 Akim Demaille <akim@epita.fr>
6784
6785 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
6786 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
6787 Use them to have `calc.y' ready for %pure-parser.
6788 * data/yacc.c (YYLEX): Pass a yylex return type to
6789 b4_c_function_call.
6790
ae7453f2
AD
67912002-10-19 Akim Demaille <akim@epita.fr>
6792
6793 Prototype support of %lex-param and %parse-param.
6794
6795 * src/parse-gram.y: Add the definition of the %lex-param and
6796 %parse-param tokens, plus their rules.
6797 Drop the `_' version of %glr-parser.
6798 Add the "," token.
6799 * src/scan-gram.l (INITIAL): Scan them.
6800 * src/muscle_tab.c: Comment changes.
6801 (muscle_insert, muscle_find): Rename `pair' as `probe'.
6802 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
6803 (muscle_entry_s): The `value' member is no longer const.
6804 Adjust all dependencies.
6805 * src/muscle_tab.c (muscle_init): Adjust: use
6806 MUSCLE_INSERT_STRING.
6807 Initialize the obstack earlier.
6808 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
6809 (muscle_pair_list_grow): New.
6810 * data/c.m4 (b4_c_function_call, b4_c_args): New.
6811 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
6812 * tests/calc.at: Use %locations, not --locations.
6813 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
6814
0e575721
AD
68152002-10-19 Akim Demaille <akim@epita.fr>
6816
6817 * src/getargs.c (usage): Take status as argument and exit
6818 accordingly.
6819 Report the traditional `Try ... --help' message when status != 0.
6820 (usage, version): Don't take a FILE * as arg, it is pointless.
6821 (getargs): When there is an incorrect number of arguments, make it
6822 an error, and report it GNUlically thanks to `usage ()'.
6823
724ce7f5
PE
68242002-10-18 Paul Eggert <eggert@twinsun.com>
6825
3a781eb2
PE
6826 * data/glr.c (yyreportParseError): Don't assume that sprintf
6827 yields the length of the printed string, as this is not true
6828 on SunOS 4.1.4. Reported by Peter Klein.
6829
724ce7f5
PE
6830 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
6831 * tests/conflicts.at (%nonassoc and eof): Likewise.
6832 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
6833
473d0a75
AD
68342002-10-17 Akim Demaille <akim@epita.fr>
6835
6836 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
6837 * src/getargs.c (trace_types, trace_args): Adjust.
6838 * src/reader.c (grammar_current_rule_prec_set)
6839 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
6840 Standardize error messages.
6841 And s/@prec/%prec/!
6842 (reader): Use trace_flag to enable scanner/parser debugging,
6843 instead of an adhoc scheme.
6844 * src/scan-gram.l: Remove trailing debugging code.
6845
e76d2469
PE
68462002-10-16 Paul Eggert <eggert@twinsun.com>
6847
93e2236a
PE
6848 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
6849 MUSCLE_TAB_H.
6850
e76d2469
PE
6851 * NEWS: Officially drop support for building Bison with K&R C,
6852 since it didn't work anyway and it's not worth worrying about.
6853 * Makefile.maint (wget_files): Remove ansi2knr.c.
6854 (ansi2knr.c-url_prefix): Remove.
6855 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
6856 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
6857 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
6858
5bd1c419
PE
68592002-10-15 Paul Eggert <eggert@twinsun.com>
6860
6861 Stop using the "enum_" trick for K&R-style function definitions;
6862 it confused me, and I was the author! Instead, assume that people
6863 who want to use K&R C compilers (when using these modules in GCC,
6864 perhaps?) will run ansi2knr.
6865
6866 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
6867 All uses of "enum_" changed to "enum ".
6868 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
6869 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 6870
5bd1c419
PE
6871 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
6872 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
6873 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
6874 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
6875 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
6876 abitset_not, abitset_ones, abitset_or, abitset_or_and,
6877 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
6878 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
6879 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
6880 Use function prototypes; this removes the need for declaring
6881 static functions simply to provide their prototypes.
6882 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
6883 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
6884 bitset_count_, bitset_create, bitset_dump, bitset_first,
6885 bitset_free, bitset_init, bitset_last, bitset_next,
6886 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
6887 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
6888 bitset_print, bitset_release_memory, bitset_toggle_,
6889 bitset_type_choose, bitset_type_get, bitset_type_name_get,
6890 debug_bitset): Likewise.
6891 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
6892 * lib/bitset_stats.c (bitset_log_histogram_print,
6893 bitset_percent_histogram_print, bitset_stats_and,
6894 bitset_stats_and_cmp, bitset_stats_and_or,
6895 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
6896 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
6897 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
6898 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
6899 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
6900 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
6901 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
6902 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
6903 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
6904 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
6905 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
6906 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
6907 bitset_stats_zero): Likewise.
6908 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
6909 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
6910 bitsetv_dump, debug_bitsetv): Likewise.
6911 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
6912 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
6913 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
6914 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
6915 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
6916 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
6917 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
6918 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
6919 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
6920 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
6921 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
6922 Likewise.
6923 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
6924 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
6925 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
6926 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
6927 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
6928 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
6929 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
6930 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
6931 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
6932 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
6933 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 6934
ae26e1f0
AD
69352002-10-14 Akim Demaille <akim@epita.fr>
6936
6937 Version 1.75.
6938
d43baf71
AD
69392002-10-14 Akim Demaille <akim@epita.fr>
6940
6941 * tests/Makefile.am (maintainer-check-posix): New.
6942
7ebc83e3
AD
69432002-10-14 Akim Demaille <akim@epita.fr>
6944
6945 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
6946 member.
6947
05846dae
AD
69482002-10-14 Akim Demaille <akim@epita.fr>
6949
6950 * src/tables.c (table_ninf_remap): base -> tab.
6951 Reported by Matt Rosing.
6952
1318e37d
PE
69532002-10-14 Paul Eggert <eggert@twinsun.com>
6954
447fbb17
PE
6955 * tests/action.at, tests/calc.at, tests/conflicts.at,
6956 tests/cxx-type.at, tests/headers.at, tests/input.at,
6957 tests/regression.at, tests/synclines.at, tests/torture.at:
6958 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
6959 so that the tests still work even if POSIXLY_CORRECT is set.
6960 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 6961
1318e37d
PE
6962 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
6963 for portability to K&R hosts. Fix typo: signed char is guaranteed
6964 only to 127, not to 128.
6965 * data/glr.c (yysigned_char): New type.
6966 * data/yacc.c (yysigned_char): Likewise.
6967 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
6968
cc0f0794
PE
69692002-10-13 Paul Eggert <eggert@twinsun.com>
6970
5038f418
PE
6971 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
6972 true due to limited range of data type" warning from GCC.
6973
cc0f0794
PE
6974 * data/c.m4 (b4_token_defines): Protect against double-inclusion
6975 by wrapping enum yytokentype's definition inside #ifndef
6976 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
6977
6fed0802
AD
69782002-10-13 Akim Demaille <akim@epita.fr>
6979
6980 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
6981 Un yy- yyrhs to avoid the name clash with the global YYRHS.
6982
32f0598d
AD
69832002-10-13 Akim Demaille <akim@epita.fr>
6984
6985 * Makefile.maint: Update from Autoconf 2.54.
6986 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
6987
7ea9a33f
AD
69882002-10-13 Akim Demaille <akim@epita.fr>
6989
6990 * src/print.c (print_state): Separate the list of solved conflicts
6991 from the other items.
6992 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
6993
ea99527d
AD
69942002-10-13 Akim Demaille <akim@epita.fr>
6995
6996 Let nondeterministic skeletons be usable with deterministic
6997 tables.
6998
6999 With the patch, GAWK compiled by GCC without -O2 passes its test
7000 suite using a GLR parser driven by LALR tables. It fails with -O2
7001 because `struct stat' gives two different answers on my machine:
7002 88 (definition of an auto var) and later 96 (memset on this var).
7003 Hence the stack is badly corrumpted. The headers inclusion is to
7004 blame: if I move the awk.h inclusion before GLR's system header
7005 inclusion, the two struct stat have the same size.
7006
7007 * src/tables.c (pack_table): Always create conflict_table.
7008 (token_actions): Always create conflict_list.
7009 * data/glr.c (YYFLAG): Remove, unused.
7010
f377f69f
AD
70112002-10-13 Akim Demaille <akim@epita.fr>
7012
7013 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
7014 (O0FLAGS): New.
7015 (VALGRIND, GXX): New.
7016 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
7017 * tests/bison.in: Run $PREBISON a pre-command.
7018 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
7019 (maintainer-check-g++): New.
7020 * Makefile.am (maintainer-check): New.
7021
2a1fe6ed
AD
70222002-10-13 Akim Demaille <akim@epita.fr>
7023
7024 * data/glr.c: Formatting changes.
7025 Tweak some trace messages to match yacc.c's.
7026
f50adbbd
AD
70272002-10-13 Akim Demaille <akim@epita.fr>
7028
7029 GLR parsers sometimes raise parse errors instead of performing the
7030 default reduction.
7031 Reported by Charles-Henry de Boysson.
7032
7033 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 7034 check the length of the traces when %glr.
f50adbbd
AD
7035 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
7036 GLR's traces.
7037 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
7038 Test GLR parsers.
7039 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
7040 (yyltype): Remove the yy prefix from the member names.
7041 (yytable): Complete its comment.
7042 (yygetLRActions): Map error action number from YYTABLE from
7043 YYTABLE_NINF to 0.
7044 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
7045 (which was a bug: it should have been YYTABEL_NINF, and yet it was
7046 not satisfying as we could compare an YYACTION computed from
7047 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
7048 only value for error actions.
7049 (yyreportParseError): In verbose parse error messages, don't issue
7050 `error' in the list of expected tokens.
7051 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
7052 next action to perform to match glr.c's decoding.
7053 (yytable): Complete its comment.
7054
bcbad5b9
PE
70552002-10-13 Paul Eggert <eggert@twinsun.com>
7056
7057 Fix problem reported by Henrik Grubbstroem in
161a71f3 7058 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
7059 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
7060 because the Bison parser reads the second action before reducing
7061 the first one.
7062 * src/scan-gram.l (rule_length): New static var.
7063 Use it to keep track of the rule length in the scanner, since
7064 we can't expect the parser to be in lock-step sync with the scanner.
7065 (handle_action_dollar, handle_action_at): Use this var.
7066 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 7067
14904b89
PE
70682002-10-12 Paul Eggert <eggert@twinsun.com>
7069
1fe611e5
PE
7070 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
7071 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
7072 Include <sys/time.h> when checking for clock_t and struct tms.
7073 Use same include order as source.
7074 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 7075 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 7076
1fe611e5
PE
7077 * lib/timevar.c: Update copyright date and clarify comments.
7078 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 7079
1fe611e5
PE
7080 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
7081 GCC version as of today, then merge Bison's changes.
7082 Change "GCC" to "Bison" in copyright notice. timevar.def's
7083 author is Akim, so change that too.
7084
98194095
PE
7085 * src/reader.c (grammar_current_rule_check):
7086 Don't worry about the default action if $$ is untyped.
7087 Prevents bogus warnings reported by Jim Gifford in
161a71f3 7088 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 7089
14904b89
PE
7090 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
7091 * data/glr.c, data/lalr1.cc, data/yacc.c:
7092 Output token definitions before the first part of user declarations.
7093 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 7094 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 7095
ff6dca18
PE
70962002-10-11 Paul Eggert <eggert@twinsun.com>
7097
7098 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
7099 (yyparse): here. This undoes some of the 2002-07-25 change.
7100 Compatibility problem reported by Ralf S. Engelschall with
7101 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
7102
eb714592
AD
71032002-10-11 Akim Demaille <akim@epita.fr>
7104
7105 * tests/regression.at Characters Escapes): New.
7106 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
7107 characters.
7108 Reported by Jan Nieuwenhuizen.
7109
b7195100
AD
71102002-10-11 Akim Demaille <akim@epita.fr>
7111
7112 * po/id.po: New.
7113
f28a0f2d
PE
71142002-10-10 Paul Eggert <eggert@twinsun.com>
7115
7116 Portability fixes for bitsets; this also avoids several GCC
7117 warnings.
7118
7119 * lib/abitset.c: Include <stddef.h>, for offsetof.
7120 * lib/lbitset.c: Likewise.
7121
7122 * lib/abitset.c (abitset_bytes): Return a size that is aligned
7123 properly for vectors of objects. Do not assume that adding a
7124 header size to a multiple of a word size yields a value that is
7125 properly aligned for the whole union.
7126 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7127
7128 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
7129 unique names for structures.
7130 * lib/ebitset.c (ebitset_bytes): Likewise.
7131 * lib/lbitset.c (lbitset_bytes): Likewise.
7132
7133 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
7134 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
7135 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
7136 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
7137 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
7138 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
7139 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
7140 to improve the type-checking that GCC can do.
7141 * lib/bitset.c (bitset_op4_cmp): Likewise.
7142 * lib/bitset_stats.c (bitset_stats_count,
7143 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
7144 bitset_stats_copy, bitset_stats_disjoint_p,
7145 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
7146 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
7147 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
7148 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
7149 bitset_stats_and_or_cmp, bitset_stats_andn_or,
7150 bitset_stats_andn_or_cmp, bitset_stats_or_and,
7151 bitset_stats_or_and_cmp): Likewise.
7152 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
7153 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
7154 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
7155 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
7156
7157 * lib/abitset.h: Include bitset.h, not bbitset.h.
7158 * lib/ebitset.h: Likewise.
7159 * lib/lbitset.h: Likewise.
7160
7161 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
7162 All instances of parameters of type enum bitset_opts are now of
7163 type enum_bitset_opts, to conform to the C Standard, and similarly
7164 for enum_bitset_type.
7165 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
7166 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
7167
7168 Do not use "struct bitset_struct" to mean different things in
7169 different modules. Not only is this confusing, it violates
7170 the C Standard, which requires that structure types in different
7171 modules must be compatible if one is to be passed to the other.
7172 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
7173 All instances of "struct bitset_struct *" replaced with "bitset".
7174 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
7175 (union bitset_union, struct abitset_struct, struct ebitset_struct,
7176 struct lbitset_struct, struct bitset_stats_struct): New types.
7177 All uses of struct bitset_struct changed to union bitset_union,
7178 etc.
ba0fe3c7 7179 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
7180 struct bitset_struct): Remove.
7181 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
7182 struct bitset_struct): Remove.
7183 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
7184 bitset_struct): Remove.
7185 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
7186 Likewise.
7187
7188 Do not call a function of type T using a call that assumes the
7189 function is of a different type U. Standard C requires that a
7190 function must be called with a type that is compatible with its
7191 definition.
7192 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
7193 New decls.
7194 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
7195 New functions.
7196 * lib/ebitset.c (PFV): Remove.
7197 * lib/lbitset.c (PFV): Likewise.
7198 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
7199 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
7200 decls.
7201 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
7202 (ebitset_vtable): Use them.
7203 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
7204 lbitset_xor): New functions.
7205 (lbitset_vtable): Use them.
7206
7207 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
7208 Declare.
7209
7210 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
7211 GCC warning.
7212 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
7213 Use offsetof, for simplicity.
7214
6fbe4984
PE
72152002-10-06 Paul Eggert <eggert@twinsun.com>
7216
7217 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
7218 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 7219 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
7220 which was inadvertently undone by the 2002-09-30 patch.
7221 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
7222 the same width as int.
7223
420f93c8
PE
72242002-10-04 Paul Eggert <eggert@twinsun.com>
7225
7226 Version 1.50.
7227
7228 * configure.ac (AC_INIT), NEWS: Increment version number.
7229
7230 * doc/bison.texinfo: Minor spelling, grammar, and white space
7231 fixes.
7232 (Symbols): Mention that any negative value returned from yylex
7233 signifies end-of-input. Warn about negative chars. Mention
7234 the portable Standard C character set.
7235
7236 The GNU coding standard says CFLAGS and YFLAGS are reserved
7237 for the installer to set.
7238 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
7239 * src/Makefile.am (AM_CFLAGS): Likewise.
7240 (AM_YFLAGS): Renamed from YFLAGS.
7241
7242 Fix some MAX and MIN problems.
7243 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
7244 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
7245 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
7246 * src/reader.c (reader): Use it.
7247
7248 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
7249 POSIX 1003.1-2001 has removed fgrep.
7250
72512002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
7252
7253 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
7254 interpreted as signed.
7255 * lib/ebitset.c (ebitset_list): Fix bug.
7256
ff68026d
PE
72572002-10-01 Paul Eggert <eggert@twinsun.com>
7258
7259 More fixes for 64-bit hosts and large bitsets.
7260
7261 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
7262 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
7263 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
7264 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
7265 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
7266 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
7267 bitset_count_): Likewise.
7268 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
7269 bitset_first, bitset_last): Likewise.
7270 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
7271 bitset_stats_list_reverse, bitset_stats_size,
7272 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
7273 Likewise.
7274 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7275 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
7276 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
7277 bitsetv_reflexive_transitive_closure): Likewise.
7278 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
7279 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
7280 Likewise.
7281 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
7282 Likewise.
420f93c8 7283
ff68026d
PE
7284 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
7285 Use size_t, not unsigned int, to count bytes.
7286 * lib/abitset.h (abitset_bytes): Likewise.
7287 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
7288 Likewise.
7289 * lib/bitset.h (bitset_bytes): Likewise.
7290 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
7291 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
7292 * lib/bitsetv.c (bitsetv_alloc): Likewise.
7293 * lib/ebitset.c (ebitset_bytes): Likewise.
7294 * lib/ebitset.h (ebitset_bytes): Likewise.
7295 * lib/lbitset.c (lbitset_bytes): Likewise.
7296 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 7297
ff68026d
PE
7298 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
7299 abitset_subset_p, abitset_disjoint_p, abitset_and,
7300 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
7301 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
7302 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
7303 abitset_or_and, abitset_or_and_cmp):
7304 Use bitset_windex instead of unsigned int.
7305 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
7306 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
7307 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
7308 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
7309 Likewise.
7310 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 7311
ff68026d
PE
7312 * lib/bitset.c (bitset_print):
7313 Use proper printf formats for widths of integer types.
7314 * lib/bitset_stats.c (bitset_percent_histogram_print,
7315 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
7316 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7317 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
7318 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 7319
ff68026d
PE
7320 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
7321 BITSET_SIZE_MAX): New macros.
7322 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
7323 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
7324 to BITSET_WINDEX_MAX.
7325
7326 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
7327 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
7328 since we now return the bitset_bindex type (not int).
7329
7330 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
7331 when computing sizes.
7332 * lib/ebitset.c (ebitset_elts_grow): Likewise.
7333
7334 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
7335 and avoid cast to unsigned.
7336
6aa452a6
AD
73372002-09-30 Akim Demaille <akim@epita.fr>
7338
7339 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
7340 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
7341 Updates from Michael Hayes.
7342
927f7817
AD
73432002-09-30 Art Haas <ahaas@neosoft.com>
7344
7345 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
7346 invocations.
7347 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
7348 defined.
7349
9738f41e
AD
73502002-09-27 Akim Demaille <akim@epita.fr>
7351
7352 Version 1.49c.
7353
a5c75d7f
AD
73542002-09-27 Akim Demaille <akim@epita.fr>
7355
7356 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
7357 (Because of AC_LIBSOURCE).
7358
8280e179
AD
73592002-09-27 Akim Demaille <akim@epita.fr>
7360
7361 Playing with Autoscan.
7362
7363 * configure.ac: Remove the old LIBOBJ tweaks.
7364 (AC_REPLACE_FUNCS): Add strrchr and strtol.
7365 * lib/strrchr.c: New.
7366 * lib/strtol.c: New, from the Coreutils 4.5.1.
7367
ae64af35
AD
73682002-09-27 Akim Demaille <akim@epita.fr>
7369
7370 Playing with Autoscan.
7371
7372 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
7373 * lib/Makefile.am (libbison_a_SOURCES): No longer include
7374 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
7375 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
7376 Coreutils 4.5.1.
7377
d1a1114f
AD
73782002-09-24 Akim Demaille <akim@epita.fr>
7379
7380 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
7381 (Frequently Asked Questions, Parser Stack Overflow): New.
7382
b906441c
AD
73832002-09-13 Akim Demaille <akim@epita.fr>
7384
7385 Playing with autoscan.
7386
7387 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
7388 * src/files.c (skeleton_find): Remove, unused.
7389 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
7390 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
7391
bd701811
AD
73922002-09-13 Akim Demaille <akim@epita.fr>
7393
7394 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
7395 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
7396
e0a13e7b
AD
73972002-09-13 Akim Demaille <akim@epita.fr>
7398
7399 * configure.ac: Require 2.54.
7400 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
7401 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
7402 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
7403 Remove, provided by Autoconf macros.
7404
c97011bf
AD
74052002-09-12 Akim Demaille <akim@epita.fr>
7406
7407 * m4/prereq.m4: Update, from Coreutils 4.5.1.
7408
d862b1be
AD
74092002-09-12 Akim Demaille <akim@epita.fr>
7410
7411 * m4/prereq.m4: Update, from Fileutils 4.1.5.
7412 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
7413 Reported by Martin Mokrejs.
7414
3d38c03a
AD
74152002-09-10 Akim Demaille <akim@epita.fr>
7416
7417 * src/parse-gram.y: Associate a human readable string to each
7418 token type.
7419 * tests/regression.at (Invalid inputs): Adjust.
7420
b6347355
AD
74212002-09-10 Gary V. Vaughan <gary@gnu.org>
7422
7423 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
7424 with an Autoconf-2.5x style configure.ac.
7425
09ba4ab2
PE
74262002-09-06 Paul Eggert <eggert@twinsun.com>
7427
7428 * doc/bison.texinfo (Conditions): Make explicit that the GPL
7429 exception applies only to yacc.c. This is a modification of a
7430 patch originally suggested by Akim Demaille.
7431
21846f69
AD
74322002-09-06 Akim Demaille <akim@epita.fr>
7433
09ba4ab2
PE
7434 * data/c.m4 (b4_copyright): Move the GPL exception comment from
7435 here to...
7436 * data/yacc.c: here.
7437
21846f69
AD
7438 * data/lalr1.cc (struct yyltype): Don't define it, since we use
7439 LocationType.
7440 (b4_ltype): Default to yy::Location from location.hh.
7441
c0ad8bf3
AD
74422002-09-04 Jim Meyering <jim@meyering.net>
7443
7444 * data/yacc.c: Guard the declaration of yytoknum also with
7445 `#ifdef YYPRINT', so it is declared only when used.
7446
3a93251e
AD
74472002-09-04 Akim Demaille <akim@epita.fr>
7448
7449 * configure.in: Rename as...
7450 * configure.ac: this.
7451 Bump to 1.49c.
7452
427c0dda
AD
74532002-09-04 Akim Demaille <akim@epita.fr>
7454
7455 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
7456 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
7457 translate maintainer only messages.
7458
6a254321
PE
74592002-08-12 Paul Eggert <eggert@twinsun.com>
7460
645e30d1
PE
7461 Version 1.49b.
7462
6a254321
PE
7463 * Makefile.am (SUBDIRS): Remove intl.
7464 (DISTCLEANFILES): Remove.
7465 * NEWS: Mention that GNU M4 is now required. Clarify what is
7466 meant by "larger grammars". Mention the pt_BR translation.
7467 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
7468 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
7469 Bump version from 0.11.2 to 0.11.5.
7470 (BISON_PREREQ_STAGE): Remove.
7471 (AM_GNU_GETTEXT): Use external gettext.
7472 (AC_OUTPUT): Remove intl/Makefile.
7473
7474 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
7475
7476 * data/glr.c: Include string.h, for strlen.
7477 (yyreportParseError): Use size_t for yysize.
7478 (yy_yypstack): No longer nested inside yypstates, as nested
7479 functions are not portable. Do not assume size_t is the
7480 same width as int.
7481 (yypstates): Do not assume that ptrdiff_t is the same width
7482 as int, and similarly for yyposn and YYINDEX.
7483
7484 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
7485
7486 * lib/Makefile.am (INCLUDES): Do not include from the intl
7487 directory, which has been removed.
7488 * src/Makefile.am (INCLUDES): Likewise.
7489
7490 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
7491 (bitsets_sources, additional_bitsets_sources, timevars_sources):
7492 New vars.
7493
7494 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
7495 * tests/Makefile.am (EXTRA_DIST): Likewise.
7496
7497 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
7498 Do not assume that bitset_windex is the same width as unsigned.
7499
7500 * lib/abitset.c (abitset_unused_clear): Do not assume that
7501 bitset_word is the same width as int.
7502 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
7503 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
7504 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
7505 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
7506 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
7507
7508 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
7509 portability to one's complement hosts!).
7510 * lib/ebitset.c (ebitset_op1): Likewise.
7511 * lib/lbitset.c (lbitset_op1): Likewise.
7512
7513 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
7514 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7515 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
7516 Sync with fileutils.
7517 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
7518 lib/gettext.h: Sync with diffutils.
7519
7520 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
7521 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
7522
7523 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
7524 PROTOTYPES to check for prototypes, and "defined __STDC__" to
7525 check for void *.
7526
7527 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
7528 size_t; the old version tried to do this but casted improperly.
7529 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
7530 (bitset_test): Now returns int, not unsigned long.
7531
7532 * lib/bitset_stats.c: Include "gettext.h".
7533 (_): New macro.
7534 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
7535 name locals "index", as it generates unnecessary warnings on some
7536 hosts that have an "index" function.
7537
7538 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
7539 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
7540 they need translation.
7541 * src/LR0.c (state_list_append, new_itemsets, get_state,
7542 append_states, generate_states): Likewise.
7543 * src/assoc.c (assoc_to_string): Likewise.
7544 * src/closure.c (print_closure, set_firsts, closure): Likewise.
7545 * src/gram.c (grammar_dump): Likewise.
7546 * src/injections.c (injections_compute): Likewise.
7547 * src/lalr.c (lookaheads_print): Likewise.
7548 * src/relation.c (relation_transpose): Likewise.
7549 * src/scan-gram.l: Likewise.
7550 * src/tables.c (table_grow, pack_vector): Likewise.
7551
7552 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
7553 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
7554 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
7555 * m4/mbstate_t.m4: Sync with fileutils.
7556 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
7557
7558 * po/LINGUAS: Add pt_BR.
7559 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
7560 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
7561 lib/timevar.c.
7562 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
7563 manual recommends.
7564 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
7565
7566 * src/complain.c (strerror_r): Remove decl; not needed.
7567 (strerror): Use same pattern as ../lib/error.c.
7568
7569 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
7570
7571 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
7572
7573 * src/main.c (main): Cast result of bindtextdomain and textdomain
7574 to void, to avoid a GCC warning when --disable-nls is in effect.
7575
7576 * src/scan-gram.l: Use strings rather than escapes when possible,
7577 to minimize the number of warnings from xgettext.
7578 (handle_action_dollar, handle_action_at): Don't use isdigit,
7579 as it mishandles negative chars and it may not work as expected
7580 outside the C locale.
7581
7582 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
7583 this is a GCC extension and is not portable to other compilers.
7584
7585 * src/system.h (alloca): Use same pattern as ../lib/error.c.
7586 Do not include <ctype.h>; no longer needed.
7587 Do not include <malloc.h>; no longer needed (and generates
7588 warnings on OpenBSD 3.0).
7589
7590 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
7591 it's not portable.
7592
7593 * tests/regression.at: Do not use 'cc -c input.c -o input';
7594 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
7595
7596 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
7597 exit status as failure, not just exit status 1. Sun C exits
7598 with status 2 sometimes.
7599
7600 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
7601 Use it for the two large tests.
7602
c8f002c7
AD
76032002-08-02 Akim Demaille <akim@epita.fr>
7604
7605 * src/conflicts.c (conflicts_output): Don't output rules never
7606 reduced here, since anyway that computation doesn't work.
7607 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
7608 (rule_useless_p, rule_never_reduced_p): New.
7609 (grammar_rules_partial_print): Use a filter instead of a range.
7610 Display the title only if needed.
7611 (grammar_rules_print): Adjust.
7612 (grammar_rules_never_reduced_report): New.
7613 * src/tables.c (action_row): Move the computation of rules never
7614 reduced to...
7615 (token_actions): here.
7616 * src/main.c (main): Make the parser before making the report, so
7617 that rules never reduced are computed.
7618 Call grammar_rules_never_reduced_report.
7619 * src/print.c (print_results): Report rules never reduced.
7620 * tests/conflicts.at, tests/reduce.at: Adjust.
7621
cd08e51e
AD
76222002-08-01 Akim Demaille <akim@epita.fr>
7623
7624 Instead of attaching lookaheads and duplicating the rules being
7625 reduced by a state, attach the lookaheads to the reductions.
7626
7627 * src/state.h (state_t): Remove the `lookaheads',
7628 `lookaheads_rule' member.
7629 (reductions_t): Add a `lookaheads' member.
7630 Use a regular array for the `rules'.
7631 * src/state.c (reductions_new): Initialize the lookaheads member
7632 to 0.
7633 (state_rule_lookaheads_print): Adjust.
7634 * src/state.h, src/state.c (state_reductions_find): New.
7635 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
7636 (count_rr_conflicts): Adjust.
7637 * src/lalr.c (LArule): Remove.
7638 (add_lookback_edge): Adjust.
7639 (state_lookaheads_count): New.
7640 (states_lookaheads_initialize): Merge into...
7641 (initialize_LA): this.
7642 (lalr_free): Adjust.
7643 * src/main.c (main): Don't free nullable and derives too early: it
7644 is used by --verbose.
7645 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
7646
bb0027a9
AD
76472002-08-01 Akim Demaille <akim@epita.fr>
7648
7649 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
7650 `rule_number_t**'.
7651 (set_derives, free_derives): Rename as...
7652 (derives_compute, derives_free): this.
7653 Adjust all dependencies.
7654 * src/nullable.c (set_nullable, free_nullable): Rename as...
7655 (nullable_compute, nullable_free): these.
7656 (rule_list_t): Store rule_t *, not rule_number_t.
7657 * src/state.c (state_rule_lookaheads_print): Directly compare rule
7658 pointers, instead of their numbers.
7659 * src/main.c (main): Call nullable_free, and derives_free earlier,
7660 as they were lo longer used.
7661
3325ddc4
AD
76622002-08-01 Akim Demaille <akim@epita.fr>
7663
7664 * lib/timevar.c (get_time): Include children time.
7665 * src/lalr.h (LA, LArule): Don't export them: used with the
7666 state_t.
7667 * src/lalr.c (LA, LArule): Static.
7668 * src/lalr.h, src/lalr.c (lalr_free): New.
7669 * src/main.c (main): Call it.
7670 * src/tables.c (pack_vector): Check whether loc is >= to the
7671 table_size, not >.
7672 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
7673 (tables_generate): do it, since that's also it which allocates
7674 them.
7675 Don't free LA and LArule, main does.
7676
c6f1a33c
AD
76772002-07-31 Akim Demaille <akim@epita.fr>
7678
7679 Separate parser tables computation and output.
7680
7681 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
7682 (conflict_list, conflict_list_cnt, table, check, table_ninf)
7683 (yydefgoto, yydefact, high): Move to...
7684 * src/tables.h, src/tables.c: here.
7685 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
7686 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
7687 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
7688 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
7689 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
7690 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
7691 (action_row, save_row, token_actions, save_column, default_goto)
7692 (goto_actions, sort_actions, matching_state, pack_vector)
7693 (table_ninf_remap, pack_table, prepare_actions): Move to...
7694 * src/tables.c: here.
7695 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
7696 * src/output.c (token_actions, output_base, output_conflicts)
7697 (output_check): Merge into...
7698 (prepare_actions): this.
7699 (actions_output): Rename as...
7700 (user_actions_output): this.
7701 * src/main.c (main): Call tables_generate and tables_free.
7702
1509d42f
AD
77032002-07-31 Akim Demaille <akim@epita.fr>
7704
7705 Steal GCC's --time-report support.
7706
7707 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
7708 stolen/adjusted from GCC.
7709 * m4/stage.m4: Remove time related checks.
7710 * m4/timevar.m4: New.
7711 * configure.in: Adjust.
7712 * src/system.h: Adjust to using timevar.h.
7713 * src/getargs.h, src/getargs.c: Support trace_time for
7714 --trace=time.
7715 * src/main.c (stage): Remove.
7716 (main): Replace `stage' invocations with timevar calls.
7717 * src/output.c: Insert pertinent timevar calls.
7718
273a74fa
AD
77192002-07-31 Akim Demaille <akim@epita.fr>
7720
7721 Let --trace have arguments.
7722
7723 * src/getargs.h (enum trace_e): New.
7724 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
7725 (long_options, short_options): --trace/-T takes an optional
7726 argument.
7727 Change all the uses of trace_flag to reflect the new flags.
7728 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
7729
7730 Strengthen `stage' portability.
7731
7732 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
7733 * configure.in: Use it.
7734 Don't check for malloc.h and sys/times.h.
7735 * src/system.h: Include them when appropriate.
7736 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
7737 times and struct tms are available.
7738
217598da
AD
77392002-07-30 Akim Demaille <akim@epita.fr>
7740
7741 In verbose parse error message, don't report `error' as an
7742 expected token.
7743 * tests/actions.at (Printers and Destructors): Adjust.
7744 * tests/calc.at (Calculator $1): Adjust.
7745 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
7746 error message, do not report the parser accepts the error token in
7747 that state.
7748
52489d44
AD
77492002-07-30 Akim Demaille <akim@epita.fr>
7750
7751 Normalize conflict related messages.
7752
7753 * src/complain.h, src/complain.c (warn, complain): New.
7754 * src/conflicts.c (conflicts_print): Use them.
7755 (conflict_report_yacc): New, extracted from...
7756 (conflicts_print): here.
7757 * tests/conflicts.at, tests/existing.at: Adjust.
7758
e8832397
AD
77592002-07-30 Akim Demaille <akim@epita.fr>
7760
7761 Report rules which are never reduced by the parser: those hidden
7762 by conflicts.
7763
7764 * src/LR0.c (save_reductions): Don't make the final state too
7765 different: save its reduction (accept) instead of having a state
7766 without any action (no shift or goto, no reduce).
7767 Note: the final state is now a ``regular'' state, i.e., the
7768 parsers now contain `reduce 0' as default reduction.
7769 Nevertheless, since they decide to `accept' when yystate =
7770 final_state, they still will not reduce rule 0.
7771 * src/print.c (print_actions, print_reduction): Adjust.
7772 * src/output.c (action_row): Track reduced rules.
7773 (token_actions): Report rules never reduced.
7774 * tests/conflicts.at, tests/regression.at: Adjust.
7775
caf23d24
AD
77762002-07-30 Akim Demaille <akim@epita.fr>
7777
7778 `stage' was accidently included in a previous patch.
7779 Initiate its autoconfiscation.
7780
7781 * configure.in: Look for malloc.h and sys/times.h.
7782 * src/main.c (stage): Adjust.
7783 Report only when trace_flag.
7784
640748ee
AD
77852002-07-29 Akim Demaille <akim@epita.fr>
7786
7787 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
7788 state_number_t.
7789 (errs_t): symbol_t*, not symbol_number_t.
7790 (reductions_t): rule_t*, not rule_number_t.
7791 (FOR_EACH_SHIFT): New.
7792 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
7793 * src/print.c, src/print_graph.c: Adjust.
7794
88bce5a2
AD
77952002-07-29 Akim Demaille <akim@epita.fr>
7796
7797 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
7798
7799 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
7800 (endtoken, accept): these.
7801 * src/reader.c (reader): Set endtoken's default tag to "$end".
7802 Set undeftoken's tag to "$undefined" instead of "$undefined.".
7803 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
7804 Adjust.
7805
1bfb97db
AD
78062002-07-29 Akim Demaille <akim@epita.fr>
7807
7808 * src/reduce.c (reduce_grammar): When the language is empty,
7809 complain about the start symbol, not the axiom.
7810 Use its location.
7811 * tests/reduce.at (Empty Language): New.
7812
fc5734fe
AD
78132002-07-26 Akim Demaille <akim@epita.fr>
7814
7815 * src/reader.h, src/reader.c (gram_error): ... can't get
7816 yycontrol without making too strong assumptions on the parser
7817 itself.
7818 * src/output.c (prepare_tokens): Use the real 0th value of
7819 token_translations instead of `0'.
7820 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
7821 visible here.
7822 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
7823 for the time being: %locations ought to provide it to yyerror.
7824
3650b4b8
AD
78252002-07-25 Akim Demaille <akim@epita.fr>
7826
7827 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
7828 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
7829 * tests/regression.at (Web2c Actions): Adjust.
7830
4b3d3a8e
AD
78312002-07-25 Akim Demaille <akim@epita.fr>
7832
7833 Stop storing rules from 1 to nrules + 1.
7834
7835 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
7836 * src/nullable.c, src/output.c, src/print.c, src/reader.c
7837 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
7838 Iterate from 0 to nrules.
7839 Use rule_number_as_item_number and item_number_as_rule_number.
7840 Adjust to `derive' now containing possibly 0.
7841 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
7842 Handle the `- 1' part in rule numbers from/to item numbers.
7843 * src/conflicts.c (log_resolution): Fix the message which reversed
7844 shift and reduce.
7845 * src/output.c (action_row): Initialize default_rule to -1.
7846 (token_actions): Adjust.
7847 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
7848 expected output.
7849 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
7850
4a2a22f4
AD
78512002-07-25 Akim Demaille <akim@epita.fr>
7852
7853 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
7854 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
7855 (b4_c_knr_arg_decl): New.
7856 * data/yacc.c: Use it to define yysymprint, yydestruct, and
7857 yyreport_parse_error.
7858
b8df3223
AD
78592002-07-25 Akim Demaille <akim@epita.fr>
7860
7861 * data/yacc.c (yyreport_parse_error): New, extracted from...
7862 (yyparse): here.
7863 (yydestruct, yysymprint): Move above yyparse.
7864 Be K&R compliant.
7865
a762e609
AD
78662002-07-25 Akim Demaille <akim@epita.fr>
7867
7868 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
7869 replace...
7870 (b4_sint_type, b4_uint_type): these.
7871 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
7872 * tests/regression.at (Web2c Actions): Adjust.
7873
12b0043a
AD
78742002-07-25 Akim Demaille <akim@epita.fr>
7875
7876 * src/gram.h (TIEM_NUMBER_MAX): New.
7877 (item_number_of_rule_number, rule_number_of_item_number): Rename
7878 as...
7879 (rule_number_as_item_number, item_number_as_rule_number): these.
7880 Adjust dependencies.
7881 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
7882 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
7883 (symbol_number_to_vector_number): New.
7884 (order): Of vector_number_t* type.
7885 (base_t, BASE_MAX, BASE_MIN): New.
7886 (froms, tos, width, pos, check): Of base_t type.
7887 (action_number_t, ACTION_MIN, ACTION_MAX): New.
7888 (actrow): Of action_number_t type.
7889 (conflrow): Of unsigned int type.
7890 (table_ninf, base_ninf): New.
7891 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
7892 (muscle_insert_int_table, muscle_insert_base_table)
7893 (muscle_insert_rule_number_table): New.
7894 (prepare_tokens): Output `toknum' as int_table.
7895 (action_row): Returns a rule_number_t.
7896 Use ACTION_MIN, not SHRT_MIN.
7897 (token_actions): yydefact is rule_number_t*.
7898 (table_ninf_remap): New.
7899 (pack_table): Use it for `base' and `table'.
7900 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
7901 replaced with...
7902 (YYPACT_NINF, YYTABLE_NINF): these.
7903 (yypact, yytable): Compute their types instead of hard-coded
7904 `short'.
7905 * tests/regression.at (Web2c Actions): Adjust.
7906
5dde258a
AD
79072002-07-19 Akim Demaille <akim@epita.fr>
7908
7909 * src/scan-gram.l (id): Can start with an underscore.
7910
a945ec39
AD
79112002-07-16 Akim Demaille <akim@epita.fr>
7912
7913 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
7914 Adjust all former `associativity' dependencies.
7915 * src/symtab.c (symbol_new): Default associativity is `undef', not
7916 `right'.
7917 (symbol_check_alias_consistence): Adjust.
7918
fae437e8
AD
79192002-07-09 Akim Demaille <akim@epita.fr>
7920
7921 * doc/bison.texinfo: Properly set the ``header'' part.
7922 Use @dircategory ``GNU programming tools'' as per Texinfo's
7923 documentation.
7924 Use @copying.
7925
1a715ef2
AD
79262002-07-09 Akim Demaille <akim@epita.fr>
7927
7928 * lib/quotearg.h: Protect against multiple inclusions.
7929 * src/location.h (location_t): Add a `file' member.
7930 (LOCATION_RESET, LOCATION_PRINT): Adjust.
7931 * src/complain.c (warn_at, complain_at, fatal_at): Drop
7932 `error_one_per_line' support.
7933
a5d50994
AD
79342002-07-09 Akim Demaille <akim@epita.fr>
7935
7936 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
7937 * src/reader.c (lineno): Remove.
7938 Adjust all dependencies.
7939 (get_merge_function): Take a location and use complain_at.
7940 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
7941 * tests/regression.at (Invalid inputs, Mixing %token styles):
7942 Adjust.
7943
b275314e
AD
79442002-07-09 Akim Demaille <akim@epita.fr>
7945
7946 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
7947 recovery rule, and forbid extensions when --yacc.
7948 (gram_error): Use complain_at.
7949 * src/reader.c (reader): Exit if there were parse errors.
7950
865b9df1
AD
79512002-07-09 Akim Demaille <akim@epita.fr>
7952
7953 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
7954 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
7955 Reported by R Blake <blakers@mac.com>.
7956
c76e14da
AD
79572002-07-09 Akim Demaille <akim@epita.fr>
7958
7959 * data/yacc.c: Output the copyright notive in the header.
7960
7db2ed2d
AD
79612002-07-03 Akim Demaille <akim@epita.fr>
7962
7963 * src/output.c (froms, tos): Are state_number_t.
7964 (save_column): sp, sp1, and sp2 are state_number_t.
7965 (prepare): Rename `final' as `final_state_number', `nnts' as
7966 `nterms_number', `nrules' as `rules_number', `nstates' as
7967 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
7968 unused.
7969 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
7970 * data/lalr1.cc (nsym_): Remove, unused.
7971
e68e0410
AD
79722002-07-03 Akim Demaille <akim@epita.fr>
7973
7974 * src/lalr.h, src/lalr.c (goto_number_t): New.
7975 * src/lalr.c (goto_list_t): New.
7976 Propagate them.
7977 * src/nullable.c (rule_list_t): New.
7978 Propagate.
7979 * src/types.h: Remove.
7980
e1a4f3a4
AD
79812002-07-03 Akim Demaille <akim@epita.fr>
7982
7983 * src/closure.c (print_fderives): Use rule_rhs_print.
7984 * src/derives.c (print_derives): Use rule_rhs_print.
7985 (rule_list_t): New, replaces `shorts'.
7986 (set_derives): Add comments.
7987 * tests/sets.at (Nullable, Firsts): Adjust.
7988
536545f3
AD
79892002-07-03 Akim Demaille <akim@epita.fr>
7990
7991 * src/output.c (prepare_actions): Free `tally' and `width'.
7992 (prepare_actions): Allocate and free `order'.
7993 * src/symtab.c (symbols_free): Free `symbols'.
7994 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
7995 * src/output.c (m4_invoke): Move to...
7996 * src/scan-skel.l: here.
7997 (<<EOF>>): Close yyout, and free its name.
7998
8b752b00
AD
79992002-07-03 Akim Demaille <akim@epita.fr>
8000
8001 Fix some memory leaks, and fix a bug: state 0 was examined twice.
8002
8003 * src/LR0.c (new_state): Merge into...
8004 (state_list_append): this.
8005 (new_states): Merge into...
8006 (generate_states): here.
8007 (set_states): Don't ensure a proper `errs' state member here, do it...
8008 * src/conflicts.c (conflicts_solve): here.
8009 * src/state.h, src/state.c: Comment changes.
8010 (state_t): Rename member `shifts' as `transitions'.
8011 Adjust all dependencies.
8012 (errs_new): For consistency, also take the values as argument.
8013 (errs_dup): Remove.
8014 (state_errs_set): New.
8015 (state_reductions_set, state_transitions_set): Assert that no
8016 previous value was assigned.
8017 (state_free): New.
8018 (states_free): Use it.
8019 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
8020 temporary storage: use `errs' and `nerrs' as elsewhere.
8021 (set_conflicts): Allocate and free this `errs'.
8022
613f5e1a
AD
80232002-07-02 Akim Demaille <akim@epita.fr>
8024
8025 * lib/libiberty.h: New.
8026 * lib: Update the bitset implementation from upstream.
8027 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
8028 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
8029 * src/main.c: Adjust bitset stats calls.
8030
26e0cadc
PE
80312002-07-01 Paul Eggert <eggert@twinsun.com>
8032
8033 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
8034 char, so that negative chars don't collide with $.
8035
1154cced
AD
80362002-06-30 Akim Demaille <akim@epita.fr>
8037
8038 Have the GLR tests be `warning' checked, and fix the warnings.
8039
8040 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
8041 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
8042 (yyremoveDeletes): `yyi' and `yyj' are size_t.
8043 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
8044 (yyaddDeferredAction): static.
8045 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
8046 (yyreportParseError): yyprefix is const.
8047 yytokenp is used only when verbose.
8048 (yy__GNUC__): Replace with __GNUC__.
8049 (yypdumpstack): yyi is size_t.
8050 (yypreference): Un-yy local variables and arguments, to avoid
8051 clashes with `yyr1'. Anyway, we are not in the user name space.
8052 (yytname_size): be an int, as is compared with ints.
8053 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
8054 Use them.
8055 * tests/cxx-gram.at: Use quotation to protect $1.
8056 Use AT_COMPILE to enable warnings hunts.
8057 Prototype yylex and yyerror.
8058 `Use' argc.
8059 Include `string.h', not `strings.h'.
8060 Produce and prototype stmtMerge only when used.
8061 yylex takes a location.
8062
97650f4e
AD
80632002-06-30 Akim Demaille <akim@epita.fr>
8064
8065 We spend a lot of time in quotearg, in particular when --verbose.
8066
8067 * src/symtab.c (symbol_get): Store a quoted version of the key.
8068 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
8069 Adjust all callers.
8070
d2576365
AD
80712002-06-30 Akim Demaille <akim@epita.fr>
8072
8073 * src/state.h (reductions_t): Rename member `nreds' as num.
8074 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
8075 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
8076
ccaf65bc
AD
80772002-06-30 Akim Demaille <akim@epita.fr>
8078
8079 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
8080 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
8081 (shifts_to): Rename as...
8082 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
8083 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
8084 (TRANSITION_IS_DISABLED, transitions_to): these.
8085
87675353
AD
80862002-06-30 Akim Demaille <akim@epita.fr>
8087
8088 * src/print.c (print_shifts, print_gotos): Merge into...
8089 (print_transitions): this.
8090 (print_transitions, print_errs, print_reductions): Align the
8091 lookaheads columns.
8092 (print_core, print_transitions, print_errs, print_state,
8093 print_grammar): Output empty lines separator before, not after.
8094 (state_default_rule_compute): Rename as...
8095 (state_default_rule): this.
8096 * tests/conflicts.at (Defaulted Conflicted Reduction),
8097 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
8098 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
8099
ce4ccb4b
AD
81002002-06-30 Akim Demaille <akim@epita.fr>
8101
8102 Display items as we display rules.
8103
8104 * src/gram.h, src/gram.c (rule_lhs_print): New.
8105 * src/gram.c (grammar_rules_partial_print): Use it.
8106 * src/print.c (print_core): Likewise.
8107 * tests/conflicts.at (Defaulted Conflicted Reduction),
8108 (Unresolved SR Conflicts): Adjust.
8109 (Unresolved SR Conflicts): Adjust and rename as...
8110 (Resolved SR Conflicts): this, as was meant.
8111 * tests/regression.at (Web2c Report): Adjust.
8112
bc933ef1
AD
81132002-06-30 Akim Demaille <akim@epita.fr>
8114
8115 * src/print.c (state_default_rule_compute): New, extracted from...
8116 (print_reductions): here.
8117 Pessimize, but clarify the code.
8118 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
8119
53d4308d
AD
81202002-06-30 Akim Demaille <akim@epita.fr>
8121
8122 * src/output.c (action_row): Let default_rule be always a rule
8123 number.
8124
574fb2d5
AD
81252002-06-30 Akim Demaille <akim@epita.fr>
8126
8127 * src/closure.c (print_firsts, print_fderives, closure):
8128 Use BITSET_EXECUTE.
8129 * src/lalr.c (lookaheads_print): Likewise.
8130 * src/state.c (state_rule_lookaheads_print): Likewise.
8131 * src/print_graph.c (print_core): Likewise.
8132 * src/print.c (print_reductions): Likewise.
8133 * src/output.c (action_row): Likewise.
8134 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
8135
05811fd7
AD
81362002-06-30 Akim Demaille <akim@epita.fr>
8137
8138 * src/print_graph.c: Use report_flag.
8139
0e4d5753
AD
81402002-06-30 Akim Demaille <akim@epita.fr>
8141
8142 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
8143 to...
8144 * src/relation.h, src/relation.c (traverse, relation_digraph)
8145 (relation_print, relation_transpose): New.
8146
24c7d800
AD
81472002-06-30 Akim Demaille <akim@epita.fr>
8148
8149 * src/state.h, src/state.c (shifts_to): New.
8150 * src/lalr.c (build_relations): Use it.
8151
9222837b
AD
81522002-06-30 Akim Demaille <akim@epita.fr>
8153
8154 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
8155 (item_number_of_rule_number, rule_number_of_item_number): New.
8156 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
8157 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
8158 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
8159 Propagate their use.
8160 Much remains to be done, in particular wrt `shorts' from types.h.
8161
260008e5
AD
81622002-06-30 Akim Demaille <akim@epita.fr>
8163
8164 * src/symtab.c (symbol_new): Initialize the `printer' member.
8165
8a731ca8
AD
81662002-06-30 Akim Demaille <akim@epita.fr>
8167
8168 * src/LR0.c (save_reductions): Remove, replaced by...
8169 * src/state.h, src/state.c (state_reductions_set): New.
8170 (reductions, errs): Rename as...
8171 (reductions_t, errs_t): these.
8172 Adjust all dependencies.
8173
32e1e0a4
AD
81742002-06-30 Akim Demaille <akim@epita.fr>
8175
8176 * src/LR0.c (state_list_t, state_list_append): New.
8177 (first_state, last_state): Now symbol_list_t.
8178 (this_state): Remove.
8179 (new_itemsets, append_states, save_reductions): Take a state_t as
8180 argument.
8181 (set_states, generate_states): Adjust.
8182 (save_shifts): Remove, replaced by...
8183 * src/state.h, src/state.c (state_shifts_set): New.
8184 (shifts): Rename as...
8185 (shifts_t): this.
8186 Adjust all dependencies.
8187 * src/state.h (state_t): Remove the `next' member.
8188
e5fb6710
AD
81892002-06-30 Akim Demaille <akim@epita.fr>
8190
8191 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
8192 escaped in slot 0.
8193
c7ca99d4
AD
81942002-06-30 Akim Demaille <akim@epita.fr>
8195
8196 Use hash.h for the state hash table.
8197
8198 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
8199 (allocate_storage): Use state_hash_new.
8200 (free_storage): Use state_hash_free.
8201 (new_state, get_state): Adjust.
8202 * src/lalr.h, src/lalr.c (states): Move to...
8203 * src/states.h (state_t): Remove the `link' member, no longer
8204 used.
8205 * src/states.h, src/states.c: here.
8206 (state_hash_new, state_hash_free, state_hash_lookup)
8207 (state_hash_insert, states_free): New.
8208 * src/states.c (state_table, state_compare, state_hash): New.
8209 * src/output.c (output_actions): Do not free states now, since we
8210 still need to know the final_state number in `prepare', called
8211 afterwards. Do it...
8212 * src/main.c (main): here: call states_free after `output'.
8213
df0e7316
AD
82142002-06-30 Akim Demaille <akim@epita.fr>
8215
8216 * src/state.h, src/state.c (state_new): New, extracted from...
8217 * src/LR0.c (new_state): here.
8218 * src/state.h (STATE_ALLOC): Move to...
8219 * src/state.c: here.
8220 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
8221 * src/state.h, src/state.c: here.
8222
39f41916
AD
82232002-06-30 Akim Demaille <akim@epita.fr>
8224
8225 * src/reader.c (gensym): Rename as...
8226 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
8227 (getsym): Rename as...
8228 (symbol_get): this.
8229
d57650a5
AD
82302002-06-30 Akim Demaille <akim@epita.fr>
8231
8232 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
8233 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
8234 * src/output.c, src/print.c, src/print_graph.c: Propagate.
8235 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
8236
5a08f1ce
AD
82372002-06-30 Akim Demaille <akim@epita.fr>
8238
8239 Make the test suite pass with warnings checked.
8240
8241 * tests/actions.at (Printers and Destructors): Improve.
8242 Avoid unsigned vs. signed issues.
8243 * tests/calc.at: Don't exercise the scanner here, do it...
8244 * tests/input.at (Torturing the Scanner): here.
8245
720623af
PH
82462002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8247
88e7e941 8248 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
8249 reorganize first lines parallel to yacc.c.
8250
fb8135fa
AD
82512002-06-28 Akim Demaille <akim@epita.fr>
8252
8253 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
8254 (b4_token_enum, b4_token_defines): New, factored from...
8255 * data/lalr1.cc, data/yacc.c, glr.c: here.
8256
41442480
AD
82572002-06-28 Akim Demaille <akim@epita.fr>
8258
8259 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
8260 unused variables.
8261 * src/output.c (merger_output): static.
8262
e0e5bf84
AD
82632002-06-28 Akim Demaille <akim@epita.fr>
8264
ba0fe3c7 8265 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
8266 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
8267 pacify GCC.
8268 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 8269
676385e2
PH
82702002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8271
8272 Accumulated changelog for new GLR parsing features.
8273
6a254321 8274 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
8275 conflicts_total_count.
8276 * src/conflicts.h: Ditto.
8277 * src/output.c (token_actions): Use the new name.
8278 (output_conflicts): Change conflp => conflict_list_heads, and
8279 confl => conflict_list for better readability.
8280 * data/glr.c: Use the new names.
8281 * NEWS: Add self to GLR announcement.
e0e5bf84 8282
676385e2
PH
8283 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
8284
8285 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
8286 Akim Demaille.
8287
8288 * data/bison.glr: Change name to glr.c
8289 * data/glr.c: Renamed from bison.glr.
8290 * data/Makefile.am: Add glr.c
e0e5bf84
AD
8291
8292 * src/getargs.c:
8293
676385e2 8294 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 8295 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 8296
676385e2
PH
8297 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8298
8299 * data/bison.glr: Be sure to restore the
8300 current #line when returning to the skeleton contents after having
8301 exposed the input file's #line.
8302
8303 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8304
8305 * data/bison.glr: Bring up to date with changes to bison.simple.
8306
8307 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8308
8309 * data/bison.glr: Correct definitions that use b4_prefix.
8310 Various reformatting.
8311 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
8312 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
8313 yytokenp argument; now part of stack.
8314 (yychar): Define to behave as documented.
8315 (yyclearin): Ditto.
e0e5bf84 8316
676385e2
PH
8317 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8318
8319 * src/reader.h: Add declaration for free_merger_functions.
8320
8321 * src/reader.c (merge_functions): New variable.
8322 (get_merge_function): New function.
8323 (free_merger_functions): New function.
8324 (readgram): Check for %prec that is not followed by a symbol.
8325 Handle %dprec and %merge declarations.
8326 (packgram): Initialize dprec and merger fields in rules array.
8327
8328 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
8329 conflict_list_cnt, conflict_list_free): New variables.
8330 (table_grow): Also grow conflict_table.
e0e5bf84 8331 (prepare_rules): Output dprec and merger tables.
676385e2 8332 (conflict_row): New function.
e0e5bf84 8333 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
8334 default reduction in conflicted states for GLR parser so that there
8335 are spaces for the conflict lists.
8336 (save_row): Also save conflict information.
8337 (token_actions): Allocate conflict list.
8338 (merger_output): New function.
8339 (pack_vector): Pack conflict table, too.
8340 (output_conflicts): New function to output yyconflp and yyconfl.
8341 (output_check): Allocate conflict_tos.
8342 (output_actions): Output conflict tables, also.
8343 (output_skeleton): Output b4_mergers definition.
8344 (prepare): Output b4_max_rhs_length definition.
8345 Use 'bison.glr' as default skeleton for GLR parsers.
8346
8347 * src/gram.c (glr_parser): New flag.
8348 (grammar_free): Call free_merger_functions.
8349
8350 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
8351 all pairs of conflicting reductions, rather than just all tokens
8352 causing conflicts. Needed to size conflict tables.
e0e5bf84 8353 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
8354 interface.
8355 (conflicts_print): Ditto.
8356 (count_total_conflicts): New function.
8357
8358 * src/reader.h (merger_list): New type.
8359 (merge_functions): New variable.
8360
8361 * src/lex.h (tok_dprec, tok_merge): New token types.
8362
8363 * src/gram.h (rule_s): Add dprec and merger fields.
8364 (glr_parser): New flag.
8365
8366 * src/conflicts.h (count_total_conflicts): New function.
8367
8368 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
8369
8370 * doc/bison.texinfo (Generalized LR Parsing): New section.
8371 (GLR Parsers): New section.
8372 (Language and Grammar): Mention GLR parsing.
8373 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
8374 Correct typo ("tge" -> "the").
8375
8376 * data/bison.glr: New skeleton for GLR parsing.
8377
8378 * tests/cxx-gram.at: New tests for GLR parsing.
8379
8380 * tests/testsuite.at: Include cxx-gram.at.
8381
8382 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 8383
676385e2
PH
8384 * src/parse-gram.y:
8385
8386 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
8387
8388 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 8389
b5480d74 83902002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
8391
8392 * src/options.h, src/options.c: Remove.
8393 * src/getargs.c (short_options, long_options): New.
8394
60491a94
AD
83952002-06-27 Akim Demaille <akim@epita.fr>
8396
8397 * data/bison.simple, data/bison.c++: Rename as...
8398 * data/yacc.c, data/lalr1.cc: these.
8399 * doc/bison.texinfo (Environment Variables): Remove.
8400
9be0c25b
AD
84012002-06-25 Raja R Harinath <harinath@cs.umn.edu>
8402
8403 * src/getargs.c (report_argmatch): Initialize strtok().
8404
1ae72863
AD
84052002-06-20 Akim Demaille <akim@epita.fr>
8406
8407 * data/bison.simple (b4_symbol_actions): New, replaces...
8408 (b4_symbol_destructor, b4_symbol_printer): these.
8409 (yysymprint): Be sure to call YYPRINT only for tokens, and using
8410 user token numbers.
8411
87542d29
AD
84122002-06-20 Akim Demaille <akim@epita.fr>
8413
8414 * data/bison.simple (yydestructor): Rename as...
8415 (yydestruct): this.
8416
1a31ed21
AD
84172002-06-20 Akim Demaille <akim@epita.fr>
8418
8419 * src/symtab.h, src/symtab.c (symbol_type_set)
8420 (symbol_destructor_set, symbol_precedence_set): The location is
8421 the last argument.
8422 Adjust all callers.
8423
e776192e
AD
84242002-06-20 Akim Demaille <akim@epita.fr>
8425
8426 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
8427 internals.
8428 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
8429 Takes a location.
8430 * src/symtab.h, src/symtab.c (symbol_class_set)
8431 (symbol_user_token_number_set): Likewise.
8432 Adjust all callers.
8433 Promote complain_at.
8434 * tests/input.at (Type Clashes): Adjust.
8435
5c1180b3
AD
84362002-06-20 Akim Demaille <akim@epita.fr>
8437
8438 * data/bison.simple (YYLEX): Fix the declaration when
8439 %pure-parser.
8440
e3170060
AD
84412002-06-20 Akim Demaille <akim@epita.fr>
8442
8443 * data/bison.simple (yysymprint): Don't print the token number,
8444 just its name.
8445 * tests/actions.at (Destructors): Rename as...
8446 (Printers and Destructors): this.
8447 Also exercise %printer.
8448
253862fd
AD
84492002-06-20 Akim Demaille <akim@epita.fr>
8450
8451 * data/bison.simple (YYDSYMPRINT): New.
8452 Use it to remove many of the #if YYDEBUG/if (yydebug).
8453
366eea36
AD
84542002-06-20 Akim Demaille <akim@epita.fr>
8455
8456 * src/symtab.h, src/symtab.c (symbol_t): printer and
8457 printer_location are new members.
8458 (symbol_printer_set): New.
8459 * src/parse-gram.y (PERCENT_PRINTER): New token.
8460 Handle its associated rule.
8461 * src/scan-gram.l: Adjust.
8462 (handle_destructor_at, handle_destructor_dollar): Rename as...
8463 (handle_symbol_code_at, handle_symbol_code_dollar): these.
8464 * src/output.c (symbol_printers_output): New.
8465 (output_skeleton): Call it.
8466 * data/bison.simple (yysymprint): New. Cannot be named yyprint
8467 since there are already many grammar files with a user `yyprint'.
8468 Replace the calls to YYPRINT to calls to yysymprint.
8469 * tests/calc.at: Adjust.
8470 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
8471 taking advantage of parser very internal details (stack size!).
8472
4f25ebb0
AD
84732002-06-20 Akim Demaille <akim@epita.fr>
8474
8475 * src/scan-gram.l: Complete the scanner with the missing patterns
8476 to pacify Flex.
8477 Use `quote' and `symbol_tag_get' where appropriate.
8478
93b68a0e
AD
84792002-06-19 Akim Demaille <akim@epita.fr>
8480
8481 * tests/actions.at (Destructors): Augment to test locations.
8482 * data/bison.simple (yydestructor): Pass it the current location
8483 if locations are enabled.
8484 Prototype only when __STDC__ or C++.
8485 Change the argument names to move into the yy name space: there is
8486 user code here.
8487
58612f1d
AD
84882002-06-19 Akim Demaille <akim@epita.fr>
8489
74310291
AD
8490 * data/bison.simple (b4_pure_if): New.
8491 Use it instead of #ifdef YYPURE.
8492
84932002-06-19 Akim Demaille <akim@epita.fr>
8494
8495 * data/bison.simple (b4_location_if): New.
58612f1d
AD
8496 Use it instead of #ifdef YYLSP_NEEDED.
8497
f25bfb75
AD
84982002-06-19 Akim Demaille <akim@epita.fr>
8499
8500 Prepare @$ in %destructor, but currently don't bind it in the
8501 skeleton, as %location use is not cleaned up yet.
8502
8503 * src/scan-gram.l (handle_dollar, handle_destructor_at)
8504 (handle_action_at): New.
8505 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
8506 a braced_code_t and a location as additional arguments.
8507 (handle_destructor_dollar): Instead of requiring `b4_eval', just
8508 unquote one when outputting `b4_dollar_dollar'.
8509 Adjust callers.
8510 * data/bison.simple (b4_eval): Remove.
8511 (b4_symbol_destructor): Adjust.
8512 * tests/input.at (Invalid @n): Adjust.
8513
c732d2c6
AD
85142002-06-19 Zack Weinberg <zack@codesourcery.com>
8515
8516 * doc/bison.texinfo: Document ability to have multiple
8517 prologue sections.
8518
8c165d89
AD
85192002-06-18 Akim Demaille <akim@epita.fr>
8520
8521 * src/files.c (compute_base_names): When computing the output file
8522 names from the input file name, strip the directory part.
8523
ca98bf57
AD
85242002-06-18 Akim Demaille <akim@epita.fr>
8525
8526 * data/bison.simple.new: Comment changes.
8527 Reported by Andreas Schwab.
8528
0bfb02ff
AD
85292002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
8530
8531 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
8532 there are no `label `yyoverflowlab' defined but not used' warnings
8533 when yyoverflow is defined.
8534
24c0aad7
AD
85352002-06-18 Akim Demaille <akim@epita.fr>
8536
8537 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
8538 new member.
8539 (symbol_destructor_set): Adjust.
8540 * src/output.c (symbol_destructors_output): Output the destructor
8541 locations.
8542 Output the symbol name.
8543 * data/bison.simple (b4_symbol_destructor): Adjust.
8544
5719c109
AD
85452002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
8546 and Akim Demaille <akim@epita.fr>
8547
8548 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
8549 what's left on the stack when the error recovery hits EOF.
8550 * tests/actions.at (Destructors): Complete to exercise this case.
8551
9280d3ef
AD
85522002-06-17 Akim Demaille <akim@epita.fr>
8553
8554 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
8555 arguments is really empty, not only equal to `[]'.
8556 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
8557 member.
8558 (symbol_destructor_set): New.
8559 * src/output.c (symbol_destructors_output): New.
8560 * src/reader.h (brace_code_t, current_braced_code): New.
8561 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
8562 (handle_dollar): Rename as...
8563 (handle_action_dollar): this.
8564 (handle_destructor_dollar): New.
8565 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
8566 (grammar_declaration): Use it.
8567 * data/bison.simple (yystos): Is always defined.
8568 (yydestructor): New.
8569 * tests/actions.at (Destructors): New.
8570 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
8571
dafdc66f
AD
85722002-06-17 Akim Demaille <akim@epita.fr>
8573
8574 * src/symlist.h, src/symlist.c (symbol_list_length): New.
8575 * src/scan-gram.l (handle_dollar, handle_at): Compute the
8576 rule_length only when needed.
8577 * src/output.c (actions_output, token_definitions_output): Output
8578 the full M4 block.
8579 * src/symtab.c: Don't access directly to the symbol tag, use
8580 symbol_tag_get.
8581 * src/parse-gram.y: Use symbol_list_free.
8582
56c47203
AD
85832002-06-17 Akim Demaille <akim@epita.fr>
8584
8585 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
8586 (symbol_list_prepend, get_type_name): Move to...
8587 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
8588 (symbol_list_prepend, symbol_list_n_type_name_get): here.
8589 Adjust all callers.
8590 (symbol_list_free): New.
8591 * src/scan-gram.l (handle_dollar): Takes a location.
8592 * tests/input.at (Invalid $n): Adjust.
8593
1e0bab92
AD
85942002-06-17 Akim Demaille <akim@epita.fr>
8595
8596 * src/reader.h, src/reader.c (symbol_list_new): Export it.
8597 (symbol_list_prepend): New.
8598 * src/parse-gram.y (%union): `list' is a new member.
8599 (symbols.1): New, replaces...
8600 (terms_to_prec.1, nterms_to_type.1): these.
8601 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
8602 Take a location as additional argument.
8603 Adjust all callers.
8604
04e60654
AD
86052002-06-15 Akim Demaille <akim@epita.fr>
8606
8607 * src/parse-gram.y: Move %token in the declaration section so that
8608 we don't depend upon CVS Bison.
8609
10e5b8bd
AD
86102002-06-15 Akim Demaille <akim@epita.fr>
8611
8612 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
8613 * src/print.c (print_core): Use it.
8614
9801d40c
AD
86152002-06-15 Akim Demaille <akim@epita.fr>
8616
8617 * src/conflicts.c (log_resolution): Accept the rule involved in
8618 the sr conflicts instead of the lookahead number that points to
8619 that rule.
8620 (flush_reduce): Accept the current lookahead vector as argument,
8621 instead of the index in LA.
8622 (resolve_sr_conflict): Accept the current number of lookahead
8623 bitset to consider for the STATE, instead of the index in LA.
8624 (set_conflicts): Adjust.
8625 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
8626
c0263492
AD
86272002-06-15 Akim Demaille <akim@epita.fr>
8628
8629 * src/state.h (state_t): Replace the `lookaheadsp' member, a
8630 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
8631 Adjust all dependencies.
8632 * src/lalr.c (initialize_lookaheads): Split into...
8633 (states_lookaheads_count, states_lookaheads_initialize): these.
8634 (lalr): Adjust.
8635
9757c359
AD
86362002-06-15 Akim Demaille <akim@epita.fr>
8637
8638 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
8639 out of...
8640 (grammar_rules_print): here.
8641 * src/reduce.c (reduce_output): Use it.
8642 * tests/reduce.at (Useless Rules, Reduced Automaton)
8643 (Underivable Rules): Adjust.
8644
6b98e4b5
AD
86452002-06-15 Akim Demaille <akim@epita.fr>
8646
8647 Copy BYacc's nice way to report the grammar.
8648
8649 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
8650 New.
8651 Don't print the rules' location, it is confusing and useless.
8652 (rule_print): Use grammar_rhs_print.
8653 * src/print.c (print_grammar): Use grammar_rules_print.
8654
6b98e4b5
AD
86552002-06-15 Akim Demaille <akim@epita.fr>
8656
8657 Complete and rationalize `useless thing' warnings.
8658
8659 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
8660 (symbol_tag_print): New.
8661 Use them everywhere in place of accessing directly the tag member.
8662 * src/gram.h, src/gram.c (rule_print): New.
8663 Use it where a rule used to be printed `by hand'.
8664 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
8665 (reduce_grammar_tables): Report the useless rules.
8666 (reduce_print): Useless things are a warning, not an error.
8667 Report it as such.
8668 * tests/reduce.at (Useless Nonterminals, Useless Rules):
8669 (Reduced Automaton, Underivable Rules): Adjust.
8670 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
8671 * tests/conflicts.at (Unresolved SR Conflicts)
8672 (Solved SR Conflicts): Adjust.
8673
ee000ba4
AD
86742002-06-15 Akim Demaille <akim@epita.fr>
8675
8676 Let symbols have a location.
8677
8678 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
8679 (getsym): Adjust.
8680 Adjust all callers.
8681 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
8682 Use location_t, not int.
8683 * src/symtab.c (symbol_check_defined): Take advantage of the
8684 location.
8685 * tests/regression.at (Invalid inputs): Adjust.
8686
8efe435c
AD
86872002-06-15 Akim Demaille <akim@epita.fr>
8688
8689 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
8690 (input): Don't try to initialize yylloc here, do it in the
8691 scanner.
8692 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
8693 * src/gram.h (rule_t): Change line and action_line into location
8694 and action_location, of location_t type.
8695 Adjust all dependencies.
8696 * src/location.h, src/location.c (empty_location): New.
8697 * src/reader.h, src/reader.c (grammar_start_symbol_set)
8698 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
8699 (grammar_current_rule_symbol_append)
8700 (grammar_current_rule_action_append): Expect a location as argument.
8701 * src/reader.c (grammar_midrule_action): Adjust to attach an
8702 action's location as dummy symbol location.
8703 * src/symtab.h, src/symtab.c (startsymbol_location): New.
8704 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
8705 the line numbers.
8706
1921f1d7
AD
87072002-06-14 Akim Demaille <akim@epita.fr>
8708
8709 Grammar declarations may be found in the grammar section.
8710
8711 * src/parse-gram.y (rules_or_grammar_declaration): New.
8712 (declarations): Each declaration may end with a semicolon, not
8713 just...
8714 (grammar_declaration): `"%union"'.
8715 (grammar): Branch to rules_or_grammar_declaration.
8716
4515534c
AD
87172002-06-14 Akim Demaille <akim@epita.fr>
8718
8719 * src/main.c (main): Invoke scanner_free.
8720
f958596b
AD
87212002-06-14 Akim Demaille <akim@epita.fr>
8722
8723 * src/output.c (m4_invoke): Extracted from...
8724 (output_skeleton): here.
8725 Free tempfile.
8726
2c569025
AD
87272002-06-14 Akim Demaille <akim@epita.fr>
8728
8729 * src/parse-gram.y (directives, directive, gram)
8730 (grammar_directives, precedence_directives, precedence_directive):
8731 Rename as...
8732 (declarations, declaration, grammar, grammar_declaration)
8733 (precedence_declaration, precedence_declarator): these.
8734 (symbol_declaration): New.
8735
592e8d4d
AD
87362002-06-14 Akim Demaille <akim@epita.fr>
8737
8738 * src/files.c (action_obstack): Remove, unused.
8739 (output_obstack): Remove it, and all its dependencies, as it is no
8740 longer needed.
8741 * src/reader.c (epilogue_set): Build the epilogue in the
8742 muscle_obstack.
8743 * src/output.h, src/output.c (muscle_obstack): Move to...
8744 * src/muscle_tab.h, src/muscle_tab.h: here.
8745 (muscle_init): Initialize muscle_obstack.
8746 (muscle_free): New.
8747 * src/main.c (main): Call it.
8748
0c15323d
AD
87492002-06-14 Akim Demaille <akim@epita.fr>
8750
8751 * src/location.h: New, extracted from...
8752 * src/reader.h: here.
8753 * src/Makefile.am (noinst_HEADERS): Merge into
8754 (bison_SOURCES): this.
8755 Add location.h.
8756 * src/parse-gram.y: Use location_t instead of Bison's.
8757 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
8758 Use location_t instead of ints.
8759
e96c9728
AD
87602002-06-14 Akim Demaille <akim@epita.fr>
8761
8762 * data/bison.simple, data/bison.c++: Be sure to restore the
8763 current #line when returning to the skeleton contents after having
8764 exposed the input file's #line.
8765
75d1fe16
AD
87662002-06-12 Akim Demaille <akim@epita.fr>
8767
8768 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
8769 eager.
8770 * tests/actions.at (Exotic Dollars): New.
8771
6c35d22c
AD
87722002-06-12 Akim Demaille <akim@epita.fr>
8773
8774 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
8775 ['"/] too eagerly.
8776 * tests/input.at (Torturing the Scanner): New.
8777
1d6412ad
AD
87782002-06-11 Akim Demaille <akim@epita.fr>
8779
8780 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
8781 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
8782 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
8783 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
8784 * src/reader.c (reader): Use it.
8785
4cdb01db
AD
87862002-06-11 Akim Demaille <akim@epita.fr>
8787
8788 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
8789 Adjust all callers.
8790 (scanner_last_string_free): New.
8791
44995b2e
AD
87922002-06-11 Akim Demaille <akim@epita.fr>
8793
8794 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
8795 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
8796 (last_string, YY_OBS_FREE): New.
8797 Use them when returning an ID.
8798
e9955c83
AD
87992002-06-11 Akim Demaille <akim@epita.fr>
8800
8801 Have Bison grammars parsed by a Bison grammar.
8802
8803 * src/reader.c, src/reader.h (prologue_augment): New.
8804 * src/reader.c (copy_definition): Remove.
8805
8806 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
8807 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
8808 (grammar_current_rule_prec_set, grammar_current_rule_check)
8809 (grammar_current_rule_symbol_append)
8810 (grammar_current_rule_action_append): Export.
8811 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
8812 (symbol_list_action_append): Remove.
8813 Hook the routines from reader.
8814 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
8815 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
8816
8817 * src/reader.c (read_declarations): Remove, unused.
8818
8819 * src/parse-gram.y: Handle the epilogue.
8820 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
8821 (grammar_start_symbol_set): this.
8822 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
8823 * src/reader.c (readgram): Remove, unused.
8824 (reader): Adjust to insert eoftoken and axiom where appropriate.
8825
8826 * src/reader.c (copy_dollar): Replace with...
8827 * src/scan-gram.h (handle_dollar): this.
8828 * src/parse-gram.y: Remove `%thong'.
8829
8830 * src/reader.c (copy_at): Replace with...
8831 * src/scan-gram.h (handle_at): this.
8832
8833 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
8834 New.
8835
8836 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
8837 time being.
8838
8839 * src/reader.h, src/reader.c (grammar_rule_end): New.
8840
8841 * src/parse.y (current_type, current_class): New.
8842 Implement `%nterm', `%token' support.
8843 Merge `%term' into `%token'.
8844 (string_as_id): New.
8845 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
8846 type name.
8847
8848 * src/parse-gram.y: Be sure to handle properly the beginning of
8849 rules.
8850
8851 * src/parse-gram.y: Handle %type.
8852 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
8853
8854 * src/parse-gram.y: More directives support.
8855 * src/options.c: No longer handle source directives.
8856
8857 * src/parse-gram.y: Fix %output.
8858
8859 * src/parse-gram.y: Handle %union.
8860 Use the prologue locations.
8861 * src/reader.c (parse_union_decl): Remove.
8862
8863 * src/reader.h, src/reader.c (epilogue_set): New.
8864 * src/parse-gram.y: Use it.
8865
8866 * data/bison.simple, data/bison.c++: b4_stype is now either not
8867 defined, then default to int, or to the contents of %union,
8868 without `union' itself.
8869 Adjust.
8870 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
8871
8872 * src/output.c (actions_output): Don't output braces, as they are
8873 already handled by the scanner.
8874
8875 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
8876 characters to themselves.
8877
8878 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
8879 that the epilogue has a proper #line.
8880
8881 * src/parse-gram.y: Handle precedence/associativity.
8882
8883 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
8884 a terminal.
8885 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
8886 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
8887 at all to define terminals that cannot be emitted.
8888
8889 * src/scan-gram.l: Escape M4 characters.
8890
8891 * src/scan-gram.l: Working properly with escapes in user
8892 strings/characters.
8893
8894 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
8895 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
8896 grammar.
8897 Use more modest sizes, as for the time being the parser does not
8898 release memory, and therefore the process swallows a huge amount
8899 of memory.
8900
8901 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
8902 stricter %token grammar.
8903
8904 * src/symtab.h (associativity): Add `undef_assoc'.
8905 (symbol_precedence_set): Do nothing when passed an undef_assoc.
8906 * src/symtab.c (symbol_check_alias_consistence): Adjust.
8907
8908 * tests/regression.at (Invalid %directive): Remove, as it is now
8909 meaningless.
8910 (Invalid inputs): Adjust to the new error messages.
8911 (Token definitions): The new grammar doesn't allow too many
8912 eccentricities.
8913
8914 * src/lex.h, src/lex.c: Remove.
8915 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
8916 (copy_character, copy_string2, copy_string, copy_identifier)
8917 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
8918 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
8919 (parse_action): Remove.
8920 * po/POTFILES.in: Adjust.
8921
2e047461
AD
89222002-06-11 Akim Demaille <akim@epita.fr>
8923
cd05d13c 8924 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
8925 rule's action member: return the action as a string.
8926 Don't require `rule_length' as an argument: compute it.
8927 (grammar_current_rule_symbol_append)
8928 (grammar_current_rule_action_append): New, eved out from
8929 (readgram): here.
8930 Remove `action_flag', `rulelength', unused now.
8931
9af3fbce
AD
89322002-06-11 Akim Demaille <akim@epita.fr>
8933
8934 * src/reader.c (grammar_current_rule_prec_set).
8935 (grammar_current_rule_check): New, eved out from...
8936 (readgram): here.
8937 Remove `xaction', `first_rhs': useless.
8938 * tests/input.at (Type clashes): New.
8939 * tests/existing.at (GNU Cim Grammar): Adjust.
8940
1485e106
AD
89412002-06-11 Akim Demaille <akim@epita.fr>
8942
8943 * src/reader.c (grammar_midrule_action): New, Eved out from
8944 (readgram): here.
8945
da4160c3
AD
89462002-06-11 Akim Demaille <akim@epita.fr>
8947
8948 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
8949 New.
8950 (readgram): Use them as replacement of inlined code, crule and
8951 crule1.
8952
f6d0f937
AD
89532002-06-11 Akim Demaille <akim@epita.fr>
8954
8955 * src/reader.c (grammar_end, grammar_symbol_append): New.
8956 (readgram): Use them.
8957 Make the use of `p' as local as possible.
8958
69078d4b
AD
89592002-06-10 Akim Demaille <akim@epita.fr>
8960
8961 GCJ's parser requires the tokens to be defined before the prologue.
8962
8963 * data/bison.simple: Output the token definition before the user's
8964 prologue.
8965 * tests/regression.at (Braces parsing, Duplicate string)
8966 (Mixing %token styles): Check the output from bison.
8967 (Early token definitions): New.
8968
5e424082
AD
89692002-06-10 Akim Demaille <akim@epita.fr>
8970
8971 * src/symtab.c (symbol_user_token_number_set): Don't complain when
8972 assigning twice the same user number to a token, so that we can
8973 use it in...
8974 * src/lex.c (lex): here.
8975 Also use `symbol_class_set' instead of hand written code.
8976 * src/reader.c (parse_assoc_decl): Likewise.
8977
44536b35
AD
89782002-06-10 Akim Demaille <akim@epita.fr>
8979
8980 * src/symtab.c, src/symtab.c (symbol_class_set)
8981 (symbol_user_token_number_set): New.
8982 * src/reader.c (parse_token_decl): Use them.
8983 Use a switch instead of ifs.
8984 Use a single argument.
8985
8b9f2372
AD
89862002-06-10 Akim Demaille <akim@epita.fr>
8987
8988 Remove `%thong' support as it is undocumented, unused, duplicates
8989 `%token's job, and creates useless e-mail traffic with people who
8990 want to know what it is, why it is undocumented, unused, and
8991 duplicates `%token's job.
8992
8993 * src/reader.c (parse_thong_decl): Remove.
8994 * src/options.c (option_table): Remove "thong".
8995 * src/lex.h (tok_thong): Remove.
8996
3ae2b51f
AD
89972002-06-10 Akim Demaille <akim@epita.fr>
8998
8999 * src/symtab.c, src/symtab.c (symbol_type_set)
9000 (symbol_precedence_set): New.
9001 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
9002 (value_components_used): Remove, unused.
9003
2f1afb73
AD
90042002-06-09 Akim Demaille <akim@epita.fr>
9005
9006 Move symbols handling code out of the reader.
9007
9008 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
9009 (axiom): Move to...
9010 * src/symtab.h, src/symtab.c: here.
9011
9012 * src/gram.c (start_symbol): Remove: use startsymbol->number.
9013 * src/reader.c (startval): Rename as...
9014 * src/symtab.h, src/symtab.c (startsymbol): this.
9015 * src/reader.c: Adjust.
9016
9017 * src/reader.c (symbol_check_defined, symbol_make_alias)
9018 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
9019 (token_translations_init)
9020 Move to...
9021 * src/symtab.c: here.
9022 * src/reader.c (packsymbols): Move to...
9023 * src/symtab.h, src/symtab.c (symbols_pack): here.
9024 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
9025 argument.
9026
e9bca3ad
AD
90272002-06-03 Akim Demaille <akim@epita.fr>
9028
9029 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
9030 then statements.
9031
86eff183
AD
90322002-06-03 Akim Demaille <akim@epita.fr>
9033
9034 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
9035 structs with non literals.
9036 * src/scan-skel.l: never-interactive.
9037 * src/conflicts.c (enum conflict_resolution_e): No trailing
9038 comma.
9039 * src/getargs.c (usage): Split long literal strings.
9040 Reported by Hans Aberg.
9041
717be197
AD
90422002-05-28 Akim Demaille <akim@epita.fr>
9043
9044 * data/bison.c++: Use C++ ostreams.
9045 (cdebug_): New member.
9046
670ddffd
AD
90472002-05-28 Akim Demaille <akim@epita.fr>
9048
9049 * src/output.c (output_skeleton): Be sure to allocate enough room
9050 for `/' _and_ for `\0' in full_skeleton.
9051
769b430f
AD
90522002-05-28 Akim Demaille <akim@epita.fr>
9053
9054 * data/bison.c++: Catch up with bison.simple:
9055 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9056 and Paul Eggert <eggert@twinsun.com>: `error' handing.
9057 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
9058 and popping traces.
9059
7067cb36
PH
90602002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9061
9062 * src/output.c (output_skeleton): Put an explicit path in front of
9063 the skeleton file name, rather than relying on the -I directory,
9064 to partially alleviate effects of having a skeleton file lying around
9065 in the current directory.
769b430f 9066
4a713ec2
PH
90672002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9068
769b430f 9069 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
9070 obstack_printf should be obstack_fgrow1.
9071
b408954b
AD
90722002-05-26 Akim Demaille <akim@epita.fr>
9073
9074 * src/state.h (state_t): `solved_conflicts' is a new member.
9075 * src/LR0.c (new_state): Set it to 0.
9076 * src/conflicts.h, src/conflicts.c (print_conflicts)
9077 (free_conflicts, solve_conflicts): Rename as...
9078 (conflicts_print, conflicts_free, conflicts_solve): these.
9079 Adjust callers.
9080 * src/conflicts.c (enum conflict_resolution_e)
9081 (solved_conflicts_obstack): New, used by...
9082 (log_resolution): this.
9083 Adjust to attach the conflict resolution to each state.
9084 Complete the description with the precedence/associativity
9085 information.
9086 (resolve_sr_conflict): Adjust.
9087 * src/print.c (print_state): Output its solved_conflicts.
9088 * tests/conflicts.at (Unresolved SR Conflicts)
9089 (Solved SR Conflicts): Exercise --report=all.
9090
a49aecd5
AD
90912002-05-26 Akim Demaille <akim@epita.fr>
9092
9093 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
9094 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
9095 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
9096 (token_number_t, item_number_as_token_number)
9097 (token_number_as_item_number, muscle_insert_token_number_table):
9098 Rename as...
9099 (symbol_number_t, item_number_as_symbol_number)
9100 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
9101 these, since it is more appropriate.
9102
5504898e
AD
91032002-05-26 Akim Demaille <akim@epita.fr>
9104
9105 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
9106 `Error:' lines.
9107 * data/bison.simple (yystos) [YYDEBUG]: New.
9108 (yyparse) [YYDEBUG]: Display the symbols which are popped during
9109 error recovery.
9110 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
9111
ec3bc396
AD
91122002-05-25 Akim Demaille <akim@epita.fr>
9113
9114 * doc/bison.texinfo (Debugging): Split into...
9115 (Tracing): this new section, its former contents, and...
9116 (Understanding): this new section.
9117 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
9118 by...
9119 (report_flag): this.
9120 Adjust all dependencies.
9121 (report_args, report_types, report_argmatch): New.
9122 (usage, getargs): Report/support -r, --report.
9123 * src/options.h
9124 (struct option_table_struct): Rename as..,
9125 (struct option_table_s): this.
9126 Rename the `set_flag' member to `flag' to match with getopt_long's
9127 struct.
9128 * src/options.c (option_table): Split verbose into an entry for
9129 %verbose, and another for --verbose.
9130 Support --report/-r, so remove -r from the obsolete --raw.
9131 * src/print.c: Attach full item sets and lookaheads reports to
9132 report_flag instead of trace_flag.
9133 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
9134
78df8250
PE
91352002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9136 and Paul Eggert <eggert@twinsun.com>
769b430f 9137
78df8250
PE
9138 * data/bison.simple (yyparse): Correct error handling to conform to
9139 POSIX and yacc. Specifically, after syntax error is discovered,
9140 do not reduce further before shifting the error token.
9141 Clean up the code a bit by removing the labels yyerrdefault,
9142 yyerrhandle, yyerrpop.
9143 * NEWS: Document the above.
9144
c0c9ea05
PH
91452002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9146
9147 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
9148 type; it isn't always big enough, since it doesn't necessarily
9149 include non-terminals.
769b430f 9150 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
9151 the latter can be removed.
9152 (yy_token_number_type): Remove, only one use.
9153 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
9154 don't use TokenNumberType as element type.
769b430f 9155
c0c9ea05
PH
9156 * tests/regression.at: Modify expected output to agree with change
9157 to yyr1 and yytranslate.
769b430f 9158
6390a83f
FK
91592002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
9160
9161 * src/reader.c (parse_action): Use copy_character instead of
9162 obstack_1grow.
9163
db7c8e9a
AD
91642002-05-13 Akim Demaille <akim@epita.fr>
9165
9166 * tests/regression.at (Token definitions): Prototype yylex and
9167 yyerror.
9168
fcc61800
PH
91692002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9170
158c687b 9171 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
9172 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
9173 32-bit arithmetic.
9174 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
9175
5683e9b2
AD
91762002-05-07 Akim Demaille <akim@epita.fr>
9177
9178 * tests/synclines.at: Be sure to prototype yylex and yyerror to
9179 avoid GCC warnings.
9180
0c2d3f4c
AD
91812002-05-07 Akim Demaille <akim@epita.fr>
9182
9183 Kill GCC warnings.
9184
9185 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
9186 over the RHS of each rule.
9187 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
9188 * src/state.h (state_t): Member `nitems' is unsigned short.
9189 * src/LR0.c (get_state): Adjust.
9190 * src/reader.c (packgram): Likewise.
9191 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
9192 `Type'.
9193 (muscle_insert_int_table): Remove, unused.
9194 (prepare_rules): Remove `max'.
9195
1565b720
AD
91962002-05-06 Akim Demaille <akim@epita.fr>
9197
9198 * src/closure.c (print_firsts): Display of the symbol tags.
9199 (bitmatrix_print): Move to...
9200 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
9201 here.
9202 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
9203
cfaee611
AD
92042002-05-06 Akim Demaille <akim@epita.fr>
9205
9206 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
9207 hash_do_for_each.
9208
458be8e0
AD
92092002-05-06 Akim Demaille <akim@epita.fr>
9210
9211 * src/LR0.c (new_state, get_state): Instead of using the global
9212 `kernel_size' and `kernel_base', have two new arguments:
9213 `core_size' and `core'.
9214 Adjust callers.
9215
a900a624
AD
92162002-05-06 Akim Demaille <akim@epita.fr>
9217
9218 * src/reader.c (packgram): No longer end `ritem' with a 0
9219 sentinel: it is not used.
9220
d4e7d3a1
AD
92212002-05-05 Akim Demaille <akim@epita.fr>
9222
9223 New experimental feature: display the lookaheads in the report and
9224 graph.
9225
9226 * src/print (print_core): When --trace-flag, display the rules
9227 lookaheads.
9228 * src/print_graph.c (print_core): Likewise.
9229 Swap the arguments.
9230 Adjust caller.
9231
39ceb25b
AD
92322002-05-05 Akim Demaille <akim@epita.fr>
9233
9234 * tests/torture.at (Many lookaheads): New test.
9235
5372019f
AD
92362002-05-05 Akim Demaille <akim@epita.fr>
9237
9238 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
9239 (GENERATE_MUSCLE_INSERT_TABLE): this.
9240 (output_int_table, output_unsigned_int_table, output_short_table)
9241 (output_token_number_table, output_item_number_table): Replace with...
9242 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
9243 (muscle_insert_short_table, muscle_insert_token_number_table)
9244 (muscle_insert_item_number_table): these.
9245 Adjust all callers.
9246 (prepare_tokens): Don't free `translations', since...
9247 * src/reader.h, src/reader.c (grammar_free): do it.
9248 Move to...
9249 * src/gram.h, src/gram.c (grammar_free): here.
9250 * data/bison.simple, data/bison.c++: b4_token_number_max is now
9251 b4_translate_max.
9252
5df5f6d5
AD
92532002-05-05 Akim Demaille <akim@epita.fr>
9254
9255 * src/output.c (output_unsigned_int_table): New.
9256 (prepare_rules): `i' is unsigned.
9257 `prhs', `rline', `r2' are unsigned int.
9258 Rename muscle `rhs_number_max' as `rhs_max'.
9259 Output muscles `prhs_max', `rline_max', and `r2_max'.
9260 Free rline and r1.
9261 * data/bison.simple, data/bison.c++: Adjust to use these muscles
9262 to compute types instead of constant types.
9263 * tests/regression.at (Web2c Actions): Adjust.
9264
b87f8b21
AD
92652002-05-04 Akim Demaille <akim@epita.fr>
9266
9267 * src/symtab.h (SALIAS, SUNDEF): Rename as...
9268 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
9269 Adjust dependencies.
9270 * src/output.c (token_definitions_output): Be sure not to output a
9271 `#define 'a'' when fed with `%token 'a' "a"'.
9272 * tests/regression.at (Token definitions): New.
9273
8bb936e4
PE
92742002-05-03 Paul Eggert <eggert@twinsun.com>
9275
9276 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
9277 for K&R C.
9278
92792002-05-03 gettextize <bug-gnu-gettext@gnu.org>
9280
9281 * Makefile.am (SUBDIRS): Remove intl.
9282 (EXTRA_DIST): Add config/config.rpath.
9283
53c71a12
AD
92842002-05-03 Akim Demaille <akim@epita.fr>
9285
9286 * data/bison.simple (m4_if): Don't output empty enums.
9287 And actually, output valid enum definitions :(.
9288
289dd0cf
AD
92892002-05-03 Akim Demaille <akim@epita.fr>
9290
9291 * configure.bat: Remove, completely obsolete.
9292 * Makefile.am (EXTRA_DIST): Adjust.
9293 Don't distribute config.rpath...
9294 * config/Makefile.am (EXTRA_DIST): Do it.
9295
db85e524
AD
92962002-05-03 Akim Demaille <akim@epita.fr>
9297
9298 * configure.in (GETTEXT_VERSION): New.
9299 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
9300
83ccf991
AD
93012002-05-03 Akim Demaille <akim@epita.fr>
9302
9303 * data/bison.simple (b4_token_enum): New.
9304 (b4_token_defines): Use it to output tokens both as #define and
9305 enums.
9306 Suggested by Paul Eggert.
9307 * src/output.c (token_definitions_output): Don't output spurious
9308 white spaces.
9309
1f418995
AD
93102002-05-03 Akim Demaille <akim@epita.fr>
9311
9312 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
9313
45119f04
RA
93142002-05-02 Robert Anisko <robert@lrde.epita.fr>
9315
9316 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
9317 Update the stack class, give a try to deque as the default container.
9318
b2d52318
AD
93192002-05-02 Akim Demaille <akim@epita.fr>
9320
9321 * data/bison.simple (yyparse): Do not implement @$ = @1.
9322 (YYLLOC_DEFAULT): Adjust to do it.
9323 * doc/bison.texinfo (Location Default Action): Fix.
9324
3a8b4109
AD
93252002-05-02 Akim Demaille <akim@epita.fr>
9326
9327 * src/reader.c (parse_braces): Merge into...
9328 (parse_action): this.
9329
84614e13
AD
93302002-05-02 Akim Demaille <akim@epita.fr>
9331
9332 * configure.in (ALL_LINGUAS): Remove.
9333 * po/LINGUAS, hr.po: New.
9334
fdbcd8e2
AD
93352002-05-02 Akim Demaille <akim@epita.fr>
9336
9337 Remove the so called hairy (semantic) parsers.
9338
9339 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
9340 * src/gram.h, src/gram.c (semantic_parser): Remove.
9341 (rule_t): Remove the guard and guard_line members.
9342 * src/lex.h (token_t): remove tok_guard.
9343 * src/options.c (option_table): Remove %guard and %semantic_parser
9344 support.
9345 * src/output.c, src/output.h (guards_output): Remove.
9346 (prepare): Adjust.
9347 (token_definitions_output): Don't output the `T'
9348 tokens (???).
9349 (output_skeleton): Don't output the guards.
9350 * src/files.c, src/files.c (attrsfile): Remove.
9351 * src/reader.c (symbol_list): Remove the guard and guard_line
9352 members.
9353 Adjust dependencies.
9354 (parse_guard): Remove.
9355 * data/bison.hairy: Remove.
9356 * doc/bison.texinfo (Environment Variables): Remove occurrences of
9357 BISON_HAIRY.
9358
82b6cb3f
AD
93592002-05-02 Akim Demaille <akim@epita.fr>
9360
9361 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
9362 (parse_guard): Rename the formal argument `stack_offset' as
9363 `rule_length', which is more readable.
9364 Adjust callers.
9365 (copy_at, copy_dollar): Instead of outputting the hard coded
9366 values of $$, $n and so forth, output invocation to b4_lhs_value,
9367 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
9368 Note: this patch partially drops `semantic-parser' support: it
9369 always does `rule_length - n', where semantic parsers ought to
9370 always use `-n'.
82b6cb3f
AD
9371 * data/bison.simple, data/bison.c++ (b4_lhs_value)
9372 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
9373
6cbfbcc5
AD
93742002-05-02 Akim Demaille <akim@epita.fr>
9375
9376 * configure.in (AC_INIT): Bump to 1.49b.
9377 (AM_INIT_AUTOMAKE): Short invocation.
9378
b8548114
AD
93792002-05-02 Akim Demaille <akim@epita.fr>
9380
9381 Version 1.49a.
9382
c20cd1fa
AD
93832002-05-01 Akim Demaille <akim@epita.fr>
9384
9385 * src/skeleton.h: Remove.
9386
8a9566d4
AD
93872002-05-01 Akim Demaille <akim@epita.fr>
9388
9389 * src/skeleton.h: Fix the #endif.
9390 Reported by Magnus Fromreide.
9391
8c6d399a
PE
93922002-04-26 Paul Eggert <eggert@twinsun.com>
9393
9394 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
9395 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 9396 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 9397
2b7ed18a
RA
93982002-04-25 Robert Anisko <robert@lrde.epita.fr>
9399
9400 * src/scan-skel.l: Postprocess quadrigraphs.
9401
9402 * src/reader.c (copy_character): New function, used to output
9403 single characters while replacing `[' and `]' with quadrigraphs, to
9404 avoid troubles with M4 quotes.
9405 (copy_comment): Output characters with copy_character.
9406 (read_additionnal_code): Likewise.
9407 (copy_string2): Likewise.
9408 (copy_definition): Likewise.
9409
9410 * tests/calc.at: Exercise M4 quoting.
9411
34a89c50
AD
94122002-04-25 Akim Demaille <akim@epita.fr>
9413
9414 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
9415 between `!' and the command.
9416 Reported by Paul Eggert.
9417
0dd1580a
RA
94182002-04-24 Robert Anisko <robert@lrde.epita.fr>
9419
9420 * tests/calc.at: Exercise prologue splitting.
9421
9422 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
9423 `b4_post_prologue' instead of `b4_prologue'.
9424
9425 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
9426 muscles.
9427 (output): Free pre_prologue_obstack and post_prologue_obstack.
9428 * src/files.h, src/files.c (attrs_obstack): Remove.
9429 (pre_prologue_obstack, post_prologue_obstack): New.
9430 * src/reader.c (copy_definition): Add a parameter to specify the
9431 obstack to fill, instead of using attrs_obstack unconditionally.
9432 (read_declarations): Pass pre_prologue_obstack to copy_definition if
9433 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
9434
83c1796f
PE
94352002-04-23 Paul Eggert <eggert@twinsun.com>
9436
9437 * data/bison.simple: Remove unnecessary commentary and white
9438 space differences from 1_29-branch.
9439 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
9440
9441 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
9442 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
9443 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
9444 constructors or destructors.
9445
9446 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
9447
1207eeac
AD
94482002-04-23 Akim Demaille <akim@epita.fr>
9449
9450 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
9451 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
9452 location with columns.
9453 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
9454 All reported by Paul Eggert.
9455
78ab8f67
AD
94562002-04-22 Akim Demaille <akim@epita.fr>
9457
9458 * src/reduce.c (dump_grammar): Move to...
9459 * src/gram.h, src/gram.c (grammar_dump): here.
9460 Be sure to separate long item numbers.
9461 Don't read the members of a rule's prec if its nil.
9462
133c20e2
AD
94632002-04-22 Akim Demaille <akim@epita.fr>
9464
9465 * src/output.c (table_size, table_grow): New.
9466 (MAXTABLE): Remove, replace uses with table_size.
9467 (pack_vector): Instead of dying when the table is too big, grow it.
9468
9515e8a7
AD
94692002-04-22 Akim Demaille <akim@epita.fr>
9470
9471 * data/bison.simple (yyr1): Its type is that of a token number.
9472 * data/bison.c++ (r1_): Likewise.
9473 * tests/regression.at (Web2c Actions): Adjust.
9474
23c5a174
AD
94752002-04-22 Akim Demaille <akim@epita.fr>
9476
9477 * src/reader.c (token_translations_init): 256 is now the default
9478 value for the error token, i.e., it will be assigned another
9479 number if the user assigned 256 to one of her tokens.
9480 (reader): Don't force 256 to error.
9481 * doc/bison.texinfo (Symbols): Adjust.
9482 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
9483 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
9484 etc. instead of 10, 20, 30 (which was used to `jump' over error
9485 (256) and undefined (2)).
9486
5fbb0954
AD
94872002-04-22 Akim Demaille <akim@epita.fr>
9488
9489 Propagate more token_number_t.
9490
9491 * src/gram.h (token_number_as_item_number)
9492 (item_number_as_token_number): New.
9493 * src/output.c (GENERATE_OUTPUT_TABLE): New.
9494 Use it to create output_item_number_table and
9495 output_token_number_table.
9496 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
9497 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
9498 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
9499 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
9500
4f940944
AD
95012002-04-22 Akim Demaille <akim@epita.fr>
9502
9503 * src/output.h, src/output.c (get_lines_number): Remove.
9504
3ded9a63
AD
95052002-04-19 Akim Demaille <akim@epita.fr>
9506
9507 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
9508 as Lex/Flex'.
9509 (Debugging): More details about enabling the debugging features.
9510 (Table of Symbols): Describe $$, $n, @$, and @n.
9511 Suggested by Tim Josling.
9512
e0c471a9
AD
95132002-04-19 Akim Demaille <akim@epita.fr>
9514
9515 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
9516
fecc10cd
AD
95172002-04-10 Akim Demaille <akim@epita.fr>
9518
9519 * src/system.h: Rely on HAVE_LIMITS_H.
9520 Suggested by Paul Eggert.
9521
51dec47b
AD
95222002-04-09 Akim Demaille <akim@epita.fr>
9523
9524 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
9525 full stderr, and strip it according to the bison options, instead
9526 of composing the error message from different bits.
9527 This makes it easier to check for several error messages.
9528 Adjust all the invocations.
9529 Add an invocation exercising the error token.
9530 Add an invocation demonstrating a stupid error message.
9531 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
9532 Adjust the tests.
9533 Error message are for stderr, not stdout.
9534
007a50a4
AD
95352002-04-09 Akim Demaille <akim@epita.fr>
9536
9537 * src/gram.h, src/gram.c (error_token_number): Remove, use
9538 errtoken->number.
9539 * src/reader.c (reader): Don't specify the user token number (2)
9540 for $undefined, as it uselessly prevents using it.
9541 * src/gram.h (token_number_t): Move to...
9542 * src/symtab.h: here.
9543 (state_t.number): Is a token_number_t.
9544 * src/print.c, src/reader.c: Use undeftoken->number instead of
9545 hard coded 2.
9546 (Even though this 2 is not the same as above: the number of the
9547 undeftoken remains being 2, it is its user token number which
9548 might not be 2).
9549 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
9550 `user_token_number_max'.
9551 Output `undef_token_number'.
9552 * data/bison.simple, data/bison.c++: Use them.
9553 Be sure to map invalid yylex return values to
9554 `undef_token_number'. This saves us from gratuitous SEGV.
9555
9556 * tests/conflicts.at (Solved SR Conflicts)
9557 (Unresolved SR Conflicts): Adjust.
9558 * tests/regression.at (Web2c Actions): Adjust.
9559
06446ccf
AD
95602002-04-08 Akim Demaille <akim@epita.fr>
9561
9562 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
9563 Adding #line.
9564 Remove the duplicate `typedefs'.
9565 (RhsNumberType): Fix the declaration and various other typos.
9566 Use __ofile__.
9567 * data/bison.simple: Use __ofile__.
9568 * src/scan-skel.l: Handle __ofile__.
9569
62a3e4f0
AD
95702002-04-08 Akim Demaille <akim@epita.fr>
9571
9572 * src/gram.h (item_number_t): New, the type of item numbers in
9573 RITEM. Note that it must be able to code symbol numbers as
9574 positive number, and the negation of rule numbers as negative
9575 numbers.
9576 Adjust all dependencies (pretty many).
9577 * src/reduce.c (rule): Remove this `short *' pointer: use
9578 item_number_t.
9579 * src/system.h (MINSHORT, MAXSHORT): Remove.
9580 Include `limits.h'.
9581 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
9582 (shortcpy): Remove.
9583 (MAXTABLE): Move to...
9584 * src/output.c (MAXTABLE): here.
9585 (prepare_rules): Use output_int_table to output rhs.
9586 * data/bison.simple, data/bison.c++: Adjust.
9587 * tests/torture.at (Big triangle): Move the limit from 254 to
9588 500.
9589 * tests/regression.at (Web2c Actions): Ajust.
9590
9591 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
9592 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
9593 passes, but produces negative #line number, once fixed, GCC is
9594 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
9595 C), it passes.
9596 * src/state.h (state_h): Code input lines on ints, not shorts.
9597
bb88b0fc
AD
95982002-04-08 Akim Demaille <akim@epita.fr>
9599
9600 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
9601 and then the grammar.
9602
9a636f47
AD
96032002-04-08 Akim Demaille <akim@epita.fr>
9604
9605 * src/system.h: No longer using strndup.
9606
680e8701
AD
96072002-04-07 Akim Demaille <akim@epita.fr>
9608
9609 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
9610 * src/output.c (output_table_data): Return the longest number.
9611 (prepare_tokens): Output `token_number_max').
9612 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
9613 New.
9614 Use them to define yy_token_number_type/TokenNumberType.
9615 Use this type for yytranslate.
9616 * tests/torture.at (Big triangle): Push the limit from 124 to
9617 253.
9618 * tests/regression.at (Web2c Actions): Adjust.
9619
817e9f41
AD
96202002-04-07 Akim Demaille <akim@epita.fr>
9621
9622 * tests/torture.at (Big triangle): New.
9623 (GNU AWK Grammar, GNU Cim Grammar): Move to...
9624 * tests/existing.at: here.
9625
5123689b
AD
96262002-04-07 Akim Demaille <akim@epita.fr>
9627
9628 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
9629 nritems.
9630 Adjust dependencies.
9631
f3849179
AD
96322002-04-07 Akim Demaille <akim@epita.fr>
9633
9634 * src/reader.c: Normalize increments to prefix form.
9635
bd02036a
AD
96362002-04-07 Akim Demaille <akim@epita.fr>
9637
9638 * src/reader.c, symtab.c: Remove debugging code.
9639
db8837cb
AD
96402002-04-07 Akim Demaille <akim@epita.fr>
9641
9642 Rename all the `bucket's as `symbol_t'.
9643
9644 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
9645 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
9646 * src/symtab.c, src/symtab.h (bucket): Rename as...
9647 (symbol_t): this.
9648 (symbol_list_new, bucket_check_defined, bucket_make_alias)
9649 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
9650 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
9651 (buckets_new, buckets_free, buckets_do): Rename as...
9652 (symbol_list_new, symbol_check_defined, symbol_make_alias)
9653 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
9654 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
9655 (symbols_new, symbols_free, symbols_do): these.
9656
72a23c97
AD
96572002-04-07 Akim Demaille <akim@epita.fr>
9658
9659 Use lib/hash for the symbol table.
9660
9661 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
9662 EOF.
9663 * src/lex.c (lex): Set the `number' member of new terminals.
9664 * src/reader.c (bucket_check_defined, bucket_make_alias)
9665 (bucket_check_alias_consistence, bucket_translation): New.
9666 (reader, grammar_free, readgram, token_translations_init)
9667 (packsymbols): Adjust.
9668 (reader): Number the predefined tokens.
9669 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
9670 for predefined tokens.
9671 * src/symtab.h (bucket): Remove all the hash table related
9672 members.
9673 * src/symtab.c (symtab): Replace by...
9674 (bucket_table): this.
9675 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
9676 (buckets_new, buckets_do): New.
9677
280a38c3
AD
96782002-04-07 Akim Demaille <akim@epita.fr>
9679
9680 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
9681 (start_symbol, max_user_token_number, semantic_parser)
9682 (error_token_number): Initialize.
9683 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
9684 Initialize.
9685 (reader): Don't.
9686 (errtoken, eoftoken, undeftoken, axiom): Extern.
9687
03b31c0c
AD
96882002-04-07 Akim Demaille <akim@epita.fr>
9689
9690 * src/gram.h (rule_s): prec and precsym are now pointers
9691 to the bucket giving the priority/associativity.
9692 Member `associativity' removed: useless.
9693 * src/reduce.c, src/conflicts.c: Adjust.
9694
8b3df748
AD
96952002-04-07 Akim Demaille <akim@epita.fr>
9696
9697 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
9698 Properly escape the symbols' TAG when outputting them.
9699
e601aa1d
AD
97002002-04-07 Akim Demaille <akim@epita.fr>
9701
9702 * src/lalr.h (LA): Is a bitsetv, not bitset*.
9703
b0299a2e
AD
97042002-04-07 Akim Demaille <akim@epita.fr>
9705
9706 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
9707 (LArule): this, which is an array to rule_t*.
9708 * src/print.c, src/conflicts.c: Adjust.
9709
d7e1f00c
AD
97102002-04-07 Akim Demaille <akim@epita.fr>
9711
9712 * src/gram.h (rule_t): Rename `number' as `user_number'.
9713 `number' is a new member.
9714 Adjust dependencies.
9715 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
9716
cc9305dd
AD
97172002-04-07 Akim Demaille <akim@epita.fr>
9718
9719 As a result of the previous patch, it is no longer needed
9720 to reorder ritem itself.
9721
9722 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
9723
b0940840
AD
97242002-04-07 Akim Demaille <akim@epita.fr>
9725
9726 Be sure never to walk through RITEMS, but use only data related to
9727 the rules themselves. RITEMS should be banished.
9728
9729 * src/output.c (output_token_translations): Rename as...
9730 (prepare_tokens): this.
9731 In addition to `translate', prepare the muscles `tname' and
9732 `toknum', which were handled by...
9733 (output_rule_data): this.
9734 Remove, and move the remainder of its outputs into...
9735 (prepare_rules): this new routines, which also merges content from
9736 (output_gram): this.
9737 (prepare_rules): Be sure never to walk through RITEMS.
9738 (output_stos): Rename as...
9739 (prepare_stos): this.
9740 (output): Always invoke prepare_states, after all, just don't use it
9741 in the output if you don't need it.
9742
643a5994
AD
97432002-04-07 Akim Demaille <akim@epita.fr>
9744
9745 * src/LR0.c (new_state): Display `nstates' as the name of the
9746 newly created state.
9747 Adjust to initialize first_state and last_state if needed.
9748 Be sure to distinguish the initial from the final state.
9749 (new_states): Create the itemset of the initial state, and use
9750 new_state.
9751 * src/closure.c (closure): Now that the initial state has its
9752 items properly set, there is no need for a special case when
9753 creating `ruleset'.
9754
9755 As a result, now the rule 0, reducing to $axiom, is visible in the
9756 outputs. Adjust the test suite.
9757
9758 * tests/conflicts.at (Solved SR Conflicts)
9759 (Unresolved SR Conflicts): Adjust.
9760 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
9761 * tests/conflicts.at (S/R in initial): New.
9762
b4c4ccc2
AD
97632002-04-07 Akim Demaille <akim@epita.fr>
9764
9765 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
9766 the RHS of the rules.
9767 * src/output.c (output_gram): Likewise.
9768
bba97eb2
AD
97692002-04-07 Akim Demaille <akim@epita.fr>
9770
9771 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
9772 bucket.
9773 Adjust all dependencies.
9774 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
9775 `number' of the buckets too.
9776 * src/gram.h: Include `symtab.h'.
9777 (associativity): Move to...
9778 * src/symtab.h: here.
9779 No longer include `gram.h'.
9780
c3b407f4
AD
97812002-04-07 Akim Demaille <akim@epita.fr>
9782
9783 * src/gram.h, src/gram.c (rules_rhs_length): New.
9784 (ritem_longest_rhs): Use it.
9785 * src/gram.h (rule_t): `number' is a new member.
9786 * src/reader.c (packgram): Set it.
9787 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
9788 the end of `rules', and count them out of `nrules'.
9789 (reduce_output, dump_grammar): Adjust.
9790 * src/print.c (print_grammar): It is no longer needed to check for
9791 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
9792 * tests/reduce.at (Reduced Automaton): New test.
9793
11652ab3
AD
97942002-04-07 Akim Demaille <akim@epita.fr>
9795
9796 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
9797 lacking `+ 1' to nrules, Bison reported as useless a token if it
9798 was used solely to set the precedence of the last rule...
9799
26b23c1a
AD
98002002-04-07 Akim Demaille <akim@epita.fr>
9801
9802 * data/bison.c++, data/bison.simple: Don't output the current file
9803 name in #line, to avoid useless diffs between two identical
9804 outputs under different names.
9805
18bcecb0
AD
98062002-04-07 Akim Demaille <akim@epita.fr>
9807
9808 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
9809 Normalize loops to using `< nrules + 1', not `<= nrules'.
9810
fa770c86
AD
98112002-04-07 Akim Demaille <akim@epita.fr>
9812
9813 * TODO: Update.
9814
d9b739c3
AD
98152002-04-07 Akim Demaille <akim@epita.fr>
9816
9817 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
9818 bucket.value as bucket.number.
9819
99013900
AD
98202002-04-07 Akim Demaille <akim@epita.fr>
9821
9822 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
9823 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
9824 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
9825 RHS, instead of being an index in RITEMS.
9826
e966383b
PE
98272002-04-04 Paul Eggert <eggert@twinsun.com>
9828
9829 * doc/bison.texinfo: Update copyright date.
9830 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
9831 (Symbols): Warn about running Bison in one character set,
9832 but compiling and/or running in an incompatible one.
9833 Warn about character code 256, too.
9834
98352002-04-03 Paul Eggert <eggert@twinsun.com>
9836
9837 * src/bison.data (YYSTACK_ALLOC): Depend on whether
9838 YYERROR_VERBOSE is nonzero, not whether it is defined.
9839
9840 Merge changes from bison-1_29-branch.
c307773e 9841
8d6c48b9
PE
98422002-03-20 Paul Eggert <eggert@twinsun.com>
9843
9844 Merge fixes from Debian bison_1.34-1.diff.
9845
9846 * configure.in (AC_PREREQ): 2.53.
9847
e53c6322
AD
98482002-03-20 Akim Demaille <akim@epita.fr>
9849
9850 * src/conflicts.c (log_resolution): Argument `resolution' is const.
9851
9ffbeca7
PE
98522002-03-19 Paul Eggert <eggert@twinsun.com>
9853
21db0b2a
PE
9854 * src/bison.simple (YYCOPY): New macro.
9855 (YYSTACK_RELOCATE): Use it.
9856 Remove Type arg; no longer needed. All callers changed.
9857 (yymemcpy): Remove; no longer needed.
9858
9ffbeca7
PE
9859 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
9860 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
9861
642cb8f8
AD
98622002-03-19 Akim Demaille <akim@epita.fr>
9863
9864 Test and fix the #line outputs.
9865
9866 * tests/atlocal.at (GCC): New.
9867 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 9868 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
9869 (Action synch line, Epilogue synch line): New tests.
9870 * src/reader.c (parse_union_decl): Define the muscle stype_line.
9871 * data/bison.simple, data/bison.c++: Use it.
9872
3c31a486
AD
98732002-03-19 Akim Demaille <akim@epita.fr>
9874
9875 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
9876 (Solved SR Conflicts, %expect not enough, %expect right)
9877 (%expect too much): Move to...
9878 * tests/conflicts.at: this new file.
9879
0d8bed56
AD
98802002-03-19 Akim Demaille <akim@epita.fr>
9881
9882 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
9883 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
9884 that we can move to enums for instance.
9885 * src/output.c (token_definitions_output): Output a list of
9886 `token-name, token-number' instead of the #define.
9887 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
9888
9208d17f
AD
98892002-03-14 Akim Demaille <akim@epita.fr>
9890
9891 Use Gettext 0.11.1.
9892
af27eacb
RA
98932002-03-09 Robert Anisko <robert@lrde.epita.fr>
9894
9895 * data/bison.c++: Make the user able to add members to the generated
9896 parser by subclassing.
9897
9101a310
RA
98982002-03-05 Robert Anisko <robert@lrde.epita.fr>
9899
9900 * src/reader.c (read_additionnal_code): `c' should be an integer, not
9901 a character.
9902 Reported by Nicolas Tisserand and Nicolas Burrus.
9903
fff9bf0b
RA
99042002-03-04 Robert Anisko <robert@lrde.epita.fr>
9905
9906 * src/reader.c: Warn about lacking semi-colons, do not complain.
9907
64dba31e
RA
99082002-03-04 Robert Anisko <robert@lrde.epita.fr>
9909
9910 * data/bison.c++: Remove a debug line.
9911
374f5a14
RA
99122002-03-04 Robert Anisko <robert@lrde.epita.fr>
9913
9914 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
9915 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
9916 provide a default implementation.
9917
bfcf1f3a
AD
99182002-03-04 Akim Demaille <akim@epita.fr>
9919
9920 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
9921 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
9922 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
9923 * tests/semantic.at (Parsing Guards): Similarly.
9924 * src/reader.at (readgram): Complain if the last rule is not ended
9925 with a semi-colon.
9926
65ccf9fc
AD
99272002-03-04 Akim Demaille <akim@epita.fr>
9928
9929 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
9930 * src/closure.c: here.
9931 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
9932 RTC.
9933 * src/warshall.h, src/warshall.c: Remove.
9934 * tests/sets.at (Broken Closure): Adjust.
9935
d0039cbc
AD
99362002-03-04 Akim Demaille <akim@epita.fr>
9937
9938 * src/output.c (output_skeleton): tempdir is const.
9939 bytes_read is unused.
9940
345cea78
AD
99412002-03-04 Akim Demaille <akim@epita.fr>
9942
9943 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
9944 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
9945 Update.
9946 From Michael Hayes.
9947
564801f7
AD
99482002-03-04 Akim Demaille <akim@epita.fr>
9949
9950 * src/closure.c (closure): `r' is unused.
9951
e5352bc7
AD
99522002-03-04 Akim Demaille <akim@epita.fr>
9953
9954 * tests/sets.at (Broken Closure): Add the ending `;'.
9955 * src/reader.at (readgram): Complain if a rule is not ended with a
9956 semi-colon.
9957
914feea9
AD
99582002-03-04 Akim Demaille <akim@epita.fr>
9959
9960 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
9961 (count_sr_conflicts): Use bitset_count.
9962 * src/reduce.c (inaccessable_symbols): Ditto.
9963 (bits_size): Remove.
9964 * src/warshall.h, src/warshall.c: Convert to bitsetv.
9965
f0250de6
AD
99662002-03-04 Akim Demaille <akim@epita.fr>
9967
9968 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
9969 * src/reduce.c: Remove the `bitset_zero's following the
9970 `bitset_create's, as now it is performed by the latter.
9971
ef017502
AD
99722002-03-04 Akim Demaille <akim@epita.fr>
9973
9974 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
9975 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
9976 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
9977 latest sources from Michael.
9978
76514394
AD
99792002-03-04 Akim Demaille <akim@epita.fr>
9980
9981 * src/output.c (output): Don't free the grammar.
9982 * src/reader.c (grammar_free): New.
9983 * src/main.c (main): Call it and don't free symtab here.
9984
55024580
AD
99852002-03-04 Akim Demaille <akim@epita.fr>
9986
9987 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
9988 before returning.
9989 Reported by Benoit Perrot.
9990
f9abaa2c
AD
99912002-03-04 Akim Demaille <akim@epita.fr>
9992
9993 Use bitset operations when possible, not loops over bits.
9994
9995 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
9996 bitset_or.
9997 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
9998 * src/reduce.c (useless_nonterminals): Formatting changes.
9999 * src/warshall.c (TC): Use bitset_or.
10000
0e721e75
AD
100012002-03-04 Akim Demaille <akim@epita.fr>
10002
10003 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
10004 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
10005 Ditto.
10006
0fb1ffb1
AD
100072002-03-04 Akim Demaille <akim@epita.fr>
10008
10009 * src/lalr.c (F): Now a bitset*.
10010 Adjust all dependencies.
10011
b86796bf
AD
100122002-03-04 Akim Demaille <akim@epita.fr>
10013
10014 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
10015 Adjust all dependencies.
10016
602bbf31
AD
100172002-03-04 Akim Demaille <akim@epita.fr>
10018
10019 * src/L0.c, src/LR0.h (nstates): Be size_t.
10020 Adjust comparisons (signed vs unsigned).
10021 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
10022 bitset*.
10023 Adjust all dependencies.
10024
d8a0245c
AD
100252002-03-04 Akim Demaille <akim@epita.fr>
10026
10027 * src/closure.c (firsts): Now, also a bitset.
10028 Adjust all dependencies.
10029 (varsetsize): Remove, now unused.
10030 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
10031
34ba9743
AD
100322002-03-04 Akim Demaille <akim@epita.fr>
10033
10034 * src/print.c: Convert to use bitset.h, not hand coded iterations
10035 over ints.
10036
ed86e78c
AD
100372002-03-04 Akim Demaille <akim@epita.fr>
10038
10039 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
10040
dfdb1797
AD
100412002-03-04 Akim Demaille <akim@epita.fr>
10042
10043 * src/closure.c (ruleset): Be a bitset.
10044 (rulesetsize): Remove.
10045
7086e707
AD
100462002-03-04 Akim Demaille <akim@epita.fr>
10047
10048 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
10049 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
10050 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
10051 * src/closure.c (fderives): Be an array of bitsets.
10052
98254360
RA
100532002-02-28 Robert Anisko <robert@lrde.epita.fr>
10054
10055 * data/bison.c++: Merge the two generated headers. Insert a copyright
10056 notice in each output file.
10057
a75c057f
AD
100582002-02-28 Akim Demaille <akim@epita.fr>
10059
10060 * data/bison.c++: Copy the prologue of bison.simple to fetch
10061 useful M4 definitions, such as b4_header_guard.
10062
06b00abc
AD
100632002-02-25 Akim Demaille <akim@epita.fr>
10064
10065 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
10066 translator friendly scheme for the bgr
10067 copyright notice.
06b00abc 10068
70e7d534
AD
100692002-02-25 Akim Demaille <akim@epita.fr>
10070
10071 * src/output.c (header_output): Remove, now handled completely via
10072 M4.
10073
abe017f6
AD
100742002-02-25 Akim Demaille <akim@epita.fr>
10075
10076 * m4/m4.m4: New, from CVS Autoconf.
10077 * configure.in: Invoke it.
10078 * src/output.c (output_skeleton): Use its result instead of the
10079 hard coded name.
10080
381fb12e
AD
100812002-02-25 Akim Demaille <akim@epita.fr>
10082
10083 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
10084 Fileutils 4.1.5.
10085 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
10086 * src/output.c (output_skeleton): Use mkstemp to create a real
10087 temporary file.
10088 Move the filling of `skeleton' and its muscle to...
10089 (prepare): here.
10090 (output): Move the definition of the prologue muscle to...
10091 (prepare): here.
10092 * src/system.h (DEFAULT_TMPDIR): New.
10093
6f38107f
PE
100942002-02-14 Paul Eggert <eggert@twinsun.com>
10095
10096 Remove the support for C++ namespace cleanliness; it was
10097 causing more problems than it was curing, since it didn't work
10098 properly on some nonstandard C++ compilers. This can wait
10099 for a proper C++ parser.
10100
10101 * NEWS: Document this.
10102 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
10103 of C++, as it's treated like C now.
10104 * src/bison.simple (YYSTD): Remove.
10105 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
10106 Treat C++ just like Standard C instead of trying to support
10107 namespace cleanliness.
10108
80cce3da
AD
101092002-02-14 Akim Demaille <akim@epita.fr>
10110
10111 * tests/regression.at (else): Adjust to Andreas' change.
10112
842e8679
AD
101132002-02-14 Akim Demaille <akim@epita.fr>
10114
10115 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
10116
4bda3f10
AD
101172002-02-13 Andreas Schwab <schwab@suse.de>
10118
10119 * src/output.c (output_rule_data): Don't output NULL, it might
10120 not be defined yet.
10121
4162fa07 101222002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 10123
4162fa07
RA
10124 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
10125 (Copyright notice): Update.
b418ecd8 10126
bd16a5dc
AD
101272002-02-11 Akim Demaille <akim@epita.fr>
10128
10129 * tests/regression.at (%nonassoc and eof): Don't include
10130 nonportable headers.
10131
8d69a1a3
RA
101322002-02-08 Robert Anisko <robert@lrde.epita.fr>
10133
10134 * data/bison.c++: Correct error recovery. Make the user able to
10135 initialize the starting location.
10136
9b2d0677
AD
101372002-02-07 Akim Demaille <akim@epita.fr>
10138
10139 * tests/input.at: New.
10140
69e2658b
RA
101412002-02-07 Robert Anisko <robert@lrde.epita.fr>
10142
10143 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 10144 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
10145 directives around tables only needed for debugging.
10146
4aacc3a7
RA
101472002-02-07 Robert Anisko <robert@lrde.epita.fr>
10148
10149 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
10150 C++ parsers.
10151 (yy::b4_name::parse): Use print_.
10152
762a801e
RA
101532002-02-07 Robert Anisko <robert@lrde.epita.fr>
10154
10155 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
10156
4bb2bc3f
RA
101572002-02-07 Robert Anisko <robert@lrde.epita.fr>
10158
10159 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
10160 C++ parsers.
10161 (yy::b4_name::parse): Build verbose error messages, and use error_.
10162
6b45a3ca
RA
101632002-02-06 Robert Anisko <robert@lrde.epita.fr>
10164
10165 * data/bison.c++: Fix m4 quoting in comments.
10166
50997c6e
RA
101672002-02-06 Robert Anisko <robert@lrde.epita.fr>
10168
10169 * data/bison.c++: Adjust the parser code. Fix some muscles that were
10170 not expanded by m4.
10171
3f3eed27
AD
101722002-02-05 Akim Demaille <akim@epita.fr>
10173
10174 * data/bison.c++: Adjust to the M4 back end.
10175 More is certainly needed.
10176
be2a1a68
AD
101772002-02-05 Akim Demaille <akim@epita.fr>
10178
10179 Give a try to M4 as a back end.
10180
10181 * lib/readpipe.c: New, from wdiff.
10182 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
10183 BISON_HAIRY.
10184 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
10185 specific values. Now it is m4 that performs the lookup.
10186 * src/parse-skel.y: Remove.
10187 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
10188 * src/output.c (actions_output, guards_output)
10189 (token_definitions_output): No longer keeps track of the output
10190 line number, hence remove the second argument.
10191 (guards_output): Check against the guard member of a rule, not the
10192 action member.
10193 Adjust callers.
10194 (output_skeleton): Don't look for the skeleton location, let m4 do
10195 that.
10196 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
10197 file will be used.
10198 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
10199 (prepare): Given that for the time being changesyntax is not
10200 usable in M4, rename the muscles using `-' to `_'.
10201 Define `defines_flag', `output_parser_name' and `output_header_name'.
10202 * src/output.h (actions_output, guards_output)
10203 (token_definitions_output): Adjust prototypes.
10204 * src/scan-skel.l: Instead of scanning the skeletons, it now
10205 processes the output of m4: `__oline__' and `#output'.
10206 * data/bison.simple: Adjust to be used by M4(sugar).
10207 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
10208 to date.
10209 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
10210 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
10211 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
10212 shamelessly stolen from CVS Autoconf.
10213
beda758b
AD
102142002-02-05 Akim Demaille <akim@epita.fr>
10215
10216 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
10217 * configure.in: Check for the declarations of free and malloc.
10218 * src/muscle_tab.c: Adjust.
10219
5ece6d43
AD
102202002-02-05 Akim Demaille <akim@epita.fr>
10221
10222 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
10223 which have no values.
10224
5bb18f9a
AD
102252002-02-05 Akim Demaille <akim@epita.fr>
10226
10227 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
10228 * data/: here.
10229
894dd62e
PE
102302002-01-29 Paul Eggert <eggert@twinsun.com>
10231
10232 * src/bison.simple (YYSIZE_T): Do not define merely because
10233 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
10234 On some platforms, <alloca.h> does not declare YYSTD (size_t).
10235
82841af7
AD
102362002-01-27 Akim Demaille <akim@epita.fr>
10237
10238 Fix `%nonassoc and eof'.
10239
10240 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
10241 which were not properly copied! Replace
10242 memcpy (res->errs, src->errs, src->nerrs);
10243 with
10244 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
10245 !!!
10246 * tests/regression.at (%nonassoc and eof): Adjust to newest
10247 Autotest: `.' is not in the PATH.
10248
318b76e9
AD
102492002-01-27 Akim Demaille <akim@epita.fr>
10250
10251 * tests/sets.at (AT_EXTRACT_SETS): New.
10252 (Nullable): Use it.
10253 (Firsts): New.
10254
30d2f3d5
AD
102552002-01-26 Akim Demaille <akim@epita.fr>
10256
10257 * tests/actions.at, tests/calc.at, tests/headers.at,
10258 * tests/torture.at: Adjust to the newest Autotest which no longer
10259 forces `.' in the PATH.
10260
30f8c395
AD
102612002-01-25 Akim Demaille <akim@epita.fr>
10262
10263 * tests/regression.at (%nonassoc and eof): New.
10264 Suggested by Robert Anisko.
10265
29ae55f1
AD
102662002-01-24 Akim Demaille <akim@epita.fr>
10267
10268 Bison dumps core when trying to complain about broken input files.
10269 Reported by Cris van Pelt.
10270
10271 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
10272 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
10273 into...
10274 (Invalid inputs): Strengthen: exercise parse_percent_token.
10275
2b548aa6
RA
102762002-01-24 Robert Anisko <robert.anisko@epita.fr>
10277
10278 * src/Makefile.am: Add bison.c++.
10279 * src/bison.c++: New skeleton.
10280
bb0146c2
AD
102812002-01-21 Paolo Bonzini <bonzini@gnu.org>
10282
10283 * po/it.po: New.
10284
bec30531
AD
102852002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
10286
10287 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
10288
fc6edc45
MA
102892002-01-20 Marc Autret <marc@gnu.org>
10290
10291 * src/files.c (compute_output_file_names): Fix
10292
5e5d5415
MA
102932002-01-20 Marc Autret <marc@gnu.org>
10294
10295 * tests/output.at: New test.
10296 * src/files.c (compute_base_names): Don't map extensions when
10297 the YACC flag is set, use defaults.
10298 Reported by Evgeny Stambulchik.
10299
44ea3fbd
MA
103002002-01-20 Marc Autret <marc@gnu.org>
10301
ba0fe3c7
PE
10302 * src/system.h: Need to define __attribute__ away for non-GCC
10303 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
10304 Suggested by Albert Chin-A-Young.
10305
338963d1
TVH
103062002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
10307
10308 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
10309 canonical definition.
10310 * src/system.h: Use the canonical definition for PARAMS (avoids
10311 a conflict with the macro from lib/hash.h).
10312
c57b2479
AD
103132002-01-11 Akim Demaille <akim@epita.fr>
10314
10315 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 10316 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 10317
b85810ae
AD
103182002-01-09 Akim Demaille <akim@epita.fr>
10319
10320 * src/files.c, src/files.h (output_infix): New.
10321 (tab_extension): Remove.
10322 (compute_base_names): Compute the former, drop the latter.
10323 * src/output.c (prepare): Insert the muscles `output-infix', and
10324 `output-suffix'.
10325 * src/parse-skel.y (string, string.1): New.
10326 (section.header): Use it.
10327 (section.yacc): Remove.
10328 (prefix): Remove too.
10329 * src/scan-skel.l: Adjust.
10330 * src/bison.simple, src/bison.hairy: Adjust.
10331
cae60122
AD
103322002-01-09 Akim Demaille <akim@epita.fr>
10333
10334 * configure.in (WERROR_CFLAGS): Compute it.
10335 * src/Makefile.am (CFLAGS): Pass it.
10336 * tests/atlocal.in (CFLAGS): Idem.
10337 * src/files.c: Fix a few warnings.
10338 (get_extension_index): Remove, unused.
10339
ae404801
AD
103402002-01-08 Akim Demaille <akim@epita.fr>
10341
10342 * src/getargs.c (AS_FILE_NAME): New.
10343 (getargs): Use it to convert DOSish file names.
10344 * src/files.c (base_name): Rename as full_base_name to avoid
10345 clashes with `base_name ()'.
10346 (filename_split): New.
10347 (compute_base_names): N-th rewrite, using filename_split.
10348
22312b71
AD
103492002-01-08 Akim Demaille <akim@epita.fr>
10350
10351 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
10352 New, stolen from the Fileutils 4.1.
10353 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
10354 * configure.in: Check for the presence of memrchr, and of its
10355 prototype.
10356
a67cef01
TVH
103572002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
10358
10359 * lib/hash.h (__P): Added definition for this macro.
10360 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
10361 BUILT_SOURCES, to ensure they are generated first.
10362 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
10363 %error-verbose to allow bootstrapping with bison 1.30x.
10364
2b25d624
AD
103652002-01-06 Akim Demaille <akim@epita.fr>
10366
10367 * src/reader.c (parse_braces): Don't fetch the next char, the
10368 convention is to fetch on entry.
10369 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
10370 'switch' without a following semicolon.
10371 * tests/regression.at (braces parsing): New.
10372
3460813b
AD
103732002-01-06 Akim Demaille <akim@epita.fr>
10374
10375 Bison is dead wrong in its RR conflict reports.
10376
10377 * tests/torture.at (GNU Cim Grammar): New.
10378 * src/conflicts.c (count_rr_conflicts): Fix.
10379
73784c64
AD
103802002-01-06 Akim Demaille <akim@epita.fr>
10381
10382 Creating package.m4 from configure.ac causes too many problems.
10383
10384 * tests/Makefile.am (package.m4): Create it by hand,
10385 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
10386
25d81090
AD
103872002-01-06 Akim Demaille <akim@epita.fr>
10388
10389 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
10390 skeleton.h.
10391
a9b8959e
PE
103922002-01-04 Paul Eggert <eggert@twinsun.com>
10393
10394 * doc/bison.texinfo (Debugging):
10395 Remove YYSTDERR; it's no longer defined or used.
10396 Also, s/cstdio.h/cstdio/.
10397
25d81090
AD
103982002-01-03 Akim Demaille <akim@epita.fr>
10399
10400 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
10401
1109455c
AD
104022002-01-03 Akim Demaille <akim@epita.fr>
10403
10404 * src/parse-skel.y (process_skeleton): Don't bind the parser's
10405 tracing code to --trace, wait for a better --trace option, with
10406 args.
10407
7ea5e977
AD
104082002-01-03 Akim Demaille <akim@epita.fr>
10409
10410 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
10411 The ISO C++ standard is extremely clear about it: stderr is
10412 considered a macro, not a regular symbol (see table 94 `Header
10413 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
10414 Therefore std:: does not apply to it. It still does with fprintf.
10415 Also, s/cstdio.h/cstdio/.
10416
fab5b110
AD
104172002-01-03 Akim Demaille <akim@epita.fr>
10418
10419 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
10420 for non system headers.
10421
aed7fd9b
AD
104222002-01-02 Akim Demaille <akim@epita.fr>
10423
10424 Equip the skeleton chain with location tracking, runtime trace,
10425 pure parser and scanner.
10426
10427 * src/parse-skel.y: Request a pure parser, locations, and prefix
10428 renaming.
10429 (%union): Having several members with the same type does not help
10430 type mismatches, simplify.
10431 (YYPRINT, yyprint): New.
10432 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
10433 (skel_error): this.
10434 Handle locations.
10435 * src/scan-skel.l: Adjust to these changes.
10436 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
10437 (LOCATION_PRINT, skel_control_t): New.
10438
24fad99e
AD
104392001-12-30 Akim Demaille <akim@epita.fr>
10440
10441 * src/parse-skel.y: Get rid of the shift/reduce conflict:
10442 replace `gb' with BLANKS.
10443 * src/scan-skel.l: Adjust.
10444
a4b36db4
AD
104452001-12-30 Akim Demaille <akim@epita.fr>
10446
10447 * src/system.h: We don't need nor want bcopy.
10448 Throw away MS-DOS crap: we don't need getpid.
10449 * configure.in: We don't need strndup. It was even causing
10450 problems: because Flex includes the headers *before* us,
10451 _GNU_SOURCE is not defined by config.h, and therefore strndup was
10452 not visible.
10453 * lib/xstrndup.c: New.
10454 * src/scan-skel.l: Use it.
10455 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
10456 * src/parse-skel.y: Use %directives instead of #defines.
10457
1239777d
AD
104582001-12-30 Akim Demaille <akim@epita.fr>
10459
10460 * src/skeleton.h: New.
10461 * src/output.c (output_parser, output_master_parser): Remove, dead
10462 code.
10463 * src/output.h (get_lines_number, actions_output, guards_output)
10464 (token_definitions_output): Prototype them.
10465 * src/parse-skel.y: Add the license notice.
10466 Include output.h and skeleton.h.
10467 (process_skeleton): Returns void, and takes a single parameter.
10468 * src/scan-skel.l: Add the license notice.
10469 Include skeleton.h.
10470 Don't use %option yylineno: it seems that then Flex imagines
10471 REJECT has been used, and therefore it won't reallocate its
10472 buffers (which makes no other sense to me than a bug). It results
10473 in warnings for `unused: yy_flex_realloc'.
10474
9b3add5b
RA
104752001-12-30 Robert Anisko <robert.anisko@epita.fr>
10476
10477 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
10478 (MUSCLE_INSERT_PREFIX): ...to there.
10479 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
10480 (MUSCLE_INSERT_PREFIX): Move from here...
10481
10482 * src/bison.hairy: Add a section directive. Put braces around muscle
10483 names. This parser skeleton is still broken, but Bison should not
10484 choke on a bad muscle 'syntax'.
10485 * src/bison.simple: Add a section directive. Put braces around muscle
10486 names.
10487
10488 * src/files.h (strsuffix, stringappend): Add declarations.
10489 (tab_extension): Add declaration.
10490 (short_base_name): Add declaration.
10491
10492 * src/files.c (strsuffix, stringappend): No longer static. These
10493 functions are used in the skeleton parser.
10494 (tab_extension): New.
10495 (compute_base_names): Use the computations done in this function
fab5b110 10496 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
10497 names.
10498 (short_base_name): No longer static.
10499
10500 * src/output.c (output_skeleton): New.
10501 (output): Disable call to output_master_parser, and give a try to
10502 a new skeleton handling system.
10503 (guards_output, actions_output): No longer static.
10504 (token_definitions_output, get_lines_number): No longer static.
10505
10506 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
10507
fab5b110 10508 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
10509 parse-skel.y.
10510
10511 * src/parse-skel.y: New file.
10512 * src/scan-skel.l: New file.
10513
b5b61c61
AD
105142001-12-29 Akim Demaille <akim@epita.fr>
10515
10516 %name-prefix is broken.
10517
10518 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
10519 Adjust all dependencies.
10520 * tests/headers.at (export YYLTYPE): Strengthen this test: use
10521 %name-prefix.
10522
10523 Renaming yylval but not yylloc is not consistent. Now we do.
10524
10525 * src/bison.simple: Prefix yylloc if used.
10526 * doc/bison.texinfo (Decl Summary): Document that.
10527
8c9a50be
AD
105282001-12-29 Akim Demaille <akim@epita.fr>
10529
10530 * doc/bison.texinfo: Promote `%long-directive' over
10531 `%long_directive'.
10532 Remove all references to fixed-output-files, yacc is enough.
10533
d99361e6
AD
105342001-12-29 Akim Demaille <akim@epita.fr>
10535
10536 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
10537 user prologue. These are defaults.
10538 * tests/actions.at (Mid-rule actions): Make sure the user can
10539 define YYDEBUG and YYERROR_VERBOSE.
10540
b9cecb91
AD
105412001-12-29 Akim Demaille <akim@epita.fr>
10542
10543 * src/output.c (header_output): Don't forget to export YYLTYPE and
10544 yylloc.
10545 * tests/headers.at (export YYLTYPE): New, make sure it does.
10546 * tests/regression.at (%union and --defines, Invalid CPP headers):
10547 Move to...
10548 * tests/headers.at: here.
10549
aea13e97
AD
105502001-12-29 Akim Demaille <akim@epita.fr>
10551
10552 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
10553
931394cb
AD
105542001-12-29 Akim Demaille <akim@epita.fr>
10555
10556 * tests/actions.at (Mid-rule actions): Output on a single line
10557 instead of several.
10558
704a47c4
AD
105592001-12-29 Akim Demaille <akim@epita.fr>
10560
10561 * doc/bison.texinfo: Formatting changes.
10562
091e20bb
AD
105632001-12-29 Akim Demaille <akim@epita.fr>
10564
10565 Don't store the token defs in a muscle, just be ready to output it
10566 on command. Now possible via `symbols'. Fixes a memory leak.
10567
10568 * src/output.c (token_definitions_output): New.
10569 (output_parser, header_output): Use it.
10570 * src/reader.c (symbols_save): Remove.
10571
cce71710
AD
105722001-12-29 Akim Demaille <akim@epita.fr>
10573
10574 * src/bison.simple: Do not provide a default for YYSTYPE and
10575 YYLTYPE before the user's prologue. Otherwise it's hardly... a
10576 default.
10577
82c035a8
AD
105782001-12-29 Akim Demaille <akim@epita.fr>
10579
10580 Mid-rule actions are simply... ignored!
10581
10582 * src/reader.c (readgram): Be sure to attach mid-rule actions to
10583 the empty-rule associated to the dummy symbol, not to the host
10584 rule.
10585 * tests/actions.at (Mid-rule actions): New.
10586
8419d367
AD
105872001-12-29 Akim Demaille <akim@epita.fr>
10588
10589 Memory leak.
10590
10591 * src/reader.c (reader): Free grammar.
10592
375d5806
AD
105932001-12-29 Akim Demaille <akim@epita.fr>
10594
10595 Memory leak.
10596
10597 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
10598 since it allocates it for each state, although only one is needed.
10599 (allocate_storage): Do it here.
10600
f51cb8ff
AD
106012001-12-29 Akim Demaille <akim@epita.fr>
10602
10603 * src/options.h, src/options.c (create_long_option_table): Rename
10604 as...
10605 (long_option_table_new): this, with a clearer prototype.
10606 (percent_table): Remove, unused,
10607 * src/getargs.c (getargs): Adjust.
10608
29e88316
AD
106092001-12-29 Akim Demaille <akim@epita.fr>
10610
10611 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
10612 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
10613 as states.
10614
b9f71f19
AD
106152001-12-29 Akim Demaille <akim@epita.fr>
10616
10617 * src/lalr.c (build_relations): Rename `states' as `states1'.
10618 Sorry, I don't understand exactly what it is, no better name...
10619
1a2b5d37
AD
106202001-12-29 Akim Demaille <akim@epita.fr>
10621
10622 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
10623 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
10624 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
10625 as rules.
10626
1cca533e
AD
106272001-12-29 Akim Demaille <akim@epita.fr>
10628
10629 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
10630 ago.
10631
c03ae966
AD
106322001-12-29 Akim Demaille <akim@epita.fr>
10633
10634 * src/reader.c, src/reader.h (user_toknums): Remove.
10635 Adjust all users to use symbols[i]->user_token_number.
10636
5a670b1e
AD
106372001-12-29 Akim Demaille <akim@epita.fr>
10638
10639 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
10640 Adjust all users to use symbols[i]->prec or ->assoc.
10641
ad949da9
AD
106422001-12-29 Akim Demaille <akim@epita.fr>
10643
10644 * src/reader.c, src/reader.h (tags): Remove.
10645 Adjust all users to use symbols[i]->tag.
10646
0e78e603
AD
106472001-12-29 Akim Demaille <akim@epita.fr>
10648
10649 * src/gram.h, src/gram.c (symbols): New, similar to state_table
10650 and rule_table.
10651 * src/reader.c (packsymbols): Fill this table.
10652 Drop sprec.
10653 * src/conflicts.c (resolve_sr_conflict): Adjust.
10654 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
10655 single table.
10656 Use symbols[i]->tag instead of tags[i].
10657
213e640e
AD
106582001-12-29 Akim Demaille <akim@epita.fr>
10659
10660 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
10661 In addition, put a comment in there, to replace...
10662 * tests/regression.at (%union and C comments): Remove.
10663
e7b8bef1
AD
106642001-12-29 Akim Demaille <akim@epita.fr>
10665
10666 * tests/regression.at (Web2c Actions): Blindly move the actual
10667 output as expected output. The contents *seem* right to me, but I
10668 can't pretend reading perfectly parser tables... Nonetheless, all
10669 the other tests pass correctly, the table look OK, even though the
10670 presence of `$axiom' is to be noted: AFAICS it is useless (but
10671 harmless).
10672
b68e7744
AD
106732001-12-29 Akim Demaille <akim@epita.fr>
10674
10675 * src/reader.c (readgram): Don't add the rule 0 if there were no
10676 rules read. In other words, add it _after_ having performed
10677 grammar sanity checks.
10678 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
10679
78d5bae9
AD
106802001-12-29 Akim Demaille <akim@epita.fr>
10681
10682 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
10683 visible, and some states have now a different number.
10684
ff442794
AD
106852001-12-29 Akim Demaille <akim@epita.fr>
10686
10687 * src/reader.c (readgram): Bind the initial rule's lineno to that
10688 of the first rule.
10689 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
10690 (Solved SR Conflicts): Adjust rule 0's line number.
10691
610ab194
AD
106922001-12-29 Akim Demaille <akim@epita.fr>
10693
10694 Fix the `GAWK Grammar' failure.
10695
10696 * src/LR0.c (final_state): Initialize to -1 so that we do compute
10697 the reductions of the first state which was mistakenly confused
10698 with the final state because precisely final_state was initialized
10699 to 0.
10700 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
10701 now noticed by Bison.
10702 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
10703 have a reduction on $default.
10704
29d29c8f
AD
107052001-12-29 Akim Demaille <akim@epita.fr>
10706
10707 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
10708 rule line numbers.
10709 * src/closure.c (print_closure): Likewise.
10710 * src/derives.c (print_derives): Likewise.
10711 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
10712 now.
10713
7c6b64d0
AD
107142001-12-29 Akim Demaille <akim@epita.fr>
10715
10716 * src/lalr.c (lookaheads_print): New.
10717 (lalr): Call it when --trace-flag.
10718 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
10719 are dumped.
10720
3d4daee3
AD
107212001-12-29 Akim Demaille <akim@epita.fr>
10722
10723 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
10724 when walking through ritem, even via rule->rhs.
10725 * src/reduce.c (dump_grammar, useful_production, reduce_output)
10726 (useful_production, useless_nonterminals): Likewise.
10727 (reduce_grammar_tables): Likewise, plus update nritems.
10728 * src/nullable.c (set_nullable): Likewise.
10729 * src/lalr.c (build_relations): Likewise.
10730 * tests/sets.at (Nullable): Adjust.
10731 Fortunately, now, the $axiom is no longer nullable.
10732
9e7f6bbd
AD
107332001-12-29 Akim Demaille <akim@epita.fr>
10734
10735 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
10736 the 0-sentinel.
10737 * src/gram.c (ritem_longest_rhs): Likewise.
10738 * src/reduce.c (nonterminals_reduce): Likewise.
10739 * src/print_graph.c (print_graph): Likewise.
10740 * src/output.c (output_rule_data): Likewise.
10741 * src/nullable.c (set_nullable): Likewise.
10742
255ef638
AD
107432001-12-29 Akim Demaille <akim@epita.fr>
10744
10745 * src/output.c: Comment changes.
10746
0d8a7363
AD
107472001-12-27 Paul Eggert <eggert@twinsun.com>
10748
10749 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
10750 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
10751 Sparc, as they were causing more porting problems than the
10752 (minor) performance improvement was worth.
10753
10754 Also, catch up with 1.31's YYSTD.
10755
3db472b9
AD
107562001-12-27 Akim Demaille <akim@epita.fr>
10757
10758 * src/output.c (output_gram): Rely on nritems, not the
10759 0-sentinel. See below.
10760 Use -1 as separator, not 0.
10761 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
10762 Rely on -1 as separator in yyrhs, instead of 0.
10763 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
10764 twice `Now at end of input', therefore there are two lines less to
10765 expect.
10766
b365aa05
AD
107672001-12-27 Akim Demaille <akim@epita.fr>
10768
10769 * tests/regression.at (Unresolved SR Conflicts):
10770 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
10771 below.
10772
30171f79
AD
107732001-12-27 Akim Demaille <akim@epita.fr>
10774
10775 * src/LR0.c (new_state): Recognize the final state by the fact it
10776 is reached by eoftoken.
10777 (insert_start_shifting_state, insert_eof_shifting_state)
10778 (insert_accepting_state, augment_automaton): Remove, since now
10779 these states are automatically computed from the initial state.
10780 (generate_states): Adjust.
10781 * src/print.c: When reporting a rule number to the user, substract
10782 1, so that the axiom rule is rule 0, and the first user rule is 1.
10783 * src/reduce.c: Likewise.
10784 * src/print_graph.c (print_core): For the time being, just as for
10785 the report, depend upon --trace-flags to dump the full set of
10786 items.
10787 * src/reader.c (readgram): Once the grammar read, insert the rule
10788 0: `$axiom: START-SYMBOL $'.
10789 * tests/set.at: Adjust: rule 0 is now displayed, and since the
10790 number of the states has changed (the final state is no longer
10791 necessarily the last), catch up.
10792
75142d45
AD
107932001-12-27 Akim Demaille <akim@epita.fr>
10794
10795 Try to make the use of the eoftoken valid. Given that its value
10796 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
10797 is used instead of > 0 where appropriate, (ii), depend upon nritems
10798 instead of the 0-sentinel.
10799
10800 * src/gram.h, src/gram.c (nritems): New.
10801 Expected to be duplication of nitems, but for the time being...
10802 * src/reader.c (packgram): Assert nritems and nitems are equal.
10803 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
10804 * src/closure.c (print_closure, print_fderives): Likewise.
10805 * src/gram.c (ritem_print): Likewise.
10806 * src/print.c (print_core, print_grammar): Likewise.
10807 * src/print_graph.c: Likewise.
10808
b7c49edf
AD
108092001-12-27 Akim Demaille <akim@epita.fr>
10810
10811 * src/main.c (main): If there are complains after grammar
10812 reductions, then output the report anyway if requested, then die.
10813 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
10814 * src/reader.c (eoftoken): New.
10815 (parse_token_decl): If the token being defined has value `0', it
10816 is the eoftoken.
10817 (packsymbols): No longer hack `tags' to insert `$' by hand.
10818 Be sure to preserve the value of the eoftoken.
10819 (reader): Make sure eoftoken is defined.
10820 Initialize nsyms to 0: now eoftoken is created just like the others.
10821 * src/print.c (print_grammar): Don't special case the eof token.
10822 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
10823 lie anyway, albeit pleasant.
10824 * tests/calc.at: Exercise error messages with eoftoken.
10825 Change the grammar so that empty input is invalid.
10826 Adjust expectations.
10827 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
10828
ec2da99f
AD
108292001-12-27 Akim Demaille <akim@epita.fr>
10830
10831 * configure.in: Check the protos of strchr ans strspn.
10832 Replace strchr if needed.
10833 * src/system.h: Provide the protos of strchr, strspn and memchr if
10834 missing.
10835 * lib/strchr.c: New.
10836 * src/reader.c (symbols_save): Use strchr.
10837
8adfa272
AD
108382001-12-27 Akim Demaille <akim@epita.fr>
10839
10840 * src/print.c, src/print_graph.c (escape): New.
10841 Use it to quote the TAGS outputs.
10842 * src/print_graph.c (print_state): Now errors are in red, and
10843 reductions in green.
10844 Prefer high to wide: output the state number on a line of its own.
10845
80dac38c
AD
108462001-12-27 Akim Demaille <akim@epita.fr>
10847
10848 * src/state.h, src/state.c (reductions_new): New.
10849 * src/LR0.c (set_state_table): Let all the states have a
10850 `reductions', even if reduced to 0.
10851 (save_reductions): Adjust.
10852 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
10853 * src/print.c (print_reductions, print_actions): Adjust.
10854 * src/output.c (action_row): Adjust.
10855
2cec70b9
AD
108562001-12-27 Akim Demaille <akim@epita.fr>
10857
10858 * src/state.h, src/state.c (errs_new, errs_dup): New.
10859 * src/LR0.c (set_state_table): Let all the states have an errs,
10860 even if reduced to 0.
10861 * src/print.c (print_errs, print_reductions): Adjust.
10862 * src/output.c (output_actions, action_row): Adjust.
10863 * src/conflicts.c (resolve_sr_conflict): Adjust.
10864
13ca549a
AD
108652001-12-27 Akim Demaille <akim@epita.fr>
10866
10867 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
10868
5092aba5
AD
108692001-12-27 Akim Demaille <akim@epita.fr>
10870
10871 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
10872 * src/print.c: here.
10873 (lookaheadset, shiftset): New, used as additional storage by
10874 print_reductions.
10875 (print_results): Adjust.
10876 (print_shifts, print_gotos, print_errs): New, extracted from...
10877 (print_actions): here.
10878 * src/print_graph.c (print_actions): Remove dead code.
10879
11e2beca
AD
108802001-12-27 Akim Demaille <akim@epita.fr>
10881
10882 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
10883 `$n' and `@n'.
10884
dac3c910
AD
108852001-12-27 Akim Demaille <akim@epita.fr>
10886
10887 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
10888 (build_relations): Adjust.
10889
d0b0fefa
AD
108902001-12-27 Akim Demaille <akim@epita.fr>
10891
10892 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
10893 duplication.
10894
adc8c848
AD
108952001-12-27 Akim Demaille <akim@epita.fr>
10896
10897 * src/reader.c (packgram): Catch nitems overflows.
10898
14d293ac
AD
108992001-12-27 Akim Demaille <akim@epita.fr>
10900
10901 * src/files.c, src/files.h (guard_obstack): Remove.
10902 * src/output.c (output): Adjust.
10903 * src/reader.c (parse_braces): New, factoring...
10904 (copy_action, copy_guard): these two which are renamed as...
10905 (parse_action, parse_guard): these.
10906 As a voluntary consequence, using braces around guards is now
10907 mandatory.
10908
f499b062
AD
109092001-12-27 Akim Demaille <akim@epita.fr>
10910
10911 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
10912 * src/reader.c (symbol_list): `guard' and `guard_line' are new
10913 members.
10914 (symbol_list_new): Adjust.
10915 (copy_action): action_line is the first line, not the last.
10916 (copy_guard): Just as for actions, store the `action' only, not
10917 the switch/case/break flesh.
10918 Don't parse the user action that might follow the guard, let...
10919 (readgram): do it, i.e., now, there can be an action after a
10920 guard.
10921 In other words the guard is just explicitly optional.
10922 (packgram): Adjust.
10923 * src/output.c (guards_output): New.
10924 (output_parser): Call it when needed.
10925 (output): Also free the guard and attrs obstacks.
10926 * src/files.c, src/files.h (obstack_save): Remove.
10927 (output_files): Remove.
10928 As a result, if one needs the former `.act' file, using an
10929 appropriate skeleton which requires actions and guards is now
10930 required.
10931 * src/main.c (main): Adjust.
10932 * tests/semantic.at: New.
10933 * tests/regression.at: Use `input.y' as input file name.
10934 Avoid 8+3 problems by requiring input.c when the test needs the
10935 parser.
10936
d945f5cd
AD
109372001-12-27 Akim Demaille <akim@epita.fr>
10938
10939 * src/reader.c (symbol_list_new): Be sure to initialize all the
10940 fields.
10941
d200e455
AD
109422001-12-27 Akim Demaille <akim@epita.fr>
10943
10944 All the hacks using a final pseudo state are now useless.
10945
10946 * src/LR0.c (set_state_table): state_table holds exactly nstates.
10947 * src/lalr.c (nLA): New.
10948 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
10949 instead of lookaheadsp from the pseudo state (nstate + 1).
10950
f9507c28
AD
109512001-12-27 Akim Demaille <akim@epita.fr>
10952
10953 * src/output.c (action_row, token_actions): Use a state_t instead
10954 of a integer, and nlookaheads instead of the following state's
10955 lookaheadsp.
10956
065fbd27
AD
109572001-12-27 Akim Demaille <akim@epita.fr>
10958
10959 * src/conflicts.c (log_resolution, flush_shift)
10960 (resolve_sr_conflict, set_conflicts, solve_conflicts)
10961 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
10962 (conflicts_print, print_reductions): Use a state_t instead of an
10963 integer when referring to a state.
10964 As much as possible, depend upon nlookaheads, instead of the
10965 `lookaheadsp' member of the following state (since lookaheads of
10966 successive states are successive, the difference between state n + 1
10967 and n served as the number of lookaheads for state n).
10968 * src/lalr.c (add_lookback_edge): Likewise.
10969 * src/print.c (print_core, print_actions, print_state)
10970 (print_results): Likewise.
10971 * src/print_graph.c (print_core, print_actions, print_state)
10972 (print_graph): Likewise.
10973 * src/conflicts.h: Adjust.
10974
1b177bd7
AD
109752001-12-27 Akim Demaille <akim@epita.fr>
10976
10977 * src/bison.hairy: Formatting/comment changes.
10978 ANSIfy.
10979 Remove `register' indications.
10980 Add plenty of `static'.
10981
7742ddeb
AD
109822001-12-27 Akim Demaille <akim@epita.fr>
10983
10984 * src/output.c (prepare): Drop the muscle `ntbase' which
10985 duplicates ntokens.
10986 * src/bison.simple: Formatting/comment changes.
10987 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
10988 is an undocumented synonym.
10989
1fa14068
AD
109902001-12-22 Akim Demaille <akim@epita.fr>
10991
10992 * src/output.c (output_table_data): Change the prototype to use
10993 `int' for array ranges: some invocations do pass an int, not a
10994 short.
10995 Reported by Wayne Green.
10996
b9752825
AD
109972001-12-22 Akim Demaille <akim@epita.fr>
10998
10999 Some actions of web2c.y are improperly triggered.
11000 Reported by Mike Castle.
11001
11002 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
11003 * tests/regression.at (Web2c): Rename as...
11004 (Web2c Report): this.
11005 (Web2c Actions): New.
11006
776209d6
AD
110072001-12-22 Akim Demaille <akim@epita.fr>
11008
11009 Reductions in web2c.y are improperly reported.
11010 Reported by Mike Castle.
11011
11012 * src/conflicts.c (print_reductions): Fix.
11013 * tests/regression.at (Web2c): New.
11014
275fc3ad
AD
110152001-12-18 Akim Demaille <akim@epita.fr>
11016
11017 Some host fail on `assert (!"foo")', which expands to
11018 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
11019 Reported by Nelson Beebee.
11020
11021 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
11022 `#define it_succeeded 0' and `assert (it_succeeded)'.
11023
897668ee
MA
110242001-12-17 Marc Autret <autret_m@epita.fr>
11025
11026 * src/bison.simple: Don't hard code the skeleton line and filename.
11027 * src/output.c (output_parser): Rename 'line' as 'output_line'.
11028 New line counter 'skeleton_line' (skeleton-line muscle).
11029
ab3399e0
PE
110302001-12-17 Paul Eggert <eggert@twinsun.com>
11031
11032 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
11033 YYDEBUG must be defined to a nonzero value.
11034
11035 * src/bison.simple (yytname): Do not assume that the user defines
11036 YYDEBUG to a properly parenthesized expression.
11037
3877f72b
AD
110382001-12-17 Akim Demaille <akim@epita.fr>
11039
11040 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
11041 nlookaheads is a new member.
11042 Adjust all users.
11043 * src/lalr.h (nlookaheads): Remove this orphan declaration.
11044 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
11045 state.
776209d6 11046
331dbc1b
AD
110472001-12-17 Akim Demaille <akim@epita.fr>
11048
11049 * src/files.h, src/files.c (open_files, close_files): Remove.
11050 * src/main.c (main): Don't open/close files, nor invoke lex_free,
11051 let...
11052 * src/reader.c (reader): Do it.
776209d6 11053
be750e4c
AD
110542001-12-17 Akim Demaille <akim@epita.fr>
11055
11056 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 11057
709ae8c6
AD
110582001-12-17 Akim Demaille <akim@epita.fr>
11059
11060 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
11061 (flush_reduce): New.
11062 (resolve_sr_conflict): Adjust.
776209d6 11063
f87685c3
AD
110642001-12-17 Akim Demaille <akim@epita.fr>
11065
11066 * src/output.c (output_obstack): Be static and rename as...
11067 (format_obstack): this, to avoid any confusion with files.c's
11068 output_obstack.
11069 * src/reader.h (muscle_obstack): Move to...
11070 * src/output.h: here, since it's defined in output.c.
11071
837491d8
AD
110722001-12-17 Akim Demaille <akim@epita.fr>
11073
11074 * src/output.c (action_row, save_column, default_goto)
11075 (sort_actions, matching_state, pack_vector): Better variable
11076 locality.
11077
796d61fb
AD
110782001-12-17 Akim Demaille <akim@epita.fr>
11079
11080 * src/output.c: Various formatting changes.
776209d6 11081
64d15509
AD
110822001-12-17 Akim Demaille <akim@epita.fr>
11083
11084 * src/files.c (output_files): Free the output_obstack.
11085 * src/main.c (main): Call print and print_graph conditionally.
11086 * src/print.c (print): Work unconditionally.
11087 * src/print_graph.c (print_graph): Work unconditionally.
11088 * src/conflicts.c (log_resolution): Output only if verbose_flag.
11089
fbc8ecb7
MA
110902001-12-16 Marc Autret <autret_m@epita.fr>
11091
11092 * src/output.c (actions_output): Fix. When we use %no-lines,
11093 there is one less line per action.
11094
f0440388
MA
110952001-12-16 Marc Autret <autret_m@epita.fr>
11096
11097 * src/bison.simple: Remove a useless #line directive.
11098 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
11099 * src/output.c (get_lines_number): New.
776209d6 11100 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
11101 output muscles.
11102 Fix line numbering.
11103 (actions_output): Computes the number of lines taken by actions.
11104 (output_master_parser): Insert new skeleton which is the name of
11105 the output parser file name.
11106
a79986b8
MA
111072001-12-15 Marc Autret <autret_m@epita.fr>
11108
11109 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
11110
4ec8e00f
MA
111112001-12-15 Marc Autret <autret_m@epita.fr>
11112
11113 * src/output.c (output_gram): Keep track of the hairy one.
11114
1a4648ff
AD
111152001-12-15 Akim Demaille <akim@epita.fr>
11116
11117 Make `make distcheck' work.
11118
11119 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
11120 system.h which uses libgettext.h.
11121
9c2c67e6
AD
111222001-12-15 Akim Demaille <akim@epita.fr>
11123
11124 * src/nullable.c (set_nullable): Useless rules must be skipped,
11125 otherwise, since we range over their symbols, we might look at a
11126 nonterminal which no longer ``exists'', i.e., it is not counted in
11127 `nvars', hence we overflow our arrays.
11128
93ede233
AD
111292001-12-15 Akim Demaille <akim@epita.fr>
11130
11131 The header can also be produced directly, without any obstack!
11132 Yahoo!
11133
11134 * src/files.c, src/files.h (defines_obstack): Remove.
11135 (compute_header_macro): Global.
11136 (defines_obstack_save): Remove.
11137 * src/reader.c (parse_union_decl): No longer output to
11138 defines_obstack: its content can be found in the `stype' muscle
11139 anyway.
11140 (output_token_translations): Merge into...
11141 (symbols_output): this.
11142 Rename as...
11143 (symbols_save): this.
11144 (reader): Adjust.
11145 * src/output.c (header_output): New.
11146 (output): Call it.
11147
2666f928
AD
111482001-12-15 Akim Demaille <akim@epita.fr>
11149
11150 * src/reader.c (parse_union_decl): Instead of handling two obstack
11151 simultaneously, use one to define the `stype' muscle, and use the
11152 value of the latter to fill defines_obstack.
11153 (copy_comment): Remove.
11154 (copy_comment2): Work for a single obstack.
11155 Rename as...
11156 (copy_comment): this.
11157
428046f8
AD
111582001-12-15 Akim Demaille <akim@epita.fr>
11159
11160 * src/lex.c, src/lex.h (xgetc): No longer static.
11161 * src/reader.c (parse_union_decl): Revamp.
11162
ea52d706
AD
111632001-12-15 Akim Demaille <akim@epita.fr>
11164
11165 Still making progress in separating Bison into (i) input, (ii)
11166 process, (iii) output: now we can directly output the parser file
11167 without using table_obstack at all.
11168
11169 * src/files.c, src/files.h (table_obstack): Bye bye.
11170 (parser_file_name): New.
11171 * src/files.c (compute_output_file_names): Compute it.
11172 * src/output.c (actions_output, output_parser)
11173 (output_master_parser): To a file instead of an obstack.
11174
3f96f4dc
AD
111752001-12-15 Akim Demaille <akim@epita.fr>
11176
11177 Attach actions to rules, instead of pre-outputting them to
11178 actions_obstack.
11179
11180 * src/gram.h (rule_t): action and action_line are new members.
11181 * src/reader.c (symbol_list): Likewise.
11182 (copy_action): Save the actions within the rule.
11183 (packgram): Save them in rule_table.
11184 * src/output.c (actions_output): New.
11185 (output_parser): Use it on `%%actions'.
11186 (output_rule_data): Don't free rule_table.
11187 (output): Do it.
11188 (prepare): Don't save the `action' muscle.
11189 * src/bison.simple: s/%%action/%%actions/.
11190
51576fb3
AD
111912001-12-15 Akim Demaille <akim@epita.fr>
11192
11193 * src/reader.c (copy_action): When --yacc, don't append a `;'
11194 to the user action: let it fail if lacking.
dee049eb 11195 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 11196
2648a72d
AD
111972001-12-14 Akim Demaille <akim@epita.fr>
11198
11199 * src/lex.c (literalchar): Simply return the char you decoded, non
11200 longer mess around with obstacks and int pointers.
11201 Adjust all callers.
11202
92790e5b
AD
112032001-12-14 Akim Demaille <akim@epita.fr>
11204
11205 * src/lex.c (literalchar): Don't escape the special characters,
11206 just decode them, and keep them as char (before, eol was output as
11207 the 2 char string `\n' etc.).
11208 * src/output.c (output_rule_data): Use quotearg to output the
11209 token strings.
11210
927c1557
PE
112112001-12-13 Paul Eggert <eggert@twinsun.com>
11212
11213 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
11214 Do not infringe on the global user namespace when using C++.
11215 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
11216 All uses of `fprintf' and `stderr' changed.
11217
11218 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
11219
ed8e1f68
AD
112202001-12-13 Akim Demaille <akim@epita.fr>
11221
11222 The computation of nullable is broken: it doesn't handle empty
11223 RHS's properly.
11224
11225 * tests/torture.at (GNU AWK Grammar): New.
11226 * tests/sets.at (Nullable): New.
11227 * src/nullable.c (set_nullable): Instead of blindly looping over
11228 `ritems', loop over the rules, and then over their rhs's.
11229
11230 Work around Autotest bugs.
11231
11232 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
11233 frame, because Autotest understand lines starting with a `+' as
11234 traces from the shell. Then, they are not processed properly.
11235 Admittedly an Autotest bug, but we don't have time to wait for
11236 Autotest to catch up.
11237 * tests/regression.at (Broken Closure): Adjust to the new table
11238 frames.
11239 Move to...
11240 * tests/sets.at: here.
11241
cb581495
AD
112422001-12-13 Akim Demaille <akim@epita.fr>
11243
11244 * src/closure.c (closure): Use nrules instead of playing tricks
11245 with BITS_PER_WORD.
11246
2e729273
AD
112472001-12-13 Akim Demaille <akim@epita.fr>
11248
11249 * src/print.c (print_actions): Output the handling of `$' as the
11250 traces do: shifting the token EOF. Before EOF was treated as a
11251 nonterminal.
11252 * tests/regression.at: Adjust some tests.
11253 * src/print_graph.c (print_core): Complete the set of items via
11254 closure. The next-to-final and final states are still unsatisfying,
11255 but that's to be addressed elsewhere.
11256 No longer output the rule numbers, but do output the state number.
11257 A single loop for the shifts + gotos is enough, but picked a
11258 distinct color for each.
11259 (print_graph): Initialize and finalize closure.
11260
107f7dfb
AD
112612001-12-13 Akim Demaille <akim@epita.fr>
11262
11263 * src/reader.c (readgram): Remove dead code, an strip useless
11264 braces.
11265 (get_type): Remove, unused.
11266
9b53a24f
AD
112672001-12-12 Akim Demaille <akim@epita.fr>
11268
11269 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
11270 on that of lib/error.c.
11271
dbfb6dcd
AD
112722001-12-12 Akim Demaille <akim@epita.fr>
11273
11274 Some hosts don't like `/' in includes.
11275
11276 * src/system.h: Include libgettext.h without qualifying the path.
11277 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
11278 $(top_srcdir).
11279
c25fb648
MA
112802001-12-11 Marc Autret <autret_m@epita.fr>
11281
11282 * src/output.c (output_parser): Remove useless muscle.
11283
710ddc4f
MA
112842001-12-11 Marc Autret <autret_m@epita.fr>
11285
11286 * src/bison.simple: Remove #line just before %%epilogue. It
11287 is now handled in ...
11288 * src/reader.c (read_additionnal_code): Add the output of a
11289 #line for the epilogue.
11290
e83d80b8
MA
112912001-12-10 Marc Autret <autret_m@epita.fr>
11292
927c1557 11293 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
11294 replace precedent remove.
11295 * src/bison.simple: Remove #line before %%prologue because
11296 %%input-line is wrong at this time.
11297
971d5158
MA
112982001-12-10 Marc Autret <autret_m@epita.fr>
11299
11300 * src/reader.c (symbols_output): Clean up.
927c1557 11301 * src/output.c (output_gram, output): Clean up.
971d5158 11302
5edafffd
AD
113032001-12-10 Akim Demaille <akim@epita.fr>
11304
11305 * src/lalr.c (initialize_lookaheads): New. Extracted from...
11306 * src/LR0.c (set_state_table): here.
11307 * src/lalr.c (lalr): Call it.
11308
0279f8e9
AD
113092001-12-10 Akim Demaille <akim@epita.fr>
11310
11311 * src/state.h (shifts): Remove the `number' member: shifts are
11312 attached to state, hence no longer need to be labelled with a
11313 state number.
11314
190c4f5f
AD
113152001-12-10 Akim Demaille <akim@epita.fr>
11316
11317 Now that states have a complete set of members, the linked list of
11318 shifts is useless: just fill directly the state's shifts member.
11319
11320 * src/state.h (shifts): Remove the `next' member.
11321 * src/LR0.c (first_state, last_state): Remove.
11322 Adjust the callers.
11323 (augment_automaton): Don't look for the shifts that must be added
11324 a shift on EOF: it is those of the state we looked for! But now,
11325 since shifts are attached, it is no longer needed to looking
11326 merely by its id: its number.
11327
2a73b93d
AD
113282001-12-10 Akim Demaille <akim@epita.fr>
11329
11330 * src/LR0.c (augment_automaton): Better variable locality.
11331 Remove an impossible branch: if there is a state corresponding to
11332 the start symbol being shifted, then there is shift for the start
11333 symbol from the initial state.
11334
74392f6a
AD
113352001-12-10 Akim Demaille <akim@epita.fr>
11336
11337 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
11338 only when appropriate: when insert_start_shifting_state' is not
11339 invoked.
11340 * tests/regression.at (Rule Line Numbers): Adjust.
11341
37c82725
AD
113422001-12-10 Akim Demaille <akim@epita.fr>
11343
11344 * src/LR0.c (augment_automaton): Now that all states have shifts,
11345 merge the two cases addition shifts to the initial state.
11346
6a164e0c
AD
113472001-12-10 Akim Demaille <akim@epita.fr>
11348
11349 * src/lalr.c (set_state_table): Move to...
11350 * src/LR0.c: here.
11351 * src/lalr.c (lalr): Don't call it...
11352 * src/LR0.c (generate_states): do it.
11353 * src/LR0.h (first_state): Remove, only the table is used.
11354
7215de24
AD
113552001-12-10 Akim Demaille <akim@epita.fr>
11356
11357 * src/LR0.h (first_shift, first_reduction): Remove.
11358 * src/lalr.c: Don't use first_shift: find shifts through the
11359 states.
11360
80e25d4d
AD
113612001-12-10 Akim Demaille <akim@epita.fr>
11362
11363 * src/LR0.c: Attach shifts to states as soon as they are
11364 computed.
11365 * src/lalr.c (set_state_table): Instead of assigning shifts to
11366 state, just assert that the mapping was properly done.
11367
0ab3728b
AD
113682001-12-10 Akim Demaille <akim@epita.fr>
11369
11370 * src/LR0.c (insert_start_shift): Rename as...
11371 (insert_start_shifting_state): this.
11372 (insert_eof_shifting_state, insert_accepting_state): New.
11373 (augment_automaton): Adjust.
11374 Better locality of the variables.
11375 When looking if the start_symbol is shifted from the initial
11376 state, using `while (... symbol != start_symbol ...)' sounds
11377 better than `while (... symbol < start_symbol ...)': If fail
11378 to see how the order between symbols could be relevant!
11379
78af9bbc
AD
113802001-12-10 Akim Demaille <akim@epita.fr>
11381
11382 * src/getargs.h: Don't declare `spec_name_prefix' and
11383 `spec_file_prefix', declared by src/files.h.
11384 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
11385 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
11386 * src/output.c (prepare): Adjust.
11387 * src/reader.c (symbols_output): Likewise.
11388 * src/vmsgetargs.c: Vaguely adjust, but who cares?
11389
bdef2a41
AD
113902001-12-10 Akim Demaille <akim@epita.fr>
11391
11392 * src/muscle_tab.c (muscle_init): NULL is a better default than
11393 `"0"'.
11394
3735969c
AD
113952001-12-10 Akim Demaille <akim@epita.fr>
11396
11397 * src/reader.c (reader): Calling symbols_output once is enough.
11398
49701457
AD
113992001-12-10 Akim Demaille <akim@epita.fr>
11400
11401 Now that states have a complete set of members, the linked list of
11402 reductions is useless: just fill directly the state's reductions
11403 member.
11404
11405 * src/state.h (struct reductions): Remove member `number' and
11406 `next'.
11407 * src/LR0.c (first_reduction, last_reduction): Remove.
11408 (save_reductions): Don't link the new reductions, store them in
11409 this_state.
11410 * src/lalr.c (set_state_table): No need to attach reductions to
11411 states, it's already done.
11412 * src/output.c (output_actions): No longer free the shifts, then
11413 the reductions, then the states: free all the states and their
11414 members.
11415
0edad749
AD
114162001-12-10 Akim Demaille <akim@epita.fr>
11417
11418 * src/options.c (OPTN, DRTV, BOTH): New.
11419 (option_table): Use them.
11420
0edad749
AD
11421 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
11422 the job of system.h.
11423 * src/options.c: Don't include stdio.h and xalloc.h for the same
11424 reasons.
11425
5449dd0f
AD
114262001-12-10 Akim Demaille <akim@epita.fr>
11427
11428 * src/output.c (output, prepare): Make sure the values of the
11429 muscles `action' and `prologue' are 0-terminated.
11430
a870c567
AD
114312001-12-10 Akim Demaille <akim@epita.fr>
11432
11433 Clean up GCC warnings.
11434
11435 * src/reader.c (copy_action): `buf' is not used.
11436 (parse_skel_decl): Be static.
11437 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
11438 * src/options.h (create_long_option_table): Have a real prototype.
11439 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
11440 (hash_delete_at): Return const void *.
11441 Adjust casts to preserve the const.
11442
80df8768
AD
114432001-12-10 Akim Demaille <akim@epita.fr>
11444
11445 * configure.in: Require 2.52g.
11446 M4 is not needed, but AUTOM4TE is.
11447 * m4/m4.m4: Remove.
11448 * tests/Makefile.am: Adjust.
11449
f693ad14
AD
114502001-12-10 Akim Demaille <akim@epita.fr>
11451
11452 One structure for states is enough, even though theoretically
11453 there are LR(0) states and LALR(1) states.
11454
11455 * src/lalr.h (state_t): Remove.
11456 (state_table): Be state_t **, not state_t *.
11457 * src/state.h (core, CORE_ALLOC): Rename as...
11458 (state_t, STATE_ALLOC): this.
11459 Add the LALR(1) members: shifts, reductions, errs.
11460 * src/LR0.c (state_table): Rename as...
11461 (state_hash): this, to avoid name clashes with the global
11462 `state_table'.
11463 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
11464 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
11465
74ffbcb6
AD
114662001-12-10 Akim Demaille <akim@epita.fr>
11467
11468 Bison dumps core on bash.y.
11469 Reported by Pascal Bart.
11470
11471 * src/warshall.c (bitmatrix_print): New.
11472 (TC): Use it.
ba0fe3c7 11473 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
11474 j must be the outer loop.
11475 * tests/regression.at (Broken Closure): New.
11476
07708e19
AD
114772001-12-05 Akim Demaille <akim@epita.fr>
11478
11479 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
11480 its argument.
ba1ecc07 11481 Reported by Peter Hamorsky.
07708e19 11482
92b16366
AD
114832001-12-05 Akim Demaille <akim@epita.fr>
11484
11485 * src/conflicts.c (err_table): Remove.
11486 (resolve_sr_conflict): Adjust.
11487 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
11488 Rename as...
11489 (state_t.reductions, state_t.shifts): this.
11490
076ab033
AD
114912001-12-05 Akim Demaille <akim@epita.fr>
11492
11493 * src/reduce.c (reduce_grammar_tables): No longer disable the
11494 removal of useless rules via CPP but via `if (0)', so that the
11495 compiler still check the code is valid.
11496 For instance, it should have noticed `rline' no longer exists: use
11497 the `line' member of rule_t.
11498 * src/gram.c (dummy, rline): Remove, unused.
11499
3843c413
AD
115002001-12-05 Akim Demaille <akim@epita.fr>
11501
11502 * src/output.c (pack_vector): Use assert, not berror.
11503 * src/main.c (berror): Remove, unused.
11504
43168960
AD
115052001-12-05 Akim Demaille <akim@epita.fr>
11506
11507 New experimental feature: if --verbose --trace output all the
11508 items of a state, not only its kernel.
11509
11510 * src/print.c (print_core): If `trace_flag', then invoke closure
11511 before outputting the items of the state (print_core is no longer
11512 a correct name them).
11513 (print_results): Invoke new_closure/free_closure if needed.
11514
b2872512
AD
115152001-12-05 Akim Demaille <akim@epita.fr>
11516
11517 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
11518 * src/closure.c, src/closure.h (itemsetsize): Rename as...
11519 (nitemset): for consistency with the rest of the project.
11520
23cbcc6c
AD
115212001-12-05 Akim Demaille <akim@epita.fr>
11522
11523 * src/closure.c (print_closure): Improve.
11524 (closure): Use it for printing input and output.
11525
03ec521c
AD
115262001-12-05 Akim Demaille <akim@epita.fr>
11527
11528 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
11529 indexed by nonterminals.
11530
3a7456dd
AD
115312001-12-05 Akim Demaille <akim@epita.fr>
11532
11533 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
11534 what it was!).
11535 * src/warshall.h: Remove accidental duplication of the content.
11536
1cbcf2e7
AD
115372001-12-05 Akim Demaille <akim@epita.fr>
11538
11539 * src/closure.c (set_fderives): De-obfuscate.
11540
84182270
AD
115412001-12-05 Akim Demaille <akim@epita.fr>
11542
11543 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
11544
3f6f053c
AD
115452001-12-05 Akim Demaille <akim@epita.fr>
11546
11547 * src/closure.c (set_firsts): De-obfuscate.
11548
7a5350ba
AD
115492001-12-05 Akim Demaille <akim@epita.fr>
11550
11551 * src/output.c (action_row): De-obfuscate
11552 using the good o' techniques: arrays not pointers, variable
11553 locality, BITISSET, RESETBIT etc.
11554
d954473d
AD
115552001-12-05 Akim Demaille <akim@epita.fr>
11556
11557 Pessimize the code to simplify it: from now on, all the states
11558 have a valid SHIFTS, which NSHIFTS is possibly 0.
11559
11560 * src/LR0.c (shifts_new): Be global and move to..
11561 * src/state.c, src/state.h: here.
11562 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
11563 * src/print_graph: Adjust.
11564
9839bbe5
AD
115652001-12-05 Akim Demaille <akim@epita.fr>
11566
11567 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
11568 * src/conflicts.c: Use it.
11569 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
11570 incorrectly ``simplified''.
11571
9f136c07
AD
115722001-12-05 Akim Demaille <akim@epita.fr>
11573
11574 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
11575 using the good o' techniques: arrays not pointers, variable
11576 locality, BITISSET, RESETBIT etc.
11577
b608206e
AD
115782001-12-05 Akim Demaille <akim@epita.fr>
11579
11580 * src/state.h (SHIFT_SYMBOL): New.
11581 * src/conflicts.c: Use it to deobfuscate.
11582
52afa962
AD
115832001-12-05 Akim Demaille <akim@epita.fr>
11584
11585 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
11586 (print_reductions): De-obfuscate using the good o' techniques:
11587 arrays not pointers, variable locality, BITISSET.
11588
e74dc321
AD
115892001-12-05 Akim Demaille <akim@epita.fr>
11590
11591 * src/conflicts.c (print_reductions): Arrays, not pointers.
11592 Use BITISSET.
11593
768fca83
AD
115942001-12-05 Akim Demaille <akim@epita.fr>
11595
11596 * src/conflicts.c (print_reductions): Pessimize, but clarify.
11597
a17e599f
AD
115982001-12-05 Akim Demaille <akim@epita.fr>
11599
11600 * src/conflicts.c (print_reductions): Improve variable locality.
11601
a04bc341
AD
116022001-12-05 Akim Demaille <akim@epita.fr>
11603
11604 * src/conflicts.c (print_reductions): Pessimize, but clarify.
11605
c8ea038e
AD
116062001-12-05 Akim Demaille <akim@epita.fr>
11607
11608 * src/conflicts.c (print_reductions): Improve variable locality.
11609
aa2aab3c
AD
116102001-12-05 Akim Demaille <akim@epita.fr>
11611
11612 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
11613 * src/lalr.c: Use them.
11614
b178c8cc
AD
116152001-12-05 Akim Demaille <akim@epita.fr>
11616
11617 * src/LR0.c (augment_automaton): Formatting changes.
11618 Better variable locality.
11619
f67d13aa
AD
116202001-12-05 Akim Demaille <akim@epita.fr>
11621
11622 * src/lalr.c (matrix_print): New.
11623 (transpose): Use it.
11624 Use arrays instead of pointers.
11625
c2713865
AD
116262001-12-05 Akim Demaille <akim@epita.fr>
11627
11628 * src/lalr.c (maxrhs): Move to...
11629 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
11630 * src/lalr.c (build_relations): Adjust.
11631
9887c18a
AD
116322001-12-05 Akim Demaille <akim@epita.fr>
11633
11634 * src/lalr.c (transpose): Free the memory allocated to the
11635 argument, as it is replaced by the results by the unique caller.
11636 (build_relations): Merely invoke transpose: it handles the memory
11637 deallocation.
11638 Improve variable locality.
11639 Avoid variables used as mere abbreviations.
11640 (compute_lookaheads): Use arrays instead of pointers.
11641
4d4f699c
AD
116422001-12-05 Akim Demaille <akim@epita.fr>
11643
11644 * src/lalr.c (initialize_F): Improve variable locality.
11645 Avoid variables used as mere abbreviations.
11646
80a69750
AD
116472001-12-05 Akim Demaille <akim@epita.fr>
11648
11649 * src/derives.c (print_derives): Display the ruleno.
11650 * src/lalr.c (initialize_F, transpose): Better variable locality
11651 to improve readability.
11652 Avoid variables used as mere abbreviations.
11653
fe961097
AD
116542001-12-05 Akim Demaille <akim@epita.fr>
11655
11656 * src/lalr.c (traverse): Use arrays instead of pointers.
11657
e3e4e814
AD
116582001-12-05 Akim Demaille <akim@epita.fr>
11659
11660 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
11661 the handling of squeue.
11662 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
11663
630e182b
AD
116642001-12-05 Akim Demaille <akim@epita.fr>
11665
11666 Because useless nonterminals are now kept alive (instead of being
11667 `destroyed'), we now sometimes examine them, and store information
11668 related to them. Hence we need to know their number, and adjust
11669 memory allocations.
11670
11671 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
11672 static.
11673 * src/LR0.c (allocate_itemsets): The memory allocated to
11674 `symbol_count' was used for two different purpose: once to count
11675 the number of occurrences of each symbol, and later reassigned to
11676 `shift_symbol', containing the symbol that can be shifted from a
11677 given state.
11678 Deobfuscate, i.e., allocate, use and free `symbol_count' here
11679 only, and...
11680 (new_itemsets): Allocate `shift_symbol' here.
11681 (allocate_itemsets): symbol_count includes useless nonterminals.
11682 Make room for them.
11683 (free_storage): Use `free', not `XFREE', for pointers that cannot
11684 be null.
11685
81b51460
AD
116862001-12-05 Akim Demaille <akim@epita.fr>
11687
11688 * src/nullable.c (set_nullable): Deobfuscate the handling of
11689 ritem.
11690 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
11691
3067fbef
AD
116922001-12-05 Akim Demaille <akim@epita.fr>
11693
11694 * src/gram.c, src/gram.h (ritem_print): New.
11695 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
11696 (This useless function was defined only to work around VMS linkers
11697 that can't handle compilation units with variables only).
11698 * src/reduce.c (dump_grammar): Use it to trace the construction of
11699 ritem.
11700
c2bea5f9
PE
117012001-12-04 Paul Eggert <eggert@twinsun.com>
11702
7d27c823
PE
11703 * src/bison.simple (union yyalloc): Change member names
11704 to be the same as the stack names.
11705 (yyparse): yyptr is now union yyalloc *, not char *.
11706 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
11707 and may generate better code on some machines.
c2bea5f9
PE
11708 (yystpcpy): Use prototype if __STDC__ is defined, not just
11709 if __cplusplus is defined.
35687a9d 11710
2c8a9dfa
AD
117112001-11-30 Akim Demaille <akim@epita.fr>
11712
11713 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
11714 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
11715 Gettext doesn't compile cleanly, and dies with -Werror.
11716 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
11717 Include WARNING_CFLAGS here.
11718 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
11719 before being defined.
11720
f4e421e6
AD
117212001-11-27 Paul Eggert <eggert@twinsun.com>
11722
11723 * lib/quotearg.h (quotearg_n, quotearg_n_style):
11724 First arg is int, not unsigned.
11725 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
11726 (SIZE_MAX, UINT_MAX): New macros.
11727 (quotearg_n_options): Abort if N is negative.
11728 Avoid overflow check on hosts where size_t is 64 bits and int
11729 is 32 bits, as overflow is impossible there.
11730 Fix off-by-one typo that caused unnecessary reallocation.
11731
7093d0f5
AD
117322001-11-29 Paul Eggert <eggert@twinsun.com>
11733
11734 Name space cleanup in generated parser.
11735
11736 * doc/bison.texinfo (Bison Parser): Discuss system headers
11737 and their effect on the user name space.
11738
11739 * src/bison.simple:
11740 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
11741 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
11742 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
11743
11744 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
11745 on user names when possible.
11746
11747 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
11748 Simplify test for whather <alloca.h> exists.
11749
11750 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
11751
11752 (<stdio.h>): Include if YYDEBUG.
11753
11754 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
11755 ! defined (yyoverflow) && ! defined (yymemcpy).
11756
11757 (yymemcpy, yyparse): Rename local variables as needed so that
11758 they all begin with 'yy'.
11759
11760 (yystrlen, yystpcpy): New functions.
11761
11762 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
11763 All uses changed.
11764
11765 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
11766 instead of relying on string.h functions. Use YYSTACK_ALLOC
11767 and YYSTACK_FREE instead of malloc and free.
11768
fd51e5ff
AD
117692001-11-30 Akim Demaille <akim@epita.fr>
11770
11771 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
11772 before their first uses.
11773 (YYBISON, YYPURE): Move to the top of the output.
11774
7d13ff5f
AD
117752001-11-30 Akim Demaille <akim@epita.fr>
11776
11777 * tests/reduce.at (Useless Nonterminals): Fix.
11778
892a3995
AD
117792001-11-30 Akim Demaille <akim@epita.fr>
11780
11781 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
11782 if body instead of `;' to pacify GCC's warnings.
11783
68f1e3ed
AD
117842001-11-30 Akim Demaille <akim@epita.fr>
11785
11786 Instead of mapping the LHS of unused rules to -1, keep the LHS
11787 valid, but flag the rules as invalid.
11788
11789 * src/gram.h (rule_t): `useful' is a new member.
11790 * src/print.c (print_grammar): Adjust.
11791 * src/derives.c (set_derives): Likewise.
11792 * src/reader.c (packgram, reduce_output): Likewise.
11793 * src/reduce.c (reduce_grammar_tables): Likewise.
11794 * tests/reduce.at (Underivable Rules, Useless Rules): New.
11795
d2d1b42b
AD
117962001-11-30 Akim Demaille <akim@epita.fr>
11797
11798 * src/reduce.c (reduce_output): Formatting changes.
11799 * src/print.c (print_results, print_grammar): Likewise.
11800 * tests/regression.at (Rule Line Numbers)
11801 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
11802
760b53a8
AD
118032001-11-30 Akim Demaille <akim@epita.fr>
11804
11805 * src/reduce.c (nonterminals_reduce): Instead of throwing away
11806 useless nonterminals, move them at the end of the symbol arrays.
11807 (reduce_output): Adjust.
11808 * tests/reduce.at (Useless Nonterminals): Adjust.
11809
00238958
AD
118102001-11-30 Akim Demaille <akim@epita.fr>
11811
11812 * src/reduce.c: Various comment/formatting changes.
11813 (nonterminals_reduce): New, extracted from...
11814 (reduce_grammar_tables): here.
11815 (reduce_grammar): Call nonterminals_reduce.
11816
396452de
PE
118172001-11-29 Paul Eggert <eggert@twinsun.com>
11818
11819 * src/bison.simple (YYSTACK_REALLOC): Remove.
11820 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
11821 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
11822 New macros.
11823 (union yyalloc): New type.
11824 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
11825 an arbitrary restriction on hosts where size_t is wider than int.
11826
11827 (yyparse): Don't dump core if alloca or malloc fails; instead, report
11828 a parser stack overflow. Allocate just one block of memory for all
11829 three stacks, instead of allocating three blocks; this typically is
11830 faster and reduces fragmentation.
11831
11832 Do not limit the number of items in the stack to a value that fits
11833 in 'int', as this is an arbitrary limit on hosts with 64-bit
11834 size_t and 32-bit int.
11835
147e184c
MA
118362001-11-29 Marc Autret <autret_m@epita.fr>
11837
11838 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
11839 of defining YYERROR_VERBOSE.
11840 [AT_DATA]: $4 is now out of C declarations in the prologue.
11841
426cf563
MA
118422001-11-28 Marc Autret <autret_m@epita.fr>
11843
11844 * src/reader.c (parse_dquoted_param): New.
11845 (parse_skel_decl): Use it.
11846 * src/lex.h: Add its prototype.
11847 * src/lex.c (literalchar): Become not static.
11848
c7925b99
MA
118492001-11-28 Marc Autret <autret_m@epita.fr>
11850
11851 * src/output.h: And put its extern declaration here.
11852 * src/output.c (error_verbose): Define here.
11853 (prepare): Echo name modification.
11854 * src/getargs.h: Clean its extern declaration.
11855 * src/getargs.c (error_verbose_flag): Remove.
11856 (getargs): Remove case 'e'.
11857 * src/options.c (option_table): 'error-verbose' is now seen as simple
11858 percent option.
11859 Include output.h.
11860
11861 * src/reader.c (read_declarations): Remove case tok_include.
11862 (parse_include_decl): Remove.
11863 * src/lex.h (token_t): Remove tok_include.
11864 * src/options.c (option_table): 'include' is now a simple command line
11865 option.
11866
5b5d1929
MA
118672001-11-28 Marc Autret <autret_m@epita.fr>
11868
11869 * src/bison.simple: Adjust muscle names.
11870 * src/muscle_tab.c (muscle_init): Also rename the muscles.
11871 * src/output.c (prepare): s/_/-/ for the muscles names.
11872 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
11873
8850be4b
MA
118742001-11-28 Marc Autret <autret_m@epita.fr>
11875
11876 * src/bison.simple: Fix debug.
11877 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
11878
4a38e613
AD
118792001-11-28 Akim Demaille <akim@epita.fr>
11880
11881 * src/LR0.c (shifts_new): New.
11882 (save_shifts, insert_start_shift, augment_automaton): Use it.
11883
4b35e1c1
AD
118842001-11-28 Akim Demaille <akim@epita.fr>
11885
11886 * src/closure.c (closure): `b' and `ruleno' denote the same value:
11887 keep ruleno only.
11888
d2b04478
AD
118892001-11-28 Akim Demaille <akim@epita.fr>
11890
11891 * src/closure.c (closure): Instead of looping over word in array
11892 then bits in words, loop over bits in array.
11893
2c4c30aa
AD
118942001-11-28 Akim Demaille <akim@epita.fr>
11895
11896 * src/closure.c (closure): No longer optimize the special case
11897 where all the bits of `ruleset[r]' are set to 0, to make the code
11898 clearer.
11899
576890b7
AD
119002001-11-28 Akim Demaille <akim@epita.fr>
11901
11902 * src/closure.c (closure): `r' and `c' are new variables, used to
11903 de-obfuscate accesses to RULESET and CORE.
11904
cb487d7d
AD
119052001-11-28 Akim Demaille <akim@epita.fr>
11906
11907 * src/reduce.c (reduce_print): Use ngettext.
11908 (dump_grammar): Improve the trace accuracy.
11909
6013d43f
AD
119102001-11-28 Akim Demaille <akim@epita.fr>
11911
11912 * src/reduce.c (dump_grammar): Don't translate trace messages.
11913
cb4956ee
AD
119142001-11-28 Akim Demaille <akim@epita.fr>
11915
11916 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
11917 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
11918 as all tags are free'ed afterwards.
11919 From Enrico Scholz.
11920
648185ab
PE
119212001-11-27 Paul Eggert <eggert@twinsun.com>
11922
11923 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
11924 use alloca when we didn't want to, and vice versa.
11925
68254a03
MA
119262001-11-27 Marc Autret <autret_m@epita.fr>
11927
9113b58f
AD
11928 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
11929 initialization.
68254a03
MA
11930 * src/output.c (prepare): Remove its update.
11931
04d843a2
MA
119322001-11-27 Marc Autret <autret_m@epita.fr>
11933
11934 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
11935 Use %error-verbose.
11936
d2079671 119372001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
11938
11939 * src/bison.simple: Remove YYERROR_VERBOSE using.
11940 Use %%error_verbose.
11941 (yyparse): Likewise.
11942 * src/output.c (prepare): Give its final value.
11943 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
11944 * src/getargs.h: Add its extern declaration.
11945 * src/getargs.c (error_verbose_flag): New int.
11946 (getargs): Update to catch new case.
11947 * src/options.c (option_table): 'error-verbose' is a new option.
11948 (shortopts): Update.
11949
e0327bc8
AD
119502001-11-27 Akim Demaille <akim@epita.fr>
11951
11952 * src/system.h: Use intl/libgettext.h.
11953 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
11954
000f1a3c
AD
119552001-11-27 Akim Demaille <akim@epita.fr>
11956
11957 * tests/torture.at (Exploding the Stack Size with Malloc):
11958 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
11959
26cfe0be
AD
119602001-11-27 Akim Demaille <akim@epita.fr>
11961
11962 * src/files.c: Include error.h.
11963 Reported by Hans Aberg.
11964
f6bd5427
MA
119652001-11-26 Marc Autret <autret_m@epita.fr>
11966
d2079671 11967 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
11968 (read_declarations): Add case tok_include.
11969 * src/getargs.h (include): Add its extern definition.
11970 * src/getargs.c (include): New const char *.
11971 (getargs): Add case '-I'.
11972 * src/options.c (option_table): Add include as command line and
11973 percent option.
11974 * src/lex.h (token_t): Add tok_include.
11975
2ca209c1
AD
119762001-11-26 Akim Demaille <akim@epita.fr>
11977
11978 * src/reader.c (readgram): Make sure rules for mid-rule actions
11979 have a lineno equal to that of their host rule.
11980 Reported by Hans Aberg.
11981 * tests/regression.at (Rule Line Numbers): New.
11982
0e41b407
AD
119832001-11-26 Akim Demaille <akim@epita.fr>
11984
11985 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
11986 size_ts.
11987
119882001-11-26 Akim Demaille <akim@epita.fr>
11989
11990 * src/complain.c, src/complain.h (error): Remove, provided by
11991 lib/error.[ch].
11992
e0c40012
AD
119932001-11-26 Akim Demaille <akim@epita.fr>
11994
11995 * src/reader.c (read_declarations): Don't abort on tok_illegal,
11996 issue an error message.
11997 * tests/regression.at (Invalid %directive): New.
11998 Reported by Hans Aberg.
11999
5e147124
AD
120002001-11-26 Akim Demaille <akim@epita.fr>
12001
12002 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
12003 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
12004
a034c8b8
AD
120052001-11-26 Akim Demaille <akim@epita.fr>
12006
12007 * src/conflicts.c (conflicts_print): Don't complain at all when
12008 there are no reduce/reduce conflicts, and as many shift/reduce
12009 conflicts as expected.
12010 * tests/regression.at (%expect right): Adjust.
12011
c64a20f3
AD
120122001-11-23 Akim Demaille <akim@epita.fr>
12013
12014 * lib/alloca.c: Update, from fileutils.
12015
5b0d29bb
AD
120162001-11-23 Akim Demaille <akim@epita.fr>
12017
12018 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
12019
722c4bfe
AD
120202001-11-23 Akim Demaille <akim@epita.fr>
12021
12022 * src/system.h: Include alloca.h.
12023 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
12024
6255b435
AD
120252001-11-23 Akim Demaille <akim@epita.fr>
12026
12027 * src/print_graph.c (print_actions): Remove `rule', unused.
12028 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
12029 pacify GCC's signed < unsigned warnings.
12030 * src/closure.c (itemsetsize): Likewise.
12031 * src/reader.c (symbol_list_new): Static.
12032
b29b2ed5
AD
120332001-11-23 Akim Demaille <akim@epita.fr>
12034
12035 Attaching lineno to buckets is stupid, since only one copy of each
12036 symbol is kept, only the line of the first occurrence is kept too.
12037
12038 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
12039 * src/reader.c (rline_allocated): Remove, unused.
12040 (symbol_list): Have a `line' member.
12041 (symbol_list_new): New.
12042 (readgram): Use it.
12043 * src/print.c (print_grammar): Output the rule line numbers.
12044 * tests/regression.at (Solved SR Conflicts)
12045 (Unresolved SR Conflicts): Adjust.
12046 Reported by Hans Aberg.
12047
a81b1d4a
MA
120482001-11-22 Marc Autret <autret_m@epita.fr>
12049
12050 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
12051
c1ecb3c1
MA
120522001-11-22 Marc Autret <autret_m@epita.fr>
12053
12054 * src/muscle_tab.c (muscle_init): Remove initialization of
12055 skeleton muscle.
12056 * src/output.c (output_master_parser): Do it here.
12057
fbe01355
AD
120582001-11-20 Akim Demaille <akim@epita.fr>
12059
12060 * po/sv.po: New.
12061 * configure.in (ALL_LINGUAS): Adjust.
12062 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
12063 longer contains strings to translate.
12064
81e895c0
AD
120652001-11-19 Akim Demaille <akim@epita.fr>
12066
12067 * src/conflicts.c (conflicts_print): Add a missing \n.
12068
6bb1878b
AD
120692001-11-19 Akim Demaille <akim@epita.fr>
12070
12071 * src/nullable.c (nullable_print): New.
12072 (set_nullable): Call it when tracing.
12073 Better locality of variables.
12074
d9ec2d07
AD
120752001-11-19 Akim Demaille <akim@epita.fr>
12076
12077 * src/print.c (print_actions): Better locality of variables.
12078
720e5c1b
AD
120792001-11-19 Akim Demaille <akim@epita.fr>
12080
12081 * src/derives.c (print_derives): Fix and enrich.
12082 * src/closure.c (print_fderives): Likewise.
12083
fb908786
AD
120842001-11-19 Akim Demaille <akim@epita.fr>
12085
12086 * src/closure.c (itemsetend): Remove, replaced with...
12087 (itemsetsize): new.
12088
125ecb56
AD
120892001-11-19 Akim Demaille <akim@epita.fr>
12090
12091 * src/LR0.c (kernel_end): Remove, replaced with...
12092 (kernel_size): new.
12093
d8cf039f
AD
120942001-11-19 Akim Demaille <akim@epita.fr>
12095
12096 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
12097 to clarify.
12098
7bec0760
AD
120992001-11-19 Akim Demaille <akim@epita.fr>
12100
12101 * src/closure.c (closure): Use arrays instead of pointers to clarify.
12102
c87d4863
AD
121032001-11-19 Akim Demaille <akim@epita.fr>
12104
12105 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
12106 trace messages.
12107 * src/LR0.c: Likewise.
12108 (allocate_itemsets): Use arrays instead of pointers to clarify.
12109
9bfe901c
AD
121102001-11-19 Akim Demaille <akim@epita.fr>
12111
12112 * src/getargs.c (statistics_flag): Replace with...
12113 (trace_flag): New.
12114 (longopts): Accept --trace instead of --statistics.
12115 * src/getargs.h, src/options.c: Adjust.
12116 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
12117 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
12118
97db7bd4
AD
121192001-11-19 Akim Demaille <akim@epita.fr>
12120
cc72668c 12121 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
12122 pointers to clarify the code.
12123 (save_reductions, save_shifts): Factor common parts of alternatives.
12124
2c5f66ed
AD
121252001-11-19 Akim Demaille <akim@epita.fr>
12126
12127 * src/LR0.c (new_state, get_state): Complete TRACE code.
12128 * src/closure.c: Include `reader.h' to get `tags', needed by the
12129 trace code.
12130 Rename the conditional DEBUG as TRACE.
12131 Output consistently TRACEs to stderr, not stdout.
12132 * src/derives.c: Likewise.
12133 * src/reduce.c: (inaccessable_symbols): Using if is better style
12134 than goto.
12135 Use `#if TRACE' instead of `#if 0' for tracing code.
12136
300f275f
AD
121372001-11-19 Akim Demaille <akim@epita.fr>
12138
12139 * src/system.h (LIST_FREE, shortcpy): New.
12140 * src/LR0.c: Use them.
12141 * src/output.c (free_itemsets, free_reductions, free_shifts):
12142 Remove, replaced by LIST_FREE.
12143
f59c437a
AD
121442001-11-19 Akim Demaille <akim@epita.fr>
12145
12146 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
12147 (REDUCTIONS_ALLOC): New.
12148 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
12149 allocation.
12150
6986fd9e
AD
121512001-11-19 Akim Demaille <akim@epita.fr>
12152
12153 * src/LR0.c (new_state): Complete trace code.
12154 * src/nullable.c (set_nullable): Don't translate traces.
12155
4bc30f78
AD
121562001-11-19 Akim Demaille <akim@epita.fr>
12157
12158 * src/print_graph.c (print_core): Better locality of variables.
12159 * src/print.c (print_core): Likewise.
12160
08a946e0
AD
121612001-11-19 Akim Demaille <akim@epita.fr>
12162
12163 * src/vcg.c: You do the output, so you are responsible of the
12164 handling of VCG syntax, in particular: use quotearg.
12165 * src/print_graph.c: Don't.
12166 (print_actions): Don't output the actions as part of the nodes,
12167 since that's the job of the edges.
12168 (print_state): Don't output by hand: fill the node description,
9bfe901c 12169 and ask for its output.
08a946e0 12170
f0473484
AD
121712001-11-19 Akim Demaille <akim@epita.fr>
12172
cc72668c
AD
12173 * src/bison.simple (yyparse): When verbosely reporting an error,
12174 no longer put additional quotes around token names.
f0473484
AD
12175 * tests/calc.at: Adjust.
12176
e41dc700
AD
121772001-11-19 Akim Demaille <akim@epita.fr>
12178
12179 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
12180 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
12181 * src/output.c: Adjust.
12182
652a871c
AD
121832001-11-19 Akim Demaille <akim@epita.fr>
12184
12185 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
12186 (rule_t): this.
12187 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
12188
b2ed6e58
AD
121892001-11-19 Akim Demaille <akim@epita.fr>
12190
12191 * src/gram.h (rule_t): New.
12192 (rule_table): New.
12193 (rrhs, rlhs): Remove, part of state_t.
12194 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
12195 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12196 * src/reader.c, src/reduce.c: Adjust.
12197
edad7067
AD
121982001-11-19 Akim Demaille <akim@epita.fr>
12199
12200 * src/reader.c (symbols_output): New, extracted from...
12201 (packsymbols): Here.
12202 (reader): Call it.
12203
3feec034
AD
122042001-11-19 Akim Demaille <akim@epita.fr>
12205
12206 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
12207 (maxrhs): this new function.
12208
ddcd5fdf
AD
122092001-11-19 Akim Demaille <akim@epita.fr>
12210
cc72668c 12211 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
12212 Adjust.
12213
bb527fc2
AD
122142001-11-19 Akim Demaille <akim@epita.fr>
12215
cc72668c 12216 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
12217 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12218 * src/lalr.c: Adjust.
12219
a845a697
AD
122202001-11-19 Akim Demaille <akim@epita.fr>
12221
12222 * src/lalr.c (initialize_LA): Only initialize LA. Let...
12223 (set_state_table): handle the `lookaheads' members.
12224
f004bf6a
AD
122252001-11-19 Akim Demaille <akim@epita.fr>
12226
cc72668c
AD
12227 * src/lalr.h (lookaheads): Removed array, whose contents is now
12228 a member of...
f004bf6a
AD
12229 (state_t): this structure.
12230 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12231 Adjust.
12232
de326cc0
AD
122332001-11-19 Akim Demaille <akim@epita.fr>
12234
cc72668c
AD
12235 * src/lalr.h (consistent): Removed array, whose contents is now
12236 a member of...
de326cc0
AD
12237 (state_t): this structure.
12238 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12239 Adjust.
12240
90b4416b
AD
122412001-11-19 Akim Demaille <akim@epita.fr>
12242
cc72668c
AD
12243 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
12244 contents are now members of...
90b4416b
AD
12245 (state_t): this structure.
12246 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
12247 Adjust.
12248
9703cc49
AD
122492001-11-19 Akim Demaille <akim@epita.fr>
12250
12251 * src/lalr.h (state_t): New.
12252 (state_table): Be a state_t * instead of a core **.
12253 (accessing_symbol): Remove, part of state_t.
12254 * src/lalr.c: Adjust.
12255 (set_accessing_symbol): Merge into...
12256 (set_state_table): this.
12257 * src/print_graph.c, src/conflicts.c: Adjust.
12258
d803322e
AD
122592001-11-14 Akim Demaille <akim@epita.fr>
12260
12261 * tests/calc.at, tests/output.at, tests/regression.at,
12262 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
12263 now the tests are run in private dirs, therefore AC_CLEANUP and
12264 family can be simplified to 0-ary.
12265 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
12266 use abs. path to find config.h.
12267 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
12268 stderr, there can be way too much random noise.
12269 Instead pass -Werror to GCC and rely on the exit status.
12270 Reported by Wolfram Wagner.
12271
3d76b07d
AD
122722001-11-14 Akim Demaille <akim@epita.fr>
12273
12274 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
12275 defined only if yyoverflow is defined, to avoid `warning: unused
12276 variable `yyvs1''.
12277 Reported by The Test Suite.
12278
09b503c8
AD
122792001-11-14 Akim Demaille <akim@epita.fr>
12280
12281 * src/print.c: Include reduce.h.
12282 Reported by Hans Aberg.
12283
122842001-11-14 Akim Demaille <akim@epita.fr>
12285
12286 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
12287 Revert a previous patch: these are really const.
12288 * src/conflicts.c (conflict_report): Additional useless pair of
12289 braces to pacify GCC's warnings for `if () if () {} else {}'.
12290 * src/lex.c (parse_percent_token): Replace equal_offset with
12291 arg_offset.
12292 arg is const.
12293 Be sure to strdup `arg' when used, since there is no reason for
12294 token_buffer not to change.
12295
0f37a994
AD
122962001-11-14 Akim Demaille <akim@epita.fr>
12297
12298 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
12299 definition.
12300 * src/main.c (main): Use them.
12301 Suggested by Hans Aberg.
12302
d39d93b8
AD
123032001-11-12 Akim Demaille <akim@epita.fr>
12304
12305 * src/system.h (ngettext): Now that we use ngettext, be sure to
12306 provide a default definition when NLS are not used.
12307
9edcd895
AD
123082001-11-12 Akim Demaille <akim@epita.fr>
12309
12310 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
12311 Use @kbd to denote user input.
12312 (Language and Grammar): ANSIfy the example.
12313 Adjust its layout for info/notinfo.
12314 (Location Tracking Calc): Output error messages to stderr.
12315 Output locations in a more GNUtically correct way.
12316 Fix a couple of Englishos.
12317 Adjust @group/@end group pairs.
12318
7da99ede
AD
123192001-11-12 Akim Demaille <akim@epita.fr>
12320
e3aa65c5 12321 %expect was not functioning at all.
7da99ede
AD
12322
12323 * src/conflicts.c (expected_conflicts): Set to -1.
12324 (conflict_report): Use ngettext.
12325 (conflicts_print): Check %expect and make its violation an error.
12326 * doc/bison.texinfo (Expect Decl): Adjust.
12327 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
12328 * tests/regression.at (%expect not enough, %expect right)
12329 (%expect too much): New.
12330
ba9dda1a
AD
123312001-11-12 Akim Demaille <akim@epita.fr>
12332
12333 * tests/regression.at (Conflicts): Rename as...
12334 (Unresolved SR Conflicts): this.
12335 (Solved SR Conflicts): New.
12336
337c5bd1
AD
123372001-11-12 Akim Demaille <akim@epita.fr>
12338
12339 * src/reduce.c (print_results): Rename as...
12340 (reduce_output): This.
12341 Output to OUT, passed as argument, instead of output_obstack.
12342 (dump_grammar): Likewise.
12343 (reduce_free): New.
12344 Also free V1.
12345 (reduce_grammar): No longer call reduce_output, since...
12346 * src/print.c (print_results): do it.
12347 * src/main.c (main): Call reduce_free;
12348
c73a41af
AD
123492001-11-12 Akim Demaille <akim@epita.fr>
12350
12351 * src/conflicts.c (print_reductions): Accept OUT as argument.
12352 Output to it, not to output_obstack.
12353 * src/print.c (print_actions): Adjust.
12354
0df87bb6
AD
123552001-11-12 Akim Demaille <akim@epita.fr>
12356
12357 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
12358 the result instead of using...
12359 (src_total, rrc_total, src_count, rrc_count): Remove.
12360 (any_conflicts): Remove.
12361 (print_conflicts): Split into...
12362 (conflicts_print, conflicts_output): New.
12363 * src/conflicts.h: Adjust.
12364 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 12365 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
12366 * tests/regression.at (Conflicts): New.
12367 Reported by Tom Lane.
12368
e4d3d4de
AD
123692001-11-12 Akim Demaille <akim@epita.fr>
12370
12371 * tests/regression.at (Invalid input): Remove, duplicate with
12372 ``Invalid input: 1''.
12373
6d7d248e
AD
123742001-11-12 Akim Demaille <akim@epita.fr>
12375
12376 * tests/torture.at (AT_DATA_STACK_TORTURE)
12377 (Exploding the Stack Size with Alloca)
12378 (Exploding the Stack Size with Malloc): New.
12379
e9e4c321
AD
123802001-11-12 Akim Demaille <akim@epita.fr>
12381
12382 * src/bison.simple (YYSTACK_REALLOC): New.
12383 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 12384 Reported by Per Allansson.
e9e4c321 12385
5f7e0832
AD
123862001-11-12 Pascal Bart <pascal.bart@epita.fr>
12387
12388 * src/bison.simple: Define type yystype instead of YYSTYPE, and
12389 define CPP macro, which substitute YYSTYPE by yystype.
12390 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
12391 with yyltype/YYLTYPE. This allows inclusion of the generated
12392 header within the parser if the compiler, such as GGC, accepts
12393 multiple equivalent #defines.
12394 From Akim.
12395
e3f1699f
AD
123962001-11-05 Akim Demaille <akim@epita.fr>
12397
12398 * src/reader.c (symbols_output): New, extracted from...
12399 (packsymbols): here.
12400 (reader): Adjust.
12401
65be0866
AD
124022001-11-05 Akim Demaille <akim@epita.fr>
12403
12404 * src/lex.c (parse_percent_token): s/quotearg/quote/.
12405
e4d910bf
AD
124062001-11-05 Akim Demaille <akim@epita.fr>
12407
12408 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
12409 pattern.
12410
951366c1
AD
124112001-11-05 Akim Demaille <akim@epita.fr>
12412
12413 * src/options.h (struct option_table_struct): set_flags is void*.
12414 * src/options.c (longopts): Support `--output' and `%output'.
12415 (usage): Adjust.
12416 * src/lex.h (tok_setopt): Remove, replaced with...
12417 (tok_intopt, tok_stropt): these new guys.
12418 * src/lex.c (getopt.h): Not needed.
12419 (token_buffer, unlexed_token_buffer): Not const.
12420 (percent_table): Promote `-' over `_' in directive names.
12421 Active `%name-prefix', `file-prefix', and `output'.
12422 (parse_percent_token): Accept possible arguments to directives.
12423 Promote `-' over `_' in directive names.
12424
d8988b2f
AD
124252001-11-04 Akim Demaille <akim@epita.fr>
12426
12427 * doc/bison.texinfo (Decl Summary): Split the list into
12428 `directives for grammars' and `directives for bison'.
12429 Sort'em.
12430 Add description of `%name-prefix', `file-prefix', and `output'.
12431 Promote `-' over `_' in directive names.
12432 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
12433 Simplify the description of `--name-prefix'.
12434 Promote `-' over `_' in directive names.
12435 Promote `--output' over `--output-file'.
12436 Fix the description of `--defines'.
12437 * tests/output.at: Exercise %file-prefix and %output.
12438
6468d18e
AD
124392001-11-02 Akim Demaille <akim@epita.fr>
12440
12441 * doc/refcard.tex: Update.
12442
6b7e85b9
AD
124432001-11-02 Akim Demaille <akim@epita.fr>
12444
12445 * src/symtab.h (SUNDEF): New.
12446 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
12447 stand for `uninitialized', instead of 0.
12448 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
12449 * src/lex.c (lex): Adjust.
12450
12451 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
12452 Number it 0.
12453 Let yylex return it instead of a plain 0.
12454 Reported by Dick Streefland.
12455
cd5aafcf
AD
124562001-11-02 Akim Demaille <akim@epita.fr>
12457
12458 * tests/regression.at (Mixing %token styles): New test.
12459
037ca2f1
AD
124602001-11-02 Akim Demaille <akim@epita.fr>
12461
12462 * src/reader.c (parse_thong_decl): Formatting changes.
12463 (token_translations_init): New, extracted from...
12464 (packsymbols): Here.
12465 Adjust.
12466
270a173c
AD
124672001-11-01 Akim Demaille <akim@epita.fr>
12468
12469 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
12470 Check that `9foo.y' produces correct cpp guards.
12471 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
12472 guards.
12473 Reported by Wwp.
12474
561f9a30
AD
124752001-11-01 Akim Demaille <akim@epita.fr>
12476
12477 * tests/regression.at (Invalid input: 2): New.
12478 * src/lex.c (unlexed_token_buffer): New.
12479 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
12480 too.
12481 Reported by Wwp.
12482
f987e9d2
AD
124832001-11-01 Akim Demaille <akim@epita.fr>
12484
12485 * tests/calc.at: Catch up with 1.30.
12486 * configure.in: Bump to 1.49a.
12487 Adjust to newer Autotest.
12488
0846f581
PB
124892001-10-19 Pascal Bart <pascal.bart@epita.fr>
12490
12491 * src/conflicts.c: Move global variables rrc_total and src_total ...
12492 (print_conflicts): here.
12493 * src/output.c (output): Free global variable user_toknums.
12494 * src/lex.c (token_obstack): Become static.
12495
3c1a79b3
AD
124962001-10-18 Akim Demaille <akim@epita.fr>
12497
12498 * tests/atlocal.in (GCC): Add.
12499 * tests/calc.at: s/m4_match/m4_bmatch/.
12500 s/m4_patsubst/m4_bpatsubst/.
12501 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
12502 * configure.in: AC_SUBST(GCC).
12503
5d52e7d0
MA
125042001-10-14 Marc Autret <autret_m@epita.fr>
12505
12506 * src/options.c (create_long_option_table): Fix.
12507
631aa1d3
AD
125082001-10-10 Akim Demaille <akim@epita.fr>
12509
12510 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
12511
f6ec6d13
AD
125122001-10-04 Akim Demaille <akim@epita.fr>
12513
12514 * src/reader.c (parse_union_decl): Push the caracters in
12515 union_obstack, not attrs_obstack.
12516
342b8b6e
AD
125172001-10-04 Akim Demaille <akim@epita.fr>
12518
12519 Merge in the branch 1.29.
12520
12521 * src/reader.c (packsymbols): Use a temporary obstack for
12522 `%%tokendef', since output_stack is already used elsewhere.
12523
12524 2001-10-02 Akim Demaille <akim@epita.fr>
12525
12526 Bump 1.29d.
12527
12528 2001-10-02 Akim Demaille <akim@epita.fr>
12529
12530 Version 1.29c.
12531
12532 2001-10-02 Akim Demaille <akim@epita.fr>
12533
12534 * tests/regression.at (Invalid CPP headers): New.
12535 From Alexander Belopolsky.
12536 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
12537
12538 2001-10-02 Akim Demaille <akim@epita.fr>
12539
12540 * tests/regression.at (Invalid input): New.
12541 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
12542 Reported by Shura.
12543
12544 2001-10-02 Akim Demaille <akim@epita.fr>
12545
12546 * tests/calc.at: Now that --debug works, the tests must be adjusted.
12547
12548 2001-10-02 Akim Demaille <akim@epita.fr>
12549
12550 * src/output.c (output_parser): Assert `skeleton'.
12551 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
12552 systems.
12553 From Shura.
12554
12555 2001-10-01 Marc Autret <autret_m@epita.fr>
12556
12557 * src/lex.h: Echo modifications.
12558 * src/lex.c (unlex): Parameter is now token_t.
12559 From Hans Aberg.
12560
12561 2001-10-01 Marc Autret <autret_m@epita.fr>
12562
12563 * src/main.c: Include lex.h.
12564 From Hans Aberg.
12565
12566 2001-09-29 Akim Demaille <akim@epita.fr>
12567
12568 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
12569
12570 2001-09-28 Akim Demaille <akim@epita.fr>
12571
12572 * tests/testsuite.at: Update to newer Autotest.
12573 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
12574
12575 2001-09-27 Akim Demaille <akim@epita.fr>
12576
12577 Position independent wrapper.
12578
12579 * tests/bison: Remove.
12580 * tests/bison.in: New.
12581 * configure.in: Adjust.
12582
12583 2001-09-27 Paul Eggert <eggert@twinsun.com>
12584
12585 Port quotearg fixes from tar 1.13.24.
12586
12587 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
12588 tm to be declared.
12589 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
12590 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
12591
12592 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
12593 * m4/mbrtowc.m4: New file.
12594 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
12595 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
12596
12597 2001-09-27 Akim Demaille <akim@epita.fr>
12598
12599 Bump to 1.29c.
12600
12601 2001-09-27 Akim Demaille <akim@epita.fr>
12602
12603 Version 1.29b.
12604
12605 2001-09-25 Akim Demaille <akim@epita.fr>
12606
12607 * src/system.h: Include `xalloc.h'.
12608 Remove it from the C files.
12609 * src/files.c (output_files): Free the obstacks.
12610 * src/lex.c (init_lex): Rename as...
12611 (lex_init): this.
12612 (lex_free): New.
12613 * src/main.c (main): Use it.
12614
12615 2001-09-24 Marc Autret <autret_m@epita.fr>
12616
12617 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
12618 to output informations in fout (FILE*).
12619 (open_graph, close_graph): Likewise.
12620 (output_graph, output_edge, output_node): Likewise.
12621 * src/vcg.h: Update function prototypes.
12622 * src/print_graph.c (print_graph): Open output graph file.
12623 (print_actions): Adjust.
12624 * src/files.h: Remove extern declaration.
12625 * src/files.c: Remove graph_obstack declaration.
12626 (open_files): Remove graph_obstack initialization.
12627 (output_files): Remove graph_obstack saving.
12628
12629 2001-09-24 Marc Autret <autret_m@epita.fr>
12630
12631 * src/files.c (compute_output_file_names): Fix.
12632
12633 2001-09-24 Marc Autret <autret_m@epita.fr>,
12634 Akim Demaille <akim@epita.fr>
12635
12636 * src/reader.c (reader): Remove call to free_symtab ().
12637 * src/main.c (main): Call it here.
12638 Include symtab.h.
12639 * src/conflicts.c (initialize_conflicts): Rename as...
12640 (solve_conflicts): this.
12641 * src/print.c (print_core, print_actions, print_state)
12642 (print_grammar): Dump to a file instead a `output_obstack'.
12643 (print_results): Dump `output_obstack', and then proceed with the
12644 FILE *.
12645 * src/files.c (compute_output_file_names, close_files): New.
12646 (output_files): Adjust.
12647 * src/main.c (main): Adjust.
12648
12649 2001-09-23 Marc Autret <autret_m@epita.fr>
12650
12651 * src/files.c (compute_header_macro): Computes header macro name
12652 from spec_defines_file when given.
12653
12654 2001-09-23 Marc Autret <autret_m@epita.fr>
12655
12656 * src/files.c (output_files): Add default extensions.
12657
12658 2001-09-22 Akim Demaille <akim@epita.fr>
12659
12660 * src/conflicts.c (finalize_conflicts): Rename as...
12661 (free_conflicts): this.
12662
12663 2001-09-22 Akim Demaille <akim@epita.fr>
12664
12665 * src/gram.c (gram_free): Rename back as...
12666 (dummy): this.
12667 (output_token_translations): Free `token_translations'.
12668 * src/symtab.c (free_symtab): Free the tag field.
12669
12670 2001-09-22 Akim Demaille <akim@epita.fr>
12671
12672 Remove `translations' as it is always set to true.
12673
12674 * src/gram.h: Adjust.
12675 * src/reader.c (packsymbols, parse_token_decl): Adjust
12676 * src/print.c (print_grammar): Adjust.
12677 * src/output.c (output_token_translations): Adjust.
12678 * src/lex.c (lex): Adjust.
12679 * src/gram.c: Be sure the set pointers to NULL.
12680 (dummy): Rename as...
12681 (gram_free): this.
12682
12683 2001-09-22 Akim Demaille <akim@epita.fr>
12684
12685 * configure.in: Invoke AM_LIB_DMALLOC.
12686 * src/system.h: Use dmalloc.
12687 * src/LR0.c: Be sure to have pointers initialized to NULL.
12688 (allocate_itemsets): Allocate kernel_items only if needed.
12689
12690 2001-09-22 Akim Demaille <akim@epita.fr>
12691
12692 * configure.in: Bump to 1.29b.
12693 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
12694 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
12695 need xmalloc.c in calc.y.
12696 From Pascal Bart.
12697
12698 2001-09-21 Akim Demaille <akim@epita.fr>
12699
12700 Version 1.29a.
12701 * Makefile.maint, config/config.guess, config/config.sub,
12702 * config/missing: Update from masters.
12703 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
12704 upon package.m4.
12705 * configure.in (ALL_LINGUAS): Add `tr'.
12706
12707 2001-09-21 Akim Demaille <akim@epita.fr>
12708
12709 * tests/Makefile.am (package.m4): Move to...
12710 ($(srcdir)/$(TESTSUITE)): here.
12711
12712 2001-09-20 Akim Demaille <akim@epita.fr>
12713
12714 * src/complain.c: No longer try to be standalone: use system.h.
12715 Don't assume __STDC__ is defined to 1. Just test if it is defined.
12716 * src/complain.h: Likewise.
12717 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
12718 Remove the unused variable `n'.
12719 From Albert Chin-A-Young.
12720
12721 2001-09-18 Marc Autret <autret_m@epita.fr>
12722
12723 * doc/bison.1: Update.
12724 * doc/bison.texinfo (Bison Options): Update --defines and --graph
12725 descriptions.
12726 (Option Cross Key): Update.
12727 Add --graph.
12728
12729 2001-09-18 Marc Autret <autret_m@epita.fr>
12730
12731 * tests/regression.at: New test (comment in %union).
12732
12733 2001-09-18 Marc Autret <autret_m@epita.fr>
12734
12735 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
12736 do that.
12737 Reported by Keith Browne.
12738
12739 2001-09-18 Marc Autret <autret_m@epita.fr>
12740
12741 * tests/output.at: Add tests for --defines and --graph.
12742
12743 2001-09-18 Marc Autret <autret_m@epita.fr>
12744
12745 * tests/output.at: Removes tests of %{header,src}_extension features.
12746
12747 2001-09-18 Akim Demaille <akim@epita.fr>
12748
12749 * tests/Makefile.am (package.m4): New.
12750 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
12751 (_AT_CHECK_CALC_ERROR): Likewise.
12752 Factor the `, ' part of verbose error messages.
12753
12754 2001-09-18 Marc Autret <autret_m@epita.fr>
12755
12756 * src/getargs.c (longopts): Declare --defines and --graph as options
12757 with optional arguments.
12758 * src/files.h: Add extern declarations.
12759 * src/files.c (spec_graph_file, spec_defines_file): New.
12760 (output_files): Update.
12761 Remove CPP-outed code.
12762
12763 2001-09-18 Marc Autret <autret_m@epita.fr>
12764
12765 Turn off %{source,header}_extension feature.
12766
12767 * src/files.c (compute_exts_from_gf): Update.
12768 (compute_exts_from_src): Update.
12769 (output_files): CPP-out useless code.
12770 * src/files.h: Remove {header,source}_extension extern declarations.
12771 * src/reader.c (parse_dquoted_param): CPP-out.
12772 (parse_header_extension_decl): Remove.
12773 (parse_source_extension_decl): Remove.
12774 (read_declarations): Remove cases tok_{hdrext,srcext}.
12775 * src/lex.c (percent_table): Remove {header,source}_extension entries.
12776 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
12777
12778 2001-09-10 Akim Demaille <akim@epita.fr>
12779
12780 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
12781 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
12782 (AT_CHECK_OUTPUT): this.
12783 Merely check ls' exit status, its output is useless.
12784
12785 2001-09-10 Akim Demaille <akim@epita.fr>
12786
12787 * tests/calc.at: Use m4_match.
12788 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
12789
12790 2001-09-10 Marc Autret <autret_m@epita.fr>,
12791 Akim Demaille <akim@epita.fr>
12792
12793 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
12794 enum color_e.
12795 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
12796 to `normal'.
12797 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
12798 * src/lex.h: Adjust prototype.
12799 (token_t): Add `tok_undef'.
12800 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
12801 (parse_percent_token): Now returns token_t.
12802 Add default statement in switch.
12803 (lex): Separate `c' as an input variable, from the token_t result
12804 part.
12805 (unlexed): Is a token_t.
12806
12807 2001-09-10 Akim Demaille <akim@epita.fr>
12808
12809 * configure.in: Bump to 1.29a.
12810
12811 2001-09-07 Akim Demaille <akim@epita.fr>
12812
12813 Version 1.29.
12814
12815 2001-08-30 Akim Demaille <akim@epita.fr>
12816
12817 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
12818 * m4/atconfig.m4: Remove.
12819 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
12820 * tests/bison: New.
12821 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
12822 m4_if, m4_patsubst, and m4_regexp.
12823 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
12824 `input' file instead of echo.
12825
12826 2001-08-29 Akim Demaille <akim@epita.fr>
12827
12828 Bump to 1.28e.
12829
12830 2001-08-29 Akim Demaille <akim@epita.fr>
12831
12832 Version 1.28d.
12833
12834 2001-08-29 Paul Eggert <eggert@twinsun.com>
12835
12836 * src/bison.simple (yyparse): Don't take the address of an
12837 item before the start of an array, as that doesn't conform to
12838 the C Standard.
12839
12840 2001-08-29 Robert Anisko <anisko_r@epita.fr>
12841
12842 * doc/bison.texinfo (Location Tracking Calc): New node.
12843
12844 2001-08-29 Paul Eggert <eggert@twinsun.com>
12845
12846 * src/output.c (output): Do not define const, as this now
12847 causes more problems than it cures.
12848
12849 2001-08-29 Akim Demaille <akim@epita.fr>
12850
12851 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
12852 the nodes.
12853 Be sure to tag the `detailmenu'.
12854
12855 2001-08-29 Akim Demaille <akim@epita.fr>
12856
12857 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
12858 download in a tmp dir.
12859
12860 2001-08-28 Marc Autret <autret_m@epita.fr>
12861
12862 * config/depcomp: New file.
12863
12864 2001-08-28 Marc Autret <autret_m@epita.fr>
12865
12866 * doc/bison.1 (mandoc): Adjust.
12867 From Juan Manuel Guerrero.
12868
12869 2001-08-28 Marc Autret <autret_m@epita.fr>
12870
12871 * src/print_graph.c (print_state): Fix.
12872
12873 2001-08-27 Marc Autret <autret_m@epita.fr>
12874
12875 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
12876 char * members.
12877 Echo modifications to the functions prototypes.
12878 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
12879
12880 2001-08-27 Marc Autret <autret_m@epita.fr>
12881
12882 * src/vcg.c: Include `xalloc.h'.
12883 (add_colorentry): New.
12884 (add_classname): New.
12885 (add_infoname): New.
12886 * src/vcg.h: Add new prototypes.
12887
12888 2001-08-27 Akim Demaille <akim@epita.fr>
12889
12890 * Makefile.maint: Sync. again with CVS Autoconf.
12891
12892 2001-08-27 Akim Demaille <akim@epita.fr>
12893
12894 * Makefile.maint: Formatting changes.
12895 (po-update, cvs-update, update): New targets.
12896 (AMTAR): Remove.
12897
12898 2001-08-27 Akim Demaille <akim@epita.fr>
12899
12900 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
12901 * Makefile.maint: Sync. with CVS Autoconf.
12902
12903 2001-08-27 Marc Autret <autret_m@epita.fr>
12904
12905 * src/vcg.h (struct infoname_s): New.
12906 (struct colorentry_s): New.
12907 (graph_s): New fields {vertical,horizontal}_order in structure.
12908 Add `infoname' field.
12909 Add `colorentry' field;
12910 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
12911 (G_HORIZONTAL_ORDER): New.
12912 (G_INFONAME): New.
12913 (G_COLORENTRY): New.
12914 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
12915 Add output of `infoname'.
12916 Add output of `colorentry'.
12917
12918 2001-08-27 Marc Autret <autret_m@epita.fr>
12919
12920 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
12921 This one shadowed a global parameter.
12922
12923 2001-08-24 Marc Autret <autret_m@epita.fr>
12924
12925 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
12926 instead of `unsigned'.
12927 (print_state): Do not call obstack_object_size () in obstack_grow ()
12928 to avoid macro variables shadowing.
12929
12930 2001-08-23 Marc Autret <autret_m@epita.fr>
12931
12932 * src/lex.c (percent_table): Typo: s/naem/name/.
12933 Add graph option.
12934 Normalize new options declarations.
12935
12936 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
12937
12938 * tests/suite.at: Exercise %header_extension and %source_extension.
12939
12940 2001-08-16 Marc Autret <autret_m@epita.fr>
12941
12942 * src/reader.c (parse_dquoted_param): New.
12943 (parse_header_extension_decl): Use it.
12944 (parse_source_extension_decl): Likewise.
12945
12946 2001-08-16 Marc Autret <autret_m@epita.fr>
12947
12948 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
12949 (get_xxxx_str): Use assert () instead of complain ().
12950 Remove return invokations in default cases.
12951 (get_decision_str): Modify default behaviour. Remove second argument.
12952 Echo modifications on calls.
12953 (output_graph): Fix.
12954
12955 2001-08-16 Marc Autret <autret_m@epita.fr>
12956
12957 * src/getargs.c (usage): Update with ``-g, --graph''.
12958
12959 2001-08-16 Marc Autret <autret_m@epita.fr>
12960
12961 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
12962 (Option Cross Key): Likewise.
12963 * doc/bison.1: Update.
12964
1c8c2190
PB
129652001-09-25 Pascal Bart <pascal.bart@epita.fr>
12966
12967 * src/output.c (output_master_parser): Don't finish action_obstack.
12968 (output_parser): Don't care about the muscle action, here.
12969 (prepare): Copy the action_obstack in the action muscle.
12970 (output): Free action_obstack.
12971
180d45ba
PB
129722001-09-23 Pascal Bart <pascal.bart@epita.fr>
12973
12974 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
12975 will contain `%union' declaration.
12976 (parse_union_decl): Delete #line directive output.
12977 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
12978 informations about %union.
12979 (parse_union_decl): Copy the union_obstack in the muscle stype.
12980 * src/bison.simple: Add new #line directive.
12981 Add typdef %%stype YYSTYPE.
12982
c51d1a19
PB
129832001-09-23 Pascal Bart <pascal.bart@epita.fr>
12984
12985 * src/bison.simple: Add new `#line' directive.
12986
6f9344da
PB
129872001-09-22 Pascal Bart <pascal.bart@epita.fr>
12988
12989 * src/bison.simple: New `#line' directive.
12990 * src/output.c (output_parser): Support new dynamic muscle input_line.
12991
652def80
MA
129922001-09-22 Marc Autret <autret_m@epita.fr>
12993
12994 * src/output.c (output_master_parser): New.
12995 (output_parser): Be more re-entrant.
12996
25b222fa
MA
129972001-09-21 Marc Autret <autret_m@epita.fr>
12998
12999 * src/reader.c (copy_definition, parse_union_decl): Update and use
13000 `linef' muscle.
13001 (copy_action): Likewise.
13002 Use obstack_1grow ().
13003 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
13004
6bc35ae5
MA
130052001-09-21 Marc Autret <autret_m@epita.fr>
13006
13007 * src/options.c (option_table): Adjust.
13008 * src/lex.c (parse_percent_token): Fix.
13009
c0629aa1
PB
130102001-09-20 Pascal Bart <pascal.bart@epita.fr>
13011
13012 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 13013
82b6d266
PB
130142001-09-20 Pascal Bart <pascal.bart@epita.fr>
13015
13016 * src/lex.c (parse_percent_token): Change type of variable `tx', which
13017 is now an option_table_struct*.
13018 (option_strcmp): New function option_strcmp.
13019 (parse_percent_token): Call option_strcmp.
13020 * src/getargs.c (xalloc.h, options.h): Include it.
13021 (getargs): Call create_long_option_table.
13022 (getargs): Free longopts at the end of the function.
13023 (shortopts): Move in options.c.
13024 * src/options.c (create_long_option_table): New function. Convert
13025 information from option_table to option structure.
13026 * src/reader.c (options.h): Include it.
13027
13028 * src/Makefile.am: Adjust.
13029 * src/options.c (option_table): Create from longopts and percent_table.
13030 * src/getargs.c (longopts): Delete.
13031 * src/lex.c (struct percent_table_struct): Delete.
13032 (percent_table): Delete.
13033 (options.h): Include it.
13034 * src/options.c: Create.
13035 * src/options.h: Create.
13036 Declare enum opt_access_e.
13037 Define struct option_table_struct.
13038
75f5aaea
MA
130392001-09-20 Marc Autret <autret_m@epita.fr>
13040
13041 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
13042 sections of Bison.
13043
f508cb0a
PB
130442001-09-19 Pascal Bart <pascal.bart@epita.fr>
13045
13046 * src/bison.simple: s/%%filename/%%skeleton.
13047 * src/muscle_tab.c (getargs.h): Include it.
13048 (muscle_init): Insert new muscle skeleton.
13049
13105fc1
PB
130502001-09-18 Pascal Bart <pascal.bart@epita.fr>
13051
13052 * src/output.c (output_parser): Delete unused variable actions_dumped.
13053
b0c4483e
PB
130542001-09-07 Pascal Bart <pascal.bart@epita.fr>
13055
13056 * src/output.c (output): Delete call to reader_output_yylsp.
13057 * src/reader.c (reader): Likewise.
ba0fe3c7 13058 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 13059
11d82f03
MA
130602001-09-02 Marc Autret <autret_m@epita.fr>
13061
13062 * src/reader.c: Include muscle_tab.h.
13063 (parse_union_decl): Update.
13064 (parse_macro_decl): Rename parse_muscle_decl.
13065 Update to use renamed functions and variable.
13066 (read_declarations, copy_action, read_additionnal_code, : Updated
13067 with correct variables and functions names.
13068 (packsymbols, reader): Likewise.
342b8b6e 13069
11d82f03 13070 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 13071
11d82f03
MA
13072 * src/output.c: Include muscle_tab.h
13073 In all functions using macro_insert, change by using muscle_insert ().
13074 (macro_obstack): Rename muscle_obstack.
13075 Echo modifications in the whole file.
13076 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
13077 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
13078 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
13079
13080 * src/muscle_tab.h: Update double inclusion macros.
13081 (macro_entry_s): Rename muscle_entry_s.
13082 Update prototypes.
342b8b6e 13083
11d82f03
MA
13084 * src/muscle_tab.c: Include muscle_tab.h.
13085 Rename macro_tabble to muscle_table.
13086 (mhash1, mhash2, mcmp): Use muscle_entry.
13087 (macro_init): Rename muscle_init. Update.
13088 (macro_insert): Rename muscle_insert. Update.
13089 (macro_find): Rename muscle_find. Update.
13090
13091 * src/main.c: Include muscle_tab.h.
13092 (main): Call muscle_init ().
13093 * src/Makefile.am (bison_SOURCES): Echo modifications.
13094
93a37297
MA
130952001-09-02 Marc Autret <autret_m@epita.fr>
13096
f753cd62 13097 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 13098
f753cd62
MA
13099 * src/muscle_tab.c, src/muscle_tab.h: Add files.
13100
131012001-09-02 Marc Autret <autret_m@epita.fr>
13102
13103 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 13104
682d48cd
PB
131052001-09-01 Pascal Bart <pascal.bart@epita.fr>
13106
342b8b6e 13107 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
13108 filename.
13109
087c8fda
MA
131102001-09-01 Marc Autret <autret_m@epita.fr>
13111
13112 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
13113 to an explicit value to activate the feature. We do it here.
13114
dda680cb
PB
131152001-08-31 Pascal Bart <pascal.bart@epita.fr>
13116
13117 * src/output.c (prepare): Delete the `filename' muscule insertion.
13118 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
13119 (parse_union_decl): Likewise.
13120 * src/macrotab.c (macro_init): Initialize filename by infile.
13121
9e644e64
MA
131222001-08-31 Marc Autret <autret_m@epita.fr>
13123
13124 * src/bison.simple (YYLSP_NEEDED): New definition.
13125 * src/output.c (prepare): Add macro insertion of `locations_flag'
13126
17da6427
PB
131272001-08-31 Pascal Bart <pascal.bart@epita.fr>
13128
13129 * src/output.c (prepare): Delete insertion of previous muscles,
13130 and insert the `prefix' muscles.
13131 * src/macrotab.c (macro_init): Likewise.
13132 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 13133 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
13134 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
13135 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 13136 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
13137 name_prefix.
13138
e8cb70b9
PB
131392001-08-31 Pascal Bart <pascal.bart@epita.fr>
13140
13141 * src/main.c (main): Standardize.
13142 * src/output.c (output_table_data, output_parser): Likewise.
13143 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
13144
63c2d5de
MA
131452001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
13146
342b8b6e 13147 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
13148 %%epilogue.
13149 * src/output.c (output): Rename %%declarations to %%prologue.
13150 * src/bison.simple: Echo modifications.
342b8b6e 13151
d8cb5183
MA
131522001-08-31 Marc Autret <autret_m@epita.fr>
13153
13154 * src/reader.c (readgram): CleanUp.
13155 (output_token_defines): Likewise.
13156 (packsymbols): Likewise.
13157 (reader): Likewise.
13158 * src/output.c (output): CPP-out useless code.
13159
6c686258
PB
131602001-08-31 Pascal Bart <pascal.bart@epita.fr>
13161
342b8b6e 13162 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
13163 output_trailers and output_headers.
13164 * src/output.h: Remove obsolete functions prototypes of output_headers
13165 and output_trailers.
13166
8f451ef7
PB
131672001-08-30 Pascal Bart <pascal.bart@epita.fr>
13168
13169 * src/main.c: Include macrotab.h.
342b8b6e 13170 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
13171 Adjust functions prototypes.
13172 * src/macrotab.c (macro_insert): Constify key and value.
13173 (macro_find): Constify key.
13174 (macro_insert): Include 'xalloc.h'
13175 (macro_insert): Use XMALLOC.
13176 (macro_find): Constify return value.
13177 * src/output.c (output_table_data): Rename table to table_data.
13178 (output_parser): Constify macro_key, macro_value.
13179
997b6fd0 131802001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
13181
13182 * src/reader.c (parse_skel_decl): New.
342b8b6e 13183 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
13184 * src/lex.h (token_t): New token `tok_skel'.
13185 * src/lex.c (percent_table): Add skeleton option entry.
13186 Standardize.
13187
ff48177d
MA
131882001-08-29 Marc Autret <autret_m@epita.fr>
13189
13190 * src/bison.simple: Add %%user_code directive at the end.
13191 * src/reader.c (read_additionnal_code): New.
13192 (reader): Use it.
13193 * src/output.c (output_program): Remove.
13194 (output): Update.
13195
b33160bf
MA
131962001-08-28 Marc Autret <autret_m@epita.fr>
13197
13198 * src/output.c (output_actions): Clean up.
4e5caae2 13199 (output_gram): CPP-out useless code.
b33160bf
MA
13200 * src/reader.c (reader): Clean up, CPP-out useless code.
13201
d1a2daf7
PB
132022001-08-28 Pascal Bart <pascal.bart@epita.fr>
13203
342b8b6e 13204 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 13205 directive.
d1a2daf7
PB
13206 * src/bison.simple: Add `%%definitions'.
13207
2b763dfe
MA
132082001-08-28 Marc Autret <autret_m@epita.fr>
13209
13210 * config/depcomp: New file.
13211
f1a87ef6
PE
132122001-08-27 Paul Eggert <eggert@twinsun.com>
13213
13214 * src/bison.simple (yyparse): Don't take the address of an
13215 item before the start of an array, as that doesn't conform to
13216 the C Standard.
13217
82e236e2
RA
132182001-08-27 Robert Anisko <robert.anisko@epita.fr>
13219
f1a87ef6 13220 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
13221 obstack. It was done too late here.
13222
13223 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
13224 completely wrong.
13225 (reader): Initialize the macro obstack here, since we need it to grow
13226 '%define' directives.
13227
13228 * src/reader.h: Declare the macro obstack as extern.
13229
b0cfa28a
RA
132302001-08-27 Robert Anisko <robert.anisko@epita.fr>
13231
13232 * src/output.c (output_parser): Fix. Store single '%' characters in
13233 the output obstack instead of throwing them away.
13234
6fc74234
AD
132352001-08-27 Akim Demaille <akim@epita.fr>
13236
13237 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
13238
9c76d118
RA
132392001-08-25 Robert Anisko <robert.anisko@epita.fr>
13240
13241 * lib/Makefile.am: Adjust.
13242
a8289c62
RA
132432001-08-25 Robert Anisko <robert.anisko@epita.fr>
13244
13245 * src/bison.simple: Update and add '%%' directives.
13246
b6610515
RA
132472001-08-25 Robert Anisko <robert.anisko@epita.fr>
13248
13249 * src/reader.c (reader): Remove calls to 'output_headers' and
13250 'output_trailers'. Remove some C output.
13251 (readgram): Disable a piece of code that was writing a default
13252 definition for 'YYSTYPE'.
13253 (reader_output_yylsp): Remove.
13254 (packsymbols): Output token defintions to a macro.
13255 (copy_definition): Disable C output.
6fc74234 13256
b6610515
RA
13257 * src/reader.c (parse_macro_decl): New function used to parse macro
13258 declarations.
13259 (copy_string2): Put the body of copy_string into this new function.
13260 Add a parameter to let the caller choose whether he wants to copy the
13261 string delimiters or not.
13262 (copy_string): Be a simple call to copy_string2 with the last argument
13263 bound to true.
13264 (read_declarations): Add case for macro definition.
13265 (copy_identifier): New.
6fc74234 13266 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
13267 rather than lex.
13268
26f609ff
RA
132692001-08-25 Robert Anisko <robert.anisko@epita.fr>
13270
13271 * src/output.c (prepare): Add prefixed names.
13272 (output_parser): Output semantic actions.
13273 (output_parser): Fix bug on '%%line' directives.
6fc74234 13274
26f609ff
RA
13275 * src/output.c (output_headers): Remove. The C code printed by this
13276 function should now be in the skeletons.
13277 (output_trailers): Remove.
13278 (output): Disable call to 'reader_output_yylsp'.
13279 (output_rule_data): Do not output tables to the table obstack.
13280
13281 * src/output.c: Remove some C dedicated output.
13282 Improve the use of macro and output obstacks.
13283 (output_defines): Remove.
6fc74234 13284
26f609ff
RA
13285 * src/output.c (output_token_translations): Associate 'translate'
13286 table with a macro. No output to the table obstack.
13287 (output_gram): Same for 'rhs' and 'prhs'.
13288 (output_stos): Same for 'stos'.
13289 (output_rule_data): Same for 'r1' and 'r2'.
13290 (token_actions): Same for 'defact'.
13291 (goto_actions): Same for 'defgoto'.
13292 (output_base): Same for 'pact' and 'pgoto'.
13293 (output_table): Same for 'table'.
13294 (output_check): Same for 'check'.
6fc74234 13295
26f609ff
RA
13296 * src/output.c (output_table_data): New function.
13297 (output_short_table): Remove.
13298 (output_short_or_char_table): Remove.
6fc74234 13299
26f609ff
RA
13300 * src/output.c (output_parser): Replace most of the skeleton copy code
13301 with something new. Skeletons are now processed character by character
13302 rather than line by line, and Bison looks for '%%' macros. This is the
13303 first step in making Bison's output process (a lot) more flexible.
13304 (output_parser): Use the macro table.
13305
6f43b113
RA
133062001-08-25 Robert Anisko <robert.anisko@epita.fr>
13307
13308 * src/main.c (main): Initialize the macro table.
13309
dd3127cf
RA
133102001-08-25 Robert Anisko <robert.anisko@epita.fr>
13311
13312 * src/lex.c (percent_table): Add tok_define.
13313 * src/lex.h: Add tok_define.
13314
aa321494
RA
133152001-08-25 Robert Anisko <robert.anisko@epita.fr>
13316
13317 * src/macrotab.c: New file.
13318 * src/macrotab.h: New file.
13319 * src/Makefile.am: Update.
13320
68bd3b6b
RA
133212001-08-25 Robert Anisko <robert.anisko@epita.fr>
13322
13323 * lib/hash.c: New file.
13324 * lib/hash.h: New file.
13325 * lib/Makefile.am: Update.
13326
45f8dd1e
AD
133272001-08-15 Akim Demaille <akim@epita.fr>
13328
13329 Version 1.28c.
13330
40a64a7a 133312001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
13332
13333 * src/reader.c (readgram): Indent output macro YYSTYPE.
13334 (packsymbols): Likewise.
13335 (output_token_defines): Likewise.
13336 * src/files.c: Standardize.
13337 (compute_header_macro): New.
13338 (defines_obstack_save): New. Use compute_header_macro.
13339 (output_files): Update. Use defines_obstack_save.
13340
f9a8293a
AD
133412001-08-15 Akim Demaille <akim@epita.fr>
13342
13343 * doc/bison.texinfo (Table of Symbols): Document
13344 YYSTACK_USE_ALLOCA.
13345
150ca7a7
AD
133462001-08-15 Akim Demaille <akim@epita.fr>
13347
13348 * missing: Update from CVS Automake.
13349 * config/config.guess, config/config.sub, config/texinfo.tex:
13350 Update from gnu.org.
13351
69b5cec4
AD
133522001-08-15 Akim Demaille <akim@epita.fr>
13353
13354 * Makefile.maint: Sync with CVS Autoconf.
13355
f2b5126e
PB
133562001-08-14 Pascal Bart <pascal.bart@epita.fr>
13357
69b5cec4 13358 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
13359 `fdl.texi'.
13360 * doc/fdl.texi: Add to package.
13361
4ecbf796
MA
133622001-08-14 Marc Autret <autret_m@epita.fr>
13363
13364 Turn on %{source,header}_extension features.
13365
69b5cec4 13366 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
13367 source_extension.
13368 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 13369 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
13370 between options.
13371
95fb5662
MA
133722001-08-14 Marc Autret <autret_m@epita.fr>
13373
13374 * src/files.c (compute_base_names): Add extensions computing when
13375 `--file-prefix' used.
13376 Standardize function calls.
13377
78d09da9
MA
133782001-08-13 Marc Autret <autret_m@epita.fr>
13379
69b5cec4 13380 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
13381 defining it (defined but null disables alloca).
13382
5a009f2c
MA
133832001-08-13 Marc Autret <autret_m@epita.fr>
13384
13385 * src/bison.simple (_yy_memcpy): CPP reformat.
13386
1e41465a
PB
133872001-08-13 Pascal Bart <pascal.bart@epita.fr>
13388
13389 * tests/atconfig.in (CPPFLAGS): Fix.
13390
c67a198d
PB
133912001-08-10 Pascal Bart <pascal.bart@epita.fr>
13392
79282c6c 13393 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
13394 `gpl.texi'.
13395 * doc/gpl.texi: Add to package.
13396
09a6de7e
MA
133972001-08-10 Marc Autret <autret_m@epita.fr>
13398
13399 * src/print_graph.h: Fix.
13400 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
13401
b77b9ee0
AD
134022001-08-10 Akim Demaille <akim@epita.fr>
13403
13404 * src/system.h: Provide default declarations for stpcpy, strndup,
13405 and strnlen.
13406
3e259915
MA
134072001-08-10 Robert Anisko <anisko_r@epita.fr>
13408
13409 * doc/bison.texinfo (Locations): Update @$ stuff.
13410
ca96bc2d
MA
134112001-08-09 Robert Anisko <anisko_r@epita.fr>
13412
13413 * src/bison.simple (YYLLOC_DEFAULT): Update.
13414 (yyparse): Adjust.
13415
fdc6758b
MA
134162001-08-08 Marc Autret <autret_m@epita.fr>
13417
b77b9ee0 13418 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
13419 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
13420 Reported by Fabrice Bauzac.
957d4dbf 13421
600cad3b
MA
134222001-08-08 Marc Autret <autret_m@epita.fr>
13423
13424 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
13425 * src/vcg.c (output_node): Fix.
13426 * src/vcg.h: Cleanup.
13427 * src/print_graph.c: Add comments.
b77b9ee0 13428 (node_output_size): New global variable. Simplify the formatting of
600cad3b 13429 the VCG graph output.
b77b9ee0 13430 (print_actions): Unused code is now used. It notifies the final state
600cad3b 13431 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 13432 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
13433 blue.
13434 Get the current node name and node_obstack by argument.
13435 (node_obstack): New variable.
13436 (print_state): Manage node_obstack.
13437 (print_core): Use node_obstack given by argument.
13438 A node is not only computed here but in print_actions also.
13439 (print_graph): CPP out useless code instead of commenting it.
13440
976e528f
AD
134412001-08-07 Pascal Bart <pascal.bart@epita.fr>
13442
13443 * tests/atconfig.in (CPPFLAGS): Fix.
13444
20e8e5ca
AD
134452001-08-07 Akim Demaille <akim@epita.fr>
13446
13447 * src/print_graph.c (quote): New.
13448 (print_core): Use it.
13449
957d4dbf 134502001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 13451
3e3da797
AD
13452 * src/vcg.c (complain.h): Include it.
13453 Unepitaize `return' invocations.
c4b66126 13454 [NDEBUG] (main): Remove.
79282c6c 13455 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
13456 * src/files.c (open_files): Initialize graph_obstack.
13457 * src/print_graph.c (print_actions): CPP out useless code.
13458 (print_core): Don't output the last `\n' in labels.
13459 Use `quote'.
13460 * src/files.c (output_files): Output the VCG file.
13461 * src/main.c (main): Invoke print_graph ();
3e3da797 13462
957d4dbf 134632001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
13464
13465 Automaton VCG graph output.
13466 Using option ``-g'' or long option ``--graph'', you can generate
13467 a gram_filename.vcg file containing a VCG description of the LALR (1)
13468 automaton of your grammar.
13469
13470 * src/main.c: Call to print_graph() function.
13471 * src/getargs.h: Update.
13472 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
13473 (graph_flag): New flag.
13474 (longopts): Update.
13475 (getargs): Add case `g'.
13476 * src/files.c (graph_obstack): New obstack struct.
13477 (open_files): Initialize new obstack.
13478 (output_files): Saves graph_obstack if required.
13479 * src/files.h (graph_obstack): New extern declaration.
13480 * src/Makefile.am: Add new source files.
13481
927c1557 134822001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
13483
13484 * src/print_graph.c, src/print_graph.h (graph): New.
13485 * src/vcg.h: New file.
13486 * src/vcg.c: New file, VCG graph handling.
13487
7333d403
AD
134882001-08-06 Marc Autret <autret_m@epita.fr>
13489
13490 Add of %source_extension and %header_extension which specify
13491 the source or/and the header output file extension.
13492
13493 * src/files.c (compute_base_names): Remove initialisation of
13494 src_extension and header_extension.
13495 (compute_exts_from_gf): Update.
13496 (compute_exts_from_src): Update.
13497 (output_files): Update.
13498 * src/reader.c (parse_header_extension_decl): New.
13499 (parse_source_extension_decl): New.
13500 (read_declarations): New case statements for the new tokens.
13501 * src/lex.c (percent_table): Add entries for %source_extension
13502 and %header_extension.
13503 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
13504
84163231
AD
135052001-08-06 Marc Autret <autret_m@epita.fr>
13506
13507 * configure.in: Bump to 1.28c.
13508 * doc/bison.texinfo: Texinfo thingies.
13509
8303fc42
AD
135102001-08-04 Pascal Bart <pascal.bart@epita.fr>
13511
13512 * tests/atconfig.in (CPPFLAGS): Add.
13513 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
13514
70a84437
AD
135152001-08-03 Akim Demaille <akim@epita.fr>
13516
13517 Version 1.28b.
13518
2ce10144
AD
135192001-08-03 Akim Demaille <akim@epita.fr>
13520
13521 * tests/Makefile.am (check-local): Ship testsuite.
13522 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
13523 Include `string.h'.
13524
1e3e4bc1
AD
135252001-08-03 Akim Demaille <akim@epita.fr>
13526
13527 * configure.in: Try using -Wformat when compiling.
13528
42b45b7f
AD
135292001-08-03 Akim Demaille <akim@epita.fr>
13530
13531 * configure.in: Bump to 1.28b.
13532
8f13fe33
AD
135332001-08-03 Akim Demaille <akim@epita.fr>
13534
13535 * src/complain.c: Adjust strerror_r portability issues.
13536
b37ba92c
AD
135372001-08-03 Akim Demaille <akim@epita.fr>
13538
13539 Version 1.28a.
13540
b0ce6046
AD
135412001-08-03 Akim Demaille <akim@epita.fr>
13542
13543 * src/getargs.c, src/getarg.h (skeleton)): Constify.
13544 * src/lex.c (literalchar): Avoid name clashes on `buf'.
13545 * src/getargs.c: Include complain.h.
13546 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
13547 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
13548
d01c415b
AD
135492001-08-03 Akim Demaille <akim@epita.fr>
13550
13551 * src/reader.c (readgram): Display hidden chars in error messages.
13552
459dd1a6
AD
135532001-08-03 Akim Demaille <akim@epita.fr>
13554
13555 Update to gettext 0.10.39.
13556
53b74c0c
AD
135572001-08-03 Akim Demaille <akim@epita.fr>
13558
13559 * lib/strspn.c: New.
13560
234a3be3
AD
135612001-08-01 Marc Autret <autret_m@epita.fr>
13562
13563 * doc/bison.texinfo: Update.
13564 * doc/bison.1 (mandoc): Update.
13565 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
13566 * src/files.c: Support output files extensions computing.
13567 (src_extension): New static variable.
13568 (header_extension): New static variable.
13569 (tr): New function.
13570 (get_extension_index): New function, gets the index of an extension
13571 filename in a string.
13572 (compute_exts_from_gf): New function, computes extensions from the
13573 grammar file extension.
13574 (compute_exts_from_src): New functions, computes extensions from the
13575 C source file extension, file given by ``-o'' option.
13576 (compute_base_names): Update.
13577 (output_files): Update.
13578
847bf1f5
AD
135792001-08-01 Robert Anisko <anisko_r@epita.fr>
13580
d995fee7 13581 * doc/bison.texi: Document @$.
847bf1f5
AD
13582 (Locations): New section.
13583
d074a105
AD
135842001-07-18 Akim Demaille <akim@epita.fr>
13585
13586 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
13587 * config/prev-version.txt, config/move-if-change: New.
13588 * Makefile.am: Adjust.
13589
3419715d
AD
135902001-07-08 Pascal Bart <pascal.bart@epita.fr>
13591
13592 * src/bison.simple (yyparse): Suppress warning `comparaison
13593 between signed and unsigned'.
13594
62ab6972
AD
135952001-07-05 Pascal Bart <pascal.bart@epita.fr>
13596
13597 * src/getargs.h (raw_flag): Remove.
13598 * src/getargs.c: Die on `-r'/`--raw'.
13599 * src/lex.c (parse_percent_token): Die on `%raw'.
13600 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
13601 * tests/calc.at: Suppress test with option `--raw'.
13602
1e24cc5b
AD
136032001-07-14 Akim Demaille <akim@epita.fr>
13604
13605 * config/: New.
13606 * configure.in: Require Autoconf 2.50.
13607 Update to gettext 0.10.38.
13608
32dfccf8
AD
136092001-03-16 Akim Demaille <akim@epita.fr>
13610
13611 * doc/bison.texinfo: ANSIfy the examples.
13612
cd5bd6ac
AD
136132001-03-16 Akim Demaille <akim@epita.fr>
13614
13615 * getargs.c (skeleton): New variable.
13616 (longopts): --skeleton is a new option.
13617 (shortopts, getargs): -S is a new option.
13618 * getargs.h: Declare skeleton.
13619 * output.c (output_parser): Use it.
13620
5141b016
AD
136212001-03-16 Akim Demaille <akim@epita.fr>
13622
13623 * m4/strerror_r.m4: New.
13624 * m4/error.m4: Run AC_FUNC_STRERROR_R.
13625 * lib/error.h, lib/error.c: Update.
13626
447992b9
AD
136272001-03-16 Akim Demaille <akim@epita.fr>
13628
13629 * src/getargs.c (longopts): Clean up.
13630
274d42ce
AD
136312001-02-21 Akim Demaille <akim@epita.fr>
13632
13633 * src/reader.c (gensym): `gensym_count' is your own.
13634 Use a static buf to create the symbol name, as token_buffer is no
13635 longer a buffer.
13636
22c821f3
AD
136372001-02-08 Akim Demaille <akim@epita.fr>
13638
13639 * src/conflicts.c (conflict_report): Be sure not to append to res
13640 between two calls, which could happen if both first sprintf were
13641 skipped, but not the first cp += strlen.
13642
18569462
AD
136432001-02-08 Akim Demaille <akim@epita.fr>
13644
13645 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
13646 New, from fileutils 4.0.37.
13647 * configure.in: Require Autoconf 2.49c. I took some time before
13648 making this decision. This is the only way out for portability
13649 issues in Bison, it would mean way too much duplicate effort to
13650 import in Bison features implemented in 2.49c since 2.13.
13651 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
13652
0d8f3c8a
AD
136532001-02-02 Akim Demaille <akim@epita.fr>
13654
13655 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 13656 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 13657
f17bcd1f
AD
136582001-01-19 Akim Demaille <akim@epita.fr>
13659
13660 Get rid of the ad hoc handling of token_buffer in the scanner: use
13661 the obstacks.
13662
13663 * src/lex.c (token_obstack): New.
13664 (init_lex): Initialize it. No longer call...
13665 (grow_token_buffer): this. Remove it.
13666 Adjust all the places which used it to use the obstack.
13667
511e79b3
AD
136682001-01-19 Akim Demaille <akim@epita.fr>
13669
13670 * src/lex.h: Rename all the tokens:
13671 s/\bENDFILE\b/tok_eof/g;
13672 s/\bIDENTIFIER\b/tok_identifier/g;
13673 etc.
13674 Let them be enums, not #define, to ease debugging.
13675 Adjust all the code.
13676
0d6508ef
AD
136772001-01-18 Akim Demaille <akim@epita.fr>
13678
13679 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
13680 * src/lex.c (maxtoken, grow_token_buffer): Static.
13681
6deb4447
AD
136822001-01-18 Akim Demaille <akim@epita.fr>
13683
13684 Since we now use obstacks, more % directives can be enabled.
13685
13686 * src/lex.c (percent_table): Also accept `%yacc',
13687 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
13688 `%debug'.
13689 Handle the actions for `%semantic_parser' and `%pure_parser' here,
13690 instead of returning a token.
13691 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
13692 * src/reader.c (read_declarations): Adjust.
13693 * src/files.c (open_files): Don't call `compute_base_names', don't
13694 compute `attrsfile' since they depend upon data which might be
13695 *in* the input file now.
13696 (output_files): Do it here.
13697 * src/output.c (output_headers): Document the fact that this patch
13698 introduces a guaranteed SEGV for semantic parsers.
13699 * doc/bison.texinfo: Document them.
13700 * tests/suite.at: Exercise these %options.
13701
ff4423cc
AD
137022000-12-20 Akim Demaille <akim@epita.fr>
13703
13704 Also handle the output file (--verbose) with obstacks.
13705
13706 * files.c (foutput): Remove.
13707 (output_obstack): New.
13708 Adjust all dependencies.
13709 * src/conflicts.c: Return a string.
13710 * src/system.h (obstack_grow_string): Rename as...
13711 (obstack_sgrow): this. Be ready to work with non literals.
13712 (obstack_fgrow4): New.
13713
956dba3a
AD
137142000-12-20 Akim Demaille <akim@epita.fr>
13715
13716 * src/files.c (open_files): Fix the computation of short_base_name
13717 in the case of `-o foo.tab.c'.
13718
337bab46
AD
137192000-12-20 Akim Demaille <akim@epita.fr>
13720
13721 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
13722 (copy_dollar): Now that everything uses obstacks, get rid of the
13723 FILE * parameters.
13724
5d3214b8
AD
137252000-12-20 Akim Demaille <akim@epita.fr>
13726
13727 * src/files.c (open_files): Actually the `.output' file is based
13728 on the short_base_name, not base_name.
13729 * tests/suite.at (Checking output file names): Adjust.
13730
29092a57
AD
137312000-12-20 Akim Demaille <akim@epita.fr>
13732
13733 * src/bison.s1: Remove, we now use directly...
13734 * src/bison.simple: this.
13735 * src/Makefile.am: Use pkgdata instead of data.
13736
ea5607fd
AD
137372000-12-20 Akim Demaille <akim@epita.fr>
13738
13739 * src/files.c (guard_obstack): New.
13740 (open_files): Initialize it.
13741 (output_files): Dump it...
13742 * src/files.h: Export it.
13743 * src/reader.c (copy_guard): Use it.
13744
27110317
AD
137452000-12-19 Akim Demaille <akim@epita.fr>
13746
13747 * src/files.c (outfile, defsfile, actfile): Removed as global
13748 vars.
13749 (open_files): Don't compute them.
13750 (output_files): Adjust.
13751 (base_name, short_base_name): Be global.
13752 Adjust dependencies.
13753
19c50364
AD
137542000-12-19 Akim Demaille <akim@epita.fr>
13755
13756 * src/files.c (strsuffix): New.
13757 (stringappend): Be just like strcat but allocate.
13758 (base_names): Eve out from open_files.
13759 Try to simplify the rather hairy computation of base_name and
13760 short_base_name.
13761 (open_files): Use it.
13762 * tests/suite.at (Checking output file names): New test.
13763
573c1d9f
AD
137642000-12-19 Akim Demaille <akim@epita.fr>
13765
13766 * src/system.h (obstack_grow_literal_string): Rename as...
13767 (obstack_grow_string): this.
13768 * src/output.c (output_parser): Recognize `%% actions' instead of
13769 `$'.
13770 * src/bison.s1: s/$/%% actions/.
13771 * src/bison.hairy: Likewise.
13772
ef7ddedd
AD
137732000-12-19 Akim Demaille <akim@epita.fr>
13774
13775 * src/output.c (output_parser): Compute the `#line' lines when
13776 there are.
13777 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
13778 Suggested by Hans Aberg.
13779
ff61dabd
AD
137802000-12-19 Akim Demaille <akim@epita.fr>
13781
13782 Let the handling of the skeleton files be local to the procedures
13783 that use it.
13784
13785 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
13786 longer static.
13787 (fparser, open_extra_files): Remove.
13788 (open_files, output_files): Don't take care of fparser.
13789 * src/files.h: Adjust.
13790 * src/output.c (output_parser): Open and close the file to the
13791 skeleton.
13792 * src/reader.c (read_declarations): When %semantic_parser, open
13793 fguard.
13794
55b96341
AD
137952000-12-19 Akim Demaille <akim@epita.fr>
13796
13797 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
13798 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
13799
358c15b7
AD
138002000-12-19 Akim Demaille <akim@epita.fr>
13801
13802 * src/files.c (open_files): Yipee! We no longer need all the code
13803 looking for `/tmp' since we have no tmp file.
13804
7de3329e
AD
138052000-12-19 Akim Demaille <akim@epita.fr>
13806
13807 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
13808 New macros.
13809 * src/files.c (open_files): Less dependency on MSDOS etc.
13810
3abcd459
AD
138112000-12-14 Akim Demaille <akim@epita.fr>
13812
13813 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
13814 Provide a default definition.
13815 Use it when executing the default @ action.
13816 * src/reader.c (reader_output_yylsp): No longer include
13817 `timestamp' and `text' in the default YYLTYPE.
13818
2a91a95e
AD
138192000-12-12 Akim Demaille <akim@epita.fr>
13820
13821 * src/reader.c (copy_definition, parse_union_decl, copy_action)
13822 (copy_guard): Quote the file names.
13823 Reported by Laurent Mascherpa.
13824
14d3eb9b
AD
138252000-12-12 Akim Demaille <akim@epita.fr>
13826
13827 * src/output.c (output_headers, output_program, output): Be sure
13828 to escape special characters when outputting filenames.
13829 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
13830 (output_headers): Don't depend on them, Use ACTSTR.
13831
d7045ec6
AD
138322000-11-17 Akim Demaille <akim@epita.fr>
13833
13834 * lib/obstack.h: Formatting changes.
13835 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
13836 prevents type checking.
13837 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
13838 cast the value to (void *): assigning a `foo *' to a `void *'
13839 variable is valid.
13840 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
13841 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
13842 append characters.
13843
6fd54b73
AD
138442000-11-17 Akim Demaille <akim@epita.fr>
13845
13846 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
13847 as...
13848 (suite.m4, regression.m4, calc.m4): these.
13849 * tests/atgeneral.m4: Update from CVS Autoconf.
13850
4c50eae6
AD
138512000-11-17 Akim Demaille <akim@epita.fr>
13852
13853 * tests/regression.m4 (%union and --defines): New test,
13854 demonstrating a current bug in the obstack implementation.
13855
a35f64ea
AD
138562000-11-17 Akim Demaille <akim@epita.fr>
13857
13858 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
13859 macros.
13860 Use them to declare the variables which are global or local to
13861 `yyparse'.
13862
7de23534
AD
138632000-11-17 Akim Demaille <akim@epita.fr>
13864
13865 * acconfig.h: Remove, no longer used.
13866
aa7815f5
AD
138672000-11-07 Akim Demaille <akim@epita.fr>
13868
13869 * src: s/Copyright (C)/Copyright/g.
13870
5af1f549
AD
138712000-11-07 Akim Demaille <akim@epita.fr>
13872
13873 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
13874 defining.
13875 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
13876
553e2b22
AD
138772000-11-07 Akim Demaille <akim@epita.fr>
13878
13879 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
13880 Merge in a single CPP if/else.
13881
8a4f41d6
AD
138822000-11-07 Akim Demaille <akim@epita.fr>
13883
13884 * src/output.c (output): Remove useless variables.
13885 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
13886 argument `data' for consistency with the prototypes.
13887 Qualify it `const'.
13888 (obstack_copy, obstack_copy0): Rename the second argument as
13889 `address' for consistency. Qualify it `const'.
13890 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
13891 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
13892 `const' their input argument (`data' or `address').
13893 Adjust the corresponding macros to include `const' in casts.
13894
095a3fb5
AD
138952000-11-03 Akim Demaille <akim@epita.fr>
13896
13897 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
13898 s/PFILE1/BISON_HAIRY/.
13899 Adjust dependencies.
13900
d1cdce7c
AD
139012000-11-03 Akim Demaille <akim@epita.fr>
13902
090c5ebf 13903 For some reason, this was not applied.
d1cdce7c
AD
13904
13905 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
13906 `unlink': it's no longer used.
13907
9311529b
AD
139082000-11-03 Akim Demaille <akim@epita.fr>
13909
13910 * src/files.c (skeleton_find): New function, eved out of...
13911 (open_files, open_extra_files): here.
13912
d8880f69
AD
139132000-11-03 Akim Demaille <akim@epita.fr>
13914
13915 Don't use `atexit'.
13916
13917 * src/files.c (obstack_save): New function.
13918 (done): Rename as...
13919 (output_files): this.
13920 Use `obstack_save'.
13921 * src/main.c (main): Don't use `atexit' to register `done', since
13922 it no longer has to remove tmp files, just call `output_files'
13923 when there are no errors.
13924
0dbb648e
AD
139252000-11-02 Akim Demaille <akim@epita.fr>
13926
13927 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
13928 `unlink': it's no longer used.
13929 * src/files.h: Formatting changes.
13930
896fe5c1
AD
139312000-11-02 Akim Demaille <akim@epita.fr>
13932
13933 Remove the last uses of mktemp and unlink/delete.
13934
13935 * src/files.c (fdefines, ftable): Removed.
13936 (defines_ostack, table_obstack): New.
13937 Adjust dependencies of the former into uses of the latter.
13938 * src/output.c (output_short_or_char_table, output_short_table):
13939 Convert to using obstacks.
13940 * src/reader.c (copy_comment2): Accept one FILE * and two
13941 obstacks.
13942 (output_token_defines, reader_output_yylsp): Use obstacks.
13943 * src/system.h (obstack_fgrow3): New.
1f65350a 13944 * po/POTFILES.in: Adjust.
896fe5c1 13945
dd60faec
AD
139462000-11-01 Akim Demaille <akim@epita.fr>
13947
13948 Change each use of `fattrs' into a use of `attrs_obstack'.
13949
13950 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
13951 * src/files.c (fattrs): Remove.
13952 (attrs_obstack): New.
13953 Adjust all dependencies.
13954 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
13955
8c7ebe49
AD
139562000-11-01 Akim Demaille <akim@epita.fr>
13957
13958 Introduce obstacks.
13959 Change each use of `faction' into a use of `action_obstack'.
13960
13961 * lib/obstack.h, lib/obstack.c: New files.
13962 * src/files.c (faction): Remove.
13963 (action_obstack): New.
13964 Adjust all dependencies.
13965
77aee789
AD
139662000-10-20 Akim Demaille <akim@epita.fr>
13967
13968 * lib/quote.h (PARAMS): New macro. Use it.
13969
43591cec
AD
139702000-10-16 Akim Demaille <akim@epita.fr>
13971
13972 * src/output.c (output_short_or_char_table): New function.
13973 (output_short_table, output_token_translations): Use it.
13974 (goto_actions): Use output_short_table.
13975
1e9798d5
AD
139762000-10-16 Akim Demaille <akim@epita.fr>
13977
13978 * src/symtab.c (bucket_new): New function.
13979 (getsym): Use it.
13980
13981 * src/output.c (output_short_table): New argument to display the
13982 comment associated with the table.
13983 Adjust dependencies.
13984 (output_gram): Use it.
13985 (output_rule_data): Nicer output layout for YYTNAME.
13986
f282676b
AD
139872000-10-16 Akim Demaille <akim@epita.fr>
13988
13989 * src/lex.c (read_typename): New function.
13990 (lex): Use it.
13991 * src/reader.c (copy_dollar): Likewise.
13992
550a72a3
AD
139932000-10-16 Akim Demaille <akim@epita.fr>
13994
13995 * src/reader.c (copy_comment2): Expect the input stream to be on
13996 the `/' which is suspected to open a comment, instead of being
13997 called after `//' or `/*' was read.
13998 (copy_comment, copy_definition, parse_union_decl, copy_action)
13999 (copy_guard): Adjust.
14000
131e2fef
AD
140012000-10-16 Akim Demaille <akim@epita.fr>
14002
14003 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
14004 `read_signed_integer'.
14005
79282c5a
AD
140062000-10-16 Akim Demaille <akim@epita.fr>
14007
14008 * src/reader.c (copy_dollar): New function.
14009 (copy_guard, copy_action): Use it.
14010
ff4a34be
AD
140112000-10-16 Akim Demaille <akim@epita.fr>
14012
14013 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
14014 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
14015 New files, from Fileutils 4.0.27.
14016 * src/main.c (printable_version): Remove.
14017 * src/lex.c, src/reader.c: Use `quote'.
14018
140192000-10-04 Akim Demaille <akim@epita.fr>
14020
14021 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
14022
14ded682
AD
140232000-10-04 Akim Demaille <akim@epita.fr>
14024
14025 * doc/bison.texinfo: Various typos spotted by Neil Booth.
14026
8e03724b
AD
140272000-10-04 Akim Demaille <akim@epita.fr>
14028
14029 When a literal string is used to define two different tokens,
14030 `bison -v' segfaults.
14031 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
14032
14033 * tests/regression.m4: New file.
14034 Include the core of the sample provided by Piotr Gackiewicz.
14035 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
14036 properly.
14037
a9e64249
AD
140382000-10-04 Akim Demaille <akim@epita.fr>
14039
14040 * src/reader.c (parse_expect_decl): Keep `count' within the size
14041 of `buffer'.
14042 From Neil Booth.
14043
da9abf43
AD
140442000-10-02 Paul Eggert <eggert@twinsun.com>
14045
14046 * bison.s1 (yyparse): Assign the default value
14047 unconditionally, to avoid a GCC warning and make the parser a
14048 tad smaller.
14049
c33638bb
AD
140502000-10-02 Akim Demaille <akim@epita.fr>
14051
14052 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
14053 options.
14054
444c570a
AD
140552000-10-02 Akim Demaille <akim@epita.fr>
14056
14057 * src/derives.c, src/print.c, src/reduce.c: To ease the
14058 translation, move some `\n' out of the translated strings.
14059
89cab50d
AD
140602000-10-02 Akim Demaille <akim@epita.fr>
14061
14062 The location tracking mechanism is precious for parse error
14063 messages. Nevertheless, it is enabled only when `@n' is used in
14064 the grammar, which is a different issue (you can use it in error
14065 message, but not in the grammar per se). Therefore, there should
14066 be another means to enable it.
14067
14068 * src/getargs.c (getargs): Support `--locations'.
14069 (usage): Report it.
14070 * src/getargs.h (locationsflag): Export it.
14071 * src/lex.c (percent_table): Support `%locations'.
14072 * src/reader.c (yylsp_needed): Remove this variable, now replaced
14073 with `locationsflag'.
14074 * doc/bison.texinfo: Document `--locations' and `%locations'.
14075 Sort the options.
14076 * tests/calc.m4: Test it.
14077
14078 For regularity of the names, replace each
14079 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
14080 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
14081 In addition replace each `flag' with `_flag'.
14082
d6c2cba0
AD
140832000-10-02 Akim Demaille <akim@epita.fr>
14084
14085 Also test parse error messages, including with YYERROR_VERBOSE.
14086
14087 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
14088 associative).
14089 Use it to check the computations.
14090 Use it to check `nonassoc' is honored.
14091 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
14092 `--yyerror-verbose'.
14093 (_AT_CHECK_CALC): Adjust to this option.
14094 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
14095
5a35a6cb
AD
140962000-10-02 Akim Demaille <akim@epita.fr>
14097
14098 Test also `--verbose', `--defines' and `--name-prefix'. Testing
14099 the latter demonstrates a flaw in the handling of non debugging
14100 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
14101 was used in order to simplify:
14102
14103 #if YYDEBUG
14104 if (yydebug)
14105 {
14106 ...
14107 }
14108 #endif
14109
14110 into
14111
14112 if (yydebug)
14113 {
14114 ...
14115 }
14116
14117 unfortunately this leads to a CPP conflict when
14118 `--name-prefix=foo' is used since it produces `#define yydebug
14119 foodebug'.
14120
14121 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
14122 (YYDPRINTF): New macro.
14123 Spread its use.
14124 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
14125 the bison options.
14126 Also test `--verbose', `--defines' and `--name-prefix'.
14127
71da9eea
AD
141282000-10-02 Akim Demaille <akim@epita.fr>
14129
14130 Improve the readability of the produced parsers.
14131
14132 * src/bison.s1: Formatting changes.
14133 Improve the comment related to the `$' mark.
14134 (yydefault): Don't fall through to `yyresume': `goto' there.
14135 * src/output.c (output_parser): When the `$' is met, skip the end
14136 of its line.
14137 New variable, `number_of_dollar_signs', to check there's exactly
14138 one `$' in the parser skeleton.
14139
95e36146
AD
141402000-10-02 Akim Demaille <akim@epita.fr>
14141
14142 * lib/xstrdup.c: New file, from the fileutils.
14143 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
14144 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
14145 instead of strlen + xmalloc + strcpy.
14146 * src/symtab.c (copys): Remove, use xstrdup instead.
14147
d7020c20
AD
141482000-10-02 Akim Demaille <akim@epita.fr>
14149
14150 * src/gram.h (associativity): New enum type which replaces the
14151 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
14152 `right_assoc', `left_assoc' and `non_assoc'.
14153 Adjust all dependencies.
14154 * src/reader.c: Formatting changes.
14155 (LTYPESTR): Don't define it, use it as a literal in
14156 `reader_output_yylsp'.
14157 * src/symtab.h (symbol_class): New enum type which replaces the
14158 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
14159 `sunknown', `stoken and `snterm'.
14160
1916f98e
AD
141612000-10-02 Akim Demaille <akim@epita.fr>
14162
14163 * src/getargs.c (fixed_outfiles): Rename as...
14164 (yaccflag): for consistency and accuracy.
14165 Adjust dependencies.
14166
d7913476
AD
141672000-10-02 Akim Demaille <akim@epita.fr>
14168
14169 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
14170 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
14171 difficult and introduced a lot of core dump. It turns out that
14172 Bison used an implementation of `xmalloc' based on `calloc', and
14173 at various places it does depend upon the initialization to 0. I
14174 have not tried to isolate the pertinent places, and all the former
14175 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
14176 someone should address this issue.
14177
14178 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
14179 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
14180 files.
14181 Adjust dependencies.
14182 * src/warshall.h: New file.
14183 Propagate.
14184
340ef489
AD
141852000-10-02 Akim Demaille <akim@epita.fr>
14186
14187 Various anti-`extern in *.c' changes.
14188
14189 * src/system.h: Include `assert.h'.
14190
b2ca4022
AD
141912000-10-02 Akim Demaille <akim@epita.fr>
14192
14193 * src/state.h (nstates, final_state, first_state, first_shift)
14194 (first_reduction): Move their exportation from here...
14195 * src/LR0.h: to here.
14196 Adjust dependencies.
14197 * src/getargs.c (statisticsflag): New variable.
14198 Add support for `--statistics'.
14199 Adjust dependencies.
14200
14201 Remove a lot of now useless `extern' statements in most files.
14202
403b315b
AD
142032000-10-02 Akim Demaille <akim@epita.fr>
14204
14205 * src/LR0.h: New file.
14206 Propagate its use.
14207
07a58c13
AD
142082000-10-02 Akim Demaille <akim@epita.fr>
14209
14210 * src/print.h: New file.
14211 Propagate its use.
14212 * src/print.c: Formatting and ordering changes.
14213 (verbose, terse): Replace with...
14214 (print_results): this new function.
14215 Adjust dependencies.
14216
0619caf0
AD
142172000-10-02 Akim Demaille <akim@epita.fr>
14218
14219 * src/conflicts.c (conflict_report): New function.
14220 (conflict_log, verbose_conflict_log): Replace with...
14221 (print_conflicts): this function.
14222 Adjust dependencies.
14223 * src/conflicts.h: New file.
14224 Propagate its inclusion.
14225
3519ec76
AD
142262000-10-02 Akim Demaille <akim@epita.fr>
14227
14228 * src/nullable.h: New file.
14229 Propagate its inclusion.
14230 * src/nullable.c: Formatting changes.
14231
015acc48
AD
142322000-10-02 Akim Demaille <akim@epita.fr>
14233
14234 * src/reduce.h: New file.
14235 Propagate its inclusion.
14236 * src/reduce.c: Topological sort and other formatting changes.
14237 (bool, TRUE, FALSE): Move their definition to...
14238 * src/system.h: here.
14239
8963a27b
AD
142402000-10-02 Akim Demaille <akim@epita.fr>
14241
14242 * src/files.c: Formatting changes.
14243 (tryopen, tryclose, openfiles): Rename as...
14244 (xfopen, xfclose, open_files): this.
14245 (stringappend): static.
14246 * src/files.h: Complete the list of exported symbols.
14247 Propagate its use.
14248
a70083a3
AD
142492000-10-02 Akim Demaille <akim@epita.fr>
14250
14251 * src/reader.h: New file.
14252 Propagate its use instead of tedious list of `extern' and
14253 prototypes.
14254 * src/reader.c: Formatting changes, topological sort,
14255 s/register//.
14256
abadc117
AD
142572000-10-02 Akim Demaille <akim@epita.fr>
14258
14259 * src/lex.h: Prototype `lex.c' exported functions.
14260 * src/reader.c: Adjust.
14261 * src/lex.c: Formatting changes.
14262 (safegetc): Rename as...
14263 (xgetc): this.
14264
720d742f
AD
142652000-10-02 Akim Demaille <akim@epita.fr>
14266
14267 * src/lalr.h: New file.
14268 Propagate its inclusion instead of prototypes and `extern'.
14269 * src/lalr.c: Formatting changes, topological sorting etc.
14270
f2acea59
AD
142712000-10-02 Akim Demaille <akim@epita.fr>
14272
14273 * src/output.c (token_actions): Introduce a temporary array,
14274 YYDEFACT, that makes it possible for this function to use
14275 output_short_table.
14276
d019d655
AD
142772000-10-02 Akim Demaille <akim@epita.fr>
14278
14279 `user_toknums' is output as a `short[]' in `output.c', while it is
14280 defined as a `int[]' in `reader.c'. For consistency with the
14281 other output tables, `user_toknums' is now defined as a table of
14282 shorts.
14283
14284 * src/reader.c (user_toknums): Be a short table instead of an int
14285 table.
14286 Adjust dependencies.
14287
14288 Factor the short table outputs.
14289
14290 * src/output.c (output_short_table): New function.
14291 * src/output.c (output_gram, output_stos, output_rule_data)
14292 (output_base, output_table, output_check): Use it.
14293
6c89f1c1
AD
142942000-10-02 Akim Demaille <akim@epita.fr>
14295
14296 * src/output.c (output): Topological sort of the functions, in
14297 order to get rid of the `static' prototypes.
14298 No longer use `register'.
14299 * src/output.h: New file.
14300 Propagate its inclusion in files explicitly prototyping functions
14301 from output.c.
14302
d9efd181
AD
143032000-09-21 Akim Demaille <akim@epita.fr>
14304
14305 * src/atgeneral.m4: Update from Autoconf.
14306
c29240e7 143072000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
14308
14309 * src/closure.h: New file.
14310 * src/closure.c: Formatting changes, topological sort over the
14311 functions, use of closure.h.
14312 (initialize_closure, finalize_closure): Rename as...
14313 (new_closure, free_closure): these. Adjust dependencies.
14314 * src/LR0.c: Formatting changes, topological sort, use of
14315 cloture.h.
14316 (initialize_states): Rename as...
14317 (new_states): this.
14318 * src/Makefile.am (noinst_HEADERS): Adjust.
14319
499daa50
AD
143202000-09-20 Akim Demaille <akim@epita.fr>
14321
14322 * src/acconfig.h: Don't protect config.h against multiple
14323 inclusion.
14324 Don't define PARAMS.
14325 * src/system.h: Define PARAMS.
14326 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
14327 purpose of config.h. system.h must not try to fix wrong
14328 definitions in config.h.
14329
cc84fd5d
AD
143302000-09-20 Akim Demaille <akim@epita.fr>
14331
14332 * src/derives.h: New file.
14333 * src/main.c, src/derives.h: Use it.
14334 Formatting changes.
14335 * src/Makefile.am (noinst_HEADERS): Adjust.
14336
db5b3a89
AD
143372000-09-20 Akim Demaille <akim@epita.fr>
14338
14339 * tests/atgeneral.m4: Update from Autoconf.
14340 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
14341 (AT_CHECK_CALC): New macros.
14342 Use these macros to test bison with options `', `--raw',
14343 `--debug', `--yacc', `--yacc --debug'.
14344
ceed8467
AD
143452000-09-19 Akim Demaille <akim@epita.fr>
14346
14347 * src/output.c: Formatting changes.
14348 * src/machine.h: Remove, leaving its contents in...
14349 * src/system.h: here.
14350 Include stdio.h.
14351 Adjust all dependencies on stdio.h and machine.h.
14352 * src/getargs.h: New file.
14353 Let all `extern' declarations about getargs.c be replaced with
14354 inclusion of `getargs.h'.
14355 * src/Makefile.am (noinst_HEADERS): Adjust.
14356
14357 * tests/calc.m4 (yyin): Be initialized in main, not on the global
14358 scope.
14359 (yyerror): Returns void, not int.
14360 * doc/bison.texinfo: Formatting changes.
14361
05a1d24b
AD
143622000-09-19 Akim Demaille <akim@epita.fr>
14363
14364 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
14365 portable.
14366
cbd25751
AD
143672000-09-18 Akim Demaille <akim@epita.fr>
14368
14369 * configure.in: Append WARNING_CFLAGS to CFLAGS.
14370 * src/Makefile.am (INCLUDES): Don't.
14371 Be ready to fetch headers in lib/.
14372
13863333
AD
143732000-09-18 Akim Demaille <akim@epita.fr>
14374
14375 * doc/bison.texinfo: Update the copyright.
14376 ANSIfy and GNUify the examples.
14377 Remove the old menu.
14378
0d533154
AD
143792000-09-18 Akim Demaille <akim@epita.fr>
14380
14381 First set of tests: use the `calc' example from the documentation.
14382
14383 * src/bison.s1 (yyparse): Condition the code using `yytname' which
14384 is defined only when YYDEBUG is.
14385 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
14386 * src/files.c (tryopen, tryclose): Formatting changes.
14387 Move to the top and be static.
14388 * src/reader.c (read_signed_integer): Likewise.
14389 * tests/calc.m4: New file.
14390 * Makefile.am, suite.m4: Adjust.
14391 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
14392
e79137ac
AD
143932000-09-18 Akim Demaille <akim@epita.fr>
14394
14395 Add support for an Autotest test suite for Bison.
14396
14397 * m4/m4.m4, m4/atconfig.m4: New files.
14398 * m4/Makefile.am (EXTRA_DIST): Adjust.
14399 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
14400 files.
14401 * src/getargs.c: Display a more standard --version message.
14402 * src/reader.c (reader): Formatting changes.
14403 No longer depend upon VERSION_STRING.
14404 * configure.in: No longer use `dnl'.
14405 Set up the test suite and the new directory `tests/.
14406 (VERSION_STRING): Remove.
14407
27821bff
AD
144082000-04-14 Akim Demaille <akim@epita.fr>
14409
14410 * src/reader.c (copy_comment2): New function, same as former
14411 `copy_comment', but outputs into two FILE *.
14412 (copy_comment): Use it.
14413 (parse_union_decl): Use it.
14414 (get_type, parse_start_decl): Use the same `invalid' message.
14415 (parse_start_decl, parse_union_decl): Use the same `multiple'
14416 message.
14417 (parse_union_decl, copy_guard, copy_action): Use the same
14418 `unmatched' message.
14419 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
14420
cfe5fbc0
AD
144212000-03-31 Akim Demaille <akim@epita.fr>
14422
14423 * src/files.c (tryopen, tryclose): Move to the top.
14424 Be static.
14425
cb7db13e
AD
144262000-03-31 Akim Demaille <akim@epita.fr>
14427
14428 * src/main.c (main): Don't call `done', exit does it.
14429
a0f6b076
AD
144302000-03-31 Akim Demaille <akim@epita.fr>
14431
36281465
AD
14432 * allocate.c: s/return (foo)/return foo/.
14433 * lalr.c: Likewise.
14434 * LR0.c: Likewise.
14435 * output.c: Likewise.
14436 * reader.c: Likewise.
14437 * symtab.c: Likewise.
14438 * vmsgetargs.c: Likewise.
14439
144402000-03-31 Akim Demaille <akim@epita.fr>
14441
14442 Clean up the error reporting functions.
a0f6b076
AD
14443
14444 * src/report.c: New file.
14445 * src/report.h: Likewise.
14446 * src/Makefile.am: Adjust.
14447 * m4/error.m4: New file.
14448 * m4/Makefile.am: Adjust.
14449 * configure.in (jm_PREREQ_ERROR): Call it.
14450 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
14451 Remove.
14452 (fatal, fatals): Remove. All callers use complain.c::fatal.
14453 (warn, warni, warns, warnss, warnss): Remove. All callers use
14454 complain.c::complain.
14455 (toomany): Remove, use fatal instead.
14456 * src/files.c (done): No argument, use complain_message_count.
14457 * src/main.c (main): Register `done' to `atexit'.
14458
14459 * src/getargs.c (usage): More `fputs', less `fprintf'.
14460
18539825
AD
144612000-03-28 Akim Demaille <akim@epita.fr>
14462
14463 * lib/: New directory.
14464 * Makefile.am (SUBDIRS): Adjust.
14465 * configure.in: Adjust.
14466 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
14467 useless.
14468 * src/alloca.c: Moved to lib/.
14469 * src/getopt.c: Likewise.
14470 * src/getopt1.c: Likewise.
14471 * src/getopt.h: Likewise.
14472 * src/ansi2knr.c: Likewise.
14473 * src/ansi2knr.1: Likewise.
14474 * src/Makefile.am: Adjust.
14475 * lib/Makefile.am: New file.
14476
9f306f2a
AD
144772000-03-28 Akim Demaille <akim@epita.fr>
14478
14479 * src/getargs.c (usage): Refresh the help message.
14480
0ba347b6
AD
144812000-03-17 Akim Demaille <akim@epita.fr>
14482
14483 * src/getopt1.c: Updated from textutils 2.0e
14484 * src/getopt.c: Likewise.
14485 * src/getopt.h: Likewise.
14486
dbe7f271
AD
144872000-03-17 Akim Demaille <akim@epita.fr>
14488
14489 * src/Makefile.am (bison.simple): Fix the awk program: quote only
14490 the file name, not the whole `#line LINE FILE'.
14491
75bbe78d
AD
144922000-03-17 Akim Demaille <akim@epita.fr>
14493
14494 On syntax errors, report the token on which we choked.
14495
aa5fd0ee
AD
14496 * src/bison.s1 (yyparse): In the label yyerrlab, when
14497 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 14498
7b306f52
AD
144992000-03-17 Akim Demaille <akim@epita.fr>
14500
aa5fd0ee 14501 * src/reader.c (copy_at): New function.
7b306f52
AD
14502 (copy_guard): Use it.
14503 (copy_action): Use it.
14504
e87b5700
AD
145052000-03-17 Akim Demaille <akim@epita.fr>
14506
14507 Be kind to translators, save some useless translations.
14508
aa5fd0ee 14509 * src/main.c (banner): New function.
e87b5700
AD
14510 (fatal_banner): Use it.
14511 (warn_banner): Use it.
14512
ae3c3164
AD
145132000-03-17 Akim Demaille <akim@epita.fr>
14514
aa5fd0ee
AD
14515 * src/reader.c (copy_definition): Use copy_string and
14516 copy_comment. Removed now unused `match', `ended',
14517 `cplus_comment'.
ae3c3164
AD
14518 (copy_comment, copy_string): Moved, to be visible from
14519 copy_definition.
14520
4dc58e7c
AD
145212000-03-17 Akim Demaille <akim@epita.fr>
14522
aa5fd0ee
AD
14523 * src/reader.c (copy_string): Declare `static inline'. No
14524 problems with inline, since it is checked by configure.
4dc58e7c
AD
14525 (copy_comment): Likewise.
14526
0a6384c4
AD
145272000-03-17 Akim Demaille <akim@epita.fr>
14528
aa5fd0ee 14529 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 14530
3cef001a
AD
145312000-03-17 Akim Demaille <akim@epita.fr>
14532
aa5fd0ee 14533 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
14534 (copy_action): Use it. Removed now unused `match', `ended',
14535 `cplus_comment'.
14536 (copy_guard): Likewise.
14537
ca36d2ef
AD
145382000-03-17 Akim Demaille <akim@epita.fr>
14539
aa5fd0ee 14540 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
14541 (copy_action): Use it.
14542 (copy_guard): Likewise.
14543
6666f98f
AD
145442000-03-17 Akim Demaille <akim@epita.fr>
14545
14546 Change the handling of @s so that they behave exactly like $s.
14547 There is now a pseudo variable @$ (readble and writable), location
14548 of the lhs of the rule (by default ranging from the location of
14549 the first symbol of the rhs, to the location of the last symbol,
14550 or, if the rhs is empty, YYLLOC).
14551
14552 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
14553 yyval.
14554 (yyparse): When providing a default semantic action, provide a
14555 default location action.
14556 (after the $): No longer change `*YYLSP', just stack YYLOC the
14557 same way you stack YYVAL.
14558 * src/reader.c (read_declarations): Use warns.
14559 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
14560 (copy_action, case '@'): Likewise.
14561 Use a standard error message, to save useless work from
14562 translators.
14563
41aca2e0
AD
145642000-03-17 Akim Demaille <akim@epita.fr>
14565
aa5fd0ee
AD
14566 * src/bison.s1: Formatting and cosmetics changes.
14567 * src/reader.c: Likewise.
41aca2e0
AD
14568 Update the Copyright notice.
14569
dc08c1d5
AD
145702000-03-17 Akim Demaille <akim@epita.fr>
14571
aa5fd0ee
AD
14572 * src/bison.s1 (#line): All set to `#line' only, since the
14573 Makefile now handles them.
dc08c1d5 14574
9ee3c97b
AD
145752000-03-16 Akim Demaille <akim@epita.fr>
14576
14577 * src/output.c (output_rule_data): Output the documentation of
14578 some of the tables.
14579 (Copyright notice): Update.
14580 Formatting changes.
14581
0de741ca
AD
145822000-03-16 Akim Demaille <akim@epita.fr>
14583
14584 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
14585 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
14586 One `#if YYDEBUG' remains, since it uses variables which are
14587 defined only if `YYDEBUG != 0'.
14588
bb10be54
AD
145892000-03-16 Akim Demaille <akim@epita.fr>
14590
14591 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
14592 and related variables so that the similarities are highlighted.
14593
b07b484a
AD
145942000-03-16 Akim Demaille <akim@epita.fr>
14595
14596 * src/bison.s1: Properly indent CPP directives.
14597
361f60b3
AD
145982000-03-16 Akim Demaille <akim@epita.fr>
14599
14600 * src/bison.s1: Properly indent the `alloca' CPP section.
14601
8c44d3ec
AD
146022000-03-16 Akim Demaille <akim@epita.fr>
14603
14604 Do not hard code values of directories in `configure.in'.
14605 Update the `configure' tool chain.
14606
14607 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
14608 src/makefile.am.
14609 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
14610 (AC_OUTPUT): Add m4/Makefile.
14611 Bump to bison 1.28a, 1.29 has never been released.
14612 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
14613 handled via src/Makefile.am.
14614 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
14615 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
14616 autoheader.
14617 * Makefile.am (SUBDIRS): Add m4.
14618 (ACLOCAL_AM_FLAGS): New variable.
14619 (AUTOMAKE_OPTIONS): Add check-news.
14620 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
14621 the proper line number and file name.
14622 (DEFS): Propagate the location of bison library files and of the
14623 locale files.
14624 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
14625 builddir.
14626 * acinclude.m4: Remove, replaced by the directory m4.
14627 * m4/Makefile.am (EXTRA_DIST): New variable.
14628 * m4/gettext.m4: New file, from the fileutils.
14629 * m4/lcmessage.m4: Likewise
14630 * m4/progtest.m4: Likewise.
14631 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
14632
f95997e7
AD
146332000-03-10 Akim Demaille <akim@epita.fr>
14634
14635 * src/closure.c:
14636 Formatting changes of various comments.
14637 Respect the GNU coding standards at various places.
14638 Don't use `_()' when no translation is needed.
14639
146401999-12-13 Jesse Thilo <jthilo@gnu.org>
14641
14642 * src/files.c:
14643 OS/2 honors TMPDIR environment variable.
14644
146451999-12-13 Jesse Thilo <jthilo@gnu.org>
14646
14647 * doc/bison.texinfo: Tweaked spelling and grammar.
14648 Updated ISBN.
14649 Removed reference to price of printed copy.
14650 Mention BISON_SIMPLE and BISON_HAIRY.
14651
146521999-12-13 Jesse Thilo <jthilo@gnu.org>
14653
14654 * configure.in, NEWS:
14655 Bison 1.29 released.
14656
146571999-10-27 Jesse Thilo <jthilo@gnu.org>
14658
14659 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
14660 Added reference card.
14661
146621999-07-26 Jesse Thilo <jthilo@gnu.org>
14663
14664 * po/ru.po: Added Russian translation.
14665
146661999-07-26 Jesse Thilo <jthilo@gnu.org>
14667
14668 * configure.in: Added Russian translation.
14669
146701999-07-06 Jesse Thilo <jthilo@gnu.org>
14671
14672 * configure.in, NEWS, README:
14673 Released version 1.28.
14674
146751999-06-14 Jesse Thilo <jthilo@gnu.org>
14676
14677 * src/system.h:
14678 Squashed redefinition warning on some systems.
14679
14680 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
14681 Have configure build version string instead of relying on ANSI string
14682 concatentation.
14683
146841999-06-14 Jesse Thilo <jthilo@gnu.org>
14685
14686 * po/POTFILES.in: Got rid of version.c.
14687
146881999-06-14 Jesse Thilo <jthilo@gnu.org>
14689
14690 * acconfig.h, configure.in:
14691 Have configure build version string instead of relying on ANSI string
14692 concatentation.
14693
146941999-06-08 Jesse Thilo <jthilo@gnu.org>
14695
14696 * doc/bison.1:
14697 Dropped mention of `+' for long-named options.
14698
146991999-05-30 Jesse Thilo <jthilo@gnu.org>
14700
14701 * src/files.c: Added <unistd.h> for unlink().
14702
14703 * src/Makefile.am, src/system.h:
14704 I18n fixes.
14705
147061999-05-30 Jesse Thilo <jthilo@gnu.org>
14707
14708 * README: Added a FAQ list.
14709
14710 * configure.in, acconfig.h:
14711 I18n fixes.
14712
147131999-05-30 Jesse Thilo <jthilo@gnu.org>
14714
14715 * doc/FAQ, doc/Makefile.am:
14716 Added a FAQ list.
14717
147181999-05-19 Jesse Thilo <jthilo@gnu.org>
14719
14720 * src/alloc.h, src/symtab.h, src/version.c:
14721 Protected inclusion of "config.h" with HAVE_CONFIG_H.
14722
147231999-04-18 Jesse Thilo <jthilo@gnu.org>
14724
14725 * src/.cvsignore, src/Makefile.am:
14726 Reorganized: sources in `src', documentation in `doc'.
14727
14728 * src/lex.c (literalchar):
14729 fixed the code for escaping double quotes (thanks
14730 Jonathan Czisny.)
14731
147321999-04-18 Jesse Thilo <jthilo@gnu.org>
14733
14734 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
14735 Adjusted paths to reflect directory reorganization.
14736
147371999-04-18 Jesse Thilo <jthilo@gnu.org>
14738
14739 * doc/.cvsignore, doc/Makefile.am:
14740 Reorganized: sources in `src', documentation in `doc'.
14741
147421999-04-18 Jesse Thilo <jthilo@gnu.org>
14743
14744 * configure.in:
14745 Updated AC_INIT file to reflect directory reorganization.
14746
14747 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
14748 Reorganized: sources in `src', documentation in `doc'.
14749
147501999-04-13 Jesse Thilo <jthilo@gnu.org>
14751
14752 * src/allocate.c:
14753 Don't declare calloc() and realloc() if not necessary.
14754
147551999-04-13 Jesse Thilo <jthilo@gnu.org>
14756
14757 * configure.in, acconfig.h, acinclude.m4:
14758 Don't declare calloc() and realloc() if not necessary.
14759
147601999-03-23 Jesse Thilo <jthilo@gnu.org>
14761
14762 * po/.cvsignore: Added i18n support.
14763
147641999-03-23 Jesse Thilo <jthilo@gnu.org>
14765
14766 * acconfig.h, configure.in, Makefile.am:
14767 Added i18n support.
14768
147691999-03-22 Jesse Thilo <jthilo@gnu.org>
14770
14771 * src/bison.s1: Fixed #line numbers.
14772
147731999-03-15 Jesse Thilo <jthilo@gnu.org>
14774
14775 * po/es.po, po/fr.po, po/nl.po, po/de.po:
14776 Added PO files from Translation Project.
14777
147781999-03-03 Jesse Thilo <jthilo@gnu.org>
14779
14780 * Makefile.am:
14781 Added support for non-ANSI compilers (ansi2knr).
14782
147831999-02-16 Jesse Thilo <jthilo@gnu.org>
14784
14785 * configure.in: Bumped version number to 1.27.
14786
14787 * Makefile.am:
14788 Added `bison.simple' to list of files removed by `make distclean'.
14789
147901999-02-12 Jesse Thilo <jthilo@gnu.org>
14791
14792 * src/files.c, src/files.h:
14793 Defined locations of parser files in config.h instead of Makefile.
14794
147951999-02-12 Jesse Thilo <jthilo@gnu.org>
14796
14797 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
14798 Defined locations of parser files in config.h instead of Makefile.
14799
148001999-02-09 Jesse Thilo <jthilo@gnu.org>
14801
14802 * Makefile.am:
14803 Removed inappropriate use of $< macro.
14804
148051999-02-05 Jesse Thilo <jthilo@gnu.org>
14806
14807 * po/Makefile.in.in, po/POTFILES.in:
14808 Add `po' directory skeleton.
14809
148101999-01-27 Jesse Thilo <jthilo@gnu.org>
14811
14812 * README: Document help-bison list.
14813
14814 * configure.in: Add check for mkstemp().
14815
148161999-01-20 Jesse Thilo <jthilo@gnu.org>
14817
14818 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
14819 Hush a few compiler warnings.
14820
14821 * src/files.c:
14822 Add tryclose(), which verifies that fclose was successful.
14823 Hush a couple of compiler warnings.
14824
148251999-01-20 Jesse Thilo <jthilo@gnu.org>
14826
14827 * Makefile.am, OChangeLog:
14828 ChangeLog is now automatically generated. Include the old version as
14829 OChangeLog.
14830
148311999-01-14 Jesse Thilo <jthilo@gnu.org>
14832
14833 * 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:
14834 Update FSF address.
14835
148361999-01-14 Jesse Thilo <jthilo@gnu.org>
14837
14838 * doc/bison.texinfo: Fix formatting glitch.
14839
14840 * doc/bison.texinfo: Update FSF address.
14841
148421999-01-14 Jesse Thilo <jthilo@gnu.org>
14843
14844 * acconfig.h: Update FSF address.
14845
148461999-01-08 Jesse Thilo <jthilo@gnu.org>
14847
14848 * src/system.h:
14849 Don't define PACKAGE here, since config.h defines it.
14850
148511998-12-30 Jesse Thilo <jthilo@gnu.org>
14852
14853 * src/reader.c: Update copyright date.
14854
14855 * src/main.c:
14856 Ditch sprintf to statically-sized buffers in fatal/warn functions in
14857 favor of output directly to stderr (avoids buffer overruns).
14858
14859 * src/reader.c: Some checks for premature EOF.
14860
14861 * 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:
14862 Use prototypes if the compiler understands them.
14863
14864 * src/files.c: Honor TMPDIR on Unix hosts.
14865 Use prototypes if the compiler understands them.
14866
14867 * src/reader.c:
14868 Fix a couple of buffer overrun bugs.
14869 Use prototypes if the compiler understands them.
14870
14871 * src/system.h: Include unistd.h and ctype.h.
14872 Use #ifdef instead of #if for NLS symbols.
14873
148741998-12-30 Jesse Thilo <jthilo@gnu.org>
14875
14876 * doc/bison.texinfo:
14877 Delete comment "consider using @set for edition number, etc..." since
14878 we now are doing so.
14879
148801998-12-30 Jesse Thilo <jthilo@gnu.org>
14881
14882 * configure.in:
14883 Use prototypes if the compiler understands them.
14884
14885 * NEWS: Document 1.26 highlights.
14886
14887 * Makefile.am: Require Automake 1.3 or later.
14888
14889 * acconfig.h:
14890 Use prototypes if the compiler understands them.
14891
148921998-12-29 Jesse Thilo <jthilo@gnu.org>
14893
14894 * src/version.c:
14895 Use VERSION symbol from automake for version number.
14896
148971998-12-29 Jesse Thilo <jthilo@gnu.org>
14898
14899 * acconfig.h, configure.in, version.cin:
14900 Use VERSION symbol from automake for version number.
14901
149021998-11-28 Jesse Thilo <jthilo@gnu.org>
14903
14904 * Makefile.am:
14905 Distribute original version of simple parser (bison.s1), not built
14906 version (bison.simple).
14907
149081998-11-28 Jesse Thilo <jthilo@gnu.org>
14909
14910 * doc/bison.texinfo: Add info dir entry.
14911
14912 * doc/bison.texinfo:
14913 Let automake put version number into documentation.
14914
149151998-11-26 Jesse Thilo <jthilo@gnu.org>
14916
14917 * src/bison.cld, src/build.com, src/vmshlp.mar:
14918 Add non-RCS files from /gd/gnu/bison.
14919
149201998-11-26 Jesse Thilo <jthilo@gnu.org>
14921
14922 * doc/bison.1:
14923 Document the BISON_HAIRY and BISON_SIMPLE variables.
14924
149251998-11-25 Jesse Thilo <jthilo@gnu.org>
14926
14927 * src/version.c: Build version.c automatically.
14928
14929 * src/reader.c:
14930 Fix token numbering (used to start at 258, not 257).
14931
14932 * src/system.h: Include config.h.
14933
14934 * src/getargs.c: Update bug report address.
14935
14936 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
14937 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
14938
149391998-11-25 Jesse Thilo <jthilo@gnu.org>
14940
14941 * Makefile.am:
14942 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
14943
14944 * configure.in, version.cin:
14945 Build version.c automatically.
14946
14947 * AUTHORS: Add AUTHORS file.
14948
14949 * README: Update bug report address.
14950
14951 * bison.simple:
14952 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
14953
14954 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
14955 Add automake stuff.
14956
149571998-11-25 Jesse Thilo <jthilo@gnu.org>
14958
14959 * doc/bison.texinfo: Clean up some formatting.
14960
149611998-05-05 Richard Stallman <rms@gnu.org>
14962
14963 * doc/bison.texinfo:
14964 Explain better why to make a pure parser.
14965
149661998-01-05 Richard Stallman <rms@gnu.org>
14967
14968 * src/files.c (openfiles):
14969 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
14970 find a temporary directory, if possible. Do not unlink files while
14971 they are open.
14972
149731997-08-25 Richard Stallman <rms@gnu.org>
14974
14975 * src/reader.c (stack_offset;):
14976 Change some warni to warns.
14977
14978 * src/lex.c (literalchar): Use warns, not warni.
14979
149801997-06-28 Richard Stallman <rms@gnu.org>
14981
14982 * src/bison.s1: Add a Bison version comment.
14983
14984 * src/main.c (fatal, warn, berror):
14985 Use program_name.
14986
149871997-06-28 Richard Stallman <rms@gnu.org>
14988
14989 * Makefile.in (bison_version): New variable.
14990 (dist): Use that variable.
14991 (bison.s1): Substitute the Bison version into bison.simple.
14992
14993 * bison.simple: Add a Bison version comment.
14994
149951997-06-18 Richard Stallman <rms@gnu.org>
14996
14997 * src/main.c (fatal, warn, berror):
14998 Make error messages standard.
14999 (toomany): Improve error message text.
15000
15001 * 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:
15002 new.h renamed to alloc.h.
15003
150041997-06-18 Richard Stallman <rms@gnu.org>
15005
15006 * Makefile.in: new.h renamed to alloc.h.
15007
150081997-05-24 Richard Stallman <rms@gnu.org>
15009
15010 * src/lex.c (literalchar):
15011 Fix the code for escaping \, " and '.
15012
15013 (lex): Avoid trouble when there are many chars
15014 to discard in a char literal with just several chars in it.
15015
150161997-05-17 Richard Stallman <rms@gnu.org>
15017
15018 * src/bison.s1:
15019 Use malloc, if using alloca is troublesome.
15020 (YYSTACK_USE_ALLOCA): New flag macro.
15021 Define it for some systems and compilers.
15022 (YYSTACK_ALLOC): New macro.
15023 (yyparse): Use YYSTACK_ALLOC to allocate stack.
15024 If it was malloc'd, free it.
15025
150261997-05-17 Richard Stallman <rms@gnu.org>
15027
15028 * bison.simple:
15029 Use malloc, if using alloca is troublesome.
15030 (YYSTACK_USE_ALLOCA): New flag macro.
15031 Define it for some systems and compilers.
15032 (YYSTACK_ALLOC): New macro.
15033 (yyparse): Use YYSTACK_ALLOC to allocate stack.
15034 If it was malloc'd, free it.
15035
150361997-04-23 Richard Stallman <rms@gnu.org>
15037
15038 * src/bison.s1:
15039 (alloca) [__hpux]: Always define as __builtin_alloca.
15040
150411997-04-23 Richard Stallman <rms@gnu.org>
15042
15043 * bison.simple:
15044 (alloca) [__hpux]: Always define as __builtin_alloca.
15045
150461997-04-22 Richard Stallman <rms@gnu.org>
15047
15048 * src/bison.s1:
15049 [__hpux]: Include alloca.h (right for HPUX 10)
15050 instead of declaring alloca (right for HPUX 9).
15051
15052 * src/bison.s1 (__yy_memcpy):
15053 Declare arg `count' as unsigned int.
15054 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
15055
150561997-04-22 Richard Stallman <rms@gnu.org>
15057
15058 * bison.simple:
15059 [__hpux]: Include alloca.h (right for HPUX 10)
15060 instead of declaring alloca (right for HPUX 9).
15061
15062 * bison.simple (__yy_memcpy):
15063 Declare arg `count' as unsigned int.
15064 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
15065
150661997-01-03 Richard Stallman <rms@gnu.org>
15067
15068 * src/allocate.c: [__STDC__ or _MSC_VER]:
15069 Declare calloc and realloc to return void *.
15070
150711997-01-02 Richard Stallman <rms@gnu.org>
15072
15073 * src/system.h:
15074 [_MSC_VER]: Include stdlib.h and process.h.
15075 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
15076
15077 * src/main.c (main): Return FAILURE as a value.
15078 (printable_version): Declare arg as int, not char.
15079
150801997-01-02 Richard Stallman <rms@gnu.org>
15081
15082 * Makefile.in (dist):
15083 Explicitly check for symlinks, and copy them.
15084
150851996-12-19 Richard Stallman <rms@gnu.org>
15086
15087 * src/files.c:
15088 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
15089
150901996-12-18 Paul Eggert <eggert@gnu.org>
15091
15092 * src/bison.s1 (yyparse):
15093 If __GNUC__ and YYPARSE_PARAM are both defined,
15094 declare yyparse to have a void * argument.
15095
150961996-12-18 Paul Eggert <eggert@gnu.org>
15097
15098 * bison.simple (yyparse):
15099 If __GNUC__ and YYPARSE_PARAM are both defined,
15100 declare yyparse to have a void * argument.
15101
151021996-12-17 Richard Stallman <rms@gnu.org>
15103
15104 * src/reduce.c (nbits): Add some casts.
15105
151061996-08-12 Richard Stallman <rms@gnu.org>
15107
15108 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
15109
151101996-08-12 Richard Stallman <rms@gnu.org>
15111
15112 * bison.simple: Test _MSDOS as well as _MSDOS_.
15113
151141996-07-31 Richard Stallman <rms@gnu.org>
15115
15116 * src/bison.s1:
15117 [__sun && __i386]: Include alloca.h.
15118
151191996-07-31 Richard Stallman <rms@gnu.org>
15120
15121 * bison.simple:
15122 [__sun && __i386]: Include alloca.h.
15123
151241996-07-30 Richard Stallman <rms@gnu.org>
15125
15126 * src/bison.s1: Comment change.
15127
15128 * src/bison.s1: Test _MSDOS_, not MSDOS.
15129
151301996-07-30 Richard Stallman <rms@gnu.org>
15131
15132 * bison.simple: Comment change.
15133
15134 * bison.simple: Test _MSDOS_, not MSDOS.
15135
151361996-06-01 Richard Stallman <rms@gnu.org>
15137
15138 * 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:
15139 Insert `_' macro around many string constants.
15140
15141 * src/main.c:
15142 Insert `_' macro around many string constants.
15143
15144 (main): Call setlocale, bindtextdomain and textdomain.
15145
15146 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
15147 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
15148 [ENABLE_NLS]: Include libintl.h.
15149 [ENABLE_NLS] (gettext): Define.
15150 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
15151 (N_, PACKAGE, LOCALEDIR): New macros.
15152
151531996-06-01 Richard Stallman <rms@gnu.org>
15154
15155 * POTFILES.in: New file.
15156
15157 * Makefile.in (allocate.o):
15158 Define target explicitly.
15159
15160 * Makefile.in (CFLAGS): Set to @CFLAGS@.
15161 (LDFLAGS): Set to @LDFLAGS@.
15162 (configure): Run autoconf only if preceding `cd' succeeds.
15163 (bison.s1): Redirect output to temporary file then move the
15164 temporary to the target, rather than redirecting directly to bison.s1.
15165 (clean): Remove config.status and config.log.
15166 (distclean): Don't remove config.status here.
15167
151681996-05-12 Richard Stallman <rms@gnu.org>
15169
15170 * src/bison.s1:
15171 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
15172
151731996-05-12 Richard Stallman <rms@gnu.org>
15174
15175 * bison.simple:
15176 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
15177
151781996-05-11 Richard Stallman <rms@gnu.org>
15179
15180 * src/bison.s1 (__yy_memcpy):
15181 Really reorder the args, as was supposedly done on Feb 14 1995.
15182 (yyparse): Calls changed accordingly.
15183
151841996-05-11 Richard Stallman <rms@gnu.org>
15185
15186 * Makefile.in (dist): Don't use $(srcdir).
15187
15188 * bison.simple (__yy_memcpy):
15189 Really reorder the args, as was supposedly done on Feb 14 1995.
15190 (yyparse): Calls changed accordingly.
15191
151921996-01-27 Richard Stallman <rms@gnu.org>
15193
15194 * src/output.c (output_rule_data):
15195 Test YYERROR_VERBOSE in the conditional
15196 around the definition of ttyname.
15197
151981995-12-29 Richard Stallman <rms@gnu.org>
15199
15200 * src/bison.s1:
15201 Fix line numbers in #line commands.
15202
152031995-12-29 Richard Stallman <rms@gnu.org>
15204
15205 * bison.simple:
15206 Fix line numbers in #line commands.
15207
152081995-12-27 Richard Stallman <rms@gnu.org>
15209
15210 * src/bison.s1 (YYPARSE_PARAM_DECL):
15211 In C++, make it always null.
15212 (YYPARSE_PARAM_ARG): New macro.
15213 (yyparse): Use YYPARSE_PARAM_ARG.
15214
152151995-12-27 Richard Stallman <rms@gnu.org>
15216
15217 * bison.simple (YYPARSE_PARAM_DECL):
15218 In C++, make it always null.
15219 (YYPARSE_PARAM_ARG): New macro.
15220 (yyparse): Use YYPARSE_PARAM_ARG.
15221
152221995-11-29 Richard Stallman <rms@gnu.org>
15223
15224 * doc/bison.texinfo:
15225 Describe literal string tokens, %raw, %no_lines, %token_table.
15226
152271995-11-29 Daniel Hagerty <hag@gnu.org>
15228
15229 * doc/bison.texinfo: Fixed update date
15230
152311995-10-16 Richard Stallman <rms@gnu.org>
15232
15233 * src/version.c: Version 1.25.
15234
152351995-10-16 Richard Stallman <rms@gnu.org>
15236
15237 * NEWS: *** empty log message ***
15238
152391995-10-16 Richard Stallman <rms@gnu.org>
15240
15241 * doc/bison.1, doc/bison.rnh:
15242 Add new options.
15243
152441995-10-15 Richard Stallman <rms@gnu.org>
15245
15246 * src/vmsgetargs.c, src/getargs.c:
15247 Added -n, -k, and -raw switches.
15248 (noparserflag, toknumflag, rawtoknumflag): New variables.
15249
15250 * src/symtab.h (SALIAS):
15251 New #define for adding aliases to %token.
15252 (struct bucket): Added `alias' field.
15253
15254 * src/reduce.c (reduce_grammar):
15255 Revise error message.
15256 (print_notices): Remove final `.' from error message.
15257
15258 * src/reader.c (reader_output_yylsp):
15259 New function.
15260 (readgram): Use `#if 0' around code that accepted %command
15261 inside grammar rules: The documentation doesn't allow it,
15262 and it will fail since the %command processors scan for the next %.
15263 (parse_token_decl): Extended the %token
15264 declaration to allow a multi-character symbol as an alias.
15265 (parse_thong_decl): New function.
15266 (read_declarations): Added %thong declarations.
15267 (read_declarations): Handle NOOP to deal with allowing
15268 % declarations as another means to specify the flags.
15269 (readgram): Allow %prec prior to semantics embedded in a rule.
15270 (skip_to_char, read_declarations, copy_definition)
15271 (parse_token_decl, parse_start_decl, parse_type_decl)
15272 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
15273 (get_type_name, copy_guard, copy_action, readgram)
15274 (get_type, packsymbols): Revised most error messages.
15275 Changed `fatal' to `warnxxx' to avoid aborting for error.
15276 Revised and use multiple warnxxx functions to avoid using VARARGS1.
15277 (read_declarations): Improve the error message for
15278 an invalid character. Do not abort.
15279 (read_declarations, copy_guard, copy_action): Use
15280 printable_version to avoid unprintable characters in printed output.
15281 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
15282 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
15283 Allow the type of a non-terminal can be given
15284 more than once, as long as all specifications give the same type.
15285
15286 * src/output.c:
15287 (output_headers, output_trailers, output, output_gram)
15288 (output_rule_data): Implement noparserflag variable.
15289 Implement toknumflag variable.
15290 (output): Call reader_output_yylsp to output LTYPESTR.
15291
15292 * src/main.c (main):
15293 If reader sees an error, don't process the grammar.
15294 (fatals): Updated to not use VARARGS1.
15295 (printable_version, int_to_string, warn, warni, warns, warnss)
15296 (warnsss): New error reporting functions. Avoid abort for error.
15297
15298 * src/lex.h:
15299 Added THONG and NOOP for alias processing.
15300 Added SETOPT for the new code that allows setting options with %flags.
15301
15302 * src/lex.c:
15303 Include getopt.h. Add some extern decls.
15304 (safegetc): New function to deal with EOF gracefully.
15305 (literalchar); new function to deal with reading \ escapes.
15306 (lex): Use literalchar.
15307 (lex): Implemented "..." tokens.
15308 (literalchar, lex, parse_percent_token): Made tokenbuffer
15309 always contain the token. This includes growing the token
15310 buffer while reading an integer.
15311 (parse_percent_token): Replaced if-else statement with percent_table.
15312 (parse_percent_token): Added % declarations as another
15313 way to specify the flags -n, -l, and -r. Also added hooks for
15314 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
15315 major changes to files.c.
15316 (lex) Retain in the incoming stream a character following
15317 an incorrect '/'.
15318 (skip_white_space, lex): Revised most error messages
15319 and changed fatal to warn to avoid aborting.
15320 (percent_table): Added %thong declarations.
15321
15322 * src/gram.h: Comment changes.
15323
15324 * src/files.c (openfiles, open_extra_files, done):
15325 Add faction flag
15326 and actfile file. Handle noparserflag. Both for -n switch.
15327
15328 * src/conflicts.c (resolve_sr_conflict):
15329 Remove use of alloca.
15330
153311995-06-01 Jim Meyering <meyering@gnu.org>
15332
15333 * doc/bison.texinfo: *** empty log message ***
15334
153351995-05-06 Richard Stallman <rms@gnu.org>
15336
15337 * src/bison.s1: Comment change.
15338
153391995-05-06 Richard Stallman <rms@gnu.org>
15340
15341 * bison.simple: Comment change.
15342
153431995-05-03 Richard Stallman <rms@gnu.org>
15344
15345 * src/version.c: Version now 1.24.
15346
15347 * src/bison.s1: Change distribution terms.
15348
15349 * src/version.c: Version now 1.23.
15350
153511995-05-03 Richard Stallman <rms@gnu.org>
15352
15353 * doc/bison.texinfo:
15354 Rewrite "Conditions for Using Bison".
15355 Update version to 1.24.
15356
153571995-05-03 Richard Stallman <rms@gnu.org>
15358
15359 * bison.simple: Change distribution terms.
15360
153611995-02-23 Richard Stallman <rms@gnu.org>
15362
15363 * src/files.c: Test __VMS_POSIX as well as VMS.
15364
153651995-02-14 Jim Meyering <meyering@gnu.org>
15366
15367 * src/bison.s1 (__yy_memcpy):
15368 Renamed from __yy_bcopy to avoid
15369 confusion. Reverse FROM and TO arguments to be consistent with
15370 those of memcpy.
15371
153721995-02-14 Jim Meyering <meyering@gnu.org>
15373
15374 * bison.simple (__yy_memcpy):
15375 Renamed from __yy_bcopy to avoid
15376 confusion. Reverse FROM and TO arguments to be consistent with
15377 those of memcpy.
15378
153791994-11-10 David J. MacKenzie <djm@gnu.org>
15380
15381 * NEWS: reformat
15382
15383 * NEWS: New file.
15384
15385 * Makefile.in (DISTFILES): Include NEWS.
15386
15387 * Makefile.in (DISTFILES):
15388 Include install-sh, not install.sh.
15389
15390 * configure.in: Update to Autoconf v2 macro names.
15391
153921994-10-05 David J. MacKenzie <djm@gnu.org>
15393
15394 * Makefile.in: fix typo
15395
15396 * Makefile.in (prefix, exec_prefix):
15397 Let configure set them.
15398
153991994-09-28 David J. MacKenzie <djm@gnu.org>
15400
15401 * Makefile.in: Set datadir to $(prefix)/share.
15402
154031994-09-15 Richard Stallman <rms@gnu.org>
15404
15405 * src/bison.s1:
15406 Update copyright notice and GPL version.
15407
154081994-09-15 Richard Stallman <rms@gnu.org>
15409
15410 * bison.simple:
15411 Update copyright notice and GPL version.
15412
154131994-07-12 Richard Stallman <rms@gnu.org>
15414
15415 * src/reduce.c, src/reader.c:
15416 entered into RCS
15417
154181994-05-05 David J. MacKenzie <djm@gnu.org>
15419
15420 * Makefile.in: entered into RCS
15421
154221994-03-26 Richard Stallman <rms@gnu.org>
15423
15424 * src/bison.s1: entered into RCS
15425
154261994-03-26 Richard Stallman <rms@gnu.org>
15427
15428 * bison.simple: entered into RCS
15429
154301994-03-25 Richard Stallman <rms@gnu.org>
15431
15432 * src/main.c: entered into RCS
15433
154341994-03-24 Richard Stallman <rms@gnu.org>
15435
15436 * src/conflicts.c: entered into RCS
15437
154381994-01-02 Richard Stallman <rms@gnu.org>
15439
15440 * Makefile.in: *** empty log message ***
15441
154421993-11-21 Richard Stallman <rms@gnu.org>
15443
15444 * src/bison.s1: *** empty log message ***
15445
154461993-11-21 Richard Stallman <rms@gnu.org>
15447
15448 * doc/bison.texinfo: entered into RCS
15449
15450 * doc/bison.texinfo: *** empty log message ***
15451
154521993-11-21 Richard Stallman <rms@gnu.org>
15453
15454 * bison.simple: *** empty log message ***
15455
154561993-10-25 David J. MacKenzie <djm@gnu.org>
15457
15458 * doc/bison.texinfo: *** empty log message ***
15459
154601993-10-19 Richard Stallman <rms@gnu.org>
15461
15462 * src/bison.s1: *** empty log message ***
15463
154641993-10-19 Richard Stallman <rms@gnu.org>
15465
15466 * bison.simple: *** empty log message ***
15467
154681993-10-14 Richard Stallman <rms@gnu.org>
15469
15470 * src/bison.s1: *** empty log message ***
15471
154721993-10-14 Richard Stallman <rms@gnu.org>
15473
15474 * bison.simple: *** empty log message ***
15475
154761993-09-14 David J. MacKenzie <djm@gnu.org>
15477
15478 * doc/bison.texinfo: *** empty log message ***
15479
154801993-09-13 Noah Friedman <friedman@gnu.org>
15481
15482 * Makefile.in: *** empty log message ***
15483
154841993-09-10 Richard Stallman <rms@gnu.org>
15485
15486 * src/conflicts.c: *** empty log message ***
15487
15488 * src/system.h: entered into RCS
15489
154901993-09-10 Richard Stallman <rms@gnu.org>
15491
15492 * doc/bison.1: entered into RCS
15493
154941993-09-06 Noah Friedman <friedman@gnu.org>
15495
15496 * src/version.c: entered into RCS
15497
154981993-09-06 Noah Friedman <friedman@gnu.org>
15499
15500 * Makefile.in: *** empty log message ***
15501
155021993-07-30 David J. MacKenzie <djm@gnu.org>
15503
15504 * Makefile.in: *** empty log message ***
15505
155061993-07-24 Richard Stallman <rms@gnu.org>
15507
15508 * src/bison.s1: *** empty log message ***
15509
155101993-07-24 Richard Stallman <rms@gnu.org>
15511
15512 * bison.simple: *** empty log message ***
15513
155141993-07-08 David J. MacKenzie <djm@gnu.org>
15515
15516 * Makefile.in: *** empty log message ***
15517
155181993-07-04 Richard Stallman <rms@gnu.org>
15519
15520 * src/bison.s1: *** empty log message ***
15521
155221993-07-04 Richard Stallman <rms@gnu.org>
15523
15524 * bison.simple: *** empty log message ***
15525
155261993-06-26 David J. MacKenzie <djm@gnu.org>
15527
15528 * src/getargs.c: entered into RCS
15529
155301993-06-26 David J. MacKenzie <djm@gnu.org>
15531
15532 * doc/bison.texinfo: *** empty log message ***
15533
15534 * doc/bison.1: New file.
15535
155361993-06-25 Richard Stallman <rms@gnu.org>
15537
15538 * src/getargs.c: New file.
15539
155401993-06-16 Richard Stallman <rms@gnu.org>
15541
15542 * src/bison.s1: *** empty log message ***
15543
155441993-06-16 Richard Stallman <rms@gnu.org>
15545
15546 * bison.simple: *** empty log message ***
15547
155481993-06-03 Richard Stallman <rms@gnu.org>
15549
15550 * src/bison.s1: New file.
15551
155521993-06-03 Richard Stallman <rms@gnu.org>
15553
15554 * doc/bison.texinfo: *** empty log message ***
15555
155561993-06-03 Richard Stallman <rms@gnu.org>
15557
15558 * bison.simple: New file.
15559
155601993-05-19 Richard Stallman <rms@gnu.org>
15561
15562 * doc/bison.texinfo: New file.
15563
155641993-05-07 Noah Friedman <friedman@gnu.org>
15565
15566 * Makefile.in: *** empty log message ***
15567
155681993-04-28 Noah Friedman <friedman@gnu.org>
15569
15570 * src/reader.c: *** empty log message ***
15571
155721993-04-23 Noah Friedman <friedman@gnu.org>
15573
15574 * src/alloc.h: entered into RCS
15575
155761993-04-20 David J. MacKenzie <djm@gnu.org>
15577
15578 * src/version.c: *** empty log message ***
15579
15580 * src/files.c, src/allocate.c:
15581 entered into RCS
15582
15583 * src/reader.c: *** empty log message ***
15584
15585 * src/lex.c: entered into RCS
15586
15587 * src/conflicts.c: New file.
15588
15589 * src/symtab.c: entered into RCS
15590
15591 * src/alloc.h: New file.
15592
15593 * src/LR0.c: entered into RCS
15594
155951993-04-18 Noah Friedman <friedman@gnu.org>
15596
15597 * src/reader.c: New file.
15598
15599 * src/version.c: *** empty log message ***
15600
156011993-04-18 Noah Friedman <friedman@gnu.org>
15602
15603 * Makefile.in: *** empty log message ***
15604
156051993-04-17 Noah Friedman <friedman@gnu.org>
15606
15607 * Makefile.in: *** empty log message ***
15608
156091993-04-15 Richard Stallman <rms@gnu.org>
15610
15611 * src/main.c, src/files.c:
15612 New file.
15613
156141993-04-15 Noah Friedman <friedman@gnu.org>
15615
15616 * configure.in: entered into RCS
15617
15618 * configure.in: *** empty log message ***
15619
15620 * configure.in: New file.
15621
156221993-04-14 Richard Stallman <rms@gnu.org>
15623
15624 * Makefile.in: New file.
15625
156261993-04-13 Richard Stallman <rms@gnu.org>
15627
15628 * src/version.c: New file.
15629
156301993-03-25 Richard Stallman <rms@gnu.org>
15631
15632 * src/output.c: entered into RCS
15633
156341992-09-25 Richard Stallman <rms@gnu.org>
15635
15636 * configure.bat: entered into RCS
15637
156381992-06-22 Richard Stallman <rms@gnu.org>
15639
15640 * src/vmsgetargs.c: entered into RCS
15641
156421992-06-22 Richard Stallman <rms@gnu.org>
15643
15644 * doc/bison.rnh: entered into RCS
15645
156461992-04-20 David J. MacKenzie <djm@gnu.org>
15647
15648 * README: entered into RCS
15649
156501992-01-22 Richard Stallman <rms@gnu.org>
15651
15652 * src/machine.h: entered into RCS
15653
156541991-12-21 Richard Stallman <rms@gnu.org>
15655
15656 * src/lalr.c, src/closure.c:
15657 entered into RCS
15658
156591991-12-20 Richard Stallman <rms@gnu.org>
15660
15661 * src/state.h: entered into RCS
15662
156631991-12-18 Richard Stallman <rms@gnu.org>
15664
15665 * src/print.c, src/nullable.c, src/derives.c:
15666 entered into RCS
15667
156681991-11-03 David J. MacKenzie <djm@gnu.org>
15669
15670 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
15671 entered into RCS
15672
156731988-09-09 Richard Stallman <rms@gnu.org>
15674
15675 * src/bison.hairy: entered into RCS
15676
156771987-12-16 Richard Stallman <rms@gnu.org>
15678
15679 * REFERENCES: entered into RCS
dc546b0f 15680
f294a2c2 15681
04098407 15682 -----
f294a2c2 15683
04098407 15684 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
e2a21b6f
PE
15685 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
15686 Software Foundation, Inc.
f294a2c2 15687
04098407
PE
15688 Copying and distribution of this file, with or without
15689 modification, are permitted provided the copyright notice and this
15690 notice are preserved.