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