]> git.saurik.com Git - bison.git/blame - ChangeLog
(YYERROR): Move code from yyerrlab1 to here, so that
[bison.git] / ChangeLog
CommitLineData
4196b931
PE
12003-01-17 Paul Eggert <eggert@twinsun.com>
2
3 * src/output.c (symbol_printers_output): Fix typo that led
4 to core dump. Problem reported by Antonio Rus in
5 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
6
3ae831b4
AD
72003-01-13 Akim Demaille <akim@epita.fr>,
8 Quoc Peyrot <chojin@lrde.epita.fr>,
9 Robert Anisko <anisko_r@lrde.epita.fr>
10
11 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
12 when the stacks contain one element, as the loop would otherwise
13 free the last state, and then use the top state (the one we just
14 popped). This means that the initial elements will not be freed
15 explicitly, as is the case in yacc.c; it is not a problem, as
16 these elements have fake values.
17
e3aa65c5
PE
182003-01-11 Paul Eggert <eggert@twinsun.com>
19
20 * NEWS: %expect-violations are now just warnings, reverting
21 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
22 bootstrapping problem reported by Matthias Klose; see
23 <http://mail.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
24 * src/conflicts.c (conflicts_print): Likewise.
25 * tests/conflicts.at (%expect not enough, %expect too much,
26 %expect with reduce conflicts): Likewise.
27 * doc/bison.texinfo (Expect Decl): Document this. Also mention
28 that the warning is enabled if the number of conflicts changes
29 (not necessarily increases).
30
31 * src/getargs.c (version): Update copyright year.
32
f0057011
AD
332003-01-09 Akim Demaille <akim@epita.fr>
34
35 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
36
1ee6d2a0
PE
372003-01-08 Paul Eggert <eggert@twinsun.com>
38
39 * Makefile.maint (WGETFLAGS):
40 New macro, containing "-C off" to disable proxy caches.
41 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
42 (rel-check): Use $(WGET) instead of wget.
43
d4fd77c4
PE
442003-01-06 Paul Eggert <eggert@twinsun.com>
45
46 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
47 the GLR paper of Scott, Johnstone and Hussain.
48
464c6927
PE
492003-01-04 Paul Eggert <eggert@twinsun.com>
50
d600ee67
PE
51 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
52 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
53 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
54 (EXTRA_LIBRARIES): New var, for liby.a.
55 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
56 (EXTRA_SCRIPTS): New var, for yacc.
57
464c6927
PE
58 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
59 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
60 Problem reported by Nelson H. F. Beebe.
61
622003-01-03 Paul Eggert <eggert@twinsun.com>
63
64 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
65 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
66 when compiling Bison 1.875's `bitset bset = obstack_alloc
67 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
68
69 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
70 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
71 grow to a huge size with typical invocation.
d600ee67 72
464c6927
PE
73 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
74 Use the pattern recommended by Autoconf 2.57, except also protect
75 against double-definition.
76 * src/system.h: Likewise.
77 Portability issues reported by Nelson H. F. Beebe.
d600ee67 78
464c6927
PE
79 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
80 All uses changed. Provide a definition in both C and C++.
81 (yytrue, yyfalse): Define even if defined (__cplusplus).
82
83 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
84 Reported by Nelson H. F. Beebe.
d600ee67 85
464c6927
PE
86 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
87
0f42c7d5
PE
882003-01-02 Paul Eggert <eggert@twinsun.com>
89
90 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
91 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
92 Bug reported by Nelson H. F. Beebe.
93
dc546b0f
PE
942003-01-01 Paul Eggert <eggert@twinsun.com>
95
96 * Version 1.875.
97
2c09b6a7
PE
982002-12-30 Paul Eggert <eggert@twinsun.com>
99
100 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
101 Moved here from...
102 (<INITIAL>","): Here. This causes stray "," to be treated
103 more uniformly.
104
dc546b0f 105 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
106 last brace in braced code when not in Yacc mode, for compatibility
107 with Bison 1.35. This resurrects the 2001-12-15 patch to
108 src/reader.c.
109
110 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
111 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
112
535c0f63
PE
1132002-12-28 Paul Eggert <eggert@twinsun.com>
114
115 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
116 that of SYM's type. This fixes Debian bug 168069, reported by
117 Thomas Olsson.
d600ee67 118
963fcc17
PE
1192002-12-28 Paul Eggert <eggert@twinsun.com>
120
121 Version 1.75f.
122
123 Switch back to the Yacc style of conflict reports, undoing some
124 of the 2002-07-30 change.
125 * doc/bison.texinfo (Understanding): Use Yacc style for
126 conflict reports. Also, use new way of locating rules.
127 * src/conflicts.c (conflict_report):
128 Renamed from conflict_report_yacc, removing the old
129 'conflict_report'. Translate the entire conflict report at once,
130 so that we don't assume that "," has the same interpretation in
131 all languages.
132 (conflicts_output): Use Yacc-style conflict report for each state,
133 instead of our more-complicated style.
134 (conflicts_print): Use Yacc-style conflict report, except print
135 the input file name when not emulating Yacc.
136 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
137 Conflicted Reduction, %expect not enough, %expect too much,
138 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
139 * tests/existing.at (GNU Cim Grammar): Likewise.
140 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
141
142 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
143 fatal): Don't invoke fflush; it's not needed and it might even be
144 harmful for stdout, as stdout might not be open.
145 * src/reduce.c (reduce_print): Likewise.
146
b1efe548
PE
1472002-12-27 Paul Eggert <eggert@twinsun.com>
148
149 Fix a bug where error locations were not being recorded correctly.
150 This problem was originally reported by Paul Hilfinger in
e3aa65c5 151 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
152
153 * data/yacc.c (yyparse): New local var yylerrsp, to record the
154 top of the location stack's error locations.
155 (yyerrlab): Set it. When discarding a token, push its location
156 onto yylerrsp so that we don't lose track of the error's end.
157 (yyerrlab1): Now is only the target of YYERROR, so that we can
158 properly record the location of the action that failed. For GCC
159 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
160 GCC warning about yyerrlab1 being unused if YYERROR is unused.
161 (yyerrlab2): New label, which yyerrlab now falls through to.
162 Compute the error's location by applying YYLLOC_DEFAULT to
163 the locations of all the symbols that went into the error.
164 * doc/bison.texinfo (Location Default Action): Mention that
165 YYLLOC_DEFAULT is also invoked for syntax errors.
166 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
167 Error locations include the locations of all the tokens that were
168 discarded, not just the last token.
d600ee67 169
983c5c2c
PE
1702002-12-26 Paul Eggert <eggert@twinsun.com>
171
b1efe548
PE
172 * src/files.c: Include quote.h.
173 (compute_output_file_names): Warn if we detect conflicting
174 outputs to the same file. This should catch the misunderstanding
175 exemplified by Debian Bug 165349, reported by Bruce Stephens..
176
177 * src/conflicts.c (conflicts_print): If the user specifies
178 "%expect N", report an error if there are any reduce/reduce
179 conflicts. This is what the manual says should happen.
180 This fixes Debian bug 130890, reported by Anthony DeRobertis.
181 * tests/conflicts.at (%expect with reduce conflicts): New test.
182
983c5c2c
PE
183 Don't use m4_include on relative file names, as it doesn't work as
184 desired if there happens to be a file with that name under ".".
d600ee67 185
983c5c2c
PE
186 * m4sugar/version.m4: Remove; it was included but it wasn't used.
187 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
188 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
189 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
190 * src/output.c (output_skeleton): Use full path names when
191 specifying a file to include; don't rely on include path, as
192 it's unreliable when the working file contains a file with
193 that name.
d600ee67 194
983c5c2c
PE
1952002-12-25 Paul Eggert <eggert@twinsun.com>
196
197 Remove obsolete references to bison.simple and bison.hairy.
198 Problem mentioned by Aubin Mahe in
e3aa65c5 199 <http://mail.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
200 * data/glr.c: Comment fix.
201 * doc/bison.1: Remove references. Also, mention "yacc".
202
203 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
204 with -g option.
205
206 * src/parse-gram.y (declaration): Use enum "report_states" rather
207 than its numeric value 1.
208
209 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
210 opening a new one. This fixes Debian bug 165349, reported by
211 Bruce Stephens.
212
23f2d9dc
PE
2132002-12-24 Paul Eggert <eggert@twinsun.com>
214
215 Version 1.75e.
216
217 * Makefile.maint (cvs-update): Don't assume that the shell
218 supports $(...), as Solaris sh doesn't.
219
220 * src/parse-gram.y (lloc_default): Remove test for empty
221 nonterminals at the end, since it didn't change the result.
222
2232002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
224
225 If the user does not define YYSTYPE as a macro, Bison now declares it
226 using typedef instead of defining it as a macro. POSIX requires this.
227 For consistency, YYLTYPE is also declared instead of defined.
228
229 %union directives can now have a tag before the `{', e.g., the
230 directive `%union foo {...}' now generates the C code
231 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
232 The default union tag is `YYSTYPE', for compatibility with Solaris 9
233 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
234 instead of `yyltype'.
235
236 `yystype' and `yyltype' are now obsolescent macros instead of being
237 typedefs or tags; they are no longer documented and will be
238 withdrawn in a future release.
239
240 * data/glr.c (b4_location_type): Remove.
241 (YYSTYPE): Renamed from yystype.
242 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
243 (struct YYLTYPE): Renamed from struct yyltype.
244 (YYLTYPE): Renamed from yyltype.
245 (yyltype, yystype): New (and obsolescent) macros,
246 for backward compatibility.
247 * data/yacc.c: Likewise.
248
249 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
250 does not specify a union tag. This is for compatibility with
251 Solaris 9 yacc.
252
253 * src/parse-gram.y (add_param): 2nd arg is now char * not char
254 const *, since it is now modified by stripping surrounding { }.
255 (current_braced_code): Remove.
256 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
257 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
258 trailing " {...}". Now of type <chars>.
259 (grammar_declaration): Adjust to bundled tokens.
260 (code_content): Remove; stripping is now done by add_param.
261 (print_token_value): Print contents of bundled tokens.
262 (token_name): New function.
263
264 * src/reader.h (braced_code, current_braced_code): Remove.
265 (token_name): New decl.
266
267 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
268 token_type, not braced_code code_kind. All uses changed.
269 (SC_PRE_CODE): New state, for scanning after a keyword that
270 has (or usually has) an immediately-following braced code.
271 (token_type): New local var, to keep track of which token type
272 to return when scanning braced code.
273 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 274 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
275 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
276 instead of returning a token type immediately.
277 (<INITIAL>"{"): Set token type.
278 (<SC_BRACED_CODE>"}"): Use it.
279 (handle_action_dollar, handle_action_at): Now returns bool
280 indicating success. Fail if ! current_rule; this prevents a core dump.
281 (handle_symbol_code_dollar, handle_symbol_code_at):
282 Remove; merge body into caller.
283 (handle_dollar, handle_at): Complain in invalid contexts.
284
285 * NEWS, doc/bison.texinfo: Document the above.
286 * NEWS: Fix years and program names in copyright notice.
287
879ca4f8
PE
2882002-12-17 Paul Eggert <eggert@twinsun.com>
289
290 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
291 Reporting, Table of Symbols): Omit mentions of %lex-param and
292 %parse-param from the documentation for now.
293
1c5fe69d
PE
2942002-12-15 Paul Eggert <eggert@twinsun.com>
295
296 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
297 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
298 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
299 disagreed with the Bison documentation. Bug
300 reported by Andrew Walrond.
d600ee67 301
1c5fe69d
PE
302 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
303 as the caller now does that.
304 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
305 (YYEMPTY): Parenthesize right hand side, since others use it.
306 (yyparse): Don't assume that our generated code is the only code
307 that sets yychar.
308
d1de5372
PE
3092002-12-13 Paul Eggert <eggert@twinsun.com>
310
311 Version 1.75d.
312
313 POSIX requires a "yacc" command.
314 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
315 (MOSTLYCLEANFILES): Add yacc.
316 (yacc): New rule.
1c5fe69d 317 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
318 as an alias for bison y.
319
320 * po/LINGUAS: Add da.
d600ee67 321
d1de5372
PE
322 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
323 problem with latest <getopt.h>.
324 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
325
326 * doc/fdl.texi: Upgrade to 1.2.
327 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
328 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
329 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
330 gnulib.
331 * config/install-sh: Sync with autotools.
332
333 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
e3aa65c5 334 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
335 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
336 locations are requested.
337 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
338 locations are requested.
339
d0f3fe23
PE
3402002-12-12 Paul Eggert <eggert@twinsun.com>
341
342 Remove unportable casts and storage allocation tricks.
343 While we're at it, remove almost all casts, since they
344 usually aren't needed and are a sign of trouble.
345
346 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
347
348 * src/derives.c (derives_compute): Do not subtract NTOKENS from
349 the pointer DSET returned by malloc; this isn't portable.
350 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
351 Similarly for DERIVES.
352 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
353 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
354 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
355
356 * src/derives.c (derives_compute): Do not bother invoking
357 int_of_rule_number, since rule numbers are integers.
358
359 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
360 rather than XMALLOC (char, N).
361
362 * src/files.c (filename_split): Rewrite to avoid cast.
363
364 * src/gram.h (symbol_number_as_item_number,
365 item_number_as_symbol_number, rule_number_as_item_number,
366 item_number_as_rule_number):
367 Now inline functions rather than macros, to avoid casts.
368 * src/state.h (state_number_as_int): Likewise.
369 * src/tables.c (state_number_to_vector_number,
370 symbol_number_to_vector_number): Likewise.
371
372 * src/gram.h (int_of_rule_number): Remove; no longer used.
373
374 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
375 since the resulting storage is always stored into.
376
377 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
378 where it's needed.
379
380 * src/muscle_tab.c (muscle_m4_output):
381 Now inline. Return bool, not int.
382 * src/state.c (state_compare): Likewise.
383 * src/symtab.c (symbol_check_defined,
384 symbol_check_alias_consistency, symbol_pack, symbol_translation,
385 hash_compare_symbol, hash_symbol):
386 Likewise.
387 * src/uniqstr.c (uniqstr_print): Likewise.
388 * src/muscle_tab.c (muscle_m4_output_processor):
389 New function, to avoid casts.
390 * src/state.c (state_comparator, stage_hasher): Likewise.
391 * src/symtab.c (symbol_check_defined_processor,
392 symbol_check_alias_consistency_processor, symbol_pack_processor,
393 symbol_translation_processor, hash_symbol_comparator,
394 hash_symbol_hasher): Likewise.
395 * src/uniqstr.c (uniqstr_print_processor): Likewise.
396 * src/muscle_tab.c (muscles_m4_output):
397 Use new functions instead of casting old functions unportably.
398 * src/state.c (state_hash_new): Likewise.
399 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
400 symbols_token_translations_init):
401 Likewise.
402 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
403
404 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
405 var instead of casting to long, to avoid casts.
406 (prepare_states): Use MALLOC rather than alloca, so that we don't
407 have to worry about alloca.
408 * src/state.c (state_hash_lookup): Likewise.
409
410 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
411 local var instead of casting to unsigned char, to avoid casts.
412
413 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
414 STATE_ALLOC): Remove.
415 (transitions_new, errs_new, reductions_new, state_new): Use malloc
416 rather than calloc, and use offsetof to avoid allocating slightly
417 too much storage.
418 (state_new): Initialize all members.
419
420 * src/state.c (state_hash): Use unsigned accumulator, not signed.
421
422 * src/symtab.c (symbol_free): Remove; unused.
423 (symbol_get): Remove cast in lhs of assignment.
424 (symbols_do): Now static. Accept generic arguments, not
425 hashing-related ones.
426
427 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
428 (symbol_processor): Remove.
429 (symbols_do): Remove decl; now static.
430
431 * src/system.h (alloca): Remove; decl no longer needed.
432 (<stddef.h>): Include, for offsetof.
433 (<inttypes.>, <stdint.h>): Include if available.
434 (uintptr_t): New type, if system lacks it.
435 (CALLOC, MALLOC, REALLOC): New macros.
436 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
437 new macros.
438
439 * src/tables.c (table_size): Now int, to pacify GCC.
440 (table_grow, table_ninf_remap): Use signed table size.
441 (save_row): Don't bother initializing locals when not needed.
442 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
443 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
444
445 * src/vcg.h: Correct misspellings.
446
447 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
448
449
450 * src/getargs.c (getargs): Don't assume EOF == -1.
451
26b4a969
PE
4522002-12-09 Paul Eggert <eggert@twinsun.com>
453
454 Change identifier spellings to avoid collisions with names
455 that are reserved by POSIX.
456
457 Don't use names ending in _t, since POSIX reserves them.
458 For consistency, remove _e and _s endings -- they're weren't
459 needed to remove ambiguity. All uses changed.
460 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
461 turn was just renamed from struniq_t.
462 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
463 which in turn was just renamed from struniq_processor_t.
464 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
465 in turn was renamed from hash_compare_struniq_t.
466 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
467 (state_list): Renamed from state_list_t.
468 * src/assoc.h (assoc): Renamed from assoc_t.
469 * src/conflicts.c (enum conflict_resolution): Renamed from
470 enum conflict_resolution_e.
471 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
472 (rule_list): Renamed from rule_list_t.
473 * src/getargs.h (enum trace): Renamed from enum trace_e.
474 (enum report): Renamed from enum report_e.
475 * src/gram.h (item_number): Renamed from item_number_t.
476 (rule_number): Renamed from rule_number_t.
477 (struct rule_s): Remove the "rule_s" part; not used.
478 (rule): Renamed from rule_t.
479 (rule_filter): Renamed from rule_filter_t.
480 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
481 (goto_list): Renamed from goto_list_t.
482 * src/lalr.h (goto_number): Renamed from goto_number_t.
483 * src/location.h (location): Renamed from location_t.
484 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
485 and moved here from:
486 * src/muscle_tab.h (muscle_entry_t): here.
487 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
488 (rule_list): Renamed from rule_list_t.
489 * src/print_graph.c (static_graph): Renamed from graph.
490 * src/reader.h (braced_code): Renamed from braced_code_t.
491 Remove brace_code_e tag.
492 * src/relation.h (relation_node): Renamed from relation_node_t.
493 (relation_nodes): Renamed from relation_nodes_t.
494 (relation): Renamed from relation_t.
495 * src/state.h (state_number): Renamed from state_number_t.
496 (struct state): Renamed from struct state_s.
497 (state): Renamed from state_t.
498 (transitions): Renamed from transitions_t. Unused (and
499 misspelled) transtion_s tag removed.
500 (errs): Renamed from errs_t. Unused errs_s tag removed.
501 (reductions): Renamed from reductions_t. Unused tag
502 reductions_s removed.
503 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
504 (struct symbol_list): Renamed from struct symbol_list_s.
505 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
506 (struct symbol): Renamed from struct symbol_s.
507 (symbol): Renamed from symbol_t.
508 * src/tables.c (vector_number): Renamed from vector_number_t.
509 (action_number): Renamed from action_t.
510 * src/tables.h (base_number): Renamed from base_t.
511 * src/vcg.h (enum color): Renamed from enum color_e.
512 (enum textmode): Renamed from enum textmode_e.
513 (enum shape): Renamed from enum shape_e.
514 (struct colorentry): Renamed from struct colorentry_s.
515 (struct classname): Renamed from struct classname_s.
516 (struct infoname): Renamed from struct infoname_s.
517 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
518 (enum decision): Renamed from enum decision_e.
519 (enum orientation): Renamed from enum orientation_e.
520 (enum alignment): Renamed from enum alignment_e.
521 (enum arrow_mode): Renamed from enum arrow_mode_e.
522 (enum crossing_type): Renamed from enum crossing_type_e.
523 (enum view): Renamed from enum view_e.
524 (struct node): Renamed from struct node_s.
525 (node): Renamed from node_t.
526 (enum linestyle): Renamed from enum linestyle_e.
527 (enum arrowstyle): Renamed from enum arrowstyle_e.
528 (struct edge): Renamed from struct edge.
529 (edge): Renamed from edge_t.
530 (struct graph): Renamed from struct graph_s.
531 (graph): Renamed from graph_t.
532 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
533 Rename value_t -> value.
534 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
535 value_t_as_yystype -> value_as_yystype.
536
537 Don't include <errno.h> in the mainstream code, since it
538 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
539 * lib/get-errno.c, lib/get-errno.h: New files.
540 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
541 get-errno.c.
542 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
543 * src/output.c (output_skeleton): Likewise.
544 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
545 instead of errno.
546 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
547 Likewise.
548 (handle_action_dollar, handle_action_at): Likewise.
549 * src/system.h: Do not include <errno.h>.
550 (TAB_EXT): Renamed from EXT_TAB.
551 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
552
553 Avoid str[a-z]*, since <string.h> reserves that name space.
554 Change all instances of "struniq" in names to "uniqstr", and
555 likewise for "STRUNIQ" and "UNIQSTR".
556 * src/uniqstr.c: Renamed from src/struniq.c.
557 * src/uniqstr.h: Renamed from src/struniq.h.
558 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
559 * src/files.c (strsuffix): Remove; unused.
560 (concat2): Renamed from stringappend. Now static.
561 * src/files.h (strsuffix, stringappend): Remove; unused.
562 * src/parse-gram.y (<chars>): Renamed from <string>.
563 (<uniqstr>): Renamed from <struniq>.
564 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
565 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
566 (struct graph_s.expand): Renamed from struct graph_s.stretch.
567 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
568 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
569 (N_EXPAND): Renamed from N_STRETCH.
570
571 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
572 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
573 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
574 Remove; unused.
575 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
576 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
577 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
578 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
579 (BASE_MAXIMUM): Renamed from BASE_MAX.
580 (BASE_MINIMUM): Renamed from BASE_MIN.
581 (ACTION_MAX): Remove; unused.
582 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
583 Unnecessary casts removed from above defines.
584
585
586 Fix misspelling in names.
587 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
588 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
589 G_NODE_ALIGNEMENT.
590
591
592 * lib/timevar.c (timevar_report): Renamed from time_report,
593 for consistency with other names.
594 * lib/timevar.h (timevar_report): New decl.
595 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
596
597
598 Sort include-file uses.
599
600 Reorder all include files under src to be in the order "system.h".
601 then the ../lib include files in angle brackets (alphabetized),
602 then the . include files in double-quotes (alphabetized). Fix
603 dependency breakages encountered in this process, as follows:
604 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
605 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
606 * src/state.h: Include "symtab.h".
607
996b1c7e
PE
6082002-12-08 Paul Eggert <eggert@twinsun.com>
609
610 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
611 since this causes problems when __file__ contains character
612 sequences like "@" that are treated specially by src/scan-skel.l.
613 Instead, just use the file's basename. This fixes the bug
614 reported by Martin Mokrejs in
e3aa65c5 615 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 616
e19c4e5d
PE
6172002-12-06 Paul Eggert <eggert@twinsun.com>
618
619 Add support for rules that do not have trailing semicolons, as
620 POSIX requires. Improve the quality of locations in Bison
621 diagnostics.
26b4a969 622
e19c4e5d
PE
623 * src/location.c: Include <quotearg.h>.
624 (empty_location): Now const.
625 (location_print): New function. Follow the recommendation of the
626 GNU Coding Standards for locations that span file boundaries.
627 * src/location.h: Do not include <quotearg.h>; no longer needed.
628 (boundary): New type.
629 (location_t): Use it. This allows locations to span file boundaries.
630 All member uses changed: file -> start.file or end.file (as needed),
631 first_line -> start.line, first_column -> start.column,
632 last_line -> end.line, last_column -> end.column.
633 (equal_boundaries): New function.
634 (LOCATION_RESET, LOCATION_STEP): Remove.
635 (LOCATION_PRINT): Remove. All callers changed to use location_print.
636 (empty_location): Now const.
637 (location_print): New decl.
638 * src/parse-gram.y (lloc_default): New function, which handles
639 empty locations more accurately.
640 (YYLLOC_DEFAULT): Use it.
641 (%token COLON): Remove.
642 (%token ID_COLON): New token.
26b4a969 643 (rules): Use it.
e19c4e5d
PE
644 (declarations, rules): Remove trailing semicolon.
645 (declaration, rules_or_grammar_declaration):
646 Allow empty (";") declaration.
647 (symbol_def): Remove empty actions; no longer needed.
648 (rules_or_grammar_declaration): Remove trailing semicolon.
649 (semi_colon.opt): Remove.
650 * src/reader.h: Include location.h.
651 (scanner_cursor): New decl.
652 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
653 rolling our own.
654 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
655 of *loc.
656 (STEP): Remove. No longer needed, now that adjust_location does
657 the work. All uses removed.
658 (scanner_cursor): New var.
659 (adjust_location): Renamed from extend_location. It now sets
660 *loc and adjusts the scanner cursor. All uses changed.
661 Don't bother testing for CR.
662 (handle_syncline): Remove location arg; now updates scanner cursor.
663 All callers changed.
664 (unexpected_end_of_file): Now accepts start boundary of token or
665 comment, not location. All callers changed. Update scanner cursor,
666 not the location.
667 (SC_AFTER_IDENTIFIER): New state.
668 (context_state): Renamed from c_context. All uses changed.
669 (id_loc, code_start, token_start): New local vars.
670 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
671 processing of Yacc white space and equivalents here.
672 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
673 instead of returning ID immediately, since we need to search for
674 a subsequent colon.
675 (<INITIAL>"'", "\""): Save token_start.
676 (<INITIAL>"%{", "{", "%%"): Save code_start.
677 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
678 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
679 BEGIN context_state at end, not INITIAL.
680 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
681 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
682 Return correct token start.
683 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
684 the start of a character, string or multiline comment is found.
685 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
686 Reduction): Adjust reported locations to match the more-precise
687 results now expected.
688 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
689 * tests/reduce.at (Useless Rules, Reduced Automaton,
690 Underivable Rules): Likewise.
691 * tests/regression.at (Invalid inputs): No longer `expecting ";"
692 or "|"' now that so many other tokens are allowed by the new grammar.
693
694 * src/complain.h (current_file): Remove duplicate decl;
695 current_file is now owned by files.h.
696 * src/complain.c, src/scan-gram.l: Include files.h.
697
6982002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 699
e19c4e5d
PE
700 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
701 promotes to int; it might be unsigned int.
702 * data/yacc.c (yy_reduce_print): Likewise.
703
704 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
705 be #defined in the prologue, not in the Bison declarations.
706 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 707
b64755e3
PE
7082002-12-02 Paul Eggert <eggert@twinsun.com>
709
710 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
711 * lib/strtoul.c: New file, from gnulib.
712 This fixes a porting bug reported by Peter Klein in
e3aa65c5 713 <http://mail.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 714
6e746484
PE
7152002-11-30 Paul Eggert <eggert@twinsun.com>
716
b64755e3
PE
717 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
718 and put only a forward declaration in the prologue. This is for
719 consistency with the other scanner helper functions.
720
6ba55592
PE
721 Type clashes now generate warnings, not errors, since it
722 appears that POSIX may allow some grammars with type clashes.
723 * src/reader.c (grammar_current_rule_check): Warn about
724 type clashes instead of complaining.
725 * tests/input.at (Type Clashes): Expect warnings, not complaints.
726
6e746484
PE
727 Add Yacc library, since POSIX requires it.
728 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
729 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
730 * lib/main.c, lib/yyerror.c: New files.
731
732 gram_error can be static; it need not be extern.
733 * src/reader.h (gram_error): Remove decl.
734 * src/parse-gram.y (gram_error): Now static. Add static decl.
735 (print_token_value): Omit parameter names from forward decl,
736 for consistency.
737
88510f9c
PE
7382002-11-29 Paul Eggert <eggert@twinsun.com>
739
6e746484
PE
740 * doc/bison.texinfo: Emphasize that yylex and yyerror must
741 be declared before being used. E.g., one should typically
742 declare them in the prologue. Use GNU coding style in examples.
743 Put "const" consistently after the type it modifies. Mention
744 that C99 supports "inline". Mention that yyerror traditionally
745 returns "int".
746
88510f9c
PE
747 %parse-param and %lex-param now take just one argument, the
748 declaration; the argument name is deduced from the declaration.
749
750 * doc/bison.texinfo (Parser Function, Pure Calling, Error
751 Reporting, Table of Symbols): Document this.
752 * src/parse-gram.y (add_param): New function.
753 (COMMA): Remove.
754 (declaration): Implement new rule for %parse-param and %lex-param.
755 * src/scan-gram.l: "," now elicits a warning, rather than being
756 a token; this is more compatible with byacc.
757 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
758
bb92250c
PE
7592002-11-27 Paul Eggert <eggert@twinsun.com>
760
761 Rename identifiers to avoid real and potential collisions.
762
763 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
764 to avoid collision with lex macro described by Bruce Lilly in
e3aa65c5 765 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
766 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
767 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
768 * src/parse-gram.y (print_token_value): Renamed from yyprint.
769 All uses changed.
770 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
771 The name "yycontrol" violates the name space rules, and this stuff
772 wasn't being used anyway.
773 (input): Remove action; this stuff wasn't being used.
774 (gram_error): Rename local variable yylloc -> loc.
775 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
776 (YY_DECL): Don't use "yy" at start of local variables.
777 All uses changed, e.g., yylloc -> loc.
778 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
779 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
780 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
781 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
782
783 * src/parse-gram.y (gram_error): loc is now const *.
784 * src/reader.h (gram_error): Likewise.
785
3af4feb2
PE
7862002-11-24 Paul Eggert <eggert@twinsun.com>
787
788 Version 1.75c.
789
790 * tests/actions.at (Actions after errors): Use an output format
791 more similar to that of the Printers and Destructors test.
792 Test the position of the ';' token too.
793 (Printers and Destructors): Likewise.
794 (Printers and Destructors: %glr-parser): Remove for now, to avoid
795 unnecessarily alarming people when the test fails.
796
797 * data/yacc.c (yyerrlab1): Move this label down, so that the
798 parser does not discard the lookahead token if the user code
799 invokes YYERROR. This change is required for POSIX conformance.
800
801 * lib/error.c: Sync with gnulib.
802
8032002-11-22 Paul Eggert <eggert@twinsun.com>
804
805 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
806 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
807 * lib/xmalloc.c: Likewise.
26b4a969 808
58004308
PE
8092002-11-20 Paul Eggert <eggert@twinsun.com>
810
811 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
812
8132002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 814
58004308
PE
815 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
816 should use `if (! x) abort ();' rather than `assert (x);', and
817 anyway it's one less thing to worry about configuring.
818
819 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
820 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
821 and replace all instances of assert with abort.
822 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
823 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
824
825 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
826 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
827 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
828 hash_find_entry, hash_rehash, hash_insert): Likewise.
829 * src/conflicts.c (resolve_sr_conflict): Likewise.
830 * src/lalr.c (set_goto_map, map_goto): Likewise.
831 * src/nullable.c (nullable_compute): Likewise.
832 * src/output.c (prepare_rules, token_definitions_output): Likewise.
833 * src/reader.c (packgram, reader): Likewise.
834 * src/state.c (state_new, state_free, state_transitions_set,
835 state_reduction_find): Likewise.
836 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
837 symbol_pack): Likewise.
838 * src/tables.c (conflict_row, pack_vector): Likewise.
839 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
840 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
841 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
842 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
843
844 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
845 (ARGMATCH_CONSTRAINT): New macro.
846 (ARGMATCH_ASSERT): Use it.
847
848 * src/system.h (verify): New macro.
849 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
850 rather than assert.
851 * src/tables.c (tables_generate): Likewise.
852
853 * src/struniq.c (struniq_assert): Now returns void, and aborts
854 if the assertion is false.
855 (struniq_assert_p): Remove.
856 * src/struniq.h: Likewise.
857
76ae8198
PE
8582002-11-18 Paul Eggert <eggert@twinsun.com>
859
860 * data/glr.c (yygetLRActions): Replace `yyindex' with
861 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
862 This fixes the regression with Sun ONE Studio 7 cc that I reported in
e3aa65c5 863 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 864
d3c4e709
AD
8652002-11-18 Akim Demaille <akim@epita.fr>
866
867 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
868 space.
869 From Tim Van Holder.
870
8d8a7238
PE
8712002-11-17 Paul Eggert <eggert@twinsun.com>
872
873 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
874 to "SyntaxError" for consistency with my 2002-11-15 change.
875
876 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
877 not define to {}, since this breaks the common use of `YYDPRINTF
878 ((...));' if a single statement is desired (e.g. before `else').
879 Work around GCC warnings by surrounding corresponding calls with
880 {} if needed.
881 (yyhasResolvedValue): Remove unused function.
882 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
883 loop body.
884 (yyreportSyntaxError): Renamed from yyreportParseError.
885 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
886 All uses changed.
887 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
888 extern when possible. Remove unused initializations.
889
b0937b22
AD
8902002-11-16 Akim Demaille <akim@epita.fr>
891
892 Augment the similarity between GLR and LALR traces.
893
894 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
895 (YY_REDUCE_PRINT): New.
896 (yyparse): Use them.
897 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
898 YYDPRINT here.
899 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
900 state reached after the reduction/recovery, since...
901 (yyparse, yyprocessOneStack): Report the state we are entering in.
902
c5e3e510
AD
9032002-11-16 Akim Demaille <akim@epita.fr>
904
905 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
906 Add support for --trace=skeleton.
907 * src/scan-skel.l: %option debug.
908 Scan strings of non-@ or \n instead of character by character.
909 (scan_skel): Handle trace_skeleton.
910 (QPUTS): New.
911 (@output_parser_name@, @output_header_name@): ``Restore'' their
912 support (used to be M4 macros).
913 * data/yacc.c: Quote larger chunks, a la glr.c.
914 * data/lalr1.cc: Likewise.
915 The header guards are no longer available, so use some other
916 string than `YYLSP_NEEDED'.
917
4c6cc1db
AD
9182002-11-16 Akim Demaille <akim@epita.fr>
919
920 Make the ``Printers and Destructors'' test more verbose, taking
921 `yacc.c''s behavior as (possibly wrong) reference.
922
923 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
924 instead of fprint on stdout.
925 Set and report the last_line of the symbols.
926 Consistently display values and locations.
927
6d9e8019
PE
9282002-11-16 Paul Eggert <eggert@twinsun.com>
929
930 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
931
6e649e65
PE
9322002-11-15 Paul Eggert <eggert@twinsun.com>
933
b25d88f6
PE
934 * tests/actions.at (Actions after errors): New test case.
935
6e649e65
PE
936 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
937 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
938 tests/action.at, tests/calc.at, tests/conflicts.at,
939 tests/cxx-type.at, tests/regression.at:
940 "parse error" -> "syntax error" for POSIX compatibility.
941 "parsing stack overflow..." -> "parser stack overflow" so
942 that code matches Bison documentation.
943
0f39aab9
AD
9442002-11-15 Akim Demaille <akim@epita.fr>
945
946 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
947 take two BRACED_CODE, not two string_content.
948 Free the scanner's obstack when we are done.
949 (code_content): New.
950 * tests/calc.at: Adjust.
951 * doc/bison.texinfo: Adjust.
952 Also, make sure to include the `,' for these declarations.
953
761c1926
AD
9542002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
955
956 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
957 definition; avoids potential autoreconf problems.
958
b0f98b10
AD
9592002-11-15 Akim Demaille <akim@epita.fr>
960
961 Always check the value returned by yyparse.
962
963 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
964 returned by yyparse.
965 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
966 Adjust calls.
967 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
968 returned by yyparse.
969
970785f1
PH
9702002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
971
972 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
973 on input.at test.
974
8fcc7db1
PE
9752002-11-14 Paul Eggert <eggert@twinsun.com>
976
7ec1b48e
PE
977 * src/output.c (output_skeleton): Call xfopen instead of
978 duplicating xfopen's body.
979
cfff7583 980 Fix bugs reported by Nelson H. F. Beebe in
e3aa65c5 981 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 982
8fcc7db1
PE
983 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
984 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
985 Group compiler. Instead, use "$CC -E bar.c". Include the .h
986 file twice in the grammar, as an extra check.
987
988 * tests/input.at (Torturing the Scanner): Surround the
989 backslash-newline tests with "#if 0", to make it less likely that
990 we'll run into compiler bugs. Bring back solitary \ inside
991 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 992 test backslash-newline in C character constant.
8fcc7db1 993
4e8d992c
AD
9942002-11-14 Akim Demaille <akim@epita.fr>
995
996 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
997 status of the compiler.
f32b346d 998 Calling `exit 1' is no longer needed.
4e8d992c
AD
999 Reported by Nelson H. F. Beebe.
1000
9501dc6e
AD
10012002-11-14 Akim Demaille <akim@epita.fr>
1002
1003 * tests/atlocal.in (CPPFLAGS): We have config.h.
1004 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
1005 New.
1006 * tests/actions.at, tests/calc.at, tests/conflicts.at,
1007 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
1008 * tests/regression.at, tests/torture.at: Use them for all the
1009 grammars that are to be compiled.
1010 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
1011 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
1012 * doc/bison.texinfo (GLR Parsers): Document `inline'.
1013
18b519c0
AD
10142002-11-14 Akim Demaille <akim@epita.fr>
1015
1016 * doc/bison.texinfo: Various formatting changes (alignments in
1017 samples, additional @group/@end group, GCS in samples.
1018 Use @deffn instead of simple @table to define the directives,
1019 macros, variables etc.
1020
9a86cdb9
PE
10212002-11-13 Paul Eggert <eggert@twinsun.com>
1022
daa33def 1023 Fix some bugs reported by Albert Chin-A-Young in
e3aa65c5 1024 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 1025
daa33def 1026 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 1027 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
1028 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
1029 * tests/headers.at (export YYLTYPE): Likewise.
1030
1031 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 1032 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 1033
9a86cdb9
PE
1034 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
1035 comments, since they're not portable. Use GNU coding style.
1036
9c1e26bd
AD
10372002-11-13 Akim Demaille <akim@epita.fr>
1038
1039 * data/yacc.c: Leave bigger chunks of quoted text.
1040 (YYDSYMPRINTF): New.
1041 Use it to report symbol activities.
1042 * data/glr.c (YYDSYMPRINTF): New.
1043 Use it.
1044
87f721cc
PE
10452002-11-12 Paul Eggert <eggert@twinsun.com>
1046
1047 Version 1.75b.
1048
1049 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
1050 (yyglrReduce): Return yyok, not 0.
1051 This should avoid the enumerated-type warnings reported
464c6927 1052 by Nelson H. F. Beebe in
e3aa65c5 1053 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
1054
1055 * lib/bbitset.h (BITSET_INLINE): Remove.
1056 * lib/bitset.h [! BITSET_INLINE]: Remove.
1057 (bitset_set, bitset_reset, bitset_test): Rename local vars
1058 to avoid shadowing warnings by GCC.
1059
1060 * data/glr.c (inline): Remove #define. It's the user's
1061 responsibility to #define it away, just like 'const'.
464c6927 1062 This fixes one of the bugs reported by Nelson H. F. Beebe in
e3aa65c5 1063 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 1064
87f721cc
PE
1065 * Makefile.maint (po-check): Scan .l and .y files instead of the
1066 .c and the .h files that they generate. This fixes the bug
1067 reported by Tim Van Holder in:
e3aa65c5 1068 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
1069 Look for N_ as well as for _. Try to avoid matching #define for
1070 N_ and _.
1071 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
1072 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
1073 * src/scan-gram.l: Revamp regular expressions so that " and '
1074 do not confuse xgettext.
1075
1076 * src/struniq.h (struniq_new): Do not declare the return type
1077 to be 'const'; this violates the C standard.
1078 * src/struniq.c (struniq_new): Likewise.
1079
be14ade5
AD
10802002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
1081
1082 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
1083 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
1084 linker.
1085
05291fbc
AD
10862002-11-12 Akim Demaille <akim@epita.fr>
1087
1088 * Makefile.maint: Sync with Autoconf:
1089 (local_updates): New.
1090
1f5fd52e
AD
10912002-11-12 Akim Demaille <akim@epita.fr>
1092
1093 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
1094
283f1e64
AD
10952002-11-12 Akim Demaille <akim@epita.fr>
1096
1097 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
1098 locations.
1099
886b69d1
AD
11002002-11-12 Akim Demaille <akim@epita.fr>
1101
1102 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
1103 not yyvalue.
1104
3df37415
AD
11052002-11-12 Akim Demaille <akim@epita.fr>
1106
1107 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
1108 Use it to test the GLR parser.
1109
7bd6c77e
AD
11102002-11-12 Akim Demaille <akim@epita.fr>
1111
1112 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
1113 defines it.
1114 * data/glr.c (yystos): New.
1115 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
1116 (YYDSYMPRINT): New.
1117 (yyval): Don't define it, it is handled via M4.
1118 (yyrecoverParseError): Free verbosely the discarded symbols.
1119 * data/yacc.c (yysymprint): Remove, rather...
1120 (b4_yysymprint_generate): invoke.
1121 * data/c.m4 (b4_yysymprint_generate): New.
1122 Accept pointers as arguments, as opposed to the version from
1123 yacc.c.
1124 (b4_yydestruct_generate): Likewise.
1125 * tests/cations.at (Printers and Destructors): Use Bison directives
1126 instead of CPP macros.
1127 Don't rely on internal details.
1128
b0400cc6
AD
11292002-11-12 Akim Demaille <akim@epita.fr>
1130
1131 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
1132 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
1133 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
1134 it against YYEMPTY and so forth), work on yytoken (i.e., set
1135 it to YYEMPTY etc.).
1136 (yydestruct): Replace with a b4_yydestruct_generate invocation.
1137 (b4_symbol_actions): Remove.
1138 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
1139 for 0, end-of-input.
1140
72f889cc
AD
11412002-11-12 Akim Demaille <akim@epita.fr>
1142
1143 * doc/bison.texinfo (Destructor Decl): New.
1144
b1ae9233
AD
11452002-11-12 Akim Demaille <akim@epita.fr>
1146
1147 * src/tables.c (tables_generate): Use free for pointers that
1148 cannot be NULL, not XFREE.
1149 (pack_vector): Use assert, not fatal, for bound violations.
1150 * src/state.c (state_new): Likewise.
1151 * src/reader.c (reader): Likewise.
1152 * src/lalr.c (set_goto_map): Likewise.
72f889cc 1153 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
1154 the file name.
1155
7ec2d4cd
AD
11562002-11-12 Akim Demaille <akim@epita.fr>
1157
1158 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
1159 Restore.
1160 * src/scan-gram.l (last_string): Is global to the file, not to
1161 yylex.
1162 * src/parse-gram.y (input): Don't append the epilogue here,
1163 (epilogue.opt): do it here, and free the scanner's obstack.
1164 * src/reader.c (epilogue_set): Rename as...
1165 (epilogue_augment): this.
1166 * data/c.m4 (b4_epilogue): Defaults to empty.
1167
573a6cd3
AD
11682002-11-12 Akim Demaille <akim@epita.fr>
1169
1170 * src/getargs.c (long_options): Remove duplicates.
1171 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
1172 Remove.
1173 * doc/bison.rnh: Remove.
1174 * doc/bison.texinfo (VMS Invocation): Remove.
1175
95612cfa
AD
11762002-11-12 Akim Demaille <akim@epita.fr>
1177
1178 * src/struniq.h, src/struniq.c (struniq_t): Is const.
1179 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
1180
1181 Use struniq for symbols.
1182
1183 * src/symtab.h (symbol_t): The tag member is a struniq.
1184 (symbol_type_set): Adjust.
1185 * src/symtab.c (symbol_new): Takes a struniq.
1186 (symbol_free): Don't free the tag member.
1187 (hash_compare_symbol_t, hash_symbol_t): Rename as...
1188 (hash_compare_symbol, hash_symbol): these.
1189 Use the fact that tags as struniqs.
1190 (symbol_get): Use struniq_new.
1191 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
1192 Returns a strniq.
1193 * src/reader.h (merger_list, grammar_currentmerge_set): The name
1194 and type members are struniqs.
1195 * src/reader.c (get_merge_function)
1196 (grammar_current_rule_merge_set): Adjust.
1197 (TYPE, current_type): Are struniq.
1198
1199 Use struniq for file names.
1200
1201 * src/files.h, src/files.c (infile): Split into...
1202 (grammar_file, current_file): these.
1203 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
1204 * src/reduce.c (reduce_print): Likewise.
1205 * src/getargs.c (getargs): Likewise.
1206 * src/complain.h, src/complain.c: Likewise.
1207 * src/main.c (main): Call struniqs_new early enough to use it for
1208 file names.
1209 Don't free the input file name.
1210
3e6656f9
AD
12112002-11-12 Akim Demaille <akim@epita.fr>
1212
1213 * src/symtab.c (symbol_free): Remove dead deactivated code:
1214 type_name are properly removed.
1215 Don't use XFREE to free items that cannot be NULL.
1216 * src/struniq.h, src/struniq.c: New.
1217 * src/main.c (main): Initialize/free struniqs.
1218 * src/parse-gram.y (%union): Add astruniq member.
1219 (yyprint): Adjust.
1220 * src/scan-gram.l (<{tag}>): Return a struniq.
1221 Free the obstack bit that used to store it.
1222 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
1223
7672019c
PE
12242002-11-11 Paul Eggert <eggert@twinsun.com>
1225
1226 Revamp to fix many (but not all) of the C- and M4-related quoting
1227 problems. Among other things, this fixes the Bison bug reported
1228 by Jan Hubicka when processing the Bash grammar; see:
e3aa65c5 1229 <http://mail.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
1230
1231 Use new @ escapes consistently. Represent brackets with @{ and @}
1232 rather than @<:@ and @:>@, since this works a bit better with dumb
1233 editors like vi. Represent @ with @@, since @ is now consistently
1234 an escape. Use @oline@ and @ofile@ rather than __oline__ and
1235 __ofile__, to avoid unexpected expansions. Similarly, use @output
1236 rather than #output.
1237
1238 * data/c.m4 (b4_copyright): Omit file name from comment, since
1239 the file name could contain "*/".
1240 (b4_synclines_flag): Don't quote the 2nd argument; it should already
1241 be quoted. All uses changed.
1242
1243 * data/glr.c: Use new @ escapes consistently.
1244 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
1245 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
1246 Remove, since they couldn't handle arbitrary characters in file
1247 names.
1248 * data/lalr1.cc: Likewise.
1249 * data/yacc.c: Likewise.
1250
1251 * src/files.c (output_infix): Remove; all uses removed.
1252 * src/files.h: Likewise.
1253
1254 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
1255 mishandled funny characters in file names, and anyway it isn't
1256 needed any more.
1257 * data/yacc.c: Likewise.
1258 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
1259
1260 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
1261 * data/yacc.c: Likewise.
1262
1263 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
1264 strings now.
1265 (muscle_init): Quote filename as a C string.
1266 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
1267 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
1268 * src/output.c (escaped_file_name_output): New function.
1269 (prepare_symbols): Quote tokens for M4.
1270 (prepare): Don't insert output_infix, output_prefix,
1271 output_parser_name, output_header_name; this is now down by scan-skel.
1272 Insert skeleton as a C string.
1273
1274 * src/output.c (user_actions_output, symbol_destructors_output,
1275 symbol_printers_output): Quote filenames for C and M4.
1276 * src/reader.c (prologue_augment, epilogue_set): Likewise.
1277
1278 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
1279 escapes other than \\ and \'; this simplifies the code.
1280 (<SC_STRING>): Likewise, for \\ and \".
1281 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
1282 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
1283 Use new escapes @{ and @} for [ and ].
1284
1285 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
1286 them with auto vars.
1287 Switch to new escape scheme, where @ is the escape character uniformly.
1288 Abort if a stray escape character is found. Avoid unbounded input
1289 buffer when parsing non-escaped text.
1290
1291 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
1292 __oline__, #output, $@, and @{ do not have unintended meanings.
1293
acea4f3b
PE
12942002-11-09 Paul Eggert <eggert@twinsun.com>
1295
1296 Fix the test failure due to GCC warnings described in
e3aa65c5 1297 <http://mail.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
1298 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
1299 evaluate to 0 if it's impossible for NINF to be in the respective
1300 table.
1301 (yygetLRActions, yyrecoverParseError): Use them.
1302
1303 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
1304 counted in the token inserted at end of file. Now takes
1305 location_t *, not location_t, so that the location can be
1306 adjusted. All uses changed.
1307
1308 * tests/regression.at (Invalid inputs): Adjust wording in
1309 diagnostic to match the new behavior.
1310
1311 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
1312 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
1313 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
1314 abort ();'. This reduces the runtime of the "Many lookaheads"
1315 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
1316 GCC 3.2.
1317
20ef1ad5
PE
13182002-11-07 Paul Eggert <eggert@twinsun.com>
1319
1320 * src/parse-gram.y (CHARACTER): Remove unused token.
1321 All uses removed.
1322
1323 * src/scan-gram.l: Remove stack option. We no longer use the
1324 stack, since the stack was never deeper than 1; instead, use the
1325 new auto var c_context to record the stacked value.
1326
1327 Remove nounput option. At an unexpected end of file, we now unput
1328 the minimal input necessary to end cleanly; this simplifies the
1329 code.
1330
1331 Avoid unbounded token sizes where this is easy.
1332
1333 (unexpected_end_of_file): New function.
1334 Use it to systematize the error message on unexpected EOF.
1335 (last-string): Now auto, not static.
1336 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
1337 (scanner_last_string_free): Remove; not used.
1338 (percent_percent_count): Move decl to just before use.
1339 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
1340 not the (never otherwised-used) CHARACTER.
1341
93724f13
AD
13422002-11-07 Akim Demaille <akim@epita.fr>
1343
1344 Let yyerror always receive the msg as last argument, so that
1345 yyerror can be variadic.
1346
1347 * data/yacc.c (b4_yyerror_args): New.
1348 Use it when calling yyerror.
1349 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
1350 Use it when calling yyerror.
1351 * doc/bison.texinfo (Error Reporting): Adjust.
1352 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
1353 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
1354
6e40b4eb
AD
13552002-11-06 Akim Demaille <akim@epita.fr>
1356
1357 #line should have quoted strings.
1358 Ideally, this should be done by m4_quotearg.
1359
1360 * src/scan-skel.l: Include quotearg.h.
1361 Quote __ofile__.
1362 * src/output.c (symbol_printers_output)
1363 (symbol_destructors_output): Quote the file name.
1364
2dfbfc12
AD
13652002-11-06 Akim Demaille <akim@epita.fr>
1366
1367 * tests/regression.at (Invalid inputs): Adjust to the recent
1368 messages.
1369
437c2d80
AD
13702002-11-06 Akim Demaille <akim@epita.fr>
1371
1372 Restore --no-lines.
1373 Reported by Jim Kent.
1374
1375 * data/c.m4 (b4_syncline): New.
1376 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
1377 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
1378 * src/output.c (user_actions_output): Likewise.
1379 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 1380 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 1381
900c5db5
AD
13822002-11-06 Akim Demaille <akim@epita.fr>
1383
1384 * src/main.c (main): Free `infile'.
1385 * src/scan-gram.l (handle_syncline): New.
1386 Recognize `#line'.
1387 * src/output.c (user_actions_output, symbol_destructors_output)
1388 (symbol_printers_output): Use the location's file name, not
1389 infile.
1390 * src/reader.c (prologue_augment, epilogue_set): Likewise.
1391
e183b123 13922002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 1393
e183b123 1394 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 1395 either has GLR conflict entries.
e183b123 1396
193eb6b7
PE
13972002-11-05 Paul Eggert <eggert@twinsun.com>
1398
e183b123
PE
1399 * src/scan-gram.l: Use more accurate diagnostics, e.g.
1400 "integer out of range" rather than "invalid value".
1401 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
1402 accordingly.
1403
193eb6b7
PE
1404 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
1405 Also, remove one static variable in the scanner.
1406
1407 * src/scan-gram.l (braces_level): Now auto, not static.
1408 Initialize to zero if the compiler is being picky.
1409 (INITIAL): Clear braces_level instead of incrementing it.
1410 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
1411 as POSIX 1003.1-2001 requires.
1412 * src/system.h (IF_LINT): New macro, taken from coreutils.
1413 * configure.ac: Define "lint" if --enable-gcc-warnings.
1414
29c01725
AD
14152002-11-05 Akim Demaille <akim@epita.fr>
1416
1417 * src/scan-gram.l: When it starts with `%', complain about the
1418 whole directive, not just that `invalid character: %'.
1419
8aeac3ca
AD
14202002-11-04 Akim Demaille <akim@epita.fr>
1421
1422 * Makefile.maint: Update from Autoconf.
1423 (update, cvs-update, po-update, do-po-update): New.
1424
793a58bb
AD
14252002-11-04 Akim Demaille <akim@epita.fr>
1426
1427 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
1428 and yyerror.
1429 Have yyerror `use' its arguments.
1430 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
1431 returns true when location & yacc & pure & parse-param.
1432 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
1433
c4d720cd
AD
14342002-11-04 Akim Demaille <akim@epita.fr>
1435
1436 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
1437 clashes.
1438 * src/scan-gram.l: Use [\'] instead of ['] to pacify
1439 font-lock-mode.
1440 Use complain_at.
1441 Use quote, not quote_n since LOCATION_PRINT no longer uses the
1442 slot 0.
1443
613a0dc5
PE
14442002-11-03 Paul Eggert <eggert@twinsun.com>
1445
1446 * src/reader.c (get_merge_function, grammar_current_rule_check):
1447 Use consistent diagnostics for reporting type name clashes.
1448 Quote the types with <>, for consistency with Yacc.
1449 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
1450
2a8d363a
AD
14512002-11-03 Akim Demaille <akim@epita.fr>
1452
1453 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
1454 New.
1455 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
1456 (b4_parse_param): Remove.
1457 Use b4_identification.
1458 Propagate b4_pure_args where needed to pass them to yyerror.
1459 * data/glr.m4 (b4_parse_param): Remove.
1460 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
1461 (b4_lpure_formals): New.
1462 Use b4_identification.
1463 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
1464 b4_user_formals and b4_user_args.
1465 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
1466 (yyreportAmbiguity): When using a pure parser, also need
1467 the location, and the parse-params.
1468 Adjust callers.
1469 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
1470 When using a pure parser, also need the parse-params.
1471 Adjust callers.
1472 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
1473 (%pure-parser + %parse-param) LALR and GLR parsers.
1474 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
1475 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
1476 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
1477 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
1478 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
1479 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
1480 * doc/bison.texinfo: Untabify the whole file.
1481 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
1482 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
1483 (Error Reporting): Adjust to these new directives.
1484 Document %error-verbose, deprecate YYERROR_VERBOSE.
1485
9e32add8
AD
14862002-11-03 Akim Demaille <akim@epita.fr>
1487
1488 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
1489 AT_CHECK_CALC_GLR invocations to use % directives, instead of
1490 command line options.
1491 * tests/cxx-type.at: Formatting changes.
1492
b02d90a5
PE
14932002-11-03 Paul Eggert <eggert@twinsun.com>
1494
1495 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
1496 to count columns correctly, and to check for invalid inputs.
9e32add8 1497
b02d90a5
PE
1498 Use mbsnwidth to count columns correctly. Account for tabs, too.
1499 Include mbswidth.h.
1500 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
1501 (extend_location): New function.
1502 (YY_LINES): Remove.
1503
1504 Handle CRLF in C code rather than in Lex code.
1505 (YY_INPUT): New macro.
1506 (no_cr_read): New function.
1507
1508 Scan UCNs, even though we don't fully handle them yet.
1509 (convert_ucn_to_byte): New function.
1510
1511 Handle backslash-newline correctly in C code.
1512 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
1513 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
1514 all uses changed.
1515 (tag, splice): New EREs. Do not allow NUL or newline in tags.
1516 Use {splice} wherever C allows backslash-newline.
1517 YY_STEP after space, newline, vertical-tab.
1518 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 1519
b02d90a5
PE
1520 (letter, id): Don't assume ASCII; e.g., spell out a-z.
1521
1522 ({int}, handle_action_dollar, handle_action_at): Check for integer
1523 overflow.
9e32add8 1524
b02d90a5
PE
1525 (YY_STEP): Omit trailing semicolon, so that it's more like C.
1526
1527 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
1528 as well as \000. Check for UCHAR_MAX, not 255.
1529 Allow \x with an arbitrary positive number of digits, as in C.
1530 Check for overflow here.
1531 Allow \? and UCNs, for compatibility with C.
1532
1533 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
1534 with quote slot used by complain_at.
1535
1536 * tests/input.at: Add tests for backslash-newline, m4 quotes
1537 in symbols, long literals, and funny escapes in strings.
1538
1539 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
1540 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
1541 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
1542 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
1543 * m4/mbswidth.m4: New file, from GNU coreutils.
1544
1545 * doc/bison.texinfo (Grammar Outline): Document // comments.
1546 (Symbols): Document that trigraphs have no special meaning in Bison,
1547 nor is backslash-newline allowed.
1548 (Actions): Document that trigraphs have no special meaning.
1549
1550 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
1551 no longer used.
1552
15532002-11-02 Paul Eggert <eggert@twinsun.com>
1554
1555 * src/reader.c: Don't include quote.h; not needed.
1556 (get_merge_function): Reword warning to be consistent with
1557 type clash diagnostic in grammar_current_rule_check.
1558
1559 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
1560 bug in trigraph handling.
1561
1562 * src/output.c (prepare_symbols): When printing token names,
1563 escape "[" as "@<:@" and likewise for "]".
1564
1565 * src/system.h (errno): Remove declaration, as we are now
1566 assuming C89 or better, and C89 guarantees errno.
1567
762b212b
PE
15682002-10-30 Paul Eggert <eggert@twinsun.com>
1569
1570 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
1571 Check for close failures.
1572 * src/files.h (xfclose): Return void, not int, since it always
1573 returned zero.
1574 * src/files.c (xfclose): Likewise. Report I/O error if ferror
1575 indicates one.
1576 * src/output.c (output_skeleton): Use xfclose rather than fclose
1577 and ferror. xfclose now checks ferror.
1578
1579 * data/glr.c (YYLEFTMOST_STATE): Remove.
1580 (yyreportTree): Use a stack-based leftmost state. This avoids
1581 our continuing battles with bogus warnings about initializers.
1582
56100c60
AD
15832002-10-30 Akim Demaille <akim@epita.fr>
1584
1585 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
1586 #if.
1587
51b4a04c
PH
15882002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1589
1590 * tests/glr-regr1.at: New test for reported regressions.
1591 * tests/testsuite.at: Add glr-regr1.at test.
1592 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 1593
bf1ebda2
PE
15942002-10-24 Paul Eggert <eggert@twinsun.com>
1595
5c16c6b1
PE
1596 Version 1.75a.
1597
bf1ebda2
PE
1598 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
1599 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
1600 we use malloc. Don't assume 'A' through 'Z' are contiguous.
1601 Don't assume strdup exists; POSIX says its an XSI extension.
1602 Check for buffer overflow on input.
1603
b526ee61
AD
16042002-10-24 Akim Demaille <akim@epita.fr>
1605
1606 * src/output.c (output_skeleton): Don't disable M4sugar comments
1607 too soon: it results in comments being expanded.
1608 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
1609 first output.
1610
f1886bb2
AD
16112002-10-24 Akim Demaille <akim@epita.fr>
1612
1613 * data/yacc.c (m4_int_type): New.
1614 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
1615 char' as only yacc.c wants K&R portability.
1616 * data/glr.c (yysigned_char): Remove.
1617 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
1618 Reported by Quoc Peyrot.
1619
c5576256
PE
16202002-10-23 Paul Eggert <eggert@twinsun.com>
1621
1622 * src/main.c (main): With --trace=time, report times even if a
1623 non-fatal error occurs. Formerly, the times were reported in some
1624 such cases but not in others.
1625 * src/reader.c (reader): Just return if a complaint has been issued,
1626 instead of exiting, so that 'main' can report times.
1627
27b0ffea
AD
16282002-10-22 Akim Demaille <akim@epita.fr>
1629
1630 * src/system.h: Include sys/types.
1631 Reported by Bert Deknuydt.
1632
223a7883
PE
16332002-10-23 Paul Eggert <eggert@twinsun.com>
1634
1635 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
1636 Suggested by Art Haas.
1637
16382002-10-22 Paul Eggert <eggert@twinsun.com>
1639
1640 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
1641 decl; not needed any more.
1642 * src/main.c (main): Use return to exit, undoing yesterday's change.
1643 The last OS that we could find where this wouldn't work is
1644 SunOS 3.5, and that's too old to worry about now.
1645
1646 * data/glr.c (struct yyltype): Define members even when not
1647 doing locations. This is more consistent with yacc.c, and it
1648 works around the following bug reports:
e3aa65c5
PE
1649 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
1650 http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 1651
223a7883
PE
1652 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
1653 @acronym consistently. Standardize on "Yacc" instead of "YACC",
1654 "Algol" instead of "ALGOL". Give a bit more history about BNF.
1655
8b76775a
AD
16562002-10-22 Akim Demaille <akim@epita.fr>
1657
1658 * data/README: New.
1659
6db10d14
PE
16602002-10-21 Paul Eggert <eggert@twinsun.com>
1661
1662 Be consistent about 'bool'; the old code used an enum in one
1663 module and an int in another, and this violates the C standard.
1664 * m4/stdbool.m4: New file, from coreutils 4.5.3.
1665 * configure.ac (AC_HEADER_STDBOOL): Add.
1666 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
1667 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
1668 * src/symtab.c (hash_compare_symbol_t): Likewise.
1669 * src/system.h (bool, false, true): Use a definition consistent
1670 with ../lib/hash.c. All uses changed.
1671
1672 * src/complain.c (warning_issued): Renamed from warn_message_count,
1673 so that we needn't worry about integer overflow (!).
1674 Now of type bool. All uses changed.
1675 (complaint_issued): Renamed from complain_message_count; likewise.
1676
1677 * src/main.c (main): Use exit to exit with failure.
27b0ffea 1678
6db10d14
PE
1679 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
1680 rather than 1 and 0.
1681 * src/main.c (main): Likewise.
1682 * src/getargs.c (getargs): Likewise.
1683 * src/reader.c (reader): Likewise.
1684
1685 * src/getarg.c (getargs): Remove duplicate code for
1686 "Try `bison --help'".
1687
1688 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
1689 What was that "2" for?
1690
1691 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
1692 * src/getargs.c (usage): Likewise.
1693
1694 * src/getargs.c (getargs): When there are too few operands, report
1695 the last one. When there are too many, report the first extra
1696 one. This is how diffutils does it.
1697
92a060fd
PE
16982002-10-20 Paul Eggert <eggert@twinsun.com>
1699
1700 Remove K&R vestiges.
1701 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
1702 * src/complain.c (VA_START): Remove. Assume prototypes.
1703 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
1704 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
1705 fatal): Assume prototypes.
1706 * src/complain.h: Assume prototypes.
1707 * src/system.h (PARAMS): Remove.
1708 Include <limits.h> unconditionally, since it's guaranteeed even
1709 for a freestanding C89 compiler.
1710 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
1711 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 1712
e7cb57c0
AD
17132002-10-20 Akim Demaille <akim@epita.fr>
1714
1715 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
1716 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
1717 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
1718 (yyresolveStates, yyresolveAction, yyresolveStack)
1719 (yyprocessOneStack): Use them.
1720 (yy_reduce_print): New.
1721 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
1722
0245f82d
AD
17232002-10-20 Akim Demaille <akim@epita.fr>
1724
1725 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
1726 arguments and output `void'.
1727 (b4_c_function): Rename as...
1728 (b4_c_function_def): this.
1729 (b4_c_function_decl, b4_c_ansi_function_def)
1730 (b4_c_ansi_function_decl): New.
1731 Change the interpretation of the arguments: before `int, foo', now
1732 `int foo, foo'.
1733 * data/yacc.c (yyparse): Prototype and define thanks to these.
1734 Adjust b4_c_function_def uses.
1735 * data/glr.c (yyparse): Likewise, but ANSI only.
1736
39912f52
AD
17372002-10-20 Akim Demaille <akim@epita.fr>
1738
1739 * src/output.c (prepare): Move the definition of `tokens_number',
1740 `nterms_number', `undef_token_number', `user_token_number_max'
1741 to...
1742 (prepare_tokens): Here.
1743 (prepare_tokens): Rename as...
1744 (prepare_symbols): this.
1745 (prepare): Move the definition of `rules_number' to...
1746 (prepare_rules): here.
1747 (prepare): Move the definition of `last', `final_state_number',
1748 `states_number' to...
1749 (prepare_states): here.
1750 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
1751
20c1e2ad
AD
17522002-10-20 Akim Demaille <akim@epita.fr>
1753
1754 * src/tables.h, src/tables.c, src/output.c: Comment changes.
1755
21964f43
AD
17562002-10-20 Akim Demaille <akim@epita.fr>
1757
1758 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
1759 * data/c.m4: here.
1760
66d30cd4
AD
17612002-10-20 Akim Demaille <akim@epita.fr>
1762
1763 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
1764 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
1765 `pair'.
1766 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
1767 `name' to...
1768 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
1769 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
1770 These.
1771
95f2c9fe
PE
17722002-10-19 Paul Eggert <eggert@twinsun.com>
1773
1774 Do not create a temporary file, as that involves security and
1775 cleanup headaches. Instead, use a pair of pipes.
1776 Derived from a suggestion by Florian Krohm.
1777 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
1778 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
1779 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
1780 (BISON_PREREQ_SUBPIPE): Add.
1781 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
1782 Add subpipe.h, subpipe.c.
1783 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
1784 * po/POTFILES.in: Add lib/subpipe.c.
1785 * src/output.c: Include "subpipe.h".
1786 (m4_invoke): Remove decl.
1787 (scan_skel): New decl.
1788 (output_skeleton): Use pipe rather than temporary file for m4 input.
1789 Check that m4sugar.m4 is readable, to avoid deadlock.
1790 Check for pipe I/O error.
1791 * src/scan-skel.l (readpipe): Remove decl.
1792 (scan_skel): New function, to be used in place of m4_invoke.
1793 Read from stream rather than file.
66d30cd4 1794
95f2c9fe
PE
1795 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
1796 float, as this generates a warning on Solaris 8 + GCC 3.2 with
1797 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
1798 this generates a more-accurate value anyway.
1799
1800 * lib/timevar.c (timervar_accumulate): Rename locals to
1801 avoid confusion with similarly-named more-global.
1802 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
1803
1804 * src/output.c (prepare): Use xstrdup to convert char const *
1805 to char *, to avoid GCC warning.
1806
c19988b7
AD
18072002-10-19 Akim Demaille <akim@epita.fr>
1808
1809 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
1810 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
1811 Use them to have `calc.y' ready for %pure-parser.
1812 * data/yacc.c (YYLEX): Pass a yylex return type to
1813 b4_c_function_call.
1814
ae7453f2
AD
18152002-10-19 Akim Demaille <akim@epita.fr>
1816
1817 Prototype support of %lex-param and %parse-param.
1818
1819 * src/parse-gram.y: Add the definition of the %lex-param and
1820 %parse-param tokens, plus their rules.
1821 Drop the `_' version of %glr-parser.
1822 Add the "," token.
1823 * src/scan-gram.l (INITIAL): Scan them.
1824 * src/muscle_tab.c: Comment changes.
1825 (muscle_insert, muscle_find): Rename `pair' as `probe'.
1826 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
1827 (muscle_entry_s): The `value' member is no longer const.
1828 Adjust all dependencies.
1829 * src/muscle_tab.c (muscle_init): Adjust: use
1830 MUSCLE_INSERT_STRING.
1831 Initialize the obstack earlier.
1832 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
1833 (muscle_pair_list_grow): New.
1834 * data/c.m4 (b4_c_function_call, b4_c_args): New.
1835 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
1836 * tests/calc.at: Use %locations, not --locations.
1837 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
1838
0e575721
AD
18392002-10-19 Akim Demaille <akim@epita.fr>
1840
1841 * src/getargs.c (usage): Take status as argument and exit
1842 accordingly.
1843 Report the traditional `Try ... --help' message when status != 0.
1844 (usage, version): Don't take a FILE * as arg, it is pointless.
1845 (getargs): When there is an incorrect number of arguments, make it
1846 an error, and report it GNUlically thanks to `usage ()'.
1847
724ce7f5
PE
18482002-10-18 Paul Eggert <eggert@twinsun.com>
1849
3a781eb2
PE
1850 * data/glr.c (yyreportParseError): Don't assume that sprintf
1851 yields the length of the printed string, as this is not true
1852 on SunOS 4.1.4. Reported by Peter Klein.
1853
724ce7f5
PE
1854 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
1855 * tests/conflicts.at (%nonassoc and eof): Likewise.
1856 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
1857
473d0a75
AD
18582002-10-17 Akim Demaille <akim@epita.fr>
1859
1860 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
1861 * src/getargs.c (trace_types, trace_args): Adjust.
1862 * src/reader.c (grammar_current_rule_prec_set)
1863 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
1864 Standardize error messages.
1865 And s/@prec/%prec/!
1866 (reader): Use trace_flag to enable scanner/parser debugging,
1867 instead of an adhoc scheme.
1868 * src/scan-gram.l: Remove trailing debugging code.
1869
e76d2469
PE
18702002-10-16 Paul Eggert <eggert@twinsun.com>
1871
93e2236a
PE
1872 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
1873 MUSCLE_TAB_H.
1874
e76d2469
PE
1875 * NEWS: Officially drop support for building Bison with K&R C,
1876 since it didn't work anyway and it's not worth worrying about.
1877 * Makefile.maint (wget_files): Remove ansi2knr.c.
1878 (ansi2knr.c-url_prefix): Remove.
1879 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
1880 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1881 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1882
5bd1c419
PE
18832002-10-15 Paul Eggert <eggert@twinsun.com>
1884
1885 Stop using the "enum_" trick for K&R-style function definitions;
1886 it confused me, and I was the author! Instead, assume that people
1887 who want to use K&R C compilers (when using these modules in GCC,
1888 perhaps?) will run ansi2knr.
1889
1890 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
1891 All uses of "enum_" changed to "enum ".
1892 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
1893 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 1894
5bd1c419
PE
1895 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
1896 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
1897 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
1898 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
1899 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
1900 abitset_not, abitset_ones, abitset_or, abitset_or_and,
1901 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
1902 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
1903 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
1904 Use function prototypes; this removes the need for declaring
1905 static functions simply to provide their prototypes.
1906 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
1907 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
1908 bitset_count_, bitset_create, bitset_dump, bitset_first,
1909 bitset_free, bitset_init, bitset_last, bitset_next,
1910 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
1911 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
1912 bitset_print, bitset_release_memory, bitset_toggle_,
1913 bitset_type_choose, bitset_type_get, bitset_type_name_get,
1914 debug_bitset): Likewise.
1915 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
1916 * lib/bitset_stats.c (bitset_log_histogram_print,
1917 bitset_percent_histogram_print, bitset_stats_and,
1918 bitset_stats_and_cmp, bitset_stats_and_or,
1919 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
1920 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
1921 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
1922 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
1923 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
1924 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
1925 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
1926 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
1927 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
1928 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
1929 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
1930 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
1931 bitset_stats_zero): Likewise.
1932 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
1933 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
1934 bitsetv_dump, debug_bitsetv): Likewise.
1935 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
1936 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
1937 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
1938 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
1939 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
1940 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
1941 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
1942 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
1943 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
1944 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
1945 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
1946 Likewise.
1947 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
1948 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
1949 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
1950 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
1951 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
1952 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
1953 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
1954 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
1955 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
1956 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
1957 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 1958
ae26e1f0
AD
19592002-10-14 Akim Demaille <akim@epita.fr>
1960
1961 Version 1.75.
1962
d43baf71
AD
19632002-10-14 Akim Demaille <akim@epita.fr>
1964
1965 * tests/Makefile.am (maintainer-check-posix): New.
1966
7ebc83e3
AD
19672002-10-14 Akim Demaille <akim@epita.fr>
1968
1969 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
1970 member.
1971
05846dae
AD
19722002-10-14 Akim Demaille <akim@epita.fr>
1973
1974 * src/tables.c (table_ninf_remap): base -> tab.
1975 Reported by Matt Rosing.
1976
1318e37d
PE
19772002-10-14 Paul Eggert <eggert@twinsun.com>
1978
447fbb17
PE
1979 * tests/action.at, tests/calc.at, tests/conflicts.at,
1980 tests/cxx-type.at, tests/headers.at, tests/input.at,
1981 tests/regression.at, tests/synclines.at, tests/torture.at:
1982 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
1983 so that the tests still work even if POSIXLY_CORRECT is set.
1984 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 1985
1318e37d
PE
1986 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
1987 for portability to K&R hosts. Fix typo: signed char is guaranteed
1988 only to 127, not to 128.
1989 * data/glr.c (yysigned_char): New type.
1990 * data/yacc.c (yysigned_char): Likewise.
1991 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
1992
cc0f0794
PE
19932002-10-13 Paul Eggert <eggert@twinsun.com>
1994
5038f418
PE
1995 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
1996 true due to limited range of data type" warning from GCC.
1997
cc0f0794
PE
1998 * data/c.m4 (b4_token_defines): Protect against double-inclusion
1999 by wrapping enum yytokentype's definition inside #ifndef
2000 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
2001
6fed0802
AD
20022002-10-13 Akim Demaille <akim@epita.fr>
2003
2004 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
2005 Un yy- yyrhs to avoid the name clash with the global YYRHS.
2006
32f0598d
AD
20072002-10-13 Akim Demaille <akim@epita.fr>
2008
2009 * Makefile.maint: Update from Autoconf 2.54.
2010 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
2011
7ea9a33f
AD
20122002-10-13 Akim Demaille <akim@epita.fr>
2013
2014 * src/print.c (print_state): Separate the list of solved conflicts
2015 from the other items.
2016 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
2017
ea99527d
AD
20182002-10-13 Akim Demaille <akim@epita.fr>
2019
2020 Let nondeterministic skeletons be usable with deterministic
2021 tables.
2022
2023 With the patch, GAWK compiled by GCC without -O2 passes its test
2024 suite using a GLR parser driven by LALR tables. It fails with -O2
2025 because `struct stat' gives two different answers on my machine:
2026 88 (definition of an auto var) and later 96 (memset on this var).
2027 Hence the stack is badly corrumpted. The headers inclusion is to
2028 blame: if I move the awk.h inclusion before GLR's system header
2029 inclusion, the two struct stat have the same size.
2030
2031 * src/tables.c (pack_table): Always create conflict_table.
2032 (token_actions): Always create conflict_list.
2033 * data/glr.c (YYFLAG): Remove, unused.
2034
f377f69f
AD
20352002-10-13 Akim Demaille <akim@epita.fr>
2036
2037 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
2038 (O0FLAGS): New.
2039 (VALGRIND, GXX): New.
2040 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
2041 * tests/bison.in: Run $PREBISON a pre-command.
2042 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
2043 (maintainer-check-g++): New.
2044 * Makefile.am (maintainer-check): New.
2045
2a1fe6ed
AD
20462002-10-13 Akim Demaille <akim@epita.fr>
2047
2048 * data/glr.c: Formatting changes.
2049 Tweak some trace messages to match yacc.c's.
2050
f50adbbd
AD
20512002-10-13 Akim Demaille <akim@epita.fr>
2052
2053 GLR parsers sometimes raise parse errors instead of performing the
2054 default reduction.
2055 Reported by Charles-Henry de Boysson.
2056
2057 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
2058 check the length of the traces when %glr.
2059 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
2060 GLR's traces.
2061 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
2062 Test GLR parsers.
2063 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
2064 (yyltype): Remove the yy prefix from the member names.
2065 (yytable): Complete its comment.
2066 (yygetLRActions): Map error action number from YYTABLE from
2067 YYTABLE_NINF to 0.
2068 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
2069 (which was a bug: it should have been YYTABEL_NINF, and yet it was
2070 not satisfying as we could compare an YYACTION computed from
2071 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
2072 only value for error actions.
2073 (yyreportParseError): In verbose parse error messages, don't issue
2074 `error' in the list of expected tokens.
2075 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
2076 next action to perform to match glr.c's decoding.
2077 (yytable): Complete its comment.
2078
bcbad5b9
PE
20792002-10-13 Paul Eggert <eggert@twinsun.com>
2080
2081 Fix problem reported by Henrik Grubbstroem in
e3aa65c5 2082 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
2083 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
2084 because the Bison parser reads the second action before reducing
2085 the first one.
2086 * src/scan-gram.l (rule_length): New static var.
2087 Use it to keep track of the rule length in the scanner, since
2088 we can't expect the parser to be in lock-step sync with the scanner.
2089 (handle_action_dollar, handle_action_at): Use this var.
2090 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 2091
14904b89
PE
20922002-10-12 Paul Eggert <eggert@twinsun.com>
2093
1fe611e5
PE
2094 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
2095 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
2096 Include <sys/time.h> when checking for clock_t and struct tms.
2097 Use same include order as source.
2098 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
e3aa65c5 2099 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 2100
1fe611e5
PE
2101 * lib/timevar.c: Update copyright date and clarify comments.
2102 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 2103
1fe611e5
PE
2104 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
2105 GCC version as of today, then merge Bison's changes.
2106 Change "GCC" to "Bison" in copyright notice. timevar.def's
2107 author is Akim, so change that too.
2108
98194095
PE
2109 * src/reader.c (grammar_current_rule_check):
2110 Don't worry about the default action if $$ is untyped.
2111 Prevents bogus warnings reported by Jim Gifford in
e3aa65c5 2112 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 2113
14904b89
PE
2114 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
2115 * data/glr.c, data/lalr1.cc, data/yacc.c:
2116 Output token definitions before the first part of user declarations.
2117 Fixes compatibility problem reported by Jim Gifford for kbd in
e3aa65c5 2118 <http://mail.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 2119
ff6dca18
PE
21202002-10-11 Paul Eggert <eggert@twinsun.com>
2121
2122 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
2123 (yyparse): here. This undoes some of the 2002-07-25 change.
2124 Compatibility problem reported by Ralf S. Engelschall with
2125 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
2126
eb714592
AD
21272002-10-11 Akim Demaille <akim@epita.fr>
2128
2129 * tests/regression.at Characters Escapes): New.
2130 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
2131 characters.
2132 Reported by Jan Nieuwenhuizen.
2133
b7195100
AD
21342002-10-11 Akim Demaille <akim@epita.fr>
2135
2136 * po/id.po: New.
2137
f28a0f2d
PE
21382002-10-10 Paul Eggert <eggert@twinsun.com>
2139
2140 Portability fixes for bitsets; this also avoids several GCC
2141 warnings.
2142
2143 * lib/abitset.c: Include <stddef.h>, for offsetof.
2144 * lib/lbitset.c: Likewise.
2145
2146 * lib/abitset.c (abitset_bytes): Return a size that is aligned
2147 properly for vectors of objects. Do not assume that adding a
2148 header size to a multiple of a word size yields a value that is
2149 properly aligned for the whole union.
2150 * lib/bitsetv.c (bitsetv_alloc): Likewise.
2151
2152 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
2153 unique names for structures.
2154 * lib/ebitset.c (ebitset_bytes): Likewise.
2155 * lib/lbitset.c (lbitset_bytes): Likewise.
2156
2157 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
2158 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
2159 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
2160 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
2161 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
2162 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
2163 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
2164 to improve the type-checking that GCC can do.
2165 * lib/bitset.c (bitset_op4_cmp): Likewise.
2166 * lib/bitset_stats.c (bitset_stats_count,
2167 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
2168 bitset_stats_copy, bitset_stats_disjoint_p,
2169 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
2170 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
2171 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
2172 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
2173 bitset_stats_and_or_cmp, bitset_stats_andn_or,
2174 bitset_stats_andn_or_cmp, bitset_stats_or_and,
2175 bitset_stats_or_and_cmp): Likewise.
2176 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
2177 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
2178 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
2179 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
2180
2181 * lib/abitset.h: Include bitset.h, not bbitset.h.
2182 * lib/ebitset.h: Likewise.
2183 * lib/lbitset.h: Likewise.
2184
2185 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
2186 All instances of parameters of type enum bitset_opts are now of
2187 type enum_bitset_opts, to conform to the C Standard, and similarly
2188 for enum_bitset_type.
2189 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
2190 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
2191
2192 Do not use "struct bitset_struct" to mean different things in
2193 different modules. Not only is this confusing, it violates
2194 the C Standard, which requires that structure types in different
2195 modules must be compatible if one is to be passed to the other.
2196 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
2197 All instances of "struct bitset_struct *" replaced with "bitset".
2198 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
2199 (union bitset_union, struct abitset_struct, struct ebitset_struct,
2200 struct lbitset_struct, struct bitset_stats_struct): New types.
2201 All uses of struct bitset_struct changed to union bitset_union,
2202 etc.
2203 * lib/abitset.c (struct abitset_struct, abitset,
2204 struct bitset_struct): Remove.
2205 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
2206 struct bitset_struct): Remove.
2207 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
2208 bitset_struct): Remove.
2209 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
2210 Likewise.
2211
2212 Do not call a function of type T using a call that assumes the
2213 function is of a different type U. Standard C requires that a
2214 function must be called with a type that is compatible with its
2215 definition.
2216 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
2217 New decls.
2218 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
2219 New functions.
2220 * lib/ebitset.c (PFV): Remove.
2221 * lib/lbitset.c (PFV): Likewise.
2222 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
2223 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
2224 decls.
2225 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
2226 (ebitset_vtable): Use them.
2227 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
2228 lbitset_xor): New functions.
2229 (lbitset_vtable): Use them.
2230
2231 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
2232 Declare.
2233
2234 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
2235 GCC warning.
2236 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
2237 Use offsetof, for simplicity.
2238
6fbe4984
PE
22392002-10-06 Paul Eggert <eggert@twinsun.com>
2240
2241 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
2242 the same width as int. This reapplies a hunk of the 2002-08-12 patch
e3aa65c5 2243 <http://mail.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
2244 which was inadvertently undone by the 2002-09-30 patch.
2245 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
2246 the same width as int.
2247
420f93c8
PE
22482002-10-04 Paul Eggert <eggert@twinsun.com>
2249
2250 Version 1.50.
2251
2252 * configure.ac (AC_INIT), NEWS: Increment version number.
2253
2254 * doc/bison.texinfo: Minor spelling, grammar, and white space
2255 fixes.
2256 (Symbols): Mention that any negative value returned from yylex
2257 signifies end-of-input. Warn about negative chars. Mention
2258 the portable Standard C character set.
2259
2260 The GNU coding standard says CFLAGS and YFLAGS are reserved
2261 for the installer to set.
2262 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
2263 * src/Makefile.am (AM_CFLAGS): Likewise.
2264 (AM_YFLAGS): Renamed from YFLAGS.
2265
2266 Fix some MAX and MIN problems.
2267 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
2268 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
2269 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
2270 * src/reader.c (reader): Use it.
2271
2272 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
2273 POSIX 1003.1-2001 has removed fgrep.
2274
22752002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
2276
2277 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
2278 interpreted as signed.
2279 * lib/ebitset.c (ebitset_list): Fix bug.
2280
ff68026d
PE
22812002-10-01 Paul Eggert <eggert@twinsun.com>
2282
2283 More fixes for 64-bit hosts and large bitsets.
2284
2285 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
2286 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
2287 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
2288 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
2289 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
2290 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
2291 bitset_count_): Likewise.
2292 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
2293 bitset_first, bitset_last): Likewise.
2294 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
2295 bitset_stats_list_reverse, bitset_stats_size,
2296 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
2297 Likewise.
2298 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
2299 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
2300 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
2301 bitsetv_reflexive_transitive_closure): Likewise.
2302 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
2303 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
2304 Likewise.
2305 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
2306 Likewise.
420f93c8 2307
ff68026d
PE
2308 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
2309 Use size_t, not unsigned int, to count bytes.
2310 * lib/abitset.h (abitset_bytes): Likewise.
2311 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
2312 Likewise.
2313 * lib/bitset.h (bitset_bytes): Likewise.
2314 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
2315 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
2316 * lib/bitsetv.c (bitsetv_alloc): Likewise.
2317 * lib/ebitset.c (ebitset_bytes): Likewise.
2318 * lib/ebitset.h (ebitset_bytes): Likewise.
2319 * lib/lbitset.c (lbitset_bytes): Likewise.
2320 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 2321
ff68026d
PE
2322 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
2323 abitset_subset_p, abitset_disjoint_p, abitset_and,
2324 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
2325 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
2326 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
2327 abitset_or_and, abitset_or_and_cmp):
2328 Use bitset_windex instead of unsigned int.
2329 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
2330 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
2331 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
2332 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
2333 Likewise.
2334 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 2335
ff68026d
PE
2336 * lib/bitset.c (bitset_print):
2337 Use proper printf formats for widths of integer types.
2338 * lib/bitset_stats.c (bitset_percent_histogram_print,
2339 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
2340 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
2341 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
2342 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 2343
ff68026d
PE
2344 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
2345 BITSET_SIZE_MAX): New macros.
2346 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
2347 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
2348 to BITSET_WINDEX_MAX.
2349
2350 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
2351 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
2352 since we now return the bitset_bindex type (not int).
2353
2354 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
2355 when computing sizes.
2356 * lib/ebitset.c (ebitset_elts_grow): Likewise.
2357
2358 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
2359 and avoid cast to unsigned.
2360
6aa452a6
AD
23612002-09-30 Akim Demaille <akim@epita.fr>
2362
2363 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
2364 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
2365 Updates from Michael Hayes.
2366
927f7817
AD
23672002-09-30 Art Haas <ahaas@neosoft.com>
2368
2369 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
2370 invocations.
2371 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
2372 defined.
2373
9738f41e
AD
23742002-09-27 Akim Demaille <akim@epita.fr>
2375
2376 Version 1.49c.
2377
a5c75d7f
AD
23782002-09-27 Akim Demaille <akim@epita.fr>
2379
2380 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
2381 (Because of AC_LIBSOURCE).
2382
8280e179
AD
23832002-09-27 Akim Demaille <akim@epita.fr>
2384
2385 Playing with Autoscan.
2386
2387 * configure.ac: Remove the old LIBOBJ tweaks.
2388 (AC_REPLACE_FUNCS): Add strrchr and strtol.
2389 * lib/strrchr.c: New.
2390 * lib/strtol.c: New, from the Coreutils 4.5.1.
2391
ae64af35
AD
23922002-09-27 Akim Demaille <akim@epita.fr>
2393
2394 Playing with Autoscan.
2395
2396 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
2397 * lib/Makefile.am (libbison_a_SOURCES): No longer include
2398 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
2399 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
2400 Coreutils 4.5.1.
2401
d1a1114f
AD
24022002-09-24 Akim Demaille <akim@epita.fr>
2403
2404 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
2405 (Frequently Asked Questions, Parser Stack Overflow): New.
2406
b906441c
AD
24072002-09-13 Akim Demaille <akim@epita.fr>
2408
2409 Playing with autoscan.
2410
2411 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
2412 * src/files.c (skeleton_find): Remove, unused.
2413 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
2414 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
2415
bd701811
AD
24162002-09-13 Akim Demaille <akim@epita.fr>
2417
2418 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
2419 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
2420
e0a13e7b
AD
24212002-09-13 Akim Demaille <akim@epita.fr>
2422
2423 * configure.ac: Require 2.54.
2424 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
2425 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
2426 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
2427 Remove, provided by Autoconf macros.
2428
c97011bf
AD
24292002-09-12 Akim Demaille <akim@epita.fr>
2430
2431 * m4/prereq.m4: Update, from Coreutils 4.5.1.
2432
d862b1be
AD
24332002-09-12 Akim Demaille <akim@epita.fr>
2434
2435 * m4/prereq.m4: Update, from Fileutils 4.1.5.
2436 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
2437 Reported by Martin Mokrejs.
2438
3d38c03a
AD
24392002-09-10 Akim Demaille <akim@epita.fr>
2440
2441 * src/parse-gram.y: Associate a human readable string to each
2442 token type.
2443 * tests/regression.at (Invalid inputs): Adjust.
2444
b6347355
AD
24452002-09-10 Gary V. Vaughan <gary@gnu.org>
2446
2447 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
2448 with an Autoconf-2.5x style configure.ac.
2449
09ba4ab2
PE
24502002-09-06 Paul Eggert <eggert@twinsun.com>
2451
2452 * doc/bison.texinfo (Conditions): Make explicit that the GPL
2453 exception applies only to yacc.c. This is a modification of a
2454 patch originally suggested by Akim Demaille.
2455
21846f69
AD
24562002-09-06 Akim Demaille <akim@epita.fr>
2457
09ba4ab2
PE
2458 * data/c.m4 (b4_copyright): Move the GPL exception comment from
2459 here to...
2460 * data/yacc.c: here.
2461
21846f69
AD
2462 * data/lalr1.cc (struct yyltype): Don't define it, since we use
2463 LocationType.
2464 (b4_ltype): Default to yy::Location from location.hh.
2465
c0ad8bf3
AD
24662002-09-04 Jim Meyering <jim@meyering.net>
2467
2468 * data/yacc.c: Guard the declaration of yytoknum also with
2469 `#ifdef YYPRINT', so it is declared only when used.
2470
3a93251e
AD
24712002-09-04 Akim Demaille <akim@epita.fr>
2472
2473 * configure.in: Rename as...
2474 * configure.ac: this.
2475 Bump to 1.49c.
2476
427c0dda
AD
24772002-09-04 Akim Demaille <akim@epita.fr>
2478
2479 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
2480 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
2481 translate maintainer only messages.
2482
6a254321
PE
24832002-08-12 Paul Eggert <eggert@twinsun.com>
2484
645e30d1
PE
2485 Version 1.49b.
2486
6a254321
PE
2487 * Makefile.am (SUBDIRS): Remove intl.
2488 (DISTCLEANFILES): Remove.
2489 * NEWS: Mention that GNU M4 is now required. Clarify what is
2490 meant by "larger grammars". Mention the pt_BR translation.
2491 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
2492 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
2493 Bump version from 0.11.2 to 0.11.5.
2494 (BISON_PREREQ_STAGE): Remove.
2495 (AM_GNU_GETTEXT): Use external gettext.
2496 (AC_OUTPUT): Remove intl/Makefile.
2497
2498 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
2499
2500 * data/glr.c: Include string.h, for strlen.
2501 (yyreportParseError): Use size_t for yysize.
2502 (yy_yypstack): No longer nested inside yypstates, as nested
2503 functions are not portable. Do not assume size_t is the
2504 same width as int.
2505 (yypstates): Do not assume that ptrdiff_t is the same width
2506 as int, and similarly for yyposn and YYINDEX.
2507
2508 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
2509
2510 * lib/Makefile.am (INCLUDES): Do not include from the intl
2511 directory, which has been removed.
2512 * src/Makefile.am (INCLUDES): Likewise.
2513
2514 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
2515 (bitsets_sources, additional_bitsets_sources, timevars_sources):
2516 New vars.
2517
2518 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
2519 * tests/Makefile.am (EXTRA_DIST): Likewise.
2520
2521 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
2522 Do not assume that bitset_windex is the same width as unsigned.
2523
2524 * lib/abitset.c (abitset_unused_clear): Do not assume that
2525 bitset_word is the same width as int.
2526 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
2527 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
2528 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
2529 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
2530 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
2531
2532 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
2533 portability to one's complement hosts!).
2534 * lib/ebitset.c (ebitset_op1): Likewise.
2535 * lib/lbitset.c (lbitset_op1): Likewise.
2536
2537 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
2538 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
2539 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
2540 Sync with fileutils.
2541 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
2542 lib/gettext.h: Sync with diffutils.
2543
2544 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
2545 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
2546
2547 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
2548 PROTOTYPES to check for prototypes, and "defined __STDC__" to
2549 check for void *.
2550
2551 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
2552 size_t; the old version tried to do this but casted improperly.
2553 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
2554 (bitset_test): Now returns int, not unsigned long.
2555
2556 * lib/bitset_stats.c: Include "gettext.h".
2557 (_): New macro.
2558 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
2559 name locals "index", as it generates unnecessary warnings on some
2560 hosts that have an "index" function.
2561
2562 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
2563 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
2564 they need translation.
2565 * src/LR0.c (state_list_append, new_itemsets, get_state,
2566 append_states, generate_states): Likewise.
2567 * src/assoc.c (assoc_to_string): Likewise.
2568 * src/closure.c (print_closure, set_firsts, closure): Likewise.
2569 * src/gram.c (grammar_dump): Likewise.
2570 * src/injections.c (injections_compute): Likewise.
2571 * src/lalr.c (lookaheads_print): Likewise.
2572 * src/relation.c (relation_transpose): Likewise.
2573 * src/scan-gram.l: Likewise.
2574 * src/tables.c (table_grow, pack_vector): Likewise.
2575
2576 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
2577 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
2578 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
2579 * m4/mbstate_t.m4: Sync with fileutils.
2580 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
2581
2582 * po/LINGUAS: Add pt_BR.
2583 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
2584 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
2585 lib/timevar.c.
2586 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
2587 manual recommends.
2588 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
2589
2590 * src/complain.c (strerror_r): Remove decl; not needed.
2591 (strerror): Use same pattern as ../lib/error.c.
2592
2593 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
2594
2595 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
2596
2597 * src/main.c (main): Cast result of bindtextdomain and textdomain
2598 to void, to avoid a GCC warning when --disable-nls is in effect.
2599
2600 * src/scan-gram.l: Use strings rather than escapes when possible,
2601 to minimize the number of warnings from xgettext.
2602 (handle_action_dollar, handle_action_at): Don't use isdigit,
2603 as it mishandles negative chars and it may not work as expected
2604 outside the C locale.
2605
2606 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
2607 this is a GCC extension and is not portable to other compilers.
2608
2609 * src/system.h (alloca): Use same pattern as ../lib/error.c.
2610 Do not include <ctype.h>; no longer needed.
2611 Do not include <malloc.h>; no longer needed (and generates
2612 warnings on OpenBSD 3.0).
2613
2614 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
2615 it's not portable.
2616
2617 * tests/regression.at: Do not use 'cc -c input.c -o input';
2618 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
2619
2620 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
2621 exit status as failure, not just exit status 1. Sun C exits
2622 with status 2 sometimes.
2623
2624 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
2625 Use it for the two large tests.
2626
c8f002c7
AD
26272002-08-02 Akim Demaille <akim@epita.fr>
2628
2629 * src/conflicts.c (conflicts_output): Don't output rules never
2630 reduced here, since anyway that computation doesn't work.
2631 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
2632 (rule_useless_p, rule_never_reduced_p): New.
2633 (grammar_rules_partial_print): Use a filter instead of a range.
2634 Display the title only if needed.
2635 (grammar_rules_print): Adjust.
2636 (grammar_rules_never_reduced_report): New.
2637 * src/tables.c (action_row): Move the computation of rules never
2638 reduced to...
2639 (token_actions): here.
2640 * src/main.c (main): Make the parser before making the report, so
2641 that rules never reduced are computed.
2642 Call grammar_rules_never_reduced_report.
2643 * src/print.c (print_results): Report rules never reduced.
2644 * tests/conflicts.at, tests/reduce.at: Adjust.
2645
cd08e51e
AD
26462002-08-01 Akim Demaille <akim@epita.fr>
2647
2648 Instead of attaching lookaheads and duplicating the rules being
2649 reduced by a state, attach the lookaheads to the reductions.
2650
2651 * src/state.h (state_t): Remove the `lookaheads',
2652 `lookaheads_rule' member.
2653 (reductions_t): Add a `lookaheads' member.
2654 Use a regular array for the `rules'.
2655 * src/state.c (reductions_new): Initialize the lookaheads member
2656 to 0.
2657 (state_rule_lookaheads_print): Adjust.
2658 * src/state.h, src/state.c (state_reductions_find): New.
2659 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
2660 (count_rr_conflicts): Adjust.
2661 * src/lalr.c (LArule): Remove.
2662 (add_lookback_edge): Adjust.
2663 (state_lookaheads_count): New.
2664 (states_lookaheads_initialize): Merge into...
2665 (initialize_LA): this.
2666 (lalr_free): Adjust.
2667 * src/main.c (main): Don't free nullable and derives too early: it
2668 is used by --verbose.
2669 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
2670
bb0027a9
AD
26712002-08-01 Akim Demaille <akim@epita.fr>
2672
2673 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
2674 `rule_number_t**'.
2675 (set_derives, free_derives): Rename as...
2676 (derives_compute, derives_free): this.
2677 Adjust all dependencies.
2678 * src/nullable.c (set_nullable, free_nullable): Rename as...
2679 (nullable_compute, nullable_free): these.
2680 (rule_list_t): Store rule_t *, not rule_number_t.
2681 * src/state.c (state_rule_lookaheads_print): Directly compare rule
2682 pointers, instead of their numbers.
2683 * src/main.c (main): Call nullable_free, and derives_free earlier,
2684 as they were lo longer used.
2685
3325ddc4
AD
26862002-08-01 Akim Demaille <akim@epita.fr>
2687
2688 * lib/timevar.c (get_time): Include children time.
2689 * src/lalr.h (LA, LArule): Don't export them: used with the
2690 state_t.
2691 * src/lalr.c (LA, LArule): Static.
2692 * src/lalr.h, src/lalr.c (lalr_free): New.
2693 * src/main.c (main): Call it.
2694 * src/tables.c (pack_vector): Check whether loc is >= to the
2695 table_size, not >.
2696 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
2697 (tables_generate): do it, since that's also it which allocates
2698 them.
2699 Don't free LA and LArule, main does.
2700
c6f1a33c
AD
27012002-07-31 Akim Demaille <akim@epita.fr>
2702
2703 Separate parser tables computation and output.
2704
2705 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
2706 (conflict_list, conflict_list_cnt, table, check, table_ninf)
2707 (yydefgoto, yydefact, high): Move to...
2708 * src/tables.h, src/tables.c: here.
2709 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
2710 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
2711 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
2712 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
2713 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
2714 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
2715 (action_row, save_row, token_actions, save_column, default_goto)
2716 (goto_actions, sort_actions, matching_state, pack_vector)
2717 (table_ninf_remap, pack_table, prepare_actions): Move to...
2718 * src/tables.c: here.
2719 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
2720 * src/output.c (token_actions, output_base, output_conflicts)
2721 (output_check): Merge into...
2722 (prepare_actions): this.
2723 (actions_output): Rename as...
2724 (user_actions_output): this.
2725 * src/main.c (main): Call tables_generate and tables_free.
2726
1509d42f
AD
27272002-07-31 Akim Demaille <akim@epita.fr>
2728
2729 Steal GCC's --time-report support.
2730
2731 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
2732 stolen/adjusted from GCC.
2733 * m4/stage.m4: Remove time related checks.
2734 * m4/timevar.m4: New.
2735 * configure.in: Adjust.
2736 * src/system.h: Adjust to using timevar.h.
2737 * src/getargs.h, src/getargs.c: Support trace_time for
2738 --trace=time.
2739 * src/main.c (stage): Remove.
2740 (main): Replace `stage' invocations with timevar calls.
2741 * src/output.c: Insert pertinent timevar calls.
2742
273a74fa
AD
27432002-07-31 Akim Demaille <akim@epita.fr>
2744
2745 Let --trace have arguments.
2746
2747 * src/getargs.h (enum trace_e): New.
2748 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
2749 (long_options, short_options): --trace/-T takes an optional
2750 argument.
2751 Change all the uses of trace_flag to reflect the new flags.
2752 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
2753
2754 Strengthen `stage' portability.
2755
2756 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
2757 * configure.in: Use it.
2758 Don't check for malloc.h and sys/times.h.
2759 * src/system.h: Include them when appropriate.
2760 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
2761 times and struct tms are available.
2762
217598da
AD
27632002-07-30 Akim Demaille <akim@epita.fr>
2764
2765 In verbose parse error message, don't report `error' as an
2766 expected token.
2767 * tests/actions.at (Printers and Destructors): Adjust.
2768 * tests/calc.at (Calculator $1): Adjust.
2769 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
2770 error message, do not report the parser accepts the error token in
2771 that state.
2772
52489d44
AD
27732002-07-30 Akim Demaille <akim@epita.fr>
2774
2775 Normalize conflict related messages.
2776
2777 * src/complain.h, src/complain.c (warn, complain): New.
2778 * src/conflicts.c (conflicts_print): Use them.
2779 (conflict_report_yacc): New, extracted from...
2780 (conflicts_print): here.
2781 * tests/conflicts.at, tests/existing.at: Adjust.
2782
e8832397
AD
27832002-07-30 Akim Demaille <akim@epita.fr>
2784
2785 Report rules which are never reduced by the parser: those hidden
2786 by conflicts.
2787
2788 * src/LR0.c (save_reductions): Don't make the final state too
2789 different: save its reduction (accept) instead of having a state
2790 without any action (no shift or goto, no reduce).
2791 Note: the final state is now a ``regular'' state, i.e., the
2792 parsers now contain `reduce 0' as default reduction.
2793 Nevertheless, since they decide to `accept' when yystate =
2794 final_state, they still will not reduce rule 0.
2795 * src/print.c (print_actions, print_reduction): Adjust.
2796 * src/output.c (action_row): Track reduced rules.
2797 (token_actions): Report rules never reduced.
2798 * tests/conflicts.at, tests/regression.at: Adjust.
2799
caf23d24
AD
28002002-07-30 Akim Demaille <akim@epita.fr>
2801
2802 `stage' was accidently included in a previous patch.
2803 Initiate its autoconfiscation.
2804
2805 * configure.in: Look for malloc.h and sys/times.h.
2806 * src/main.c (stage): Adjust.
2807 Report only when trace_flag.
2808
640748ee
AD
28092002-07-29 Akim Demaille <akim@epita.fr>
2810
2811 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
2812 state_number_t.
2813 (errs_t): symbol_t*, not symbol_number_t.
2814 (reductions_t): rule_t*, not rule_number_t.
2815 (FOR_EACH_SHIFT): New.
2816 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
2817 * src/print.c, src/print_graph.c: Adjust.
2818
88bce5a2
AD
28192002-07-29 Akim Demaille <akim@epita.fr>
2820
2821 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
2822
2823 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
2824 (endtoken, accept): these.
2825 * src/reader.c (reader): Set endtoken's default tag to "$end".
2826 Set undeftoken's tag to "$undefined" instead of "$undefined.".
2827 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
2828 Adjust.
2829
1bfb97db
AD
28302002-07-29 Akim Demaille <akim@epita.fr>
2831
2832 * src/reduce.c (reduce_grammar): When the language is empty,
2833 complain about the start symbol, not the axiom.
2834 Use its location.
2835 * tests/reduce.at (Empty Language): New.
2836
fc5734fe
AD
28372002-07-26 Akim Demaille <akim@epita.fr>
2838
2839 * src/reader.h, src/reader.c (gram_error): ... can't get
2840 yycontrol without making too strong assumptions on the parser
2841 itself.
2842 * src/output.c (prepare_tokens): Use the real 0th value of
2843 token_translations instead of `0'.
2844 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
2845 visible here.
2846 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
2847 for the time being: %locations ought to provide it to yyerror.
2848
3650b4b8
AD
28492002-07-25 Akim Demaille <akim@epita.fr>
2850
2851 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
2852 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
2853 * tests/regression.at (Web2c Actions): Adjust.
2854
4b3d3a8e
AD
28552002-07-25 Akim Demaille <akim@epita.fr>
2856
2857 Stop storing rules from 1 to nrules + 1.
2858
2859 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
2860 * src/nullable.c, src/output.c, src/print.c, src/reader.c
2861 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
2862 Iterate from 0 to nrules.
2863 Use rule_number_as_item_number and item_number_as_rule_number.
2864 Adjust to `derive' now containing possibly 0.
2865 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
2866 Handle the `- 1' part in rule numbers from/to item numbers.
2867 * src/conflicts.c (log_resolution): Fix the message which reversed
2868 shift and reduce.
2869 * src/output.c (action_row): Initialize default_rule to -1.
2870 (token_actions): Adjust.
2871 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
2872 expected output.
2873 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
2874
4a2a22f4
AD
28752002-07-25 Akim Demaille <akim@epita.fr>
2876
2877 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
2878 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
2879 (b4_c_knr_arg_decl): New.
2880 * data/yacc.c: Use it to define yysymprint, yydestruct, and
2881 yyreport_parse_error.
2882
b8df3223
AD
28832002-07-25 Akim Demaille <akim@epita.fr>
2884
2885 * data/yacc.c (yyreport_parse_error): New, extracted from...
2886 (yyparse): here.
2887 (yydestruct, yysymprint): Move above yyparse.
2888 Be K&R compliant.
2889
a762e609
AD
28902002-07-25 Akim Demaille <akim@epita.fr>
2891
2892 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
2893 replace...
2894 (b4_sint_type, b4_uint_type): these.
2895 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
2896 * tests/regression.at (Web2c Actions): Adjust.
2897
12b0043a
AD
28982002-07-25 Akim Demaille <akim@epita.fr>
2899
2900 * src/gram.h (TIEM_NUMBER_MAX): New.
2901 (item_number_of_rule_number, rule_number_of_item_number): Rename
2902 as...
2903 (rule_number_as_item_number, item_number_as_rule_number): these.
2904 Adjust dependencies.
2905 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
2906 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
2907 (symbol_number_to_vector_number): New.
2908 (order): Of vector_number_t* type.
2909 (base_t, BASE_MAX, BASE_MIN): New.
2910 (froms, tos, width, pos, check): Of base_t type.
2911 (action_number_t, ACTION_MIN, ACTION_MAX): New.
2912 (actrow): Of action_number_t type.
2913 (conflrow): Of unsigned int type.
2914 (table_ninf, base_ninf): New.
2915 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
2916 (muscle_insert_int_table, muscle_insert_base_table)
2917 (muscle_insert_rule_number_table): New.
2918 (prepare_tokens): Output `toknum' as int_table.
2919 (action_row): Returns a rule_number_t.
2920 Use ACTION_MIN, not SHRT_MIN.
2921 (token_actions): yydefact is rule_number_t*.
2922 (table_ninf_remap): New.
2923 (pack_table): Use it for `base' and `table'.
2924 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
2925 replaced with...
2926 (YYPACT_NINF, YYTABLE_NINF): these.
2927 (yypact, yytable): Compute their types instead of hard-coded
2928 `short'.
2929 * tests/regression.at (Web2c Actions): Adjust.
2930
5dde258a
AD
29312002-07-19 Akim Demaille <akim@epita.fr>
2932
2933 * src/scan-gram.l (id): Can start with an underscore.
2934
a945ec39
AD
29352002-07-16 Akim Demaille <akim@epita.fr>
2936
2937 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
2938 Adjust all former `associativity' dependencies.
2939 * src/symtab.c (symbol_new): Default associativity is `undef', not
2940 `right'.
2941 (symbol_check_alias_consistence): Adjust.
2942
fae437e8
AD
29432002-07-09 Akim Demaille <akim@epita.fr>
2944
2945 * doc/bison.texinfo: Properly set the ``header'' part.
2946 Use @dircategory ``GNU programming tools'' as per Texinfo's
2947 documentation.
2948 Use @copying.
2949
1a715ef2
AD
29502002-07-09 Akim Demaille <akim@epita.fr>
2951
2952 * lib/quotearg.h: Protect against multiple inclusions.
2953 * src/location.h (location_t): Add a `file' member.
2954 (LOCATION_RESET, LOCATION_PRINT): Adjust.
2955 * src/complain.c (warn_at, complain_at, fatal_at): Drop
2956 `error_one_per_line' support.
2957
a5d50994
AD
29582002-07-09 Akim Demaille <akim@epita.fr>
2959
2960 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
2961 * src/reader.c (lineno): Remove.
2962 Adjust all dependencies.
2963 (get_merge_function): Take a location and use complain_at.
2964 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
2965 * tests/regression.at (Invalid inputs, Mixing %token styles):
2966 Adjust.
2967
b275314e
AD
29682002-07-09 Akim Demaille <akim@epita.fr>
2969
2970 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
2971 recovery rule, and forbid extensions when --yacc.
2972 (gram_error): Use complain_at.
2973 * src/reader.c (reader): Exit if there were parse errors.
2974
865b9df1
AD
29752002-07-09 Akim Demaille <akim@epita.fr>
2976
2977 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
2978 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
2979 Reported by R Blake <blakers@mac.com>.
2980
c76e14da
AD
29812002-07-09 Akim Demaille <akim@epita.fr>
2982
2983 * data/yacc.c: Output the copyright notive in the header.
2984
7db2ed2d
AD
29852002-07-03 Akim Demaille <akim@epita.fr>
2986
2987 * src/output.c (froms, tos): Are state_number_t.
2988 (save_column): sp, sp1, and sp2 are state_number_t.
2989 (prepare): Rename `final' as `final_state_number', `nnts' as
2990 `nterms_number', `nrules' as `rules_number', `nstates' as
2991 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
2992 unused.
2993 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
2994 * data/lalr1.cc (nsym_): Remove, unused.
2995
e68e0410
AD
29962002-07-03 Akim Demaille <akim@epita.fr>
2997
2998 * src/lalr.h, src/lalr.c (goto_number_t): New.
2999 * src/lalr.c (goto_list_t): New.
3000 Propagate them.
3001 * src/nullable.c (rule_list_t): New.
3002 Propagate.
3003 * src/types.h: Remove.
3004
e1a4f3a4
AD
30052002-07-03 Akim Demaille <akim@epita.fr>
3006
3007 * src/closure.c (print_fderives): Use rule_rhs_print.
3008 * src/derives.c (print_derives): Use rule_rhs_print.
3009 (rule_list_t): New, replaces `shorts'.
3010 (set_derives): Add comments.
3011 * tests/sets.at (Nullable, Firsts): Adjust.
3012
536545f3
AD
30132002-07-03 Akim Demaille <akim@epita.fr>
3014
3015 * src/output.c (prepare_actions): Free `tally' and `width'.
3016 (prepare_actions): Allocate and free `order'.
3017 * src/symtab.c (symbols_free): Free `symbols'.
3018 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
3019 * src/output.c (m4_invoke): Move to...
3020 * src/scan-skel.l: here.
3021 (<<EOF>>): Close yyout, and free its name.
3022
8b752b00
AD
30232002-07-03 Akim Demaille <akim@epita.fr>
3024
3025 Fix some memory leaks, and fix a bug: state 0 was examined twice.
3026
3027 * src/LR0.c (new_state): Merge into...
3028 (state_list_append): this.
3029 (new_states): Merge into...
3030 (generate_states): here.
3031 (set_states): Don't ensure a proper `errs' state member here, do it...
3032 * src/conflicts.c (conflicts_solve): here.
3033 * src/state.h, src/state.c: Comment changes.
3034 (state_t): Rename member `shifts' as `transitions'.
3035 Adjust all dependencies.
3036 (errs_new): For consistency, also take the values as argument.
3037 (errs_dup): Remove.
3038 (state_errs_set): New.
3039 (state_reductions_set, state_transitions_set): Assert that no
3040 previous value was assigned.
3041 (state_free): New.
3042 (states_free): Use it.
3043 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
3044 temporary storage: use `errs' and `nerrs' as elsewhere.
3045 (set_conflicts): Allocate and free this `errs'.
3046
613f5e1a
AD
30472002-07-02 Akim Demaille <akim@epita.fr>
3048
3049 * lib/libiberty.h: New.
3050 * lib: Update the bitset implementation from upstream.
3051 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
3052 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
3053 * src/main.c: Adjust bitset stats calls.
3054
26e0cadc
PE
30552002-07-01 Paul Eggert <eggert@twinsun.com>
3056
3057 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
3058 char, so that negative chars don't collide with $.
3059
1154cced
AD
30602002-06-30 Akim Demaille <akim@epita.fr>
3061
3062 Have the GLR tests be `warning' checked, and fix the warnings.
3063
3064 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
3065 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
3066 (yyremoveDeletes): `yyi' and `yyj' are size_t.
3067 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
3068 (yyaddDeferredAction): static.
3069 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
3070 (yyreportParseError): yyprefix is const.
3071 yytokenp is used only when verbose.
3072 (yy__GNUC__): Replace with __GNUC__.
3073 (yypdumpstack): yyi is size_t.
3074 (yypreference): Un-yy local variables and arguments, to avoid
3075 clashes with `yyr1'. Anyway, we are not in the user name space.
3076 (yytname_size): be an int, as is compared with ints.
3077 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
3078 Use them.
3079 * tests/cxx-gram.at: Use quotation to protect $1.
3080 Use AT_COMPILE to enable warnings hunts.
3081 Prototype yylex and yyerror.
3082 `Use' argc.
3083 Include `string.h', not `strings.h'.
3084 Produce and prototype stmtMerge only when used.
3085 yylex takes a location.
3086
97650f4e
AD
30872002-06-30 Akim Demaille <akim@epita.fr>
3088
3089 We spend a lot of time in quotearg, in particular when --verbose.
3090
3091 * src/symtab.c (symbol_get): Store a quoted version of the key.
3092 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
3093 Adjust all callers.
3094
d2576365
AD
30952002-06-30 Akim Demaille <akim@epita.fr>
3096
3097 * src/state.h (reductions_t): Rename member `nreds' as num.
3098 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
3099 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
3100
ccaf65bc
AD
31012002-06-30 Akim Demaille <akim@epita.fr>
3102
3103 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
3104 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
3105 (shifts_to): Rename as...
3106 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
3107 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
3108 (TRANSITION_IS_DISABLED, transitions_to): these.
3109
87675353
AD
31102002-06-30 Akim Demaille <akim@epita.fr>
3111
3112 * src/print.c (print_shifts, print_gotos): Merge into...
3113 (print_transitions): this.
3114 (print_transitions, print_errs, print_reductions): Align the
3115 lookaheads columns.
3116 (print_core, print_transitions, print_errs, print_state,
3117 print_grammar): Output empty lines separator before, not after.
3118 (state_default_rule_compute): Rename as...
3119 (state_default_rule): this.
3120 * tests/conflicts.at (Defaulted Conflicted Reduction),
3121 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
3122 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
3123
ce4ccb4b
AD
31242002-06-30 Akim Demaille <akim@epita.fr>
3125
3126 Display items as we display rules.
3127
3128 * src/gram.h, src/gram.c (rule_lhs_print): New.
3129 * src/gram.c (grammar_rules_partial_print): Use it.
3130 * src/print.c (print_core): Likewise.
3131 * tests/conflicts.at (Defaulted Conflicted Reduction),
3132 (Unresolved SR Conflicts): Adjust.
3133 (Unresolved SR Conflicts): Adjust and rename as...
3134 (Resolved SR Conflicts): this, as was meant.
3135 * tests/regression.at (Web2c Report): Adjust.
3136
bc933ef1
AD
31372002-06-30 Akim Demaille <akim@epita.fr>
3138
3139 * src/print.c (state_default_rule_compute): New, extracted from...
3140 (print_reductions): here.
3141 Pessimize, but clarify the code.
3142 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
3143
53d4308d
AD
31442002-06-30 Akim Demaille <akim@epita.fr>
3145
3146 * src/output.c (action_row): Let default_rule be always a rule
3147 number.
3148
574fb2d5
AD
31492002-06-30 Akim Demaille <akim@epita.fr>
3150
3151 * src/closure.c (print_firsts, print_fderives, closure):
3152 Use BITSET_EXECUTE.
3153 * src/lalr.c (lookaheads_print): Likewise.
3154 * src/state.c (state_rule_lookaheads_print): Likewise.
3155 * src/print_graph.c (print_core): Likewise.
3156 * src/print.c (print_reductions): Likewise.
3157 * src/output.c (action_row): Likewise.
3158 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
3159
05811fd7
AD
31602002-06-30 Akim Demaille <akim@epita.fr>
3161
3162 * src/print_graph.c: Use report_flag.
3163
0e4d5753
AD
31642002-06-30 Akim Demaille <akim@epita.fr>
3165
3166 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
3167 to...
3168 * src/relation.h, src/relation.c (traverse, relation_digraph)
3169 (relation_print, relation_transpose): New.
3170
24c7d800
AD
31712002-06-30 Akim Demaille <akim@epita.fr>
3172
3173 * src/state.h, src/state.c (shifts_to): New.
3174 * src/lalr.c (build_relations): Use it.
3175
9222837b
AD
31762002-06-30 Akim Demaille <akim@epita.fr>
3177
3178 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
3179 (item_number_of_rule_number, rule_number_of_item_number): New.
3180 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
3181 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
3182 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
3183 Propagate their use.
3184 Much remains to be done, in particular wrt `shorts' from types.h.
3185
260008e5
AD
31862002-06-30 Akim Demaille <akim@epita.fr>
3187
3188 * src/symtab.c (symbol_new): Initialize the `printer' member.
3189
8a731ca8
AD
31902002-06-30 Akim Demaille <akim@epita.fr>
3191
3192 * src/LR0.c (save_reductions): Remove, replaced by...
3193 * src/state.h, src/state.c (state_reductions_set): New.
3194 (reductions, errs): Rename as...
3195 (reductions_t, errs_t): these.
3196 Adjust all dependencies.
3197
32e1e0a4
AD
31982002-06-30 Akim Demaille <akim@epita.fr>
3199
3200 * src/LR0.c (state_list_t, state_list_append): New.
3201 (first_state, last_state): Now symbol_list_t.
3202 (this_state): Remove.
3203 (new_itemsets, append_states, save_reductions): Take a state_t as
3204 argument.
3205 (set_states, generate_states): Adjust.
3206 (save_shifts): Remove, replaced by...
3207 * src/state.h, src/state.c (state_shifts_set): New.
3208 (shifts): Rename as...
3209 (shifts_t): this.
3210 Adjust all dependencies.
3211 * src/state.h (state_t): Remove the `next' member.
3212
e5fb6710
AD
32132002-06-30 Akim Demaille <akim@epita.fr>
3214
3215 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
3216 escaped in slot 0.
3217
c7ca99d4
AD
32182002-06-30 Akim Demaille <akim@epita.fr>
3219
3220 Use hash.h for the state hash table.
3221
3222 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
3223 (allocate_storage): Use state_hash_new.
3224 (free_storage): Use state_hash_free.
3225 (new_state, get_state): Adjust.
3226 * src/lalr.h, src/lalr.c (states): Move to...
3227 * src/states.h (state_t): Remove the `link' member, no longer
3228 used.
3229 * src/states.h, src/states.c: here.
3230 (state_hash_new, state_hash_free, state_hash_lookup)
3231 (state_hash_insert, states_free): New.
3232 * src/states.c (state_table, state_compare, state_hash): New.
3233 * src/output.c (output_actions): Do not free states now, since we
3234 still need to know the final_state number in `prepare', called
3235 afterwards. Do it...
3236 * src/main.c (main): here: call states_free after `output'.
3237
df0e7316
AD
32382002-06-30 Akim Demaille <akim@epita.fr>
3239
3240 * src/state.h, src/state.c (state_new): New, extracted from...
3241 * src/LR0.c (new_state): here.
3242 * src/state.h (STATE_ALLOC): Move to...
3243 * src/state.c: here.
3244 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
3245 * src/state.h, src/state.c: here.
3246
39f41916
AD
32472002-06-30 Akim Demaille <akim@epita.fr>
3248
3249 * src/reader.c (gensym): Rename as...
3250 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
3251 (getsym): Rename as...
3252 (symbol_get): this.
3253
d57650a5
AD
32542002-06-30 Akim Demaille <akim@epita.fr>
3255
3256 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
3257 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
3258 * src/output.c, src/print.c, src/print_graph.c: Propagate.
3259 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
3260
5a08f1ce
AD
32612002-06-30 Akim Demaille <akim@epita.fr>
3262
3263 Make the test suite pass with warnings checked.
3264
3265 * tests/actions.at (Printers and Destructors): Improve.
3266 Avoid unsigned vs. signed issues.
3267 * tests/calc.at: Don't exercise the scanner here, do it...
3268 * tests/input.at (Torturing the Scanner): here.
3269
720623af
PH
32702002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3271
88e7e941 3272 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
3273 reorganize first lines parallel to yacc.c.
3274
fb8135fa
AD
32752002-06-28 Akim Demaille <akim@epita.fr>
3276
3277 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
3278 (b4_token_enum, b4_token_defines): New, factored from...
3279 * data/lalr1.cc, data/yacc.c, glr.c: here.
3280
41442480
AD
32812002-06-28 Akim Demaille <akim@epita.fr>
3282
3283 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
3284 unused variables.
3285 * src/output.c (merger_output): static.
3286
e0e5bf84
AD
32872002-06-28 Akim Demaille <akim@epita.fr>
3288
3289 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
3290 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
3291 pacify GCC.
3292 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 3293
676385e2
PH
32942002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3295
3296 Accumulated changelog for new GLR parsing features.
3297
6a254321 3298 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
3299 conflicts_total_count.
3300 * src/conflicts.h: Ditto.
3301 * src/output.c (token_actions): Use the new name.
3302 (output_conflicts): Change conflp => conflict_list_heads, and
3303 confl => conflict_list for better readability.
3304 * data/glr.c: Use the new names.
3305 * NEWS: Add self to GLR announcement.
e0e5bf84 3306
676385e2
PH
3307 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
3308
3309 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
3310 Akim Demaille.
3311
3312 * data/bison.glr: Change name to glr.c
3313 * data/glr.c: Renamed from bison.glr.
3314 * data/Makefile.am: Add glr.c
e0e5bf84
AD
3315
3316 * src/getargs.c:
3317
676385e2
PH
3318 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
3319 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 3320
676385e2
PH
3321 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3322
3323 * data/bison.glr: Be sure to restore the
3324 current #line when returning to the skeleton contents after having
3325 exposed the input file's #line.
3326
3327 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3328
3329 * data/bison.glr: Bring up to date with changes to bison.simple.
3330
3331 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3332
3333 * data/bison.glr: Correct definitions that use b4_prefix.
3334 Various reformatting.
3335 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
3336 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
3337 yytokenp argument; now part of stack.
3338 (yychar): Define to behave as documented.
3339 (yyclearin): Ditto.
e0e5bf84 3340
676385e2
PH
3341 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
3342
3343 * src/reader.h: Add declaration for free_merger_functions.
3344
3345 * src/reader.c (merge_functions): New variable.
3346 (get_merge_function): New function.
3347 (free_merger_functions): New function.
3348 (readgram): Check for %prec that is not followed by a symbol.
3349 Handle %dprec and %merge declarations.
3350 (packgram): Initialize dprec and merger fields in rules array.
3351
3352 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
3353 conflict_list_cnt, conflict_list_free): New variables.
3354 (table_grow): Also grow conflict_table.
e0e5bf84 3355 (prepare_rules): Output dprec and merger tables.
676385e2 3356 (conflict_row): New function.
e0e5bf84 3357 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
3358 default reduction in conflicted states for GLR parser so that there
3359 are spaces for the conflict lists.
3360 (save_row): Also save conflict information.
3361 (token_actions): Allocate conflict list.
3362 (merger_output): New function.
3363 (pack_vector): Pack conflict table, too.
3364 (output_conflicts): New function to output yyconflp and yyconfl.
3365 (output_check): Allocate conflict_tos.
3366 (output_actions): Output conflict tables, also.
3367 (output_skeleton): Output b4_mergers definition.
3368 (prepare): Output b4_max_rhs_length definition.
3369 Use 'bison.glr' as default skeleton for GLR parsers.
3370
3371 * src/gram.c (glr_parser): New flag.
3372 (grammar_free): Call free_merger_functions.
3373
3374 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
3375 all pairs of conflicting reductions, rather than just all tokens
3376 causing conflicts. Needed to size conflict tables.
e0e5bf84 3377 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
3378 interface.
3379 (conflicts_print): Ditto.
3380 (count_total_conflicts): New function.
3381
3382 * src/reader.h (merger_list): New type.
3383 (merge_functions): New variable.
3384
3385 * src/lex.h (tok_dprec, tok_merge): New token types.
3386
3387 * src/gram.h (rule_s): Add dprec and merger fields.
3388 (glr_parser): New flag.
3389
3390 * src/conflicts.h (count_total_conflicts): New function.
3391
3392 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
3393
3394 * doc/bison.texinfo (Generalized LR Parsing): New section.
3395 (GLR Parsers): New section.
3396 (Language and Grammar): Mention GLR parsing.
3397 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
3398 Correct typo ("tge" -> "the").
3399
3400 * data/bison.glr: New skeleton for GLR parsing.
3401
3402 * tests/cxx-gram.at: New tests for GLR parsing.
3403
3404 * tests/testsuite.at: Include cxx-gram.at.
3405
3406 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 3407
676385e2
PH
3408 * src/parse-gram.y:
3409
3410 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
3411
3412 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 3413
b5480d74 34142002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
3415
3416 * src/options.h, src/options.c: Remove.
3417 * src/getargs.c (short_options, long_options): New.
3418
60491a94
AD
34192002-06-27 Akim Demaille <akim@epita.fr>
3420
3421 * data/bison.simple, data/bison.c++: Rename as...
3422 * data/yacc.c, data/lalr1.cc: these.
3423 * doc/bison.texinfo (Environment Variables): Remove.
3424
9be0c25b
AD
34252002-06-25 Raja R Harinath <harinath@cs.umn.edu>
3426
3427 * src/getargs.c (report_argmatch): Initialize strtok().
3428
1ae72863
AD
34292002-06-20 Akim Demaille <akim@epita.fr>
3430
3431 * data/bison.simple (b4_symbol_actions): New, replaces...
3432 (b4_symbol_destructor, b4_symbol_printer): these.
3433 (yysymprint): Be sure to call YYPRINT only for tokens, and using
3434 user token numbers.
3435
87542d29
AD
34362002-06-20 Akim Demaille <akim@epita.fr>
3437
3438 * data/bison.simple (yydestructor): Rename as...
3439 (yydestruct): this.
3440
1a31ed21
AD
34412002-06-20 Akim Demaille <akim@epita.fr>
3442
3443 * src/symtab.h, src/symtab.c (symbol_type_set)
3444 (symbol_destructor_set, symbol_precedence_set): The location is
3445 the last argument.
3446 Adjust all callers.
3447
e776192e
AD
34482002-06-20 Akim Demaille <akim@epita.fr>
3449
3450 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
3451 internals.
3452 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
3453 Takes a location.
3454 * src/symtab.h, src/symtab.c (symbol_class_set)
3455 (symbol_user_token_number_set): Likewise.
3456 Adjust all callers.
3457 Promote complain_at.
3458 * tests/input.at (Type Clashes): Adjust.
3459
5c1180b3
AD
34602002-06-20 Akim Demaille <akim@epita.fr>
3461
3462 * data/bison.simple (YYLEX): Fix the declaration when
3463 %pure-parser.
3464
e3170060
AD
34652002-06-20 Akim Demaille <akim@epita.fr>
3466
3467 * data/bison.simple (yysymprint): Don't print the token number,
3468 just its name.
3469 * tests/actions.at (Destructors): Rename as...
3470 (Printers and Destructors): this.
3471 Also exercise %printer.
3472
253862fd
AD
34732002-06-20 Akim Demaille <akim@epita.fr>
3474
3475 * data/bison.simple (YYDSYMPRINT): New.
3476 Use it to remove many of the #if YYDEBUG/if (yydebug).
3477
366eea36
AD
34782002-06-20 Akim Demaille <akim@epita.fr>
3479
3480 * src/symtab.h, src/symtab.c (symbol_t): printer and
3481 printer_location are new members.
3482 (symbol_printer_set): New.
3483 * src/parse-gram.y (PERCENT_PRINTER): New token.
3484 Handle its associated rule.
3485 * src/scan-gram.l: Adjust.
3486 (handle_destructor_at, handle_destructor_dollar): Rename as...
3487 (handle_symbol_code_at, handle_symbol_code_dollar): these.
3488 * src/output.c (symbol_printers_output): New.
3489 (output_skeleton): Call it.
3490 * data/bison.simple (yysymprint): New. Cannot be named yyprint
3491 since there are already many grammar files with a user `yyprint'.
3492 Replace the calls to YYPRINT to calls to yysymprint.
3493 * tests/calc.at: Adjust.
3494 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
3495 taking advantage of parser very internal details (stack size!).
3496
4f25ebb0
AD
34972002-06-20 Akim Demaille <akim@epita.fr>
3498
3499 * src/scan-gram.l: Complete the scanner with the missing patterns
3500 to pacify Flex.
3501 Use `quote' and `symbol_tag_get' where appropriate.
3502
93b68a0e
AD
35032002-06-19 Akim Demaille <akim@epita.fr>
3504
3505 * tests/actions.at (Destructors): Augment to test locations.
3506 * data/bison.simple (yydestructor): Pass it the current location
3507 if locations are enabled.
3508 Prototype only when __STDC__ or C++.
3509 Change the argument names to move into the yy name space: there is
3510 user code here.
3511
58612f1d
AD
35122002-06-19 Akim Demaille <akim@epita.fr>
3513
74310291
AD
3514 * data/bison.simple (b4_pure_if): New.
3515 Use it instead of #ifdef YYPURE.
3516
35172002-06-19 Akim Demaille <akim@epita.fr>
3518
3519 * data/bison.simple (b4_location_if): New.
58612f1d
AD
3520 Use it instead of #ifdef YYLSP_NEEDED.
3521
f25bfb75
AD
35222002-06-19 Akim Demaille <akim@epita.fr>
3523
3524 Prepare @$ in %destructor, but currently don't bind it in the
3525 skeleton, as %location use is not cleaned up yet.
3526
3527 * src/scan-gram.l (handle_dollar, handle_destructor_at)
3528 (handle_action_at): New.
3529 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
3530 a braced_code_t and a location as additional arguments.
3531 (handle_destructor_dollar): Instead of requiring `b4_eval', just
3532 unquote one when outputting `b4_dollar_dollar'.
3533 Adjust callers.
3534 * data/bison.simple (b4_eval): Remove.
3535 (b4_symbol_destructor): Adjust.
3536 * tests/input.at (Invalid @n): Adjust.
3537
c732d2c6
AD
35382002-06-19 Zack Weinberg <zack@codesourcery.com>
3539
3540 * doc/bison.texinfo: Document ability to have multiple
3541 prologue sections.
3542
8c165d89
AD
35432002-06-18 Akim Demaille <akim@epita.fr>
3544
3545 * src/files.c (compute_base_names): When computing the output file
3546 names from the input file name, strip the directory part.
3547
ca98bf57
AD
35482002-06-18 Akim Demaille <akim@epita.fr>
3549
3550 * data/bison.simple.new: Comment changes.
3551 Reported by Andreas Schwab.
3552
0bfb02ff
AD
35532002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
3554
3555 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
3556 there are no `label `yyoverflowlab' defined but not used' warnings
3557 when yyoverflow is defined.
3558
24c0aad7
AD
35592002-06-18 Akim Demaille <akim@epita.fr>
3560
3561 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
3562 new member.
3563 (symbol_destructor_set): Adjust.
3564 * src/output.c (symbol_destructors_output): Output the destructor
3565 locations.
3566 Output the symbol name.
3567 * data/bison.simple (b4_symbol_destructor): Adjust.
3568
5719c109
AD
35692002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
3570 and Akim Demaille <akim@epita.fr>
3571
3572 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
3573 what's left on the stack when the error recovery hits EOF.
3574 * tests/actions.at (Destructors): Complete to exercise this case.
3575
9280d3ef
AD
35762002-06-17 Akim Demaille <akim@epita.fr>
3577
3578 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
3579 arguments is really empty, not only equal to `[]'.
3580 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
3581 member.
3582 (symbol_destructor_set): New.
3583 * src/output.c (symbol_destructors_output): New.
3584 * src/reader.h (brace_code_t, current_braced_code): New.
3585 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
3586 (handle_dollar): Rename as...
3587 (handle_action_dollar): this.
3588 (handle_destructor_dollar): New.
3589 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
3590 (grammar_declaration): Use it.
3591 * data/bison.simple (yystos): Is always defined.
3592 (yydestructor): New.
3593 * tests/actions.at (Destructors): New.
3594 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
3595
dafdc66f
AD
35962002-06-17 Akim Demaille <akim@epita.fr>
3597
3598 * src/symlist.h, src/symlist.c (symbol_list_length): New.
3599 * src/scan-gram.l (handle_dollar, handle_at): Compute the
3600 rule_length only when needed.
3601 * src/output.c (actions_output, token_definitions_output): Output
3602 the full M4 block.
3603 * src/symtab.c: Don't access directly to the symbol tag, use
3604 symbol_tag_get.
3605 * src/parse-gram.y: Use symbol_list_free.
3606
56c47203
AD
36072002-06-17 Akim Demaille <akim@epita.fr>
3608
3609 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
3610 (symbol_list_prepend, get_type_name): Move to...
3611 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
3612 (symbol_list_prepend, symbol_list_n_type_name_get): here.
3613 Adjust all callers.
3614 (symbol_list_free): New.
3615 * src/scan-gram.l (handle_dollar): Takes a location.
3616 * tests/input.at (Invalid $n): Adjust.
3617
1e0bab92
AD
36182002-06-17 Akim Demaille <akim@epita.fr>
3619
3620 * src/reader.h, src/reader.c (symbol_list_new): Export it.
3621 (symbol_list_prepend): New.
3622 * src/parse-gram.y (%union): `list' is a new member.
3623 (symbols.1): New, replaces...
3624 (terms_to_prec.1, nterms_to_type.1): these.
3625 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
3626 Take a location as additional argument.
3627 Adjust all callers.
3628
04e60654
AD
36292002-06-15 Akim Demaille <akim@epita.fr>
3630
3631 * src/parse-gram.y: Move %token in the declaration section so that
3632 we don't depend upon CVS Bison.
3633
10e5b8bd
AD
36342002-06-15 Akim Demaille <akim@epita.fr>
3635
3636 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
3637 * src/print.c (print_core): Use it.
3638
9801d40c
AD
36392002-06-15 Akim Demaille <akim@epita.fr>
3640
3641 * src/conflicts.c (log_resolution): Accept the rule involved in
3642 the sr conflicts instead of the lookahead number that points to
3643 that rule.
3644 (flush_reduce): Accept the current lookahead vector as argument,
3645 instead of the index in LA.
3646 (resolve_sr_conflict): Accept the current number of lookahead
3647 bitset to consider for the STATE, instead of the index in LA.
3648 (set_conflicts): Adjust.
3649 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
3650
c0263492
AD
36512002-06-15 Akim Demaille <akim@epita.fr>
3652
3653 * src/state.h (state_t): Replace the `lookaheadsp' member, a
3654 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
3655 Adjust all dependencies.
3656 * src/lalr.c (initialize_lookaheads): Split into...
3657 (states_lookaheads_count, states_lookaheads_initialize): these.
3658 (lalr): Adjust.
3659
9757c359
AD
36602002-06-15 Akim Demaille <akim@epita.fr>
3661
3662 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
3663 out of...
3664 (grammar_rules_print): here.
3665 * src/reduce.c (reduce_output): Use it.
3666 * tests/reduce.at (Useless Rules, Reduced Automaton)
3667 (Underivable Rules): Adjust.
3668
6b98e4b5
AD
36692002-06-15 Akim Demaille <akim@epita.fr>
3670
3671 Copy BYacc's nice way to report the grammar.
3672
3673 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
3674 New.
3675 Don't print the rules' location, it is confusing and useless.
3676 (rule_print): Use grammar_rhs_print.
3677 * src/print.c (print_grammar): Use grammar_rules_print.
3678
6b98e4b5
AD
36792002-06-15 Akim Demaille <akim@epita.fr>
3680
3681 Complete and rationalize `useless thing' warnings.
3682
3683 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
3684 (symbol_tag_print): New.
3685 Use them everywhere in place of accessing directly the tag member.
3686 * src/gram.h, src/gram.c (rule_print): New.
3687 Use it where a rule used to be printed `by hand'.
3688 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
3689 (reduce_grammar_tables): Report the useless rules.
3690 (reduce_print): Useless things are a warning, not an error.
3691 Report it as such.
3692 * tests/reduce.at (Useless Nonterminals, Useless Rules):
3693 (Reduced Automaton, Underivable Rules): Adjust.
3694 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
3695 * tests/conflicts.at (Unresolved SR Conflicts)
3696 (Solved SR Conflicts): Adjust.
3697
ee000ba4
AD
36982002-06-15 Akim Demaille <akim@epita.fr>
3699
3700 Let symbols have a location.
3701
3702 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
3703 (getsym): Adjust.
3704 Adjust all callers.
3705 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
3706 Use location_t, not int.
3707 * src/symtab.c (symbol_check_defined): Take advantage of the
3708 location.
3709 * tests/regression.at (Invalid inputs): Adjust.
3710
8efe435c
AD
37112002-06-15 Akim Demaille <akim@epita.fr>
3712
3713 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
3714 (input): Don't try to initialize yylloc here, do it in the
3715 scanner.
3716 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
3717 * src/gram.h (rule_t): Change line and action_line into location
3718 and action_location, of location_t type.
3719 Adjust all dependencies.
3720 * src/location.h, src/location.c (empty_location): New.
3721 * src/reader.h, src/reader.c (grammar_start_symbol_set)
3722 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
3723 (grammar_current_rule_symbol_append)
3724 (grammar_current_rule_action_append): Expect a location as argument.
3725 * src/reader.c (grammar_midrule_action): Adjust to attach an
3726 action's location as dummy symbol location.
3727 * src/symtab.h, src/symtab.c (startsymbol_location): New.
3728 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
3729 the line numbers.
3730
1921f1d7
AD
37312002-06-14 Akim Demaille <akim@epita.fr>
3732
3733 Grammar declarations may be found in the grammar section.
3734
3735 * src/parse-gram.y (rules_or_grammar_declaration): New.
3736 (declarations): Each declaration may end with a semicolon, not
3737 just...
3738 (grammar_declaration): `"%union"'.
3739 (grammar): Branch to rules_or_grammar_declaration.
3740
4515534c
AD
37412002-06-14 Akim Demaille <akim@epita.fr>
3742
3743 * src/main.c (main): Invoke scanner_free.
3744
f958596b
AD
37452002-06-14 Akim Demaille <akim@epita.fr>
3746
3747 * src/output.c (m4_invoke): Extracted from...
3748 (output_skeleton): here.
3749 Free tempfile.
3750
2c569025
AD
37512002-06-14 Akim Demaille <akim@epita.fr>
3752
3753 * src/parse-gram.y (directives, directive, gram)
3754 (grammar_directives, precedence_directives, precedence_directive):
3755 Rename as...
3756 (declarations, declaration, grammar, grammar_declaration)
3757 (precedence_declaration, precedence_declarator): these.
3758 (symbol_declaration): New.
3759
592e8d4d
AD
37602002-06-14 Akim Demaille <akim@epita.fr>
3761
3762 * src/files.c (action_obstack): Remove, unused.
3763 (output_obstack): Remove it, and all its dependencies, as it is no
3764 longer needed.
3765 * src/reader.c (epilogue_set): Build the epilogue in the
3766 muscle_obstack.
3767 * src/output.h, src/output.c (muscle_obstack): Move to...
3768 * src/muscle_tab.h, src/muscle_tab.h: here.
3769 (muscle_init): Initialize muscle_obstack.
3770 (muscle_free): New.
3771 * src/main.c (main): Call it.
3772
0c15323d
AD
37732002-06-14 Akim Demaille <akim@epita.fr>
3774
3775 * src/location.h: New, extracted from...
3776 * src/reader.h: here.
3777 * src/Makefile.am (noinst_HEADERS): Merge into
3778 (bison_SOURCES): this.
3779 Add location.h.
3780 * src/parse-gram.y: Use location_t instead of Bison's.
3781 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
3782 Use location_t instead of ints.
3783
e96c9728
AD
37842002-06-14 Akim Demaille <akim@epita.fr>
3785
3786 * data/bison.simple, data/bison.c++: Be sure to restore the
3787 current #line when returning to the skeleton contents after having
3788 exposed the input file's #line.
3789
75d1fe16
AD
37902002-06-12 Akim Demaille <akim@epita.fr>
3791
3792 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
3793 eager.
3794 * tests/actions.at (Exotic Dollars): New.
3795
6c35d22c
AD
37962002-06-12 Akim Demaille <akim@epita.fr>
3797
3798 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
3799 ['"/] too eagerly.
3800 * tests/input.at (Torturing the Scanner): New.
3801
1d6412ad
AD
38022002-06-11 Akim Demaille <akim@epita.fr>
3803
3804 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
3805 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
3806 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
3807 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
3808 * src/reader.c (reader): Use it.
3809
4cdb01db
AD
38102002-06-11 Akim Demaille <akim@epita.fr>
3811
3812 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
3813 Adjust all callers.
3814 (scanner_last_string_free): New.
3815
44995b2e
AD
38162002-06-11 Akim Demaille <akim@epita.fr>
3817
3818 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
3819 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
3820 (last_string, YY_OBS_FREE): New.
3821 Use them when returning an ID.
3822
e9955c83
AD
38232002-06-11 Akim Demaille <akim@epita.fr>
3824
3825 Have Bison grammars parsed by a Bison grammar.
3826
3827 * src/reader.c, src/reader.h (prologue_augment): New.
3828 * src/reader.c (copy_definition): Remove.
3829
3830 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
3831 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
3832 (grammar_current_rule_prec_set, grammar_current_rule_check)
3833 (grammar_current_rule_symbol_append)
3834 (grammar_current_rule_action_append): Export.
3835 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
3836 (symbol_list_action_append): Remove.
3837 Hook the routines from reader.
3838 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
3839 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
3840
3841 * src/reader.c (read_declarations): Remove, unused.
3842
3843 * src/parse-gram.y: Handle the epilogue.
3844 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
3845 (grammar_start_symbol_set): this.
3846 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
3847 * src/reader.c (readgram): Remove, unused.
3848 (reader): Adjust to insert eoftoken and axiom where appropriate.
3849
3850 * src/reader.c (copy_dollar): Replace with...
3851 * src/scan-gram.h (handle_dollar): this.
3852 * src/parse-gram.y: Remove `%thong'.
3853
3854 * src/reader.c (copy_at): Replace with...
3855 * src/scan-gram.h (handle_at): this.
3856
3857 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
3858 New.
3859
3860 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
3861 time being.
3862
3863 * src/reader.h, src/reader.c (grammar_rule_end): New.
3864
3865 * src/parse.y (current_type, current_class): New.
3866 Implement `%nterm', `%token' support.
3867 Merge `%term' into `%token'.
3868 (string_as_id): New.
3869 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
3870 type name.
3871
3872 * src/parse-gram.y: Be sure to handle properly the beginning of
3873 rules.
3874
3875 * src/parse-gram.y: Handle %type.
3876 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
3877
3878 * src/parse-gram.y: More directives support.
3879 * src/options.c: No longer handle source directives.
3880
3881 * src/parse-gram.y: Fix %output.
3882
3883 * src/parse-gram.y: Handle %union.
3884 Use the prologue locations.
3885 * src/reader.c (parse_union_decl): Remove.
3886
3887 * src/reader.h, src/reader.c (epilogue_set): New.
3888 * src/parse-gram.y: Use it.
3889
3890 * data/bison.simple, data/bison.c++: b4_stype is now either not
3891 defined, then default to int, or to the contents of %union,
3892 without `union' itself.
3893 Adjust.
3894 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
3895
3896 * src/output.c (actions_output): Don't output braces, as they are
3897 already handled by the scanner.
3898
3899 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
3900 characters to themselves.
3901
3902 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
3903 that the epilogue has a proper #line.
3904
3905 * src/parse-gram.y: Handle precedence/associativity.
3906
3907 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
3908 a terminal.
3909 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
3910 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
3911 at all to define terminals that cannot be emitted.
3912
3913 * src/scan-gram.l: Escape M4 characters.
3914
3915 * src/scan-gram.l: Working properly with escapes in user
3916 strings/characters.
3917
3918 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
3919 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
3920 grammar.
3921 Use more modest sizes, as for the time being the parser does not
3922 release memory, and therefore the process swallows a huge amount
3923 of memory.
3924
3925 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
3926 stricter %token grammar.
3927
3928 * src/symtab.h (associativity): Add `undef_assoc'.
3929 (symbol_precedence_set): Do nothing when passed an undef_assoc.
3930 * src/symtab.c (symbol_check_alias_consistence): Adjust.
3931
3932 * tests/regression.at (Invalid %directive): Remove, as it is now
3933 meaningless.
3934 (Invalid inputs): Adjust to the new error messages.
3935 (Token definitions): The new grammar doesn't allow too many
3936 eccentricities.
3937
3938 * src/lex.h, src/lex.c: Remove.
3939 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
3940 (copy_character, copy_string2, copy_string, copy_identifier)
3941 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
3942 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
3943 (parse_action): Remove.
3944 * po/POTFILES.in: Adjust.
3945
2e047461
AD
39462002-06-11 Akim Demaille <akim@epita.fr>
3947
3948 * src/reader.c (parse_action): Don't store directly into the
3949 rule's action member: return the action as a string.
3950 Don't require `rule_length' as an argument: compute it.
3951 (grammar_current_rule_symbol_append)
3952 (grammar_current_rule_action_append): New, eved out from
3953 (readgram): here.
3954 Remove `action_flag', `rulelength', unused now.
3955
9af3fbce
AD
39562002-06-11 Akim Demaille <akim@epita.fr>
3957
3958 * src/reader.c (grammar_current_rule_prec_set).
3959 (grammar_current_rule_check): New, eved out from...
3960 (readgram): here.
3961 Remove `xaction', `first_rhs': useless.
3962 * tests/input.at (Type clashes): New.
3963 * tests/existing.at (GNU Cim Grammar): Adjust.
3964
1485e106
AD
39652002-06-11 Akim Demaille <akim@epita.fr>
3966
3967 * src/reader.c (grammar_midrule_action): New, Eved out from
3968 (readgram): here.
3969
da4160c3
AD
39702002-06-11 Akim Demaille <akim@epita.fr>
3971
3972 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
3973 New.
3974 (readgram): Use them as replacement of inlined code, crule and
3975 crule1.
3976
f6d0f937
AD
39772002-06-11 Akim Demaille <akim@epita.fr>
3978
3979 * src/reader.c (grammar_end, grammar_symbol_append): New.
3980 (readgram): Use them.
3981 Make the use of `p' as local as possible.
3982
69078d4b
AD
39832002-06-10 Akim Demaille <akim@epita.fr>
3984
3985 GCJ's parser requires the tokens to be defined before the prologue.
3986
3987 * data/bison.simple: Output the token definition before the user's
3988 prologue.
3989 * tests/regression.at (Braces parsing, Duplicate string)
3990 (Mixing %token styles): Check the output from bison.
3991 (Early token definitions): New.
3992
5e424082
AD
39932002-06-10 Akim Demaille <akim@epita.fr>
3994
3995 * src/symtab.c (symbol_user_token_number_set): Don't complain when
3996 assigning twice the same user number to a token, so that we can
3997 use it in...
3998 * src/lex.c (lex): here.
3999 Also use `symbol_class_set' instead of hand written code.
4000 * src/reader.c (parse_assoc_decl): Likewise.
4001
44536b35
AD
40022002-06-10 Akim Demaille <akim@epita.fr>
4003
4004 * src/symtab.c, src/symtab.c (symbol_class_set)
4005 (symbol_user_token_number_set): New.
4006 * src/reader.c (parse_token_decl): Use them.
4007 Use a switch instead of ifs.
4008 Use a single argument.
4009
8b9f2372
AD
40102002-06-10 Akim Demaille <akim@epita.fr>
4011
4012 Remove `%thong' support as it is undocumented, unused, duplicates
4013 `%token's job, and creates useless e-mail traffic with people who
4014 want to know what it is, why it is undocumented, unused, and
4015 duplicates `%token's job.
4016
4017 * src/reader.c (parse_thong_decl): Remove.
4018 * src/options.c (option_table): Remove "thong".
4019 * src/lex.h (tok_thong): Remove.
4020
3ae2b51f
AD
40212002-06-10 Akim Demaille <akim@epita.fr>
4022
4023 * src/symtab.c, src/symtab.c (symbol_type_set)
4024 (symbol_precedence_set): New.
4025 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
4026 (value_components_used): Remove, unused.
4027
2f1afb73
AD
40282002-06-09 Akim Demaille <akim@epita.fr>
4029
4030 Move symbols handling code out of the reader.
4031
4032 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
4033 (axiom): Move to...
4034 * src/symtab.h, src/symtab.c: here.
4035
4036 * src/gram.c (start_symbol): Remove: use startsymbol->number.
4037 * src/reader.c (startval): Rename as...
4038 * src/symtab.h, src/symtab.c (startsymbol): this.
4039 * src/reader.c: Adjust.
4040
4041 * src/reader.c (symbol_check_defined, symbol_make_alias)
4042 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
4043 (token_translations_init)
4044 Move to...
4045 * src/symtab.c: here.
4046 * src/reader.c (packsymbols): Move to...
4047 * src/symtab.h, src/symtab.c (symbols_pack): here.
4048 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
4049 argument.
4050
e9bca3ad
AD
40512002-06-03 Akim Demaille <akim@epita.fr>
4052
4053 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
4054 then statements.
4055
86eff183
AD
40562002-06-03 Akim Demaille <akim@epita.fr>
4057
4058 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
4059 structs with non literals.
4060 * src/scan-skel.l: never-interactive.
4061 * src/conflicts.c (enum conflict_resolution_e): No trailing
4062 comma.
4063 * src/getargs.c (usage): Split long literal strings.
4064 Reported by Hans Aberg.
4065
717be197
AD
40662002-05-28 Akim Demaille <akim@epita.fr>
4067
4068 * data/bison.c++: Use C++ ostreams.
4069 (cdebug_): New member.
4070
670ddffd
AD
40712002-05-28 Akim Demaille <akim@epita.fr>
4072
4073 * src/output.c (output_skeleton): Be sure to allocate enough room
4074 for `/' _and_ for `\0' in full_skeleton.
4075
769b430f
AD
40762002-05-28 Akim Demaille <akim@epita.fr>
4077
4078 * data/bison.c++: Catch up with bison.simple:
4079 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4080 and Paul Eggert <eggert@twinsun.com>: `error' handing.
4081 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
4082 and popping traces.
4083
7067cb36
PH
40842002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4085
4086 * src/output.c (output_skeleton): Put an explicit path in front of
4087 the skeleton file name, rather than relying on the -I directory,
4088 to partially alleviate effects of having a skeleton file lying around
4089 in the current directory.
769b430f 4090
4a713ec2
PH
40912002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4092
769b430f 4093 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
4094 obstack_printf should be obstack_fgrow1.
4095
b408954b
AD
40962002-05-26 Akim Demaille <akim@epita.fr>
4097
4098 * src/state.h (state_t): `solved_conflicts' is a new member.
4099 * src/LR0.c (new_state): Set it to 0.
4100 * src/conflicts.h, src/conflicts.c (print_conflicts)
4101 (free_conflicts, solve_conflicts): Rename as...
4102 (conflicts_print, conflicts_free, conflicts_solve): these.
4103 Adjust callers.
4104 * src/conflicts.c (enum conflict_resolution_e)
4105 (solved_conflicts_obstack): New, used by...
4106 (log_resolution): this.
4107 Adjust to attach the conflict resolution to each state.
4108 Complete the description with the precedence/associativity
4109 information.
4110 (resolve_sr_conflict): Adjust.
4111 * src/print.c (print_state): Output its solved_conflicts.
4112 * tests/conflicts.at (Unresolved SR Conflicts)
4113 (Solved SR Conflicts): Exercise --report=all.
4114
a49aecd5
AD
41152002-05-26 Akim Demaille <akim@epita.fr>
4116
4117 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
4118 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
4119 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
4120 (token_number_t, item_number_as_token_number)
4121 (token_number_as_item_number, muscle_insert_token_number_table):
4122 Rename as...
4123 (symbol_number_t, item_number_as_symbol_number)
4124 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
4125 these, since it is more appropriate.
4126
5504898e
AD
41272002-05-26 Akim Demaille <akim@epita.fr>
4128
4129 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
4130 `Error:' lines.
4131 * data/bison.simple (yystos) [YYDEBUG]: New.
4132 (yyparse) [YYDEBUG]: Display the symbols which are popped during
4133 error recovery.
4134 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
4135
ec3bc396
AD
41362002-05-25 Akim Demaille <akim@epita.fr>
4137
4138 * doc/bison.texinfo (Debugging): Split into...
4139 (Tracing): this new section, its former contents, and...
4140 (Understanding): this new section.
4141 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
4142 by...
4143 (report_flag): this.
4144 Adjust all dependencies.
4145 (report_args, report_types, report_argmatch): New.
4146 (usage, getargs): Report/support -r, --report.
4147 * src/options.h
4148 (struct option_table_struct): Rename as..,
4149 (struct option_table_s): this.
4150 Rename the `set_flag' member to `flag' to match with getopt_long's
4151 struct.
4152 * src/options.c (option_table): Split verbose into an entry for
4153 %verbose, and another for --verbose.
4154 Support --report/-r, so remove -r from the obsolete --raw.
4155 * src/print.c: Attach full item sets and lookaheads reports to
4156 report_flag instead of trace_flag.
4157 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
4158
78df8250
PE
41592002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4160 and Paul Eggert <eggert@twinsun.com>
769b430f 4161
78df8250
PE
4162 * data/bison.simple (yyparse): Correct error handling to conform to
4163 POSIX and yacc. Specifically, after syntax error is discovered,
4164 do not reduce further before shifting the error token.
4165 Clean up the code a bit by removing the labels yyerrdefault,
4166 yyerrhandle, yyerrpop.
4167 * NEWS: Document the above.
4168
c0c9ea05
PH
41692002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4170
4171 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
4172 type; it isn't always big enough, since it doesn't necessarily
4173 include non-terminals.
769b430f 4174 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
4175 the latter can be removed.
4176 (yy_token_number_type): Remove, only one use.
4177 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
4178 don't use TokenNumberType as element type.
769b430f 4179
c0c9ea05
PH
4180 * tests/regression.at: Modify expected output to agree with change
4181 to yyr1 and yytranslate.
769b430f 4182
6390a83f
FK
41832002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
4184
4185 * src/reader.c (parse_action): Use copy_character instead of
4186 obstack_1grow.
4187
db7c8e9a
AD
41882002-05-13 Akim Demaille <akim@epita.fr>
4189
4190 * tests/regression.at (Token definitions): Prototype yylex and
4191 yyerror.
4192
fcc61800
PH
41932002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
4194
158c687b 4195 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
4196 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
4197 32-bit arithmetic.
4198 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
4199
5683e9b2
AD
42002002-05-07 Akim Demaille <akim@epita.fr>
4201
4202 * tests/synclines.at: Be sure to prototype yylex and yyerror to
4203 avoid GCC warnings.
4204
0c2d3f4c
AD
42052002-05-07 Akim Demaille <akim@epita.fr>
4206
4207 Kill GCC warnings.
4208
4209 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
4210 over the RHS of each rule.
4211 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
4212 * src/state.h (state_t): Member `nitems' is unsigned short.
4213 * src/LR0.c (get_state): Adjust.
4214 * src/reader.c (packgram): Likewise.
4215 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
4216 `Type'.
4217 (muscle_insert_int_table): Remove, unused.
4218 (prepare_rules): Remove `max'.
4219
1565b720
AD
42202002-05-06 Akim Demaille <akim@epita.fr>
4221
4222 * src/closure.c (print_firsts): Display of the symbol tags.
4223 (bitmatrix_print): Move to...
4224 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
4225 here.
4226 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
4227
cfaee611
AD
42282002-05-06 Akim Demaille <akim@epita.fr>
4229
4230 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
4231 hash_do_for_each.
4232
458be8e0
AD
42332002-05-06 Akim Demaille <akim@epita.fr>
4234
4235 * src/LR0.c (new_state, get_state): Instead of using the global
4236 `kernel_size' and `kernel_base', have two new arguments:
4237 `core_size' and `core'.
4238 Adjust callers.
4239
a900a624
AD
42402002-05-06 Akim Demaille <akim@epita.fr>
4241
4242 * src/reader.c (packgram): No longer end `ritem' with a 0
4243 sentinel: it is not used.
4244
d4e7d3a1
AD
42452002-05-05 Akim Demaille <akim@epita.fr>
4246
4247 New experimental feature: display the lookaheads in the report and
4248 graph.
4249
4250 * src/print (print_core): When --trace-flag, display the rules
4251 lookaheads.
4252 * src/print_graph.c (print_core): Likewise.
4253 Swap the arguments.
4254 Adjust caller.
4255
39ceb25b
AD
42562002-05-05 Akim Demaille <akim@epita.fr>
4257
4258 * tests/torture.at (Many lookaheads): New test.
4259
5372019f
AD
42602002-05-05 Akim Demaille <akim@epita.fr>
4261
4262 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
4263 (GENERATE_MUSCLE_INSERT_TABLE): this.
4264 (output_int_table, output_unsigned_int_table, output_short_table)
4265 (output_token_number_table, output_item_number_table): Replace with...
4266 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
4267 (muscle_insert_short_table, muscle_insert_token_number_table)
4268 (muscle_insert_item_number_table): these.
4269 Adjust all callers.
4270 (prepare_tokens): Don't free `translations', since...
4271 * src/reader.h, src/reader.c (grammar_free): do it.
4272 Move to...
4273 * src/gram.h, src/gram.c (grammar_free): here.
4274 * data/bison.simple, data/bison.c++: b4_token_number_max is now
4275 b4_translate_max.
4276
5df5f6d5
AD
42772002-05-05 Akim Demaille <akim@epita.fr>
4278
4279 * src/output.c (output_unsigned_int_table): New.
4280 (prepare_rules): `i' is unsigned.
4281 `prhs', `rline', `r2' are unsigned int.
4282 Rename muscle `rhs_number_max' as `rhs_max'.
4283 Output muscles `prhs_max', `rline_max', and `r2_max'.
4284 Free rline and r1.
4285 * data/bison.simple, data/bison.c++: Adjust to use these muscles
4286 to compute types instead of constant types.
4287 * tests/regression.at (Web2c Actions): Adjust.
4288
b87f8b21
AD
42892002-05-04 Akim Demaille <akim@epita.fr>
4290
4291 * src/symtab.h (SALIAS, SUNDEF): Rename as...
4292 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
4293 Adjust dependencies.
4294 * src/output.c (token_definitions_output): Be sure not to output a
4295 `#define 'a'' when fed with `%token 'a' "a"'.
4296 * tests/regression.at (Token definitions): New.
4297
8bb936e4
PE
42982002-05-03 Paul Eggert <eggert@twinsun.com>
4299
4300 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
4301 for K&R C.
4302
43032002-05-03 gettextize <bug-gnu-gettext@gnu.org>
4304
4305 * Makefile.am (SUBDIRS): Remove intl.
4306 (EXTRA_DIST): Add config/config.rpath.
4307
53c71a12
AD
43082002-05-03 Akim Demaille <akim@epita.fr>
4309
4310 * data/bison.simple (m4_if): Don't output empty enums.
4311 And actually, output valid enum definitions :(.
4312
289dd0cf
AD
43132002-05-03 Akim Demaille <akim@epita.fr>
4314
4315 * configure.bat: Remove, completely obsolete.
4316 * Makefile.am (EXTRA_DIST): Adjust.
4317 Don't distribute config.rpath...
4318 * config/Makefile.am (EXTRA_DIST): Do it.
4319
db85e524
AD
43202002-05-03 Akim Demaille <akim@epita.fr>
4321
4322 * configure.in (GETTEXT_VERSION): New.
4323 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
4324
83ccf991
AD
43252002-05-03 Akim Demaille <akim@epita.fr>
4326
4327 * data/bison.simple (b4_token_enum): New.
4328 (b4_token_defines): Use it to output tokens both as #define and
4329 enums.
4330 Suggested by Paul Eggert.
4331 * src/output.c (token_definitions_output): Don't output spurious
4332 white spaces.
4333
1f418995
AD
43342002-05-03 Akim Demaille <akim@epita.fr>
4335
4336 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
4337
45119f04
RA
43382002-05-02 Robert Anisko <robert@lrde.epita.fr>
4339
4340 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
4341 Update the stack class, give a try to deque as the default container.
4342
b2d52318
AD
43432002-05-02 Akim Demaille <akim@epita.fr>
4344
4345 * data/bison.simple (yyparse): Do not implement @$ = @1.
4346 (YYLLOC_DEFAULT): Adjust to do it.
4347 * doc/bison.texinfo (Location Default Action): Fix.
4348
3a8b4109
AD
43492002-05-02 Akim Demaille <akim@epita.fr>
4350
4351 * src/reader.c (parse_braces): Merge into...
4352 (parse_action): this.
4353
84614e13
AD
43542002-05-02 Akim Demaille <akim@epita.fr>
4355
4356 * configure.in (ALL_LINGUAS): Remove.
4357 * po/LINGUAS, hr.po: New.
4358
fdbcd8e2
AD
43592002-05-02 Akim Demaille <akim@epita.fr>
4360
4361 Remove the so called hairy (semantic) parsers.
4362
4363 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
4364 * src/gram.h, src/gram.c (semantic_parser): Remove.
4365 (rule_t): Remove the guard and guard_line members.
4366 * src/lex.h (token_t): remove tok_guard.
4367 * src/options.c (option_table): Remove %guard and %semantic_parser
4368 support.
4369 * src/output.c, src/output.h (guards_output): Remove.
4370 (prepare): Adjust.
4371 (token_definitions_output): Don't output the `T'
4372 tokens (???).
4373 (output_skeleton): Don't output the guards.
4374 * src/files.c, src/files.c (attrsfile): Remove.
4375 * src/reader.c (symbol_list): Remove the guard and guard_line
4376 members.
4377 Adjust dependencies.
4378 (parse_guard): Remove.
4379 * data/bison.hairy: Remove.
4380 * doc/bison.texinfo (Environment Variables): Remove occurrences of
4381 BISON_HAIRY.
4382
82b6cb3f
AD
43832002-05-02 Akim Demaille <akim@epita.fr>
4384
4385 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
4386 (parse_guard): Rename the formal argument `stack_offset' as
4387 `rule_length', which is more readable.
4388 Adjust callers.
4389 (copy_at, copy_dollar): Instead of outputting the hard coded
4390 values of $$, $n and so forth, output invocation to b4_lhs_value,
4391 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
4392 Note: this patch partially drops `semantic-parser' support: it
4393 always does `rule_length - n', where semantic parsers ought to
4394 always use `-n'.
82b6cb3f
AD
4395 * data/bison.simple, data/bison.c++ (b4_lhs_value)
4396 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
4397
6cbfbcc5
AD
43982002-05-02 Akim Demaille <akim@epita.fr>
4399
4400 * configure.in (AC_INIT): Bump to 1.49b.
4401 (AM_INIT_AUTOMAKE): Short invocation.
4402
b8548114
AD
44032002-05-02 Akim Demaille <akim@epita.fr>
4404
4405 Version 1.49a.
4406
c20cd1fa
AD
44072002-05-01 Akim Demaille <akim@epita.fr>
4408
4409 * src/skeleton.h: Remove.
4410
8a9566d4
AD
44112002-05-01 Akim Demaille <akim@epita.fr>
4412
4413 * src/skeleton.h: Fix the #endif.
4414 Reported by Magnus Fromreide.
4415
8c6d399a
PE
44162002-04-26 Paul Eggert <eggert@twinsun.com>
4417
4418 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
4419 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 4420 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 4421
2b7ed18a
RA
44222002-04-25 Robert Anisko <robert@lrde.epita.fr>
4423
4424 * src/scan-skel.l: Postprocess quadrigraphs.
4425
4426 * src/reader.c (copy_character): New function, used to output
4427 single characters while replacing `[' and `]' with quadrigraphs, to
4428 avoid troubles with M4 quotes.
4429 (copy_comment): Output characters with copy_character.
4430 (read_additionnal_code): Likewise.
4431 (copy_string2): Likewise.
4432 (copy_definition): Likewise.
4433
4434 * tests/calc.at: Exercise M4 quoting.
4435
34a89c50
AD
44362002-04-25 Akim Demaille <akim@epita.fr>
4437
4438 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
4439 between `!' and the command.
4440 Reported by Paul Eggert.
4441
0dd1580a
RA
44422002-04-24 Robert Anisko <robert@lrde.epita.fr>
4443
4444 * tests/calc.at: Exercise prologue splitting.
4445
4446 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
4447 `b4_post_prologue' instead of `b4_prologue'.
4448
4449 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
4450 muscles.
4451 (output): Free pre_prologue_obstack and post_prologue_obstack.
4452 * src/files.h, src/files.c (attrs_obstack): Remove.
4453 (pre_prologue_obstack, post_prologue_obstack): New.
4454 * src/reader.c (copy_definition): Add a parameter to specify the
4455 obstack to fill, instead of using attrs_obstack unconditionally.
4456 (read_declarations): Pass pre_prologue_obstack to copy_definition if
4457 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
4458
83c1796f
PE
44592002-04-23 Paul Eggert <eggert@twinsun.com>
4460
4461 * data/bison.simple: Remove unnecessary commentary and white
4462 space differences from 1_29-branch.
4463 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
4464
4465 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
4466 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
4467 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
4468 constructors or destructors.
4469
4470 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
4471
1207eeac
AD
44722002-04-23 Akim Demaille <akim@epita.fr>
4473
4474 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
4475 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
4476 location with columns.
4477 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
4478 All reported by Paul Eggert.
4479
78ab8f67
AD
44802002-04-22 Akim Demaille <akim@epita.fr>
4481
4482 * src/reduce.c (dump_grammar): Move to...
4483 * src/gram.h, src/gram.c (grammar_dump): here.
4484 Be sure to separate long item numbers.
4485 Don't read the members of a rule's prec if its nil.
4486
133c20e2
AD
44872002-04-22 Akim Demaille <akim@epita.fr>
4488
4489 * src/output.c (table_size, table_grow): New.
4490 (MAXTABLE): Remove, replace uses with table_size.
4491 (pack_vector): Instead of dying when the table is too big, grow it.
4492
9515e8a7
AD
44932002-04-22 Akim Demaille <akim@epita.fr>
4494
4495 * data/bison.simple (yyr1): Its type is that of a token number.
4496 * data/bison.c++ (r1_): Likewise.
4497 * tests/regression.at (Web2c Actions): Adjust.
4498
23c5a174
AD
44992002-04-22 Akim Demaille <akim@epita.fr>
4500
4501 * src/reader.c (token_translations_init): 256 is now the default
4502 value for the error token, i.e., it will be assigned another
4503 number if the user assigned 256 to one of her tokens.
4504 (reader): Don't force 256 to error.
4505 * doc/bison.texinfo (Symbols): Adjust.
4506 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
4507 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
4508 etc. instead of 10, 20, 30 (which was used to `jump' over error
4509 (256) and undefined (2)).
4510
5fbb0954
AD
45112002-04-22 Akim Demaille <akim@epita.fr>
4512
4513 Propagate more token_number_t.
4514
4515 * src/gram.h (token_number_as_item_number)
4516 (item_number_as_token_number): New.
4517 * src/output.c (GENERATE_OUTPUT_TABLE): New.
4518 Use it to create output_item_number_table and
4519 output_token_number_table.
4520 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
4521 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
4522 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
4523 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
4524
4f940944
AD
45252002-04-22 Akim Demaille <akim@epita.fr>
4526
4527 * src/output.h, src/output.c (get_lines_number): Remove.
4528
3ded9a63
AD
45292002-04-19 Akim Demaille <akim@epita.fr>
4530
4531 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
4532 as Lex/Flex'.
4533 (Debugging): More details about enabling the debugging features.
4534 (Table of Symbols): Describe $$, $n, @$, and @n.
4535 Suggested by Tim Josling.
4536
e0c471a9
AD
45372002-04-19 Akim Demaille <akim@epita.fr>
4538
4539 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
4540
fecc10cd
AD
45412002-04-10 Akim Demaille <akim@epita.fr>
4542
4543 * src/system.h: Rely on HAVE_LIMITS_H.
4544 Suggested by Paul Eggert.
4545
51dec47b
AD
45462002-04-09 Akim Demaille <akim@epita.fr>
4547
4548 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
4549 full stderr, and strip it according to the bison options, instead
4550 of composing the error message from different bits.
4551 This makes it easier to check for several error messages.
4552 Adjust all the invocations.
4553 Add an invocation exercising the error token.
4554 Add an invocation demonstrating a stupid error message.
4555 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
4556 Adjust the tests.
4557 Error message are for stderr, not stdout.
4558
007a50a4
AD
45592002-04-09 Akim Demaille <akim@epita.fr>
4560
4561 * src/gram.h, src/gram.c (error_token_number): Remove, use
4562 errtoken->number.
4563 * src/reader.c (reader): Don't specify the user token number (2)
4564 for $undefined, as it uselessly prevents using it.
4565 * src/gram.h (token_number_t): Move to...
4566 * src/symtab.h: here.
4567 (state_t.number): Is a token_number_t.
4568 * src/print.c, src/reader.c: Use undeftoken->number instead of
4569 hard coded 2.
4570 (Even though this 2 is not the same as above: the number of the
4571 undeftoken remains being 2, it is its user token number which
4572 might not be 2).
4573 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
4574 `user_token_number_max'.
4575 Output `undef_token_number'.
4576 * data/bison.simple, data/bison.c++: Use them.
4577 Be sure to map invalid yylex return values to
4578 `undef_token_number'. This saves us from gratuitous SEGV.
4579
4580 * tests/conflicts.at (Solved SR Conflicts)
4581 (Unresolved SR Conflicts): Adjust.
4582 * tests/regression.at (Web2c Actions): Adjust.
4583
06446ccf
AD
45842002-04-08 Akim Demaille <akim@epita.fr>
4585
4586 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
4587 Adding #line.
4588 Remove the duplicate `typedefs'.
4589 (RhsNumberType): Fix the declaration and various other typos.
4590 Use __ofile__.
4591 * data/bison.simple: Use __ofile__.
4592 * src/scan-skel.l: Handle __ofile__.
4593
62a3e4f0
AD
45942002-04-08 Akim Demaille <akim@epita.fr>
4595
4596 * src/gram.h (item_number_t): New, the type of item numbers in
4597 RITEM. Note that it must be able to code symbol numbers as
4598 positive number, and the negation of rule numbers as negative
4599 numbers.
4600 Adjust all dependencies (pretty many).
4601 * src/reduce.c (rule): Remove this `short *' pointer: use
4602 item_number_t.
4603 * src/system.h (MINSHORT, MAXSHORT): Remove.
4604 Include `limits.h'.
4605 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
4606 (shortcpy): Remove.
4607 (MAXTABLE): Move to...
4608 * src/output.c (MAXTABLE): here.
4609 (prepare_rules): Use output_int_table to output rhs.
4610 * data/bison.simple, data/bison.c++: Adjust.
4611 * tests/torture.at (Big triangle): Move the limit from 254 to
4612 500.
4613 * tests/regression.at (Web2c Actions): Ajust.
4614
4615 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
4616 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
4617 passes, but produces negative #line number, once fixed, GCC is
4618 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
4619 C), it passes.
4620 * src/state.h (state_h): Code input lines on ints, not shorts.
4621
bb88b0fc
AD
46222002-04-08 Akim Demaille <akim@epita.fr>
4623
4624 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
4625 and then the grammar.
4626
9a636f47
AD
46272002-04-08 Akim Demaille <akim@epita.fr>
4628
4629 * src/system.h: No longer using strndup.
4630
680e8701
AD
46312002-04-07 Akim Demaille <akim@epita.fr>
4632
4633 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
4634 * src/output.c (output_table_data): Return the longest number.
4635 (prepare_tokens): Output `token_number_max').
4636 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
4637 New.
4638 Use them to define yy_token_number_type/TokenNumberType.
4639 Use this type for yytranslate.
4640 * tests/torture.at (Big triangle): Push the limit from 124 to
4641 253.
4642 * tests/regression.at (Web2c Actions): Adjust.
4643
817e9f41
AD
46442002-04-07 Akim Demaille <akim@epita.fr>
4645
4646 * tests/torture.at (Big triangle): New.
4647 (GNU AWK Grammar, GNU Cim Grammar): Move to...
4648 * tests/existing.at: here.
4649
5123689b
AD
46502002-04-07 Akim Demaille <akim@epita.fr>
4651
4652 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
4653 nritems.
4654 Adjust dependencies.
4655
f3849179
AD
46562002-04-07 Akim Demaille <akim@epita.fr>
4657
4658 * src/reader.c: Normalize increments to prefix form.
4659
bd02036a
AD
46602002-04-07 Akim Demaille <akim@epita.fr>
4661
4662 * src/reader.c, symtab.c: Remove debugging code.
4663
db8837cb
AD
46642002-04-07 Akim Demaille <akim@epita.fr>
4665
4666 Rename all the `bucket's as `symbol_t'.
4667
4668 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
4669 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
4670 * src/symtab.c, src/symtab.h (bucket): Rename as...
4671 (symbol_t): this.
4672 (symbol_list_new, bucket_check_defined, bucket_make_alias)
4673 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
4674 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
4675 (buckets_new, buckets_free, buckets_do): Rename as...
4676 (symbol_list_new, symbol_check_defined, symbol_make_alias)
4677 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
4678 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
4679 (symbols_new, symbols_free, symbols_do): these.
4680
72a23c97
AD
46812002-04-07 Akim Demaille <akim@epita.fr>
4682
4683 Use lib/hash for the symbol table.
4684
4685 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
4686 EOF.
4687 * src/lex.c (lex): Set the `number' member of new terminals.
4688 * src/reader.c (bucket_check_defined, bucket_make_alias)
4689 (bucket_check_alias_consistence, bucket_translation): New.
4690 (reader, grammar_free, readgram, token_translations_init)
4691 (packsymbols): Adjust.
4692 (reader): Number the predefined tokens.
4693 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
4694 for predefined tokens.
4695 * src/symtab.h (bucket): Remove all the hash table related
4696 members.
4697 * src/symtab.c (symtab): Replace by...
4698 (bucket_table): this.
4699 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
4700 (buckets_new, buckets_do): New.
4701
280a38c3
AD
47022002-04-07 Akim Demaille <akim@epita.fr>
4703
4704 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
4705 (start_symbol, max_user_token_number, semantic_parser)
4706 (error_token_number): Initialize.
4707 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
4708 Initialize.
4709 (reader): Don't.
4710 (errtoken, eoftoken, undeftoken, axiom): Extern.
4711
03b31c0c
AD
47122002-04-07 Akim Demaille <akim@epita.fr>
4713
4714 * src/gram.h (rule_s): prec and precsym are now pointers
4715 to the bucket giving the priority/associativity.
4716 Member `associativity' removed: useless.
4717 * src/reduce.c, src/conflicts.c: Adjust.
4718
8b3df748
AD
47192002-04-07 Akim Demaille <akim@epita.fr>
4720
4721 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
4722 Properly escape the symbols' TAG when outputting them.
4723
e601aa1d
AD
47242002-04-07 Akim Demaille <akim@epita.fr>
4725
4726 * src/lalr.h (LA): Is a bitsetv, not bitset*.
4727
b0299a2e
AD
47282002-04-07 Akim Demaille <akim@epita.fr>
4729
4730 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
4731 (LArule): this, which is an array to rule_t*.
4732 * src/print.c, src/conflicts.c: Adjust.
4733
d7e1f00c
AD
47342002-04-07 Akim Demaille <akim@epita.fr>
4735
4736 * src/gram.h (rule_t): Rename `number' as `user_number'.
4737 `number' is a new member.
4738 Adjust dependencies.
4739 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
4740
cc9305dd
AD
47412002-04-07 Akim Demaille <akim@epita.fr>
4742
4743 As a result of the previous patch, it is no longer needed
4744 to reorder ritem itself.
4745
4746 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
4747
b0940840
AD
47482002-04-07 Akim Demaille <akim@epita.fr>
4749
4750 Be sure never to walk through RITEMS, but use only data related to
4751 the rules themselves. RITEMS should be banished.
4752
4753 * src/output.c (output_token_translations): Rename as...
4754 (prepare_tokens): this.
4755 In addition to `translate', prepare the muscles `tname' and
4756 `toknum', which were handled by...
4757 (output_rule_data): this.
4758 Remove, and move the remainder of its outputs into...
4759 (prepare_rules): this new routines, which also merges content from
4760 (output_gram): this.
4761 (prepare_rules): Be sure never to walk through RITEMS.
4762 (output_stos): Rename as...
4763 (prepare_stos): this.
4764 (output): Always invoke prepare_states, after all, just don't use it
4765 in the output if you don't need it.
4766
643a5994
AD
47672002-04-07 Akim Demaille <akim@epita.fr>
4768
4769 * src/LR0.c (new_state): Display `nstates' as the name of the
4770 newly created state.
4771 Adjust to initialize first_state and last_state if needed.
4772 Be sure to distinguish the initial from the final state.
4773 (new_states): Create the itemset of the initial state, and use
4774 new_state.
4775 * src/closure.c (closure): Now that the initial state has its
4776 items properly set, there is no need for a special case when
4777 creating `ruleset'.
4778
4779 As a result, now the rule 0, reducing to $axiom, is visible in the
4780 outputs. Adjust the test suite.
4781
4782 * tests/conflicts.at (Solved SR Conflicts)
4783 (Unresolved SR Conflicts): Adjust.
4784 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
4785 * tests/conflicts.at (S/R in initial): New.
4786
b4c4ccc2
AD
47872002-04-07 Akim Demaille <akim@epita.fr>
4788
4789 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
4790 the RHS of the rules.
4791 * src/output.c (output_gram): Likewise.
4792
bba97eb2
AD
47932002-04-07 Akim Demaille <akim@epita.fr>
4794
4795 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
4796 bucket.
4797 Adjust all dependencies.
4798 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
4799 `number' of the buckets too.
4800 * src/gram.h: Include `symtab.h'.
4801 (associativity): Move to...
4802 * src/symtab.h: here.
4803 No longer include `gram.h'.
4804
c3b407f4
AD
48052002-04-07 Akim Demaille <akim@epita.fr>
4806
4807 * src/gram.h, src/gram.c (rules_rhs_length): New.
4808 (ritem_longest_rhs): Use it.
4809 * src/gram.h (rule_t): `number' is a new member.
4810 * src/reader.c (packgram): Set it.
4811 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
4812 the end of `rules', and count them out of `nrules'.
4813 (reduce_output, dump_grammar): Adjust.
4814 * src/print.c (print_grammar): It is no longer needed to check for
4815 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
4816 * tests/reduce.at (Reduced Automaton): New test.
4817
11652ab3
AD
48182002-04-07 Akim Demaille <akim@epita.fr>
4819
4820 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
4821 lacking `+ 1' to nrules, Bison reported as useless a token if it
4822 was used solely to set the precedence of the last rule...
4823
26b23c1a
AD
48242002-04-07 Akim Demaille <akim@epita.fr>
4825
4826 * data/bison.c++, data/bison.simple: Don't output the current file
4827 name in #line, to avoid useless diffs between two identical
4828 outputs under different names.
4829
18bcecb0
AD
48302002-04-07 Akim Demaille <akim@epita.fr>
4831
4832 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
4833 Normalize loops to using `< nrules + 1', not `<= nrules'.
4834
fa770c86
AD
48352002-04-07 Akim Demaille <akim@epita.fr>
4836
4837 * TODO: Update.
4838
d9b739c3
AD
48392002-04-07 Akim Demaille <akim@epita.fr>
4840
4841 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
4842 bucket.value as bucket.number.
4843
99013900
AD
48442002-04-07 Akim Demaille <akim@epita.fr>
4845
4846 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
4847 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
4848 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
4849 RHS, instead of being an index in RITEMS.
4850
e966383b
PE
48512002-04-04 Paul Eggert <eggert@twinsun.com>
4852
4853 * doc/bison.texinfo: Update copyright date.
4854 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
4855 (Symbols): Warn about running Bison in one character set,
4856 but compiling and/or running in an incompatible one.
4857 Warn about character code 256, too.
4858
48592002-04-03 Paul Eggert <eggert@twinsun.com>
4860
4861 * src/bison.data (YYSTACK_ALLOC): Depend on whether
4862 YYERROR_VERBOSE is nonzero, not whether it is defined.
4863
4864 Merge changes from bison-1_29-branch.
c307773e 4865
8d6c48b9
PE
48662002-03-20 Paul Eggert <eggert@twinsun.com>
4867
4868 Merge fixes from Debian bison_1.34-1.diff.
4869
4870 * configure.in (AC_PREREQ): 2.53.
4871
e53c6322
AD
48722002-03-20 Akim Demaille <akim@epita.fr>
4873
4874 * src/conflicts.c (log_resolution): Argument `resolution' is const.
4875
9ffbeca7
PE
48762002-03-19 Paul Eggert <eggert@twinsun.com>
4877
21db0b2a
PE
4878 * src/bison.simple (YYCOPY): New macro.
4879 (YYSTACK_RELOCATE): Use it.
4880 Remove Type arg; no longer needed. All callers changed.
4881 (yymemcpy): Remove; no longer needed.
4882
9ffbeca7
PE
4883 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
4884 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
4885
642cb8f8
AD
48862002-03-19 Akim Demaille <akim@epita.fr>
4887
4888 Test and fix the #line outputs.
4889
4890 * tests/atlocal.at (GCC): New.
4891 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
4892 (Prologue synch line, ,%union synch line, Postprologue synch line)
4893 (Action synch line, Epilogue synch line): New tests.
4894 * src/reader.c (parse_union_decl): Define the muscle stype_line.
4895 * data/bison.simple, data/bison.c++: Use it.
4896
3c31a486
AD
48972002-03-19 Akim Demaille <akim@epita.fr>
4898
4899 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
4900 (Solved SR Conflicts, %expect not enough, %expect right)
4901 (%expect too much): Move to...
4902 * tests/conflicts.at: this new file.
4903
0d8bed56
AD
49042002-03-19 Akim Demaille <akim@epita.fr>
4905
4906 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
4907 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
4908 that we can move to enums for instance.
4909 * src/output.c (token_definitions_output): Output a list of
4910 `token-name, token-number' instead of the #define.
4911 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
4912
9208d17f
AD
49132002-03-14 Akim Demaille <akim@epita.fr>
4914
4915 Use Gettext 0.11.1.
4916
af27eacb
RA
49172002-03-09 Robert Anisko <robert@lrde.epita.fr>
4918
4919 * data/bison.c++: Make the user able to add members to the generated
4920 parser by subclassing.
4921
9101a310
RA
49222002-03-05 Robert Anisko <robert@lrde.epita.fr>
4923
4924 * src/reader.c (read_additionnal_code): `c' should be an integer, not
4925 a character.
4926 Reported by Nicolas Tisserand and Nicolas Burrus.
4927
fff9bf0b
RA
49282002-03-04 Robert Anisko <robert@lrde.epita.fr>
4929
4930 * src/reader.c: Warn about lacking semi-colons, do not complain.
4931
64dba31e
RA
49322002-03-04 Robert Anisko <robert@lrde.epita.fr>
4933
4934 * data/bison.c++: Remove a debug line.
4935
374f5a14
RA
49362002-03-04 Robert Anisko <robert@lrde.epita.fr>
4937
4938 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
4939 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
4940 provide a default implementation.
4941
bfcf1f3a
AD
49422002-03-04 Akim Demaille <akim@epita.fr>
4943
4944 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
4945 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
4946 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
4947 * tests/semantic.at (Parsing Guards): Similarly.
4948 * src/reader.at (readgram): Complain if the last rule is not ended
4949 with a semi-colon.
4950
65ccf9fc
AD
49512002-03-04 Akim Demaille <akim@epita.fr>
4952
4953 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
4954 * src/closure.c: here.
4955 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
4956 RTC.
4957 * src/warshall.h, src/warshall.c: Remove.
4958 * tests/sets.at (Broken Closure): Adjust.
4959
d0039cbc
AD
49602002-03-04 Akim Demaille <akim@epita.fr>
4961
4962 * src/output.c (output_skeleton): tempdir is const.
4963 bytes_read is unused.
4964
345cea78
AD
49652002-03-04 Akim Demaille <akim@epita.fr>
4966
4967 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
4968 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
4969 Update.
4970 From Michael Hayes.
4971
564801f7
AD
49722002-03-04 Akim Demaille <akim@epita.fr>
4973
4974 * src/closure.c (closure): `r' is unused.
4975
e5352bc7
AD
49762002-03-04 Akim Demaille <akim@epita.fr>
4977
4978 * tests/sets.at (Broken Closure): Add the ending `;'.
4979 * src/reader.at (readgram): Complain if a rule is not ended with a
4980 semi-colon.
4981
914feea9
AD
49822002-03-04 Akim Demaille <akim@epita.fr>
4983
4984 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
4985 (count_sr_conflicts): Use bitset_count.
4986 * src/reduce.c (inaccessable_symbols): Ditto.
4987 (bits_size): Remove.
4988 * src/warshall.h, src/warshall.c: Convert to bitsetv.
4989
f0250de6
AD
49902002-03-04 Akim Demaille <akim@epita.fr>
4991
4992 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
4993 * src/reduce.c: Remove the `bitset_zero's following the
4994 `bitset_create's, as now it is performed by the latter.
4995
ef017502
AD
49962002-03-04 Akim Demaille <akim@epita.fr>
4997
4998 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
4999 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
5000 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
5001 latest sources from Michael.
5002
76514394
AD
50032002-03-04 Akim Demaille <akim@epita.fr>
5004
5005 * src/output.c (output): Don't free the grammar.
5006 * src/reader.c (grammar_free): New.
5007 * src/main.c (main): Call it and don't free symtab here.
5008
55024580
AD
50092002-03-04 Akim Demaille <akim@epita.fr>
5010
5011 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
5012 before returning.
5013 Reported by Benoit Perrot.
5014
f9abaa2c
AD
50152002-03-04 Akim Demaille <akim@epita.fr>
5016
5017 Use bitset operations when possible, not loops over bits.
5018
5019 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
5020 bitset_or.
5021 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
5022 * src/reduce.c (useless_nonterminals): Formatting changes.
5023 * src/warshall.c (TC): Use bitset_or.
5024
0e721e75
AD
50252002-03-04 Akim Demaille <akim@epita.fr>
5026
5027 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
5028 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
5029 Ditto.
5030
0fb1ffb1
AD
50312002-03-04 Akim Demaille <akim@epita.fr>
5032
5033 * src/lalr.c (F): Now a bitset*.
5034 Adjust all dependencies.
5035
b86796bf
AD
50362002-03-04 Akim Demaille <akim@epita.fr>
5037
5038 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
5039 Adjust all dependencies.
5040
602bbf31
AD
50412002-03-04 Akim Demaille <akim@epita.fr>
5042
5043 * src/L0.c, src/LR0.h (nstates): Be size_t.
5044 Adjust comparisons (signed vs unsigned).
5045 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
5046 bitset*.
5047 Adjust all dependencies.
5048
d8a0245c
AD
50492002-03-04 Akim Demaille <akim@epita.fr>
5050
5051 * src/closure.c (firsts): Now, also a bitset.
5052 Adjust all dependencies.
5053 (varsetsize): Remove, now unused.
5054 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
5055
34ba9743
AD
50562002-03-04 Akim Demaille <akim@epita.fr>
5057
5058 * src/print.c: Convert to use bitset.h, not hand coded iterations
5059 over ints.
5060
ed86e78c
AD
50612002-03-04 Akim Demaille <akim@epita.fr>
5062
5063 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
5064
dfdb1797
AD
50652002-03-04 Akim Demaille <akim@epita.fr>
5066
5067 * src/closure.c (ruleset): Be a bitset.
5068 (rulesetsize): Remove.
5069
7086e707
AD
50702002-03-04 Akim Demaille <akim@epita.fr>
5071
5072 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
5073 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
5074 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
5075 * src/closure.c (fderives): Be an array of bitsets.
5076
98254360
RA
50772002-02-28 Robert Anisko <robert@lrde.epita.fr>
5078
5079 * data/bison.c++: Merge the two generated headers. Insert a copyright
5080 notice in each output file.
5081
a75c057f
AD
50822002-02-28 Akim Demaille <akim@epita.fr>
5083
5084 * data/bison.c++: Copy the prologue of bison.simple to fetch
5085 useful M4 definitions, such as b4_header_guard.
5086
06b00abc
AD
50872002-02-25 Akim Demaille <akim@epita.fr>
5088
5089 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
5090 translator friendly scheme for the bgr
5091 copyright notice.
06b00abc 5092
70e7d534
AD
50932002-02-25 Akim Demaille <akim@epita.fr>
5094
5095 * src/output.c (header_output): Remove, now handled completely via
5096 M4.
5097
abe017f6
AD
50982002-02-25 Akim Demaille <akim@epita.fr>
5099
5100 * m4/m4.m4: New, from CVS Autoconf.
5101 * configure.in: Invoke it.
5102 * src/output.c (output_skeleton): Use its result instead of the
5103 hard coded name.
5104
381fb12e
AD
51052002-02-25 Akim Demaille <akim@epita.fr>
5106
5107 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
5108 Fileutils 4.1.5.
5109 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
5110 * src/output.c (output_skeleton): Use mkstemp to create a real
5111 temporary file.
5112 Move the filling of `skeleton' and its muscle to...
5113 (prepare): here.
5114 (output): Move the definition of the prologue muscle to...
5115 (prepare): here.
5116 * src/system.h (DEFAULT_TMPDIR): New.
5117
6f38107f
PE
51182002-02-14 Paul Eggert <eggert@twinsun.com>
5119
5120 Remove the support for C++ namespace cleanliness; it was
5121 causing more problems than it was curing, since it didn't work
5122 properly on some nonstandard C++ compilers. This can wait
5123 for a proper C++ parser.
5124
5125 * NEWS: Document this.
5126 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
5127 of C++, as it's treated like C now.
5128 * src/bison.simple (YYSTD): Remove.
5129 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
5130 Treat C++ just like Standard C instead of trying to support
5131 namespace cleanliness.
5132
80cce3da
AD
51332002-02-14 Akim Demaille <akim@epita.fr>
5134
5135 * tests/regression.at (else): Adjust to Andreas' change.
5136
842e8679
AD
51372002-02-14 Akim Demaille <akim@epita.fr>
5138
5139 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
5140
4bda3f10
AD
51412002-02-13 Andreas Schwab <schwab@suse.de>
5142
5143 * src/output.c (output_rule_data): Don't output NULL, it might
5144 not be defined yet.
5145
4162fa07 51462002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 5147
4162fa07
RA
5148 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
5149 (Copyright notice): Update.
b418ecd8 5150
bd16a5dc
AD
51512002-02-11 Akim Demaille <akim@epita.fr>
5152
5153 * tests/regression.at (%nonassoc and eof): Don't include
5154 nonportable headers.
5155
8d69a1a3
RA
51562002-02-08 Robert Anisko <robert@lrde.epita.fr>
5157
5158 * data/bison.c++: Correct error recovery. Make the user able to
5159 initialize the starting location.
5160
9b2d0677
AD
51612002-02-07 Akim Demaille <akim@epita.fr>
5162
5163 * tests/input.at: New.
5164
69e2658b
RA
51652002-02-07 Robert Anisko <robert@lrde.epita.fr>
5166
5167 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 5168 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
5169 directives around tables only needed for debugging.
5170
4aacc3a7
RA
51712002-02-07 Robert Anisko <robert@lrde.epita.fr>
5172
5173 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
5174 C++ parsers.
5175 (yy::b4_name::parse): Use print_.
5176
762a801e
RA
51772002-02-07 Robert Anisko <robert@lrde.epita.fr>
5178
5179 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
5180
4bb2bc3f
RA
51812002-02-07 Robert Anisko <robert@lrde.epita.fr>
5182
5183 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
5184 C++ parsers.
5185 (yy::b4_name::parse): Build verbose error messages, and use error_.
5186
6b45a3ca
RA
51872002-02-06 Robert Anisko <robert@lrde.epita.fr>
5188
5189 * data/bison.c++: Fix m4 quoting in comments.
5190
50997c6e
RA
51912002-02-06 Robert Anisko <robert@lrde.epita.fr>
5192
5193 * data/bison.c++: Adjust the parser code. Fix some muscles that were
5194 not expanded by m4.
5195
3f3eed27
AD
51962002-02-05 Akim Demaille <akim@epita.fr>
5197
5198 * data/bison.c++: Adjust to the M4 back end.
5199 More is certainly needed.
5200
be2a1a68
AD
52012002-02-05 Akim Demaille <akim@epita.fr>
5202
5203 Give a try to M4 as a back end.
5204
5205 * lib/readpipe.c: New, from wdiff.
5206 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
5207 BISON_HAIRY.
5208 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
5209 specific values. Now it is m4 that performs the lookup.
5210 * src/parse-skel.y: Remove.
5211 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
5212 * src/output.c (actions_output, guards_output)
5213 (token_definitions_output): No longer keeps track of the output
5214 line number, hence remove the second argument.
5215 (guards_output): Check against the guard member of a rule, not the
5216 action member.
5217 Adjust callers.
5218 (output_skeleton): Don't look for the skeleton location, let m4 do
5219 that.
5220 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
5221 file will be used.
5222 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
5223 (prepare): Given that for the time being changesyntax is not
5224 usable in M4, rename the muscles using `-' to `_'.
5225 Define `defines_flag', `output_parser_name' and `output_header_name'.
5226 * src/output.h (actions_output, guards_output)
5227 (token_definitions_output): Adjust prototypes.
5228 * src/scan-skel.l: Instead of scanning the skeletons, it now
5229 processes the output of m4: `__oline__' and `#output'.
5230 * data/bison.simple: Adjust to be used by M4(sugar).
5231 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
5232 to date.
5233 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
5234 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
5235 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
5236 shamelessly stolen from CVS Autoconf.
5237
beda758b
AD
52382002-02-05 Akim Demaille <akim@epita.fr>
5239
5240 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
5241 * configure.in: Check for the declarations of free and malloc.
5242 * src/muscle_tab.c: Adjust.
5243
5ece6d43
AD
52442002-02-05 Akim Demaille <akim@epita.fr>
5245
5246 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
5247 which have no values.
5248
5bb18f9a
AD
52492002-02-05 Akim Demaille <akim@epita.fr>
5250
5251 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
5252 * data/: here.
5253
894dd62e
PE
52542002-01-29 Paul Eggert <eggert@twinsun.com>
5255
5256 * src/bison.simple (YYSIZE_T): Do not define merely because
5257 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
5258 On some platforms, <alloca.h> does not declare YYSTD (size_t).
5259
82841af7
AD
52602002-01-27 Akim Demaille <akim@epita.fr>
5261
5262 Fix `%nonassoc and eof'.
5263
5264 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
5265 which were not properly copied! Replace
5266 memcpy (res->errs, src->errs, src->nerrs);
5267 with
5268 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
5269 !!!
5270 * tests/regression.at (%nonassoc and eof): Adjust to newest
5271 Autotest: `.' is not in the PATH.
5272
318b76e9
AD
52732002-01-27 Akim Demaille <akim@epita.fr>
5274
5275 * tests/sets.at (AT_EXTRACT_SETS): New.
5276 (Nullable): Use it.
5277 (Firsts): New.
5278
30d2f3d5
AD
52792002-01-26 Akim Demaille <akim@epita.fr>
5280
5281 * tests/actions.at, tests/calc.at, tests/headers.at,
5282 * tests/torture.at: Adjust to the newest Autotest which no longer
5283 forces `.' in the PATH.
5284
30f8c395
AD
52852002-01-25 Akim Demaille <akim@epita.fr>
5286
5287 * tests/regression.at (%nonassoc and eof): New.
5288 Suggested by Robert Anisko.
5289
29ae55f1
AD
52902002-01-24 Akim Demaille <akim@epita.fr>
5291
5292 Bison dumps core when trying to complain about broken input files.
5293 Reported by Cris van Pelt.
5294
5295 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
5296 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
5297 into...
5298 (Invalid inputs): Strengthen: exercise parse_percent_token.
5299
2b548aa6
RA
53002002-01-24 Robert Anisko <robert.anisko@epita.fr>
5301
5302 * src/Makefile.am: Add bison.c++.
5303 * src/bison.c++: New skeleton.
5304
bb0146c2
AD
53052002-01-21 Paolo Bonzini <bonzini@gnu.org>
5306
5307 * po/it.po: New.
5308
bec30531
AD
53092002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
5310
5311 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
5312
fc6edc45
MA
53132002-01-20 Marc Autret <marc@gnu.org>
5314
5315 * src/files.c (compute_output_file_names): Fix
5316
5e5d5415
MA
53172002-01-20 Marc Autret <marc@gnu.org>
5318
5319 * tests/output.at: New test.
5320 * src/files.c (compute_base_names): Don't map extensions when
5321 the YACC flag is set, use defaults.
5322 Reported by Evgeny Stambulchik.
5323
44ea3fbd
MA
53242002-01-20 Marc Autret <marc@gnu.org>
5325
bb0146c2 5326 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
5327 compilers as well (i.e. the vendor C compiler).
5328 Suggested by Albert Chin-A-Young.
5329
338963d1
TVH
53302002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
5331
5332 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
5333 canonical definition.
5334 * src/system.h: Use the canonical definition for PARAMS (avoids
5335 a conflict with the macro from lib/hash.h).
5336
c57b2479
AD
53372002-01-11 Akim Demaille <akim@epita.fr>
5338
5339 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 5340 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 5341
b85810ae
AD
53422002-01-09 Akim Demaille <akim@epita.fr>
5343
5344 * src/files.c, src/files.h (output_infix): New.
5345 (tab_extension): Remove.
5346 (compute_base_names): Compute the former, drop the latter.
5347 * src/output.c (prepare): Insert the muscles `output-infix', and
5348 `output-suffix'.
5349 * src/parse-skel.y (string, string.1): New.
5350 (section.header): Use it.
5351 (section.yacc): Remove.
5352 (prefix): Remove too.
5353 * src/scan-skel.l: Adjust.
5354 * src/bison.simple, src/bison.hairy: Adjust.
5355
cae60122
AD
53562002-01-09 Akim Demaille <akim@epita.fr>
5357
5358 * configure.in (WERROR_CFLAGS): Compute it.
5359 * src/Makefile.am (CFLAGS): Pass it.
5360 * tests/atlocal.in (CFLAGS): Idem.
5361 * src/files.c: Fix a few warnings.
5362 (get_extension_index): Remove, unused.
5363
ae404801
AD
53642002-01-08 Akim Demaille <akim@epita.fr>
5365
5366 * src/getargs.c (AS_FILE_NAME): New.
5367 (getargs): Use it to convert DOSish file names.
5368 * src/files.c (base_name): Rename as full_base_name to avoid
5369 clashes with `base_name ()'.
5370 (filename_split): New.
5371 (compute_base_names): N-th rewrite, using filename_split.
5372
22312b71
AD
53732002-01-08 Akim Demaille <akim@epita.fr>
5374
5375 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
5376 New, stolen from the Fileutils 4.1.
5377 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
5378 * configure.in: Check for the presence of memrchr, and of its
5379 prototype.
5380
a67cef01
TVH
53812002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
5382
5383 * lib/hash.h (__P): Added definition for this macro.
5384 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
5385 BUILT_SOURCES, to ensure they are generated first.
5386 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
5387 %error-verbose to allow bootstrapping with bison 1.30x.
5388
2b25d624
AD
53892002-01-06 Akim Demaille <akim@epita.fr>
5390
5391 * src/reader.c (parse_braces): Don't fetch the next char, the
5392 convention is to fetch on entry.
5393 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
5394 'switch' without a following semicolon.
5395 * tests/regression.at (braces parsing): New.
5396
3460813b
AD
53972002-01-06 Akim Demaille <akim@epita.fr>
5398
5399 Bison is dead wrong in its RR conflict reports.
5400
5401 * tests/torture.at (GNU Cim Grammar): New.
5402 * src/conflicts.c (count_rr_conflicts): Fix.
5403
73784c64
AD
54042002-01-06 Akim Demaille <akim@epita.fr>
5405
5406 Creating package.m4 from configure.ac causes too many problems.
5407
5408 * tests/Makefile.am (package.m4): Create it by hand,
5409 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
5410
25d81090
AD
54112002-01-06 Akim Demaille <akim@epita.fr>
5412
5413 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
5414 skeleton.h.
5415
a9b8959e
PE
54162002-01-04 Paul Eggert <eggert@twinsun.com>
5417
5418 * doc/bison.texinfo (Debugging):
5419 Remove YYSTDERR; it's no longer defined or used.
5420 Also, s/cstdio.h/cstdio/.
5421
25d81090
AD
54222002-01-03 Akim Demaille <akim@epita.fr>
5423
5424 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
5425
1109455c
AD
54262002-01-03 Akim Demaille <akim@epita.fr>
5427
5428 * src/parse-skel.y (process_skeleton): Don't bind the parser's
5429 tracing code to --trace, wait for a better --trace option, with
5430 args.
5431
7ea5e977
AD
54322002-01-03 Akim Demaille <akim@epita.fr>
5433
5434 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
5435 The ISO C++ standard is extremely clear about it: stderr is
5436 considered a macro, not a regular symbol (see table 94 `Header
5437 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
5438 Therefore std:: does not apply to it. It still does with fprintf.
5439 Also, s/cstdio.h/cstdio/.
5440
fab5b110
AD
54412002-01-03 Akim Demaille <akim@epita.fr>
5442
5443 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
5444 for non system headers.
5445
aed7fd9b
AD
54462002-01-02 Akim Demaille <akim@epita.fr>
5447
5448 Equip the skeleton chain with location tracking, runtime trace,
5449 pure parser and scanner.
5450
5451 * src/parse-skel.y: Request a pure parser, locations, and prefix
5452 renaming.
5453 (%union): Having several members with the same type does not help
5454 type mismatches, simplify.
5455 (YYPRINT, yyprint): New.
5456 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
5457 (skel_error): this.
5458 Handle locations.
5459 * src/scan-skel.l: Adjust to these changes.
5460 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
5461 (LOCATION_PRINT, skel_control_t): New.
5462
24fad99e
AD
54632001-12-30 Akim Demaille <akim@epita.fr>
5464
5465 * src/parse-skel.y: Get rid of the shift/reduce conflict:
5466 replace `gb' with BLANKS.
5467 * src/scan-skel.l: Adjust.
5468
a4b36db4
AD
54692001-12-30 Akim Demaille <akim@epita.fr>
5470
5471 * src/system.h: We don't need nor want bcopy.
5472 Throw away MS-DOS crap: we don't need getpid.
5473 * configure.in: We don't need strndup. It was even causing
5474 problems: because Flex includes the headers *before* us,
5475 _GNU_SOURCE is not defined by config.h, and therefore strndup was
5476 not visible.
5477 * lib/xstrndup.c: New.
5478 * src/scan-skel.l: Use it.
5479 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
5480 * src/parse-skel.y: Use %directives instead of #defines.
5481
1239777d
AD
54822001-12-30 Akim Demaille <akim@epita.fr>
5483
5484 * src/skeleton.h: New.
5485 * src/output.c (output_parser, output_master_parser): Remove, dead
5486 code.
5487 * src/output.h (get_lines_number, actions_output, guards_output)
5488 (token_definitions_output): Prototype them.
5489 * src/parse-skel.y: Add the license notice.
5490 Include output.h and skeleton.h.
5491 (process_skeleton): Returns void, and takes a single parameter.
5492 * src/scan-skel.l: Add the license notice.
5493 Include skeleton.h.
5494 Don't use %option yylineno: it seems that then Flex imagines
5495 REJECT has been used, and therefore it won't reallocate its
5496 buffers (which makes no other sense to me than a bug). It results
5497 in warnings for `unused: yy_flex_realloc'.
5498
9b3add5b
RA
54992001-12-30 Robert Anisko <robert.anisko@epita.fr>
5500
5501 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
5502 (MUSCLE_INSERT_PREFIX): ...to there.
5503 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
5504 (MUSCLE_INSERT_PREFIX): Move from here...
5505
5506 * src/bison.hairy: Add a section directive. Put braces around muscle
5507 names. This parser skeleton is still broken, but Bison should not
5508 choke on a bad muscle 'syntax'.
5509 * src/bison.simple: Add a section directive. Put braces around muscle
5510 names.
5511
5512 * src/files.h (strsuffix, stringappend): Add declarations.
5513 (tab_extension): Add declaration.
5514 (short_base_name): Add declaration.
5515
5516 * src/files.c (strsuffix, stringappend): No longer static. These
5517 functions are used in the skeleton parser.
5518 (tab_extension): New.
5519 (compute_base_names): Use the computations done in this function
fab5b110 5520 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
5521 names.
5522 (short_base_name): No longer static.
5523
5524 * src/output.c (output_skeleton): New.
5525 (output): Disable call to output_master_parser, and give a try to
5526 a new skeleton handling system.
5527 (guards_output, actions_output): No longer static.
5528 (token_definitions_output, get_lines_number): No longer static.
5529
5530 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
5531
fab5b110 5532 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
5533 parse-skel.y.
5534
5535 * src/parse-skel.y: New file.
5536 * src/scan-skel.l: New file.
5537
b5b61c61
AD
55382001-12-29 Akim Demaille <akim@epita.fr>
5539
5540 %name-prefix is broken.
5541
5542 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
5543 Adjust all dependencies.
5544 * tests/headers.at (export YYLTYPE): Strengthen this test: use
5545 %name-prefix.
5546
5547 Renaming yylval but not yylloc is not consistent. Now we do.
5548
5549 * src/bison.simple: Prefix yylloc if used.
5550 * doc/bison.texinfo (Decl Summary): Document that.
5551
8c9a50be
AD
55522001-12-29 Akim Demaille <akim@epita.fr>
5553
5554 * doc/bison.texinfo: Promote `%long-directive' over
5555 `%long_directive'.
5556 Remove all references to fixed-output-files, yacc is enough.
5557
d99361e6
AD
55582001-12-29 Akim Demaille <akim@epita.fr>
5559
5560 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
5561 user prologue. These are defaults.
5562 * tests/actions.at (Mid-rule actions): Make sure the user can
5563 define YYDEBUG and YYERROR_VERBOSE.
5564
b9cecb91
AD
55652001-12-29 Akim Demaille <akim@epita.fr>
5566
5567 * src/output.c (header_output): Don't forget to export YYLTYPE and
5568 yylloc.
5569 * tests/headers.at (export YYLTYPE): New, make sure it does.
5570 * tests/regression.at (%union and --defines, Invalid CPP headers):
5571 Move to...
5572 * tests/headers.at: here.
5573
aea13e97
AD
55742001-12-29 Akim Demaille <akim@epita.fr>
5575
5576 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
5577
931394cb
AD
55782001-12-29 Akim Demaille <akim@epita.fr>
5579
5580 * tests/actions.at (Mid-rule actions): Output on a single line
5581 instead of several.
5582
704a47c4
AD
55832001-12-29 Akim Demaille <akim@epita.fr>
5584
5585 * doc/bison.texinfo: Formatting changes.
5586
091e20bb
AD
55872001-12-29 Akim Demaille <akim@epita.fr>
5588
5589 Don't store the token defs in a muscle, just be ready to output it
5590 on command. Now possible via `symbols'. Fixes a memory leak.
5591
5592 * src/output.c (token_definitions_output): New.
5593 (output_parser, header_output): Use it.
5594 * src/reader.c (symbols_save): Remove.
5595
cce71710
AD
55962001-12-29 Akim Demaille <akim@epita.fr>
5597
5598 * src/bison.simple: Do not provide a default for YYSTYPE and
5599 YYLTYPE before the user's prologue. Otherwise it's hardly... a
5600 default.
5601
82c035a8
AD
56022001-12-29 Akim Demaille <akim@epita.fr>
5603
5604 Mid-rule actions are simply... ignored!
5605
5606 * src/reader.c (readgram): Be sure to attach mid-rule actions to
5607 the empty-rule associated to the dummy symbol, not to the host
5608 rule.
5609 * tests/actions.at (Mid-rule actions): New.
5610
8419d367
AD
56112001-12-29 Akim Demaille <akim@epita.fr>
5612
5613 Memory leak.
5614
5615 * src/reader.c (reader): Free grammar.
5616
375d5806
AD
56172001-12-29 Akim Demaille <akim@epita.fr>
5618
5619 Memory leak.
5620
5621 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
5622 since it allocates it for each state, although only one is needed.
5623 (allocate_storage): Do it here.
5624
f51cb8ff
AD
56252001-12-29 Akim Demaille <akim@epita.fr>
5626
5627 * src/options.h, src/options.c (create_long_option_table): Rename
5628 as...
5629 (long_option_table_new): this, with a clearer prototype.
5630 (percent_table): Remove, unused,
5631 * src/getargs.c (getargs): Adjust.
5632
29e88316
AD
56332001-12-29 Akim Demaille <akim@epita.fr>
5634
5635 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
5636 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
5637 as states.
5638
b9f71f19
AD
56392001-12-29 Akim Demaille <akim@epita.fr>
5640
5641 * src/lalr.c (build_relations): Rename `states' as `states1'.
5642 Sorry, I don't understand exactly what it is, no better name...
5643
1a2b5d37
AD
56442001-12-29 Akim Demaille <akim@epita.fr>
5645
5646 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
5647 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
5648 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
5649 as rules.
5650
1cca533e
AD
56512001-12-29 Akim Demaille <akim@epita.fr>
5652
5653 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
5654 ago.
5655
c03ae966
AD
56562001-12-29 Akim Demaille <akim@epita.fr>
5657
5658 * src/reader.c, src/reader.h (user_toknums): Remove.
5659 Adjust all users to use symbols[i]->user_token_number.
5660
5a670b1e
AD
56612001-12-29 Akim Demaille <akim@epita.fr>
5662
5663 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
5664 Adjust all users to use symbols[i]->prec or ->assoc.
5665
ad949da9
AD
56662001-12-29 Akim Demaille <akim@epita.fr>
5667
5668 * src/reader.c, src/reader.h (tags): Remove.
5669 Adjust all users to use symbols[i]->tag.
5670
0e78e603
AD
56712001-12-29 Akim Demaille <akim@epita.fr>
5672
5673 * src/gram.h, src/gram.c (symbols): New, similar to state_table
5674 and rule_table.
5675 * src/reader.c (packsymbols): Fill this table.
5676 Drop sprec.
5677 * src/conflicts.c (resolve_sr_conflict): Adjust.
5678 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
5679 single table.
5680 Use symbols[i]->tag instead of tags[i].
5681
213e640e
AD
56822001-12-29 Akim Demaille <akim@epita.fr>
5683
5684 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
5685 In addition, put a comment in there, to replace...
5686 * tests/regression.at (%union and C comments): Remove.
5687
e7b8bef1
AD
56882001-12-29 Akim Demaille <akim@epita.fr>
5689
5690 * tests/regression.at (Web2c Actions): Blindly move the actual
5691 output as expected output. The contents *seem* right to me, but I
5692 can't pretend reading perfectly parser tables... Nonetheless, all
5693 the other tests pass correctly, the table look OK, even though the
5694 presence of `$axiom' is to be noted: AFAICS it is useless (but
5695 harmless).
5696
b68e7744
AD
56972001-12-29 Akim Demaille <akim@epita.fr>
5698
5699 * src/reader.c (readgram): Don't add the rule 0 if there were no
5700 rules read. In other words, add it _after_ having performed
5701 grammar sanity checks.
5702 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
5703
78d5bae9
AD
57042001-12-29 Akim Demaille <akim@epita.fr>
5705
5706 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
5707 visible, and some states have now a different number.
5708
ff442794
AD
57092001-12-29 Akim Demaille <akim@epita.fr>
5710
5711 * src/reader.c (readgram): Bind the initial rule's lineno to that
5712 of the first rule.
5713 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
5714 (Solved SR Conflicts): Adjust rule 0's line number.
5715
610ab194
AD
57162001-12-29 Akim Demaille <akim@epita.fr>
5717
5718 Fix the `GAWK Grammar' failure.
5719
5720 * src/LR0.c (final_state): Initialize to -1 so that we do compute
5721 the reductions of the first state which was mistakenly confused
5722 with the final state because precisely final_state was initialized
5723 to 0.
5724 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
5725 now noticed by Bison.
5726 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
5727 have a reduction on $default.
5728
29d29c8f
AD
57292001-12-29 Akim Demaille <akim@epita.fr>
5730
5731 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
5732 rule line numbers.
5733 * src/closure.c (print_closure): Likewise.
5734 * src/derives.c (print_derives): Likewise.
5735 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
5736 now.
5737
7c6b64d0
AD
57382001-12-29 Akim Demaille <akim@epita.fr>
5739
5740 * src/lalr.c (lookaheads_print): New.
5741 (lalr): Call it when --trace-flag.
5742 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
5743 are dumped.
5744
3d4daee3
AD
57452001-12-29 Akim Demaille <akim@epita.fr>
5746
5747 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
5748 when walking through ritem, even via rule->rhs.
5749 * src/reduce.c (dump_grammar, useful_production, reduce_output)
5750 (useful_production, useless_nonterminals): Likewise.
5751 (reduce_grammar_tables): Likewise, plus update nritems.
5752 * src/nullable.c (set_nullable): Likewise.
5753 * src/lalr.c (build_relations): Likewise.
5754 * tests/sets.at (Nullable): Adjust.
5755 Fortunately, now, the $axiom is no longer nullable.
5756
9e7f6bbd
AD
57572001-12-29 Akim Demaille <akim@epita.fr>
5758
5759 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
5760 the 0-sentinel.
5761 * src/gram.c (ritem_longest_rhs): Likewise.
5762 * src/reduce.c (nonterminals_reduce): Likewise.
5763 * src/print_graph.c (print_graph): Likewise.
5764 * src/output.c (output_rule_data): Likewise.
5765 * src/nullable.c (set_nullable): Likewise.
5766
255ef638
AD
57672001-12-29 Akim Demaille <akim@epita.fr>
5768
5769 * src/output.c: Comment changes.
5770
0d8a7363
AD
57712001-12-27 Paul Eggert <eggert@twinsun.com>
5772
5773 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
5774 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
5775 Sparc, as they were causing more porting problems than the
5776 (minor) performance improvement was worth.
5777
5778 Also, catch up with 1.31's YYSTD.
5779
3db472b9
AD
57802001-12-27 Akim Demaille <akim@epita.fr>
5781
5782 * src/output.c (output_gram): Rely on nritems, not the
5783 0-sentinel. See below.
5784 Use -1 as separator, not 0.
5785 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
5786 Rely on -1 as separator in yyrhs, instead of 0.
5787 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
5788 twice `Now at end of input', therefore there are two lines less to
5789 expect.
5790
b365aa05
AD
57912001-12-27 Akim Demaille <akim@epita.fr>
5792
5793 * tests/regression.at (Unresolved SR Conflicts):
5794 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
5795 below.
5796
30171f79
AD
57972001-12-27 Akim Demaille <akim@epita.fr>
5798
5799 * src/LR0.c (new_state): Recognize the final state by the fact it
5800 is reached by eoftoken.
5801 (insert_start_shifting_state, insert_eof_shifting_state)
5802 (insert_accepting_state, augment_automaton): Remove, since now
5803 these states are automatically computed from the initial state.
5804 (generate_states): Adjust.
5805 * src/print.c: When reporting a rule number to the user, substract
5806 1, so that the axiom rule is rule 0, and the first user rule is 1.
5807 * src/reduce.c: Likewise.
5808 * src/print_graph.c (print_core): For the time being, just as for
5809 the report, depend upon --trace-flags to dump the full set of
5810 items.
5811 * src/reader.c (readgram): Once the grammar read, insert the rule
5812 0: `$axiom: START-SYMBOL $'.
5813 * tests/set.at: Adjust: rule 0 is now displayed, and since the
5814 number of the states has changed (the final state is no longer
5815 necessarily the last), catch up.
5816
75142d45
AD
58172001-12-27 Akim Demaille <akim@epita.fr>
5818
5819 Try to make the use of the eoftoken valid. Given that its value
5820 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
5821 is used instead of > 0 where appropriate, (ii), depend upon nritems
5822 instead of the 0-sentinel.
5823
5824 * src/gram.h, src/gram.c (nritems): New.
5825 Expected to be duplication of nitems, but for the time being...
5826 * src/reader.c (packgram): Assert nritems and nitems are equal.
5827 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
5828 * src/closure.c (print_closure, print_fderives): Likewise.
5829 * src/gram.c (ritem_print): Likewise.
5830 * src/print.c (print_core, print_grammar): Likewise.
5831 * src/print_graph.c: Likewise.
5832
b7c49edf
AD
58332001-12-27 Akim Demaille <akim@epita.fr>
5834
5835 * src/main.c (main): If there are complains after grammar
5836 reductions, then output the report anyway if requested, then die.
5837 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
5838 * src/reader.c (eoftoken): New.
5839 (parse_token_decl): If the token being defined has value `0', it
5840 is the eoftoken.
5841 (packsymbols): No longer hack `tags' to insert `$' by hand.
5842 Be sure to preserve the value of the eoftoken.
5843 (reader): Make sure eoftoken is defined.
5844 Initialize nsyms to 0: now eoftoken is created just like the others.
5845 * src/print.c (print_grammar): Don't special case the eof token.
5846 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
5847 lie anyway, albeit pleasant.
5848 * tests/calc.at: Exercise error messages with eoftoken.
5849 Change the grammar so that empty input is invalid.
5850 Adjust expectations.
5851 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
5852
ec2da99f
AD
58532001-12-27 Akim Demaille <akim@epita.fr>
5854
5855 * configure.in: Check the protos of strchr ans strspn.
5856 Replace strchr if needed.
5857 * src/system.h: Provide the protos of strchr, strspn and memchr if
5858 missing.
5859 * lib/strchr.c: New.
5860 * src/reader.c (symbols_save): Use strchr.
5861
8adfa272
AD
58622001-12-27 Akim Demaille <akim@epita.fr>
5863
5864 * src/print.c, src/print_graph.c (escape): New.
5865 Use it to quote the TAGS outputs.
5866 * src/print_graph.c (print_state): Now errors are in red, and
5867 reductions in green.
5868 Prefer high to wide: output the state number on a line of its own.
5869
80dac38c
AD
58702001-12-27 Akim Demaille <akim@epita.fr>
5871
5872 * src/state.h, src/state.c (reductions_new): New.
5873 * src/LR0.c (set_state_table): Let all the states have a
5874 `reductions', even if reduced to 0.
5875 (save_reductions): Adjust.
5876 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
5877 * src/print.c (print_reductions, print_actions): Adjust.
5878 * src/output.c (action_row): Adjust.
5879
2cec70b9
AD
58802001-12-27 Akim Demaille <akim@epita.fr>
5881
5882 * src/state.h, src/state.c (errs_new, errs_dup): New.
5883 * src/LR0.c (set_state_table): Let all the states have an errs,
5884 even if reduced to 0.
5885 * src/print.c (print_errs, print_reductions): Adjust.
5886 * src/output.c (output_actions, action_row): Adjust.
5887 * src/conflicts.c (resolve_sr_conflict): Adjust.
5888
13ca549a
AD
58892001-12-27 Akim Demaille <akim@epita.fr>
5890
5891 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
5892
5092aba5
AD
58932001-12-27 Akim Demaille <akim@epita.fr>
5894
5895 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
5896 * src/print.c: here.
5897 (lookaheadset, shiftset): New, used as additional storage by
5898 print_reductions.
5899 (print_results): Adjust.
5900 (print_shifts, print_gotos, print_errs): New, extracted from...
5901 (print_actions): here.
5902 * src/print_graph.c (print_actions): Remove dead code.
5903
11e2beca
AD
59042001-12-27 Akim Demaille <akim@epita.fr>
5905
5906 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
5907 `$n' and `@n'.
5908
dac3c910
AD
59092001-12-27 Akim Demaille <akim@epita.fr>
5910
5911 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
5912 (build_relations): Adjust.
5913
d0b0fefa
AD
59142001-12-27 Akim Demaille <akim@epita.fr>
5915
5916 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
5917 duplication.
5918
adc8c848
AD
59192001-12-27 Akim Demaille <akim@epita.fr>
5920
5921 * src/reader.c (packgram): Catch nitems overflows.
5922
14d293ac
AD
59232001-12-27 Akim Demaille <akim@epita.fr>
5924
5925 * src/files.c, src/files.h (guard_obstack): Remove.
5926 * src/output.c (output): Adjust.
5927 * src/reader.c (parse_braces): New, factoring...
5928 (copy_action, copy_guard): these two which are renamed as...
5929 (parse_action, parse_guard): these.
5930 As a voluntary consequence, using braces around guards is now
5931 mandatory.
5932
f499b062
AD
59332001-12-27 Akim Demaille <akim@epita.fr>
5934
5935 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
5936 * src/reader.c (symbol_list): `guard' and `guard_line' are new
5937 members.
5938 (symbol_list_new): Adjust.
5939 (copy_action): action_line is the first line, not the last.
5940 (copy_guard): Just as for actions, store the `action' only, not
5941 the switch/case/break flesh.
5942 Don't parse the user action that might follow the guard, let...
5943 (readgram): do it, i.e., now, there can be an action after a
5944 guard.
5945 In other words the guard is just explicitly optional.
5946 (packgram): Adjust.
5947 * src/output.c (guards_output): New.
5948 (output_parser): Call it when needed.
5949 (output): Also free the guard and attrs obstacks.
5950 * src/files.c, src/files.h (obstack_save): Remove.
5951 (output_files): Remove.
5952 As a result, if one needs the former `.act' file, using an
5953 appropriate skeleton which requires actions and guards is now
5954 required.
5955 * src/main.c (main): Adjust.
5956 * tests/semantic.at: New.
5957 * tests/regression.at: Use `input.y' as input file name.
5958 Avoid 8+3 problems by requiring input.c when the test needs the
5959 parser.
5960
d945f5cd
AD
59612001-12-27 Akim Demaille <akim@epita.fr>
5962
5963 * src/reader.c (symbol_list_new): Be sure to initialize all the
5964 fields.
5965
d200e455
AD
59662001-12-27 Akim Demaille <akim@epita.fr>
5967
5968 All the hacks using a final pseudo state are now useless.
5969
5970 * src/LR0.c (set_state_table): state_table holds exactly nstates.
5971 * src/lalr.c (nLA): New.
5972 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
5973 instead of lookaheadsp from the pseudo state (nstate + 1).
5974
f9507c28
AD
59752001-12-27 Akim Demaille <akim@epita.fr>
5976
5977 * src/output.c (action_row, token_actions): Use a state_t instead
5978 of a integer, and nlookaheads instead of the following state's
5979 lookaheadsp.
5980
065fbd27
AD
59812001-12-27 Akim Demaille <akim@epita.fr>
5982
5983 * src/conflicts.c (log_resolution, flush_shift)
5984 (resolve_sr_conflict, set_conflicts, solve_conflicts)
5985 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
5986 (conflicts_print, print_reductions): Use a state_t instead of an
5987 integer when referring to a state.
5988 As much as possible, depend upon nlookaheads, instead of the
5989 `lookaheadsp' member of the following state (since lookaheads of
5990 successive states are successive, the difference between state n + 1
5991 and n served as the number of lookaheads for state n).
5992 * src/lalr.c (add_lookback_edge): Likewise.
5993 * src/print.c (print_core, print_actions, print_state)
5994 (print_results): Likewise.
5995 * src/print_graph.c (print_core, print_actions, print_state)
5996 (print_graph): Likewise.
5997 * src/conflicts.h: Adjust.
5998
1b177bd7
AD
59992001-12-27 Akim Demaille <akim@epita.fr>
6000
6001 * src/bison.hairy: Formatting/comment changes.
6002 ANSIfy.
6003 Remove `register' indications.
6004 Add plenty of `static'.
6005
7742ddeb
AD
60062001-12-27 Akim Demaille <akim@epita.fr>
6007
6008 * src/output.c (prepare): Drop the muscle `ntbase' which
6009 duplicates ntokens.
6010 * src/bison.simple: Formatting/comment changes.
6011 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
6012 is an undocumented synonym.
6013
1fa14068
AD
60142001-12-22 Akim Demaille <akim@epita.fr>
6015
6016 * src/output.c (output_table_data): Change the prototype to use
6017 `int' for array ranges: some invocations do pass an int, not a
6018 short.
6019 Reported by Wayne Green.
6020
b9752825
AD
60212001-12-22 Akim Demaille <akim@epita.fr>
6022
6023 Some actions of web2c.y are improperly triggered.
6024 Reported by Mike Castle.
6025
6026 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
6027 * tests/regression.at (Web2c): Rename as...
6028 (Web2c Report): this.
6029 (Web2c Actions): New.
6030
776209d6
AD
60312001-12-22 Akim Demaille <akim@epita.fr>
6032
6033 Reductions in web2c.y are improperly reported.
6034 Reported by Mike Castle.
6035
6036 * src/conflicts.c (print_reductions): Fix.
6037 * tests/regression.at (Web2c): New.
6038
275fc3ad
AD
60392001-12-18 Akim Demaille <akim@epita.fr>
6040
6041 Some host fail on `assert (!"foo")', which expands to
6042 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
6043 Reported by Nelson Beebee.
6044
6045 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
6046 `#define it_succeeded 0' and `assert (it_succeeded)'.
6047
897668ee
MA
60482001-12-17 Marc Autret <autret_m@epita.fr>
6049
6050 * src/bison.simple: Don't hard code the skeleton line and filename.
6051 * src/output.c (output_parser): Rename 'line' as 'output_line'.
6052 New line counter 'skeleton_line' (skeleton-line muscle).
6053
ab3399e0
PE
60542001-12-17 Paul Eggert <eggert@twinsun.com>
6055
6056 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
6057 YYDEBUG must be defined to a nonzero value.
6058
6059 * src/bison.simple (yytname): Do not assume that the user defines
6060 YYDEBUG to a properly parenthesized expression.
6061
3877f72b
AD
60622001-12-17 Akim Demaille <akim@epita.fr>
6063
6064 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
6065 nlookaheads is a new member.
6066 Adjust all users.
6067 * src/lalr.h (nlookaheads): Remove this orphan declaration.
6068 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
6069 state.
776209d6 6070
331dbc1b
AD
60712001-12-17 Akim Demaille <akim@epita.fr>
6072
6073 * src/files.h, src/files.c (open_files, close_files): Remove.
6074 * src/main.c (main): Don't open/close files, nor invoke lex_free,
6075 let...
6076 * src/reader.c (reader): Do it.
776209d6 6077
be750e4c
AD
60782001-12-17 Akim Demaille <akim@epita.fr>
6079
6080 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 6081
709ae8c6
AD
60822001-12-17 Akim Demaille <akim@epita.fr>
6083
6084 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
6085 (flush_reduce): New.
6086 (resolve_sr_conflict): Adjust.
776209d6 6087
f87685c3
AD
60882001-12-17 Akim Demaille <akim@epita.fr>
6089
6090 * src/output.c (output_obstack): Be static and rename as...
6091 (format_obstack): this, to avoid any confusion with files.c's
6092 output_obstack.
6093 * src/reader.h (muscle_obstack): Move to...
6094 * src/output.h: here, since it's defined in output.c.
6095
837491d8
AD
60962001-12-17 Akim Demaille <akim@epita.fr>
6097
6098 * src/output.c (action_row, save_column, default_goto)
6099 (sort_actions, matching_state, pack_vector): Better variable
6100 locality.
6101
796d61fb
AD
61022001-12-17 Akim Demaille <akim@epita.fr>
6103
6104 * src/output.c: Various formatting changes.
776209d6 6105
64d15509
AD
61062001-12-17 Akim Demaille <akim@epita.fr>
6107
6108 * src/files.c (output_files): Free the output_obstack.
6109 * src/main.c (main): Call print and print_graph conditionally.
6110 * src/print.c (print): Work unconditionally.
6111 * src/print_graph.c (print_graph): Work unconditionally.
6112 * src/conflicts.c (log_resolution): Output only if verbose_flag.
6113
fbc8ecb7
MA
61142001-12-16 Marc Autret <autret_m@epita.fr>
6115
6116 * src/output.c (actions_output): Fix. When we use %no-lines,
6117 there is one less line per action.
6118
f0440388
MA
61192001-12-16 Marc Autret <autret_m@epita.fr>
6120
6121 * src/bison.simple: Remove a useless #line directive.
6122 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
6123 * src/output.c (get_lines_number): New.
776209d6 6124 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
6125 output muscles.
6126 Fix line numbering.
6127 (actions_output): Computes the number of lines taken by actions.
6128 (output_master_parser): Insert new skeleton which is the name of
6129 the output parser file name.
6130
a79986b8
MA
61312001-12-15 Marc Autret <autret_m@epita.fr>
6132
6133 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
6134
4ec8e00f
MA
61352001-12-15 Marc Autret <autret_m@epita.fr>
6136
6137 * src/output.c (output_gram): Keep track of the hairy one.
6138
1a4648ff
AD
61392001-12-15 Akim Demaille <akim@epita.fr>
6140
6141 Make `make distcheck' work.
6142
6143 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
6144 system.h which uses libgettext.h.
6145
9c2c67e6
AD
61462001-12-15 Akim Demaille <akim@epita.fr>
6147
6148 * src/nullable.c (set_nullable): Useless rules must be skipped,
6149 otherwise, since we range over their symbols, we might look at a
6150 nonterminal which no longer ``exists'', i.e., it is not counted in
6151 `nvars', hence we overflow our arrays.
6152
93ede233
AD
61532001-12-15 Akim Demaille <akim@epita.fr>
6154
6155 The header can also be produced directly, without any obstack!
6156 Yahoo!
6157
6158 * src/files.c, src/files.h (defines_obstack): Remove.
6159 (compute_header_macro): Global.
6160 (defines_obstack_save): Remove.
6161 * src/reader.c (parse_union_decl): No longer output to
6162 defines_obstack: its content can be found in the `stype' muscle
6163 anyway.
6164 (output_token_translations): Merge into...
6165 (symbols_output): this.
6166 Rename as...
6167 (symbols_save): this.
6168 (reader): Adjust.
6169 * src/output.c (header_output): New.
6170 (output): Call it.
6171
2666f928
AD
61722001-12-15 Akim Demaille <akim@epita.fr>
6173
6174 * src/reader.c (parse_union_decl): Instead of handling two obstack
6175 simultaneously, use one to define the `stype' muscle, and use the
6176 value of the latter to fill defines_obstack.
6177 (copy_comment): Remove.
6178 (copy_comment2): Work for a single obstack.
6179 Rename as...
6180 (copy_comment): this.
6181
428046f8
AD
61822001-12-15 Akim Demaille <akim@epita.fr>
6183
6184 * src/lex.c, src/lex.h (xgetc): No longer static.
6185 * src/reader.c (parse_union_decl): Revamp.
6186
ea52d706
AD
61872001-12-15 Akim Demaille <akim@epita.fr>
6188
6189 Still making progress in separating Bison into (i) input, (ii)
6190 process, (iii) output: now we can directly output the parser file
6191 without using table_obstack at all.
6192
6193 * src/files.c, src/files.h (table_obstack): Bye bye.
6194 (parser_file_name): New.
6195 * src/files.c (compute_output_file_names): Compute it.
6196 * src/output.c (actions_output, output_parser)
6197 (output_master_parser): To a file instead of an obstack.
6198
3f96f4dc
AD
61992001-12-15 Akim Demaille <akim@epita.fr>
6200
6201 Attach actions to rules, instead of pre-outputting them to
6202 actions_obstack.
6203
6204 * src/gram.h (rule_t): action and action_line are new members.
6205 * src/reader.c (symbol_list): Likewise.
6206 (copy_action): Save the actions within the rule.
6207 (packgram): Save them in rule_table.
6208 * src/output.c (actions_output): New.
6209 (output_parser): Use it on `%%actions'.
6210 (output_rule_data): Don't free rule_table.
6211 (output): Do it.
6212 (prepare): Don't save the `action' muscle.
6213 * src/bison.simple: s/%%action/%%actions/.
6214
51576fb3
AD
62152001-12-15 Akim Demaille <akim@epita.fr>
6216
6217 * src/reader.c (copy_action): When --yacc, don't append a `;'
6218 to the user action: let it fail if lacking.
dee049eb 6219 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 6220
2648a72d
AD
62212001-12-14 Akim Demaille <akim@epita.fr>
6222
6223 * src/lex.c (literalchar): Simply return the char you decoded, non
6224 longer mess around with obstacks and int pointers.
6225 Adjust all callers.
6226
92790e5b
AD
62272001-12-14 Akim Demaille <akim@epita.fr>
6228
6229 * src/lex.c (literalchar): Don't escape the special characters,
6230 just decode them, and keep them as char (before, eol was output as
6231 the 2 char string `\n' etc.).
6232 * src/output.c (output_rule_data): Use quotearg to output the
6233 token strings.
6234
927c1557
PE
62352001-12-13 Paul Eggert <eggert@twinsun.com>
6236
6237 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
6238 Do not infringe on the global user namespace when using C++.
6239 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
6240 All uses of `fprintf' and `stderr' changed.
6241
6242 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
6243
ed8e1f68
AD
62442001-12-13 Akim Demaille <akim@epita.fr>
6245
6246 The computation of nullable is broken: it doesn't handle empty
6247 RHS's properly.
6248
6249 * tests/torture.at (GNU AWK Grammar): New.
6250 * tests/sets.at (Nullable): New.
6251 * src/nullable.c (set_nullable): Instead of blindly looping over
6252 `ritems', loop over the rules, and then over their rhs's.
6253
6254 Work around Autotest bugs.
6255
6256 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
6257 frame, because Autotest understand lines starting with a `+' as
6258 traces from the shell. Then, they are not processed properly.
6259 Admittedly an Autotest bug, but we don't have time to wait for
6260 Autotest to catch up.
6261 * tests/regression.at (Broken Closure): Adjust to the new table
6262 frames.
6263 Move to...
6264 * tests/sets.at: here.
6265
cb581495
AD
62662001-12-13 Akim Demaille <akim@epita.fr>
6267
6268 * src/closure.c (closure): Use nrules instead of playing tricks
6269 with BITS_PER_WORD.
6270
2e729273
AD
62712001-12-13 Akim Demaille <akim@epita.fr>
6272
6273 * src/print.c (print_actions): Output the handling of `$' as the
6274 traces do: shifting the token EOF. Before EOF was treated as a
6275 nonterminal.
6276 * tests/regression.at: Adjust some tests.
6277 * src/print_graph.c (print_core): Complete the set of items via
6278 closure. The next-to-final and final states are still unsatisfying,
6279 but that's to be addressed elsewhere.
6280 No longer output the rule numbers, but do output the state number.
6281 A single loop for the shifts + gotos is enough, but picked a
6282 distinct color for each.
6283 (print_graph): Initialize and finalize closure.
6284
107f7dfb
AD
62852001-12-13 Akim Demaille <akim@epita.fr>
6286
6287 * src/reader.c (readgram): Remove dead code, an strip useless
6288 braces.
6289 (get_type): Remove, unused.
6290
9b53a24f
AD
62912001-12-12 Akim Demaille <akim@epita.fr>
6292
6293 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
6294 on that of lib/error.c.
6295
dbfb6dcd
AD
62962001-12-12 Akim Demaille <akim@epita.fr>
6297
6298 Some hosts don't like `/' in includes.
6299
6300 * src/system.h: Include libgettext.h without qualifying the path.
6301 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
6302 $(top_srcdir).
6303
c25fb648
MA
63042001-12-11 Marc Autret <autret_m@epita.fr>
6305
6306 * src/output.c (output_parser): Remove useless muscle.
6307
710ddc4f
MA
63082001-12-11 Marc Autret <autret_m@epita.fr>
6309
6310 * src/bison.simple: Remove #line just before %%epilogue. It
6311 is now handled in ...
6312 * src/reader.c (read_additionnal_code): Add the output of a
6313 #line for the epilogue.
6314
e83d80b8
MA
63152001-12-10 Marc Autret <autret_m@epita.fr>
6316
927c1557 6317 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
6318 replace precedent remove.
6319 * src/bison.simple: Remove #line before %%prologue because
6320 %%input-line is wrong at this time.
6321
971d5158
MA
63222001-12-10 Marc Autret <autret_m@epita.fr>
6323
6324 * src/reader.c (symbols_output): Clean up.
927c1557 6325 * src/output.c (output_gram, output): Clean up.
971d5158 6326
5edafffd
AD
63272001-12-10 Akim Demaille <akim@epita.fr>
6328
6329 * src/lalr.c (initialize_lookaheads): New. Extracted from...
6330 * src/LR0.c (set_state_table): here.
6331 * src/lalr.c (lalr): Call it.
6332
0279f8e9
AD
63332001-12-10 Akim Demaille <akim@epita.fr>
6334
6335 * src/state.h (shifts): Remove the `number' member: shifts are
6336 attached to state, hence no longer need to be labelled with a
6337 state number.
6338
190c4f5f
AD
63392001-12-10 Akim Demaille <akim@epita.fr>
6340
6341 Now that states have a complete set of members, the linked list of
6342 shifts is useless: just fill directly the state's shifts member.
6343
6344 * src/state.h (shifts): Remove the `next' member.
6345 * src/LR0.c (first_state, last_state): Remove.
6346 Adjust the callers.
6347 (augment_automaton): Don't look for the shifts that must be added
6348 a shift on EOF: it is those of the state we looked for! But now,
6349 since shifts are attached, it is no longer needed to looking
6350 merely by its id: its number.
6351
2a73b93d
AD
63522001-12-10 Akim Demaille <akim@epita.fr>
6353
6354 * src/LR0.c (augment_automaton): Better variable locality.
6355 Remove an impossible branch: if there is a state corresponding to
6356 the start symbol being shifted, then there is shift for the start
6357 symbol from the initial state.
6358
74392f6a
AD
63592001-12-10 Akim Demaille <akim@epita.fr>
6360
6361 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
6362 only when appropriate: when insert_start_shifting_state' is not
6363 invoked.
6364 * tests/regression.at (Rule Line Numbers): Adjust.
6365
37c82725
AD
63662001-12-10 Akim Demaille <akim@epita.fr>
6367
6368 * src/LR0.c (augment_automaton): Now that all states have shifts,
6369 merge the two cases addition shifts to the initial state.
6370
6a164e0c
AD
63712001-12-10 Akim Demaille <akim@epita.fr>
6372
6373 * src/lalr.c (set_state_table): Move to...
6374 * src/LR0.c: here.
6375 * src/lalr.c (lalr): Don't call it...
6376 * src/LR0.c (generate_states): do it.
6377 * src/LR0.h (first_state): Remove, only the table is used.
6378
7215de24
AD
63792001-12-10 Akim Demaille <akim@epita.fr>
6380
6381 * src/LR0.h (first_shift, first_reduction): Remove.
6382 * src/lalr.c: Don't use first_shift: find shifts through the
6383 states.
6384
80e25d4d
AD
63852001-12-10 Akim Demaille <akim@epita.fr>
6386
6387 * src/LR0.c: Attach shifts to states as soon as they are
6388 computed.
6389 * src/lalr.c (set_state_table): Instead of assigning shifts to
6390 state, just assert that the mapping was properly done.
6391
0ab3728b
AD
63922001-12-10 Akim Demaille <akim@epita.fr>
6393
6394 * src/LR0.c (insert_start_shift): Rename as...
6395 (insert_start_shifting_state): this.
6396 (insert_eof_shifting_state, insert_accepting_state): New.
6397 (augment_automaton): Adjust.
6398 Better locality of the variables.
6399 When looking if the start_symbol is shifted from the initial
6400 state, using `while (... symbol != start_symbol ...)' sounds
6401 better than `while (... symbol < start_symbol ...)': If fail
6402 to see how the order between symbols could be relevant!
6403
78af9bbc
AD
64042001-12-10 Akim Demaille <akim@epita.fr>
6405
6406 * src/getargs.h: Don't declare `spec_name_prefix' and
6407 `spec_file_prefix', declared by src/files.h.
6408 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
6409 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
6410 * src/output.c (prepare): Adjust.
6411 * src/reader.c (symbols_output): Likewise.
6412 * src/vmsgetargs.c: Vaguely adjust, but who cares?
6413
bdef2a41
AD
64142001-12-10 Akim Demaille <akim@epita.fr>
6415
6416 * src/muscle_tab.c (muscle_init): NULL is a better default than
6417 `"0"'.
6418
3735969c
AD
64192001-12-10 Akim Demaille <akim@epita.fr>
6420
6421 * src/reader.c (reader): Calling symbols_output once is enough.
6422
49701457
AD
64232001-12-10 Akim Demaille <akim@epita.fr>
6424
6425 Now that states have a complete set of members, the linked list of
6426 reductions is useless: just fill directly the state's reductions
6427 member.
6428
6429 * src/state.h (struct reductions): Remove member `number' and
6430 `next'.
6431 * src/LR0.c (first_reduction, last_reduction): Remove.
6432 (save_reductions): Don't link the new reductions, store them in
6433 this_state.
6434 * src/lalr.c (set_state_table): No need to attach reductions to
6435 states, it's already done.
6436 * src/output.c (output_actions): No longer free the shifts, then
6437 the reductions, then the states: free all the states and their
6438 members.
6439
0edad749
AD
64402001-12-10 Akim Demaille <akim@epita.fr>
6441
6442 * src/options.c (OPTN, DRTV, BOTH): New.
6443 (option_table): Use them.
6444
0edad749
AD
6445 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
6446 the job of system.h.
6447 * src/options.c: Don't include stdio.h and xalloc.h for the same
6448 reasons.
6449
5449dd0f
AD
64502001-12-10 Akim Demaille <akim@epita.fr>
6451
6452 * src/output.c (output, prepare): Make sure the values of the
6453 muscles `action' and `prologue' are 0-terminated.
6454
a870c567
AD
64552001-12-10 Akim Demaille <akim@epita.fr>
6456
6457 Clean up GCC warnings.
6458
6459 * src/reader.c (copy_action): `buf' is not used.
6460 (parse_skel_decl): Be static.
6461 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
6462 * src/options.h (create_long_option_table): Have a real prototype.
6463 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
6464 (hash_delete_at): Return const void *.
6465 Adjust casts to preserve the const.
6466
80df8768
AD
64672001-12-10 Akim Demaille <akim@epita.fr>
6468
6469 * configure.in: Require 2.52g.
6470 M4 is not needed, but AUTOM4TE is.
6471 * m4/m4.m4: Remove.
6472 * tests/Makefile.am: Adjust.
6473
f693ad14
AD
64742001-12-10 Akim Demaille <akim@epita.fr>
6475
6476 One structure for states is enough, even though theoretically
6477 there are LR(0) states and LALR(1) states.
6478
6479 * src/lalr.h (state_t): Remove.
6480 (state_table): Be state_t **, not state_t *.
6481 * src/state.h (core, CORE_ALLOC): Rename as...
6482 (state_t, STATE_ALLOC): this.
6483 Add the LALR(1) members: shifts, reductions, errs.
6484 * src/LR0.c (state_table): Rename as...
6485 (state_hash): this, to avoid name clashes with the global
6486 `state_table'.
6487 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
6488 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
6489
74ffbcb6
AD
64902001-12-10 Akim Demaille <akim@epita.fr>
6491
6492 Bison dumps core on bash.y.
6493 Reported by Pascal Bart.
6494
6495 * src/warshall.c (bitmatrix_print): New.
6496 (TC): Use it.
6497 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
6498 j must be the outer loop.
6499 * tests/regression.at (Broken Closure): New.
6500
07708e19
AD
65012001-12-05 Akim Demaille <akim@epita.fr>
6502
6503 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
6504 its argument.
6505