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