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