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