]> git.saurik.com Git - bison.git/blame - ChangeLog
* data/yacc.c (m4_int_type): New.
[bison.git] / ChangeLog
CommitLineData
f1886bb2
AD
12002-10-24 Akim Demaille <akim@epita.fr>
2
3 * data/yacc.c (m4_int_type): New.
4 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
5 char' as only yacc.c wants K&R portability.
6 * data/glr.c (yysigned_char): Remove.
7 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
8 Reported by Quoc Peyrot.
9
c5576256
PE
102002-10-23 Paul Eggert <eggert@twinsun.com>
11
12 * src/main.c (main): With --trace=time, report times even if a
13 non-fatal error occurs. Formerly, the times were reported in some
14 such cases but not in others.
15 * src/reader.c (reader): Just return if a complaint has been issued,
16 instead of exiting, so that 'main' can report times.
17
27b0ffea
AD
182002-10-22 Akim Demaille <akim@epita.fr>
19
20 * src/system.h: Include sys/types.
21 Reported by Bert Deknuydt.
22
223a7883
PE
232002-10-23 Paul Eggert <eggert@twinsun.com>
24
25 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
26 Suggested by Art Haas.
27
282002-10-22 Paul Eggert <eggert@twinsun.com>
29
30 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
31 decl; not needed any more.
32 * src/main.c (main): Use return to exit, undoing yesterday's change.
33 The last OS that we could find where this wouldn't work is
34 SunOS 3.5, and that's too old to worry about now.
35
36 * data/glr.c (struct yyltype): Define members even when not
37 doing locations. This is more consistent with yacc.c, and it
38 works around the following bug reports:
39 http://mail.gnu.org/pipermail/bug-bison/2002-October/001764.html
40 http://mail.gnu.org/pipermail/bug-bison/2002-October/001769.html
41 and I hope it also fixes this bug report:
42 http://mail.gnu.org/pipermail/bug-bison/2002-October/001748.html
27b0ffea 43
223a7883
PE
44 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
45 @acronym consistently. Standardize on "Yacc" instead of "YACC",
46 "Algol" instead of "ALGOL". Give a bit more history about BNF.
47
8b76775a
AD
482002-10-22 Akim Demaille <akim@epita.fr>
49
50 * data/README: New.
51
6db10d14
PE
522002-10-21 Paul Eggert <eggert@twinsun.com>
53
54 Be consistent about 'bool'; the old code used an enum in one
55 module and an int in another, and this violates the C standard.
56 * m4/stdbool.m4: New file, from coreutils 4.5.3.
57 * configure.ac (AC_HEADER_STDBOOL): Add.
58 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
59 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
60 * src/symtab.c (hash_compare_symbol_t): Likewise.
61 * src/system.h (bool, false, true): Use a definition consistent
62 with ../lib/hash.c. All uses changed.
63
64 * src/complain.c (warning_issued): Renamed from warn_message_count,
65 so that we needn't worry about integer overflow (!).
66 Now of type bool. All uses changed.
67 (complaint_issued): Renamed from complain_message_count; likewise.
68
69 * src/main.c (main): Use exit to exit with failure.
27b0ffea 70
6db10d14
PE
71 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
72 rather than 1 and 0.
73 * src/main.c (main): Likewise.
74 * src/getargs.c (getargs): Likewise.
75 * src/reader.c (reader): Likewise.
76
77 * src/getarg.c (getargs): Remove duplicate code for
78 "Try `bison --help'".
79
80 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
81 What was that "2" for?
82
83 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
84 * src/getargs.c (usage): Likewise.
85
86 * src/getargs.c (getargs): When there are too few operands, report
87 the last one. When there are too many, report the first extra
88 one. This is how diffutils does it.
89
92a060fd
PE
902002-10-20 Paul Eggert <eggert@twinsun.com>
91
92 Remove K&R vestiges.
93 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
94 * src/complain.c (VA_START): Remove. Assume prototypes.
95 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
96 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
97 fatal): Assume prototypes.
98 * src/complain.h: Assume prototypes.
99 * src/system.h (PARAMS): Remove.
100 Include <limits.h> unconditionally, since it's guaranteeed even
101 for a freestanding C89 compiler.
102 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
103 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 104
e7cb57c0
AD
1052002-10-20 Akim Demaille <akim@epita.fr>
106
107 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
108 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
109 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
110 (yyresolveStates, yyresolveAction, yyresolveStack)
111 (yyprocessOneStack): Use them.
112 (yy_reduce_print): New.
113 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
114
0245f82d
AD
1152002-10-20 Akim Demaille <akim@epita.fr>
116
117 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
118 arguments and output `void'.
119 (b4_c_function): Rename as...
120 (b4_c_function_def): this.
121 (b4_c_function_decl, b4_c_ansi_function_def)
122 (b4_c_ansi_function_decl): New.
123 Change the interpretation of the arguments: before `int, foo', now
124 `int foo, foo'.
125 * data/yacc.c (yyparse): Prototype and define thanks to these.
126 Adjust b4_c_function_def uses.
127 * data/glr.c (yyparse): Likewise, but ANSI only.
128
39912f52
AD
1292002-10-20 Akim Demaille <akim@epita.fr>
130
131 * src/output.c (prepare): Move the definition of `tokens_number',
132 `nterms_number', `undef_token_number', `user_token_number_max'
133 to...
134 (prepare_tokens): Here.
135 (prepare_tokens): Rename as...
136 (prepare_symbols): this.
137 (prepare): Move the definition of `rules_number' to...
138 (prepare_rules): here.
139 (prepare): Move the definition of `last', `final_state_number',
140 `states_number' to...
141 (prepare_states): here.
142 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
143
20c1e2ad
AD
1442002-10-20 Akim Demaille <akim@epita.fr>
145
146 * src/tables.h, src/tables.c, src/output.c: Comment changes.
147
21964f43
AD
1482002-10-20 Akim Demaille <akim@epita.fr>
149
150 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
151 * data/c.m4: here.
152
66d30cd4
AD
1532002-10-20 Akim Demaille <akim@epita.fr>
154
155 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
156 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
157 `pair'.
158 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
159 `name' to...
160 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
161 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
162 These.
163
95f2c9fe
PE
1642002-10-19 Paul Eggert <eggert@twinsun.com>
165
166 Do not create a temporary file, as that involves security and
167 cleanup headaches. Instead, use a pair of pipes.
168 Derived from a suggestion by Florian Krohm.
169 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
170 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
171 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
172 (BISON_PREREQ_SUBPIPE): Add.
173 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
174 Add subpipe.h, subpipe.c.
175 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
176 * po/POTFILES.in: Add lib/subpipe.c.
177 * src/output.c: Include "subpipe.h".
178 (m4_invoke): Remove decl.
179 (scan_skel): New decl.
180 (output_skeleton): Use pipe rather than temporary file for m4 input.
181 Check that m4sugar.m4 is readable, to avoid deadlock.
182 Check for pipe I/O error.
183 * src/scan-skel.l (readpipe): Remove decl.
184 (scan_skel): New function, to be used in place of m4_invoke.
185 Read from stream rather than file.
66d30cd4 186
95f2c9fe
PE
187 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
188 float, as this generates a warning on Solaris 8 + GCC 3.2 with
189 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
190 this generates a more-accurate value anyway.
191
192 * lib/timevar.c (timervar_accumulate): Rename locals to
193 avoid confusion with similarly-named more-global.
194 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
195
196 * src/output.c (prepare): Use xstrdup to convert char const *
197 to char *, to avoid GCC warning.
198
c19988b7
AD
1992002-10-19 Akim Demaille <akim@epita.fr>
200
201 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
202 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
203 Use them to have `calc.y' ready for %pure-parser.
204 * data/yacc.c (YYLEX): Pass a yylex return type to
205 b4_c_function_call.
206
ae7453f2
AD
2072002-10-19 Akim Demaille <akim@epita.fr>
208
209 Prototype support of %lex-param and %parse-param.
210
211 * src/parse-gram.y: Add the definition of the %lex-param and
212 %parse-param tokens, plus their rules.
213 Drop the `_' version of %glr-parser.
214 Add the "," token.
215 * src/scan-gram.l (INITIAL): Scan them.
216 * src/muscle_tab.c: Comment changes.
217 (muscle_insert, muscle_find): Rename `pair' as `probe'.
218 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
219 (muscle_entry_s): The `value' member is no longer const.
220 Adjust all dependencies.
221 * src/muscle_tab.c (muscle_init): Adjust: use
222 MUSCLE_INSERT_STRING.
223 Initialize the obstack earlier.
224 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
225 (muscle_pair_list_grow): New.
226 * data/c.m4 (b4_c_function_call, b4_c_args): New.
227 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
228 * tests/calc.at: Use %locations, not --locations.
229 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
230
0e575721
AD
2312002-10-19 Akim Demaille <akim@epita.fr>
232
233 * src/getargs.c (usage): Take status as argument and exit
234 accordingly.
235 Report the traditional `Try ... --help' message when status != 0.
236 (usage, version): Don't take a FILE * as arg, it is pointless.
237 (getargs): When there is an incorrect number of arguments, make it
238 an error, and report it GNUlically thanks to `usage ()'.
239
724ce7f5
PE
2402002-10-18 Paul Eggert <eggert@twinsun.com>
241
3a781eb2
PE
242 * data/glr.c (yyreportParseError): Don't assume that sprintf
243 yields the length of the printed string, as this is not true
244 on SunOS 4.1.4. Reported by Peter Klein.
245
724ce7f5
PE
246 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
247 * tests/conflicts.at (%nonassoc and eof): Likewise.
248 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
249
473d0a75
AD
2502002-10-17 Akim Demaille <akim@epita.fr>
251
252 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
253 * src/getargs.c (trace_types, trace_args): Adjust.
254 * src/reader.c (grammar_current_rule_prec_set)
255 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
256 Standardize error messages.
257 And s/@prec/%prec/!
258 (reader): Use trace_flag to enable scanner/parser debugging,
259 instead of an adhoc scheme.
260 * src/scan-gram.l: Remove trailing debugging code.
261
e76d2469
PE
2622002-10-16 Paul Eggert <eggert@twinsun.com>
263
93e2236a
PE
264 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
265 MUSCLE_TAB_H.
266
e76d2469
PE
267 * NEWS: Officially drop support for building Bison with K&R C,
268 since it didn't work anyway and it's not worth worrying about.
269 * Makefile.maint (wget_files): Remove ansi2knr.c.
270 (ansi2knr.c-url_prefix): Remove.
271 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
272 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
273 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
274
5bd1c419
PE
2752002-10-15 Paul Eggert <eggert@twinsun.com>
276
277 Stop using the "enum_" trick for K&R-style function definitions;
278 it confused me, and I was the author! Instead, assume that people
279 who want to use K&R C compilers (when using these modules in GCC,
280 perhaps?) will run ansi2knr.
281
282 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
283 All uses of "enum_" changed to "enum ".
284 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
285 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 286
5bd1c419
PE
287 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
288 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
289 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
290 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
291 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
292 abitset_not, abitset_ones, abitset_or, abitset_or_and,
293 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
294 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
295 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
296 Use function prototypes; this removes the need for declaring
297 static functions simply to provide their prototypes.
298 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
299 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
300 bitset_count_, bitset_create, bitset_dump, bitset_first,
301 bitset_free, bitset_init, bitset_last, bitset_next,
302 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
303 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
304 bitset_print, bitset_release_memory, bitset_toggle_,
305 bitset_type_choose, bitset_type_get, bitset_type_name_get,
306 debug_bitset): Likewise.
307 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
308 * lib/bitset_stats.c (bitset_log_histogram_print,
309 bitset_percent_histogram_print, bitset_stats_and,
310 bitset_stats_and_cmp, bitset_stats_and_or,
311 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
312 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
313 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
314 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
315 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
316 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
317 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
318 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
319 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
320 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
321 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
322 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
323 bitset_stats_zero): Likewise.
324 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
325 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
326 bitsetv_dump, debug_bitsetv): Likewise.
327 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
328 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
329 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
330 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
331 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
332 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
333 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
334 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
335 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
336 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
337 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
338 Likewise.
339 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
340 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
341 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
342 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
343 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
344 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
345 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
346 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
347 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
348 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
349 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 350
ae26e1f0
AD
3512002-10-14 Akim Demaille <akim@epita.fr>
352
353 Version 1.75.
354
d43baf71
AD
3552002-10-14 Akim Demaille <akim@epita.fr>
356
357 * tests/Makefile.am (maintainer-check-posix): New.
358
7ebc83e3
AD
3592002-10-14 Akim Demaille <akim@epita.fr>
360
361 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
362 member.
363
05846dae
AD
3642002-10-14 Akim Demaille <akim@epita.fr>
365
366 * src/tables.c (table_ninf_remap): base -> tab.
367 Reported by Matt Rosing.
368
1318e37d
PE
3692002-10-14 Paul Eggert <eggert@twinsun.com>
370
447fbb17
PE
371 * tests/action.at, tests/calc.at, tests/conflicts.at,
372 tests/cxx-type.at, tests/headers.at, tests/input.at,
373 tests/regression.at, tests/synclines.at, tests/torture.at:
374 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
375 so that the tests still work even if POSIXLY_CORRECT is set.
376 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 377
1318e37d
PE
378 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
379 for portability to K&R hosts. Fix typo: signed char is guaranteed
380 only to 127, not to 128.
381 * data/glr.c (yysigned_char): New type.
382 * data/yacc.c (yysigned_char): Likewise.
383 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
384
cc0f0794
PE
3852002-10-13 Paul Eggert <eggert@twinsun.com>
386
5038f418
PE
387 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
388 true due to limited range of data type" warning from GCC.
389
cc0f0794
PE
390 * data/c.m4 (b4_token_defines): Protect against double-inclusion
391 by wrapping enum yytokentype's definition inside #ifndef
392 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
393
6fed0802
AD
3942002-10-13 Akim Demaille <akim@epita.fr>
395
396 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
397 Un yy- yyrhs to avoid the name clash with the global YYRHS.
398
32f0598d
AD
3992002-10-13 Akim Demaille <akim@epita.fr>
400
401 * Makefile.maint: Update from Autoconf 2.54.
402 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
403
7ea9a33f
AD
4042002-10-13 Akim Demaille <akim@epita.fr>
405
406 * src/print.c (print_state): Separate the list of solved conflicts
407 from the other items.
408 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
409
ea99527d
AD
4102002-10-13 Akim Demaille <akim@epita.fr>
411
412 Let nondeterministic skeletons be usable with deterministic
413 tables.
414
415 With the patch, GAWK compiled by GCC without -O2 passes its test
416 suite using a GLR parser driven by LALR tables. It fails with -O2
417 because `struct stat' gives two different answers on my machine:
418 88 (definition of an auto var) and later 96 (memset on this var).
419 Hence the stack is badly corrumpted. The headers inclusion is to
420 blame: if I move the awk.h inclusion before GLR's system header
421 inclusion, the two struct stat have the same size.
422
423 * src/tables.c (pack_table): Always create conflict_table.
424 (token_actions): Always create conflict_list.
425 * data/glr.c (YYFLAG): Remove, unused.
426
f377f69f
AD
4272002-10-13 Akim Demaille <akim@epita.fr>
428
429 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
430 (O0FLAGS): New.
431 (VALGRIND, GXX): New.
432 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
433 * tests/bison.in: Run $PREBISON a pre-command.
434 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
435 (maintainer-check-g++): New.
436 * Makefile.am (maintainer-check): New.
437
2a1fe6ed
AD
4382002-10-13 Akim Demaille <akim@epita.fr>
439
440 * data/glr.c: Formatting changes.
441 Tweak some trace messages to match yacc.c's.
442
f50adbbd
AD
4432002-10-13 Akim Demaille <akim@epita.fr>
444
445 GLR parsers sometimes raise parse errors instead of performing the
446 default reduction.
447 Reported by Charles-Henry de Boysson.
448
449 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
450 check the length of the traces when %glr.
451 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
452 GLR's traces.
453 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
454 Test GLR parsers.
455 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
456 (yyltype): Remove the yy prefix from the member names.
457 (yytable): Complete its comment.
458 (yygetLRActions): Map error action number from YYTABLE from
459 YYTABLE_NINF to 0.
460 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
461 (which was a bug: it should have been YYTABEL_NINF, and yet it was
462 not satisfying as we could compare an YYACTION computed from
463 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
464 only value for error actions.
465 (yyreportParseError): In verbose parse error messages, don't issue
466 `error' in the list of expected tokens.
467 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
468 next action to perform to match glr.c's decoding.
469 (yytable): Complete its comment.
470
bcbad5b9
PE
4712002-10-13 Paul Eggert <eggert@twinsun.com>
472
473 Fix problem reported by Henrik Grubbstroem in
474 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001670.html>:
475 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
476 because the Bison parser reads the second action before reducing
477 the first one.
478 * src/scan-gram.l (rule_length): New static var.
479 Use it to keep track of the rule length in the scanner, since
480 we can't expect the parser to be in lock-step sync with the scanner.
481 (handle_action_dollar, handle_action_at): Use this var.
482 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 483
14904b89
PE
4842002-10-12 Paul Eggert <eggert@twinsun.com>
485
1fe611e5
PE
486 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
487 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
488 Include <sys/time.h> when checking for clock_t and struct tms.
489 Use same include order as source.
490 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
491 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001674.html>.
05846dae 492
1fe611e5
PE
493 * lib/timevar.c: Update copyright date and clarify comments.
494 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 495
1fe611e5
PE
496 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
497 GCC version as of today, then merge Bison's changes.
498 Change "GCC" to "Bison" in copyright notice. timevar.def's
499 author is Akim, so change that too.
500
98194095
PE
501 * src/reader.c (grammar_current_rule_check):
502 Don't worry about the default action if $$ is untyped.
503 Prevents bogus warnings reported by Jim Gifford in
504 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001673.html>.
505
14904b89
PE
506 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
507 * data/glr.c, data/lalr1.cc, data/yacc.c:
508 Output token definitions before the first part of user declarations.
509 Fixes compatibility problem reported by Jim Gifford for kbd in
510 <http://mail.gnu.org/pipermail/bug-bison/2002-October/001672.html>.
511
ff6dca18
PE
5122002-10-11 Paul Eggert <eggert@twinsun.com>
513
514 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
515 (yyparse): here. This undoes some of the 2002-07-25 change.
516 Compatibility problem reported by Ralf S. Engelschall with
517 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
518
eb714592
AD
5192002-10-11 Akim Demaille <akim@epita.fr>
520
521 * tests/regression.at Characters Escapes): New.
522 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
523 characters.
524 Reported by Jan Nieuwenhuizen.
525
b7195100
AD
5262002-10-11 Akim Demaille <akim@epita.fr>
527
528 * po/id.po: New.
529
f28a0f2d
PE
5302002-10-10 Paul Eggert <eggert@twinsun.com>
531
532 Portability fixes for bitsets; this also avoids several GCC
533 warnings.
534
535 * lib/abitset.c: Include <stddef.h>, for offsetof.
536 * lib/lbitset.c: Likewise.
537
538 * lib/abitset.c (abitset_bytes): Return a size that is aligned
539 properly for vectors of objects. Do not assume that adding a
540 header size to a multiple of a word size yields a value that is
541 properly aligned for the whole union.
542 * lib/bitsetv.c (bitsetv_alloc): Likewise.
543
544 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
545 unique names for structures.
546 * lib/ebitset.c (ebitset_bytes): Likewise.
547 * lib/lbitset.c (lbitset_bytes): Likewise.
548
549 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
550 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
551 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
552 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
553 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
554 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
555 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
556 to improve the type-checking that GCC can do.
557 * lib/bitset.c (bitset_op4_cmp): Likewise.
558 * lib/bitset_stats.c (bitset_stats_count,
559 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
560 bitset_stats_copy, bitset_stats_disjoint_p,
561 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
562 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
563 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
564 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
565 bitset_stats_and_or_cmp, bitset_stats_andn_or,
566 bitset_stats_andn_or_cmp, bitset_stats_or_and,
567 bitset_stats_or_and_cmp): Likewise.
568 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
569 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
570 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
571 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
572
573 * lib/abitset.h: Include bitset.h, not bbitset.h.
574 * lib/ebitset.h: Likewise.
575 * lib/lbitset.h: Likewise.
576
577 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
578 All instances of parameters of type enum bitset_opts are now of
579 type enum_bitset_opts, to conform to the C Standard, and similarly
580 for enum_bitset_type.
581 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
582 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
583
584 Do not use "struct bitset_struct" to mean different things in
585 different modules. Not only is this confusing, it violates
586 the C Standard, which requires that structure types in different
587 modules must be compatible if one is to be passed to the other.
588 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
589 All instances of "struct bitset_struct *" replaced with "bitset".
590 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
591 (union bitset_union, struct abitset_struct, struct ebitset_struct,
592 struct lbitset_struct, struct bitset_stats_struct): New types.
593 All uses of struct bitset_struct changed to union bitset_union,
594 etc.
595 * lib/abitset.c (struct abitset_struct, abitset,
596 struct bitset_struct): Remove.
597 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
598 struct bitset_struct): Remove.
599 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
600 bitset_struct): Remove.
601 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
602 Likewise.
603
604 Do not call a function of type T using a call that assumes the
605 function is of a different type U. Standard C requires that a
606 function must be called with a type that is compatible with its
607 definition.
608 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
609 New decls.
610 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
611 New functions.
612 * lib/ebitset.c (PFV): Remove.
613 * lib/lbitset.c (PFV): Likewise.
614 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
615 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
616 decls.
617 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
618 (ebitset_vtable): Use them.
619 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
620 lbitset_xor): New functions.
621 (lbitset_vtable): Use them.
622
623 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
624 Declare.
625
626 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
627 GCC warning.
628 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
629 Use offsetof, for simplicity.
630
6fbe4984
PE
6312002-10-06 Paul Eggert <eggert@twinsun.com>
632
633 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
634 the same width as int. This reapplies a hunk of the 2002-08-12 patch
635 <http://mail.gnu.org/pipermail/bison-patches/2002-August/001111.html>,
636 which was inadvertently undone by the 2002-09-30 patch.
637 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
638 the same width as int.
639
420f93c8
PE
6402002-10-04 Paul Eggert <eggert@twinsun.com>
641
642 Version 1.50.
643
644 * configure.ac (AC_INIT), NEWS: Increment version number.
645
646 * doc/bison.texinfo: Minor spelling, grammar, and white space
647 fixes.
648 (Symbols): Mention that any negative value returned from yylex
649 signifies end-of-input. Warn about negative chars. Mention
650 the portable Standard C character set.
651
652 The GNU coding standard says CFLAGS and YFLAGS are reserved
653 for the installer to set.
654 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
655 * src/Makefile.am (AM_CFLAGS): Likewise.
656 (AM_YFLAGS): Renamed from YFLAGS.
657
658 Fix some MAX and MIN problems.
659 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
660 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
661 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
662 * src/reader.c (reader): Use it.
663
664 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
665 POSIX 1003.1-2001 has removed fgrep.
666
6672002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
668
669 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
670 interpreted as signed.
671 * lib/ebitset.c (ebitset_list): Fix bug.
672
ff68026d
PE
6732002-10-01 Paul Eggert <eggert@twinsun.com>
674
675 More fixes for 64-bit hosts and large bitsets.
676
677 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
678 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
679 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
680 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
681 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
682 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
683 bitset_count_): Likewise.
684 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
685 bitset_first, bitset_last): Likewise.
686 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
687 bitset_stats_list_reverse, bitset_stats_size,
688 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
689 Likewise.
690 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
691 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
692 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
693 bitsetv_reflexive_transitive_closure): Likewise.
694 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
695 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
696 Likewise.
697 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
698 Likewise.
420f93c8 699
ff68026d
PE
700 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
701 Use size_t, not unsigned int, to count bytes.
702 * lib/abitset.h (abitset_bytes): Likewise.
703 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
704 Likewise.
705 * lib/bitset.h (bitset_bytes): Likewise.
706 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
707 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
708 * lib/bitsetv.c (bitsetv_alloc): Likewise.
709 * lib/ebitset.c (ebitset_bytes): Likewise.
710 * lib/ebitset.h (ebitset_bytes): Likewise.
711 * lib/lbitset.c (lbitset_bytes): Likewise.
712 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 713
ff68026d
PE
714 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
715 abitset_subset_p, abitset_disjoint_p, abitset_and,
716 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
717 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
718 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
719 abitset_or_and, abitset_or_and_cmp):
720 Use bitset_windex instead of unsigned int.
721 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
722 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
723 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
724 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
725 Likewise.
726 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 727
ff68026d
PE
728 * lib/bitset.c (bitset_print):
729 Use proper printf formats for widths of integer types.
730 * lib/bitset_stats.c (bitset_percent_histogram_print,
731 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
732 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
733 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
734 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 735
ff68026d
PE
736 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
737 BITSET_SIZE_MAX): New macros.
738 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
739 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
740 to BITSET_WINDEX_MAX.
741
742 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
743 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
744 since we now return the bitset_bindex type (not int).
745
746 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
747 when computing sizes.
748 * lib/ebitset.c (ebitset_elts_grow): Likewise.
749
750 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
751 and avoid cast to unsigned.
752
6aa452a6
AD
7532002-09-30 Akim Demaille <akim@epita.fr>
754
755 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
756 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
757 Updates from Michael Hayes.
758
927f7817
AD
7592002-09-30 Art Haas <ahaas@neosoft.com>
760
761 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
762 invocations.
763 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
764 defined.
765
9738f41e
AD
7662002-09-27 Akim Demaille <akim@epita.fr>
767
768 Version 1.49c.
769
a5c75d7f
AD
7702002-09-27 Akim Demaille <akim@epita.fr>
771
772 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
773 (Because of AC_LIBSOURCE).
774
8280e179
AD
7752002-09-27 Akim Demaille <akim@epita.fr>
776
777 Playing with Autoscan.
778
779 * configure.ac: Remove the old LIBOBJ tweaks.
780 (AC_REPLACE_FUNCS): Add strrchr and strtol.
781 * lib/strrchr.c: New.
782 * lib/strtol.c: New, from the Coreutils 4.5.1.
783
ae64af35
AD
7842002-09-27 Akim Demaille <akim@epita.fr>
785
786 Playing with Autoscan.
787
788 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
789 * lib/Makefile.am (libbison_a_SOURCES): No longer include
790 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
791 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
792 Coreutils 4.5.1.
793
d1a1114f
AD
7942002-09-24 Akim Demaille <akim@epita.fr>
795
796 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
797 (Frequently Asked Questions, Parser Stack Overflow): New.
798
b906441c
AD
7992002-09-13 Akim Demaille <akim@epita.fr>
800
801 Playing with autoscan.
802
803 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
804 * src/files.c (skeleton_find): Remove, unused.
805 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
806 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
807
bd701811
AD
8082002-09-13 Akim Demaille <akim@epita.fr>
809
810 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
811 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
812
e0a13e7b
AD
8132002-09-13 Akim Demaille <akim@epita.fr>
814
815 * configure.ac: Require 2.54.
816 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
817 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
818 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
819 Remove, provided by Autoconf macros.
820
c97011bf
AD
8212002-09-12 Akim Demaille <akim@epita.fr>
822
823 * m4/prereq.m4: Update, from Coreutils 4.5.1.
824
d862b1be
AD
8252002-09-12 Akim Demaille <akim@epita.fr>
826
827 * m4/prereq.m4: Update, from Fileutils 4.1.5.
828 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
829 Reported by Martin Mokrejs.
830
3d38c03a
AD
8312002-09-10 Akim Demaille <akim@epita.fr>
832
833 * src/parse-gram.y: Associate a human readable string to each
834 token type.
835 * tests/regression.at (Invalid inputs): Adjust.
836
b6347355
AD
8372002-09-10 Gary V. Vaughan <gary@gnu.org>
838
839 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
840 with an Autoconf-2.5x style configure.ac.
841
09ba4ab2
PE
8422002-09-06 Paul Eggert <eggert@twinsun.com>
843
844 * doc/bison.texinfo (Conditions): Make explicit that the GPL
845 exception applies only to yacc.c. This is a modification of a
846 patch originally suggested by Akim Demaille.
847
21846f69
AD
8482002-09-06 Akim Demaille <akim@epita.fr>
849
09ba4ab2
PE
850 * data/c.m4 (b4_copyright): Move the GPL exception comment from
851 here to...
852 * data/yacc.c: here.
853
21846f69
AD
854 * data/lalr1.cc (struct yyltype): Don't define it, since we use
855 LocationType.
856 (b4_ltype): Default to yy::Location from location.hh.
857
c0ad8bf3
AD
8582002-09-04 Jim Meyering <jim@meyering.net>
859
860 * data/yacc.c: Guard the declaration of yytoknum also with
861 `#ifdef YYPRINT', so it is declared only when used.
862
3a93251e
AD
8632002-09-04 Akim Demaille <akim@epita.fr>
864
865 * configure.in: Rename as...
866 * configure.ac: this.
867 Bump to 1.49c.
868
427c0dda
AD
8692002-09-04 Akim Demaille <akim@epita.fr>
870
871 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
872 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
873 translate maintainer only messages.
874
6a254321
PE
8752002-08-12 Paul Eggert <eggert@twinsun.com>
876
645e30d1
PE
877 Version 1.49b.
878
6a254321
PE
879 * Makefile.am (SUBDIRS): Remove intl.
880 (DISTCLEANFILES): Remove.
881 * NEWS: Mention that GNU M4 is now required. Clarify what is
882 meant by "larger grammars". Mention the pt_BR translation.
883 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
884 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
885 Bump version from 0.11.2 to 0.11.5.
886 (BISON_PREREQ_STAGE): Remove.
887 (AM_GNU_GETTEXT): Use external gettext.
888 (AC_OUTPUT): Remove intl/Makefile.
889
890 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
891
892 * data/glr.c: Include string.h, for strlen.
893 (yyreportParseError): Use size_t for yysize.
894 (yy_yypstack): No longer nested inside yypstates, as nested
895 functions are not portable. Do not assume size_t is the
896 same width as int.
897 (yypstates): Do not assume that ptrdiff_t is the same width
898 as int, and similarly for yyposn and YYINDEX.
899
900 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
901
902 * lib/Makefile.am (INCLUDES): Do not include from the intl
903 directory, which has been removed.
904 * src/Makefile.am (INCLUDES): Likewise.
905
906 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
907 (bitsets_sources, additional_bitsets_sources, timevars_sources):
908 New vars.
909
910 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
911 * tests/Makefile.am (EXTRA_DIST): Likewise.
912
913 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
914 Do not assume that bitset_windex is the same width as unsigned.
915
916 * lib/abitset.c (abitset_unused_clear): Do not assume that
917 bitset_word is the same width as int.
918 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
919 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
920 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
921 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
922 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
923
924 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
925 portability to one's complement hosts!).
926 * lib/ebitset.c (ebitset_op1): Likewise.
927 * lib/lbitset.c (lbitset_op1): Likewise.
928
929 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
930 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
931 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
932 Sync with fileutils.
933 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
934 lib/gettext.h: Sync with diffutils.
935
936 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
937 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
938
939 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
940 PROTOTYPES to check for prototypes, and "defined __STDC__" to
941 check for void *.
942
943 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
944 size_t; the old version tried to do this but casted improperly.
945 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
946 (bitset_test): Now returns int, not unsigned long.
947
948 * lib/bitset_stats.c: Include "gettext.h".
949 (_): New macro.
950 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
951 name locals "index", as it generates unnecessary warnings on some
952 hosts that have an "index" function.
953
954 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
955 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
956 they need translation.
957 * src/LR0.c (state_list_append, new_itemsets, get_state,
958 append_states, generate_states): Likewise.
959 * src/assoc.c (assoc_to_string): Likewise.
960 * src/closure.c (print_closure, set_firsts, closure): Likewise.
961 * src/gram.c (grammar_dump): Likewise.
962 * src/injections.c (injections_compute): Likewise.
963 * src/lalr.c (lookaheads_print): Likewise.
964 * src/relation.c (relation_transpose): Likewise.
965 * src/scan-gram.l: Likewise.
966 * src/tables.c (table_grow, pack_vector): Likewise.
967
968 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
969 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
970 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
971 * m4/mbstate_t.m4: Sync with fileutils.
972 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
973
974 * po/LINGUAS: Add pt_BR.
975 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
976 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
977 lib/timevar.c.
978 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
979 manual recommends.
980 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
981
982 * src/complain.c (strerror_r): Remove decl; not needed.
983 (strerror): Use same pattern as ../lib/error.c.
984
985 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
986
987 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
988
989 * src/main.c (main): Cast result of bindtextdomain and textdomain
990 to void, to avoid a GCC warning when --disable-nls is in effect.
991
992 * src/scan-gram.l: Use strings rather than escapes when possible,
993 to minimize the number of warnings from xgettext.
994 (handle_action_dollar, handle_action_at): Don't use isdigit,
995 as it mishandles negative chars and it may not work as expected
996 outside the C locale.
997
998 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
999 this is a GCC extension and is not portable to other compilers.
1000
1001 * src/system.h (alloca): Use same pattern as ../lib/error.c.
1002 Do not include <ctype.h>; no longer needed.
1003 Do not include <malloc.h>; no longer needed (and generates
1004 warnings on OpenBSD 3.0).
1005
1006 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
1007 it's not portable.
1008
1009 * tests/regression.at: Do not use 'cc -c input.c -o input';
1010 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
1011
1012 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
1013 exit status as failure, not just exit status 1. Sun C exits
1014 with status 2 sometimes.
1015
1016 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
1017 Use it for the two large tests.
1018
c8f002c7
AD
10192002-08-02 Akim Demaille <akim@epita.fr>
1020
1021 * src/conflicts.c (conflicts_output): Don't output rules never
1022 reduced here, since anyway that computation doesn't work.
1023 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
1024 (rule_useless_p, rule_never_reduced_p): New.
1025 (grammar_rules_partial_print): Use a filter instead of a range.
1026 Display the title only if needed.
1027 (grammar_rules_print): Adjust.
1028 (grammar_rules_never_reduced_report): New.
1029 * src/tables.c (action_row): Move the computation of rules never
1030 reduced to...
1031 (token_actions): here.
1032 * src/main.c (main): Make the parser before making the report, so
1033 that rules never reduced are computed.
1034 Call grammar_rules_never_reduced_report.
1035 * src/print.c (print_results): Report rules never reduced.
1036 * tests/conflicts.at, tests/reduce.at: Adjust.
1037
cd08e51e
AD
10382002-08-01 Akim Demaille <akim@epita.fr>
1039
1040 Instead of attaching lookaheads and duplicating the rules being
1041 reduced by a state, attach the lookaheads to the reductions.
1042
1043 * src/state.h (state_t): Remove the `lookaheads',
1044 `lookaheads_rule' member.
1045 (reductions_t): Add a `lookaheads' member.
1046 Use a regular array for the `rules'.
1047 * src/state.c (reductions_new): Initialize the lookaheads member
1048 to 0.
1049 (state_rule_lookaheads_print): Adjust.
1050 * src/state.h, src/state.c (state_reductions_find): New.
1051 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
1052 (count_rr_conflicts): Adjust.
1053 * src/lalr.c (LArule): Remove.
1054 (add_lookback_edge): Adjust.
1055 (state_lookaheads_count): New.
1056 (states_lookaheads_initialize): Merge into...
1057 (initialize_LA): this.
1058 (lalr_free): Adjust.
1059 * src/main.c (main): Don't free nullable and derives too early: it
1060 is used by --verbose.
1061 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
1062
bb0027a9
AD
10632002-08-01 Akim Demaille <akim@epita.fr>
1064
1065 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
1066 `rule_number_t**'.
1067 (set_derives, free_derives): Rename as...
1068 (derives_compute, derives_free): this.
1069 Adjust all dependencies.
1070 * src/nullable.c (set_nullable, free_nullable): Rename as...
1071 (nullable_compute, nullable_free): these.
1072 (rule_list_t): Store rule_t *, not rule_number_t.
1073 * src/state.c (state_rule_lookaheads_print): Directly compare rule
1074 pointers, instead of their numbers.
1075 * src/main.c (main): Call nullable_free, and derives_free earlier,
1076 as they were lo longer used.
1077
3325ddc4
AD
10782002-08-01 Akim Demaille <akim@epita.fr>
1079
1080 * lib/timevar.c (get_time): Include children time.
1081 * src/lalr.h (LA, LArule): Don't export them: used with the
1082 state_t.
1083 * src/lalr.c (LA, LArule): Static.
1084 * src/lalr.h, src/lalr.c (lalr_free): New.
1085 * src/main.c (main): Call it.
1086 * src/tables.c (pack_vector): Check whether loc is >= to the
1087 table_size, not >.
1088 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
1089 (tables_generate): do it, since that's also it which allocates
1090 them.
1091 Don't free LA and LArule, main does.
1092
c6f1a33c
AD
10932002-07-31 Akim Demaille <akim@epita.fr>
1094
1095 Separate parser tables computation and output.
1096
1097 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
1098 (conflict_list, conflict_list_cnt, table, check, table_ninf)
1099 (yydefgoto, yydefact, high): Move to...
1100 * src/tables.h, src/tables.c: here.
1101 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1102 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1103 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
1104 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
1105 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
1106 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
1107 (action_row, save_row, token_actions, save_column, default_goto)
1108 (goto_actions, sort_actions, matching_state, pack_vector)
1109 (table_ninf_remap, pack_table, prepare_actions): Move to...
1110 * src/tables.c: here.
1111 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
1112 * src/output.c (token_actions, output_base, output_conflicts)
1113 (output_check): Merge into...
1114 (prepare_actions): this.
1115 (actions_output): Rename as...
1116 (user_actions_output): this.
1117 * src/main.c (main): Call tables_generate and tables_free.
1118
1509d42f
AD
11192002-07-31 Akim Demaille <akim@epita.fr>
1120
1121 Steal GCC's --time-report support.
1122
1123 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
1124 stolen/adjusted from GCC.
1125 * m4/stage.m4: Remove time related checks.
1126 * m4/timevar.m4: New.
1127 * configure.in: Adjust.
1128 * src/system.h: Adjust to using timevar.h.
1129 * src/getargs.h, src/getargs.c: Support trace_time for
1130 --trace=time.
1131 * src/main.c (stage): Remove.
1132 (main): Replace `stage' invocations with timevar calls.
1133 * src/output.c: Insert pertinent timevar calls.
1134
273a74fa
AD
11352002-07-31 Akim Demaille <akim@epita.fr>
1136
1137 Let --trace have arguments.
1138
1139 * src/getargs.h (enum trace_e): New.
1140 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
1141 (long_options, short_options): --trace/-T takes an optional
1142 argument.
1143 Change all the uses of trace_flag to reflect the new flags.
1144 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
1145
1146 Strengthen `stage' portability.
1147
1148 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
1149 * configure.in: Use it.
1150 Don't check for malloc.h and sys/times.h.
1151 * src/system.h: Include them when appropriate.
1152 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
1153 times and struct tms are available.
1154
217598da
AD
11552002-07-30 Akim Demaille <akim@epita.fr>
1156
1157 In verbose parse error message, don't report `error' as an
1158 expected token.
1159 * tests/actions.at (Printers and Destructors): Adjust.
1160 * tests/calc.at (Calculator $1): Adjust.
1161 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
1162 error message, do not report the parser accepts the error token in
1163 that state.
1164
52489d44
AD
11652002-07-30 Akim Demaille <akim@epita.fr>
1166
1167 Normalize conflict related messages.
1168
1169 * src/complain.h, src/complain.c (warn, complain): New.
1170 * src/conflicts.c (conflicts_print): Use them.
1171 (conflict_report_yacc): New, extracted from...
1172 (conflicts_print): here.
1173 * tests/conflicts.at, tests/existing.at: Adjust.
1174
e8832397
AD
11752002-07-30 Akim Demaille <akim@epita.fr>
1176
1177 Report rules which are never reduced by the parser: those hidden
1178 by conflicts.
1179
1180 * src/LR0.c (save_reductions): Don't make the final state too
1181 different: save its reduction (accept) instead of having a state
1182 without any action (no shift or goto, no reduce).
1183 Note: the final state is now a ``regular'' state, i.e., the
1184 parsers now contain `reduce 0' as default reduction.
1185 Nevertheless, since they decide to `accept' when yystate =
1186 final_state, they still will not reduce rule 0.
1187 * src/print.c (print_actions, print_reduction): Adjust.
1188 * src/output.c (action_row): Track reduced rules.
1189 (token_actions): Report rules never reduced.
1190 * tests/conflicts.at, tests/regression.at: Adjust.
1191
caf23d24
AD
11922002-07-30 Akim Demaille <akim@epita.fr>
1193
1194 `stage' was accidently included in a previous patch.
1195 Initiate its autoconfiscation.
1196
1197 * configure.in: Look for malloc.h and sys/times.h.
1198 * src/main.c (stage): Adjust.
1199 Report only when trace_flag.
1200
640748ee
AD
12012002-07-29 Akim Demaille <akim@epita.fr>
1202
1203 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
1204 state_number_t.
1205 (errs_t): symbol_t*, not symbol_number_t.
1206 (reductions_t): rule_t*, not rule_number_t.
1207 (FOR_EACH_SHIFT): New.
1208 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
1209 * src/print.c, src/print_graph.c: Adjust.
1210
88bce5a2
AD
12112002-07-29 Akim Demaille <akim@epita.fr>
1212
1213 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
1214
1215 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
1216 (endtoken, accept): these.
1217 * src/reader.c (reader): Set endtoken's default tag to "$end".
1218 Set undeftoken's tag to "$undefined" instead of "$undefined.".
1219 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
1220 Adjust.
1221
1bfb97db
AD
12222002-07-29 Akim Demaille <akim@epita.fr>
1223
1224 * src/reduce.c (reduce_grammar): When the language is empty,
1225 complain about the start symbol, not the axiom.
1226 Use its location.
1227 * tests/reduce.at (Empty Language): New.
1228
fc5734fe
AD
12292002-07-26 Akim Demaille <akim@epita.fr>
1230
1231 * src/reader.h, src/reader.c (gram_error): ... can't get
1232 yycontrol without making too strong assumptions on the parser
1233 itself.
1234 * src/output.c (prepare_tokens): Use the real 0th value of
1235 token_translations instead of `0'.
1236 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
1237 visible here.
1238 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
1239 for the time being: %locations ought to provide it to yyerror.
1240
3650b4b8
AD
12412002-07-25 Akim Demaille <akim@epita.fr>
1242
1243 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
1244 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
1245 * tests/regression.at (Web2c Actions): Adjust.
1246
4b3d3a8e
AD
12472002-07-25 Akim Demaille <akim@epita.fr>
1248
1249 Stop storing rules from 1 to nrules + 1.
1250
1251 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
1252 * src/nullable.c, src/output.c, src/print.c, src/reader.c
1253 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
1254 Iterate from 0 to nrules.
1255 Use rule_number_as_item_number and item_number_as_rule_number.
1256 Adjust to `derive' now containing possibly 0.
1257 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
1258 Handle the `- 1' part in rule numbers from/to item numbers.
1259 * src/conflicts.c (log_resolution): Fix the message which reversed
1260 shift and reduce.
1261 * src/output.c (action_row): Initialize default_rule to -1.
1262 (token_actions): Adjust.
1263 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
1264 expected output.
1265 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
1266
4a2a22f4
AD
12672002-07-25 Akim Demaille <akim@epita.fr>
1268
1269 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
1270 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
1271 (b4_c_knr_arg_decl): New.
1272 * data/yacc.c: Use it to define yysymprint, yydestruct, and
1273 yyreport_parse_error.
1274
b8df3223
AD
12752002-07-25 Akim Demaille <akim@epita.fr>
1276
1277 * data/yacc.c (yyreport_parse_error): New, extracted from...
1278 (yyparse): here.
1279 (yydestruct, yysymprint): Move above yyparse.
1280 Be K&R compliant.
1281
a762e609
AD
12822002-07-25 Akim Demaille <akim@epita.fr>
1283
1284 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
1285 replace...
1286 (b4_sint_type, b4_uint_type): these.
1287 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
1288 * tests/regression.at (Web2c Actions): Adjust.
1289
12b0043a
AD
12902002-07-25 Akim Demaille <akim@epita.fr>
1291
1292 * src/gram.h (TIEM_NUMBER_MAX): New.
1293 (item_number_of_rule_number, rule_number_of_item_number): Rename
1294 as...
1295 (rule_number_as_item_number, item_number_as_rule_number): these.
1296 Adjust dependencies.
1297 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
1298 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
1299 (symbol_number_to_vector_number): New.
1300 (order): Of vector_number_t* type.
1301 (base_t, BASE_MAX, BASE_MIN): New.
1302 (froms, tos, width, pos, check): Of base_t type.
1303 (action_number_t, ACTION_MIN, ACTION_MAX): New.
1304 (actrow): Of action_number_t type.
1305 (conflrow): Of unsigned int type.
1306 (table_ninf, base_ninf): New.
1307 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
1308 (muscle_insert_int_table, muscle_insert_base_table)
1309 (muscle_insert_rule_number_table): New.
1310 (prepare_tokens): Output `toknum' as int_table.
1311 (action_row): Returns a rule_number_t.
1312 Use ACTION_MIN, not SHRT_MIN.
1313 (token_actions): yydefact is rule_number_t*.
1314 (table_ninf_remap): New.
1315 (pack_table): Use it for `base' and `table'.
1316 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
1317 replaced with...
1318 (YYPACT_NINF, YYTABLE_NINF): these.
1319 (yypact, yytable): Compute their types instead of hard-coded
1320 `short'.
1321 * tests/regression.at (Web2c Actions): Adjust.
1322
5dde258a
AD
13232002-07-19 Akim Demaille <akim@epita.fr>
1324
1325 * src/scan-gram.l (id): Can start with an underscore.
1326
a945ec39
AD
13272002-07-16 Akim Demaille <akim@epita.fr>
1328
1329 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
1330 Adjust all former `associativity' dependencies.
1331 * src/symtab.c (symbol_new): Default associativity is `undef', not
1332 `right'.
1333 (symbol_check_alias_consistence): Adjust.
1334
fae437e8
AD
13352002-07-09 Akim Demaille <akim@epita.fr>
1336
1337 * doc/bison.texinfo: Properly set the ``header'' part.
1338 Use @dircategory ``GNU programming tools'' as per Texinfo's
1339 documentation.
1340 Use @copying.
1341
1a715ef2
AD
13422002-07-09 Akim Demaille <akim@epita.fr>
1343
1344 * lib/quotearg.h: Protect against multiple inclusions.
1345 * src/location.h (location_t): Add a `file' member.
1346 (LOCATION_RESET, LOCATION_PRINT): Adjust.
1347 * src/complain.c (warn_at, complain_at, fatal_at): Drop
1348 `error_one_per_line' support.
1349
a5d50994
AD
13502002-07-09 Akim Demaille <akim@epita.fr>
1351
1352 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
1353 * src/reader.c (lineno): Remove.
1354 Adjust all dependencies.
1355 (get_merge_function): Take a location and use complain_at.
1356 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
1357 * tests/regression.at (Invalid inputs, Mixing %token styles):
1358 Adjust.
1359
b275314e
AD
13602002-07-09 Akim Demaille <akim@epita.fr>
1361
1362 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
1363 recovery rule, and forbid extensions when --yacc.
1364 (gram_error): Use complain_at.
1365 * src/reader.c (reader): Exit if there were parse errors.
1366
865b9df1
AD
13672002-07-09 Akim Demaille <akim@epita.fr>
1368
1369 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
1370 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
1371 Reported by R Blake <blakers@mac.com>.
1372
c76e14da
AD
13732002-07-09 Akim Demaille <akim@epita.fr>
1374
1375 * data/yacc.c: Output the copyright notive in the header.
1376
7db2ed2d
AD
13772002-07-03 Akim Demaille <akim@epita.fr>
1378
1379 * src/output.c (froms, tos): Are state_number_t.
1380 (save_column): sp, sp1, and sp2 are state_number_t.
1381 (prepare): Rename `final' as `final_state_number', `nnts' as
1382 `nterms_number', `nrules' as `rules_number', `nstates' as
1383 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
1384 unused.
1385 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
1386 * data/lalr1.cc (nsym_): Remove, unused.
1387
e68e0410
AD
13882002-07-03 Akim Demaille <akim@epita.fr>
1389
1390 * src/lalr.h, src/lalr.c (goto_number_t): New.
1391 * src/lalr.c (goto_list_t): New.
1392 Propagate them.
1393 * src/nullable.c (rule_list_t): New.
1394 Propagate.
1395 * src/types.h: Remove.
1396
e1a4f3a4
AD
13972002-07-03 Akim Demaille <akim@epita.fr>
1398
1399 * src/closure.c (print_fderives): Use rule_rhs_print.
1400 * src/derives.c (print_derives): Use rule_rhs_print.
1401 (rule_list_t): New, replaces `shorts'.
1402 (set_derives): Add comments.
1403 * tests/sets.at (Nullable, Firsts): Adjust.
1404
536545f3
AD
14052002-07-03 Akim Demaille <akim@epita.fr>
1406
1407 * src/output.c (prepare_actions): Free `tally' and `width'.
1408 (prepare_actions): Allocate and free `order'.
1409 * src/symtab.c (symbols_free): Free `symbols'.
1410 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
1411 * src/output.c (m4_invoke): Move to...
1412 * src/scan-skel.l: here.
1413 (<<EOF>>): Close yyout, and free its name.
1414
8b752b00
AD
14152002-07-03 Akim Demaille <akim@epita.fr>
1416
1417 Fix some memory leaks, and fix a bug: state 0 was examined twice.
1418
1419 * src/LR0.c (new_state): Merge into...
1420 (state_list_append): this.
1421 (new_states): Merge into...
1422 (generate_states): here.
1423 (set_states): Don't ensure a proper `errs' state member here, do it...
1424 * src/conflicts.c (conflicts_solve): here.
1425 * src/state.h, src/state.c: Comment changes.
1426 (state_t): Rename member `shifts' as `transitions'.
1427 Adjust all dependencies.
1428 (errs_new): For consistency, also take the values as argument.
1429 (errs_dup): Remove.
1430 (state_errs_set): New.
1431 (state_reductions_set, state_transitions_set): Assert that no
1432 previous value was assigned.
1433 (state_free): New.
1434 (states_free): Use it.
1435 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
1436 temporary storage: use `errs' and `nerrs' as elsewhere.
1437 (set_conflicts): Allocate and free this `errs'.
1438
613f5e1a
AD
14392002-07-02 Akim Demaille <akim@epita.fr>
1440
1441 * lib/libiberty.h: New.
1442 * lib: Update the bitset implementation from upstream.
1443 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
1444 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
1445 * src/main.c: Adjust bitset stats calls.
1446
26e0cadc
PE
14472002-07-01 Paul Eggert <eggert@twinsun.com>
1448
1449 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
1450 char, so that negative chars don't collide with $.
1451
1154cced
AD
14522002-06-30 Akim Demaille <akim@epita.fr>
1453
1454 Have the GLR tests be `warning' checked, and fix the warnings.
1455
1456 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
1457 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
1458 (yyremoveDeletes): `yyi' and `yyj' are size_t.
1459 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
1460 (yyaddDeferredAction): static.
1461 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
1462 (yyreportParseError): yyprefix is const.
1463 yytokenp is used only when verbose.
1464 (yy__GNUC__): Replace with __GNUC__.
1465 (yypdumpstack): yyi is size_t.
1466 (yypreference): Un-yy local variables and arguments, to avoid
1467 clashes with `yyr1'. Anyway, we are not in the user name space.
1468 (yytname_size): be an int, as is compared with ints.
1469 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
1470 Use them.
1471 * tests/cxx-gram.at: Use quotation to protect $1.
1472 Use AT_COMPILE to enable warnings hunts.
1473 Prototype yylex and yyerror.
1474 `Use' argc.
1475 Include `string.h', not `strings.h'.
1476 Produce and prototype stmtMerge only when used.
1477 yylex takes a location.
1478
97650f4e
AD
14792002-06-30 Akim Demaille <akim@epita.fr>
1480
1481 We spend a lot of time in quotearg, in particular when --verbose.
1482
1483 * src/symtab.c (symbol_get): Store a quoted version of the key.
1484 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
1485 Adjust all callers.
1486
d2576365
AD
14872002-06-30 Akim Demaille <akim@epita.fr>
1488
1489 * src/state.h (reductions_t): Rename member `nreds' as num.
1490 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
1491 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
1492
ccaf65bc
AD
14932002-06-30 Akim Demaille <akim@epita.fr>
1494
1495 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
1496 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
1497 (shifts_to): Rename as...
1498 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
1499 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
1500 (TRANSITION_IS_DISABLED, transitions_to): these.
1501
87675353
AD
15022002-06-30 Akim Demaille <akim@epita.fr>
1503
1504 * src/print.c (print_shifts, print_gotos): Merge into...
1505 (print_transitions): this.
1506 (print_transitions, print_errs, print_reductions): Align the
1507 lookaheads columns.
1508 (print_core, print_transitions, print_errs, print_state,
1509 print_grammar): Output empty lines separator before, not after.
1510 (state_default_rule_compute): Rename as...
1511 (state_default_rule): this.
1512 * tests/conflicts.at (Defaulted Conflicted Reduction),
1513 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
1514 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
1515
ce4ccb4b
AD
15162002-06-30 Akim Demaille <akim@epita.fr>
1517
1518 Display items as we display rules.
1519
1520 * src/gram.h, src/gram.c (rule_lhs_print): New.
1521 * src/gram.c (grammar_rules_partial_print): Use it.
1522 * src/print.c (print_core): Likewise.
1523 * tests/conflicts.at (Defaulted Conflicted Reduction),
1524 (Unresolved SR Conflicts): Adjust.
1525 (Unresolved SR Conflicts): Adjust and rename as...
1526 (Resolved SR Conflicts): this, as was meant.
1527 * tests/regression.at (Web2c Report): Adjust.
1528
bc933ef1
AD
15292002-06-30 Akim Demaille <akim@epita.fr>
1530
1531 * src/print.c (state_default_rule_compute): New, extracted from...
1532 (print_reductions): here.
1533 Pessimize, but clarify the code.
1534 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
1535
53d4308d
AD
15362002-06-30 Akim Demaille <akim@epita.fr>
1537
1538 * src/output.c (action_row): Let default_rule be always a rule
1539 number.
1540
574fb2d5
AD
15412002-06-30 Akim Demaille <akim@epita.fr>
1542
1543 * src/closure.c (print_firsts, print_fderives, closure):
1544 Use BITSET_EXECUTE.
1545 * src/lalr.c (lookaheads_print): Likewise.
1546 * src/state.c (state_rule_lookaheads_print): Likewise.
1547 * src/print_graph.c (print_core): Likewise.
1548 * src/print.c (print_reductions): Likewise.
1549 * src/output.c (action_row): Likewise.
1550 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
1551
05811fd7
AD
15522002-06-30 Akim Demaille <akim@epita.fr>
1553
1554 * src/print_graph.c: Use report_flag.
1555
0e4d5753
AD
15562002-06-30 Akim Demaille <akim@epita.fr>
1557
1558 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
1559 to...
1560 * src/relation.h, src/relation.c (traverse, relation_digraph)
1561 (relation_print, relation_transpose): New.
1562
24c7d800
AD
15632002-06-30 Akim Demaille <akim@epita.fr>
1564
1565 * src/state.h, src/state.c (shifts_to): New.
1566 * src/lalr.c (build_relations): Use it.
1567
9222837b
AD
15682002-06-30 Akim Demaille <akim@epita.fr>
1569
1570 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
1571 (item_number_of_rule_number, rule_number_of_item_number): New.
1572 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
1573 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
1574 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
1575 Propagate their use.
1576 Much remains to be done, in particular wrt `shorts' from types.h.
1577
260008e5
AD
15782002-06-30 Akim Demaille <akim@epita.fr>
1579
1580 * src/symtab.c (symbol_new): Initialize the `printer' member.
1581
8a731ca8
AD
15822002-06-30 Akim Demaille <akim@epita.fr>
1583
1584 * src/LR0.c (save_reductions): Remove, replaced by...
1585 * src/state.h, src/state.c (state_reductions_set): New.
1586 (reductions, errs): Rename as...
1587 (reductions_t, errs_t): these.
1588 Adjust all dependencies.
1589
32e1e0a4
AD
15902002-06-30 Akim Demaille <akim@epita.fr>
1591
1592 * src/LR0.c (state_list_t, state_list_append): New.
1593 (first_state, last_state): Now symbol_list_t.
1594 (this_state): Remove.
1595 (new_itemsets, append_states, save_reductions): Take a state_t as
1596 argument.
1597 (set_states, generate_states): Adjust.
1598 (save_shifts): Remove, replaced by...
1599 * src/state.h, src/state.c (state_shifts_set): New.
1600 (shifts): Rename as...
1601 (shifts_t): this.
1602 Adjust all dependencies.
1603 * src/state.h (state_t): Remove the `next' member.
1604
e5fb6710
AD
16052002-06-30 Akim Demaille <akim@epita.fr>
1606
1607 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
1608 escaped in slot 0.
1609
c7ca99d4
AD
16102002-06-30 Akim Demaille <akim@epita.fr>
1611
1612 Use hash.h for the state hash table.
1613
1614 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
1615 (allocate_storage): Use state_hash_new.
1616 (free_storage): Use state_hash_free.
1617 (new_state, get_state): Adjust.
1618 * src/lalr.h, src/lalr.c (states): Move to...
1619 * src/states.h (state_t): Remove the `link' member, no longer
1620 used.
1621 * src/states.h, src/states.c: here.
1622 (state_hash_new, state_hash_free, state_hash_lookup)
1623 (state_hash_insert, states_free): New.
1624 * src/states.c (state_table, state_compare, state_hash): New.
1625 * src/output.c (output_actions): Do not free states now, since we
1626 still need to know the final_state number in `prepare', called
1627 afterwards. Do it...
1628 * src/main.c (main): here: call states_free after `output'.
1629
df0e7316
AD
16302002-06-30 Akim Demaille <akim@epita.fr>
1631
1632 * src/state.h, src/state.c (state_new): New, extracted from...
1633 * src/LR0.c (new_state): here.
1634 * src/state.h (STATE_ALLOC): Move to...
1635 * src/state.c: here.
1636 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
1637 * src/state.h, src/state.c: here.
1638
39f41916
AD
16392002-06-30 Akim Demaille <akim@epita.fr>
1640
1641 * src/reader.c (gensym): Rename as...
1642 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
1643 (getsym): Rename as...
1644 (symbol_get): this.
1645
d57650a5
AD
16462002-06-30 Akim Demaille <akim@epita.fr>
1647
1648 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
1649 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
1650 * src/output.c, src/print.c, src/print_graph.c: Propagate.
1651 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
1652
5a08f1ce
AD
16532002-06-30 Akim Demaille <akim@epita.fr>
1654
1655 Make the test suite pass with warnings checked.
1656
1657 * tests/actions.at (Printers and Destructors): Improve.
1658 Avoid unsigned vs. signed issues.
1659 * tests/calc.at: Don't exercise the scanner here, do it...
1660 * tests/input.at (Torturing the Scanner): here.
1661
720623af
PH
16622002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1663
88e7e941 1664 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
1665 reorganize first lines parallel to yacc.c.
1666
fb8135fa
AD
16672002-06-28 Akim Demaille <akim@epita.fr>
1668
1669 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
1670 (b4_token_enum, b4_token_defines): New, factored from...
1671 * data/lalr1.cc, data/yacc.c, glr.c: here.
1672
41442480
AD
16732002-06-28 Akim Demaille <akim@epita.fr>
1674
1675 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
1676 unused variables.
1677 * src/output.c (merger_output): static.
1678
e0e5bf84
AD
16792002-06-28 Akim Demaille <akim@epita.fr>
1680
1681 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
1682 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
1683 pacify GCC.
1684 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 1685
676385e2
PH
16862002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1687
1688 Accumulated changelog for new GLR parsing features.
1689
6a254321 1690 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
1691 conflicts_total_count.
1692 * src/conflicts.h: Ditto.
1693 * src/output.c (token_actions): Use the new name.
1694 (output_conflicts): Change conflp => conflict_list_heads, and
1695 confl => conflict_list for better readability.
1696 * data/glr.c: Use the new names.
1697 * NEWS: Add self to GLR announcement.
e0e5bf84 1698
676385e2
PH
1699 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
1700
1701 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
1702 Akim Demaille.
1703
1704 * data/bison.glr: Change name to glr.c
1705 * data/glr.c: Renamed from bison.glr.
1706 * data/Makefile.am: Add glr.c
e0e5bf84
AD
1707
1708 * src/getargs.c:
1709
676385e2
PH
1710 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
1711 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 1712
676385e2
PH
1713 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1714
1715 * data/bison.glr: Be sure to restore the
1716 current #line when returning to the skeleton contents after having
1717 exposed the input file's #line.
1718
1719 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1720
1721 * data/bison.glr: Bring up to date with changes to bison.simple.
1722
1723 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1724
1725 * data/bison.glr: Correct definitions that use b4_prefix.
1726 Various reformatting.
1727 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
1728 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
1729 yytokenp argument; now part of stack.
1730 (yychar): Define to behave as documented.
1731 (yyclearin): Ditto.
e0e5bf84 1732
676385e2
PH
1733 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1734
1735 * src/reader.h: Add declaration for free_merger_functions.
1736
1737 * src/reader.c (merge_functions): New variable.
1738 (get_merge_function): New function.
1739 (free_merger_functions): New function.
1740 (readgram): Check for %prec that is not followed by a symbol.
1741 Handle %dprec and %merge declarations.
1742 (packgram): Initialize dprec and merger fields in rules array.
1743
1744 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
1745 conflict_list_cnt, conflict_list_free): New variables.
1746 (table_grow): Also grow conflict_table.
e0e5bf84 1747 (prepare_rules): Output dprec and merger tables.
676385e2 1748 (conflict_row): New function.
e0e5bf84 1749 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
1750 default reduction in conflicted states for GLR parser so that there
1751 are spaces for the conflict lists.
1752 (save_row): Also save conflict information.
1753 (token_actions): Allocate conflict list.
1754 (merger_output): New function.
1755 (pack_vector): Pack conflict table, too.
1756 (output_conflicts): New function to output yyconflp and yyconfl.
1757 (output_check): Allocate conflict_tos.
1758 (output_actions): Output conflict tables, also.
1759 (output_skeleton): Output b4_mergers definition.
1760 (prepare): Output b4_max_rhs_length definition.
1761 Use 'bison.glr' as default skeleton for GLR parsers.
1762
1763 * src/gram.c (glr_parser): New flag.
1764 (grammar_free): Call free_merger_functions.
1765
1766 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
1767 all pairs of conflicting reductions, rather than just all tokens
1768 causing conflicts. Needed to size conflict tables.
e0e5bf84 1769 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
1770 interface.
1771 (conflicts_print): Ditto.
1772 (count_total_conflicts): New function.
1773
1774 * src/reader.h (merger_list): New type.
1775 (merge_functions): New variable.
1776
1777 * src/lex.h (tok_dprec, tok_merge): New token types.
1778
1779 * src/gram.h (rule_s): Add dprec and merger fields.
1780 (glr_parser): New flag.
1781
1782 * src/conflicts.h (count_total_conflicts): New function.
1783
1784 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
1785
1786 * doc/bison.texinfo (Generalized LR Parsing): New section.
1787 (GLR Parsers): New section.
1788 (Language and Grammar): Mention GLR parsing.
1789 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
1790 Correct typo ("tge" -> "the").
1791
1792 * data/bison.glr: New skeleton for GLR parsing.
1793
1794 * tests/cxx-gram.at: New tests for GLR parsing.
1795
1796 * tests/testsuite.at: Include cxx-gram.at.
1797
1798 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 1799
676385e2
PH
1800 * src/parse-gram.y:
1801
1802 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
1803
1804 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 1805
b5480d74 18062002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
1807
1808 * src/options.h, src/options.c: Remove.
1809 * src/getargs.c (short_options, long_options): New.
1810
60491a94
AD
18112002-06-27 Akim Demaille <akim@epita.fr>
1812
1813 * data/bison.simple, data/bison.c++: Rename as...
1814 * data/yacc.c, data/lalr1.cc: these.
1815 * doc/bison.texinfo (Environment Variables): Remove.
1816
9be0c25b
AD
18172002-06-25 Raja R Harinath <harinath@cs.umn.edu>
1818
1819 * src/getargs.c (report_argmatch): Initialize strtok().
1820
1ae72863
AD
18212002-06-20 Akim Demaille <akim@epita.fr>
1822
1823 * data/bison.simple (b4_symbol_actions): New, replaces...
1824 (b4_symbol_destructor, b4_symbol_printer): these.
1825 (yysymprint): Be sure to call YYPRINT only for tokens, and using
1826 user token numbers.
1827
87542d29
AD
18282002-06-20 Akim Demaille <akim@epita.fr>
1829
1830 * data/bison.simple (yydestructor): Rename as...
1831 (yydestruct): this.
1832
1a31ed21
AD
18332002-06-20 Akim Demaille <akim@epita.fr>
1834
1835 * src/symtab.h, src/symtab.c (symbol_type_set)
1836 (symbol_destructor_set, symbol_precedence_set): The location is
1837 the last argument.
1838 Adjust all callers.
1839
e776192e
AD
18402002-06-20 Akim Demaille <akim@epita.fr>
1841
1842 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
1843 internals.
1844 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
1845 Takes a location.
1846 * src/symtab.h, src/symtab.c (symbol_class_set)
1847 (symbol_user_token_number_set): Likewise.
1848 Adjust all callers.
1849 Promote complain_at.
1850 * tests/input.at (Type Clashes): Adjust.
1851
5c1180b3
AD
18522002-06-20 Akim Demaille <akim@epita.fr>
1853
1854 * data/bison.simple (YYLEX): Fix the declaration when
1855 %pure-parser.
1856
e3170060
AD
18572002-06-20 Akim Demaille <akim@epita.fr>
1858
1859 * data/bison.simple (yysymprint): Don't print the token number,
1860 just its name.
1861 * tests/actions.at (Destructors): Rename as...
1862 (Printers and Destructors): this.
1863 Also exercise %printer.
1864
253862fd
AD
18652002-06-20 Akim Demaille <akim@epita.fr>
1866
1867 * data/bison.simple (YYDSYMPRINT): New.
1868 Use it to remove many of the #if YYDEBUG/if (yydebug).
1869
366eea36
AD
18702002-06-20 Akim Demaille <akim@epita.fr>
1871
1872 * src/symtab.h, src/symtab.c (symbol_t): printer and
1873 printer_location are new members.
1874 (symbol_printer_set): New.
1875 * src/parse-gram.y (PERCENT_PRINTER): New token.
1876 Handle its associated rule.
1877 * src/scan-gram.l: Adjust.
1878 (handle_destructor_at, handle_destructor_dollar): Rename as...
1879 (handle_symbol_code_at, handle_symbol_code_dollar): these.
1880 * src/output.c (symbol_printers_output): New.
1881 (output_skeleton): Call it.
1882 * data/bison.simple (yysymprint): New. Cannot be named yyprint
1883 since there are already many grammar files with a user `yyprint'.
1884 Replace the calls to YYPRINT to calls to yysymprint.
1885 * tests/calc.at: Adjust.
1886 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
1887 taking advantage of parser very internal details (stack size!).
1888
4f25ebb0
AD
18892002-06-20 Akim Demaille <akim@epita.fr>
1890
1891 * src/scan-gram.l: Complete the scanner with the missing patterns
1892 to pacify Flex.
1893 Use `quote' and `symbol_tag_get' where appropriate.
1894
93b68a0e
AD
18952002-06-19 Akim Demaille <akim@epita.fr>
1896
1897 * tests/actions.at (Destructors): Augment to test locations.
1898 * data/bison.simple (yydestructor): Pass it the current location
1899 if locations are enabled.
1900 Prototype only when __STDC__ or C++.
1901 Change the argument names to move into the yy name space: there is
1902 user code here.
1903
58612f1d
AD
19042002-06-19 Akim Demaille <akim@epita.fr>
1905
74310291
AD
1906 * data/bison.simple (b4_pure_if): New.
1907 Use it instead of #ifdef YYPURE.
1908
19092002-06-19 Akim Demaille <akim@epita.fr>
1910
1911 * data/bison.simple (b4_location_if): New.
58612f1d
AD
1912 Use it instead of #ifdef YYLSP_NEEDED.
1913
f25bfb75
AD
19142002-06-19 Akim Demaille <akim@epita.fr>
1915
1916 Prepare @$ in %destructor, but currently don't bind it in the
1917 skeleton, as %location use is not cleaned up yet.
1918
1919 * src/scan-gram.l (handle_dollar, handle_destructor_at)
1920 (handle_action_at): New.
1921 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
1922 a braced_code_t and a location as additional arguments.
1923 (handle_destructor_dollar): Instead of requiring `b4_eval', just
1924 unquote one when outputting `b4_dollar_dollar'.
1925 Adjust callers.
1926 * data/bison.simple (b4_eval): Remove.
1927 (b4_symbol_destructor): Adjust.
1928 * tests/input.at (Invalid @n): Adjust.
1929
c732d2c6
AD
19302002-06-19 Zack Weinberg <zack@codesourcery.com>
1931
1932 * doc/bison.texinfo: Document ability to have multiple
1933 prologue sections.
1934
8c165d89
AD
19352002-06-18 Akim Demaille <akim@epita.fr>
1936
1937 * src/files.c (compute_base_names): When computing the output file
1938 names from the input file name, strip the directory part.
1939
ca98bf57
AD
19402002-06-18 Akim Demaille <akim@epita.fr>
1941
1942 * data/bison.simple.new: Comment changes.
1943 Reported by Andreas Schwab.
1944
0bfb02ff
AD
19452002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
1946
1947 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
1948 there are no `label `yyoverflowlab' defined but not used' warnings
1949 when yyoverflow is defined.
1950
24c0aad7
AD
19512002-06-18 Akim Demaille <akim@epita.fr>
1952
1953 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
1954 new member.
1955 (symbol_destructor_set): Adjust.
1956 * src/output.c (symbol_destructors_output): Output the destructor
1957 locations.
1958 Output the symbol name.
1959 * data/bison.simple (b4_symbol_destructor): Adjust.
1960
5719c109
AD
19612002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
1962 and Akim Demaille <akim@epita.fr>
1963
1964 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
1965 what's left on the stack when the error recovery hits EOF.
1966 * tests/actions.at (Destructors): Complete to exercise this case.
1967
9280d3ef
AD
19682002-06-17 Akim Demaille <akim@epita.fr>
1969
1970 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
1971 arguments is really empty, not only equal to `[]'.
1972 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
1973 member.
1974 (symbol_destructor_set): New.
1975 * src/output.c (symbol_destructors_output): New.
1976 * src/reader.h (brace_code_t, current_braced_code): New.
1977 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
1978 (handle_dollar): Rename as...
1979 (handle_action_dollar): this.
1980 (handle_destructor_dollar): New.
1981 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
1982 (grammar_declaration): Use it.
1983 * data/bison.simple (yystos): Is always defined.
1984 (yydestructor): New.
1985 * tests/actions.at (Destructors): New.
1986 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
1987
dafdc66f
AD
19882002-06-17 Akim Demaille <akim@epita.fr>
1989
1990 * src/symlist.h, src/symlist.c (symbol_list_length): New.
1991 * src/scan-gram.l (handle_dollar, handle_at): Compute the
1992 rule_length only when needed.
1993 * src/output.c (actions_output, token_definitions_output): Output
1994 the full M4 block.
1995 * src/symtab.c: Don't access directly to the symbol tag, use
1996 symbol_tag_get.
1997 * src/parse-gram.y: Use symbol_list_free.
1998
56c47203
AD
19992002-06-17 Akim Demaille <akim@epita.fr>
2000
2001 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
2002 (symbol_list_prepend, get_type_name): Move to...
2003 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
2004 (symbol_list_prepend, symbol_list_n_type_name_get): here.
2005 Adjust all callers.
2006 (symbol_list_free): New.
2007 * src/scan-gram.l (handle_dollar): Takes a location.
2008 * tests/input.at (Invalid $n): Adjust.
2009
1e0bab92
AD
20102002-06-17 Akim Demaille <akim@epita.fr>
2011
2012 * src/reader.h, src/reader.c (symbol_list_new): Export it.
2013 (symbol_list_prepend): New.
2014 * src/parse-gram.y (%union): `list' is a new member.
2015 (symbols.1): New, replaces...
2016 (terms_to_prec.1, nterms_to_type.1): these.
2017 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
2018 Take a location as additional argument.
2019 Adjust all callers.
2020
04e60654
AD
20212002-06-15 Akim Demaille <akim@epita.fr>
2022
2023 * src/parse-gram.y: Move %token in the declaration section so that
2024 we don't depend upon CVS Bison.
2025
10e5b8bd
AD
20262002-06-15 Akim Demaille <akim@epita.fr>
2027
2028 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
2029 * src/print.c (print_core): Use it.
2030
9801d40c
AD
20312002-06-15 Akim Demaille <akim@epita.fr>
2032
2033 * src/conflicts.c (log_resolution): Accept the rule involved in
2034 the sr conflicts instead of the lookahead number that points to
2035 that rule.
2036 (flush_reduce): Accept the current lookahead vector as argument,
2037 instead of the index in LA.
2038 (resolve_sr_conflict): Accept the current number of lookahead
2039 bitset to consider for the STATE, instead of the index in LA.
2040 (set_conflicts): Adjust.
2041 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
2042
c0263492
AD
20432002-06-15 Akim Demaille <akim@epita.fr>
2044
2045 * src/state.h (state_t): Replace the `lookaheadsp' member, a
2046 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
2047 Adjust all dependencies.
2048 * src/lalr.c (initialize_lookaheads): Split into...
2049 (states_lookaheads_count, states_lookaheads_initialize): these.
2050 (lalr): Adjust.
2051
9757c359
AD
20522002-06-15 Akim Demaille <akim@epita.fr>
2053
2054 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
2055 out of...
2056 (grammar_rules_print): here.
2057 * src/reduce.c (reduce_output): Use it.
2058 * tests/reduce.at (Useless Rules, Reduced Automaton)
2059 (Underivable Rules): Adjust.
2060
6b98e4b5
AD
20612002-06-15 Akim Demaille <akim@epita.fr>
2062
2063 Copy BYacc's nice way to report the grammar.
2064
2065 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
2066 New.
2067 Don't print the rules' location, it is confusing and useless.
2068 (rule_print): Use grammar_rhs_print.
2069 * src/print.c (print_grammar): Use grammar_rules_print.
2070
6b98e4b5
AD
20712002-06-15 Akim Demaille <akim@epita.fr>
2072
2073 Complete and rationalize `useless thing' warnings.
2074
2075 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
2076 (symbol_tag_print): New.
2077 Use them everywhere in place of accessing directly the tag member.
2078 * src/gram.h, src/gram.c (rule_print): New.
2079 Use it where a rule used to be printed `by hand'.
2080 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
2081 (reduce_grammar_tables): Report the useless rules.
2082 (reduce_print): Useless things are a warning, not an error.
2083 Report it as such.
2084 * tests/reduce.at (Useless Nonterminals, Useless Rules):
2085 (Reduced Automaton, Underivable Rules): Adjust.
2086 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
2087 * tests/conflicts.at (Unresolved SR Conflicts)
2088 (Solved SR Conflicts): Adjust.
2089
ee000ba4
AD
20902002-06-15 Akim Demaille <akim@epita.fr>
2091
2092 Let symbols have a location.
2093
2094 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
2095 (getsym): Adjust.
2096 Adjust all callers.
2097 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
2098 Use location_t, not int.
2099 * src/symtab.c (symbol_check_defined): Take advantage of the
2100 location.
2101 * tests/regression.at (Invalid inputs): Adjust.
2102
8efe435c
AD
21032002-06-15 Akim Demaille <akim@epita.fr>
2104
2105 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
2106 (input): Don't try to initialize yylloc here, do it in the
2107 scanner.
2108 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
2109 * src/gram.h (rule_t): Change line and action_line into location
2110 and action_location, of location_t type.
2111 Adjust all dependencies.
2112 * src/location.h, src/location.c (empty_location): New.
2113 * src/reader.h, src/reader.c (grammar_start_symbol_set)
2114 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
2115 (grammar_current_rule_symbol_append)
2116 (grammar_current_rule_action_append): Expect a location as argument.
2117 * src/reader.c (grammar_midrule_action): Adjust to attach an
2118 action's location as dummy symbol location.
2119 * src/symtab.h, src/symtab.c (startsymbol_location): New.
2120 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
2121 the line numbers.
2122
1921f1d7
AD
21232002-06-14 Akim Demaille <akim@epita.fr>
2124
2125 Grammar declarations may be found in the grammar section.
2126
2127 * src/parse-gram.y (rules_or_grammar_declaration): New.
2128 (declarations): Each declaration may end with a semicolon, not
2129 just...
2130 (grammar_declaration): `"%union"'.
2131 (grammar): Branch to rules_or_grammar_declaration.
2132
4515534c
AD
21332002-06-14 Akim Demaille <akim@epita.fr>
2134
2135 * src/main.c (main): Invoke scanner_free.
2136
f958596b
AD
21372002-06-14 Akim Demaille <akim@epita.fr>
2138
2139 * src/output.c (m4_invoke): Extracted from...
2140 (output_skeleton): here.
2141 Free tempfile.
2142
2c569025
AD
21432002-06-14 Akim Demaille <akim@epita.fr>
2144
2145 * src/parse-gram.y (directives, directive, gram)
2146 (grammar_directives, precedence_directives, precedence_directive):
2147 Rename as...
2148 (declarations, declaration, grammar, grammar_declaration)
2149 (precedence_declaration, precedence_declarator): these.
2150 (symbol_declaration): New.
2151
592e8d4d
AD
21522002-06-14 Akim Demaille <akim@epita.fr>
2153
2154 * src/files.c (action_obstack): Remove, unused.
2155 (output_obstack): Remove it, and all its dependencies, as it is no
2156 longer needed.
2157 * src/reader.c (epilogue_set): Build the epilogue in the
2158 muscle_obstack.
2159 * src/output.h, src/output.c (muscle_obstack): Move to...
2160 * src/muscle_tab.h, src/muscle_tab.h: here.
2161 (muscle_init): Initialize muscle_obstack.
2162 (muscle_free): New.
2163 * src/main.c (main): Call it.
2164
0c15323d
AD
21652002-06-14 Akim Demaille <akim@epita.fr>
2166
2167 * src/location.h: New, extracted from...
2168 * src/reader.h: here.
2169 * src/Makefile.am (noinst_HEADERS): Merge into
2170 (bison_SOURCES): this.
2171 Add location.h.
2172 * src/parse-gram.y: Use location_t instead of Bison's.
2173 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
2174 Use location_t instead of ints.
2175
e96c9728
AD
21762002-06-14 Akim Demaille <akim@epita.fr>
2177
2178 * data/bison.simple, data/bison.c++: Be sure to restore the
2179 current #line when returning to the skeleton contents after having
2180 exposed the input file's #line.
2181
75d1fe16
AD
21822002-06-12 Akim Demaille <akim@epita.fr>
2183
2184 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
2185 eager.
2186 * tests/actions.at (Exotic Dollars): New.
2187
6c35d22c
AD
21882002-06-12 Akim Demaille <akim@epita.fr>
2189
2190 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
2191 ['"/] too eagerly.
2192 * tests/input.at (Torturing the Scanner): New.
2193
1d6412ad
AD
21942002-06-11 Akim Demaille <akim@epita.fr>
2195
2196 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
2197 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
2198 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
2199 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
2200 * src/reader.c (reader): Use it.
2201
4cdb01db
AD
22022002-06-11 Akim Demaille <akim@epita.fr>
2203
2204 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
2205 Adjust all callers.
2206 (scanner_last_string_free): New.
2207
44995b2e
AD
22082002-06-11 Akim Demaille <akim@epita.fr>
2209
2210 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
2211 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
2212 (last_string, YY_OBS_FREE): New.
2213 Use them when returning an ID.
2214
e9955c83
AD
22152002-06-11 Akim Demaille <akim@epita.fr>
2216
2217 Have Bison grammars parsed by a Bison grammar.
2218
2219 * src/reader.c, src/reader.h (prologue_augment): New.
2220 * src/reader.c (copy_definition): Remove.
2221
2222 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
2223 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
2224 (grammar_current_rule_prec_set, grammar_current_rule_check)
2225 (grammar_current_rule_symbol_append)
2226 (grammar_current_rule_action_append): Export.
2227 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
2228 (symbol_list_action_append): Remove.
2229 Hook the routines from reader.
2230 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
2231 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
2232
2233 * src/reader.c (read_declarations): Remove, unused.
2234
2235 * src/parse-gram.y: Handle the epilogue.
2236 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
2237 (grammar_start_symbol_set): this.
2238 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
2239 * src/reader.c (readgram): Remove, unused.
2240 (reader): Adjust to insert eoftoken and axiom where appropriate.
2241
2242 * src/reader.c (copy_dollar): Replace with...
2243 * src/scan-gram.h (handle_dollar): this.
2244 * src/parse-gram.y: Remove `%thong'.
2245
2246 * src/reader.c (copy_at): Replace with...
2247 * src/scan-gram.h (handle_at): this.
2248
2249 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
2250 New.
2251
2252 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
2253 time being.
2254
2255 * src/reader.h, src/reader.c (grammar_rule_end): New.
2256
2257 * src/parse.y (current_type, current_class): New.
2258 Implement `%nterm', `%token' support.
2259 Merge `%term' into `%token'.
2260 (string_as_id): New.
2261 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
2262 type name.
2263
2264 * src/parse-gram.y: Be sure to handle properly the beginning of
2265 rules.
2266
2267 * src/parse-gram.y: Handle %type.
2268 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
2269
2270 * src/parse-gram.y: More directives support.
2271 * src/options.c: No longer handle source directives.
2272
2273 * src/parse-gram.y: Fix %output.
2274
2275 * src/parse-gram.y: Handle %union.
2276 Use the prologue locations.
2277 * src/reader.c (parse_union_decl): Remove.
2278
2279 * src/reader.h, src/reader.c (epilogue_set): New.
2280 * src/parse-gram.y: Use it.
2281
2282 * data/bison.simple, data/bison.c++: b4_stype is now either not
2283 defined, then default to int, or to the contents of %union,
2284 without `union' itself.
2285 Adjust.
2286 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
2287
2288 * src/output.c (actions_output): Don't output braces, as they are
2289 already handled by the scanner.
2290
2291 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
2292 characters to themselves.
2293
2294 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
2295 that the epilogue has a proper #line.
2296
2297 * src/parse-gram.y: Handle precedence/associativity.
2298
2299 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
2300 a terminal.
2301 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
2302 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
2303 at all to define terminals that cannot be emitted.
2304
2305 * src/scan-gram.l: Escape M4 characters.
2306
2307 * src/scan-gram.l: Working properly with escapes in user
2308 strings/characters.
2309
2310 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
2311 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
2312 grammar.
2313 Use more modest sizes, as for the time being the parser does not
2314 release memory, and therefore the process swallows a huge amount
2315 of memory.
2316
2317 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
2318 stricter %token grammar.
2319
2320 * src/symtab.h (associativity): Add `undef_assoc'.
2321 (symbol_precedence_set): Do nothing when passed an undef_assoc.
2322 * src/symtab.c (symbol_check_alias_consistence): Adjust.
2323
2324 * tests/regression.at (Invalid %directive): Remove, as it is now
2325 meaningless.
2326 (Invalid inputs): Adjust to the new error messages.
2327 (Token definitions): The new grammar doesn't allow too many
2328 eccentricities.
2329
2330 * src/lex.h, src/lex.c: Remove.
2331 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
2332 (copy_character, copy_string2, copy_string, copy_identifier)
2333 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
2334 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
2335 (parse_action): Remove.
2336 * po/POTFILES.in: Adjust.
2337
2e047461
AD
23382002-06-11 Akim Demaille <akim@epita.fr>
2339
2340 * src/reader.c (parse_action): Don't store directly into the
2341 rule's action member: return the action as a string.
2342 Don't require `rule_length' as an argument: compute it.
2343 (grammar_current_rule_symbol_append)
2344 (grammar_current_rule_action_append): New, eved out from
2345 (readgram): here.
2346 Remove `action_flag', `rulelength', unused now.
2347
9af3fbce
AD
23482002-06-11 Akim Demaille <akim@epita.fr>
2349
2350 * src/reader.c (grammar_current_rule_prec_set).
2351 (grammar_current_rule_check): New, eved out from...
2352 (readgram): here.
2353 Remove `xaction', `first_rhs': useless.
2354 * tests/input.at (Type clashes): New.
2355 * tests/existing.at (GNU Cim Grammar): Adjust.
2356
1485e106
AD
23572002-06-11 Akim Demaille <akim@epita.fr>
2358
2359 * src/reader.c (grammar_midrule_action): New, Eved out from
2360 (readgram): here.
2361
da4160c3
AD
23622002-06-11 Akim Demaille <akim@epita.fr>
2363
2364 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
2365 New.
2366 (readgram): Use them as replacement of inlined code, crule and
2367 crule1.
2368
f6d0f937
AD
23692002-06-11 Akim Demaille <akim@epita.fr>
2370
2371 * src/reader.c (grammar_end, grammar_symbol_append): New.
2372 (readgram): Use them.
2373 Make the use of `p' as local as possible.
2374
69078d4b
AD
23752002-06-10 Akim Demaille <akim@epita.fr>
2376
2377 GCJ's parser requires the tokens to be defined before the prologue.
2378
2379 * data/bison.simple: Output the token definition before the user's
2380 prologue.
2381 * tests/regression.at (Braces parsing, Duplicate string)
2382 (Mixing %token styles): Check the output from bison.
2383 (Early token definitions): New.
2384
5e424082
AD
23852002-06-10 Akim Demaille <akim@epita.fr>
2386
2387 * src/symtab.c (symbol_user_token_number_set): Don't complain when
2388 assigning twice the same user number to a token, so that we can
2389 use it in...
2390 * src/lex.c (lex): here.
2391 Also use `symbol_class_set' instead of hand written code.
2392 * src/reader.c (parse_assoc_decl): Likewise.
2393
44536b35
AD
23942002-06-10 Akim Demaille <akim@epita.fr>
2395
2396 * src/symtab.c, src/symtab.c (symbol_class_set)
2397 (symbol_user_token_number_set): New.
2398 * src/reader.c (parse_token_decl): Use them.
2399 Use a switch instead of ifs.
2400 Use a single argument.
2401
8b9f2372
AD
24022002-06-10 Akim Demaille <akim@epita.fr>
2403
2404 Remove `%thong' support as it is undocumented, unused, duplicates
2405 `%token's job, and creates useless e-mail traffic with people who
2406 want to know what it is, why it is undocumented, unused, and
2407 duplicates `%token's job.
2408
2409 * src/reader.c (parse_thong_decl): Remove.
2410 * src/options.c (option_table): Remove "thong".
2411 * src/lex.h (tok_thong): Remove.
2412
3ae2b51f
AD
24132002-06-10 Akim Demaille <akim@epita.fr>
2414
2415 * src/symtab.c, src/symtab.c (symbol_type_set)
2416 (symbol_precedence_set): New.
2417 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
2418 (value_components_used): Remove, unused.
2419
2f1afb73
AD
24202002-06-09 Akim Demaille <akim@epita.fr>
2421
2422 Move symbols handling code out of the reader.
2423
2424 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
2425 (axiom): Move to...
2426 * src/symtab.h, src/symtab.c: here.
2427
2428 * src/gram.c (start_symbol): Remove: use startsymbol->number.
2429 * src/reader.c (startval): Rename as...
2430 * src/symtab.h, src/symtab.c (startsymbol): this.
2431 * src/reader.c: Adjust.
2432
2433 * src/reader.c (symbol_check_defined, symbol_make_alias)
2434 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
2435 (token_translations_init)
2436 Move to...
2437 * src/symtab.c: here.
2438 * src/reader.c (packsymbols): Move to...
2439 * src/symtab.h, src/symtab.c (symbols_pack): here.
2440 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
2441 argument.
2442
e9bca3ad
AD
24432002-06-03 Akim Demaille <akim@epita.fr>
2444
2445 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
2446 then statements.
2447
86eff183
AD
24482002-06-03 Akim Demaille <akim@epita.fr>
2449
2450 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
2451 structs with non literals.
2452 * src/scan-skel.l: never-interactive.
2453 * src/conflicts.c (enum conflict_resolution_e): No trailing
2454 comma.
2455 * src/getargs.c (usage): Split long literal strings.
2456 Reported by Hans Aberg.
2457
717be197
AD
24582002-05-28 Akim Demaille <akim@epita.fr>
2459
2460 * data/bison.c++: Use C++ ostreams.
2461 (cdebug_): New member.
2462
670ddffd
AD
24632002-05-28 Akim Demaille <akim@epita.fr>
2464
2465 * src/output.c (output_skeleton): Be sure to allocate enough room
2466 for `/' _and_ for `\0' in full_skeleton.
2467
769b430f
AD
24682002-05-28 Akim Demaille <akim@epita.fr>
2469
2470 * data/bison.c++: Catch up with bison.simple:
2471 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2472 and Paul Eggert <eggert@twinsun.com>: `error' handing.
2473 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
2474 and popping traces.
2475
7067cb36
PH
24762002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2477
2478 * src/output.c (output_skeleton): Put an explicit path in front of
2479 the skeleton file name, rather than relying on the -I directory,
2480 to partially alleviate effects of having a skeleton file lying around
2481 in the current directory.
769b430f 2482
4a713ec2
PH
24832002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2484
769b430f 2485 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
2486 obstack_printf should be obstack_fgrow1.
2487
b408954b
AD
24882002-05-26 Akim Demaille <akim@epita.fr>
2489
2490 * src/state.h (state_t): `solved_conflicts' is a new member.
2491 * src/LR0.c (new_state): Set it to 0.
2492 * src/conflicts.h, src/conflicts.c (print_conflicts)
2493 (free_conflicts, solve_conflicts): Rename as...
2494 (conflicts_print, conflicts_free, conflicts_solve): these.
2495 Adjust callers.
2496 * src/conflicts.c (enum conflict_resolution_e)
2497 (solved_conflicts_obstack): New, used by...
2498 (log_resolution): this.
2499 Adjust to attach the conflict resolution to each state.
2500 Complete the description with the precedence/associativity
2501 information.
2502 (resolve_sr_conflict): Adjust.
2503 * src/print.c (print_state): Output its solved_conflicts.
2504 * tests/conflicts.at (Unresolved SR Conflicts)
2505 (Solved SR Conflicts): Exercise --report=all.
2506
a49aecd5
AD
25072002-05-26 Akim Demaille <akim@epita.fr>
2508
2509 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2510 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
2511 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
2512 (token_number_t, item_number_as_token_number)
2513 (token_number_as_item_number, muscle_insert_token_number_table):
2514 Rename as...
2515 (symbol_number_t, item_number_as_symbol_number)
2516 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
2517 these, since it is more appropriate.
2518
5504898e
AD
25192002-05-26 Akim Demaille <akim@epita.fr>
2520
2521 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
2522 `Error:' lines.
2523 * data/bison.simple (yystos) [YYDEBUG]: New.
2524 (yyparse) [YYDEBUG]: Display the symbols which are popped during
2525 error recovery.
2526 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
2527
ec3bc396
AD
25282002-05-25 Akim Demaille <akim@epita.fr>
2529
2530 * doc/bison.texinfo (Debugging): Split into...
2531 (Tracing): this new section, its former contents, and...
2532 (Understanding): this new section.
2533 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
2534 by...
2535 (report_flag): this.
2536 Adjust all dependencies.
2537 (report_args, report_types, report_argmatch): New.
2538 (usage, getargs): Report/support -r, --report.
2539 * src/options.h
2540 (struct option_table_struct): Rename as..,
2541 (struct option_table_s): this.
2542 Rename the `set_flag' member to `flag' to match with getopt_long's
2543 struct.
2544 * src/options.c (option_table): Split verbose into an entry for
2545 %verbose, and another for --verbose.
2546 Support --report/-r, so remove -r from the obsolete --raw.
2547 * src/print.c: Attach full item sets and lookaheads reports to
2548 report_flag instead of trace_flag.
2549 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
2550
78df8250
PE
25512002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2552 and Paul Eggert <eggert@twinsun.com>
769b430f 2553
78df8250
PE
2554 * data/bison.simple (yyparse): Correct error handling to conform to
2555 POSIX and yacc. Specifically, after syntax error is discovered,
2556 do not reduce further before shifting the error token.
2557 Clean up the code a bit by removing the labels yyerrdefault,
2558 yyerrhandle, yyerrpop.
2559 * NEWS: Document the above.
2560
c0c9ea05
PH
25612002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2562
2563 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
2564 type; it isn't always big enough, since it doesn't necessarily
2565 include non-terminals.
769b430f 2566 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
2567 the latter can be removed.
2568 (yy_token_number_type): Remove, only one use.
2569 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
2570 don't use TokenNumberType as element type.
769b430f 2571
c0c9ea05
PH
2572 * tests/regression.at: Modify expected output to agree with change
2573 to yyr1 and yytranslate.
769b430f 2574
6390a83f
FK
25752002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
2576
2577 * src/reader.c (parse_action): Use copy_character instead of
2578 obstack_1grow.
2579
db7c8e9a
AD
25802002-05-13 Akim Demaille <akim@epita.fr>
2581
2582 * tests/regression.at (Token definitions): Prototype yylex and
2583 yyerror.
2584
fcc61800
PH
25852002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2586
158c687b 2587 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
2588 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
2589 32-bit arithmetic.
2590 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
2591
5683e9b2
AD
25922002-05-07 Akim Demaille <akim@epita.fr>
2593
2594 * tests/synclines.at: Be sure to prototype yylex and yyerror to
2595 avoid GCC warnings.
2596
0c2d3f4c
AD
25972002-05-07 Akim Demaille <akim@epita.fr>
2598
2599 Kill GCC warnings.
2600
2601 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
2602 over the RHS of each rule.
2603 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
2604 * src/state.h (state_t): Member `nitems' is unsigned short.
2605 * src/LR0.c (get_state): Adjust.
2606 * src/reader.c (packgram): Likewise.
2607 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
2608 `Type'.
2609 (muscle_insert_int_table): Remove, unused.
2610 (prepare_rules): Remove `max'.
2611
1565b720
AD
26122002-05-06 Akim Demaille <akim@epita.fr>
2613
2614 * src/closure.c (print_firsts): Display of the symbol tags.
2615 (bitmatrix_print): Move to...
2616 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
2617 here.
2618 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
2619
cfaee611
AD
26202002-05-06 Akim Demaille <akim@epita.fr>
2621
2622 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
2623 hash_do_for_each.
2624
458be8e0
AD
26252002-05-06 Akim Demaille <akim@epita.fr>
2626
2627 * src/LR0.c (new_state, get_state): Instead of using the global
2628 `kernel_size' and `kernel_base', have two new arguments:
2629 `core_size' and `core'.
2630 Adjust callers.
2631
a900a624
AD
26322002-05-06 Akim Demaille <akim@epita.fr>
2633
2634 * src/reader.c (packgram): No longer end `ritem' with a 0
2635 sentinel: it is not used.
2636
d4e7d3a1
AD
26372002-05-05 Akim Demaille <akim@epita.fr>
2638
2639 New experimental feature: display the lookaheads in the report and
2640 graph.
2641
2642 * src/print (print_core): When --trace-flag, display the rules
2643 lookaheads.
2644 * src/print_graph.c (print_core): Likewise.
2645 Swap the arguments.
2646 Adjust caller.
2647
39ceb25b
AD
26482002-05-05 Akim Demaille <akim@epita.fr>
2649
2650 * tests/torture.at (Many lookaheads): New test.
2651
5372019f
AD
26522002-05-05 Akim Demaille <akim@epita.fr>
2653
2654 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
2655 (GENERATE_MUSCLE_INSERT_TABLE): this.
2656 (output_int_table, output_unsigned_int_table, output_short_table)
2657 (output_token_number_table, output_item_number_table): Replace with...
2658 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
2659 (muscle_insert_short_table, muscle_insert_token_number_table)
2660 (muscle_insert_item_number_table): these.
2661 Adjust all callers.
2662 (prepare_tokens): Don't free `translations', since...
2663 * src/reader.h, src/reader.c (grammar_free): do it.
2664 Move to...
2665 * src/gram.h, src/gram.c (grammar_free): here.
2666 * data/bison.simple, data/bison.c++: b4_token_number_max is now
2667 b4_translate_max.
2668
5df5f6d5
AD
26692002-05-05 Akim Demaille <akim@epita.fr>
2670
2671 * src/output.c (output_unsigned_int_table): New.
2672 (prepare_rules): `i' is unsigned.
2673 `prhs', `rline', `r2' are unsigned int.
2674 Rename muscle `rhs_number_max' as `rhs_max'.
2675 Output muscles `prhs_max', `rline_max', and `r2_max'.
2676 Free rline and r1.
2677 * data/bison.simple, data/bison.c++: Adjust to use these muscles
2678 to compute types instead of constant types.
2679 * tests/regression.at (Web2c Actions): Adjust.
2680
b87f8b21
AD
26812002-05-04 Akim Demaille <akim@epita.fr>
2682
2683 * src/symtab.h (SALIAS, SUNDEF): Rename as...
2684 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
2685 Adjust dependencies.
2686 * src/output.c (token_definitions_output): Be sure not to output a
2687 `#define 'a'' when fed with `%token 'a' "a"'.
2688 * tests/regression.at (Token definitions): New.
2689
8bb936e4
PE
26902002-05-03 Paul Eggert <eggert@twinsun.com>
2691
2692 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
2693 for K&R C.
2694
26952002-05-03 gettextize <bug-gnu-gettext@gnu.org>
2696
2697 * Makefile.am (SUBDIRS): Remove intl.
2698 (EXTRA_DIST): Add config/config.rpath.
2699
53c71a12
AD
27002002-05-03 Akim Demaille <akim@epita.fr>
2701
2702 * data/bison.simple (m4_if): Don't output empty enums.
2703 And actually, output valid enum definitions :(.
2704
289dd0cf
AD
27052002-05-03 Akim Demaille <akim@epita.fr>
2706
2707 * configure.bat: Remove, completely obsolete.
2708 * Makefile.am (EXTRA_DIST): Adjust.
2709 Don't distribute config.rpath...
2710 * config/Makefile.am (EXTRA_DIST): Do it.
2711
db85e524
AD
27122002-05-03 Akim Demaille <akim@epita.fr>
2713
2714 * configure.in (GETTEXT_VERSION): New.
2715 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
2716
83ccf991
AD
27172002-05-03 Akim Demaille <akim@epita.fr>
2718
2719 * data/bison.simple (b4_token_enum): New.
2720 (b4_token_defines): Use it to output tokens both as #define and
2721 enums.
2722 Suggested by Paul Eggert.
2723 * src/output.c (token_definitions_output): Don't output spurious
2724 white spaces.
2725
1f418995
AD
27262002-05-03 Akim Demaille <akim@epita.fr>
2727
2728 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
2729
45119f04
RA
27302002-05-02 Robert Anisko <robert@lrde.epita.fr>
2731
2732 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
2733 Update the stack class, give a try to deque as the default container.
2734
b2d52318
AD
27352002-05-02 Akim Demaille <akim@epita.fr>
2736
2737 * data/bison.simple (yyparse): Do not implement @$ = @1.
2738 (YYLLOC_DEFAULT): Adjust to do it.
2739 * doc/bison.texinfo (Location Default Action): Fix.
2740
3a8b4109
AD
27412002-05-02 Akim Demaille <akim@epita.fr>
2742
2743 * src/reader.c (parse_braces): Merge into...
2744 (parse_action): this.
2745
84614e13
AD
27462002-05-02 Akim Demaille <akim@epita.fr>
2747
2748 * configure.in (ALL_LINGUAS): Remove.
2749 * po/LINGUAS, hr.po: New.
2750
fdbcd8e2
AD
27512002-05-02 Akim Demaille <akim@epita.fr>
2752
2753 Remove the so called hairy (semantic) parsers.
2754
2755 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
2756 * src/gram.h, src/gram.c (semantic_parser): Remove.
2757 (rule_t): Remove the guard and guard_line members.
2758 * src/lex.h (token_t): remove tok_guard.
2759 * src/options.c (option_table): Remove %guard and %semantic_parser
2760 support.
2761 * src/output.c, src/output.h (guards_output): Remove.
2762 (prepare): Adjust.
2763 (token_definitions_output): Don't output the `T'
2764 tokens (???).
2765 (output_skeleton): Don't output the guards.
2766 * src/files.c, src/files.c (attrsfile): Remove.
2767 * src/reader.c (symbol_list): Remove the guard and guard_line
2768 members.
2769 Adjust dependencies.
2770 (parse_guard): Remove.
2771 * data/bison.hairy: Remove.
2772 * doc/bison.texinfo (Environment Variables): Remove occurrences of
2773 BISON_HAIRY.
2774
82b6cb3f
AD
27752002-05-02 Akim Demaille <akim@epita.fr>
2776
2777 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
2778 (parse_guard): Rename the formal argument `stack_offset' as
2779 `rule_length', which is more readable.
2780 Adjust callers.
2781 (copy_at, copy_dollar): Instead of outputting the hard coded
2782 values of $$, $n and so forth, output invocation to b4_lhs_value,
2783 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
2784 Note: this patch partially drops `semantic-parser' support: it
2785 always does `rule_length - n', where semantic parsers ought to
2786 always use `-n'.
82b6cb3f
AD
2787 * data/bison.simple, data/bison.c++ (b4_lhs_value)
2788 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
2789
6cbfbcc5
AD
27902002-05-02 Akim Demaille <akim@epita.fr>
2791
2792 * configure.in (AC_INIT): Bump to 1.49b.
2793 (AM_INIT_AUTOMAKE): Short invocation.
2794
b8548114
AD
27952002-05-02 Akim Demaille <akim@epita.fr>
2796
2797 Version 1.49a.
2798
c20cd1fa
AD
27992002-05-01 Akim Demaille <akim@epita.fr>
2800
2801 * src/skeleton.h: Remove.
2802
8a9566d4
AD
28032002-05-01 Akim Demaille <akim@epita.fr>
2804
2805 * src/skeleton.h: Fix the #endif.
2806 Reported by Magnus Fromreide.
2807
8c6d399a
PE
28082002-04-26 Paul Eggert <eggert@twinsun.com>
2809
2810 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
2811 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 2812 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 2813
2b7ed18a
RA
28142002-04-25 Robert Anisko <robert@lrde.epita.fr>
2815
2816 * src/scan-skel.l: Postprocess quadrigraphs.
2817
2818 * src/reader.c (copy_character): New function, used to output
2819 single characters while replacing `[' and `]' with quadrigraphs, to
2820 avoid troubles with M4 quotes.
2821 (copy_comment): Output characters with copy_character.
2822 (read_additionnal_code): Likewise.
2823 (copy_string2): Likewise.
2824 (copy_definition): Likewise.
2825
2826 * tests/calc.at: Exercise M4 quoting.
2827
34a89c50
AD
28282002-04-25 Akim Demaille <akim@epita.fr>
2829
2830 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
2831 between `!' and the command.
2832 Reported by Paul Eggert.
2833
0dd1580a
RA
28342002-04-24 Robert Anisko <robert@lrde.epita.fr>
2835
2836 * tests/calc.at: Exercise prologue splitting.
2837
2838 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
2839 `b4_post_prologue' instead of `b4_prologue'.
2840
2841 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
2842 muscles.
2843 (output): Free pre_prologue_obstack and post_prologue_obstack.
2844 * src/files.h, src/files.c (attrs_obstack): Remove.
2845 (pre_prologue_obstack, post_prologue_obstack): New.
2846 * src/reader.c (copy_definition): Add a parameter to specify the
2847 obstack to fill, instead of using attrs_obstack unconditionally.
2848 (read_declarations): Pass pre_prologue_obstack to copy_definition if
2849 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
2850
83c1796f
PE
28512002-04-23 Paul Eggert <eggert@twinsun.com>
2852
2853 * data/bison.simple: Remove unnecessary commentary and white
2854 space differences from 1_29-branch.
2855 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
2856
2857 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
2858 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
2859 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
2860 constructors or destructors.
2861
2862 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
2863
1207eeac
AD
28642002-04-23 Akim Demaille <akim@epita.fr>
2865
2866 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
2867 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
2868 location with columns.
2869 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
2870 All reported by Paul Eggert.
2871
78ab8f67
AD
28722002-04-22 Akim Demaille <akim@epita.fr>
2873
2874 * src/reduce.c (dump_grammar): Move to...
2875 * src/gram.h, src/gram.c (grammar_dump): here.
2876 Be sure to separate long item numbers.
2877 Don't read the members of a rule's prec if its nil.
2878
133c20e2
AD
28792002-04-22 Akim Demaille <akim@epita.fr>
2880
2881 * src/output.c (table_size, table_grow): New.
2882 (MAXTABLE): Remove, replace uses with table_size.
2883 (pack_vector): Instead of dying when the table is too big, grow it.
2884
9515e8a7
AD
28852002-04-22 Akim Demaille <akim@epita.fr>
2886
2887 * data/bison.simple (yyr1): Its type is that of a token number.
2888 * data/bison.c++ (r1_): Likewise.
2889 * tests/regression.at (Web2c Actions): Adjust.
2890
23c5a174
AD
28912002-04-22 Akim Demaille <akim@epita.fr>
2892
2893 * src/reader.c (token_translations_init): 256 is now the default
2894 value for the error token, i.e., it will be assigned another
2895 number if the user assigned 256 to one of her tokens.
2896 (reader): Don't force 256 to error.
2897 * doc/bison.texinfo (Symbols): Adjust.
2898 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
2899 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
2900 etc. instead of 10, 20, 30 (which was used to `jump' over error
2901 (256) and undefined (2)).
2902
5fbb0954
AD
29032002-04-22 Akim Demaille <akim@epita.fr>
2904
2905 Propagate more token_number_t.
2906
2907 * src/gram.h (token_number_as_item_number)
2908 (item_number_as_token_number): New.
2909 * src/output.c (GENERATE_OUTPUT_TABLE): New.
2910 Use it to create output_item_number_table and
2911 output_token_number_table.
2912 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
2913 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
2914 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
2915 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
2916
4f940944
AD
29172002-04-22 Akim Demaille <akim@epita.fr>
2918
2919 * src/output.h, src/output.c (get_lines_number): Remove.
2920
3ded9a63
AD
29212002-04-19 Akim Demaille <akim@epita.fr>
2922
2923 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
2924 as Lex/Flex'.
2925 (Debugging): More details about enabling the debugging features.
2926 (Table of Symbols): Describe $$, $n, @$, and @n.
2927 Suggested by Tim Josling.
2928
e0c471a9
AD
29292002-04-19 Akim Demaille <akim@epita.fr>
2930
2931 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
2932
fecc10cd
AD
29332002-04-10 Akim Demaille <akim@epita.fr>
2934
2935 * src/system.h: Rely on HAVE_LIMITS_H.
2936 Suggested by Paul Eggert.
2937
51dec47b
AD
29382002-04-09 Akim Demaille <akim@epita.fr>
2939
2940 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
2941 full stderr, and strip it according to the bison options, instead
2942 of composing the error message from different bits.
2943 This makes it easier to check for several error messages.
2944 Adjust all the invocations.
2945 Add an invocation exercising the error token.
2946 Add an invocation demonstrating a stupid error message.
2947 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
2948 Adjust the tests.
2949 Error message are for stderr, not stdout.
2950
007a50a4
AD
29512002-04-09 Akim Demaille <akim@epita.fr>
2952
2953 * src/gram.h, src/gram.c (error_token_number): Remove, use
2954 errtoken->number.
2955 * src/reader.c (reader): Don't specify the user token number (2)
2956 for $undefined, as it uselessly prevents using it.
2957 * src/gram.h (token_number_t): Move to...
2958 * src/symtab.h: here.
2959 (state_t.number): Is a token_number_t.
2960 * src/print.c, src/reader.c: Use undeftoken->number instead of
2961 hard coded 2.
2962 (Even though this 2 is not the same as above: the number of the
2963 undeftoken remains being 2, it is its user token number which
2964 might not be 2).
2965 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
2966 `user_token_number_max'.
2967 Output `undef_token_number'.
2968 * data/bison.simple, data/bison.c++: Use them.
2969 Be sure to map invalid yylex return values to
2970 `undef_token_number'. This saves us from gratuitous SEGV.
2971
2972 * tests/conflicts.at (Solved SR Conflicts)
2973 (Unresolved SR Conflicts): Adjust.
2974 * tests/regression.at (Web2c Actions): Adjust.
2975
06446ccf
AD
29762002-04-08 Akim Demaille <akim@epita.fr>
2977
2978 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
2979 Adding #line.
2980 Remove the duplicate `typedefs'.
2981 (RhsNumberType): Fix the declaration and various other typos.
2982 Use __ofile__.
2983 * data/bison.simple: Use __ofile__.
2984 * src/scan-skel.l: Handle __ofile__.
2985
62a3e4f0
AD
29862002-04-08 Akim Demaille <akim@epita.fr>
2987
2988 * src/gram.h (item_number_t): New, the type of item numbers in
2989 RITEM. Note that it must be able to code symbol numbers as
2990 positive number, and the negation of rule numbers as negative
2991 numbers.
2992 Adjust all dependencies (pretty many).
2993 * src/reduce.c (rule): Remove this `short *' pointer: use
2994 item_number_t.
2995 * src/system.h (MINSHORT, MAXSHORT): Remove.
2996 Include `limits.h'.
2997 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
2998 (shortcpy): Remove.
2999 (MAXTABLE): Move to...
3000 * src/output.c (MAXTABLE): here.
3001 (prepare_rules): Use output_int_table to output rhs.
3002 * data/bison.simple, data/bison.c++: Adjust.
3003 * tests/torture.at (Big triangle): Move the limit from 254 to
3004 500.
3005 * tests/regression.at (Web2c Actions): Ajust.
3006
3007 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
3008 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
3009 passes, but produces negative #line number, once fixed, GCC is
3010 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
3011 C), it passes.
3012 * src/state.h (state_h): Code input lines on ints, not shorts.
3013
bb88b0fc
AD
30142002-04-08 Akim Demaille <akim@epita.fr>
3015
3016 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
3017 and then the grammar.
3018
9a636f47
AD
30192002-04-08 Akim Demaille <akim@epita.fr>
3020
3021 * src/system.h: No longer using strndup.
3022
680e8701
AD
30232002-04-07 Akim Demaille <akim@epita.fr>
3024
3025 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
3026 * src/output.c (output_table_data): Return the longest number.
3027 (prepare_tokens): Output `token_number_max').
3028 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
3029 New.
3030 Use them to define yy_token_number_type/TokenNumberType.
3031 Use this type for yytranslate.
3032 * tests/torture.at (Big triangle): Push the limit from 124 to
3033 253.
3034 * tests/regression.at (Web2c Actions): Adjust.
3035
817e9f41
AD
30362002-04-07 Akim Demaille <akim@epita.fr>
3037
3038 * tests/torture.at (Big triangle): New.
3039 (GNU AWK Grammar, GNU Cim Grammar): Move to...
3040 * tests/existing.at: here.
3041
5123689b
AD
30422002-04-07 Akim Demaille <akim@epita.fr>
3043
3044 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
3045 nritems.
3046 Adjust dependencies.
3047
f3849179
AD
30482002-04-07 Akim Demaille <akim@epita.fr>
3049
3050 * src/reader.c: Normalize increments to prefix form.
3051
bd02036a
AD
30522002-04-07 Akim Demaille <akim@epita.fr>
3053
3054 * src/reader.c, symtab.c: Remove debugging code.
3055
db8837cb
AD
30562002-04-07 Akim Demaille <akim@epita.fr>
3057
3058 Rename all the `bucket's as `symbol_t'.
3059
3060 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
3061 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
3062 * src/symtab.c, src/symtab.h (bucket): Rename as...
3063 (symbol_t): this.
3064 (symbol_list_new, bucket_check_defined, bucket_make_alias)
3065 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
3066 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3067 (buckets_new, buckets_free, buckets_do): Rename as...
3068 (symbol_list_new, symbol_check_defined, symbol_make_alias)
3069 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
3070 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
3071 (symbols_new, symbols_free, symbols_do): these.
3072
72a23c97
AD
30732002-04-07 Akim Demaille <akim@epita.fr>
3074
3075 Use lib/hash for the symbol table.
3076
3077 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
3078 EOF.
3079 * src/lex.c (lex): Set the `number' member of new terminals.
3080 * src/reader.c (bucket_check_defined, bucket_make_alias)
3081 (bucket_check_alias_consistence, bucket_translation): New.
3082 (reader, grammar_free, readgram, token_translations_init)
3083 (packsymbols): Adjust.
3084 (reader): Number the predefined tokens.
3085 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
3086 for predefined tokens.
3087 * src/symtab.h (bucket): Remove all the hash table related
3088 members.
3089 * src/symtab.c (symtab): Replace by...
3090 (bucket_table): this.
3091 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
3092 (buckets_new, buckets_do): New.
3093
280a38c3
AD
30942002-04-07 Akim Demaille <akim@epita.fr>
3095
3096 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
3097 (start_symbol, max_user_token_number, semantic_parser)
3098 (error_token_number): Initialize.
3099 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
3100 Initialize.
3101 (reader): Don't.
3102 (errtoken, eoftoken, undeftoken, axiom): Extern.
3103
03b31c0c
AD
31042002-04-07 Akim Demaille <akim@epita.fr>
3105
3106 * src/gram.h (rule_s): prec and precsym are now pointers
3107 to the bucket giving the priority/associativity.
3108 Member `associativity' removed: useless.
3109 * src/reduce.c, src/conflicts.c: Adjust.
3110
8b3df748
AD
31112002-04-07 Akim Demaille <akim@epita.fr>
3112
3113 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
3114 Properly escape the symbols' TAG when outputting them.
3115
e601aa1d
AD
31162002-04-07 Akim Demaille <akim@epita.fr>
3117
3118 * src/lalr.h (LA): Is a bitsetv, not bitset*.
3119
b0299a2e
AD
31202002-04-07 Akim Demaille <akim@epita.fr>
3121
3122 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
3123 (LArule): this, which is an array to rule_t*.
3124 * src/print.c, src/conflicts.c: Adjust.
3125
d7e1f00c
AD
31262002-04-07 Akim Demaille <akim@epita.fr>
3127
3128 * src/gram.h (rule_t): Rename `number' as `user_number'.
3129 `number' is a new member.
3130 Adjust dependencies.
3131 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
3132
cc9305dd
AD
31332002-04-07 Akim Demaille <akim@epita.fr>
3134
3135 As a result of the previous patch, it is no longer needed
3136 to reorder ritem itself.
3137
3138 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
3139
b0940840
AD
31402002-04-07 Akim Demaille <akim@epita.fr>
3141
3142 Be sure never to walk through RITEMS, but use only data related to
3143 the rules themselves. RITEMS should be banished.
3144
3145 * src/output.c (output_token_translations): Rename as...
3146 (prepare_tokens): this.
3147 In addition to `translate', prepare the muscles `tname' and
3148 `toknum', which were handled by...
3149 (output_rule_data): this.
3150 Remove, and move the remainder of its outputs into...
3151 (prepare_rules): this new routines, which also merges content from
3152 (output_gram): this.
3153 (prepare_rules): Be sure never to walk through RITEMS.
3154 (output_stos): Rename as...
3155 (prepare_stos): this.
3156 (output): Always invoke prepare_states, after all, just don't use it
3157 in the output if you don't need it.
3158
643a5994
AD
31592002-04-07 Akim Demaille <akim@epita.fr>
3160
3161 * src/LR0.c (new_state): Display `nstates' as the name of the
3162 newly created state.
3163 Adjust to initialize first_state and last_state if needed.
3164 Be sure to distinguish the initial from the final state.
3165 (new_states): Create the itemset of the initial state, and use
3166 new_state.
3167 * src/closure.c (closure): Now that the initial state has its
3168 items properly set, there is no need for a special case when
3169 creating `ruleset'.
3170
3171 As a result, now the rule 0, reducing to $axiom, is visible in the
3172 outputs. Adjust the test suite.
3173
3174 * tests/conflicts.at (Solved SR Conflicts)
3175 (Unresolved SR Conflicts): Adjust.
3176 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
3177 * tests/conflicts.at (S/R in initial): New.
3178
b4c4ccc2
AD
31792002-04-07 Akim Demaille <akim@epita.fr>
3180
3181 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
3182 the RHS of the rules.
3183 * src/output.c (output_gram): Likewise.
3184
bba97eb2
AD
31852002-04-07 Akim Demaille <akim@epita.fr>
3186
3187 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
3188 bucket.
3189 Adjust all dependencies.
3190 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
3191 `number' of the buckets too.
3192 * src/gram.h: Include `symtab.h'.
3193 (associativity): Move to...
3194 * src/symtab.h: here.
3195 No longer include `gram.h'.
3196
c3b407f4
AD
31972002-04-07 Akim Demaille <akim@epita.fr>
3198
3199 * src/gram.h, src/gram.c (rules_rhs_length): New.
3200 (ritem_longest_rhs): Use it.
3201 * src/gram.h (rule_t): `number' is a new member.
3202 * src/reader.c (packgram): Set it.
3203 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
3204 the end of `rules', and count them out of `nrules'.
3205 (reduce_output, dump_grammar): Adjust.
3206 * src/print.c (print_grammar): It is no longer needed to check for
3207 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
3208 * tests/reduce.at (Reduced Automaton): New test.
3209
11652ab3
AD
32102002-04-07 Akim Demaille <akim@epita.fr>
3211
3212 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
3213 lacking `+ 1' to nrules, Bison reported as useless a token if it
3214 was used solely to set the precedence of the last rule...
3215
26b23c1a
AD
32162002-04-07 Akim Demaille <akim@epita.fr>
3217
3218 * data/bison.c++, data/bison.simple: Don't output the current file
3219 name in #line, to avoid useless diffs between two identical
3220 outputs under different names.
3221
18bcecb0
AD
32222002-04-07 Akim Demaille <akim@epita.fr>
3223
3224 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
3225 Normalize loops to using `< nrules + 1', not `<= nrules'.
3226
fa770c86
AD
32272002-04-07 Akim Demaille <akim@epita.fr>
3228
3229 * TODO: Update.
3230
d9b739c3
AD
32312002-04-07 Akim Demaille <akim@epita.fr>
3232
3233 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
3234 bucket.value as bucket.number.
3235
99013900
AD
32362002-04-07 Akim Demaille <akim@epita.fr>
3237
3238 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
3239 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
3240 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
3241 RHS, instead of being an index in RITEMS.
3242
e966383b
PE
32432002-04-04 Paul Eggert <eggert@twinsun.com>
3244
3245 * doc/bison.texinfo: Update copyright date.
3246 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
3247 (Symbols): Warn about running Bison in one character set,
3248 but compiling and/or running in an incompatible one.
3249 Warn about character code 256, too.
3250
32512002-04-03 Paul Eggert <eggert@twinsun.com>
3252
3253 * src/bison.data (YYSTACK_ALLOC): Depend on whether
3254 YYERROR_VERBOSE is nonzero, not whether it is defined.
3255
3256 Merge changes from bison-1_29-branch.
c307773e 3257
8d6c48b9
PE
32582002-03-20 Paul Eggert <eggert@twinsun.com>
3259
3260 Merge fixes from Debian bison_1.34-1.diff.
3261
3262 * configure.in (AC_PREREQ): 2.53.
3263
e53c6322
AD
32642002-03-20 Akim Demaille <akim@epita.fr>
3265
3266 * src/conflicts.c (log_resolution): Argument `resolution' is const.
3267
9ffbeca7
PE
32682002-03-19 Paul Eggert <eggert@twinsun.com>
3269
21db0b2a
PE
3270 * src/bison.simple (YYCOPY): New macro.
3271 (YYSTACK_RELOCATE): Use it.
3272 Remove Type arg; no longer needed. All callers changed.
3273 (yymemcpy): Remove; no longer needed.
3274
9ffbeca7
PE
3275 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
3276 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
3277
642cb8f8
AD
32782002-03-19 Akim Demaille <akim@epita.fr>
3279
3280 Test and fix the #line outputs.
3281
3282 * tests/atlocal.at (GCC): New.
3283 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
3284 (Prologue synch line, ,%union synch line, Postprologue synch line)
3285 (Action synch line, Epilogue synch line): New tests.
3286 * src/reader.c (parse_union_decl): Define the muscle stype_line.
3287 * data/bison.simple, data/bison.c++: Use it.
3288
3c31a486
AD
32892002-03-19 Akim Demaille <akim@epita.fr>
3290
3291 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
3292 (Solved SR Conflicts, %expect not enough, %expect right)
3293 (%expect too much): Move to...
3294 * tests/conflicts.at: this new file.
3295
0d8bed56
AD
32962002-03-19 Akim Demaille <akim@epita.fr>
3297
3298 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
3299 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
3300 that we can move to enums for instance.
3301 * src/output.c (token_definitions_output): Output a list of
3302 `token-name, token-number' instead of the #define.
3303 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
3304
9208d17f
AD
33052002-03-14 Akim Demaille <akim@epita.fr>
3306
3307 Use Gettext 0.11.1.
3308
af27eacb
RA
33092002-03-09 Robert Anisko <robert@lrde.epita.fr>
3310
3311 * data/bison.c++: Make the user able to add members to the generated
3312 parser by subclassing.
3313
9101a310
RA
33142002-03-05 Robert Anisko <robert@lrde.epita.fr>
3315
3316 * src/reader.c (read_additionnal_code): `c' should be an integer, not
3317 a character.
3318 Reported by Nicolas Tisserand and Nicolas Burrus.
3319
fff9bf0b
RA
33202002-03-04 Robert Anisko <robert@lrde.epita.fr>
3321
3322 * src/reader.c: Warn about lacking semi-colons, do not complain.
3323
64dba31e
RA
33242002-03-04 Robert Anisko <robert@lrde.epita.fr>
3325
3326 * data/bison.c++: Remove a debug line.
3327
374f5a14
RA
33282002-03-04 Robert Anisko <robert@lrde.epita.fr>
3329
3330 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
3331 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
3332 provide a default implementation.
3333
bfcf1f3a
AD
33342002-03-04 Akim Demaille <akim@epita.fr>
3335
3336 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
3337 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
3338 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
3339 * tests/semantic.at (Parsing Guards): Similarly.
3340 * src/reader.at (readgram): Complain if the last rule is not ended
3341 with a semi-colon.
3342
65ccf9fc
AD
33432002-03-04 Akim Demaille <akim@epita.fr>
3344
3345 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
3346 * src/closure.c: here.
3347 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
3348 RTC.
3349 * src/warshall.h, src/warshall.c: Remove.
3350 * tests/sets.at (Broken Closure): Adjust.
3351
d0039cbc
AD
33522002-03-04 Akim Demaille <akim@epita.fr>
3353
3354 * src/output.c (output_skeleton): tempdir is const.
3355 bytes_read is unused.
3356
345cea78
AD
33572002-03-04 Akim Demaille <akim@epita.fr>
3358
3359 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
3360 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
3361 Update.
3362 From Michael Hayes.
3363
564801f7
AD
33642002-03-04 Akim Demaille <akim@epita.fr>
3365
3366 * src/closure.c (closure): `r' is unused.
3367
e5352bc7
AD
33682002-03-04 Akim Demaille <akim@epita.fr>
3369
3370 * tests/sets.at (Broken Closure): Add the ending `;'.
3371 * src/reader.at (readgram): Complain if a rule is not ended with a
3372 semi-colon.
3373
914feea9
AD
33742002-03-04 Akim Demaille <akim@epita.fr>
3375
3376 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
3377 (count_sr_conflicts): Use bitset_count.
3378 * src/reduce.c (inaccessable_symbols): Ditto.
3379 (bits_size): Remove.
3380 * src/warshall.h, src/warshall.c: Convert to bitsetv.
3381
f0250de6
AD
33822002-03-04 Akim Demaille <akim@epita.fr>
3383
3384 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
3385 * src/reduce.c: Remove the `bitset_zero's following the
3386 `bitset_create's, as now it is performed by the latter.
3387
ef017502
AD
33882002-03-04 Akim Demaille <akim@epita.fr>
3389
3390 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
3391 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
3392 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
3393 latest sources from Michael.
3394
76514394
AD
33952002-03-04 Akim Demaille <akim@epita.fr>
3396
3397 * src/output.c (output): Don't free the grammar.
3398 * src/reader.c (grammar_free): New.
3399 * src/main.c (main): Call it and don't free symtab here.
3400
55024580
AD
34012002-03-04 Akim Demaille <akim@epita.fr>
3402
3403 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
3404 before returning.
3405 Reported by Benoit Perrot.
3406
f9abaa2c
AD
34072002-03-04 Akim Demaille <akim@epita.fr>
3408
3409 Use bitset operations when possible, not loops over bits.
3410
3411 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
3412 bitset_or.
3413 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
3414 * src/reduce.c (useless_nonterminals): Formatting changes.
3415 * src/warshall.c (TC): Use bitset_or.
3416
0e721e75
AD
34172002-03-04 Akim Demaille <akim@epita.fr>
3418
3419 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
3420 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
3421 Ditto.
3422
0fb1ffb1
AD
34232002-03-04 Akim Demaille <akim@epita.fr>
3424
3425 * src/lalr.c (F): Now a bitset*.
3426 Adjust all dependencies.
3427
b86796bf
AD
34282002-03-04 Akim Demaille <akim@epita.fr>
3429
3430 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
3431 Adjust all dependencies.
3432
602bbf31
AD
34332002-03-04 Akim Demaille <akim@epita.fr>
3434
3435 * src/L0.c, src/LR0.h (nstates): Be size_t.
3436 Adjust comparisons (signed vs unsigned).
3437 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
3438 bitset*.
3439 Adjust all dependencies.
3440
d8a0245c
AD
34412002-03-04 Akim Demaille <akim@epita.fr>
3442
3443 * src/closure.c (firsts): Now, also a bitset.
3444 Adjust all dependencies.
3445 (varsetsize): Remove, now unused.
3446 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
3447
34ba9743
AD
34482002-03-04 Akim Demaille <akim@epita.fr>
3449
3450 * src/print.c: Convert to use bitset.h, not hand coded iterations
3451 over ints.
3452
ed86e78c
AD
34532002-03-04 Akim Demaille <akim@epita.fr>
3454
3455 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
3456
dfdb1797
AD
34572002-03-04 Akim Demaille <akim@epita.fr>
3458
3459 * src/closure.c (ruleset): Be a bitset.
3460 (rulesetsize): Remove.
3461
7086e707
AD
34622002-03-04 Akim Demaille <akim@epita.fr>
3463
3464 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
3465 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
3466 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
3467 * src/closure.c (fderives): Be an array of bitsets.
3468
98254360
RA
34692002-02-28 Robert Anisko <robert@lrde.epita.fr>
3470
3471 * data/bison.c++: Merge the two generated headers. Insert a copyright
3472 notice in each output file.
3473
a75c057f
AD
34742002-02-28 Akim Demaille <akim@epita.fr>
3475
3476 * data/bison.c++: Copy the prologue of bison.simple to fetch
3477 useful M4 definitions, such as b4_header_guard.
3478
06b00abc
AD
34792002-02-25 Akim Demaille <akim@epita.fr>
3480
3481 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
3482 translator friendly scheme for the bgr
3483 copyright notice.
06b00abc 3484
70e7d534
AD
34852002-02-25 Akim Demaille <akim@epita.fr>
3486
3487 * src/output.c (header_output): Remove, now handled completely via
3488 M4.
3489
abe017f6
AD
34902002-02-25 Akim Demaille <akim@epita.fr>
3491
3492 * m4/m4.m4: New, from CVS Autoconf.
3493 * configure.in: Invoke it.
3494 * src/output.c (output_skeleton): Use its result instead of the
3495 hard coded name.
3496
381fb12e
AD
34972002-02-25 Akim Demaille <akim@epita.fr>
3498
3499 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
3500 Fileutils 4.1.5.
3501 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
3502 * src/output.c (output_skeleton): Use mkstemp to create a real
3503 temporary file.
3504 Move the filling of `skeleton' and its muscle to...
3505 (prepare): here.
3506 (output): Move the definition of the prologue muscle to...
3507 (prepare): here.
3508 * src/system.h (DEFAULT_TMPDIR): New.
3509
6f38107f
PE
35102002-02-14 Paul Eggert <eggert@twinsun.com>
3511
3512 Remove the support for C++ namespace cleanliness; it was
3513 causing more problems than it was curing, since it didn't work
3514 properly on some nonstandard C++ compilers. This can wait
3515 for a proper C++ parser.
3516
3517 * NEWS: Document this.
3518 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
3519 of C++, as it's treated like C now.
3520 * src/bison.simple (YYSTD): Remove.
3521 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
3522 Treat C++ just like Standard C instead of trying to support
3523 namespace cleanliness.
3524
80cce3da
AD
35252002-02-14 Akim Demaille <akim@epita.fr>
3526
3527 * tests/regression.at (else): Adjust to Andreas' change.
3528
842e8679
AD
35292002-02-14 Akim Demaille <akim@epita.fr>
3530
3531 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
3532
4bda3f10
AD
35332002-02-13 Andreas Schwab <schwab@suse.de>
3534
3535 * src/output.c (output_rule_data): Don't output NULL, it might
3536 not be defined yet.
3537
4162fa07 35382002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 3539
4162fa07
RA
3540 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
3541 (Copyright notice): Update.
b418ecd8 3542
bd16a5dc
AD
35432002-02-11 Akim Demaille <akim@epita.fr>
3544
3545 * tests/regression.at (%nonassoc and eof): Don't include
3546 nonportable headers.
3547
8d69a1a3
RA
35482002-02-08 Robert Anisko <robert@lrde.epita.fr>
3549
3550 * data/bison.c++: Correct error recovery. Make the user able to
3551 initialize the starting location.
3552
9b2d0677
AD
35532002-02-07 Akim Demaille <akim@epita.fr>
3554
3555 * tests/input.at: New.
3556
69e2658b
RA
35572002-02-07 Robert Anisko <robert@lrde.epita.fr>
3558
3559 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 3560 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
3561 directives around tables only needed for debugging.
3562
4aacc3a7
RA
35632002-02-07 Robert Anisko <robert@lrde.epita.fr>
3564
3565 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
3566 C++ parsers.
3567 (yy::b4_name::parse): Use print_.
3568
762a801e
RA
35692002-02-07 Robert Anisko <robert@lrde.epita.fr>
3570
3571 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
3572
4bb2bc3f
RA
35732002-02-07 Robert Anisko <robert@lrde.epita.fr>
3574
3575 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
3576 C++ parsers.
3577 (yy::b4_name::parse): Build verbose error messages, and use error_.
3578
6b45a3ca
RA
35792002-02-06 Robert Anisko <robert@lrde.epita.fr>
3580
3581 * data/bison.c++: Fix m4 quoting in comments.
3582
50997c6e
RA
35832002-02-06 Robert Anisko <robert@lrde.epita.fr>
3584
3585 * data/bison.c++: Adjust the parser code. Fix some muscles that were
3586 not expanded by m4.
3587
3f3eed27
AD
35882002-02-05 Akim Demaille <akim@epita.fr>
3589
3590 * data/bison.c++: Adjust to the M4 back end.
3591 More is certainly needed.
3592
be2a1a68
AD
35932002-02-05 Akim Demaille <akim@epita.fr>
3594
3595 Give a try to M4 as a back end.
3596
3597 * lib/readpipe.c: New, from wdiff.
3598 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
3599 BISON_HAIRY.
3600 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
3601 specific values. Now it is m4 that performs the lookup.
3602 * src/parse-skel.y: Remove.
3603 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
3604 * src/output.c (actions_output, guards_output)
3605 (token_definitions_output): No longer keeps track of the output
3606 line number, hence remove the second argument.
3607 (guards_output): Check against the guard member of a rule, not the
3608 action member.
3609 Adjust callers.
3610 (output_skeleton): Don't look for the skeleton location, let m4 do
3611 that.
3612 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
3613 file will be used.
3614 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
3615 (prepare): Given that for the time being changesyntax is not
3616 usable in M4, rename the muscles using `-' to `_'.
3617 Define `defines_flag', `output_parser_name' and `output_header_name'.
3618 * src/output.h (actions_output, guards_output)
3619 (token_definitions_output): Adjust prototypes.
3620 * src/scan-skel.l: Instead of scanning the skeletons, it now
3621 processes the output of m4: `__oline__' and `#output'.
3622 * data/bison.simple: Adjust to be used by M4(sugar).
3623 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
3624 to date.
3625 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
3626 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
3627 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
3628 shamelessly stolen from CVS Autoconf.
3629
beda758b
AD
36302002-02-05 Akim Demaille <akim@epita.fr>
3631
3632 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
3633 * configure.in: Check for the declarations of free and malloc.
3634 * src/muscle_tab.c: Adjust.
3635
5ece6d43
AD
36362002-02-05 Akim Demaille <akim@epita.fr>
3637
3638 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
3639 which have no values.
3640
5bb18f9a
AD
36412002-02-05 Akim Demaille <akim@epita.fr>
3642
3643 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
3644 * data/: here.
3645
894dd62e
PE
36462002-01-29 Paul Eggert <eggert@twinsun.com>
3647
3648 * src/bison.simple (YYSIZE_T): Do not define merely because
3649 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
3650 On some platforms, <alloca.h> does not declare YYSTD (size_t).
3651
82841af7
AD
36522002-01-27 Akim Demaille <akim@epita.fr>
3653
3654 Fix `%nonassoc and eof'.
3655
3656 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
3657 which were not properly copied! Replace
3658 memcpy (res->errs, src->errs, src->nerrs);
3659 with
3660 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
3661 !!!
3662 * tests/regression.at (%nonassoc and eof): Adjust to newest
3663 Autotest: `.' is not in the PATH.
3664
318b76e9
AD
36652002-01-27 Akim Demaille <akim@epita.fr>
3666
3667 * tests/sets.at (AT_EXTRACT_SETS): New.
3668 (Nullable): Use it.
3669 (Firsts): New.
3670
30d2f3d5
AD
36712002-01-26 Akim Demaille <akim@epita.fr>
3672
3673 * tests/actions.at, tests/calc.at, tests/headers.at,
3674 * tests/torture.at: Adjust to the newest Autotest which no longer
3675 forces `.' in the PATH.
3676
30f8c395
AD
36772002-01-25 Akim Demaille <akim@epita.fr>
3678
3679 * tests/regression.at (%nonassoc and eof): New.
3680 Suggested by Robert Anisko.
3681
29ae55f1
AD
36822002-01-24 Akim Demaille <akim@epita.fr>
3683
3684 Bison dumps core when trying to complain about broken input files.
3685 Reported by Cris van Pelt.
3686
3687 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
3688 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
3689 into...
3690 (Invalid inputs): Strengthen: exercise parse_percent_token.
3691
2b548aa6
RA
36922002-01-24 Robert Anisko <robert.anisko@epita.fr>
3693
3694 * src/Makefile.am: Add bison.c++.
3695 * src/bison.c++: New skeleton.
3696
bb0146c2
AD
36972002-01-21 Paolo Bonzini <bonzini@gnu.org>
3698
3699 * po/it.po: New.
3700
bec30531
AD
37012002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
3702
3703 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
3704
fc6edc45
MA
37052002-01-20 Marc Autret <marc@gnu.org>
3706
3707 * src/files.c (compute_output_file_names): Fix
3708
5e5d5415
MA
37092002-01-20 Marc Autret <marc@gnu.org>
3710
3711 * tests/output.at: New test.
3712 * src/files.c (compute_base_names): Don't map extensions when
3713 the YACC flag is set, use defaults.
3714 Reported by Evgeny Stambulchik.
3715
44ea3fbd
MA
37162002-01-20 Marc Autret <marc@gnu.org>
3717
bb0146c2 3718 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
3719 compilers as well (i.e. the vendor C compiler).
3720 Suggested by Albert Chin-A-Young.
3721
338963d1
TVH
37222002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
3723
3724 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
3725 canonical definition.
3726 * src/system.h: Use the canonical definition for PARAMS (avoids
3727 a conflict with the macro from lib/hash.h).
3728
c57b2479
AD
37292002-01-11 Akim Demaille <akim@epita.fr>
3730
3731 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 3732 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 3733
b85810ae
AD
37342002-01-09 Akim Demaille <akim@epita.fr>
3735
3736 * src/files.c, src/files.h (output_infix): New.
3737 (tab_extension): Remove.
3738 (compute_base_names): Compute the former, drop the latter.
3739 * src/output.c (prepare): Insert the muscles `output-infix', and
3740 `output-suffix'.
3741 * src/parse-skel.y (string, string.1): New.
3742 (section.header): Use it.
3743 (section.yacc): Remove.
3744 (prefix): Remove too.
3745 * src/scan-skel.l: Adjust.
3746 * src/bison.simple, src/bison.hairy: Adjust.
3747
cae60122
AD
37482002-01-09 Akim Demaille <akim@epita.fr>
3749
3750 * configure.in (WERROR_CFLAGS): Compute it.
3751 * src/Makefile.am (CFLAGS): Pass it.
3752 * tests/atlocal.in (CFLAGS): Idem.
3753 * src/files.c: Fix a few warnings.
3754 (get_extension_index): Remove, unused.
3755
ae404801
AD
37562002-01-08 Akim Demaille <akim@epita.fr>
3757
3758 * src/getargs.c (AS_FILE_NAME): New.
3759 (getargs): Use it to convert DOSish file names.
3760 * src/files.c (base_name): Rename as full_base_name to avoid
3761 clashes with `base_name ()'.
3762 (filename_split): New.
3763 (compute_base_names): N-th rewrite, using filename_split.
3764
22312b71
AD
37652002-01-08 Akim Demaille <akim@epita.fr>
3766
3767 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
3768 New, stolen from the Fileutils 4.1.
3769 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
3770 * configure.in: Check for the presence of memrchr, and of its
3771 prototype.
3772
a67cef01
TVH
37732002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
3774
3775 * lib/hash.h (__P): Added definition for this macro.
3776 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
3777 BUILT_SOURCES, to ensure they are generated first.
3778 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
3779 %error-verbose to allow bootstrapping with bison 1.30x.
3780
2b25d624
AD
37812002-01-06 Akim Demaille <akim@epita.fr>
3782
3783 * src/reader.c (parse_braces): Don't fetch the next char, the
3784 convention is to fetch on entry.
3785 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
3786 'switch' without a following semicolon.
3787 * tests/regression.at (braces parsing): New.
3788
3460813b
AD
37892002-01-06 Akim Demaille <akim@epita.fr>
3790
3791 Bison is dead wrong in its RR conflict reports.
3792
3793 * tests/torture.at (GNU Cim Grammar): New.
3794 * src/conflicts.c (count_rr_conflicts): Fix.
3795
73784c64
AD
37962002-01-06 Akim Demaille <akim@epita.fr>
3797
3798 Creating package.m4 from configure.ac causes too many problems.
3799
3800 * tests/Makefile.am (package.m4): Create it by hand,
3801 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
3802
25d81090
AD
38032002-01-06 Akim Demaille <akim@epita.fr>
3804
3805 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
3806 skeleton.h.
3807
a9b8959e
PE
38082002-01-04 Paul Eggert <eggert@twinsun.com>
3809
3810 * doc/bison.texinfo (Debugging):
3811 Remove YYSTDERR; it's no longer defined or used.
3812 Also, s/cstdio.h/cstdio/.
3813
25d81090
AD
38142002-01-03 Akim Demaille <akim@epita.fr>
3815
3816 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
3817
1109455c
AD
38182002-01-03 Akim Demaille <akim@epita.fr>
3819
3820 * src/parse-skel.y (process_skeleton): Don't bind the parser's
3821 tracing code to --trace, wait for a better --trace option, with
3822 args.
3823
7ea5e977
AD
38242002-01-03 Akim Demaille <akim@epita.fr>
3825
3826 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
3827 The ISO C++ standard is extremely clear about it: stderr is
3828 considered a macro, not a regular symbol (see table 94 `Header
3829 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
3830 Therefore std:: does not apply to it. It still does with fprintf.
3831 Also, s/cstdio.h/cstdio/.
3832
fab5b110
AD
38332002-01-03 Akim Demaille <akim@epita.fr>
3834
3835 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
3836 for non system headers.
3837
aed7fd9b
AD
38382002-01-02 Akim Demaille <akim@epita.fr>
3839
3840 Equip the skeleton chain with location tracking, runtime trace,
3841 pure parser and scanner.
3842
3843 * src/parse-skel.y: Request a pure parser, locations, and prefix
3844 renaming.
3845 (%union): Having several members with the same type does not help
3846 type mismatches, simplify.
3847 (YYPRINT, yyprint): New.
3848 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
3849 (skel_error): this.
3850 Handle locations.
3851 * src/scan-skel.l: Adjust to these changes.
3852 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
3853 (LOCATION_PRINT, skel_control_t): New.
3854
24fad99e
AD
38552001-12-30 Akim Demaille <akim@epita.fr>
3856
3857 * src/parse-skel.y: Get rid of the shift/reduce conflict:
3858 replace `gb' with BLANKS.
3859 * src/scan-skel.l: Adjust.
3860
a4b36db4
AD
38612001-12-30 Akim Demaille <akim@epita.fr>
3862
3863 * src/system.h: We don't need nor want bcopy.
3864 Throw away MS-DOS crap: we don't need getpid.
3865 * configure.in: We don't need strndup. It was even causing
3866 problems: because Flex includes the headers *before* us,
3867 _GNU_SOURCE is not defined by config.h, and therefore strndup was
3868 not visible.
3869 * lib/xstrndup.c: New.
3870 * src/scan-skel.l: Use it.
3871 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
3872 * src/parse-skel.y: Use %directives instead of #defines.
3873
1239777d
AD
38742001-12-30 Akim Demaille <akim@epita.fr>
3875
3876 * src/skeleton.h: New.
3877 * src/output.c (output_parser, output_master_parser): Remove, dead
3878 code.
3879 * src/output.h (get_lines_number, actions_output, guards_output)
3880 (token_definitions_output): Prototype them.
3881 * src/parse-skel.y: Add the license notice.
3882 Include output.h and skeleton.h.
3883 (process_skeleton): Returns void, and takes a single parameter.
3884 * src/scan-skel.l: Add the license notice.
3885 Include skeleton.h.
3886 Don't use %option yylineno: it seems that then Flex imagines
3887 REJECT has been used, and therefore it won't reallocate its
3888 buffers (which makes no other sense to me than a bug). It results
3889 in warnings for `unused: yy_flex_realloc'.
3890
9b3add5b
RA
38912001-12-30 Robert Anisko <robert.anisko@epita.fr>
3892
3893 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3894 (MUSCLE_INSERT_PREFIX): ...to there.
3895 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
3896 (MUSCLE_INSERT_PREFIX): Move from here...
3897
3898 * src/bison.hairy: Add a section directive. Put braces around muscle
3899 names. This parser skeleton is still broken, but Bison should not
3900 choke on a bad muscle 'syntax'.
3901 * src/bison.simple: Add a section directive. Put braces around muscle
3902 names.
3903
3904 * src/files.h (strsuffix, stringappend): Add declarations.
3905 (tab_extension): Add declaration.
3906 (short_base_name): Add declaration.
3907
3908 * src/files.c (strsuffix, stringappend): No longer static. These
3909 functions are used in the skeleton parser.
3910 (tab_extension): New.
3911 (compute_base_names): Use the computations done in this function
fab5b110 3912 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
3913 names.
3914 (short_base_name): No longer static.
3915
3916 * src/output.c (output_skeleton): New.
3917 (output): Disable call to output_master_parser, and give a try to
3918 a new skeleton handling system.
3919 (guards_output, actions_output): No longer static.
3920 (token_definitions_output, get_lines_number): No longer static.
3921
3922 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
3923
fab5b110 3924 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
3925 parse-skel.y.
3926
3927 * src/parse-skel.y: New file.
3928 * src/scan-skel.l: New file.
3929
b5b61c61
AD
39302001-12-29 Akim Demaille <akim@epita.fr>
3931
3932 %name-prefix is broken.
3933
3934 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
3935 Adjust all dependencies.
3936 * tests/headers.at (export YYLTYPE): Strengthen this test: use
3937 %name-prefix.
3938
3939 Renaming yylval but not yylloc is not consistent. Now we do.
3940
3941 * src/bison.simple: Prefix yylloc if used.
3942 * doc/bison.texinfo (Decl Summary): Document that.
3943
8c9a50be
AD
39442001-12-29 Akim Demaille <akim@epita.fr>
3945
3946 * doc/bison.texinfo: Promote `%long-directive' over
3947 `%long_directive'.
3948 Remove all references to fixed-output-files, yacc is enough.
3949
d99361e6
AD
39502001-12-29 Akim Demaille <akim@epita.fr>
3951
3952 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
3953 user prologue. These are defaults.
3954 * tests/actions.at (Mid-rule actions): Make sure the user can
3955 define YYDEBUG and YYERROR_VERBOSE.
3956
b9cecb91
AD
39572001-12-29 Akim Demaille <akim@epita.fr>
3958
3959 * src/output.c (header_output): Don't forget to export YYLTYPE and
3960 yylloc.
3961 * tests/headers.at (export YYLTYPE): New, make sure it does.
3962 * tests/regression.at (%union and --defines, Invalid CPP headers):
3963 Move to...
3964 * tests/headers.at: here.
3965
aea13e97
AD
39662001-12-29 Akim Demaille <akim@epita.fr>
3967
3968 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
3969
931394cb
AD
39702001-12-29 Akim Demaille <akim@epita.fr>
3971
3972 * tests/actions.at (Mid-rule actions): Output on a single line
3973 instead of several.
3974
704a47c4
AD
39752001-12-29 Akim Demaille <akim@epita.fr>
3976
3977 * doc/bison.texinfo: Formatting changes.
3978
091e20bb
AD
39792001-12-29 Akim Demaille <akim@epita.fr>
3980
3981 Don't store the token defs in a muscle, just be ready to output it
3982 on command. Now possible via `symbols'. Fixes a memory leak.
3983
3984 * src/output.c (token_definitions_output): New.
3985 (output_parser, header_output): Use it.
3986 * src/reader.c (symbols_save): Remove.
3987
cce71710
AD
39882001-12-29 Akim Demaille <akim@epita.fr>
3989
3990 * src/bison.simple: Do not provide a default for YYSTYPE and
3991 YYLTYPE before the user's prologue. Otherwise it's hardly... a
3992 default.
3993
82c035a8
AD
39942001-12-29 Akim Demaille <akim@epita.fr>
3995
3996 Mid-rule actions are simply... ignored!
3997
3998 * src/reader.c (readgram): Be sure to attach mid-rule actions to
3999 the empty-rule associated to the dummy symbol, not to the host
4000 rule.
4001 * tests/actions.at (Mid-rule actions): New.
4002
8419d367
AD
40032001-12-29 Akim Demaille <akim@epita.fr>
4004
4005 Memory leak.
4006
4007 * src/reader.c (reader): Free grammar.
4008
375d5806
AD
40092001-12-29 Akim Demaille <akim@epita.fr>
4010
4011 Memory leak.
4012
4013 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
4014 since it allocates it for each state, although only one is needed.
4015 (allocate_storage): Do it here.
4016
f51cb8ff
AD
40172001-12-29 Akim Demaille <akim@epita.fr>
4018
4019 * src/options.h, src/options.c (create_long_option_table): Rename
4020 as...
4021 (long_option_table_new): this, with a clearer prototype.
4022 (percent_table): Remove, unused,
4023 * src/getargs.c (getargs): Adjust.
4024
29e88316
AD
40252001-12-29 Akim Demaille <akim@epita.fr>
4026
4027 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
4028 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
4029 as states.
4030
b9f71f19
AD
40312001-12-29 Akim Demaille <akim@epita.fr>
4032
4033 * src/lalr.c (build_relations): Rename `states' as `states1'.
4034 Sorry, I don't understand exactly what it is, no better name...
4035
1a2b5d37
AD
40362001-12-29 Akim Demaille <akim@epita.fr>
4037
4038 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
4039 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
4040 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
4041 as rules.
4042
1cca533e
AD
40432001-12-29 Akim Demaille <akim@epita.fr>
4044
4045 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
4046 ago.
4047
c03ae966
AD
40482001-12-29 Akim Demaille <akim@epita.fr>
4049
4050 * src/reader.c, src/reader.h (user_toknums): Remove.
4051 Adjust all users to use symbols[i]->user_token_number.
4052
5a670b1e
AD
40532001-12-29 Akim Demaille <akim@epita.fr>
4054
4055 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
4056 Adjust all users to use symbols[i]->prec or ->assoc.
4057
ad949da9
AD
40582001-12-29 Akim Demaille <akim@epita.fr>
4059
4060 * src/reader.c, src/reader.h (tags): Remove.
4061 Adjust all users to use symbols[i]->tag.
4062
0e78e603
AD
40632001-12-29 Akim Demaille <akim@epita.fr>
4064
4065 * src/gram.h, src/gram.c (symbols): New, similar to state_table
4066 and rule_table.
4067 * src/reader.c (packsymbols): Fill this table.
4068 Drop sprec.
4069 * src/conflicts.c (resolve_sr_conflict): Adjust.
4070 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
4071 single table.
4072 Use symbols[i]->tag instead of tags[i].
4073
213e640e
AD
40742001-12-29 Akim Demaille <akim@epita.fr>
4075
4076 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
4077 In addition, put a comment in there, to replace...
4078 * tests/regression.at (%union and C comments): Remove.
4079
e7b8bef1
AD
40802001-12-29 Akim Demaille <akim@epita.fr>
4081
4082 * tests/regression.at (Web2c Actions): Blindly move the actual
4083 output as expected output. The contents *seem* right to me, but I
4084 can't pretend reading perfectly parser tables... Nonetheless, all
4085 the other tests pass correctly, the table look OK, even though the
4086 presence of `$axiom' is to be noted: AFAICS it is useless (but
4087 harmless).
4088
b68e7744
AD
40892001-12-29 Akim Demaille <akim@epita.fr>
4090
4091 * src/reader.c (readgram): Don't add the rule 0 if there were no
4092 rules read. In other words, add it _after_ having performed
4093 grammar sanity checks.
4094 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
4095
78d5bae9
AD
40962001-12-29 Akim Demaille <akim@epita.fr>
4097
4098 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
4099 visible, and some states have now a different number.
4100
ff442794
AD
41012001-12-29 Akim Demaille <akim@epita.fr>
4102
4103 * src/reader.c (readgram): Bind the initial rule's lineno to that
4104 of the first rule.
4105 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
4106 (Solved SR Conflicts): Adjust rule 0's line number.
4107
610ab194
AD
41082001-12-29 Akim Demaille <akim@epita.fr>
4109
4110 Fix the `GAWK Grammar' failure.
4111
4112 * src/LR0.c (final_state): Initialize to -1 so that we do compute
4113 the reductions of the first state which was mistakenly confused
4114 with the final state because precisely final_state was initialized
4115 to 0.
4116 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
4117 now noticed by Bison.
4118 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
4119 have a reduction on $default.
4120
29d29c8f
AD
41212001-12-29 Akim Demaille <akim@epita.fr>
4122
4123 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
4124 rule line numbers.
4125 * src/closure.c (print_closure): Likewise.
4126 * src/derives.c (print_derives): Likewise.
4127 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
4128 now.
4129
7c6b64d0
AD
41302001-12-29 Akim Demaille <akim@epita.fr>
4131
4132 * src/lalr.c (lookaheads_print): New.
4133 (lalr): Call it when --trace-flag.
4134 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
4135 are dumped.
4136
3d4daee3
AD
41372001-12-29 Akim Demaille <akim@epita.fr>
4138
4139 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
4140 when walking through ritem, even via rule->rhs.
4141 * src/reduce.c (dump_grammar, useful_production, reduce_output)
4142 (useful_production, useless_nonterminals): Likewise.
4143 (reduce_grammar_tables): Likewise, plus update nritems.
4144 * src/nullable.c (set_nullable): Likewise.
4145 * src/lalr.c (build_relations): Likewise.
4146 * tests/sets.at (Nullable): Adjust.
4147 Fortunately, now, the $axiom is no longer nullable.
4148
9e7f6bbd
AD
41492001-12-29 Akim Demaille <akim@epita.fr>
4150
4151 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
4152 the 0-sentinel.
4153 * src/gram.c (ritem_longest_rhs): Likewise.
4154 * src/reduce.c (nonterminals_reduce): Likewise.
4155 * src/print_graph.c (print_graph): Likewise.
4156 * src/output.c (output_rule_data): Likewise.
4157 * src/nullable.c (set_nullable): Likewise.
4158
255ef638
AD
41592001-12-29 Akim Demaille <akim@epita.fr>
4160
4161 * src/output.c: Comment changes.
4162
0d8a7363
AD
41632001-12-27 Paul Eggert <eggert@twinsun.com>
4164
4165 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
4166 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
4167 Sparc, as they were causing more porting problems than the
4168 (minor) performance improvement was worth.
4169
4170 Also, catch up with 1.31's YYSTD.
4171
3db472b9
AD
41722001-12-27 Akim Demaille <akim@epita.fr>
4173
4174 * src/output.c (output_gram): Rely on nritems, not the
4175 0-sentinel. See below.
4176 Use -1 as separator, not 0.
4177 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
4178 Rely on -1 as separator in yyrhs, instead of 0.
4179 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
4180 twice `Now at end of input', therefore there are two lines less to
4181 expect.
4182
b365aa05
AD
41832001-12-27 Akim Demaille <akim@epita.fr>
4184
4185 * tests/regression.at (Unresolved SR Conflicts):
4186 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
4187 below.
4188
30171f79
AD
41892001-12-27 Akim Demaille <akim@epita.fr>
4190
4191 * src/LR0.c (new_state): Recognize the final state by the fact it
4192 is reached by eoftoken.
4193 (insert_start_shifting_state, insert_eof_shifting_state)
4194 (insert_accepting_state, augment_automaton): Remove, since now
4195 these states are automatically computed from the initial state.
4196 (generate_states): Adjust.
4197 * src/print.c: When reporting a rule number to the user, substract
4198 1, so that the axiom rule is rule 0, and the first user rule is 1.
4199 * src/reduce.c: Likewise.
4200 * src/print_graph.c (print_core): For the time being, just as for
4201 the report, depend upon --trace-flags to dump the full set of
4202 items.
4203 * src/reader.c (readgram): Once the grammar read, insert the rule
4204 0: `$axiom: START-SYMBOL $'.
4205 * tests/set.at: Adjust: rule 0 is now displayed, and since the
4206 number of the states has changed (the final state is no longer
4207 necessarily the last), catch up.
4208
75142d45
AD
42092001-12-27 Akim Demaille <akim@epita.fr>
4210
4211 Try to make the use of the eoftoken valid. Given that its value
4212 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
4213 is used instead of > 0 where appropriate, (ii), depend upon nritems
4214 instead of the 0-sentinel.
4215
4216 * src/gram.h, src/gram.c (nritems): New.
4217 Expected to be duplication of nitems, but for the time being...
4218 * src/reader.c (packgram): Assert nritems and nitems are equal.
4219 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
4220 * src/closure.c (print_closure, print_fderives): Likewise.
4221 * src/gram.c (ritem_print): Likewise.
4222 * src/print.c (print_core, print_grammar): Likewise.
4223 * src/print_graph.c: Likewise.
4224
b7c49edf
AD
42252001-12-27 Akim Demaille <akim@epita.fr>
4226
4227 * src/main.c (main): If there are complains after grammar
4228 reductions, then output the report anyway if requested, then die.
4229 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
4230 * src/reader.c (eoftoken): New.
4231 (parse_token_decl): If the token being defined has value `0', it
4232 is the eoftoken.
4233 (packsymbols): No longer hack `tags' to insert `$' by hand.
4234 Be sure to preserve the value of the eoftoken.
4235 (reader): Make sure eoftoken is defined.
4236 Initialize nsyms to 0: now eoftoken is created just like the others.
4237 * src/print.c (print_grammar): Don't special case the eof token.
4238 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
4239 lie anyway, albeit pleasant.
4240 * tests/calc.at: Exercise error messages with eoftoken.
4241 Change the grammar so that empty input is invalid.
4242 Adjust expectations.
4243 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
4244
ec2da99f
AD
42452001-12-27 Akim Demaille <akim@epita.fr>
4246
4247 * configure.in: Check the protos of strchr ans strspn.
4248 Replace strchr if needed.
4249 * src/system.h: Provide the protos of strchr, strspn and memchr if
4250 missing.
4251 * lib/strchr.c: New.
4252 * src/reader.c (symbols_save): Use strchr.
4253
8adfa272
AD
42542001-12-27 Akim Demaille <akim@epita.fr>
4255
4256 * src/print.c, src/print_graph.c (escape): New.
4257 Use it to quote the TAGS outputs.
4258 * src/print_graph.c (print_state): Now errors are in red, and
4259 reductions in green.
4260 Prefer high to wide: output the state number on a line of its own.
4261
80dac38c
AD
42622001-12-27 Akim Demaille <akim@epita.fr>
4263
4264 * src/state.h, src/state.c (reductions_new): New.
4265 * src/LR0.c (set_state_table): Let all the states have a
4266 `reductions', even if reduced to 0.
4267 (save_reductions): Adjust.
4268 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
4269 * src/print.c (print_reductions, print_actions): Adjust.
4270 * src/output.c (action_row): Adjust.
4271
2cec70b9
AD
42722001-12-27 Akim Demaille <akim@epita.fr>
4273
4274 * src/state.h, src/state.c (errs_new, errs_dup): New.
4275 * src/LR0.c (set_state_table): Let all the states have an errs,
4276 even if reduced to 0.
4277 * src/print.c (print_errs, print_reductions): Adjust.
4278 * src/output.c (output_actions, action_row): Adjust.
4279 * src/conflicts.c (resolve_sr_conflict): Adjust.
4280
13ca549a
AD
42812001-12-27 Akim Demaille <akim@epita.fr>
4282
4283 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
4284
5092aba5
AD
42852001-12-27 Akim Demaille <akim@epita.fr>
4286
4287 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
4288 * src/print.c: here.
4289 (lookaheadset, shiftset): New, used as additional storage by
4290 print_reductions.
4291 (print_results): Adjust.
4292 (print_shifts, print_gotos, print_errs): New, extracted from...
4293 (print_actions): here.
4294 * src/print_graph.c (print_actions): Remove dead code.
4295
11e2beca
AD
42962001-12-27 Akim Demaille <akim@epita.fr>
4297
4298 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
4299 `$n' and `@n'.
4300
dac3c910
AD
43012001-12-27 Akim Demaille <akim@epita.fr>
4302
4303 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
4304 (build_relations): Adjust.
4305
d0b0fefa
AD
43062001-12-27 Akim Demaille <akim@epita.fr>
4307
4308 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
4309 duplication.
4310
adc8c848
AD
43112001-12-27 Akim Demaille <akim@epita.fr>
4312
4313 * src/reader.c (packgram): Catch nitems overflows.
4314
14d293ac
AD
43152001-12-27 Akim Demaille <akim@epita.fr>
4316
4317 * src/files.c, src/files.h (guard_obstack): Remove.
4318 * src/output.c (output): Adjust.
4319 * src/reader.c (parse_braces): New, factoring...
4320 (copy_action, copy_guard): these two which are renamed as...
4321 (parse_action, parse_guard): these.
4322 As a voluntary consequence, using braces around guards is now
4323 mandatory.
4324
f499b062
AD
43252001-12-27 Akim Demaille <akim@epita.fr>
4326
4327 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
4328 * src/reader.c (symbol_list): `guard' and `guard_line' are new
4329 members.
4330 (symbol_list_new): Adjust.
4331 (copy_action): action_line is the first line, not the last.
4332 (copy_guard): Just as for actions, store the `action' only, not
4333 the switch/case/break flesh.
4334 Don't parse the user action that might follow the guard, let...
4335 (readgram): do it, i.e., now, there can be an action after a
4336 guard.
4337 In other words the guard is just explicitly optional.
4338 (packgram): Adjust.
4339 * src/output.c (guards_output): New.
4340 (output_parser): Call it when needed.
4341 (output): Also free the guard and attrs obstacks.
4342 * src/files.c, src/files.h (obstack_save): Remove.
4343 (output_files): Remove.
4344 As a result, if one needs the former `.act' file, using an
4345 appropriate skeleton which requires actions and guards is now
4346 required.
4347 * src/main.c (main): Adjust.
4348 * tests/semantic.at: New.
4349 * tests/regression.at: Use `input.y' as input file name.
4350 Avoid 8+3 problems by requiring input.c when the test needs the
4351 parser.
4352
d945f5cd
AD
43532001-12-27 Akim Demaille <akim@epita.fr>
4354
4355 * src/reader.c (symbol_list_new): Be sure to initialize all the
4356 fields.
4357
d200e455
AD
43582001-12-27 Akim Demaille <akim@epita.fr>
4359
4360 All the hacks using a final pseudo state are now useless.
4361
4362 * src/LR0.c (set_state_table): state_table holds exactly nstates.
4363 * src/lalr.c (nLA): New.
4364 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
4365 instead of lookaheadsp from the pseudo state (nstate + 1).
4366
f9507c28
AD
43672001-12-27 Akim Demaille <akim@epita.fr>
4368
4369 * src/output.c (action_row, token_actions): Use a state_t instead
4370 of a integer, and nlookaheads instead of the following state's
4371 lookaheadsp.
4372
065fbd27
AD
43732001-12-27 Akim Demaille <akim@epita.fr>
4374
4375 * src/conflicts.c (log_resolution, flush_shift)
4376 (resolve_sr_conflict, set_conflicts, solve_conflicts)
4377 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
4378 (conflicts_print, print_reductions): Use a state_t instead of an
4379 integer when referring to a state.
4380 As much as possible, depend upon nlookaheads, instead of the
4381 `lookaheadsp' member of the following state (since lookaheads of
4382 successive states are successive, the difference between state n + 1
4383 and n served as the number of lookaheads for state n).
4384 * src/lalr.c (add_lookback_edge): Likewise.
4385 * src/print.c (print_core, print_actions, print_state)
4386 (print_results): Likewise.
4387 * src/print_graph.c (print_core, print_actions, print_state)
4388 (print_graph): Likewise.
4389 * src/conflicts.h: Adjust.
4390
1b177bd7
AD
43912001-12-27 Akim Demaille <akim@epita.fr>
4392
4393 * src/bison.hairy: Formatting/comment changes.
4394 ANSIfy.
4395 Remove `register' indications.
4396 Add plenty of `static'.
4397
7742ddeb
AD
43982001-12-27 Akim Demaille <akim@epita.fr>
4399
4400 * src/output.c (prepare): Drop the muscle `ntbase' which
4401 duplicates ntokens.
4402 * src/bison.simple: Formatting/comment changes.
4403 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
4404 is an undocumented synonym.
4405
1fa14068
AD
44062001-12-22 Akim Demaille <akim@epita.fr>
4407
4408 * src/output.c (output_table_data): Change the prototype to use
4409 `int' for array ranges: some invocations do pass an int, not a
4410 short.
4411 Reported by Wayne Green.
4412
b9752825
AD
44132001-12-22 Akim Demaille <akim@epita.fr>
4414
4415 Some actions of web2c.y are improperly triggered.
4416 Reported by Mike Castle.
4417
4418 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
4419 * tests/regression.at (Web2c): Rename as...
4420 (Web2c Report): this.
4421 (Web2c Actions): New.
4422
776209d6
AD
44232001-12-22 Akim Demaille <akim@epita.fr>
4424
4425 Reductions in web2c.y are improperly reported.
4426 Reported by Mike Castle.
4427
4428 * src/conflicts.c (print_reductions): Fix.
4429 * tests/regression.at (Web2c): New.
4430
275fc3ad
AD
44312001-12-18 Akim Demaille <akim@epita.fr>
4432
4433 Some host fail on `assert (!"foo")', which expands to
4434 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
4435 Reported by Nelson Beebee.
4436
4437 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
4438 `#define it_succeeded 0' and `assert (it_succeeded)'.
4439
897668ee
MA
44402001-12-17 Marc Autret <autret_m@epita.fr>
4441
4442 * src/bison.simple: Don't hard code the skeleton line and filename.
4443 * src/output.c (output_parser): Rename 'line' as 'output_line'.
4444 New line counter 'skeleton_line' (skeleton-line muscle).
4445
ab3399e0
PE
44462001-12-17 Paul Eggert <eggert@twinsun.com>
4447
4448 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
4449 YYDEBUG must be defined to a nonzero value.
4450
4451 * src/bison.simple (yytname): Do not assume that the user defines
4452 YYDEBUG to a properly parenthesized expression.
4453
3877f72b
AD
44542001-12-17 Akim Demaille <akim@epita.fr>
4455
4456 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
4457 nlookaheads is a new member.
4458 Adjust all users.
4459 * src/lalr.h (nlookaheads): Remove this orphan declaration.
4460 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
4461 state.
776209d6 4462
331dbc1b
AD
44632001-12-17 Akim Demaille <akim@epita.fr>
4464
4465 * src/files.h, src/files.c (open_files, close_files): Remove.
4466 * src/main.c (main): Don't open/close files, nor invoke lex_free,
4467 let...
4468 * src/reader.c (reader): Do it.
776209d6 4469
be750e4c
AD
44702001-12-17 Akim Demaille <akim@epita.fr>
4471
4472 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 4473
709ae8c6
AD
44742001-12-17 Akim Demaille <akim@epita.fr>
4475
4476 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
4477 (flush_reduce): New.
4478 (resolve_sr_conflict): Adjust.
776209d6 4479
f87685c3
AD
44802001-12-17 Akim Demaille <akim@epita.fr>
4481
4482 * src/output.c (output_obstack): Be static and rename as...
4483 (format_obstack): this, to avoid any confusion with files.c's
4484 output_obstack.
4485 * src/reader.h (muscle_obstack): Move to...
4486 * src/output.h: here, since it's defined in output.c.
4487
837491d8
AD
44882001-12-17 Akim Demaille <akim@epita.fr>
4489
4490 * src/output.c (action_row, save_column, default_goto)
4491 (sort_actions, matching_state, pack_vector): Better variable
4492 locality.
4493
796d61fb
AD
44942001-12-17 Akim Demaille <akim@epita.fr>
4495
4496 * src/output.c: Various formatting changes.
776209d6 4497
64d15509
AD
44982001-12-17 Akim Demaille <akim@epita.fr>
4499
4500 * src/files.c (output_files): Free the output_obstack.
4501 * src/main.c (main): Call print and print_graph conditionally.
4502 * src/print.c (print): Work unconditionally.
4503 * src/print_graph.c (print_graph): Work unconditionally.
4504 * src/conflicts.c (log_resolution): Output only if verbose_flag.
4505
fbc8ecb7
MA
45062001-12-16 Marc Autret <autret_m@epita.fr>
4507
4508 * src/output.c (actions_output): Fix. When we use %no-lines,
4509 there is one less line per action.
4510
f0440388
MA
45112001-12-16 Marc Autret <autret_m@epita.fr>
4512
4513 * src/bison.simple: Remove a useless #line directive.
4514 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
4515 * src/output.c (get_lines_number): New.
776209d6 4516 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
4517 output muscles.
4518 Fix line numbering.
4519 (actions_output): Computes the number of lines taken by actions.
4520 (output_master_parser): Insert new skeleton which is the name of
4521 the output parser file name.
4522
a79986b8
MA
45232001-12-15 Marc Autret <autret_m@epita.fr>
4524
4525 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
4526
4ec8e00f
MA
45272001-12-15 Marc Autret <autret_m@epita.fr>
4528
4529 * src/output.c (output_gram): Keep track of the hairy one.
4530
1a4648ff
AD
45312001-12-15 Akim Demaille <akim@epita.fr>
4532
4533 Make `make distcheck' work.
4534
4535 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
4536 system.h which uses libgettext.h.
4537
9c2c67e6
AD
45382001-12-15 Akim Demaille <akim@epita.fr>
4539
4540 * src/nullable.c (set_nullable): Useless rules must be skipped,
4541 otherwise, since we range over their symbols, we might look at a
4542 nonterminal which no longer ``exists'', i.e., it is not counted in
4543 `nvars', hence we overflow our arrays.
4544
93ede233
AD
45452001-12-15 Akim Demaille <akim@epita.fr>
4546
4547 The header can also be produced directly, without any obstack!
4548 Yahoo!
4549
4550 * src/files.c, src/files.h (defines_obstack): Remove.
4551 (compute_header_macro): Global.
4552 (defines_obstack_save): Remove.
4553 * src/reader.c (parse_union_decl): No longer output to
4554 defines_obstack: its content can be found in the `stype' muscle
4555 anyway.
4556 (output_token_translations): Merge into...
4557 (symbols_output): this.
4558 Rename as...
4559 (symbols_save): this.
4560 (reader): Adjust.
4561 * src/output.c (header_output): New.
4562 (output): Call it.
4563
2666f928
AD
45642001-12-15 Akim Demaille <akim@epita.fr>
4565
4566 * src/reader.c (parse_union_decl): Instead of handling two obstack
4567 simultaneously, use one to define the `stype' muscle, and use the
4568 value of the latter to fill defines_obstack.
4569 (copy_comment): Remove.
4570 (copy_comment2): Work for a single obstack.
4571 Rename as...
4572 (copy_comment): this.
4573
428046f8
AD
45742001-12-15 Akim Demaille <akim@epita.fr>
4575
4576 * src/lex.c, src/lex.h (xgetc): No longer static.
4577 * src/reader.c (parse_union_decl): Revamp.
4578
ea52d706
AD
45792001-12-15 Akim Demaille <akim@epita.fr>
4580
4581 Still making progress in separating Bison into (i) input, (ii)
4582 process, (iii) output: now we can directly output the parser file
4583 without using table_obstack at all.
4584
4585 * src/files.c, src/files.h (table_obstack): Bye bye.
4586 (parser_file_name): New.
4587 * src/files.c (compute_output_file_names): Compute it.
4588 * src/output.c (actions_output, output_parser)
4589 (output_master_parser): To a file instead of an obstack.
4590
3f96f4dc
AD
45912001-12-15 Akim Demaille <akim@epita.fr>
4592
4593 Attach actions to rules, instead of pre-outputting them to
4594 actions_obstack.
4595
4596 * src/gram.h (rule_t): action and action_line are new members.
4597 * src/reader.c (symbol_list): Likewise.
4598 (copy_action): Save the actions within the rule.
4599 (packgram): Save them in rule_table.
4600 * src/output.c (actions_output): New.
4601 (output_parser): Use it on `%%actions'.
4602 (output_rule_data): Don't free rule_table.
4603 (output): Do it.
4604 (prepare): Don't save the `action' muscle.
4605 * src/bison.simple: s/%%action/%%actions/.
4606
51576fb3
AD
46072001-12-15 Akim Demaille <akim@epita.fr>
4608
4609 * src/reader.c (copy_action): When --yacc, don't append a `;'
4610 to the user action: let it fail if lacking.
dee049eb 4611 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 4612
2648a72d
AD
46132001-12-14 Akim Demaille <akim@epita.fr>
4614
4615 * src/lex.c (literalchar): Simply return the char you decoded, non
4616 longer mess around with obstacks and int pointers.
4617 Adjust all callers.
4618
92790e5b
AD
46192001-12-14 Akim Demaille <akim@epita.fr>
4620
4621 * src/lex.c (literalchar): Don't escape the special characters,
4622 just decode them, and keep them as char (before, eol was output as
4623 the 2 char string `\n' etc.).
4624 * src/output.c (output_rule_data): Use quotearg to output the
4625 token strings.
4626
927c1557
PE
46272001-12-13 Paul Eggert <eggert@twinsun.com>
4628
4629 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
4630 Do not infringe on the global user namespace when using C++.
4631 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
4632 All uses of `fprintf' and `stderr' changed.
4633
4634 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
4635
ed8e1f68
AD
46362001-12-13 Akim Demaille <akim@epita.fr>
4637
4638 The computation of nullable is broken: it doesn't handle empty
4639 RHS's properly.
4640
4641 * tests/torture.at (GNU AWK Grammar): New.
4642 * tests/sets.at (Nullable): New.
4643 * src/nullable.c (set_nullable): Instead of blindly looping over
4644 `ritems', loop over the rules, and then over their rhs's.
4645
4646 Work around Autotest bugs.
4647
4648 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
4649 frame, because Autotest understand lines starting with a `+' as
4650 traces from the shell. Then, they are not processed properly.
4651 Admittedly an Autotest bug, but we don't have time to wait for
4652 Autotest to catch up.
4653 * tests/regression.at (Broken Closure): Adjust to the new table
4654 frames.
4655 Move to...
4656 * tests/sets.at: here.
4657
cb581495
AD
46582001-12-13 Akim Demaille <akim@epita.fr>
4659
4660 * src/closure.c (closure): Use nrules instead of playing tricks
4661 with BITS_PER_WORD.
4662
2e729273
AD
46632001-12-13 Akim Demaille <akim@epita.fr>
4664
4665 * src/print.c (print_actions): Output the handling of `$' as the
4666 traces do: shifting the token EOF. Before EOF was treated as a
4667 nonterminal.
4668 * tests/regression.at: Adjust some tests.
4669 * src/print_graph.c (print_core): Complete the set of items via
4670 closure. The next-to-final and final states are still unsatisfying,
4671 but that's to be addressed elsewhere.
4672 No longer output the rule numbers, but do output the state number.
4673 A single loop for the shifts + gotos is enough, but picked a
4674 distinct color for each.
4675 (print_graph): Initialize and finalize closure.
4676
107f7dfb
AD
46772001-12-13 Akim Demaille <akim@epita.fr>
4678
4679 * src/reader.c (readgram): Remove dead code, an strip useless
4680 braces.
4681 (get_type): Remove, unused.
4682
9b53a24f
AD
46832001-12-12 Akim Demaille <akim@epita.fr>
4684
4685 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
4686 on that of lib/error.c.
4687
dbfb6dcd
AD
46882001-12-12 Akim Demaille <akim@epita.fr>
4689
4690 Some hosts don't like `/' in includes.
4691
4692 * src/system.h: Include libgettext.h without qualifying the path.
4693 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
4694 $(top_srcdir).
4695
c25fb648
MA
46962001-12-11 Marc Autret <autret_m@epita.fr>
4697
4698 * src/output.c (output_parser): Remove useless muscle.
4699
710ddc4f
MA
47002001-12-11 Marc Autret <autret_m@epita.fr>
4701
4702 * src/bison.simple: Remove #line just before %%epilogue. It
4703 is now handled in ...
4704 * src/reader.c (read_additionnal_code): Add the output of a
4705 #line for the epilogue.
4706
e83d80b8
MA
47072001-12-10 Marc Autret <autret_m@epita.fr>
4708
927c1557 4709 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
4710 replace precedent remove.
4711 * src/bison.simple: Remove #line before %%prologue because
4712 %%input-line is wrong at this time.
4713
971d5158
MA
47142001-12-10 Marc Autret <autret_m@epita.fr>
4715
4716 * src/reader.c (symbols_output): Clean up.
927c1557 4717 * src/output.c (output_gram, output): Clean up.
971d5158 4718
5edafffd
AD
47192001-12-10 Akim Demaille <akim@epita.fr>
4720
4721 * src/lalr.c (initialize_lookaheads): New. Extracted from...
4722 * src/LR0.c (set_state_table): here.
4723 * src/lalr.c (lalr): Call it.
4724
0279f8e9
AD
47252001-12-10 Akim Demaille <akim@epita.fr>
4726
4727 * src/state.h (shifts): Remove the `number' member: shifts are
4728 attached to state, hence no longer need to be labelled with a
4729 state number.
4730
190c4f5f
AD
47312001-12-10 Akim Demaille <akim@epita.fr>
4732
4733 Now that states have a complete set of members, the linked list of
4734 shifts is useless: just fill directly the state's shifts member.
4735
4736 * src/state.h (shifts): Remove the `next' member.
4737 * src/LR0.c (first_state, last_state): Remove.
4738 Adjust the callers.
4739 (augment_automaton): Don't look for the shifts that must be added
4740 a shift on EOF: it is those of the state we looked for! But now,
4741 since shifts are attached, it is no longer needed to looking
4742 merely by its id: its number.
4743
2a73b93d
AD
47442001-12-10 Akim Demaille <akim@epita.fr>
4745
4746 * src/LR0.c (augment_automaton): Better variable locality.
4747 Remove an impossible branch: if there is a state corresponding to
4748 the start symbol being shifted, then there is shift for the start
4749 symbol from the initial state.
4750
74392f6a
AD
47512001-12-10 Akim Demaille <akim@epita.fr>
4752
4753 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
4754 only when appropriate: when insert_start_shifting_state' is not
4755 invoked.
4756 * tests/regression.at (Rule Line Numbers): Adjust.
4757
37c82725
AD
47582001-12-10 Akim Demaille <akim@epita.fr>
4759
4760 * src/LR0.c (augment_automaton): Now that all states have shifts,
4761 merge the two cases addition shifts to the initial state.
4762
6a164e0c
AD
47632001-12-10 Akim Demaille <akim@epita.fr>
4764
4765 * src/lalr.c (set_state_table): Move to...
4766 * src/LR0.c: here.
4767 * src/lalr.c (lalr): Don't call it...
4768 * src/LR0.c (generate_states): do it.
4769 * src/LR0.h (first_state): Remove, only the table is used.
4770
7215de24
AD
47712001-12-10 Akim Demaille <akim@epita.fr>
4772
4773 * src/LR0.h (first_shift, first_reduction): Remove.
4774 * src/lalr.c: Don't use first_shift: find shifts through the
4775 states.
4776
80e25d4d
AD
47772001-12-10 Akim Demaille <akim@epita.fr>
4778
4779 * src/LR0.c: Attach shifts to states as soon as they are
4780 computed.
4781 * src/lalr.c (set_state_table): Instead of assigning shifts to
4782 state, just assert that the mapping was properly done.
4783
0ab3728b
AD
47842001-12-10 Akim Demaille <akim@epita.fr>
4785
4786 * src/LR0.c (insert_start_shift): Rename as...
4787 (insert_start_shifting_state): this.
4788 (insert_eof_shifting_state, insert_accepting_state): New.
4789 (augment_automaton): Adjust.
4790 Better locality of the variables.
4791 When looking if the start_symbol is shifted from the initial
4792 state, using `while (... symbol != start_symbol ...)' sounds
4793 better than `while (... symbol < start_symbol ...)': If fail
4794 to see how the order between symbols could be relevant!
4795
78af9bbc
AD
47962001-12-10 Akim Demaille <akim@epita.fr>
4797
4798 * src/getargs.h: Don't declare `spec_name_prefix' and
4799 `spec_file_prefix', declared by src/files.h.
4800 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
4801 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
4802 * src/output.c (prepare): Adjust.
4803 * src/reader.c (symbols_output): Likewise.
4804 * src/vmsgetargs.c: Vaguely adjust, but who cares?
4805
bdef2a41
AD
48062001-12-10 Akim Demaille <akim@epita.fr>
4807
4808 * src/muscle_tab.c (muscle_init): NULL is a better default than
4809 `"0"'.
4810
3735969c
AD
48112001-12-10 Akim Demaille <akim@epita.fr>
4812
4813 * src/reader.c (reader): Calling symbols_output once is enough.
4814
49701457
AD
48152001-12-10 Akim Demaille <akim@epita.fr>
4816
4817 Now that states have a complete set of members, the linked list of
4818 reductions is useless: just fill directly the state's reductions
4819 member.
4820
4821 * src/state.h (struct reductions): Remove member `number' and
4822 `next'.
4823 * src/LR0.c (first_reduction, last_reduction): Remove.
4824 (save_reductions): Don't link the new reductions, store them in
4825 this_state.
4826 * src/lalr.c (set_state_table): No need to attach reductions to
4827 states, it's already done.
4828 * src/output.c (output_actions): No longer free the shifts, then
4829 the reductions, then the states: free all the states and their
4830 members.
4831
0edad749
AD
48322001-12-10 Akim Demaille <akim@epita.fr>
4833
4834 * src/options.c (OPTN, DRTV, BOTH): New.
4835 (option_table): Use them.
4836
0edad749
AD
4837 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
4838 the job of system.h.
4839 * src/options.c: Don't include stdio.h and xalloc.h for the same
4840 reasons.
4841
5449dd0f
AD
48422001-12-10 Akim Demaille <akim@epita.fr>
4843
4844 * src/output.c (output, prepare): Make sure the values of the
4845 muscles `action' and `prologue' are 0-terminated.
4846
a870c567
AD
48472001-12-10 Akim Demaille <akim@epita.fr>
4848
4849 Clean up GCC warnings.
4850
4851 * src/reader.c (copy_action): `buf' is not used.
4852 (parse_skel_decl): Be static.
4853 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
4854 * src/options.h (create_long_option_table): Have a real prototype.
4855 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
4856 (hash_delete_at): Return const void *.
4857 Adjust casts to preserve the const.
4858
80df8768
AD
48592001-12-10 Akim Demaille <akim@epita.fr>
4860
4861 * configure.in: Require 2.52g.
4862 M4 is not needed, but AUTOM4TE is.
4863 * m4/m4.m4: Remove.
4864 * tests/Makefile.am: Adjust.
4865
f693ad14
AD
48662001-12-10 Akim Demaille <akim@epita.fr>
4867
4868 One structure for states is enough, even though theoretically
4869 there are LR(0) states and LALR(1) states.
4870
4871 * src/lalr.h (state_t): Remove.
4872 (state_table): Be state_t **, not state_t *.
4873 * src/state.h (core, CORE_ALLOC): Rename as...
4874 (state_t, STATE_ALLOC): this.
4875 Add the LALR(1) members: shifts, reductions, errs.
4876 * src/LR0.c (state_table): Rename as...
4877 (state_hash): this, to avoid name clashes with the global
4878 `state_table'.
4879 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
4880 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
4881
74ffbcb6
AD
48822001-12-10 Akim Demaille <akim@epita.fr>
4883
4884 Bison dumps core on bash.y.
4885 Reported by Pascal Bart.
4886
4887 * src/warshall.c (bitmatrix_print): New.
4888 (TC): Use it.
4889 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
4890 j must be the outer loop.
4891 * tests/regression.at (Broken Closure): New.
4892
07708e19
AD
48932001-12-05 Akim Demaille <akim@epita.fr>
4894
4895 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
4896 its argument.
4897