]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
[bison.git] / ChangeLog
CommitLineData
9222837b
AD
12002-06-30 Akim Demaille <akim@epita.fr>
2
3 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
4 (item_number_of_rule_number, rule_number_of_item_number): New.
5 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
6 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
7 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
8 Propagate their use.
9 Much remains to be done, in particular wrt `shorts' from types.h.
10
11
260008e5
AD
122002-06-30 Akim Demaille <akim@epita.fr>
13
14 * src/symtab.c (symbol_new): Initialize the `printer' member.
15
16
8a731ca8
AD
172002-06-30 Akim Demaille <akim@epita.fr>
18
19 * src/LR0.c (save_reductions): Remove, replaced by...
20 * src/state.h, src/state.c (state_reductions_set): New.
21 (reductions, errs): Rename as...
22 (reductions_t, errs_t): these.
23 Adjust all dependencies.
24
25
32e1e0a4
AD
262002-06-30 Akim Demaille <akim@epita.fr>
27
28 * src/LR0.c (state_list_t, state_list_append): New.
29 (first_state, last_state): Now symbol_list_t.
30 (this_state): Remove.
31 (new_itemsets, append_states, save_reductions): Take a state_t as
32 argument.
33 (set_states, generate_states): Adjust.
34 (save_shifts): Remove, replaced by...
35 * src/state.h, src/state.c (state_shifts_set): New.
36 (shifts): Rename as...
37 (shifts_t): this.
38 Adjust all dependencies.
39 * src/state.h (state_t): Remove the `next' member.
40
41
e5fb6710
AD
422002-06-30 Akim Demaille <akim@epita.fr>
43
44 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
45 escaped in slot 0.
46
47
482002-06-30 Akim Demaille <akim@epita.fr>
49
50 Use hash.h for the state hash table.
51
52 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
53 (allocate_storage): Use state_hash_new.
54 (free_storage): Use state_hash_free.
55 (new_state, get_state): Adjust.
56 * src/lalr.h, src/lalr.c (states): Move to...
57 * src/states.h (state_t): Remove the `link' member, no longer
58 used.
59 * src/states.h, src/states.c: here.
60 (state_hash_new, state_hash_free, state_hash_lookup)
61 (state_hash_insert, states_free): New.
62 * src/states.c (state_table, state_compare, state_hash): New.
63 * src/output.c (output_actions): Do not free states now, since we
64 still need to know the final_state number in `prepare', called
65 afterwards. Do it...
66 * src/main.c (main): here: call states_free after `output'.
67
68
c7ca99d4
AD
692002-06-30 Akim Demaille <akim@epita.fr>
70
71 Use hash.h for the state hash table.
72
73 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
74 (allocate_storage): Use state_hash_new.
75 (free_storage): Use state_hash_free.
76 (new_state, get_state): Adjust.
77 * src/lalr.h, src/lalr.c (states): Move to...
78 * src/states.h (state_t): Remove the `link' member, no longer
79 used.
80 * src/states.h, src/states.c: here.
81 (state_hash_new, state_hash_free, state_hash_lookup)
82 (state_hash_insert, states_free): New.
83 * src/states.c (state_table, state_compare, state_hash): New.
84 * src/output.c (output_actions): Do not free states now, since we
85 still need to know the final_state number in `prepare', called
86 afterwards. Do it...
87 * src/main.c (main): here: call states_free after `output'.
88
89
df0e7316
AD
902002-06-30 Akim Demaille <akim@epita.fr>
91
92 * src/state.h, src/state.c (state_new): New, extracted from...
93 * src/LR0.c (new_state): here.
94 * src/state.h (STATE_ALLOC): Move to...
95 * src/state.c: here.
96 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
97 * src/state.h, src/state.c: here.
98
99
39f41916
AD
1002002-06-30 Akim Demaille <akim@epita.fr>
101
102 * src/reader.c (gensym): Rename as...
103 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
104 (getsym): Rename as...
105 (symbol_get): this.
106
107
d57650a5
AD
1082002-06-30 Akim Demaille <akim@epita.fr>
109
110 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
111 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
112 * src/output.c, src/print.c, src/print_graph.c: Propagate.
113 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
114
5a08f1ce
AD
1152002-06-30 Akim Demaille <akim@epita.fr>
116
117 Make the test suite pass with warnings checked.
118
119 * tests/actions.at (Printers and Destructors): Improve.
120 Avoid unsigned vs. signed issues.
121 * tests/calc.at: Don't exercise the scanner here, do it...
122 * tests/input.at (Torturing the Scanner): here.
123
124
720623af
PH
1252002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
126
127 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
128 reorganize first lines parallel to yacc.c.
129
fb8135fa
AD
1302002-06-28 Akim Demaille <akim@epita.fr>
131
132 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
133 (b4_token_enum, b4_token_defines): New, factored from...
134 * data/lalr1.cc, data/yacc.c, glr.c: here.
135
41442480
AD
1362002-06-28 Akim Demaille <akim@epita.fr>
137
138 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
139 unused variables.
140 * src/output.c (merger_output): static.
141
e0e5bf84
AD
1422002-06-28 Akim Demaille <akim@epita.fr>
143
144 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
145 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
146 pacify GCC.
147 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 148
676385e2
PH
1492002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
150
151 Accumulated changelog for new GLR parsing features.
152
e0e5bf84 153 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
154 conflicts_total_count.
155 * src/conflicts.h: Ditto.
156 * src/output.c (token_actions): Use the new name.
157 (output_conflicts): Change conflp => conflict_list_heads, and
158 confl => conflict_list for better readability.
159 * data/glr.c: Use the new names.
160 * NEWS: Add self to GLR announcement.
e0e5bf84 161
676385e2
PH
162 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
163
164 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
165 Akim Demaille.
166
167 * data/bison.glr: Change name to glr.c
168 * data/glr.c: Renamed from bison.glr.
169 * data/Makefile.am: Add glr.c
e0e5bf84
AD
170
171 * src/getargs.c:
172
676385e2
PH
173 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
174 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 175
676385e2
PH
176 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
177
178 * data/bison.glr: Be sure to restore the
179 current #line when returning to the skeleton contents after having
180 exposed the input file's #line.
181
182 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
183
184 * data/bison.glr: Bring up to date with changes to bison.simple.
185
186 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
187
188 * data/bison.glr: Correct definitions that use b4_prefix.
189 Various reformatting.
190 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
191 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
192 yytokenp argument; now part of stack.
193 (yychar): Define to behave as documented.
194 (yyclearin): Ditto.
e0e5bf84 195
676385e2
PH
196 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
197
198 * src/reader.h: Add declaration for free_merger_functions.
199
200 * src/reader.c (merge_functions): New variable.
201 (get_merge_function): New function.
202 (free_merger_functions): New function.
203 (readgram): Check for %prec that is not followed by a symbol.
204 Handle %dprec and %merge declarations.
205 (packgram): Initialize dprec and merger fields in rules array.
206
207 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
208 conflict_list_cnt, conflict_list_free): New variables.
209 (table_grow): Also grow conflict_table.
e0e5bf84 210 (prepare_rules): Output dprec and merger tables.
676385e2 211 (conflict_row): New function.
e0e5bf84 212 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
213 default reduction in conflicted states for GLR parser so that there
214 are spaces for the conflict lists.
215 (save_row): Also save conflict information.
216 (token_actions): Allocate conflict list.
217 (merger_output): New function.
218 (pack_vector): Pack conflict table, too.
219 (output_conflicts): New function to output yyconflp and yyconfl.
220 (output_check): Allocate conflict_tos.
221 (output_actions): Output conflict tables, also.
222 (output_skeleton): Output b4_mergers definition.
223 (prepare): Output b4_max_rhs_length definition.
224 Use 'bison.glr' as default skeleton for GLR parsers.
225
226 * src/gram.c (glr_parser): New flag.
227 (grammar_free): Call free_merger_functions.
228
229 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
230 all pairs of conflicting reductions, rather than just all tokens
231 causing conflicts. Needed to size conflict tables.
e0e5bf84 232 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
233 interface.
234 (conflicts_print): Ditto.
235 (count_total_conflicts): New function.
236
237 * src/reader.h (merger_list): New type.
238 (merge_functions): New variable.
239
240 * src/lex.h (tok_dprec, tok_merge): New token types.
241
242 * src/gram.h (rule_s): Add dprec and merger fields.
243 (glr_parser): New flag.
244
245 * src/conflicts.h (count_total_conflicts): New function.
246
247 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
248
249 * doc/bison.texinfo (Generalized LR Parsing): New section.
250 (GLR Parsers): New section.
251 (Language and Grammar): Mention GLR parsing.
252 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
253 Correct typo ("tge" -> "the").
254
255 * data/bison.glr: New skeleton for GLR parsing.
256
257 * tests/cxx-gram.at: New tests for GLR parsing.
258
259 * tests/testsuite.at: Include cxx-gram.at.
260
261 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 262
676385e2
PH
263 * src/parse-gram.y:
264
265 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
266
267 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 268
b5480d74 2692002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
270
271 * src/options.h, src/options.c: Remove.
272 * src/getargs.c (short_options, long_options): New.
273
60491a94
AD
2742002-06-27 Akim Demaille <akim@epita.fr>
275
276 * data/bison.simple, data/bison.c++: Rename as...
277 * data/yacc.c, data/lalr1.cc: these.
278 * doc/bison.texinfo (Environment Variables): Remove.
279
9be0c25b
AD
2802002-06-25 Raja R Harinath <harinath@cs.umn.edu>
281
282 * src/getargs.c (report_argmatch): Initialize strtok().
283
1ae72863
AD
2842002-06-20 Akim Demaille <akim@epita.fr>
285
286 * data/bison.simple (b4_symbol_actions): New, replaces...
287 (b4_symbol_destructor, b4_symbol_printer): these.
288 (yysymprint): Be sure to call YYPRINT only for tokens, and using
289 user token numbers.
290
87542d29
AD
2912002-06-20 Akim Demaille <akim@epita.fr>
292
293 * data/bison.simple (yydestructor): Rename as...
294 (yydestruct): this.
295
1a31ed21
AD
2962002-06-20 Akim Demaille <akim@epita.fr>
297
298 * src/symtab.h, src/symtab.c (symbol_type_set)
299 (symbol_destructor_set, symbol_precedence_set): The location is
300 the last argument.
301 Adjust all callers.
302
e776192e
AD
3032002-06-20 Akim Demaille <akim@epita.fr>
304
305 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
306 internals.
307 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
308 Takes a location.
309 * src/symtab.h, src/symtab.c (symbol_class_set)
310 (symbol_user_token_number_set): Likewise.
311 Adjust all callers.
312 Promote complain_at.
313 * tests/input.at (Type Clashes): Adjust.
314
5c1180b3
AD
3152002-06-20 Akim Demaille <akim@epita.fr>
316
317 * data/bison.simple (YYLEX): Fix the declaration when
318 %pure-parser.
319
e3170060
AD
3202002-06-20 Akim Demaille <akim@epita.fr>
321
322 * data/bison.simple (yysymprint): Don't print the token number,
323 just its name.
324 * tests/actions.at (Destructors): Rename as...
325 (Printers and Destructors): this.
326 Also exercise %printer.
327
253862fd
AD
3282002-06-20 Akim Demaille <akim@epita.fr>
329
330 * data/bison.simple (YYDSYMPRINT): New.
331 Use it to remove many of the #if YYDEBUG/if (yydebug).
332
366eea36
AD
3332002-06-20 Akim Demaille <akim@epita.fr>
334
335 * src/symtab.h, src/symtab.c (symbol_t): printer and
336 printer_location are new members.
337 (symbol_printer_set): New.
338 * src/parse-gram.y (PERCENT_PRINTER): New token.
339 Handle its associated rule.
340 * src/scan-gram.l: Adjust.
341 (handle_destructor_at, handle_destructor_dollar): Rename as...
342 (handle_symbol_code_at, handle_symbol_code_dollar): these.
343 * src/output.c (symbol_printers_output): New.
344 (output_skeleton): Call it.
345 * data/bison.simple (yysymprint): New. Cannot be named yyprint
346 since there are already many grammar files with a user `yyprint'.
347 Replace the calls to YYPRINT to calls to yysymprint.
348 * tests/calc.at: Adjust.
349 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
350 taking advantage of parser very internal details (stack size!).
351
4f25ebb0
AD
3522002-06-20 Akim Demaille <akim@epita.fr>
353
354 * src/scan-gram.l: Complete the scanner with the missing patterns
355 to pacify Flex.
356 Use `quote' and `symbol_tag_get' where appropriate.
357
93b68a0e
AD
3582002-06-19 Akim Demaille <akim@epita.fr>
359
360 * tests/actions.at (Destructors): Augment to test locations.
361 * data/bison.simple (yydestructor): Pass it the current location
362 if locations are enabled.
363 Prototype only when __STDC__ or C++.
364 Change the argument names to move into the yy name space: there is
365 user code here.
366
58612f1d
AD
3672002-06-19 Akim Demaille <akim@epita.fr>
368
74310291
AD
369 * data/bison.simple (b4_pure_if): New.
370 Use it instead of #ifdef YYPURE.
371
3722002-06-19 Akim Demaille <akim@epita.fr>
373
374 * data/bison.simple (b4_location_if): New.
58612f1d
AD
375 Use it instead of #ifdef YYLSP_NEEDED.
376
f25bfb75
AD
3772002-06-19 Akim Demaille <akim@epita.fr>
378
379 Prepare @$ in %destructor, but currently don't bind it in the
380 skeleton, as %location use is not cleaned up yet.
381
382 * src/scan-gram.l (handle_dollar, handle_destructor_at)
383 (handle_action_at): New.
384 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
385 a braced_code_t and a location as additional arguments.
386 (handle_destructor_dollar): Instead of requiring `b4_eval', just
387 unquote one when outputting `b4_dollar_dollar'.
388 Adjust callers.
389 * data/bison.simple (b4_eval): Remove.
390 (b4_symbol_destructor): Adjust.
391 * tests/input.at (Invalid @n): Adjust.
392
c732d2c6
AD
3932002-06-19 Zack Weinberg <zack@codesourcery.com>
394
395 * doc/bison.texinfo: Document ability to have multiple
396 prologue sections.
397
8c165d89
AD
3982002-06-18 Akim Demaille <akim@epita.fr>
399
400 * src/files.c (compute_base_names): When computing the output file
401 names from the input file name, strip the directory part.
402
ca98bf57
AD
4032002-06-18 Akim Demaille <akim@epita.fr>
404
405 * data/bison.simple.new: Comment changes.
406 Reported by Andreas Schwab.
407
0bfb02ff
AD
4082002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
409
410 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
411 there are no `label `yyoverflowlab' defined but not used' warnings
412 when yyoverflow is defined.
413
24c0aad7
AD
4142002-06-18 Akim Demaille <akim@epita.fr>
415
416 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
417 new member.
418 (symbol_destructor_set): Adjust.
419 * src/output.c (symbol_destructors_output): Output the destructor
420 locations.
421 Output the symbol name.
422 * data/bison.simple (b4_symbol_destructor): Adjust.
423
5719c109
AD
4242002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
425 and Akim Demaille <akim@epita.fr>
426
427 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
428 what's left on the stack when the error recovery hits EOF.
429 * tests/actions.at (Destructors): Complete to exercise this case.
430
9280d3ef
AD
4312002-06-17 Akim Demaille <akim@epita.fr>
432
433 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
434 arguments is really empty, not only equal to `[]'.
435 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
436 member.
437 (symbol_destructor_set): New.
438 * src/output.c (symbol_destructors_output): New.
439 * src/reader.h (brace_code_t, current_braced_code): New.
440 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
441 (handle_dollar): Rename as...
442 (handle_action_dollar): this.
443 (handle_destructor_dollar): New.
444 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
445 (grammar_declaration): Use it.
446 * data/bison.simple (yystos): Is always defined.
447 (yydestructor): New.
448 * tests/actions.at (Destructors): New.
449 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
450
dafdc66f
AD
4512002-06-17 Akim Demaille <akim@epita.fr>
452
453 * src/symlist.h, src/symlist.c (symbol_list_length): New.
454 * src/scan-gram.l (handle_dollar, handle_at): Compute the
455 rule_length only when needed.
456 * src/output.c (actions_output, token_definitions_output): Output
457 the full M4 block.
458 * src/symtab.c: Don't access directly to the symbol tag, use
459 symbol_tag_get.
460 * src/parse-gram.y: Use symbol_list_free.
461
56c47203
AD
4622002-06-17 Akim Demaille <akim@epita.fr>
463
464 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
465 (symbol_list_prepend, get_type_name): Move to...
466 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
467 (symbol_list_prepend, symbol_list_n_type_name_get): here.
468 Adjust all callers.
469 (symbol_list_free): New.
470 * src/scan-gram.l (handle_dollar): Takes a location.
471 * tests/input.at (Invalid $n): Adjust.
472
1e0bab92
AD
4732002-06-17 Akim Demaille <akim@epita.fr>
474
475 * src/reader.h, src/reader.c (symbol_list_new): Export it.
476 (symbol_list_prepend): New.
477 * src/parse-gram.y (%union): `list' is a new member.
478 (symbols.1): New, replaces...
479 (terms_to_prec.1, nterms_to_type.1): these.
480 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
481 Take a location as additional argument.
482 Adjust all callers.
483
04e60654
AD
4842002-06-15 Akim Demaille <akim@epita.fr>
485
486 * src/parse-gram.y: Move %token in the declaration section so that
487 we don't depend upon CVS Bison.
488
10e5b8bd
AD
4892002-06-15 Akim Demaille <akim@epita.fr>
490
491 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
492 * src/print.c (print_core): Use it.
493
9801d40c
AD
4942002-06-15 Akim Demaille <akim@epita.fr>
495
496 * src/conflicts.c (log_resolution): Accept the rule involved in
497 the sr conflicts instead of the lookahead number that points to
498 that rule.
499 (flush_reduce): Accept the current lookahead vector as argument,
500 instead of the index in LA.
501 (resolve_sr_conflict): Accept the current number of lookahead
502 bitset to consider for the STATE, instead of the index in LA.
503 (set_conflicts): Adjust.
504 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
505
c0263492
AD
5062002-06-15 Akim Demaille <akim@epita.fr>
507
508 * src/state.h (state_t): Replace the `lookaheadsp' member, a
509 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
510 Adjust all dependencies.
511 * src/lalr.c (initialize_lookaheads): Split into...
512 (states_lookaheads_count, states_lookaheads_initialize): these.
513 (lalr): Adjust.
514
9757c359
AD
5152002-06-15 Akim Demaille <akim@epita.fr>
516
517 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
518 out of...
519 (grammar_rules_print): here.
520 * src/reduce.c (reduce_output): Use it.
521 * tests/reduce.at (Useless Rules, Reduced Automaton)
522 (Underivable Rules): Adjust.
523
6b98e4b5
AD
5242002-06-15 Akim Demaille <akim@epita.fr>
525
526 Copy BYacc's nice way to report the grammar.
527
528 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
529 New.
530 Don't print the rules' location, it is confusing and useless.
531 (rule_print): Use grammar_rhs_print.
532 * src/print.c (print_grammar): Use grammar_rules_print.
533
6b98e4b5
AD
5342002-06-15 Akim Demaille <akim@epita.fr>
535
536 Complete and rationalize `useless thing' warnings.
537
538 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
539 (symbol_tag_print): New.
540 Use them everywhere in place of accessing directly the tag member.
541 * src/gram.h, src/gram.c (rule_print): New.
542 Use it where a rule used to be printed `by hand'.
543 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
544 (reduce_grammar_tables): Report the useless rules.
545 (reduce_print): Useless things are a warning, not an error.
546 Report it as such.
547 * tests/reduce.at (Useless Nonterminals, Useless Rules):
548 (Reduced Automaton, Underivable Rules): Adjust.
549 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
550 * tests/conflicts.at (Unresolved SR Conflicts)
551 (Solved SR Conflicts): Adjust.
552
ee000ba4
AD
5532002-06-15 Akim Demaille <akim@epita.fr>
554
555 Let symbols have a location.
556
557 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
558 (getsym): Adjust.
559 Adjust all callers.
560 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
561 Use location_t, not int.
562 * src/symtab.c (symbol_check_defined): Take advantage of the
563 location.
564 * tests/regression.at (Invalid inputs): Adjust.
565
8efe435c
AD
5662002-06-15 Akim Demaille <akim@epita.fr>
567
568 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
569 (input): Don't try to initialize yylloc here, do it in the
570 scanner.
571 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
572 * src/gram.h (rule_t): Change line and action_line into location
573 and action_location, of location_t type.
574 Adjust all dependencies.
575 * src/location.h, src/location.c (empty_location): New.
576 * src/reader.h, src/reader.c (grammar_start_symbol_set)
577 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
578 (grammar_current_rule_symbol_append)
579 (grammar_current_rule_action_append): Expect a location as argument.
580 * src/reader.c (grammar_midrule_action): Adjust to attach an
581 action's location as dummy symbol location.
582 * src/symtab.h, src/symtab.c (startsymbol_location): New.
583 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
584 the line numbers.
585
1921f1d7
AD
5862002-06-14 Akim Demaille <akim@epita.fr>
587
588 Grammar declarations may be found in the grammar section.
589
590 * src/parse-gram.y (rules_or_grammar_declaration): New.
591 (declarations): Each declaration may end with a semicolon, not
592 just...
593 (grammar_declaration): `"%union"'.
594 (grammar): Branch to rules_or_grammar_declaration.
595
4515534c
AD
5962002-06-14 Akim Demaille <akim@epita.fr>
597
598 * src/main.c (main): Invoke scanner_free.
599
f958596b
AD
6002002-06-14 Akim Demaille <akim@epita.fr>
601
602 * src/output.c (m4_invoke): Extracted from...
603 (output_skeleton): here.
604 Free tempfile.
605
2c569025
AD
6062002-06-14 Akim Demaille <akim@epita.fr>
607
608 * src/parse-gram.y (directives, directive, gram)
609 (grammar_directives, precedence_directives, precedence_directive):
610 Rename as...
611 (declarations, declaration, grammar, grammar_declaration)
612 (precedence_declaration, precedence_declarator): these.
613 (symbol_declaration): New.
614
592e8d4d
AD
6152002-06-14 Akim Demaille <akim@epita.fr>
616
617 * src/files.c (action_obstack): Remove, unused.
618 (output_obstack): Remove it, and all its dependencies, as it is no
619 longer needed.
620 * src/reader.c (epilogue_set): Build the epilogue in the
621 muscle_obstack.
622 * src/output.h, src/output.c (muscle_obstack): Move to...
623 * src/muscle_tab.h, src/muscle_tab.h: here.
624 (muscle_init): Initialize muscle_obstack.
625 (muscle_free): New.
626 * src/main.c (main): Call it.
627
0c15323d
AD
6282002-06-14 Akim Demaille <akim@epita.fr>
629
630 * src/location.h: New, extracted from...
631 * src/reader.h: here.
632 * src/Makefile.am (noinst_HEADERS): Merge into
633 (bison_SOURCES): this.
634 Add location.h.
635 * src/parse-gram.y: Use location_t instead of Bison's.
636 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
637 Use location_t instead of ints.
638
e96c9728
AD
6392002-06-14 Akim Demaille <akim@epita.fr>
640
641 * data/bison.simple, data/bison.c++: Be sure to restore the
642 current #line when returning to the skeleton contents after having
643 exposed the input file's #line.
644
75d1fe16
AD
6452002-06-12 Akim Demaille <akim@epita.fr>
646
647 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
648 eager.
649 * tests/actions.at (Exotic Dollars): New.
650
6c35d22c
AD
6512002-06-12 Akim Demaille <akim@epita.fr>
652
653 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
654 ['"/] too eagerly.
655 * tests/input.at (Torturing the Scanner): New.
656
1d6412ad
AD
6572002-06-11 Akim Demaille <akim@epita.fr>
658
659 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
660 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
661 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
662 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
663 * src/reader.c (reader): Use it.
664
4cdb01db
AD
6652002-06-11 Akim Demaille <akim@epita.fr>
666
667 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
668 Adjust all callers.
669 (scanner_last_string_free): New.
670
44995b2e
AD
6712002-06-11 Akim Demaille <akim@epita.fr>
672
673 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
674 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
675 (last_string, YY_OBS_FREE): New.
676 Use them when returning an ID.
677
e9955c83
AD
6782002-06-11 Akim Demaille <akim@epita.fr>
679
680 Have Bison grammars parsed by a Bison grammar.
681
682 * src/reader.c, src/reader.h (prologue_augment): New.
683 * src/reader.c (copy_definition): Remove.
684
685 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
686 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
687 (grammar_current_rule_prec_set, grammar_current_rule_check)
688 (grammar_current_rule_symbol_append)
689 (grammar_current_rule_action_append): Export.
690 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
691 (symbol_list_action_append): Remove.
692 Hook the routines from reader.
693 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
694 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
695
696 * src/reader.c (read_declarations): Remove, unused.
697
698 * src/parse-gram.y: Handle the epilogue.
699 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
700 (grammar_start_symbol_set): this.
701 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
702 * src/reader.c (readgram): Remove, unused.
703 (reader): Adjust to insert eoftoken and axiom where appropriate.
704
705 * src/reader.c (copy_dollar): Replace with...
706 * src/scan-gram.h (handle_dollar): this.
707 * src/parse-gram.y: Remove `%thong'.
708
709 * src/reader.c (copy_at): Replace with...
710 * src/scan-gram.h (handle_at): this.
711
712 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
713 New.
714
715 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
716 time being.
717
718 * src/reader.h, src/reader.c (grammar_rule_end): New.
719
720 * src/parse.y (current_type, current_class): New.
721 Implement `%nterm', `%token' support.
722 Merge `%term' into `%token'.
723 (string_as_id): New.
724 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
725 type name.
726
727 * src/parse-gram.y: Be sure to handle properly the beginning of
728 rules.
729
730 * src/parse-gram.y: Handle %type.
731 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
732
733 * src/parse-gram.y: More directives support.
734 * src/options.c: No longer handle source directives.
735
736 * src/parse-gram.y: Fix %output.
737
738 * src/parse-gram.y: Handle %union.
739 Use the prologue locations.
740 * src/reader.c (parse_union_decl): Remove.
741
742 * src/reader.h, src/reader.c (epilogue_set): New.
743 * src/parse-gram.y: Use it.
744
745 * data/bison.simple, data/bison.c++: b4_stype is now either not
746 defined, then default to int, or to the contents of %union,
747 without `union' itself.
748 Adjust.
749 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
750
751 * src/output.c (actions_output): Don't output braces, as they are
752 already handled by the scanner.
753
754 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
755 characters to themselves.
756
757 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
758 that the epilogue has a proper #line.
759
760 * src/parse-gram.y: Handle precedence/associativity.
761
762 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
763 a terminal.
764 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
765 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
766 at all to define terminals that cannot be emitted.
767
768 * src/scan-gram.l: Escape M4 characters.
769
770 * src/scan-gram.l: Working properly with escapes in user
771 strings/characters.
772
773 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
774 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
775 grammar.
776 Use more modest sizes, as for the time being the parser does not
777 release memory, and therefore the process swallows a huge amount
778 of memory.
779
780 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
781 stricter %token grammar.
782
783 * src/symtab.h (associativity): Add `undef_assoc'.
784 (symbol_precedence_set): Do nothing when passed an undef_assoc.
785 * src/symtab.c (symbol_check_alias_consistence): Adjust.
786
787 * tests/regression.at (Invalid %directive): Remove, as it is now
788 meaningless.
789 (Invalid inputs): Adjust to the new error messages.
790 (Token definitions): The new grammar doesn't allow too many
791 eccentricities.
792
793 * src/lex.h, src/lex.c: Remove.
794 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
795 (copy_character, copy_string2, copy_string, copy_identifier)
796 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
797 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
798 (parse_action): Remove.
799 * po/POTFILES.in: Adjust.
800
2e047461
AD
8012002-06-11 Akim Demaille <akim@epita.fr>
802
803 * src/reader.c (parse_action): Don't store directly into the
804 rule's action member: return the action as a string.
805 Don't require `rule_length' as an argument: compute it.
806 (grammar_current_rule_symbol_append)
807 (grammar_current_rule_action_append): New, eved out from
808 (readgram): here.
809 Remove `action_flag', `rulelength', unused now.
810
9af3fbce
AD
8112002-06-11 Akim Demaille <akim@epita.fr>
812
813 * src/reader.c (grammar_current_rule_prec_set).
814 (grammar_current_rule_check): New, eved out from...
815 (readgram): here.
816 Remove `xaction', `first_rhs': useless.
817 * tests/input.at (Type clashes): New.
818 * tests/existing.at (GNU Cim Grammar): Adjust.
819
1485e106
AD
8202002-06-11 Akim Demaille <akim@epita.fr>
821
822 * src/reader.c (grammar_midrule_action): New, Eved out from
823 (readgram): here.
824
da4160c3
AD
8252002-06-11 Akim Demaille <akim@epita.fr>
826
827 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
828 New.
829 (readgram): Use them as replacement of inlined code, crule and
830 crule1.
831
f6d0f937
AD
8322002-06-11 Akim Demaille <akim@epita.fr>
833
834 * src/reader.c (grammar_end, grammar_symbol_append): New.
835 (readgram): Use them.
836 Make the use of `p' as local as possible.
837
69078d4b
AD
8382002-06-10 Akim Demaille <akim@epita.fr>
839
840 GCJ's parser requires the tokens to be defined before the prologue.
841
842 * data/bison.simple: Output the token definition before the user's
843 prologue.
844 * tests/regression.at (Braces parsing, Duplicate string)
845 (Mixing %token styles): Check the output from bison.
846 (Early token definitions): New.
847
5e424082
AD
8482002-06-10 Akim Demaille <akim@epita.fr>
849
850 * src/symtab.c (symbol_user_token_number_set): Don't complain when
851 assigning twice the same user number to a token, so that we can
852 use it in...
853 * src/lex.c (lex): here.
854 Also use `symbol_class_set' instead of hand written code.
855 * src/reader.c (parse_assoc_decl): Likewise.
856
44536b35
AD
8572002-06-10 Akim Demaille <akim@epita.fr>
858
859 * src/symtab.c, src/symtab.c (symbol_class_set)
860 (symbol_user_token_number_set): New.
861 * src/reader.c (parse_token_decl): Use them.
862 Use a switch instead of ifs.
863 Use a single argument.
864
8b9f2372
AD
8652002-06-10 Akim Demaille <akim@epita.fr>
866
867 Remove `%thong' support as it is undocumented, unused, duplicates
868 `%token's job, and creates useless e-mail traffic with people who
869 want to know what it is, why it is undocumented, unused, and
870 duplicates `%token's job.
871
872 * src/reader.c (parse_thong_decl): Remove.
873 * src/options.c (option_table): Remove "thong".
874 * src/lex.h (tok_thong): Remove.
875
3ae2b51f
AD
8762002-06-10 Akim Demaille <akim@epita.fr>
877
878 * src/symtab.c, src/symtab.c (symbol_type_set)
879 (symbol_precedence_set): New.
880 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
881 (value_components_used): Remove, unused.
882
2f1afb73
AD
8832002-06-09 Akim Demaille <akim@epita.fr>
884
885 Move symbols handling code out of the reader.
886
887 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
888 (axiom): Move to...
889 * src/symtab.h, src/symtab.c: here.
890
891 * src/gram.c (start_symbol): Remove: use startsymbol->number.
892 * src/reader.c (startval): Rename as...
893 * src/symtab.h, src/symtab.c (startsymbol): this.
894 * src/reader.c: Adjust.
895
896 * src/reader.c (symbol_check_defined, symbol_make_alias)
897 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
898 (token_translations_init)
899 Move to...
900 * src/symtab.c: here.
901 * src/reader.c (packsymbols): Move to...
902 * src/symtab.h, src/symtab.c (symbols_pack): here.
903 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
904 argument.
905
e9bca3ad
AD
9062002-06-03 Akim Demaille <akim@epita.fr>
907
908 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
909 then statements.
910
86eff183
AD
9112002-06-03 Akim Demaille <akim@epita.fr>
912
913 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
914 structs with non literals.
915 * src/scan-skel.l: never-interactive.
916 * src/conflicts.c (enum conflict_resolution_e): No trailing
917 comma.
918 * src/getargs.c (usage): Split long literal strings.
919 Reported by Hans Aberg.
920
717be197
AD
9212002-05-28 Akim Demaille <akim@epita.fr>
922
923 * data/bison.c++: Use C++ ostreams.
924 (cdebug_): New member.
925
670ddffd
AD
9262002-05-28 Akim Demaille <akim@epita.fr>
927
928 * src/output.c (output_skeleton): Be sure to allocate enough room
929 for `/' _and_ for `\0' in full_skeleton.
930
769b430f
AD
9312002-05-28 Akim Demaille <akim@epita.fr>
932
933 * data/bison.c++: Catch up with bison.simple:
934 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
935 and Paul Eggert <eggert@twinsun.com>: `error' handing.
936 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
937 and popping traces.
938
7067cb36
PH
9392002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
940
941 * src/output.c (output_skeleton): Put an explicit path in front of
942 the skeleton file name, rather than relying on the -I directory,
943 to partially alleviate effects of having a skeleton file lying around
944 in the current directory.
769b430f 945
4a713ec2
PH
9462002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
947
769b430f 948 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
949 obstack_printf should be obstack_fgrow1.
950
b408954b
AD
9512002-05-26 Akim Demaille <akim@epita.fr>
952
953 * src/state.h (state_t): `solved_conflicts' is a new member.
954 * src/LR0.c (new_state): Set it to 0.
955 * src/conflicts.h, src/conflicts.c (print_conflicts)
956 (free_conflicts, solve_conflicts): Rename as...
957 (conflicts_print, conflicts_free, conflicts_solve): these.
958 Adjust callers.
959 * src/conflicts.c (enum conflict_resolution_e)
960 (solved_conflicts_obstack): New, used by...
961 (log_resolution): this.
962 Adjust to attach the conflict resolution to each state.
963 Complete the description with the precedence/associativity
964 information.
965 (resolve_sr_conflict): Adjust.
966 * src/print.c (print_state): Output its solved_conflicts.
967 * tests/conflicts.at (Unresolved SR Conflicts)
968 (Solved SR Conflicts): Exercise --report=all.
969
a49aecd5
AD
9702002-05-26 Akim Demaille <akim@epita.fr>
971
972 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
973 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
974 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
975 (token_number_t, item_number_as_token_number)
976 (token_number_as_item_number, muscle_insert_token_number_table):
977 Rename as...
978 (symbol_number_t, item_number_as_symbol_number)
979 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
980 these, since it is more appropriate.
981
5504898e
AD
9822002-05-26 Akim Demaille <akim@epita.fr>
983
984 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
985 `Error:' lines.
986 * data/bison.simple (yystos) [YYDEBUG]: New.
987 (yyparse) [YYDEBUG]: Display the symbols which are popped during
988 error recovery.
989 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
990
ec3bc396
AD
9912002-05-25 Akim Demaille <akim@epita.fr>
992
993 * doc/bison.texinfo (Debugging): Split into...
994 (Tracing): this new section, its former contents, and...
995 (Understanding): this new section.
996 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
997 by...
998 (report_flag): this.
999 Adjust all dependencies.
1000 (report_args, report_types, report_argmatch): New.
1001 (usage, getargs): Report/support -r, --report.
1002 * src/options.h
1003 (struct option_table_struct): Rename as..,
1004 (struct option_table_s): this.
1005 Rename the `set_flag' member to `flag' to match with getopt_long's
1006 struct.
1007 * src/options.c (option_table): Split verbose into an entry for
1008 %verbose, and another for --verbose.
1009 Support --report/-r, so remove -r from the obsolete --raw.
1010 * src/print.c: Attach full item sets and lookaheads reports to
1011 report_flag instead of trace_flag.
1012 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1013
78df8250
PE
10142002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1015 and Paul Eggert <eggert@twinsun.com>
769b430f 1016
78df8250
PE
1017 * data/bison.simple (yyparse): Correct error handling to conform to
1018 POSIX and yacc. Specifically, after syntax error is discovered,
1019 do not reduce further before shifting the error token.
1020 Clean up the code a bit by removing the labels yyerrdefault,
1021 yyerrhandle, yyerrpop.
1022 * NEWS: Document the above.
1023
c0c9ea05
PH
10242002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1025
1026 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1027 type; it isn't always big enough, since it doesn't necessarily
1028 include non-terminals.
769b430f 1029 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
1030 the latter can be removed.
1031 (yy_token_number_type): Remove, only one use.
1032 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1033 don't use TokenNumberType as element type.
769b430f 1034
c0c9ea05
PH
1035 * tests/regression.at: Modify expected output to agree with change
1036 to yyr1 and yytranslate.
769b430f 1037
6390a83f
FK
10382002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1039
1040 * src/reader.c (parse_action): Use copy_character instead of
1041 obstack_1grow.
1042
db7c8e9a
AD
10432002-05-13 Akim Demaille <akim@epita.fr>
1044
1045 * tests/regression.at (Token definitions): Prototype yylex and
1046 yyerror.
1047
fcc61800
PH
10482002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1049
158c687b 1050 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
1051 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1052 32-bit arithmetic.
1053 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1054
5683e9b2
AD
10552002-05-07 Akim Demaille <akim@epita.fr>
1056
1057 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1058 avoid GCC warnings.
1059
0c2d3f4c
AD
10602002-05-07 Akim Demaille <akim@epita.fr>
1061
1062 Kill GCC warnings.
1063
1064 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1065 over the RHS of each rule.
1066 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1067 * src/state.h (state_t): Member `nitems' is unsigned short.
1068 * src/LR0.c (get_state): Adjust.
1069 * src/reader.c (packgram): Likewise.
1070 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1071 `Type'.
1072 (muscle_insert_int_table): Remove, unused.
1073 (prepare_rules): Remove `max'.
1074
1565b720
AD
10752002-05-06 Akim Demaille <akim@epita.fr>
1076
1077 * src/closure.c (print_firsts): Display of the symbol tags.
1078 (bitmatrix_print): Move to...
1079 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1080 here.
1081 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1082
cfaee611
AD
10832002-05-06 Akim Demaille <akim@epita.fr>
1084
1085 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1086 hash_do_for_each.
1087
458be8e0
AD
10882002-05-06 Akim Demaille <akim@epita.fr>
1089
1090 * src/LR0.c (new_state, get_state): Instead of using the global
1091 `kernel_size' and `kernel_base', have two new arguments:
1092 `core_size' and `core'.
1093 Adjust callers.
1094
a900a624
AD
10952002-05-06 Akim Demaille <akim@epita.fr>
1096
1097 * src/reader.c (packgram): No longer end `ritem' with a 0
1098 sentinel: it is not used.
1099
d4e7d3a1
AD
11002002-05-05 Akim Demaille <akim@epita.fr>
1101
1102 New experimental feature: display the lookaheads in the report and
1103 graph.
1104
1105 * src/print (print_core): When --trace-flag, display the rules
1106 lookaheads.
1107 * src/print_graph.c (print_core): Likewise.
1108 Swap the arguments.
1109 Adjust caller.
1110
39ceb25b
AD
11112002-05-05 Akim Demaille <akim@epita.fr>
1112
1113 * tests/torture.at (Many lookaheads): New test.
1114
5372019f
AD
11152002-05-05 Akim Demaille <akim@epita.fr>
1116
1117 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1118 (GENERATE_MUSCLE_INSERT_TABLE): this.
1119 (output_int_table, output_unsigned_int_table, output_short_table)
1120 (output_token_number_table, output_item_number_table): Replace with...
1121 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1122 (muscle_insert_short_table, muscle_insert_token_number_table)
1123 (muscle_insert_item_number_table): these.
1124 Adjust all callers.
1125 (prepare_tokens): Don't free `translations', since...
1126 * src/reader.h, src/reader.c (grammar_free): do it.
1127 Move to...
1128 * src/gram.h, src/gram.c (grammar_free): here.
1129 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1130 b4_translate_max.
1131
5df5f6d5
AD
11322002-05-05 Akim Demaille <akim@epita.fr>
1133
1134 * src/output.c (output_unsigned_int_table): New.
1135 (prepare_rules): `i' is unsigned.
1136 `prhs', `rline', `r2' are unsigned int.
1137 Rename muscle `rhs_number_max' as `rhs_max'.
1138 Output muscles `prhs_max', `rline_max', and `r2_max'.
1139 Free rline and r1.
1140 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1141 to compute types instead of constant types.
1142 * tests/regression.at (Web2c Actions): Adjust.
1143
b87f8b21
AD
11442002-05-04 Akim Demaille <akim@epita.fr>
1145
1146 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1147 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1148 Adjust dependencies.
1149 * src/output.c (token_definitions_output): Be sure not to output a
1150 `#define 'a'' when fed with `%token 'a' "a"'.
1151 * tests/regression.at (Token definitions): New.
1152
8bb936e4
PE
11532002-05-03 Paul Eggert <eggert@twinsun.com>
1154
1155 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1156 for K&R C.
1157
11582002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1159
1160 * Makefile.am (SUBDIRS): Remove intl.
1161 (EXTRA_DIST): Add config/config.rpath.
1162
53c71a12
AD
11632002-05-03 Akim Demaille <akim@epita.fr>
1164
1165 * data/bison.simple (m4_if): Don't output empty enums.
1166 And actually, output valid enum definitions :(.
1167
289dd0cf
AD
11682002-05-03 Akim Demaille <akim@epita.fr>
1169
1170 * configure.bat: Remove, completely obsolete.
1171 * Makefile.am (EXTRA_DIST): Adjust.
1172 Don't distribute config.rpath...
1173 * config/Makefile.am (EXTRA_DIST): Do it.
1174
db85e524
AD
11752002-05-03 Akim Demaille <akim@epita.fr>
1176
1177 * configure.in (GETTEXT_VERSION): New.
1178 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1179
83ccf991
AD
11802002-05-03 Akim Demaille <akim@epita.fr>
1181
1182 * data/bison.simple (b4_token_enum): New.
1183 (b4_token_defines): Use it to output tokens both as #define and
1184 enums.
1185 Suggested by Paul Eggert.
1186 * src/output.c (token_definitions_output): Don't output spurious
1187 white spaces.
1188
1f418995
AD
11892002-05-03 Akim Demaille <akim@epita.fr>
1190
1191 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1192
45119f04
RA
11932002-05-02 Robert Anisko <robert@lrde.epita.fr>
1194
1195 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1196 Update the stack class, give a try to deque as the default container.
1197
b2d52318
AD
11982002-05-02 Akim Demaille <akim@epita.fr>
1199
1200 * data/bison.simple (yyparse): Do not implement @$ = @1.
1201 (YYLLOC_DEFAULT): Adjust to do it.
1202 * doc/bison.texinfo (Location Default Action): Fix.
1203
3a8b4109
AD
12042002-05-02 Akim Demaille <akim@epita.fr>
1205
1206 * src/reader.c (parse_braces): Merge into...
1207 (parse_action): this.
1208
84614e13
AD
12092002-05-02 Akim Demaille <akim@epita.fr>
1210
1211 * configure.in (ALL_LINGUAS): Remove.
1212 * po/LINGUAS, hr.po: New.
1213
fdbcd8e2
AD
12142002-05-02 Akim Demaille <akim@epita.fr>
1215
1216 Remove the so called hairy (semantic) parsers.
1217
1218 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1219 * src/gram.h, src/gram.c (semantic_parser): Remove.
1220 (rule_t): Remove the guard and guard_line members.
1221 * src/lex.h (token_t): remove tok_guard.
1222 * src/options.c (option_table): Remove %guard and %semantic_parser
1223 support.
1224 * src/output.c, src/output.h (guards_output): Remove.
1225 (prepare): Adjust.
1226 (token_definitions_output): Don't output the `T'
1227 tokens (???).
1228 (output_skeleton): Don't output the guards.
1229 * src/files.c, src/files.c (attrsfile): Remove.
1230 * src/reader.c (symbol_list): Remove the guard and guard_line
1231 members.
1232 Adjust dependencies.
1233 (parse_guard): Remove.
1234 * data/bison.hairy: Remove.
1235 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1236 BISON_HAIRY.
1237
82b6cb3f
AD
12382002-05-02 Akim Demaille <akim@epita.fr>
1239
1240 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1241 (parse_guard): Rename the formal argument `stack_offset' as
1242 `rule_length', which is more readable.
1243 Adjust callers.
1244 (copy_at, copy_dollar): Instead of outputting the hard coded
1245 values of $$, $n and so forth, output invocation to b4_lhs_value,
1246 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1247 Note: this patch partially drops `semantic-parser' support: it
1248 always does `rule_length - n', where semantic parsers ought to
1249 always use `-n'.
82b6cb3f
AD
1250 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1251 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1252
6cbfbcc5
AD
12532002-05-02 Akim Demaille <akim@epita.fr>
1254
1255 * configure.in (AC_INIT): Bump to 1.49b.
1256 (AM_INIT_AUTOMAKE): Short invocation.
1257
b8548114
AD
12582002-05-02 Akim Demaille <akim@epita.fr>
1259
1260 Version 1.49a.
1261
c20cd1fa
AD
12622002-05-01 Akim Demaille <akim@epita.fr>
1263
1264 * src/skeleton.h: Remove.
1265
8a9566d4
AD
12662002-05-01 Akim Demaille <akim@epita.fr>
1267
1268 * src/skeleton.h: Fix the #endif.
1269 Reported by Magnus Fromreide.
1270
8c6d399a
PE
12712002-04-26 Paul Eggert <eggert@twinsun.com>
1272
1273 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1274 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 1275 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 1276
2b7ed18a
RA
12772002-04-25 Robert Anisko <robert@lrde.epita.fr>
1278
1279 * src/scan-skel.l: Postprocess quadrigraphs.
1280
1281 * src/reader.c (copy_character): New function, used to output
1282 single characters while replacing `[' and `]' with quadrigraphs, to
1283 avoid troubles with M4 quotes.
1284 (copy_comment): Output characters with copy_character.
1285 (read_additionnal_code): Likewise.
1286 (copy_string2): Likewise.
1287 (copy_definition): Likewise.
1288
1289 * tests/calc.at: Exercise M4 quoting.
1290
34a89c50
AD
12912002-04-25 Akim Demaille <akim@epita.fr>
1292
1293 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1294 between `!' and the command.
1295 Reported by Paul Eggert.
1296
0dd1580a
RA
12972002-04-24 Robert Anisko <robert@lrde.epita.fr>
1298
1299 * tests/calc.at: Exercise prologue splitting.
1300
1301 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1302 `b4_post_prologue' instead of `b4_prologue'.
1303
1304 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1305 muscles.
1306 (output): Free pre_prologue_obstack and post_prologue_obstack.
1307 * src/files.h, src/files.c (attrs_obstack): Remove.
1308 (pre_prologue_obstack, post_prologue_obstack): New.
1309 * src/reader.c (copy_definition): Add a parameter to specify the
1310 obstack to fill, instead of using attrs_obstack unconditionally.
1311 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1312 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1313
83c1796f
PE
13142002-04-23 Paul Eggert <eggert@twinsun.com>
1315
1316 * data/bison.simple: Remove unnecessary commentary and white
1317 space differences from 1_29-branch.
1318 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1319
1320 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1321 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1322 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1323 constructors or destructors.
1324
1325 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1326
1207eeac
AD
13272002-04-23 Akim Demaille <akim@epita.fr>
1328
1329 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1330 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1331 location with columns.
1332 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1333 All reported by Paul Eggert.
1334
78ab8f67
AD
13352002-04-22 Akim Demaille <akim@epita.fr>
1336
1337 * src/reduce.c (dump_grammar): Move to...
1338 * src/gram.h, src/gram.c (grammar_dump): here.
1339 Be sure to separate long item numbers.
1340 Don't read the members of a rule's prec if its nil.
1341
133c20e2
AD
13422002-04-22 Akim Demaille <akim@epita.fr>
1343
1344 * src/output.c (table_size, table_grow): New.
1345 (MAXTABLE): Remove, replace uses with table_size.
1346 (pack_vector): Instead of dying when the table is too big, grow it.
1347
9515e8a7
AD
13482002-04-22 Akim Demaille <akim@epita.fr>
1349
1350 * data/bison.simple (yyr1): Its type is that of a token number.
1351 * data/bison.c++ (r1_): Likewise.
1352 * tests/regression.at (Web2c Actions): Adjust.
1353
23c5a174
AD
13542002-04-22 Akim Demaille <akim@epita.fr>
1355
1356 * src/reader.c (token_translations_init): 256 is now the default
1357 value for the error token, i.e., it will be assigned another
1358 number if the user assigned 256 to one of her tokens.
1359 (reader): Don't force 256 to error.
1360 * doc/bison.texinfo (Symbols): Adjust.
1361 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1362 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1363 etc. instead of 10, 20, 30 (which was used to `jump' over error
1364 (256) and undefined (2)).
1365
5fbb0954
AD
13662002-04-22 Akim Demaille <akim@epita.fr>
1367
1368 Propagate more token_number_t.
1369
1370 * src/gram.h (token_number_as_item_number)
1371 (item_number_as_token_number): New.
1372 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1373 Use it to create output_item_number_table and
1374 output_token_number_table.
1375 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1376 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1377 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1378 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1379
4f940944
AD
13802002-04-22 Akim Demaille <akim@epita.fr>
1381
1382 * src/output.h, src/output.c (get_lines_number): Remove.
1383
3ded9a63
AD
13842002-04-19 Akim Demaille <akim@epita.fr>
1385
1386 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1387 as Lex/Flex'.
1388 (Debugging): More details about enabling the debugging features.
1389 (Table of Symbols): Describe $$, $n, @$, and @n.
1390 Suggested by Tim Josling.
1391
e0c471a9
AD
13922002-04-19 Akim Demaille <akim@epita.fr>
1393
1394 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1395
fecc10cd
AD
13962002-04-10 Akim Demaille <akim@epita.fr>
1397
1398 * src/system.h: Rely on HAVE_LIMITS_H.
1399 Suggested by Paul Eggert.
1400
51dec47b
AD
14012002-04-09 Akim Demaille <akim@epita.fr>
1402
1403 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1404 full stderr, and strip it according to the bison options, instead
1405 of composing the error message from different bits.
1406 This makes it easier to check for several error messages.
1407 Adjust all the invocations.
1408 Add an invocation exercising the error token.
1409 Add an invocation demonstrating a stupid error message.
1410 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1411 Adjust the tests.
1412 Error message are for stderr, not stdout.
1413
007a50a4
AD
14142002-04-09 Akim Demaille <akim@epita.fr>
1415
1416 * src/gram.h, src/gram.c (error_token_number): Remove, use
1417 errtoken->number.
1418 * src/reader.c (reader): Don't specify the user token number (2)
1419 for $undefined, as it uselessly prevents using it.
1420 * src/gram.h (token_number_t): Move to...
1421 * src/symtab.h: here.
1422 (state_t.number): Is a token_number_t.
1423 * src/print.c, src/reader.c: Use undeftoken->number instead of
1424 hard coded 2.
1425 (Even though this 2 is not the same as above: the number of the
1426 undeftoken remains being 2, it is its user token number which
1427 might not be 2).
1428 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1429 `user_token_number_max'.
1430 Output `undef_token_number'.
1431 * data/bison.simple, data/bison.c++: Use them.
1432 Be sure to map invalid yylex return values to
1433 `undef_token_number'. This saves us from gratuitous SEGV.
1434
1435 * tests/conflicts.at (Solved SR Conflicts)
1436 (Unresolved SR Conflicts): Adjust.
1437 * tests/regression.at (Web2c Actions): Adjust.
1438
06446ccf
AD
14392002-04-08 Akim Demaille <akim@epita.fr>
1440
1441 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1442 Adding #line.
1443 Remove the duplicate `typedefs'.
1444 (RhsNumberType): Fix the declaration and various other typos.
1445 Use __ofile__.
1446 * data/bison.simple: Use __ofile__.
1447 * src/scan-skel.l: Handle __ofile__.
1448
62a3e4f0
AD
14492002-04-08 Akim Demaille <akim@epita.fr>
1450
1451 * src/gram.h (item_number_t): New, the type of item numbers in
1452 RITEM. Note that it must be able to code symbol numbers as
1453 positive number, and the negation of rule numbers as negative
1454 numbers.
1455 Adjust all dependencies (pretty many).
1456 * src/reduce.c (rule): Remove this `short *' pointer: use
1457 item_number_t.
1458 * src/system.h (MINSHORT, MAXSHORT): Remove.
1459 Include `limits.h'.
1460 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1461 (shortcpy): Remove.
1462 (MAXTABLE): Move to...
1463 * src/output.c (MAXTABLE): here.
1464 (prepare_rules): Use output_int_table to output rhs.
1465 * data/bison.simple, data/bison.c++: Adjust.
1466 * tests/torture.at (Big triangle): Move the limit from 254 to
1467 500.
1468 * tests/regression.at (Web2c Actions): Ajust.
1469
1470 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1471 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1472 passes, but produces negative #line number, once fixed, GCC is
1473 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1474 C), it passes.
1475 * src/state.h (state_h): Code input lines on ints, not shorts.
1476
bb88b0fc
AD
14772002-04-08 Akim Demaille <akim@epita.fr>
1478
1479 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1480 and then the grammar.
1481
9a636f47
AD
14822002-04-08 Akim Demaille <akim@epita.fr>
1483
1484 * src/system.h: No longer using strndup.
1485
680e8701
AD
14862002-04-07 Akim Demaille <akim@epita.fr>
1487
1488 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1489 * src/output.c (output_table_data): Return the longest number.
1490 (prepare_tokens): Output `token_number_max').
1491 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1492 New.
1493 Use them to define yy_token_number_type/TokenNumberType.
1494 Use this type for yytranslate.
1495 * tests/torture.at (Big triangle): Push the limit from 124 to
1496 253.
1497 * tests/regression.at (Web2c Actions): Adjust.
1498
817e9f41
AD
14992002-04-07 Akim Demaille <akim@epita.fr>
1500
1501 * tests/torture.at (Big triangle): New.
1502 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1503 * tests/existing.at: here.
1504
5123689b
AD
15052002-04-07 Akim Demaille <akim@epita.fr>
1506
1507 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1508 nritems.
1509 Adjust dependencies.
1510
f3849179
AD
15112002-04-07 Akim Demaille <akim@epita.fr>
1512
1513 * src/reader.c: Normalize increments to prefix form.
1514
bd02036a
AD
15152002-04-07 Akim Demaille <akim@epita.fr>
1516
1517 * src/reader.c, symtab.c: Remove debugging code.
1518
db8837cb
AD
15192002-04-07 Akim Demaille <akim@epita.fr>
1520
1521 Rename all the `bucket's as `symbol_t'.
1522
1523 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1524 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1525 * src/symtab.c, src/symtab.h (bucket): Rename as...
1526 (symbol_t): this.
1527 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1528 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1529 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1530 (buckets_new, buckets_free, buckets_do): Rename as...
1531 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1532 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1533 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1534 (symbols_new, symbols_free, symbols_do): these.
1535
72a23c97
AD
15362002-04-07 Akim Demaille <akim@epita.fr>
1537
1538 Use lib/hash for the symbol table.
1539
1540 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1541 EOF.
1542 * src/lex.c (lex): Set the `number' member of new terminals.
1543 * src/reader.c (bucket_check_defined, bucket_make_alias)
1544 (bucket_check_alias_consistence, bucket_translation): New.
1545 (reader, grammar_free, readgram, token_translations_init)
1546 (packsymbols): Adjust.
1547 (reader): Number the predefined tokens.
1548 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1549 for predefined tokens.
1550 * src/symtab.h (bucket): Remove all the hash table related
1551 members.
1552 * src/symtab.c (symtab): Replace by...
1553 (bucket_table): this.
1554 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1555 (buckets_new, buckets_do): New.
1556
280a38c3
AD
15572002-04-07 Akim Demaille <akim@epita.fr>
1558
1559 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1560 (start_symbol, max_user_token_number, semantic_parser)
1561 (error_token_number): Initialize.
1562 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1563 Initialize.
1564 (reader): Don't.
1565 (errtoken, eoftoken, undeftoken, axiom): Extern.
1566
03b31c0c
AD
15672002-04-07 Akim Demaille <akim@epita.fr>
1568
1569 * src/gram.h (rule_s): prec and precsym are now pointers
1570 to the bucket giving the priority/associativity.
1571 Member `associativity' removed: useless.
1572 * src/reduce.c, src/conflicts.c: Adjust.
1573
8b3df748
AD
15742002-04-07 Akim Demaille <akim@epita.fr>
1575
1576 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1577 Properly escape the symbols' TAG when outputting them.
1578
e601aa1d
AD
15792002-04-07 Akim Demaille <akim@epita.fr>
1580
1581 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1582
b0299a2e
AD
15832002-04-07 Akim Demaille <akim@epita.fr>
1584
1585 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1586 (LArule): this, which is an array to rule_t*.
1587 * src/print.c, src/conflicts.c: Adjust.
1588
d7e1f00c
AD
15892002-04-07 Akim Demaille <akim@epita.fr>
1590
1591 * src/gram.h (rule_t): Rename `number' as `user_number'.
1592 `number' is a new member.
1593 Adjust dependencies.
1594 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1595
cc9305dd
AD
15962002-04-07 Akim Demaille <akim@epita.fr>
1597
1598 As a result of the previous patch, it is no longer needed
1599 to reorder ritem itself.
1600
1601 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1602
b0940840
AD
16032002-04-07 Akim Demaille <akim@epita.fr>
1604
1605 Be sure never to walk through RITEMS, but use only data related to
1606 the rules themselves. RITEMS should be banished.
1607
1608 * src/output.c (output_token_translations): Rename as...
1609 (prepare_tokens): this.
1610 In addition to `translate', prepare the muscles `tname' and
1611 `toknum', which were handled by...
1612 (output_rule_data): this.
1613 Remove, and move the remainder of its outputs into...
1614 (prepare_rules): this new routines, which also merges content from
1615 (output_gram): this.
1616 (prepare_rules): Be sure never to walk through RITEMS.
1617 (output_stos): Rename as...
1618 (prepare_stos): this.
1619 (output): Always invoke prepare_states, after all, just don't use it
1620 in the output if you don't need it.
1621
643a5994
AD
16222002-04-07 Akim Demaille <akim@epita.fr>
1623
1624 * src/LR0.c (new_state): Display `nstates' as the name of the
1625 newly created state.
1626 Adjust to initialize first_state and last_state if needed.
1627 Be sure to distinguish the initial from the final state.
1628 (new_states): Create the itemset of the initial state, and use
1629 new_state.
1630 * src/closure.c (closure): Now that the initial state has its
1631 items properly set, there is no need for a special case when
1632 creating `ruleset'.
1633
1634 As a result, now the rule 0, reducing to $axiom, is visible in the
1635 outputs. Adjust the test suite.
1636
1637 * tests/conflicts.at (Solved SR Conflicts)
1638 (Unresolved SR Conflicts): Adjust.
1639 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1640 * tests/conflicts.at (S/R in initial): New.
1641
b4c4ccc2
AD
16422002-04-07 Akim Demaille <akim@epita.fr>
1643
1644 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1645 the RHS of the rules.
1646 * src/output.c (output_gram): Likewise.
1647
bba97eb2
AD
16482002-04-07 Akim Demaille <akim@epita.fr>
1649
1650 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1651 bucket.
1652 Adjust all dependencies.
1653 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1654 `number' of the buckets too.
1655 * src/gram.h: Include `symtab.h'.
1656 (associativity): Move to...
1657 * src/symtab.h: here.
1658 No longer include `gram.h'.
1659
c3b407f4
AD
16602002-04-07 Akim Demaille <akim@epita.fr>
1661
1662 * src/gram.h, src/gram.c (rules_rhs_length): New.
1663 (ritem_longest_rhs): Use it.
1664 * src/gram.h (rule_t): `number' is a new member.
1665 * src/reader.c (packgram): Set it.
1666 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1667 the end of `rules', and count them out of `nrules'.
1668 (reduce_output, dump_grammar): Adjust.
1669 * src/print.c (print_grammar): It is no longer needed to check for
1670 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1671 * tests/reduce.at (Reduced Automaton): New test.
1672
11652ab3
AD
16732002-04-07 Akim Demaille <akim@epita.fr>
1674
1675 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1676 lacking `+ 1' to nrules, Bison reported as useless a token if it
1677 was used solely to set the precedence of the last rule...
1678
26b23c1a
AD
16792002-04-07 Akim Demaille <akim@epita.fr>
1680
1681 * data/bison.c++, data/bison.simple: Don't output the current file
1682 name in #line, to avoid useless diffs between two identical
1683 outputs under different names.
1684
18bcecb0
AD
16852002-04-07 Akim Demaille <akim@epita.fr>
1686
1687 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1688 Normalize loops to using `< nrules + 1', not `<= nrules'.
1689
fa770c86
AD
16902002-04-07 Akim Demaille <akim@epita.fr>
1691
1692 * TODO: Update.
1693
d9b739c3
AD
16942002-04-07 Akim Demaille <akim@epita.fr>
1695
1696 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1697 bucket.value as bucket.number.
1698
99013900
AD
16992002-04-07 Akim Demaille <akim@epita.fr>
1700
1701 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1702 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1703 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1704 RHS, instead of being an index in RITEMS.
1705
e966383b
PE
17062002-04-04 Paul Eggert <eggert@twinsun.com>
1707
1708 * doc/bison.texinfo: Update copyright date.
1709 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1710 (Symbols): Warn about running Bison in one character set,
1711 but compiling and/or running in an incompatible one.
1712 Warn about character code 256, too.
1713
17142002-04-03 Paul Eggert <eggert@twinsun.com>
1715
1716 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1717 YYERROR_VERBOSE is nonzero, not whether it is defined.
1718
1719 Merge changes from bison-1_29-branch.
c307773e 1720
8d6c48b9
PE
17212002-03-20 Paul Eggert <eggert@twinsun.com>
1722
1723 Merge fixes from Debian bison_1.34-1.diff.
1724
1725 * configure.in (AC_PREREQ): 2.53.
1726
e53c6322
AD
17272002-03-20 Akim Demaille <akim@epita.fr>
1728
1729 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1730
9ffbeca7
PE
17312002-03-19 Paul Eggert <eggert@twinsun.com>
1732
21db0b2a
PE
1733 * src/bison.simple (YYCOPY): New macro.
1734 (YYSTACK_RELOCATE): Use it.
1735 Remove Type arg; no longer needed. All callers changed.
1736 (yymemcpy): Remove; no longer needed.
1737
9ffbeca7
PE
1738 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1739 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1740
642cb8f8
AD
17412002-03-19 Akim Demaille <akim@epita.fr>
1742
1743 Test and fix the #line outputs.
1744
1745 * tests/atlocal.at (GCC): New.
1746 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1747 (Prologue synch line, ,%union synch line, Postprologue synch line)
1748 (Action synch line, Epilogue synch line): New tests.
1749 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1750 * data/bison.simple, data/bison.c++: Use it.
1751
3c31a486
AD
17522002-03-19 Akim Demaille <akim@epita.fr>
1753
1754 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1755 (Solved SR Conflicts, %expect not enough, %expect right)
1756 (%expect too much): Move to...
1757 * tests/conflicts.at: this new file.
1758
0d8bed56
AD
17592002-03-19 Akim Demaille <akim@epita.fr>
1760
1761 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1762 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1763 that we can move to enums for instance.
1764 * src/output.c (token_definitions_output): Output a list of
1765 `token-name, token-number' instead of the #define.
1766 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1767
9208d17f
AD
17682002-03-14 Akim Demaille <akim@epita.fr>
1769
1770 Use Gettext 0.11.1.
1771
af27eacb
RA
17722002-03-09 Robert Anisko <robert@lrde.epita.fr>
1773
1774 * data/bison.c++: Make the user able to add members to the generated
1775 parser by subclassing.
1776
9101a310
RA
17772002-03-05 Robert Anisko <robert@lrde.epita.fr>
1778
1779 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1780 a character.
1781 Reported by Nicolas Tisserand and Nicolas Burrus.
1782
fff9bf0b
RA
17832002-03-04 Robert Anisko <robert@lrde.epita.fr>
1784
1785 * src/reader.c: Warn about lacking semi-colons, do not complain.
1786
64dba31e
RA
17872002-03-04 Robert Anisko <robert@lrde.epita.fr>
1788
1789 * data/bison.c++: Remove a debug line.
1790
374f5a14
RA
17912002-03-04 Robert Anisko <robert@lrde.epita.fr>
1792
1793 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1794 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1795 provide a default implementation.
1796
bfcf1f3a
AD
17972002-03-04 Akim Demaille <akim@epita.fr>
1798
1799 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1800 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1801 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1802 * tests/semantic.at (Parsing Guards): Similarly.
1803 * src/reader.at (readgram): Complain if the last rule is not ended
1804 with a semi-colon.
1805
65ccf9fc
AD
18062002-03-04 Akim Demaille <akim@epita.fr>
1807
1808 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1809 * src/closure.c: here.
1810 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1811 RTC.
1812 * src/warshall.h, src/warshall.c: Remove.
1813 * tests/sets.at (Broken Closure): Adjust.
1814
d0039cbc
AD
18152002-03-04 Akim Demaille <akim@epita.fr>
1816
1817 * src/output.c (output_skeleton): tempdir is const.
1818 bytes_read is unused.
1819
345cea78
AD
18202002-03-04 Akim Demaille <akim@epita.fr>
1821
1822 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1823 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1824 Update.
1825 From Michael Hayes.
1826
564801f7
AD
18272002-03-04 Akim Demaille <akim@epita.fr>
1828
1829 * src/closure.c (closure): `r' is unused.
1830
e5352bc7
AD
18312002-03-04 Akim Demaille <akim@epita.fr>
1832
1833 * tests/sets.at (Broken Closure): Add the ending `;'.
1834 * src/reader.at (readgram): Complain if a rule is not ended with a
1835 semi-colon.
1836
914feea9
AD
18372002-03-04 Akim Demaille <akim@epita.fr>
1838
1839 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1840 (count_sr_conflicts): Use bitset_count.
1841 * src/reduce.c (inaccessable_symbols): Ditto.
1842 (bits_size): Remove.
1843 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1844
f0250de6
AD
18452002-03-04 Akim Demaille <akim@epita.fr>
1846
1847 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1848 * src/reduce.c: Remove the `bitset_zero's following the
1849 `bitset_create's, as now it is performed by the latter.
1850
ef017502
AD
18512002-03-04 Akim Demaille <akim@epita.fr>
1852
1853 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1854 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1855 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1856 latest sources from Michael.
1857
76514394
AD
18582002-03-04 Akim Demaille <akim@epita.fr>
1859
1860 * src/output.c (output): Don't free the grammar.
1861 * src/reader.c (grammar_free): New.
1862 * src/main.c (main): Call it and don't free symtab here.
1863
55024580
AD
18642002-03-04 Akim Demaille <akim@epita.fr>
1865
1866 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1867 before returning.
1868 Reported by Benoit Perrot.
1869
f9abaa2c
AD
18702002-03-04 Akim Demaille <akim@epita.fr>
1871
1872 Use bitset operations when possible, not loops over bits.
1873
1874 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1875 bitset_or.
1876 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1877 * src/reduce.c (useless_nonterminals): Formatting changes.
1878 * src/warshall.c (TC): Use bitset_or.
1879
0e721e75
AD
18802002-03-04 Akim Demaille <akim@epita.fr>
1881
1882 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1883 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1884 Ditto.
1885
0fb1ffb1
AD
18862002-03-04 Akim Demaille <akim@epita.fr>
1887
1888 * src/lalr.c (F): Now a bitset*.
1889 Adjust all dependencies.
1890
b86796bf
AD
18912002-03-04 Akim Demaille <akim@epita.fr>
1892
1893 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1894 Adjust all dependencies.
1895
602bbf31
AD
18962002-03-04 Akim Demaille <akim@epita.fr>
1897
1898 * src/L0.c, src/LR0.h (nstates): Be size_t.
1899 Adjust comparisons (signed vs unsigned).
1900 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1901 bitset*.
1902 Adjust all dependencies.
1903
d8a0245c
AD
19042002-03-04 Akim Demaille <akim@epita.fr>
1905
1906 * src/closure.c (firsts): Now, also a bitset.
1907 Adjust all dependencies.
1908 (varsetsize): Remove, now unused.
1909 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1910
34ba9743
AD
19112002-03-04 Akim Demaille <akim@epita.fr>
1912
1913 * src/print.c: Convert to use bitset.h, not hand coded iterations
1914 over ints.
1915
ed86e78c
AD
19162002-03-04 Akim Demaille <akim@epita.fr>
1917
1918 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1919
dfdb1797
AD
19202002-03-04 Akim Demaille <akim@epita.fr>
1921
1922 * src/closure.c (ruleset): Be a bitset.
1923 (rulesetsize): Remove.
1924
7086e707
AD
19252002-03-04 Akim Demaille <akim@epita.fr>
1926
1927 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1928 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1929 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1930 * src/closure.c (fderives): Be an array of bitsets.
1931
98254360
RA
19322002-02-28 Robert Anisko <robert@lrde.epita.fr>
1933
1934 * data/bison.c++: Merge the two generated headers. Insert a copyright
1935 notice in each output file.
1936
a75c057f
AD
19372002-02-28 Akim Demaille <akim@epita.fr>
1938
1939 * data/bison.c++: Copy the prologue of bison.simple to fetch
1940 useful M4 definitions, such as b4_header_guard.
1941
06b00abc
AD
19422002-02-25 Akim Demaille <akim@epita.fr>
1943
1944 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1945 translator friendly scheme for the bgr
1946 copyright notice.
06b00abc 1947
70e7d534
AD
19482002-02-25 Akim Demaille <akim@epita.fr>
1949
1950 * src/output.c (header_output): Remove, now handled completely via
1951 M4.
1952
abe017f6
AD
19532002-02-25 Akim Demaille <akim@epita.fr>
1954
1955 * m4/m4.m4: New, from CVS Autoconf.
1956 * configure.in: Invoke it.
1957 * src/output.c (output_skeleton): Use its result instead of the
1958 hard coded name.
1959
381fb12e
AD
19602002-02-25 Akim Demaille <akim@epita.fr>
1961
1962 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1963 Fileutils 4.1.5.
1964 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1965 * src/output.c (output_skeleton): Use mkstemp to create a real
1966 temporary file.
1967 Move the filling of `skeleton' and its muscle to...
1968 (prepare): here.
1969 (output): Move the definition of the prologue muscle to...
1970 (prepare): here.
1971 * src/system.h (DEFAULT_TMPDIR): New.
1972
6f38107f
PE
19732002-02-14 Paul Eggert <eggert@twinsun.com>
1974
1975 Remove the support for C++ namespace cleanliness; it was
1976 causing more problems than it was curing, since it didn't work
1977 properly on some nonstandard C++ compilers. This can wait
1978 for a proper C++ parser.
1979
1980 * NEWS: Document this.
1981 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1982 of C++, as it's treated like C now.
1983 * src/bison.simple (YYSTD): Remove.
1984 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1985 Treat C++ just like Standard C instead of trying to support
1986 namespace cleanliness.
1987
80cce3da
AD
19882002-02-14 Akim Demaille <akim@epita.fr>
1989
1990 * tests/regression.at (else): Adjust to Andreas' change.
1991
842e8679
AD
19922002-02-14 Akim Demaille <akim@epita.fr>
1993
1994 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1995
4bda3f10
AD
19962002-02-13 Andreas Schwab <schwab@suse.de>
1997
1998 * src/output.c (output_rule_data): Don't output NULL, it might
1999 not be defined yet.
2000
4162fa07 20012002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 2002
4162fa07
RA
2003 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2004 (Copyright notice): Update.
b418ecd8 2005
bd16a5dc
AD
20062002-02-11 Akim Demaille <akim@epita.fr>
2007
2008 * tests/regression.at (%nonassoc and eof): Don't include
2009 nonportable headers.
2010
8d69a1a3
RA
20112002-02-08 Robert Anisko <robert@lrde.epita.fr>
2012
2013 * data/bison.c++: Correct error recovery. Make the user able to
2014 initialize the starting location.
2015
9b2d0677
AD
20162002-02-07 Akim Demaille <akim@epita.fr>
2017
2018 * tests/input.at: New.
2019
69e2658b
RA
20202002-02-07 Robert Anisko <robert@lrde.epita.fr>
2021
2022 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 2023 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
2024 directives around tables only needed for debugging.
2025
4aacc3a7
RA
20262002-02-07 Robert Anisko <robert@lrde.epita.fr>
2027
2028 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2029 C++ parsers.
2030 (yy::b4_name::parse): Use print_.
2031
762a801e
RA
20322002-02-07 Robert Anisko <robert@lrde.epita.fr>
2033
2034 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2035
4bb2bc3f
RA
20362002-02-07 Robert Anisko <robert@lrde.epita.fr>
2037
2038 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2039 C++ parsers.
2040 (yy::b4_name::parse): Build verbose error messages, and use error_.
2041
6b45a3ca
RA
20422002-02-06 Robert Anisko <robert@lrde.epita.fr>
2043
2044 * data/bison.c++: Fix m4 quoting in comments.
2045
50997c6e
RA
20462002-02-06 Robert Anisko <robert@lrde.epita.fr>
2047
2048 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2049 not expanded by m4.
2050
3f3eed27
AD
20512002-02-05 Akim Demaille <akim@epita.fr>
2052
2053 * data/bison.c++: Adjust to the M4 back end.
2054 More is certainly needed.
2055
be2a1a68
AD
20562002-02-05 Akim Demaille <akim@epita.fr>
2057
2058 Give a try to M4 as a back end.
2059
2060 * lib/readpipe.c: New, from wdiff.
2061 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2062 BISON_HAIRY.
2063 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2064 specific values. Now it is m4 that performs the lookup.
2065 * src/parse-skel.y: Remove.
2066 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2067 * src/output.c (actions_output, guards_output)
2068 (token_definitions_output): No longer keeps track of the output
2069 line number, hence remove the second argument.
2070 (guards_output): Check against the guard member of a rule, not the
2071 action member.
2072 Adjust callers.
2073 (output_skeleton): Don't look for the skeleton location, let m4 do
2074 that.
2075 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2076 file will be used.
2077 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2078 (prepare): Given that for the time being changesyntax is not
2079 usable in M4, rename the muscles using `-' to `_'.
2080 Define `defines_flag', `output_parser_name' and `output_header_name'.
2081 * src/output.h (actions_output, guards_output)
2082 (token_definitions_output): Adjust prototypes.
2083 * src/scan-skel.l: Instead of scanning the skeletons, it now
2084 processes the output of m4: `__oline__' and `#output'.
2085 * data/bison.simple: Adjust to be used by M4(sugar).
2086 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2087 to date.
2088 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2089 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2090 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2091 shamelessly stolen from CVS Autoconf.
2092
beda758b
AD
20932002-02-05 Akim Demaille <akim@epita.fr>
2094
2095 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2096 * configure.in: Check for the declarations of free and malloc.
2097 * src/muscle_tab.c: Adjust.
2098
5ece6d43
AD
20992002-02-05 Akim Demaille <akim@epita.fr>
2100
2101 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2102 which have no values.
2103
5bb18f9a
AD
21042002-02-05 Akim Demaille <akim@epita.fr>
2105
2106 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2107 * data/: here.
2108
894dd62e
PE
21092002-01-29 Paul Eggert <eggert@twinsun.com>
2110
2111 * src/bison.simple (YYSIZE_T): Do not define merely because
2112 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2113 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2114
82841af7
AD
21152002-01-27 Akim Demaille <akim@epita.fr>
2116
2117 Fix `%nonassoc and eof'.
2118
2119 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2120 which were not properly copied! Replace
2121 memcpy (res->errs, src->errs, src->nerrs);
2122 with
2123 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2124 !!!
2125 * tests/regression.at (%nonassoc and eof): Adjust to newest
2126 Autotest: `.' is not in the PATH.
2127
318b76e9
AD
21282002-01-27 Akim Demaille <akim@epita.fr>
2129
2130 * tests/sets.at (AT_EXTRACT_SETS): New.
2131 (Nullable): Use it.
2132 (Firsts): New.
2133
30d2f3d5
AD
21342002-01-26 Akim Demaille <akim@epita.fr>
2135
2136 * tests/actions.at, tests/calc.at, tests/headers.at,
2137 * tests/torture.at: Adjust to the newest Autotest which no longer
2138 forces `.' in the PATH.
2139
30f8c395
AD
21402002-01-25 Akim Demaille <akim@epita.fr>
2141
2142 * tests/regression.at (%nonassoc and eof): New.
2143 Suggested by Robert Anisko.
2144
29ae55f1
AD
21452002-01-24 Akim Demaille <akim@epita.fr>
2146
2147 Bison dumps core when trying to complain about broken input files.
2148 Reported by Cris van Pelt.
2149
2150 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2151 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2152 into...
2153 (Invalid inputs): Strengthen: exercise parse_percent_token.
2154
2b548aa6
RA
21552002-01-24 Robert Anisko <robert.anisko@epita.fr>
2156
2157 * src/Makefile.am: Add bison.c++.
2158 * src/bison.c++: New skeleton.
2159
bb0146c2
AD
21602002-01-21 Paolo Bonzini <bonzini@gnu.org>
2161
2162 * po/it.po: New.
2163
bec30531
AD
21642002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2165
2166 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2167
fc6edc45
MA
21682002-01-20 Marc Autret <marc@gnu.org>
2169
2170 * src/files.c (compute_output_file_names): Fix
2171
5e5d5415
MA
21722002-01-20 Marc Autret <marc@gnu.org>
2173
2174 * tests/output.at: New test.
2175 * src/files.c (compute_base_names): Don't map extensions when
2176 the YACC flag is set, use defaults.
2177 Reported by Evgeny Stambulchik.
2178
44ea3fbd
MA
21792002-01-20 Marc Autret <marc@gnu.org>
2180
bb0146c2 2181 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2182 compilers as well (i.e. the vendor C compiler).
2183 Suggested by Albert Chin-A-Young.
2184
338963d1
TVH
21852002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2186
2187 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2188 canonical definition.
2189 * src/system.h: Use the canonical definition for PARAMS (avoids
2190 a conflict with the macro from lib/hash.h).
2191
c57b2479
AD
21922002-01-11 Akim Demaille <akim@epita.fr>
2193
2194 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2195 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2196
b85810ae
AD
21972002-01-09 Akim Demaille <akim@epita.fr>
2198
2199 * src/files.c, src/files.h (output_infix): New.
2200 (tab_extension): Remove.
2201 (compute_base_names): Compute the former, drop the latter.
2202 * src/output.c (prepare): Insert the muscles `output-infix', and
2203 `output-suffix'.
2204 * src/parse-skel.y (string, string.1): New.
2205 (section.header): Use it.
2206 (section.yacc): Remove.
2207 (prefix): Remove too.
2208 * src/scan-skel.l: Adjust.
2209 * src/bison.simple, src/bison.hairy: Adjust.
2210
cae60122
AD
22112002-01-09 Akim Demaille <akim@epita.fr>
2212
2213 * configure.in (WERROR_CFLAGS): Compute it.
2214 * src/Makefile.am (CFLAGS): Pass it.
2215 * tests/atlocal.in (CFLAGS): Idem.
2216 * src/files.c: Fix a few warnings.
2217 (get_extension_index): Remove, unused.
2218
ae404801
AD
22192002-01-08 Akim Demaille <akim@epita.fr>
2220
2221 * src/getargs.c (AS_FILE_NAME): New.
2222 (getargs): Use it to convert DOSish file names.
2223 * src/files.c (base_name): Rename as full_base_name to avoid
2224 clashes with `base_name ()'.
2225 (filename_split): New.
2226 (compute_base_names): N-th rewrite, using filename_split.
2227
22312b71
AD
22282002-01-08 Akim Demaille <akim@epita.fr>
2229
2230 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2231 New, stolen from the Fileutils 4.1.
2232 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2233 * configure.in: Check for the presence of memrchr, and of its
2234 prototype.
2235
a67cef01
TVH
22362002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2237
2238 * lib/hash.h (__P): Added definition for this macro.
2239 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2240 BUILT_SOURCES, to ensure they are generated first.
2241 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2242 %error-verbose to allow bootstrapping with bison 1.30x.
2243
2b25d624
AD
22442002-01-06 Akim Demaille <akim@epita.fr>
2245
2246 * src/reader.c (parse_braces): Don't fetch the next char, the
2247 convention is to fetch on entry.
2248 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2249 'switch' without a following semicolon.
2250 * tests/regression.at (braces parsing): New.
2251
3460813b
AD
22522002-01-06 Akim Demaille <akim@epita.fr>
2253
2254 Bison is dead wrong in its RR conflict reports.
2255
2256 * tests/torture.at (GNU Cim Grammar): New.
2257 * src/conflicts.c (count_rr_conflicts): Fix.
2258
73784c64
AD
22592002-01-06 Akim Demaille <akim@epita.fr>
2260
2261 Creating package.m4 from configure.ac causes too many problems.
2262
2263 * tests/Makefile.am (package.m4): Create it by hand,
2264 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2265
25d81090
AD
22662002-01-06 Akim Demaille <akim@epita.fr>
2267
2268 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2269 skeleton.h.
2270
a9b8959e
PE
22712002-01-04 Paul Eggert <eggert@twinsun.com>
2272
2273 * doc/bison.texinfo (Debugging):
2274 Remove YYSTDERR; it's no longer defined or used.
2275 Also, s/cstdio.h/cstdio/.
2276
25d81090
AD
22772002-01-03 Akim Demaille <akim@epita.fr>
2278
2279 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2280
1109455c
AD
22812002-01-03 Akim Demaille <akim@epita.fr>
2282
2283 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2284 tracing code to --trace, wait for a better --trace option, with
2285 args.
2286
7ea5e977
AD
22872002-01-03 Akim Demaille <akim@epita.fr>
2288
2289 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2290 The ISO C++ standard is extremely clear about it: stderr is
2291 considered a macro, not a regular symbol (see table 94 `Header
2292 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2293 Therefore std:: does not apply to it. It still does with fprintf.
2294 Also, s/cstdio.h/cstdio/.
2295
fab5b110
AD
22962002-01-03 Akim Demaille <akim@epita.fr>
2297
2298 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2299 for non system headers.
2300
aed7fd9b
AD
23012002-01-02 Akim Demaille <akim@epita.fr>
2302
2303 Equip the skeleton chain with location tracking, runtime trace,
2304 pure parser and scanner.
2305
2306 * src/parse-skel.y: Request a pure parser, locations, and prefix
2307 renaming.
2308 (%union): Having several members with the same type does not help
2309 type mismatches, simplify.
2310 (YYPRINT, yyprint): New.
2311 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2312 (skel_error): this.
2313 Handle locations.
2314 * src/scan-skel.l: Adjust to these changes.
2315 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2316 (LOCATION_PRINT, skel_control_t): New.
2317
24fad99e
AD
23182001-12-30 Akim Demaille <akim@epita.fr>
2319
2320 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2321 replace `gb' with BLANKS.
2322 * src/scan-skel.l: Adjust.
2323
a4b36db4
AD
23242001-12-30 Akim Demaille <akim@epita.fr>
2325
2326 * src/system.h: We don't need nor want bcopy.
2327 Throw away MS-DOS crap: we don't need getpid.
2328 * configure.in: We don't need strndup. It was even causing
2329 problems: because Flex includes the headers *before* us,
2330 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2331 not visible.
2332 * lib/xstrndup.c: New.
2333 * src/scan-skel.l: Use it.
2334 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2335 * src/parse-skel.y: Use %directives instead of #defines.
2336
1239777d
AD
23372001-12-30 Akim Demaille <akim@epita.fr>
2338
2339 * src/skeleton.h: New.
2340 * src/output.c (output_parser, output_master_parser): Remove, dead
2341 code.
2342 * src/output.h (get_lines_number, actions_output, guards_output)
2343 (token_definitions_output): Prototype them.
2344 * src/parse-skel.y: Add the license notice.
2345 Include output.h and skeleton.h.
2346 (process_skeleton): Returns void, and takes a single parameter.
2347 * src/scan-skel.l: Add the license notice.
2348 Include skeleton.h.
2349 Don't use %option yylineno: it seems that then Flex imagines
2350 REJECT has been used, and therefore it won't reallocate its
2351 buffers (which makes no other sense to me than a bug). It results
2352 in warnings for `unused: yy_flex_realloc'.
2353
9b3add5b
RA
23542001-12-30 Robert Anisko <robert.anisko@epita.fr>
2355
2356 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2357 (MUSCLE_INSERT_PREFIX): ...to there.
2358 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2359 (MUSCLE_INSERT_PREFIX): Move from here...
2360
2361 * src/bison.hairy: Add a section directive. Put braces around muscle
2362 names. This parser skeleton is still broken, but Bison should not
2363 choke on a bad muscle 'syntax'.
2364 * src/bison.simple: Add a section directive. Put braces around muscle
2365 names.
2366
2367 * src/files.h (strsuffix, stringappend): Add declarations.
2368 (tab_extension): Add declaration.
2369 (short_base_name): Add declaration.
2370
2371 * src/files.c (strsuffix, stringappend): No longer static. These
2372 functions are used in the skeleton parser.
2373 (tab_extension): New.
2374 (compute_base_names): Use the computations done in this function
fab5b110 2375 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
2376 names.
2377 (short_base_name): No longer static.
2378
2379 * src/output.c (output_skeleton): New.
2380 (output): Disable call to output_master_parser, and give a try to
2381 a new skeleton handling system.
2382 (guards_output, actions_output): No longer static.
2383 (token_definitions_output, get_lines_number): No longer static.
2384
2385 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2386
fab5b110 2387 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
2388 parse-skel.y.
2389
2390 * src/parse-skel.y: New file.
2391 * src/scan-skel.l: New file.
2392
b5b61c61
AD
23932001-12-29 Akim Demaille <akim@epita.fr>
2394
2395 %name-prefix is broken.
2396
2397 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2398 Adjust all dependencies.
2399 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2400 %name-prefix.
2401
2402 Renaming yylval but not yylloc is not consistent. Now we do.
2403
2404 * src/bison.simple: Prefix yylloc if used.
2405 * doc/bison.texinfo (Decl Summary): Document that.
2406
8c9a50be
AD
24072001-12-29 Akim Demaille <akim@epita.fr>
2408
2409 * doc/bison.texinfo: Promote `%long-directive' over
2410 `%long_directive'.
2411 Remove all references to fixed-output-files, yacc is enough.
2412
d99361e6
AD
24132001-12-29 Akim Demaille <akim@epita.fr>
2414
2415 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2416 user prologue. These are defaults.
2417 * tests/actions.at (Mid-rule actions): Make sure the user can
2418 define YYDEBUG and YYERROR_VERBOSE.
2419
b9cecb91
AD
24202001-12-29 Akim Demaille <akim@epita.fr>
2421
2422 * src/output.c (header_output): Don't forget to export YYLTYPE and
2423 yylloc.
2424 * tests/headers.at (export YYLTYPE): New, make sure it does.
2425 * tests/regression.at (%union and --defines, Invalid CPP headers):
2426 Move to...
2427 * tests/headers.at: here.
2428
aea13e97
AD
24292001-12-29 Akim Demaille <akim@epita.fr>
2430
2431 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2432
931394cb
AD
24332001-12-29 Akim Demaille <akim@epita.fr>
2434
2435 * tests/actions.at (Mid-rule actions): Output on a single line
2436 instead of several.
2437
704a47c4
AD
24382001-12-29 Akim Demaille <akim@epita.fr>
2439
2440 * doc/bison.texinfo: Formatting changes.
2441
091e20bb
AD
24422001-12-29 Akim Demaille <akim@epita.fr>
2443
2444 Don't store the token defs in a muscle, just be ready to output it
2445 on command. Now possible via `symbols'. Fixes a memory leak.
2446
2447 * src/output.c (token_definitions_output): New.
2448 (output_parser, header_output): Use it.
2449 * src/reader.c (symbols_save): Remove.
2450
cce71710
AD
24512001-12-29 Akim Demaille <akim@epita.fr>
2452
2453 * src/bison.simple: Do not provide a default for YYSTYPE and
2454 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2455 default.
2456
82c035a8
AD
24572001-12-29 Akim Demaille <akim@epita.fr>
2458
2459 Mid-rule actions are simply... ignored!
2460
2461 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2462 the empty-rule associated to the dummy symbol, not to the host
2463 rule.
2464 * tests/actions.at (Mid-rule actions): New.
2465
8419d367
AD
24662001-12-29 Akim Demaille <akim@epita.fr>
2467
2468 Memory leak.
2469
2470 * src/reader.c (reader): Free grammar.
2471
375d5806
AD
24722001-12-29 Akim Demaille <akim@epita.fr>
2473
2474 Memory leak.
2475
2476 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2477 since it allocates it for each state, although only one is needed.
2478 (allocate_storage): Do it here.
2479
f51cb8ff
AD
24802001-12-29 Akim Demaille <akim@epita.fr>
2481
2482 * src/options.h, src/options.c (create_long_option_table): Rename
2483 as...
2484 (long_option_table_new): this, with a clearer prototype.
2485 (percent_table): Remove, unused,
2486 * src/getargs.c (getargs): Adjust.
2487
29e88316
AD
24882001-12-29 Akim Demaille <akim@epita.fr>
2489
2490 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2491 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2492 as states.
2493
b9f71f19
AD
24942001-12-29 Akim Demaille <akim@epita.fr>
2495
2496 * src/lalr.c (build_relations): Rename `states' as `states1'.
2497 Sorry, I don't understand exactly what it is, no better name...
2498
1a2b5d37
AD
24992001-12-29 Akim Demaille <akim@epita.fr>
2500
2501 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2502 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2503 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2504 as rules.
2505
1cca533e
AD
25062001-12-29 Akim Demaille <akim@epita.fr>
2507
2508 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2509 ago.
2510
c03ae966
AD
25112001-12-29 Akim Demaille <akim@epita.fr>
2512
2513 * src/reader.c, src/reader.h (user_toknums): Remove.
2514 Adjust all users to use symbols[i]->user_token_number.
2515
5a670b1e
AD
25162001-12-29 Akim Demaille <akim@epita.fr>
2517
2518 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2519 Adjust all users to use symbols[i]->prec or ->assoc.
2520
ad949da9
AD
25212001-12-29 Akim Demaille <akim@epita.fr>
2522
2523 * src/reader.c, src/reader.h (tags): Remove.
2524 Adjust all users to use symbols[i]->tag.
2525
0e78e603
AD
25262001-12-29 Akim Demaille <akim@epita.fr>
2527
2528 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2529 and rule_table.
2530 * src/reader.c (packsymbols): Fill this table.
2531 Drop sprec.
2532 * src/conflicts.c (resolve_sr_conflict): Adjust.
2533 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2534 single table.
2535 Use symbols[i]->tag instead of tags[i].
2536
213e640e
AD
25372001-12-29 Akim Demaille <akim@epita.fr>
2538
2539 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2540 In addition, put a comment in there, to replace...
2541 * tests/regression.at (%union and C comments): Remove.
2542
e7b8bef1
AD
25432001-12-29 Akim Demaille <akim@epita.fr>
2544
2545 * tests/regression.at (Web2c Actions): Blindly move the actual
2546 output as expected output. The contents *seem* right to me, but I
2547 can't pretend reading perfectly parser tables... Nonetheless, all
2548 the other tests pass correctly, the table look OK, even though the
2549 presence of `$axiom' is to be noted: AFAICS it is useless (but
2550 harmless).
2551
b68e7744
AD
25522001-12-29 Akim Demaille <akim@epita.fr>
2553
2554 * src/reader.c (readgram): Don't add the rule 0 if there were no
2555 rules read. In other words, add it _after_ having performed
2556 grammar sanity checks.
2557 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2558
78d5bae9
AD
25592001-12-29 Akim Demaille <akim@epita.fr>
2560
2561 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2562 visible, and some states have now a different number.
2563
ff442794
AD
25642001-12-29 Akim Demaille <akim@epita.fr>
2565
2566 * src/reader.c (readgram): Bind the initial rule's lineno to that
2567 of the first rule.
2568 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2569 (Solved SR Conflicts): Adjust rule 0's line number.
2570
610ab194
AD
25712001-12-29 Akim Demaille <akim@epita.fr>
2572
2573 Fix the `GAWK Grammar' failure.
2574
2575 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2576 the reductions of the first state which was mistakenly confused
2577 with the final state because precisely final_state was initialized
2578 to 0.
2579 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2580 now noticed by Bison.
2581 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2582 have a reduction on $default.
2583
29d29c8f
AD
25842001-12-29 Akim Demaille <akim@epita.fr>
2585
2586 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2587 rule line numbers.
2588 * src/closure.c (print_closure): Likewise.
2589 * src/derives.c (print_derives): Likewise.
2590 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2591 now.
2592
7c6b64d0
AD
25932001-12-29 Akim Demaille <akim@epita.fr>
2594
2595 * src/lalr.c (lookaheads_print): New.
2596 (lalr): Call it when --trace-flag.
2597 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2598 are dumped.
2599
3d4daee3
AD
26002001-12-29 Akim Demaille <akim@epita.fr>
2601
2602 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2603 when walking through ritem, even via rule->rhs.
2604 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2605 (useful_production, useless_nonterminals): Likewise.
2606 (reduce_grammar_tables): Likewise, plus update nritems.
2607 * src/nullable.c (set_nullable): Likewise.
2608 * src/lalr.c (build_relations): Likewise.
2609 * tests/sets.at (Nullable): Adjust.
2610 Fortunately, now, the $axiom is no longer nullable.
2611
9e7f6bbd
AD
26122001-12-29 Akim Demaille <akim@epita.fr>
2613
2614 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2615 the 0-sentinel.
2616 * src/gram.c (ritem_longest_rhs): Likewise.
2617 * src/reduce.c (nonterminals_reduce): Likewise.
2618 * src/print_graph.c (print_graph): Likewise.
2619 * src/output.c (output_rule_data): Likewise.
2620 * src/nullable.c (set_nullable): Likewise.
2621
255ef638
AD
26222001-12-29 Akim Demaille <akim@epita.fr>
2623
2624 * src/output.c: Comment changes.
2625
0d8a7363
AD
26262001-12-27 Paul Eggert <eggert@twinsun.com>
2627
2628 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2629 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2630 Sparc, as they were causing more porting problems than the
2631 (minor) performance improvement was worth.
2632
2633 Also, catch up with 1.31's YYSTD.
2634
3db472b9
AD
26352001-12-27 Akim Demaille <akim@epita.fr>
2636
2637 * src/output.c (output_gram): Rely on nritems, not the
2638 0-sentinel. See below.
2639 Use -1 as separator, not 0.
2640 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2641 Rely on -1 as separator in yyrhs, instead of 0.
2642 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2643 twice `Now at end of input', therefore there are two lines less to
2644 expect.
2645
b365aa05
AD
26462001-12-27 Akim Demaille <akim@epita.fr>
2647
2648 * tests/regression.at (Unresolved SR Conflicts):
2649 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2650 below.
2651
30171f79
AD
26522001-12-27 Akim Demaille <akim@epita.fr>
2653
2654 * src/LR0.c (new_state): Recognize the final state by the fact it
2655 is reached by eoftoken.
2656 (insert_start_shifting_state, insert_eof_shifting_state)
2657 (insert_accepting_state, augment_automaton): Remove, since now
2658 these states are automatically computed from the initial state.
2659 (generate_states): Adjust.
2660 * src/print.c: When reporting a rule number to the user, substract
2661 1, so that the axiom rule is rule 0, and the first user rule is 1.
2662 * src/reduce.c: Likewise.
2663 * src/print_graph.c (print_core): For the time being, just as for
2664 the report, depend upon --trace-flags to dump the full set of
2665 items.
2666 * src/reader.c (readgram): Once the grammar read, insert the rule
2667 0: `$axiom: START-SYMBOL $'.
2668 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2669 number of the states has changed (the final state is no longer
2670 necessarily the last), catch up.
2671
75142d45
AD
26722001-12-27 Akim Demaille <akim@epita.fr>
2673
2674 Try to make the use of the eoftoken valid. Given that its value
2675 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2676 is used instead of > 0 where appropriate, (ii), depend upon nritems
2677 instead of the 0-sentinel.
2678
2679 * src/gram.h, src/gram.c (nritems): New.
2680 Expected to be duplication of nitems, but for the time being...
2681 * src/reader.c (packgram): Assert nritems and nitems are equal.
2682 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2683 * src/closure.c (print_closure, print_fderives): Likewise.
2684 * src/gram.c (ritem_print): Likewise.
2685 * src/print.c (print_core, print_grammar): Likewise.
2686 * src/print_graph.c: Likewise.
2687
b7c49edf
AD
26882001-12-27 Akim Demaille <akim@epita.fr>
2689
2690 * src/main.c (main): If there are complains after grammar
2691 reductions, then output the report anyway if requested, then die.
2692 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2693 * src/reader.c (eoftoken): New.
2694 (parse_token_decl): If the token being defined has value `0', it
2695 is the eoftoken.
2696 (packsymbols): No longer hack `tags' to insert `$' by hand.
2697 Be sure to preserve the value of the eoftoken.
2698 (reader): Make sure eoftoken is defined.
2699 Initialize nsyms to 0: now eoftoken is created just like the others.
2700 * src/print.c (print_grammar): Don't special case the eof token.
2701 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2702 lie anyway, albeit pleasant.
2703 * tests/calc.at: Exercise error messages with eoftoken.
2704 Change the grammar so that empty input is invalid.
2705 Adjust expectations.
2706 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2707
ec2da99f
AD
27082001-12-27 Akim Demaille <akim@epita.fr>
2709
2710 * configure.in: Check the protos of strchr ans strspn.
2711 Replace strchr if needed.
2712 * src/system.h: Provide the protos of strchr, strspn and memchr if
2713 missing.
2714 * lib/strchr.c: New.
2715 * src/reader.c (symbols_save): Use strchr.
2716
8adfa272
AD
27172001-12-27 Akim Demaille <akim@epita.fr>
2718
2719 * src/print.c, src/print_graph.c (escape): New.
2720 Use it to quote the TAGS outputs.
2721 * src/print_graph.c (print_state): Now errors are in red, and
2722 reductions in green.
2723 Prefer high to wide: output the state number on a line of its own.
2724
80dac38c
AD
27252001-12-27 Akim Demaille <akim@epita.fr>
2726
2727 * src/state.h, src/state.c (reductions_new): New.
2728 * src/LR0.c (set_state_table): Let all the states have a
2729 `reductions', even if reduced to 0.
2730 (save_reductions): Adjust.
2731 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2732 * src/print.c (print_reductions, print_actions): Adjust.
2733 * src/output.c (action_row): Adjust.
2734
2cec70b9
AD
27352001-12-27 Akim Demaille <akim@epita.fr>
2736
2737 * src/state.h, src/state.c (errs_new, errs_dup): New.
2738 * src/LR0.c (set_state_table): Let all the states have an errs,
2739 even if reduced to 0.
2740 * src/print.c (print_errs, print_reductions): Adjust.
2741 * src/output.c (output_actions, action_row): Adjust.
2742 * src/conflicts.c (resolve_sr_conflict): Adjust.
2743
13ca549a
AD
27442001-12-27 Akim Demaille <akim@epita.fr>
2745
2746 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2747
5092aba5
AD
27482001-12-27 Akim Demaille <akim@epita.fr>
2749
2750 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2751 * src/print.c: here.
2752 (lookaheadset, shiftset): New, used as additional storage by
2753 print_reductions.
2754 (print_results): Adjust.
2755 (print_shifts, print_gotos, print_errs): New, extracted from...
2756 (print_actions): here.
2757 * src/print_graph.c (print_actions): Remove dead code.
2758
11e2beca
AD
27592001-12-27 Akim Demaille <akim@epita.fr>
2760
2761 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2762 `$n' and `@n'.
2763
dac3c910
AD
27642001-12-27 Akim Demaille <akim@epita.fr>
2765
2766 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2767 (build_relations): Adjust.
2768
d0b0fefa
AD
27692001-12-27 Akim Demaille <akim@epita.fr>
2770
2771 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2772 duplication.
2773
adc8c848
AD
27742001-12-27 Akim Demaille <akim@epita.fr>
2775
2776 * src/reader.c (packgram): Catch nitems overflows.
2777
14d293ac
AD
27782001-12-27 Akim Demaille <akim@epita.fr>
2779
2780 * src/files.c, src/files.h (guard_obstack): Remove.
2781 * src/output.c (output): Adjust.
2782 * src/reader.c (parse_braces): New, factoring...
2783 (copy_action, copy_guard): these two which are renamed as...
2784 (parse_action, parse_guard): these.
2785 As a voluntary consequence, using braces around guards is now
2786 mandatory.
2787
f499b062
AD
27882001-12-27 Akim Demaille <akim@epita.fr>
2789
2790 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2791 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2792 members.
2793 (symbol_list_new): Adjust.
2794 (copy_action): action_line is the first line, not the last.
2795 (copy_guard): Just as for actions, store the `action' only, not
2796 the switch/case/break flesh.
2797 Don't parse the user action that might follow the guard, let...
2798 (readgram): do it, i.e., now, there can be an action after a
2799 guard.
2800 In other words the guard is just explicitly optional.
2801 (packgram): Adjust.
2802 * src/output.c (guards_output): New.
2803 (output_parser): Call it when needed.
2804 (output): Also free the guard and attrs obstacks.
2805 * src/files.c, src/files.h (obstack_save): Remove.
2806 (output_files): Remove.
2807 As a result, if one needs the former `.act' file, using an
2808 appropriate skeleton which requires actions and guards is now
2809 required.
2810 * src/main.c (main): Adjust.
2811 * tests/semantic.at: New.
2812 * tests/regression.at: Use `input.y' as input file name.
2813 Avoid 8+3 problems by requiring input.c when the test needs the
2814 parser.
2815
d945f5cd
AD
28162001-12-27 Akim Demaille <akim@epita.fr>
2817
2818 * src/reader.c (symbol_list_new): Be sure to initialize all the
2819 fields.
2820
d200e455
AD
28212001-12-27 Akim Demaille <akim@epita.fr>
2822
2823 All the hacks using a final pseudo state are now useless.
2824
2825 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2826 * src/lalr.c (nLA): New.
2827 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2828 instead of lookaheadsp from the pseudo state (nstate + 1).
2829
f9507c28
AD
28302001-12-27 Akim Demaille <akim@epita.fr>
2831
2832 * src/output.c (action_row, token_actions): Use a state_t instead
2833 of a integer, and nlookaheads instead of the following state's
2834 lookaheadsp.
2835
065fbd27
AD
28362001-12-27 Akim Demaille <akim@epita.fr>
2837
2838 * src/conflicts.c (log_resolution, flush_shift)
2839 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2840 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2841 (conflicts_print, print_reductions): Use a state_t instead of an
2842 integer when referring to a state.
2843 As much as possible, depend upon nlookaheads, instead of the
2844 `lookaheadsp' member of the following state (since lookaheads of
2845 successive states are successive, the difference between state n + 1
2846 and n served as the number of lookaheads for state n).
2847 * src/lalr.c (add_lookback_edge): Likewise.
2848 * src/print.c (print_core, print_actions, print_state)
2849 (print_results): Likewise.
2850 * src/print_graph.c (print_core, print_actions, print_state)
2851 (print_graph): Likewise.
2852 * src/conflicts.h: Adjust.
2853
1b177bd7
AD
28542001-12-27 Akim Demaille <akim@epita.fr>
2855
2856 * src/bison.hairy: Formatting/comment changes.
2857 ANSIfy.
2858 Remove `register' indications.
2859 Add plenty of `static'.
2860
7742ddeb
AD
28612001-12-27 Akim Demaille <akim@epita.fr>
2862
2863 * src/output.c (prepare): Drop the muscle `ntbase' which
2864 duplicates ntokens.
2865 * src/bison.simple: Formatting/comment changes.
2866 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2867 is an undocumented synonym.
2868
1fa14068
AD
28692001-12-22 Akim Demaille <akim@epita.fr>
2870
2871 * src/output.c (output_table_data): Change the prototype to use
2872 `int' for array ranges: some invocations do pass an int, not a
2873 short.
2874 Reported by Wayne Green.
2875
b9752825
AD
28762001-12-22 Akim Demaille <akim@epita.fr>
2877
2878 Some actions of web2c.y are improperly triggered.
2879 Reported by Mike Castle.
2880
2881 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2882 * tests/regression.at (Web2c): Rename as...
2883 (Web2c Report): this.
2884 (Web2c Actions): New.
2885
776209d6
AD
28862001-12-22 Akim Demaille <akim@epita.fr>
2887
2888 Reductions in web2c.y are improperly reported.
2889 Reported by Mike Castle.
2890
2891 * src/conflicts.c (print_reductions): Fix.
2892 * tests/regression.at (Web2c): New.
2893
275fc3ad
AD
28942001-12-18 Akim Demaille <akim@epita.fr>
2895
2896 Some host fail on `assert (!"foo")', which expands to
2897 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2898 Reported by Nelson Beebee.
2899
2900 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2901 `#define it_succeeded 0' and `assert (it_succeeded)'.
2902
897668ee
MA
29032001-12-17 Marc Autret <autret_m@epita.fr>
2904
2905 * src/bison.simple: Don't hard code the skeleton line and filename.
2906 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2907 New line counter 'skeleton_line' (skeleton-line muscle).
2908
ab3399e0
PE
29092001-12-17 Paul Eggert <eggert@twinsun.com>
2910
2911 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2912 YYDEBUG must be defined to a nonzero value.
2913
2914 * src/bison.simple (yytname): Do not assume that the user defines
2915 YYDEBUG to a properly parenthesized expression.
2916
3877f72b
AD
29172001-12-17 Akim Demaille <akim@epita.fr>
2918
2919 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2920 nlookaheads is a new member.
2921 Adjust all users.
2922 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2923 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2924 state.
776209d6 2925
331dbc1b
AD
29262001-12-17 Akim Demaille <akim@epita.fr>
2927
2928 * src/files.h, src/files.c (open_files, close_files): Remove.
2929 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2930 let...
2931 * src/reader.c (reader): Do it.
776209d6 2932
be750e4c
AD
29332001-12-17 Akim Demaille <akim@epita.fr>
2934
2935 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2936
709ae8c6
AD
29372001-12-17 Akim Demaille <akim@epita.fr>
2938
2939 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2940 (flush_reduce): New.
2941 (resolve_sr_conflict): Adjust.
776209d6 2942
f87685c3
AD
29432001-12-17 Akim Demaille <akim@epita.fr>
2944
2945 * src/output.c (output_obstack): Be static and rename as...
2946 (format_obstack): this, to avoid any confusion with files.c's
2947 output_obstack.
2948 * src/reader.h (muscle_obstack): Move to...
2949 * src/output.h: here, since it's defined in output.c.
2950
837491d8
AD
29512001-12-17 Akim Demaille <akim@epita.fr>
2952
2953 * src/output.c (action_row, save_column, default_goto)
2954 (sort_actions, matching_state, pack_vector): Better variable
2955 locality.
2956
796d61fb
AD
29572001-12-17 Akim Demaille <akim@epita.fr>
2958
2959 * src/output.c: Various formatting changes.
776209d6 2960
64d15509
AD
29612001-12-17 Akim Demaille <akim@epita.fr>
2962
2963 * src/files.c (output_files): Free the output_obstack.
2964 * src/main.c (main): Call print and print_graph conditionally.
2965 * src/print.c (print): Work unconditionally.
2966 * src/print_graph.c (print_graph): Work unconditionally.
2967 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2968
fbc8ecb7
MA
29692001-12-16 Marc Autret <autret_m@epita.fr>
2970
2971 * src/output.c (actions_output): Fix. When we use %no-lines,
2972 there is one less line per action.
2973
f0440388
MA
29742001-12-16 Marc Autret <autret_m@epita.fr>
2975
2976 * src/bison.simple: Remove a useless #line directive.
2977 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2978 * src/output.c (get_lines_number): New.
776209d6 2979 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2980 output muscles.
2981 Fix line numbering.
2982 (actions_output): Computes the number of lines taken by actions.
2983 (output_master_parser): Insert new skeleton which is the name of
2984 the output parser file name.
2985
a79986b8
MA
29862001-12-15 Marc Autret <autret_m@epita.fr>
2987
2988 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2989
4ec8e00f
MA
29902001-12-15 Marc Autret <autret_m@epita.fr>
2991
2992 * src/output.c (output_gram): Keep track of the hairy one.
2993
1a4648ff
AD
29942001-12-15 Akim Demaille <akim@epita.fr>
2995
2996 Make `make distcheck' work.
2997
2998 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2999 system.h which uses libgettext.h.
3000
9c2c67e6
AD
30012001-12-15 Akim Demaille <akim@epita.fr>
3002
3003 * src/nullable.c (set_nullable): Useless rules must be skipped,
3004 otherwise, since we range over their symbols, we might look at a
3005 nonterminal which no longer ``exists'', i.e., it is not counted in
3006 `nvars', hence we overflow our arrays.
3007
93ede233
AD
30082001-12-15 Akim Demaille <akim@epita.fr>
3009
3010 The header can also be produced directly, without any obstack!
3011 Yahoo!
3012
3013 * src/files.c, src/files.h (defines_obstack): Remove.
3014 (compute_header_macro): Global.
3015 (defines_obstack_save): Remove.
3016 * src/reader.c (parse_union_decl): No longer output to
3017 defines_obstack: its content can be found in the `stype' muscle
3018 anyway.
3019 (output_token_translations): Merge into...
3020 (symbols_output): this.
3021 Rename as...
3022 (symbols_save): this.
3023 (reader): Adjust.
3024 * src/output.c (header_output): New.
3025 (output): Call it.
3026
2666f928
AD
30272001-12-15 Akim Demaille <akim@epita.fr>
3028
3029 * src/reader.c (parse_union_decl): Instead of handling two obstack
3030 simultaneously, use one to define the `stype' muscle, and use the
3031 value of the latter to fill defines_obstack.
3032 (copy_comment): Remove.
3033 (copy_comment2): Work for a single obstack.
3034 Rename as...
3035 (copy_comment): this.
3036
428046f8
AD
30372001-12-15 Akim Demaille <akim@epita.fr>
3038
3039 * src/lex.c, src/lex.h (xgetc): No longer static.
3040 * src/reader.c (parse_union_decl): Revamp.
3041
ea52d706
AD
30422001-12-15 Akim Demaille <akim@epita.fr>
3043
3044 Still making progress in separating Bison into (i) input, (ii)
3045 process, (iii) output: now we can directly output the parser file
3046 without using table_obstack at all.
3047
3048 * src/files.c, src/files.h (table_obstack): Bye bye.
3049 (parser_file_name): New.
3050 * src/files.c (compute_output_file_names): Compute it.
3051 * src/output.c (actions_output, output_parser)
3052 (output_master_parser): To a file instead of an obstack.
3053
3f96f4dc
AD
30542001-12-15 Akim Demaille <akim@epita.fr>
3055
3056 Attach actions to rules, instead of pre-outputting them to
3057 actions_obstack.
3058
3059 * src/gram.h (rule_t): action and action_line are new members.
3060 * src/reader.c (symbol_list): Likewise.
3061 (copy_action): Save the actions within the rule.
3062 (packgram): Save them in rule_table.
3063 * src/output.c (actions_output): New.
3064 (output_parser): Use it on `%%actions'.
3065 (output_rule_data): Don't free rule_table.
3066 (output): Do it.
3067 (prepare): Don't save the `action' muscle.
3068 * src/bison.simple: s/%%action/%%actions/.
3069
51576fb3
AD
30702001-12-15 Akim Demaille <akim@epita.fr>
3071
3072 * src/reader.c (copy_action): When --yacc, don't append a `;'
3073 to the user action: let it fail if lacking.
dee049eb 3074 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 3075
2648a72d
AD
30762001-12-14 Akim Demaille <akim@epita.fr>
3077
3078 * src/lex.c (literalchar): Simply return the char you decoded, non
3079 longer mess around with obstacks and int pointers.
3080 Adjust all callers.
3081
92790e5b
AD
30822001-12-14 Akim Demaille <akim@epita.fr>
3083
3084 * src/lex.c (literalchar): Don't escape the special characters,
3085 just decode them, and keep them as char (before, eol was output as
3086 the 2 char string `\n' etc.).
3087 * src/output.c (output_rule_data): Use quotearg to output the
3088 token strings.
3089
927c1557
PE
30902001-12-13 Paul Eggert <eggert@twinsun.com>
3091
3092 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3093 Do not infringe on the global user namespace when using C++.
3094 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3095 All uses of `fprintf' and `stderr' changed.
3096
3097 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3098
ed8e1f68
AD
30992001-12-13 Akim Demaille <akim@epita.fr>
3100
3101 The computation of nullable is broken: it doesn't handle empty
3102 RHS's properly.
3103
3104 * tests/torture.at (GNU AWK Grammar): New.
3105 * tests/sets.at (Nullable): New.
3106 * src/nullable.c (set_nullable): Instead of blindly looping over
3107 `ritems', loop over the rules, and then over their rhs's.
3108
3109 Work around Autotest bugs.
3110
3111 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3112 frame, because Autotest understand lines starting with a `+' as
3113 traces from the shell. Then, they are not processed properly.
3114 Admittedly an Autotest bug, but we don't have time to wait for
3115 Autotest to catch up.
3116 * tests/regression.at (Broken Closure): Adjust to the new table
3117 frames.
3118 Move to...
3119 * tests/sets.at: here.
3120
cb581495
AD
31212001-12-13 Akim Demaille <akim@epita.fr>
3122
3123 * src/closure.c (closure): Use nrules instead of playing tricks
3124 with BITS_PER_WORD.
3125
2e729273
AD
31262001-12-13 Akim Demaille <akim@epita.fr>
3127
3128 * src/print.c (print_actions): Output the handling of `$' as the
3129 traces do: shifting the token EOF. Before EOF was treated as a
3130 nonterminal.
3131 * tests/regression.at: Adjust some tests.
3132 * src/print_graph.c (print_core): Complete the set of items via
3133 closure. The next-to-final and final states are still unsatisfying,
3134 but that's to be addressed elsewhere.
3135 No longer output the rule numbers, but do output the state number.
3136 A single loop for the shifts + gotos is enough, but picked a
3137 distinct color for each.
3138 (print_graph): Initialize and finalize closure.
3139
107f7dfb
AD
31402001-12-13 Akim Demaille <akim@epita.fr>
3141
3142 * src/reader.c (readgram): Remove dead code, an strip useless
3143 braces.
3144 (get_type): Remove, unused.
3145
9b53a24f
AD
31462001-12-12 Akim Demaille <akim@epita.fr>
3147
3148 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3149 on that of lib/error.c.
3150
dbfb6dcd
AD
31512001-12-12 Akim Demaille <akim@epita.fr>
3152
3153 Some hosts don't like `/' in includes.
3154
3155 * src/system.h: Include libgettext.h without qualifying the path.
3156 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3157 $(top_srcdir).
3158
c25fb648
MA
31592001-12-11 Marc Autret <autret_m@epita.fr>
3160
3161 * src/output.c (output_parser): Remove useless muscle.
3162
710ddc4f
MA
31632001-12-11 Marc Autret <autret_m@epita.fr>
3164
3165 * src/bison.simple: Remove #line just before %%epilogue. It
3166 is now handled in ...
3167 * src/reader.c (read_additionnal_code): Add the output of a
3168 #line for the epilogue.
3169
e83d80b8
MA
31702001-12-10 Marc Autret <autret_m@epita.fr>
3171
927c1557 3172 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3173 replace precedent remove.
3174 * src/bison.simple: Remove #line before %%prologue because
3175 %%input-line is wrong at this time.
3176
971d5158
MA
31772001-12-10 Marc Autret <autret_m@epita.fr>
3178
3179 * src/reader.c (symbols_output): Clean up.
927c1557 3180 * src/output.c (output_gram, output): Clean up.
971d5158 3181
5edafffd
AD
31822001-12-10 Akim Demaille <akim@epita.fr>
3183
3184 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3185 * src/LR0.c (set_state_table): here.
3186 * src/lalr.c (lalr): Call it.
3187
0279f8e9
AD
31882001-12-10 Akim Demaille <akim@epita.fr>
3189
3190 * src/state.h (shifts): Remove the `number' member: shifts are
3191 attached to state, hence no longer need to be labelled with a
3192 state number.
3193
190c4f5f
AD
31942001-12-10 Akim Demaille <akim@epita.fr>
3195
3196 Now that states have a complete set of members, the linked list of
3197 shifts is useless: just fill directly the state's shifts member.
3198
3199 * src/state.h (shifts): Remove the `next' member.
3200 * src/LR0.c (first_state, last_state): Remove.
3201 Adjust the callers.
3202 (augment_automaton): Don't look for the shifts that must be added
3203 a shift on EOF: it is those of the state we looked for! But now,
3204 since shifts are attached, it is no longer needed to looking
3205 merely by its id: its number.
3206
2a73b93d
AD
32072001-12-10 Akim Demaille <akim@epita.fr>
3208
3209 * src/LR0.c (augment_automaton): Better variable locality.
3210 Remove an impossible branch: if there is a state corresponding to
3211 the start symbol being shifted, then there is shift for the start
3212 symbol from the initial state.
3213
74392f6a
AD
32142001-12-10 Akim Demaille <akim@epita.fr>
3215
3216 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3217 only when appropriate: when insert_start_shifting_state' is not
3218 invoked.
3219 * tests/regression.at (Rule Line Numbers): Adjust.
3220
37c82725
AD
32212001-12-10 Akim Demaille <akim@epita.fr>
3222
3223 * src/LR0.c (augment_automaton): Now that all states have shifts,
3224 merge the two cases addition shifts to the initial state.
3225
6a164e0c
AD
32262001-12-10 Akim Demaille <akim@epita.fr>
3227
3228 * src/lalr.c (set_state_table): Move to...
3229 * src/LR0.c: here.
3230 * src/lalr.c (lalr): Don't call it...
3231 * src/LR0.c (generate_states): do it.
3232 * src/LR0.h (first_state): Remove, only the table is used.
3233
7215de24
AD
32342001-12-10 Akim Demaille <akim@epita.fr>
3235
3236 * src/LR0.h (first_shift, first_reduction): Remove.
3237 * src/lalr.c: Don't use first_shift: find shifts through the
3238 states.
3239
80e25d4d
AD
32402001-12-10 Akim Demaille <akim@epita.fr>
3241
3242 * src/LR0.c: Attach shifts to states as soon as they are
3243 computed.
3244 * src/lalr.c (set_state_table): Instead of assigning shifts to
3245 state, just assert that the mapping was properly done.
3246
0ab3728b
AD
32472001-12-10 Akim Demaille <akim@epita.fr>
3248
3249 * src/LR0.c (insert_start_shift): Rename as...
3250 (insert_start_shifting_state): this.
3251 (insert_eof_shifting_state, insert_accepting_state): New.
3252 (augment_automaton): Adjust.
3253 Better locality of the variables.
3254 When looking if the start_symbol is shifted from the initial
3255 state, using `while (... symbol != start_symbol ...)' sounds
3256 better than `while (... symbol < start_symbol ...)': If fail
3257 to see how the order between symbols could be relevant!
3258
78af9bbc
AD
32592001-12-10 Akim Demaille <akim@epita.fr>
3260
3261 * src/getargs.h: Don't declare `spec_name_prefix' and
3262 `spec_file_prefix', declared by src/files.h.
3263 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3264 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3265 * src/output.c (prepare): Adjust.
3266 * src/reader.c (symbols_output): Likewise.
3267 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3268
bdef2a41
AD
32692001-12-10 Akim Demaille <akim@epita.fr>
3270
3271 * src/muscle_tab.c (muscle_init): NULL is a better default than
3272 `"0"'.
3273
3735969c
AD
32742001-12-10 Akim Demaille <akim@epita.fr>
3275
3276 * src/reader.c (reader): Calling symbols_output once is enough.
3277
49701457
AD
32782001-12-10 Akim Demaille <akim@epita.fr>
3279
3280 Now that states have a complete set of members, the linked list of
3281 reductions is useless: just fill directly the state's reductions
3282 member.
3283
3284 * src/state.h (struct reductions): Remove member `number' and
3285 `next'.
3286 * src/LR0.c (first_reduction, last_reduction): Remove.
3287 (save_reductions): Don't link the new reductions, store them in
3288 this_state.
3289 * src/lalr.c (set_state_table): No need to attach reductions to
3290 states, it's already done.
3291 * src/output.c (output_actions): No longer free the shifts, then
3292 the reductions, then the states: free all the states and their
3293 members.
3294
0edad749
AD
32952001-12-10 Akim Demaille <akim@epita.fr>
3296
3297 * src/options.c (OPTN, DRTV, BOTH): New.
3298 (option_table): Use them.
3299
0edad749
AD
3300 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3301 the job of system.h.
3302 * src/options.c: Don't include stdio.h and xalloc.h for the same
3303 reasons.
3304
5449dd0f
AD
33052001-12-10 Akim Demaille <akim@epita.fr>
3306
3307 * src/output.c (output, prepare): Make sure the values of the
3308 muscles `action' and `prologue' are 0-terminated.
3309
a870c567
AD
33102001-12-10 Akim Demaille <akim@epita.fr>
3311
3312 Clean up GCC warnings.
3313
3314 * src/reader.c (copy_action): `buf' is not used.
3315 (parse_skel_decl): Be static.
3316 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3317 * src/options.h (create_long_option_table): Have a real prototype.
3318 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3319 (hash_delete_at): Return const void *.
3320 Adjust casts to preserve the const.
3321
80df8768
AD
33222001-12-10 Akim Demaille <akim@epita.fr>
3323
3324 * configure.in: Require 2.52g.
3325 M4 is not needed, but AUTOM4TE is.
3326 * m4/m4.m4: Remove.
3327 * tests/Makefile.am: Adjust.
3328
f693ad14
AD
33292001-12-10 Akim Demaille <akim@epita.fr>
3330
3331 One structure for states is enough, even though theoretically
3332 there are LR(0) states and LALR(1) states.
3333
3334 * src/lalr.h (state_t): Remove.
3335 (state_table): Be state_t **, not state_t *.
3336 * src/state.h (core, CORE_ALLOC): Rename as...
3337 (state_t, STATE_ALLOC): this.
3338 Add the LALR(1) members: shifts, reductions, errs.
3339 * src/LR0.c (state_table): Rename as...
3340 (state_hash): this, to avoid name clashes with the global
3341 `state_table'.
3342 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3343 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3344
74ffbcb6
AD
33452001-12-10 Akim Demaille <akim@epita.fr>
3346
3347 Bison dumps core on bash.y.
3348 Reported by Pascal Bart.
3349
3350 * src/warshall.c (bitmatrix_print): New.
3351 (TC): Use it.
3352 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3353 j must be the outer loop.
3354 * tests/regression.at (Broken Closure): New.
3355
07708e19
AD
33562001-12-05 Akim Demaille <akim@epita.fr>
3357
3358 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3359 its argument.
3360