]> git.saurik.com Git - bison.git/blame - ChangeLog
(<SC_ESCAPED_CHARACTER>): Convert to unsigned char, so that negative
[bison.git] / ChangeLog
CommitLineData
1154cced
AD
12002-06-30 Akim Demaille <akim@epita.fr>
2
3 Have the GLR tests be `warning' checked, and fix the warnings.
4
5 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
6 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
7 (yyremoveDeletes): `yyi' and `yyj' are size_t.
8 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
9 (yyaddDeferredAction): static.
10 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
11 (yyreportParseError): yyprefix is const.
12 yytokenp is used only when verbose.
13 (yy__GNUC__): Replace with __GNUC__.
14 (yypdumpstack): yyi is size_t.
15 (yypreference): Un-yy local variables and arguments, to avoid
16 clashes with `yyr1'. Anyway, we are not in the user name space.
17 (yytname_size): be an int, as is compared with ints.
18 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
19 Use them.
20 * tests/cxx-gram.at: Use quotation to protect $1.
21 Use AT_COMPILE to enable warnings hunts.
22 Prototype yylex and yyerror.
23 `Use' argc.
24 Include `string.h', not `strings.h'.
25 Produce and prototype stmtMerge only when used.
26 yylex takes a location.
27
97650f4e
AD
282002-06-30 Akim Demaille <akim@epita.fr>
29
30 We spend a lot of time in quotearg, in particular when --verbose.
31
32 * src/symtab.c (symbol_get): Store a quoted version of the key.
33 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
34 Adjust all callers.
35
d2576365
AD
362002-06-30 Akim Demaille <akim@epita.fr>
37
38 * src/state.h (reductions_t): Rename member `nreds' as num.
39 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
40 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
41
ccaf65bc
AD
422002-06-30 Akim Demaille <akim@epita.fr>
43
44 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
45 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
46 (shifts_to): Rename as...
47 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
48 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
49 (TRANSITION_IS_DISABLED, transitions_to): these.
50
87675353
AD
512002-06-30 Akim Demaille <akim@epita.fr>
52
53 * src/print.c (print_shifts, print_gotos): Merge into...
54 (print_transitions): this.
55 (print_transitions, print_errs, print_reductions): Align the
56 lookaheads columns.
57 (print_core, print_transitions, print_errs, print_state,
58 print_grammar): Output empty lines separator before, not after.
59 (state_default_rule_compute): Rename as...
60 (state_default_rule): this.
61 * tests/conflicts.at (Defaulted Conflicted Reduction),
62 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
63 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
64
ce4ccb4b
AD
652002-06-30 Akim Demaille <akim@epita.fr>
66
67 Display items as we display rules.
68
69 * src/gram.h, src/gram.c (rule_lhs_print): New.
70 * src/gram.c (grammar_rules_partial_print): Use it.
71 * src/print.c (print_core): Likewise.
72 * tests/conflicts.at (Defaulted Conflicted Reduction),
73 (Unresolved SR Conflicts): Adjust.
74 (Unresolved SR Conflicts): Adjust and rename as...
75 (Resolved SR Conflicts): this, as was meant.
76 * tests/regression.at (Web2c Report): Adjust.
77
bc933ef1
AD
782002-06-30 Akim Demaille <akim@epita.fr>
79
80 * src/print.c (state_default_rule_compute): New, extracted from...
81 (print_reductions): here.
82 Pessimize, but clarify the code.
83 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
84
53d4308d
AD
852002-06-30 Akim Demaille <akim@epita.fr>
86
87 * src/output.c (action_row): Let default_rule be always a rule
88 number.
89
574fb2d5
AD
902002-06-30 Akim Demaille <akim@epita.fr>
91
92 * src/closure.c (print_firsts, print_fderives, closure):
93 Use BITSET_EXECUTE.
94 * src/lalr.c (lookaheads_print): Likewise.
95 * src/state.c (state_rule_lookaheads_print): Likewise.
96 * src/print_graph.c (print_core): Likewise.
97 * src/print.c (print_reductions): Likewise.
98 * src/output.c (action_row): Likewise.
99 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
100
05811fd7
AD
1012002-06-30 Akim Demaille <akim@epita.fr>
102
103 * src/print_graph.c: Use report_flag.
104
0e4d5753
AD
1052002-06-30 Akim Demaille <akim@epita.fr>
106
107 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
108 to...
109 * src/relation.h, src/relation.c (traverse, relation_digraph)
110 (relation_print, relation_transpose): New.
111
24c7d800
AD
1122002-06-30 Akim Demaille <akim@epita.fr>
113
114 * src/state.h, src/state.c (shifts_to): New.
115 * src/lalr.c (build_relations): Use it.
116
9222837b
AD
1172002-06-30 Akim Demaille <akim@epita.fr>
118
119 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
120 (item_number_of_rule_number, rule_number_of_item_number): New.
121 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
122 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
123 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
124 Propagate their use.
125 Much remains to be done, in particular wrt `shorts' from types.h.
126
260008e5
AD
1272002-06-30 Akim Demaille <akim@epita.fr>
128
129 * src/symtab.c (symbol_new): Initialize the `printer' member.
130
8a731ca8
AD
1312002-06-30 Akim Demaille <akim@epita.fr>
132
133 * src/LR0.c (save_reductions): Remove, replaced by...
134 * src/state.h, src/state.c (state_reductions_set): New.
135 (reductions, errs): Rename as...
136 (reductions_t, errs_t): these.
137 Adjust all dependencies.
138
32e1e0a4
AD
1392002-06-30 Akim Demaille <akim@epita.fr>
140
141 * src/LR0.c (state_list_t, state_list_append): New.
142 (first_state, last_state): Now symbol_list_t.
143 (this_state): Remove.
144 (new_itemsets, append_states, save_reductions): Take a state_t as
145 argument.
146 (set_states, generate_states): Adjust.
147 (save_shifts): Remove, replaced by...
148 * src/state.h, src/state.c (state_shifts_set): New.
149 (shifts): Rename as...
150 (shifts_t): this.
151 Adjust all dependencies.
152 * src/state.h (state_t): Remove the `next' member.
153
e5fb6710
AD
1542002-06-30 Akim Demaille <akim@epita.fr>
155
156 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
157 escaped in slot 0.
158
c7ca99d4
AD
1592002-06-30 Akim Demaille <akim@epita.fr>
160
161 Use hash.h for the state hash table.
162
163 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
164 (allocate_storage): Use state_hash_new.
165 (free_storage): Use state_hash_free.
166 (new_state, get_state): Adjust.
167 * src/lalr.h, src/lalr.c (states): Move to...
168 * src/states.h (state_t): Remove the `link' member, no longer
169 used.
170 * src/states.h, src/states.c: here.
171 (state_hash_new, state_hash_free, state_hash_lookup)
172 (state_hash_insert, states_free): New.
173 * src/states.c (state_table, state_compare, state_hash): New.
174 * src/output.c (output_actions): Do not free states now, since we
175 still need to know the final_state number in `prepare', called
176 afterwards. Do it...
177 * src/main.c (main): here: call states_free after `output'.
178
df0e7316
AD
1792002-06-30 Akim Demaille <akim@epita.fr>
180
181 * src/state.h, src/state.c (state_new): New, extracted from...
182 * src/LR0.c (new_state): here.
183 * src/state.h (STATE_ALLOC): Move to...
184 * src/state.c: here.
185 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
186 * src/state.h, src/state.c: here.
187
39f41916
AD
1882002-06-30 Akim Demaille <akim@epita.fr>
189
190 * src/reader.c (gensym): Rename as...
191 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
192 (getsym): Rename as...
193 (symbol_get): this.
194
d57650a5
AD
1952002-06-30 Akim Demaille <akim@epita.fr>
196
197 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
198 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
199 * src/output.c, src/print.c, src/print_graph.c: Propagate.
200 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
201
5a08f1ce
AD
2022002-06-30 Akim Demaille <akim@epita.fr>
203
204 Make the test suite pass with warnings checked.
205
206 * tests/actions.at (Printers and Destructors): Improve.
207 Avoid unsigned vs. signed issues.
208 * tests/calc.at: Don't exercise the scanner here, do it...
209 * tests/input.at (Torturing the Scanner): here.
210
720623af
PH
2112002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
212
88e7e941 213 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
214 reorganize first lines parallel to yacc.c.
215
fb8135fa
AD
2162002-06-28 Akim Demaille <akim@epita.fr>
217
218 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
219 (b4_token_enum, b4_token_defines): New, factored from...
220 * data/lalr1.cc, data/yacc.c, glr.c: here.
221
41442480
AD
2222002-06-28 Akim Demaille <akim@epita.fr>
223
224 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
225 unused variables.
226 * src/output.c (merger_output): static.
227
e0e5bf84
AD
2282002-06-28 Akim Demaille <akim@epita.fr>
229
230 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
231 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
232 pacify GCC.
233 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 234
676385e2
PH
2352002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
236
237 Accumulated changelog for new GLR parsing features.
238
e0e5bf84 239 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
240 conflicts_total_count.
241 * src/conflicts.h: Ditto.
242 * src/output.c (token_actions): Use the new name.
243 (output_conflicts): Change conflp => conflict_list_heads, and
244 confl => conflict_list for better readability.
245 * data/glr.c: Use the new names.
246 * NEWS: Add self to GLR announcement.
e0e5bf84 247
676385e2
PH
248 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
249
250 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
251 Akim Demaille.
252
253 * data/bison.glr: Change name to glr.c
254 * data/glr.c: Renamed from bison.glr.
255 * data/Makefile.am: Add glr.c
e0e5bf84
AD
256
257 * src/getargs.c:
258
676385e2
PH
259 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
260 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 261
676385e2
PH
262 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
263
264 * data/bison.glr: Be sure to restore the
265 current #line when returning to the skeleton contents after having
266 exposed the input file's #line.
267
268 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
269
270 * data/bison.glr: Bring up to date with changes to bison.simple.
271
272 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
273
274 * data/bison.glr: Correct definitions that use b4_prefix.
275 Various reformatting.
276 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
277 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
278 yytokenp argument; now part of stack.
279 (yychar): Define to behave as documented.
280 (yyclearin): Ditto.
e0e5bf84 281
676385e2
PH
282 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
283
284 * src/reader.h: Add declaration for free_merger_functions.
285
286 * src/reader.c (merge_functions): New variable.
287 (get_merge_function): New function.
288 (free_merger_functions): New function.
289 (readgram): Check for %prec that is not followed by a symbol.
290 Handle %dprec and %merge declarations.
291 (packgram): Initialize dprec and merger fields in rules array.
292
293 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
294 conflict_list_cnt, conflict_list_free): New variables.
295 (table_grow): Also grow conflict_table.
e0e5bf84 296 (prepare_rules): Output dprec and merger tables.
676385e2 297 (conflict_row): New function.
e0e5bf84 298 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
299 default reduction in conflicted states for GLR parser so that there
300 are spaces for the conflict lists.
301 (save_row): Also save conflict information.
302 (token_actions): Allocate conflict list.
303 (merger_output): New function.
304 (pack_vector): Pack conflict table, too.
305 (output_conflicts): New function to output yyconflp and yyconfl.
306 (output_check): Allocate conflict_tos.
307 (output_actions): Output conflict tables, also.
308 (output_skeleton): Output b4_mergers definition.
309 (prepare): Output b4_max_rhs_length definition.
310 Use 'bison.glr' as default skeleton for GLR parsers.
311
312 * src/gram.c (glr_parser): New flag.
313 (grammar_free): Call free_merger_functions.
314
315 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
316 all pairs of conflicting reductions, rather than just all tokens
317 causing conflicts. Needed to size conflict tables.
e0e5bf84 318 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
319 interface.
320 (conflicts_print): Ditto.
321 (count_total_conflicts): New function.
322
323 * src/reader.h (merger_list): New type.
324 (merge_functions): New variable.
325
326 * src/lex.h (tok_dprec, tok_merge): New token types.
327
328 * src/gram.h (rule_s): Add dprec and merger fields.
329 (glr_parser): New flag.
330
331 * src/conflicts.h (count_total_conflicts): New function.
332
333 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
334
335 * doc/bison.texinfo (Generalized LR Parsing): New section.
336 (GLR Parsers): New section.
337 (Language and Grammar): Mention GLR parsing.
338 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
339 Correct typo ("tge" -> "the").
340
341 * data/bison.glr: New skeleton for GLR parsing.
342
343 * tests/cxx-gram.at: New tests for GLR parsing.
344
345 * tests/testsuite.at: Include cxx-gram.at.
346
347 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 348
676385e2
PH
349 * src/parse-gram.y:
350
351 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
352
353 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 354
b5480d74 3552002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
356
357 * src/options.h, src/options.c: Remove.
358 * src/getargs.c (short_options, long_options): New.
359
60491a94
AD
3602002-06-27 Akim Demaille <akim@epita.fr>
361
362 * data/bison.simple, data/bison.c++: Rename as...
363 * data/yacc.c, data/lalr1.cc: these.
364 * doc/bison.texinfo (Environment Variables): Remove.
365
9be0c25b
AD
3662002-06-25 Raja R Harinath <harinath@cs.umn.edu>
367
368 * src/getargs.c (report_argmatch): Initialize strtok().
369
1ae72863
AD
3702002-06-20 Akim Demaille <akim@epita.fr>
371
372 * data/bison.simple (b4_symbol_actions): New, replaces...
373 (b4_symbol_destructor, b4_symbol_printer): these.
374 (yysymprint): Be sure to call YYPRINT only for tokens, and using
375 user token numbers.
376
87542d29
AD
3772002-06-20 Akim Demaille <akim@epita.fr>
378
379 * data/bison.simple (yydestructor): Rename as...
380 (yydestruct): this.
381
1a31ed21
AD
3822002-06-20 Akim Demaille <akim@epita.fr>
383
384 * src/symtab.h, src/symtab.c (symbol_type_set)
385 (symbol_destructor_set, symbol_precedence_set): The location is
386 the last argument.
387 Adjust all callers.
388
e776192e
AD
3892002-06-20 Akim Demaille <akim@epita.fr>
390
391 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
392 internals.
393 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
394 Takes a location.
395 * src/symtab.h, src/symtab.c (symbol_class_set)
396 (symbol_user_token_number_set): Likewise.
397 Adjust all callers.
398 Promote complain_at.
399 * tests/input.at (Type Clashes): Adjust.
400
5c1180b3
AD
4012002-06-20 Akim Demaille <akim@epita.fr>
402
403 * data/bison.simple (YYLEX): Fix the declaration when
404 %pure-parser.
405
e3170060
AD
4062002-06-20 Akim Demaille <akim@epita.fr>
407
408 * data/bison.simple (yysymprint): Don't print the token number,
409 just its name.
410 * tests/actions.at (Destructors): Rename as...
411 (Printers and Destructors): this.
412 Also exercise %printer.
413
253862fd
AD
4142002-06-20 Akim Demaille <akim@epita.fr>
415
416 * data/bison.simple (YYDSYMPRINT): New.
417 Use it to remove many of the #if YYDEBUG/if (yydebug).
418
366eea36
AD
4192002-06-20 Akim Demaille <akim@epita.fr>
420
421 * src/symtab.h, src/symtab.c (symbol_t): printer and
422 printer_location are new members.
423 (symbol_printer_set): New.
424 * src/parse-gram.y (PERCENT_PRINTER): New token.
425 Handle its associated rule.
426 * src/scan-gram.l: Adjust.
427 (handle_destructor_at, handle_destructor_dollar): Rename as...
428 (handle_symbol_code_at, handle_symbol_code_dollar): these.
429 * src/output.c (symbol_printers_output): New.
430 (output_skeleton): Call it.
431 * data/bison.simple (yysymprint): New. Cannot be named yyprint
432 since there are already many grammar files with a user `yyprint'.
433 Replace the calls to YYPRINT to calls to yysymprint.
434 * tests/calc.at: Adjust.
435 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
436 taking advantage of parser very internal details (stack size!).
437
4f25ebb0
AD
4382002-06-20 Akim Demaille <akim@epita.fr>
439
440 * src/scan-gram.l: Complete the scanner with the missing patterns
441 to pacify Flex.
442 Use `quote' and `symbol_tag_get' where appropriate.
443
93b68a0e
AD
4442002-06-19 Akim Demaille <akim@epita.fr>
445
446 * tests/actions.at (Destructors): Augment to test locations.
447 * data/bison.simple (yydestructor): Pass it the current location
448 if locations are enabled.
449 Prototype only when __STDC__ or C++.
450 Change the argument names to move into the yy name space: there is
451 user code here.
452
58612f1d
AD
4532002-06-19 Akim Demaille <akim@epita.fr>
454
74310291
AD
455 * data/bison.simple (b4_pure_if): New.
456 Use it instead of #ifdef YYPURE.
457
4582002-06-19 Akim Demaille <akim@epita.fr>
459
460 * data/bison.simple (b4_location_if): New.
58612f1d
AD
461 Use it instead of #ifdef YYLSP_NEEDED.
462
f25bfb75
AD
4632002-06-19 Akim Demaille <akim@epita.fr>
464
465 Prepare @$ in %destructor, but currently don't bind it in the
466 skeleton, as %location use is not cleaned up yet.
467
468 * src/scan-gram.l (handle_dollar, handle_destructor_at)
469 (handle_action_at): New.
470 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
471 a braced_code_t and a location as additional arguments.
472 (handle_destructor_dollar): Instead of requiring `b4_eval', just
473 unquote one when outputting `b4_dollar_dollar'.
474 Adjust callers.
475 * data/bison.simple (b4_eval): Remove.
476 (b4_symbol_destructor): Adjust.
477 * tests/input.at (Invalid @n): Adjust.
478
c732d2c6
AD
4792002-06-19 Zack Weinberg <zack@codesourcery.com>
480
481 * doc/bison.texinfo: Document ability to have multiple
482 prologue sections.
483
8c165d89
AD
4842002-06-18 Akim Demaille <akim@epita.fr>
485
486 * src/files.c (compute_base_names): When computing the output file
487 names from the input file name, strip the directory part.
488
ca98bf57
AD
4892002-06-18 Akim Demaille <akim@epita.fr>
490
491 * data/bison.simple.new: Comment changes.
492 Reported by Andreas Schwab.
493
0bfb02ff
AD
4942002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
495
496 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
497 there are no `label `yyoverflowlab' defined but not used' warnings
498 when yyoverflow is defined.
499
24c0aad7
AD
5002002-06-18 Akim Demaille <akim@epita.fr>
501
502 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
503 new member.
504 (symbol_destructor_set): Adjust.
505 * src/output.c (symbol_destructors_output): Output the destructor
506 locations.
507 Output the symbol name.
508 * data/bison.simple (b4_symbol_destructor): Adjust.
509
5719c109
AD
5102002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
511 and Akim Demaille <akim@epita.fr>
512
513 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
514 what's left on the stack when the error recovery hits EOF.
515 * tests/actions.at (Destructors): Complete to exercise this case.
516
9280d3ef
AD
5172002-06-17 Akim Demaille <akim@epita.fr>
518
519 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
520 arguments is really empty, not only equal to `[]'.
521 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
522 member.
523 (symbol_destructor_set): New.
524 * src/output.c (symbol_destructors_output): New.
525 * src/reader.h (brace_code_t, current_braced_code): New.
526 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
527 (handle_dollar): Rename as...
528 (handle_action_dollar): this.
529 (handle_destructor_dollar): New.
530 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
531 (grammar_declaration): Use it.
532 * data/bison.simple (yystos): Is always defined.
533 (yydestructor): New.
534 * tests/actions.at (Destructors): New.
535 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
536
dafdc66f
AD
5372002-06-17 Akim Demaille <akim@epita.fr>
538
539 * src/symlist.h, src/symlist.c (symbol_list_length): New.
540 * src/scan-gram.l (handle_dollar, handle_at): Compute the
541 rule_length only when needed.
542 * src/output.c (actions_output, token_definitions_output): Output
543 the full M4 block.
544 * src/symtab.c: Don't access directly to the symbol tag, use
545 symbol_tag_get.
546 * src/parse-gram.y: Use symbol_list_free.
547
56c47203
AD
5482002-06-17 Akim Demaille <akim@epita.fr>
549
550 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
551 (symbol_list_prepend, get_type_name): Move to...
552 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
553 (symbol_list_prepend, symbol_list_n_type_name_get): here.
554 Adjust all callers.
555 (symbol_list_free): New.
556 * src/scan-gram.l (handle_dollar): Takes a location.
557 * tests/input.at (Invalid $n): Adjust.
558
1e0bab92
AD
5592002-06-17 Akim Demaille <akim@epita.fr>
560
561 * src/reader.h, src/reader.c (symbol_list_new): Export it.
562 (symbol_list_prepend): New.
563 * src/parse-gram.y (%union): `list' is a new member.
564 (symbols.1): New, replaces...
565 (terms_to_prec.1, nterms_to_type.1): these.
566 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
567 Take a location as additional argument.
568 Adjust all callers.
569
04e60654
AD
5702002-06-15 Akim Demaille <akim@epita.fr>
571
572 * src/parse-gram.y: Move %token in the declaration section so that
573 we don't depend upon CVS Bison.
574
10e5b8bd
AD
5752002-06-15 Akim Demaille <akim@epita.fr>
576
577 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
578 * src/print.c (print_core): Use it.
579
9801d40c
AD
5802002-06-15 Akim Demaille <akim@epita.fr>
581
582 * src/conflicts.c (log_resolution): Accept the rule involved in
583 the sr conflicts instead of the lookahead number that points to
584 that rule.
585 (flush_reduce): Accept the current lookahead vector as argument,
586 instead of the index in LA.
587 (resolve_sr_conflict): Accept the current number of lookahead
588 bitset to consider for the STATE, instead of the index in LA.
589 (set_conflicts): Adjust.
590 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
591
c0263492
AD
5922002-06-15 Akim Demaille <akim@epita.fr>
593
594 * src/state.h (state_t): Replace the `lookaheadsp' member, a
595 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
596 Adjust all dependencies.
597 * src/lalr.c (initialize_lookaheads): Split into...
598 (states_lookaheads_count, states_lookaheads_initialize): these.
599 (lalr): Adjust.
600
9757c359
AD
6012002-06-15 Akim Demaille <akim@epita.fr>
602
603 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
604 out of...
605 (grammar_rules_print): here.
606 * src/reduce.c (reduce_output): Use it.
607 * tests/reduce.at (Useless Rules, Reduced Automaton)
608 (Underivable Rules): Adjust.
609
6b98e4b5
AD
6102002-06-15 Akim Demaille <akim@epita.fr>
611
612 Copy BYacc's nice way to report the grammar.
613
614 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
615 New.
616 Don't print the rules' location, it is confusing and useless.
617 (rule_print): Use grammar_rhs_print.
618 * src/print.c (print_grammar): Use grammar_rules_print.
619
6b98e4b5
AD
6202002-06-15 Akim Demaille <akim@epita.fr>
621
622 Complete and rationalize `useless thing' warnings.
623
624 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
625 (symbol_tag_print): New.
626 Use them everywhere in place of accessing directly the tag member.
627 * src/gram.h, src/gram.c (rule_print): New.
628 Use it where a rule used to be printed `by hand'.
629 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
630 (reduce_grammar_tables): Report the useless rules.
631 (reduce_print): Useless things are a warning, not an error.
632 Report it as such.
633 * tests/reduce.at (Useless Nonterminals, Useless Rules):
634 (Reduced Automaton, Underivable Rules): Adjust.
635 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
636 * tests/conflicts.at (Unresolved SR Conflicts)
637 (Solved SR Conflicts): Adjust.
638
ee000ba4
AD
6392002-06-15 Akim Demaille <akim@epita.fr>
640
641 Let symbols have a location.
642
643 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
644 (getsym): Adjust.
645 Adjust all callers.
646 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
647 Use location_t, not int.
648 * src/symtab.c (symbol_check_defined): Take advantage of the
649 location.
650 * tests/regression.at (Invalid inputs): Adjust.
651
8efe435c
AD
6522002-06-15 Akim Demaille <akim@epita.fr>
653
654 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
655 (input): Don't try to initialize yylloc here, do it in the
656 scanner.
657 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
658 * src/gram.h (rule_t): Change line and action_line into location
659 and action_location, of location_t type.
660 Adjust all dependencies.
661 * src/location.h, src/location.c (empty_location): New.
662 * src/reader.h, src/reader.c (grammar_start_symbol_set)
663 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
664 (grammar_current_rule_symbol_append)
665 (grammar_current_rule_action_append): Expect a location as argument.
666 * src/reader.c (grammar_midrule_action): Adjust to attach an
667 action's location as dummy symbol location.
668 * src/symtab.h, src/symtab.c (startsymbol_location): New.
669 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
670 the line numbers.
671
1921f1d7
AD
6722002-06-14 Akim Demaille <akim@epita.fr>
673
674 Grammar declarations may be found in the grammar section.
675
676 * src/parse-gram.y (rules_or_grammar_declaration): New.
677 (declarations): Each declaration may end with a semicolon, not
678 just...
679 (grammar_declaration): `"%union"'.
680 (grammar): Branch to rules_or_grammar_declaration.
681
4515534c
AD
6822002-06-14 Akim Demaille <akim@epita.fr>
683
684 * src/main.c (main): Invoke scanner_free.
685
f958596b
AD
6862002-06-14 Akim Demaille <akim@epita.fr>
687
688 * src/output.c (m4_invoke): Extracted from...
689 (output_skeleton): here.
690 Free tempfile.
691
2c569025
AD
6922002-06-14 Akim Demaille <akim@epita.fr>
693
694 * src/parse-gram.y (directives, directive, gram)
695 (grammar_directives, precedence_directives, precedence_directive):
696 Rename as...
697 (declarations, declaration, grammar, grammar_declaration)
698 (precedence_declaration, precedence_declarator): these.
699 (symbol_declaration): New.
700
592e8d4d
AD
7012002-06-14 Akim Demaille <akim@epita.fr>
702
703 * src/files.c (action_obstack): Remove, unused.
704 (output_obstack): Remove it, and all its dependencies, as it is no
705 longer needed.
706 * src/reader.c (epilogue_set): Build the epilogue in the
707 muscle_obstack.
708 * src/output.h, src/output.c (muscle_obstack): Move to...
709 * src/muscle_tab.h, src/muscle_tab.h: here.
710 (muscle_init): Initialize muscle_obstack.
711 (muscle_free): New.
712 * src/main.c (main): Call it.
713
0c15323d
AD
7142002-06-14 Akim Demaille <akim@epita.fr>
715
716 * src/location.h: New, extracted from...
717 * src/reader.h: here.
718 * src/Makefile.am (noinst_HEADERS): Merge into
719 (bison_SOURCES): this.
720 Add location.h.
721 * src/parse-gram.y: Use location_t instead of Bison's.
722 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
723 Use location_t instead of ints.
724
e96c9728
AD
7252002-06-14 Akim Demaille <akim@epita.fr>
726
727 * data/bison.simple, data/bison.c++: Be sure to restore the
728 current #line when returning to the skeleton contents after having
729 exposed the input file's #line.
730
75d1fe16
AD
7312002-06-12 Akim Demaille <akim@epita.fr>
732
733 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
734 eager.
735 * tests/actions.at (Exotic Dollars): New.
736
6c35d22c
AD
7372002-06-12 Akim Demaille <akim@epita.fr>
738
739 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
740 ['"/] too eagerly.
741 * tests/input.at (Torturing the Scanner): New.
742
1d6412ad
AD
7432002-06-11 Akim Demaille <akim@epita.fr>
744
745 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
746 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
747 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
748 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
749 * src/reader.c (reader): Use it.
750
4cdb01db
AD
7512002-06-11 Akim Demaille <akim@epita.fr>
752
753 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
754 Adjust all callers.
755 (scanner_last_string_free): New.
756
44995b2e
AD
7572002-06-11 Akim Demaille <akim@epita.fr>
758
759 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
760 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
761 (last_string, YY_OBS_FREE): New.
762 Use them when returning an ID.
763
e9955c83
AD
7642002-06-11 Akim Demaille <akim@epita.fr>
765
766 Have Bison grammars parsed by a Bison grammar.
767
768 * src/reader.c, src/reader.h (prologue_augment): New.
769 * src/reader.c (copy_definition): Remove.
770
771 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
772 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
773 (grammar_current_rule_prec_set, grammar_current_rule_check)
774 (grammar_current_rule_symbol_append)
775 (grammar_current_rule_action_append): Export.
776 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
777 (symbol_list_action_append): Remove.
778 Hook the routines from reader.
779 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
780 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
781
782 * src/reader.c (read_declarations): Remove, unused.
783
784 * src/parse-gram.y: Handle the epilogue.
785 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
786 (grammar_start_symbol_set): this.
787 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
788 * src/reader.c (readgram): Remove, unused.
789 (reader): Adjust to insert eoftoken and axiom where appropriate.
790
791 * src/reader.c (copy_dollar): Replace with...
792 * src/scan-gram.h (handle_dollar): this.
793 * src/parse-gram.y: Remove `%thong'.
794
795 * src/reader.c (copy_at): Replace with...
796 * src/scan-gram.h (handle_at): this.
797
798 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
799 New.
800
801 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
802 time being.
803
804 * src/reader.h, src/reader.c (grammar_rule_end): New.
805
806 * src/parse.y (current_type, current_class): New.
807 Implement `%nterm', `%token' support.
808 Merge `%term' into `%token'.
809 (string_as_id): New.
810 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
811 type name.
812
813 * src/parse-gram.y: Be sure to handle properly the beginning of
814 rules.
815
816 * src/parse-gram.y: Handle %type.
817 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
818
819 * src/parse-gram.y: More directives support.
820 * src/options.c: No longer handle source directives.
821
822 * src/parse-gram.y: Fix %output.
823
824 * src/parse-gram.y: Handle %union.
825 Use the prologue locations.
826 * src/reader.c (parse_union_decl): Remove.
827
828 * src/reader.h, src/reader.c (epilogue_set): New.
829 * src/parse-gram.y: Use it.
830
831 * data/bison.simple, data/bison.c++: b4_stype is now either not
832 defined, then default to int, or to the contents of %union,
833 without `union' itself.
834 Adjust.
835 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
836
837 * src/output.c (actions_output): Don't output braces, as they are
838 already handled by the scanner.
839
840 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
841 characters to themselves.
842
843 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
844 that the epilogue has a proper #line.
845
846 * src/parse-gram.y: Handle precedence/associativity.
847
848 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
849 a terminal.
850 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
851 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
852 at all to define terminals that cannot be emitted.
853
854 * src/scan-gram.l: Escape M4 characters.
855
856 * src/scan-gram.l: Working properly with escapes in user
857 strings/characters.
858
859 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
860 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
861 grammar.
862 Use more modest sizes, as for the time being the parser does not
863 release memory, and therefore the process swallows a huge amount
864 of memory.
865
866 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
867 stricter %token grammar.
868
869 * src/symtab.h (associativity): Add `undef_assoc'.
870 (symbol_precedence_set): Do nothing when passed an undef_assoc.
871 * src/symtab.c (symbol_check_alias_consistence): Adjust.
872
873 * tests/regression.at (Invalid %directive): Remove, as it is now
874 meaningless.
875 (Invalid inputs): Adjust to the new error messages.
876 (Token definitions): The new grammar doesn't allow too many
877 eccentricities.
878
879 * src/lex.h, src/lex.c: Remove.
880 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
881 (copy_character, copy_string2, copy_string, copy_identifier)
882 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
883 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
884 (parse_action): Remove.
885 * po/POTFILES.in: Adjust.
886
2e047461
AD
8872002-06-11 Akim Demaille <akim@epita.fr>
888
889 * src/reader.c (parse_action): Don't store directly into the
890 rule's action member: return the action as a string.
891 Don't require `rule_length' as an argument: compute it.
892 (grammar_current_rule_symbol_append)
893 (grammar_current_rule_action_append): New, eved out from
894 (readgram): here.
895 Remove `action_flag', `rulelength', unused now.
896
9af3fbce
AD
8972002-06-11 Akim Demaille <akim@epita.fr>
898
899 * src/reader.c (grammar_current_rule_prec_set).
900 (grammar_current_rule_check): New, eved out from...
901 (readgram): here.
902 Remove `xaction', `first_rhs': useless.
903 * tests/input.at (Type clashes): New.
904 * tests/existing.at (GNU Cim Grammar): Adjust.
905
1485e106
AD
9062002-06-11 Akim Demaille <akim@epita.fr>
907
908 * src/reader.c (grammar_midrule_action): New, Eved out from
909 (readgram): here.
910
da4160c3
AD
9112002-06-11 Akim Demaille <akim@epita.fr>
912
913 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
914 New.
915 (readgram): Use them as replacement of inlined code, crule and
916 crule1.
917
f6d0f937
AD
9182002-06-11 Akim Demaille <akim@epita.fr>
919
920 * src/reader.c (grammar_end, grammar_symbol_append): New.
921 (readgram): Use them.
922 Make the use of `p' as local as possible.
923
69078d4b
AD
9242002-06-10 Akim Demaille <akim@epita.fr>
925
926 GCJ's parser requires the tokens to be defined before the prologue.
927
928 * data/bison.simple: Output the token definition before the user's
929 prologue.
930 * tests/regression.at (Braces parsing, Duplicate string)
931 (Mixing %token styles): Check the output from bison.
932 (Early token definitions): New.
933
5e424082
AD
9342002-06-10 Akim Demaille <akim@epita.fr>
935
936 * src/symtab.c (symbol_user_token_number_set): Don't complain when
937 assigning twice the same user number to a token, so that we can
938 use it in...
939 * src/lex.c (lex): here.
940 Also use `symbol_class_set' instead of hand written code.
941 * src/reader.c (parse_assoc_decl): Likewise.
942
44536b35
AD
9432002-06-10 Akim Demaille <akim@epita.fr>
944
945 * src/symtab.c, src/symtab.c (symbol_class_set)
946 (symbol_user_token_number_set): New.
947 * src/reader.c (parse_token_decl): Use them.
948 Use a switch instead of ifs.
949 Use a single argument.
950
8b9f2372
AD
9512002-06-10 Akim Demaille <akim@epita.fr>
952
953 Remove `%thong' support as it is undocumented, unused, duplicates
954 `%token's job, and creates useless e-mail traffic with people who
955 want to know what it is, why it is undocumented, unused, and
956 duplicates `%token's job.
957
958 * src/reader.c (parse_thong_decl): Remove.
959 * src/options.c (option_table): Remove "thong".
960 * src/lex.h (tok_thong): Remove.
961
3ae2b51f
AD
9622002-06-10 Akim Demaille <akim@epita.fr>
963
964 * src/symtab.c, src/symtab.c (symbol_type_set)
965 (symbol_precedence_set): New.
966 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
967 (value_components_used): Remove, unused.
968
2f1afb73
AD
9692002-06-09 Akim Demaille <akim@epita.fr>
970
971 Move symbols handling code out of the reader.
972
973 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
974 (axiom): Move to...
975 * src/symtab.h, src/symtab.c: here.
976
977 * src/gram.c (start_symbol): Remove: use startsymbol->number.
978 * src/reader.c (startval): Rename as...
979 * src/symtab.h, src/symtab.c (startsymbol): this.
980 * src/reader.c: Adjust.
981
982 * src/reader.c (symbol_check_defined, symbol_make_alias)
983 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
984 (token_translations_init)
985 Move to...
986 * src/symtab.c: here.
987 * src/reader.c (packsymbols): Move to...
988 * src/symtab.h, src/symtab.c (symbols_pack): here.
989 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
990 argument.
991
e9bca3ad
AD
9922002-06-03 Akim Demaille <akim@epita.fr>
993
994 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
995 then statements.
996
86eff183
AD
9972002-06-03 Akim Demaille <akim@epita.fr>
998
999 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
1000 structs with non literals.
1001 * src/scan-skel.l: never-interactive.
1002 * src/conflicts.c (enum conflict_resolution_e): No trailing
1003 comma.
1004 * src/getargs.c (usage): Split long literal strings.
1005 Reported by Hans Aberg.
1006
717be197
AD
10072002-05-28 Akim Demaille <akim@epita.fr>
1008
1009 * data/bison.c++: Use C++ ostreams.
1010 (cdebug_): New member.
1011
670ddffd
AD
10122002-05-28 Akim Demaille <akim@epita.fr>
1013
1014 * src/output.c (output_skeleton): Be sure to allocate enough room
1015 for `/' _and_ for `\0' in full_skeleton.
1016
769b430f
AD
10172002-05-28 Akim Demaille <akim@epita.fr>
1018
1019 * data/bison.c++: Catch up with bison.simple:
1020 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1021 and Paul Eggert <eggert@twinsun.com>: `error' handing.
1022 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
1023 and popping traces.
1024
7067cb36
PH
10252002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1026
1027 * src/output.c (output_skeleton): Put an explicit path in front of
1028 the skeleton file name, rather than relying on the -I directory,
1029 to partially alleviate effects of having a skeleton file lying around
1030 in the current directory.
769b430f 1031
4a713ec2
PH
10322002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1033
769b430f 1034 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
1035 obstack_printf should be obstack_fgrow1.
1036
b408954b
AD
10372002-05-26 Akim Demaille <akim@epita.fr>
1038
1039 * src/state.h (state_t): `solved_conflicts' is a new member.
1040 * src/LR0.c (new_state): Set it to 0.
1041 * src/conflicts.h, src/conflicts.c (print_conflicts)
1042 (free_conflicts, solve_conflicts): Rename as...
1043 (conflicts_print, conflicts_free, conflicts_solve): these.
1044 Adjust callers.
1045 * src/conflicts.c (enum conflict_resolution_e)
1046 (solved_conflicts_obstack): New, used by...
1047 (log_resolution): this.
1048 Adjust to attach the conflict resolution to each state.
1049 Complete the description with the precedence/associativity
1050 information.
1051 (resolve_sr_conflict): Adjust.
1052 * src/print.c (print_state): Output its solved_conflicts.
1053 * tests/conflicts.at (Unresolved SR Conflicts)
1054 (Solved SR Conflicts): Exercise --report=all.
1055
a49aecd5
AD
10562002-05-26 Akim Demaille <akim@epita.fr>
1057
1058 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1059 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1060 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
1061 (token_number_t, item_number_as_token_number)
1062 (token_number_as_item_number, muscle_insert_token_number_table):
1063 Rename as...
1064 (symbol_number_t, item_number_as_symbol_number)
1065 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
1066 these, since it is more appropriate.
1067
5504898e
AD
10682002-05-26 Akim Demaille <akim@epita.fr>
1069
1070 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
1071 `Error:' lines.
1072 * data/bison.simple (yystos) [YYDEBUG]: New.
1073 (yyparse) [YYDEBUG]: Display the symbols which are popped during
1074 error recovery.
1075 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
1076
ec3bc396
AD
10772002-05-25 Akim Demaille <akim@epita.fr>
1078
1079 * doc/bison.texinfo (Debugging): Split into...
1080 (Tracing): this new section, its former contents, and...
1081 (Understanding): this new section.
1082 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
1083 by...
1084 (report_flag): this.
1085 Adjust all dependencies.
1086 (report_args, report_types, report_argmatch): New.
1087 (usage, getargs): Report/support -r, --report.
1088 * src/options.h
1089 (struct option_table_struct): Rename as..,
1090 (struct option_table_s): this.
1091 Rename the `set_flag' member to `flag' to match with getopt_long's
1092 struct.
1093 * src/options.c (option_table): Split verbose into an entry for
1094 %verbose, and another for --verbose.
1095 Support --report/-r, so remove -r from the obsolete --raw.
1096 * src/print.c: Attach full item sets and lookaheads reports to
1097 report_flag instead of trace_flag.
1098 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
1099
78df8250
PE
11002002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1101 and Paul Eggert <eggert@twinsun.com>
769b430f 1102
78df8250
PE
1103 * data/bison.simple (yyparse): Correct error handling to conform to
1104 POSIX and yacc. Specifically, after syntax error is discovered,
1105 do not reduce further before shifting the error token.
1106 Clean up the code a bit by removing the labels yyerrdefault,
1107 yyerrhandle, yyerrpop.
1108 * NEWS: Document the above.
1109
c0c9ea05
PH
11102002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1111
1112 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
1113 type; it isn't always big enough, since it doesn't necessarily
1114 include non-terminals.
769b430f 1115 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
1116 the latter can be removed.
1117 (yy_token_number_type): Remove, only one use.
1118 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
1119 don't use TokenNumberType as element type.
769b430f 1120
c0c9ea05
PH
1121 * tests/regression.at: Modify expected output to agree with change
1122 to yyr1 and yytranslate.
769b430f 1123
6390a83f
FK
11242002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
1125
1126 * src/reader.c (parse_action): Use copy_character instead of
1127 obstack_1grow.
1128
db7c8e9a
AD
11292002-05-13 Akim Demaille <akim@epita.fr>
1130
1131 * tests/regression.at (Token definitions): Prototype yylex and
1132 yyerror.
1133
fcc61800
PH
11342002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
1135
158c687b 1136 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
1137 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
1138 32-bit arithmetic.
1139 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
1140
5683e9b2
AD
11412002-05-07 Akim Demaille <akim@epita.fr>
1142
1143 * tests/synclines.at: Be sure to prototype yylex and yyerror to
1144 avoid GCC warnings.
1145
0c2d3f4c
AD
11462002-05-07 Akim Demaille <akim@epita.fr>
1147
1148 Kill GCC warnings.
1149
1150 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
1151 over the RHS of each rule.
1152 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
1153 * src/state.h (state_t): Member `nitems' is unsigned short.
1154 * src/LR0.c (get_state): Adjust.
1155 * src/reader.c (packgram): Likewise.
1156 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
1157 `Type'.
1158 (muscle_insert_int_table): Remove, unused.
1159 (prepare_rules): Remove `max'.
1160
1565b720
AD
11612002-05-06 Akim Demaille <akim@epita.fr>
1162
1163 * src/closure.c (print_firsts): Display of the symbol tags.
1164 (bitmatrix_print): Move to...
1165 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
1166 here.
1167 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
1168
cfaee611
AD
11692002-05-06 Akim Demaille <akim@epita.fr>
1170
1171 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
1172 hash_do_for_each.
1173
458be8e0
AD
11742002-05-06 Akim Demaille <akim@epita.fr>
1175
1176 * src/LR0.c (new_state, get_state): Instead of using the global
1177 `kernel_size' and `kernel_base', have two new arguments:
1178 `core_size' and `core'.
1179 Adjust callers.
1180
a900a624
AD
11812002-05-06 Akim Demaille <akim@epita.fr>
1182
1183 * src/reader.c (packgram): No longer end `ritem' with a 0
1184 sentinel: it is not used.
1185
d4e7d3a1
AD
11862002-05-05 Akim Demaille <akim@epita.fr>
1187
1188 New experimental feature: display the lookaheads in the report and
1189 graph.
1190
1191 * src/print (print_core): When --trace-flag, display the rules
1192 lookaheads.
1193 * src/print_graph.c (print_core): Likewise.
1194 Swap the arguments.
1195 Adjust caller.
1196
39ceb25b
AD
11972002-05-05 Akim Demaille <akim@epita.fr>
1198
1199 * tests/torture.at (Many lookaheads): New test.
1200
5372019f
AD
12012002-05-05 Akim Demaille <akim@epita.fr>
1202
1203 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
1204 (GENERATE_MUSCLE_INSERT_TABLE): this.
1205 (output_int_table, output_unsigned_int_table, output_short_table)
1206 (output_token_number_table, output_item_number_table): Replace with...
1207 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
1208 (muscle_insert_short_table, muscle_insert_token_number_table)
1209 (muscle_insert_item_number_table): these.
1210 Adjust all callers.
1211 (prepare_tokens): Don't free `translations', since...
1212 * src/reader.h, src/reader.c (grammar_free): do it.
1213 Move to...
1214 * src/gram.h, src/gram.c (grammar_free): here.
1215 * data/bison.simple, data/bison.c++: b4_token_number_max is now
1216 b4_translate_max.
1217
5df5f6d5
AD
12182002-05-05 Akim Demaille <akim@epita.fr>
1219
1220 * src/output.c (output_unsigned_int_table): New.
1221 (prepare_rules): `i' is unsigned.
1222 `prhs', `rline', `r2' are unsigned int.
1223 Rename muscle `rhs_number_max' as `rhs_max'.
1224 Output muscles `prhs_max', `rline_max', and `r2_max'.
1225 Free rline and r1.
1226 * data/bison.simple, data/bison.c++: Adjust to use these muscles
1227 to compute types instead of constant types.
1228 * tests/regression.at (Web2c Actions): Adjust.
1229
b87f8b21
AD
12302002-05-04 Akim Demaille <akim@epita.fr>
1231
1232 * src/symtab.h (SALIAS, SUNDEF): Rename as...
1233 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1234 Adjust dependencies.
1235 * src/output.c (token_definitions_output): Be sure not to output a
1236 `#define 'a'' when fed with `%token 'a' "a"'.
1237 * tests/regression.at (Token definitions): New.
1238
8bb936e4
PE
12392002-05-03 Paul Eggert <eggert@twinsun.com>
1240
1241 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1242 for K&R C.
1243
12442002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1245
1246 * Makefile.am (SUBDIRS): Remove intl.
1247 (EXTRA_DIST): Add config/config.rpath.
1248
53c71a12
AD
12492002-05-03 Akim Demaille <akim@epita.fr>
1250
1251 * data/bison.simple (m4_if): Don't output empty enums.
1252 And actually, output valid enum definitions :(.
1253
289dd0cf
AD
12542002-05-03 Akim Demaille <akim@epita.fr>
1255
1256 * configure.bat: Remove, completely obsolete.
1257 * Makefile.am (EXTRA_DIST): Adjust.
1258 Don't distribute config.rpath...
1259 * config/Makefile.am (EXTRA_DIST): Do it.
1260
db85e524
AD
12612002-05-03 Akim Demaille <akim@epita.fr>
1262
1263 * configure.in (GETTEXT_VERSION): New.
1264 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1265
83ccf991
AD
12662002-05-03 Akim Demaille <akim@epita.fr>
1267
1268 * data/bison.simple (b4_token_enum): New.
1269 (b4_token_defines): Use it to output tokens both as #define and
1270 enums.
1271 Suggested by Paul Eggert.
1272 * src/output.c (token_definitions_output): Don't output spurious
1273 white spaces.
1274
1f418995
AD
12752002-05-03 Akim Demaille <akim@epita.fr>
1276
1277 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1278
45119f04
RA
12792002-05-02 Robert Anisko <robert@lrde.epita.fr>
1280
1281 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1282 Update the stack class, give a try to deque as the default container.
1283
b2d52318
AD
12842002-05-02 Akim Demaille <akim@epita.fr>
1285
1286 * data/bison.simple (yyparse): Do not implement @$ = @1.
1287 (YYLLOC_DEFAULT): Adjust to do it.
1288 * doc/bison.texinfo (Location Default Action): Fix.
1289
3a8b4109
AD
12902002-05-02 Akim Demaille <akim@epita.fr>
1291
1292 * src/reader.c (parse_braces): Merge into...
1293 (parse_action): this.
1294
84614e13
AD
12952002-05-02 Akim Demaille <akim@epita.fr>
1296
1297 * configure.in (ALL_LINGUAS): Remove.
1298 * po/LINGUAS, hr.po: New.
1299
fdbcd8e2
AD
13002002-05-02 Akim Demaille <akim@epita.fr>
1301
1302 Remove the so called hairy (semantic) parsers.
1303
1304 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1305 * src/gram.h, src/gram.c (semantic_parser): Remove.
1306 (rule_t): Remove the guard and guard_line members.
1307 * src/lex.h (token_t): remove tok_guard.
1308 * src/options.c (option_table): Remove %guard and %semantic_parser
1309 support.
1310 * src/output.c, src/output.h (guards_output): Remove.
1311 (prepare): Adjust.
1312 (token_definitions_output): Don't output the `T'
1313 tokens (???).
1314 (output_skeleton): Don't output the guards.
1315 * src/files.c, src/files.c (attrsfile): Remove.
1316 * src/reader.c (symbol_list): Remove the guard and guard_line
1317 members.
1318 Adjust dependencies.
1319 (parse_guard): Remove.
1320 * data/bison.hairy: Remove.
1321 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1322 BISON_HAIRY.
1323
82b6cb3f
AD
13242002-05-02 Akim Demaille <akim@epita.fr>
1325
1326 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1327 (parse_guard): Rename the formal argument `stack_offset' as
1328 `rule_length', which is more readable.
1329 Adjust callers.
1330 (copy_at, copy_dollar): Instead of outputting the hard coded
1331 values of $$, $n and so forth, output invocation to b4_lhs_value,
1332 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1333 Note: this patch partially drops `semantic-parser' support: it
1334 always does `rule_length - n', where semantic parsers ought to
1335 always use `-n'.
82b6cb3f
AD
1336 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1337 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1338
6cbfbcc5
AD
13392002-05-02 Akim Demaille <akim@epita.fr>
1340
1341 * configure.in (AC_INIT): Bump to 1.49b.
1342 (AM_INIT_AUTOMAKE): Short invocation.
1343
b8548114
AD
13442002-05-02 Akim Demaille <akim@epita.fr>
1345
1346 Version 1.49a.
1347
c20cd1fa
AD
13482002-05-01 Akim Demaille <akim@epita.fr>
1349
1350 * src/skeleton.h: Remove.
1351
8a9566d4
AD
13522002-05-01 Akim Demaille <akim@epita.fr>
1353
1354 * src/skeleton.h: Fix the #endif.
1355 Reported by Magnus Fromreide.
1356
8c6d399a
PE
13572002-04-26 Paul Eggert <eggert@twinsun.com>
1358
1359 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1360 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 1361 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 1362
2b7ed18a
RA
13632002-04-25 Robert Anisko <robert@lrde.epita.fr>
1364
1365 * src/scan-skel.l: Postprocess quadrigraphs.
1366
1367 * src/reader.c (copy_character): New function, used to output
1368 single characters while replacing `[' and `]' with quadrigraphs, to
1369 avoid troubles with M4 quotes.
1370 (copy_comment): Output characters with copy_character.
1371 (read_additionnal_code): Likewise.
1372 (copy_string2): Likewise.
1373 (copy_definition): Likewise.
1374
1375 * tests/calc.at: Exercise M4 quoting.
1376
34a89c50
AD
13772002-04-25 Akim Demaille <akim@epita.fr>
1378
1379 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1380 between `!' and the command.
1381 Reported by Paul Eggert.
1382
0dd1580a
RA
13832002-04-24 Robert Anisko <robert@lrde.epita.fr>
1384
1385 * tests/calc.at: Exercise prologue splitting.
1386
1387 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1388 `b4_post_prologue' instead of `b4_prologue'.
1389
1390 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1391 muscles.
1392 (output): Free pre_prologue_obstack and post_prologue_obstack.
1393 * src/files.h, src/files.c (attrs_obstack): Remove.
1394 (pre_prologue_obstack, post_prologue_obstack): New.
1395 * src/reader.c (copy_definition): Add a parameter to specify the
1396 obstack to fill, instead of using attrs_obstack unconditionally.
1397 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1398 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1399
83c1796f
PE
14002002-04-23 Paul Eggert <eggert@twinsun.com>
1401
1402 * data/bison.simple: Remove unnecessary commentary and white
1403 space differences from 1_29-branch.
1404 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1405
1406 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1407 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1408 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1409 constructors or destructors.
1410
1411 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1412
1207eeac
AD
14132002-04-23 Akim Demaille <akim@epita.fr>
1414
1415 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1416 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1417 location with columns.
1418 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1419 All reported by Paul Eggert.
1420
78ab8f67
AD
14212002-04-22 Akim Demaille <akim@epita.fr>
1422
1423 * src/reduce.c (dump_grammar): Move to...
1424 * src/gram.h, src/gram.c (grammar_dump): here.
1425 Be sure to separate long item numbers.
1426 Don't read the members of a rule's prec if its nil.
1427
133c20e2
AD
14282002-04-22 Akim Demaille <akim@epita.fr>
1429
1430 * src/output.c (table_size, table_grow): New.
1431 (MAXTABLE): Remove, replace uses with table_size.
1432 (pack_vector): Instead of dying when the table is too big, grow it.
1433
9515e8a7
AD
14342002-04-22 Akim Demaille <akim@epita.fr>
1435
1436 * data/bison.simple (yyr1): Its type is that of a token number.
1437 * data/bison.c++ (r1_): Likewise.
1438 * tests/regression.at (Web2c Actions): Adjust.
1439
23c5a174
AD
14402002-04-22 Akim Demaille <akim@epita.fr>
1441
1442 * src/reader.c (token_translations_init): 256 is now the default
1443 value for the error token, i.e., it will be assigned another
1444 number if the user assigned 256 to one of her tokens.
1445 (reader): Don't force 256 to error.
1446 * doc/bison.texinfo (Symbols): Adjust.
1447 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1448 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1449 etc. instead of 10, 20, 30 (which was used to `jump' over error
1450 (256) and undefined (2)).
1451
5fbb0954
AD
14522002-04-22 Akim Demaille <akim@epita.fr>
1453
1454 Propagate more token_number_t.
1455
1456 * src/gram.h (token_number_as_item_number)
1457 (item_number_as_token_number): New.
1458 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1459 Use it to create output_item_number_table and
1460 output_token_number_table.
1461 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1462 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1463 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1464 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1465
4f940944
AD
14662002-04-22 Akim Demaille <akim@epita.fr>
1467
1468 * src/output.h, src/output.c (get_lines_number): Remove.
1469
3ded9a63
AD
14702002-04-19 Akim Demaille <akim@epita.fr>
1471
1472 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1473 as Lex/Flex'.
1474 (Debugging): More details about enabling the debugging features.
1475 (Table of Symbols): Describe $$, $n, @$, and @n.
1476 Suggested by Tim Josling.
1477
e0c471a9
AD
14782002-04-19 Akim Demaille <akim@epita.fr>
1479
1480 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1481
fecc10cd
AD
14822002-04-10 Akim Demaille <akim@epita.fr>
1483
1484 * src/system.h: Rely on HAVE_LIMITS_H.
1485 Suggested by Paul Eggert.
1486
51dec47b
AD
14872002-04-09 Akim Demaille <akim@epita.fr>
1488
1489 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1490 full stderr, and strip it according to the bison options, instead
1491 of composing the error message from different bits.
1492 This makes it easier to check for several error messages.
1493 Adjust all the invocations.
1494 Add an invocation exercising the error token.
1495 Add an invocation demonstrating a stupid error message.
1496 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1497 Adjust the tests.
1498 Error message are for stderr, not stdout.
1499
007a50a4
AD
15002002-04-09 Akim Demaille <akim@epita.fr>
1501
1502 * src/gram.h, src/gram.c (error_token_number): Remove, use
1503 errtoken->number.
1504 * src/reader.c (reader): Don't specify the user token number (2)
1505 for $undefined, as it uselessly prevents using it.
1506 * src/gram.h (token_number_t): Move to...
1507 * src/symtab.h: here.
1508 (state_t.number): Is a token_number_t.
1509 * src/print.c, src/reader.c: Use undeftoken->number instead of
1510 hard coded 2.
1511 (Even though this 2 is not the same as above: the number of the
1512 undeftoken remains being 2, it is its user token number which
1513 might not be 2).
1514 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1515 `user_token_number_max'.
1516 Output `undef_token_number'.
1517 * data/bison.simple, data/bison.c++: Use them.
1518 Be sure to map invalid yylex return values to
1519 `undef_token_number'. This saves us from gratuitous SEGV.
1520
1521 * tests/conflicts.at (Solved SR Conflicts)
1522 (Unresolved SR Conflicts): Adjust.
1523 * tests/regression.at (Web2c Actions): Adjust.
1524
06446ccf
AD
15252002-04-08 Akim Demaille <akim@epita.fr>
1526
1527 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1528 Adding #line.
1529 Remove the duplicate `typedefs'.
1530 (RhsNumberType): Fix the declaration and various other typos.
1531 Use __ofile__.
1532 * data/bison.simple: Use __ofile__.
1533 * src/scan-skel.l: Handle __ofile__.
1534
62a3e4f0
AD
15352002-04-08 Akim Demaille <akim@epita.fr>
1536
1537 * src/gram.h (item_number_t): New, the type of item numbers in
1538 RITEM. Note that it must be able to code symbol numbers as
1539 positive number, and the negation of rule numbers as negative
1540 numbers.
1541 Adjust all dependencies (pretty many).
1542 * src/reduce.c (rule): Remove this `short *' pointer: use
1543 item_number_t.
1544 * src/system.h (MINSHORT, MAXSHORT): Remove.
1545 Include `limits.h'.
1546 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1547 (shortcpy): Remove.
1548 (MAXTABLE): Move to...
1549 * src/output.c (MAXTABLE): here.
1550 (prepare_rules): Use output_int_table to output rhs.
1551 * data/bison.simple, data/bison.c++: Adjust.
1552 * tests/torture.at (Big triangle): Move the limit from 254 to
1553 500.
1554 * tests/regression.at (Web2c Actions): Ajust.
1555
1556 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1557 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1558 passes, but produces negative #line number, once fixed, GCC is
1559 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1560 C), it passes.
1561 * src/state.h (state_h): Code input lines on ints, not shorts.
1562
bb88b0fc
AD
15632002-04-08 Akim Demaille <akim@epita.fr>
1564
1565 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1566 and then the grammar.
1567
9a636f47
AD
15682002-04-08 Akim Demaille <akim@epita.fr>
1569
1570 * src/system.h: No longer using strndup.
1571
680e8701
AD
15722002-04-07 Akim Demaille <akim@epita.fr>
1573
1574 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1575 * src/output.c (output_table_data): Return the longest number.
1576 (prepare_tokens): Output `token_number_max').
1577 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1578 New.
1579 Use them to define yy_token_number_type/TokenNumberType.
1580 Use this type for yytranslate.
1581 * tests/torture.at (Big triangle): Push the limit from 124 to
1582 253.
1583 * tests/regression.at (Web2c Actions): Adjust.
1584
817e9f41
AD
15852002-04-07 Akim Demaille <akim@epita.fr>
1586
1587 * tests/torture.at (Big triangle): New.
1588 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1589 * tests/existing.at: here.
1590
5123689b
AD
15912002-04-07 Akim Demaille <akim@epita.fr>
1592
1593 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1594 nritems.
1595 Adjust dependencies.
1596
f3849179
AD
15972002-04-07 Akim Demaille <akim@epita.fr>
1598
1599 * src/reader.c: Normalize increments to prefix form.
1600
bd02036a
AD
16012002-04-07 Akim Demaille <akim@epita.fr>
1602
1603 * src/reader.c, symtab.c: Remove debugging code.
1604
db8837cb
AD
16052002-04-07 Akim Demaille <akim@epita.fr>
1606
1607 Rename all the `bucket's as `symbol_t'.
1608
1609 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1610 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1611 * src/symtab.c, src/symtab.h (bucket): Rename as...
1612 (symbol_t): this.
1613 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1614 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1615 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1616 (buckets_new, buckets_free, buckets_do): Rename as...
1617 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1618 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1619 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1620 (symbols_new, symbols_free, symbols_do): these.
1621
72a23c97
AD
16222002-04-07 Akim Demaille <akim@epita.fr>
1623
1624 Use lib/hash for the symbol table.
1625
1626 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1627 EOF.
1628 * src/lex.c (lex): Set the `number' member of new terminals.
1629 * src/reader.c (bucket_check_defined, bucket_make_alias)
1630 (bucket_check_alias_consistence, bucket_translation): New.
1631 (reader, grammar_free, readgram, token_translations_init)
1632 (packsymbols): Adjust.
1633 (reader): Number the predefined tokens.
1634 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1635 for predefined tokens.
1636 * src/symtab.h (bucket): Remove all the hash table related
1637 members.
1638 * src/symtab.c (symtab): Replace by...
1639 (bucket_table): this.
1640 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1641 (buckets_new, buckets_do): New.
1642
280a38c3
AD
16432002-04-07 Akim Demaille <akim@epita.fr>
1644
1645 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1646 (start_symbol, max_user_token_number, semantic_parser)
1647 (error_token_number): Initialize.
1648 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1649 Initialize.
1650 (reader): Don't.
1651 (errtoken, eoftoken, undeftoken, axiom): Extern.
1652
03b31c0c
AD
16532002-04-07 Akim Demaille <akim@epita.fr>
1654
1655 * src/gram.h (rule_s): prec and precsym are now pointers
1656 to the bucket giving the priority/associativity.
1657 Member `associativity' removed: useless.
1658 * src/reduce.c, src/conflicts.c: Adjust.
1659
8b3df748
AD
16602002-04-07 Akim Demaille <akim@epita.fr>
1661
1662 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1663 Properly escape the symbols' TAG when outputting them.
1664
e601aa1d
AD
16652002-04-07 Akim Demaille <akim@epita.fr>
1666
1667 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1668
b0299a2e
AD
16692002-04-07 Akim Demaille <akim@epita.fr>
1670
1671 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1672 (LArule): this, which is an array to rule_t*.
1673 * src/print.c, src/conflicts.c: Adjust.
1674
d7e1f00c
AD
16752002-04-07 Akim Demaille <akim@epita.fr>
1676
1677 * src/gram.h (rule_t): Rename `number' as `user_number'.
1678 `number' is a new member.
1679 Adjust dependencies.
1680 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1681
cc9305dd
AD
16822002-04-07 Akim Demaille <akim@epita.fr>
1683
1684 As a result of the previous patch, it is no longer needed
1685 to reorder ritem itself.
1686
1687 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1688
b0940840
AD
16892002-04-07 Akim Demaille <akim@epita.fr>
1690
1691 Be sure never to walk through RITEMS, but use only data related to
1692 the rules themselves. RITEMS should be banished.
1693
1694 * src/output.c (output_token_translations): Rename as...
1695 (prepare_tokens): this.
1696 In addition to `translate', prepare the muscles `tname' and
1697 `toknum', which were handled by...
1698 (output_rule_data): this.
1699 Remove, and move the remainder of its outputs into...
1700 (prepare_rules): this new routines, which also merges content from
1701 (output_gram): this.
1702 (prepare_rules): Be sure never to walk through RITEMS.
1703 (output_stos): Rename as...
1704 (prepare_stos): this.
1705 (output): Always invoke prepare_states, after all, just don't use it
1706 in the output if you don't need it.
1707
643a5994
AD
17082002-04-07 Akim Demaille <akim@epita.fr>
1709
1710 * src/LR0.c (new_state): Display `nstates' as the name of the
1711 newly created state.
1712 Adjust to initialize first_state and last_state if needed.
1713 Be sure to distinguish the initial from the final state.
1714 (new_states): Create the itemset of the initial state, and use
1715 new_state.
1716 * src/closure.c (closure): Now that the initial state has its
1717 items properly set, there is no need for a special case when
1718 creating `ruleset'.
1719
1720 As a result, now the rule 0, reducing to $axiom, is visible in the
1721 outputs. Adjust the test suite.
1722
1723 * tests/conflicts.at (Solved SR Conflicts)
1724 (Unresolved SR Conflicts): Adjust.
1725 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1726 * tests/conflicts.at (S/R in initial): New.
1727
b4c4ccc2
AD
17282002-04-07 Akim Demaille <akim@epita.fr>
1729
1730 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1731 the RHS of the rules.
1732 * src/output.c (output_gram): Likewise.
1733
bba97eb2
AD
17342002-04-07 Akim Demaille <akim@epita.fr>
1735
1736 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1737 bucket.
1738 Adjust all dependencies.
1739 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1740 `number' of the buckets too.
1741 * src/gram.h: Include `symtab.h'.
1742 (associativity): Move to...
1743 * src/symtab.h: here.
1744 No longer include `gram.h'.
1745
c3b407f4
AD
17462002-04-07 Akim Demaille <akim@epita.fr>
1747
1748 * src/gram.h, src/gram.c (rules_rhs_length): New.
1749 (ritem_longest_rhs): Use it.
1750 * src/gram.h (rule_t): `number' is a new member.
1751 * src/reader.c (packgram): Set it.
1752 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1753 the end of `rules', and count them out of `nrules'.
1754 (reduce_output, dump_grammar): Adjust.
1755 * src/print.c (print_grammar): It is no longer needed to check for
1756 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1757 * tests/reduce.at (Reduced Automaton): New test.
1758
11652ab3
AD
17592002-04-07 Akim Demaille <akim@epita.fr>
1760
1761 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1762 lacking `+ 1' to nrules, Bison reported as useless a token if it
1763 was used solely to set the precedence of the last rule...
1764
26b23c1a
AD
17652002-04-07 Akim Demaille <akim@epita.fr>
1766
1767 * data/bison.c++, data/bison.simple: Don't output the current file
1768 name in #line, to avoid useless diffs between two identical
1769 outputs under different names.
1770
18bcecb0
AD
17712002-04-07 Akim Demaille <akim@epita.fr>
1772
1773 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1774 Normalize loops to using `< nrules + 1', not `<= nrules'.
1775
fa770c86
AD
17762002-04-07 Akim Demaille <akim@epita.fr>
1777
1778 * TODO: Update.
1779
d9b739c3
AD
17802002-04-07 Akim Demaille <akim@epita.fr>
1781
1782 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1783 bucket.value as bucket.number.
1784
99013900
AD
17852002-04-07 Akim Demaille <akim@epita.fr>
1786
1787 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1788 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1789 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1790 RHS, instead of being an index in RITEMS.
1791
e966383b
PE
17922002-04-04 Paul Eggert <eggert@twinsun.com>
1793
1794 * doc/bison.texinfo: Update copyright date.
1795 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1796 (Symbols): Warn about running Bison in one character set,
1797 but compiling and/or running in an incompatible one.
1798 Warn about character code 256, too.
1799
18002002-04-03 Paul Eggert <eggert@twinsun.com>
1801
1802 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1803 YYERROR_VERBOSE is nonzero, not whether it is defined.
1804
1805 Merge changes from bison-1_29-branch.
c307773e 1806
8d6c48b9
PE
18072002-03-20 Paul Eggert <eggert@twinsun.com>
1808
1809 Merge fixes from Debian bison_1.34-1.diff.
1810
1811 * configure.in (AC_PREREQ): 2.53.
1812
e53c6322
AD
18132002-03-20 Akim Demaille <akim@epita.fr>
1814
1815 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1816
9ffbeca7
PE
18172002-03-19 Paul Eggert <eggert@twinsun.com>
1818
21db0b2a
PE
1819 * src/bison.simple (YYCOPY): New macro.
1820 (YYSTACK_RELOCATE): Use it.
1821 Remove Type arg; no longer needed. All callers changed.
1822 (yymemcpy): Remove; no longer needed.
1823
9ffbeca7
PE
1824 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1825 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1826
642cb8f8
AD
18272002-03-19 Akim Demaille <akim@epita.fr>
1828
1829 Test and fix the #line outputs.
1830
1831 * tests/atlocal.at (GCC): New.
1832 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1833 (Prologue synch line, ,%union synch line, Postprologue synch line)
1834 (Action synch line, Epilogue synch line): New tests.
1835 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1836 * data/bison.simple, data/bison.c++: Use it.
1837
3c31a486
AD
18382002-03-19 Akim Demaille <akim@epita.fr>
1839
1840 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1841 (Solved SR Conflicts, %expect not enough, %expect right)
1842 (%expect too much): Move to...
1843 * tests/conflicts.at: this new file.
1844
0d8bed56
AD
18452002-03-19 Akim Demaille <akim@epita.fr>
1846
1847 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1848 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1849 that we can move to enums for instance.
1850 * src/output.c (token_definitions_output): Output a list of
1851 `token-name, token-number' instead of the #define.
1852 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1853
9208d17f
AD
18542002-03-14 Akim Demaille <akim@epita.fr>
1855
1856 Use Gettext 0.11.1.
1857
af27eacb
RA
18582002-03-09 Robert Anisko <robert@lrde.epita.fr>
1859
1860 * data/bison.c++: Make the user able to add members to the generated
1861 parser by subclassing.
1862
9101a310
RA
18632002-03-05 Robert Anisko <robert@lrde.epita.fr>
1864
1865 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1866 a character.
1867 Reported by Nicolas Tisserand and Nicolas Burrus.
1868
fff9bf0b
RA
18692002-03-04 Robert Anisko <robert@lrde.epita.fr>
1870
1871 * src/reader.c: Warn about lacking semi-colons, do not complain.
1872
64dba31e
RA
18732002-03-04 Robert Anisko <robert@lrde.epita.fr>
1874
1875 * data/bison.c++: Remove a debug line.
1876
374f5a14
RA
18772002-03-04 Robert Anisko <robert@lrde.epita.fr>
1878
1879 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1880 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1881 provide a default implementation.
1882
bfcf1f3a
AD
18832002-03-04 Akim Demaille <akim@epita.fr>
1884
1885 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1886 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1887 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1888 * tests/semantic.at (Parsing Guards): Similarly.
1889 * src/reader.at (readgram): Complain if the last rule is not ended
1890 with a semi-colon.
1891
65ccf9fc
AD
18922002-03-04 Akim Demaille <akim@epita.fr>
1893
1894 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1895 * src/closure.c: here.
1896 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1897 RTC.
1898 * src/warshall.h, src/warshall.c: Remove.
1899 * tests/sets.at (Broken Closure): Adjust.
1900
d0039cbc
AD
19012002-03-04 Akim Demaille <akim@epita.fr>
1902
1903 * src/output.c (output_skeleton): tempdir is const.
1904 bytes_read is unused.
1905
345cea78
AD
19062002-03-04 Akim Demaille <akim@epita.fr>
1907
1908 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1909 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1910 Update.
1911 From Michael Hayes.
1912
564801f7
AD
19132002-03-04 Akim Demaille <akim@epita.fr>
1914
1915 * src/closure.c (closure): `r' is unused.
1916
e5352bc7
AD
19172002-03-04 Akim Demaille <akim@epita.fr>
1918
1919 * tests/sets.at (Broken Closure): Add the ending `;'.
1920 * src/reader.at (readgram): Complain if a rule is not ended with a
1921 semi-colon.
1922
914feea9
AD
19232002-03-04 Akim Demaille <akim@epita.fr>
1924
1925 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1926 (count_sr_conflicts): Use bitset_count.
1927 * src/reduce.c (inaccessable_symbols): Ditto.
1928 (bits_size): Remove.
1929 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1930
f0250de6
AD
19312002-03-04 Akim Demaille <akim@epita.fr>
1932
1933 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1934 * src/reduce.c: Remove the `bitset_zero's following the
1935 `bitset_create's, as now it is performed by the latter.
1936
ef017502
AD
19372002-03-04 Akim Demaille <akim@epita.fr>
1938
1939 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1940 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1941 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1942 latest sources from Michael.
1943
76514394
AD
19442002-03-04 Akim Demaille <akim@epita.fr>
1945
1946 * src/output.c (output): Don't free the grammar.
1947 * src/reader.c (grammar_free): New.
1948 * src/main.c (main): Call it and don't free symtab here.
1949
55024580
AD
19502002-03-04 Akim Demaille <akim@epita.fr>
1951
1952 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1953 before returning.
1954 Reported by Benoit Perrot.
1955
f9abaa2c
AD
19562002-03-04 Akim Demaille <akim@epita.fr>
1957
1958 Use bitset operations when possible, not loops over bits.
1959
1960 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1961 bitset_or.
1962 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1963 * src/reduce.c (useless_nonterminals): Formatting changes.
1964 * src/warshall.c (TC): Use bitset_or.
1965
0e721e75
AD
19662002-03-04 Akim Demaille <akim@epita.fr>
1967
1968 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1969 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1970 Ditto.
1971
0fb1ffb1
AD
19722002-03-04 Akim Demaille <akim@epita.fr>
1973
1974 * src/lalr.c (F): Now a bitset*.
1975 Adjust all dependencies.
1976
b86796bf
AD
19772002-03-04 Akim Demaille <akim@epita.fr>
1978
1979 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1980 Adjust all dependencies.
1981
602bbf31
AD
19822002-03-04 Akim Demaille <akim@epita.fr>
1983
1984 * src/L0.c, src/LR0.h (nstates): Be size_t.
1985 Adjust comparisons (signed vs unsigned).
1986 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1987 bitset*.
1988 Adjust all dependencies.
1989
d8a0245c
AD
19902002-03-04 Akim Demaille <akim@epita.fr>
1991
1992 * src/closure.c (firsts): Now, also a bitset.
1993 Adjust all dependencies.
1994 (varsetsize): Remove, now unused.
1995 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1996
34ba9743
AD
19972002-03-04 Akim Demaille <akim@epita.fr>
1998
1999 * src/print.c: Convert to use bitset.h, not hand coded iterations
2000 over ints.
2001
ed86e78c
AD
20022002-03-04 Akim Demaille <akim@epita.fr>
2003
2004 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
2005
dfdb1797
AD
20062002-03-04 Akim Demaille <akim@epita.fr>
2007
2008 * src/closure.c (ruleset): Be a bitset.
2009 (rulesetsize): Remove.
2010
7086e707
AD
20112002-03-04 Akim Demaille <akim@epita.fr>
2012
2013 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
2014 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
2015 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
2016 * src/closure.c (fderives): Be an array of bitsets.
2017
98254360
RA
20182002-02-28 Robert Anisko <robert@lrde.epita.fr>
2019
2020 * data/bison.c++: Merge the two generated headers. Insert a copyright
2021 notice in each output file.
2022
a75c057f
AD
20232002-02-28 Akim Demaille <akim@epita.fr>
2024
2025 * data/bison.c++: Copy the prologue of bison.simple to fetch
2026 useful M4 definitions, such as b4_header_guard.
2027
06b00abc
AD
20282002-02-25 Akim Demaille <akim@epita.fr>
2029
2030 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
2031 translator friendly scheme for the bgr
2032 copyright notice.
06b00abc 2033
70e7d534
AD
20342002-02-25 Akim Demaille <akim@epita.fr>
2035
2036 * src/output.c (header_output): Remove, now handled completely via
2037 M4.
2038
abe017f6
AD
20392002-02-25 Akim Demaille <akim@epita.fr>
2040
2041 * m4/m4.m4: New, from CVS Autoconf.
2042 * configure.in: Invoke it.
2043 * src/output.c (output_skeleton): Use its result instead of the
2044 hard coded name.
2045
381fb12e
AD
20462002-02-25 Akim Demaille <akim@epita.fr>
2047
2048 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
2049 Fileutils 4.1.5.
2050 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
2051 * src/output.c (output_skeleton): Use mkstemp to create a real
2052 temporary file.
2053 Move the filling of `skeleton' and its muscle to...
2054 (prepare): here.
2055 (output): Move the definition of the prologue muscle to...
2056 (prepare): here.
2057 * src/system.h (DEFAULT_TMPDIR): New.
2058
6f38107f
PE
20592002-02-14 Paul Eggert <eggert@twinsun.com>
2060
2061 Remove the support for C++ namespace cleanliness; it was
2062 causing more problems than it was curing, since it didn't work
2063 properly on some nonstandard C++ compilers. This can wait
2064 for a proper C++ parser.
2065
2066 * NEWS: Document this.
2067 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
2068 of C++, as it's treated like C now.
2069 * src/bison.simple (YYSTD): Remove.
2070 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
2071 Treat C++ just like Standard C instead of trying to support
2072 namespace cleanliness.
2073
80cce3da
AD
20742002-02-14 Akim Demaille <akim@epita.fr>
2075
2076 * tests/regression.at (else): Adjust to Andreas' change.
2077
842e8679
AD
20782002-02-14 Akim Demaille <akim@epita.fr>
2079
2080 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
2081
4bda3f10
AD
20822002-02-13 Andreas Schwab <schwab@suse.de>
2083
2084 * src/output.c (output_rule_data): Don't output NULL, it might
2085 not be defined yet.
2086
4162fa07 20872002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 2088
4162fa07
RA
2089 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
2090 (Copyright notice): Update.
b418ecd8 2091
bd16a5dc
AD
20922002-02-11 Akim Demaille <akim@epita.fr>
2093
2094 * tests/regression.at (%nonassoc and eof): Don't include
2095 nonportable headers.
2096
8d69a1a3
RA
20972002-02-08 Robert Anisko <robert@lrde.epita.fr>
2098
2099 * data/bison.c++: Correct error recovery. Make the user able to
2100 initialize the starting location.
2101
9b2d0677
AD
21022002-02-07 Akim Demaille <akim@epita.fr>
2103
2104 * tests/input.at: New.
2105
69e2658b
RA
21062002-02-07 Robert Anisko <robert@lrde.epita.fr>
2107
2108 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 2109 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
2110 directives around tables only needed for debugging.
2111
4aacc3a7
RA
21122002-02-07 Robert Anisko <robert@lrde.epita.fr>
2113
2114 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
2115 C++ parsers.
2116 (yy::b4_name::parse): Use print_.
2117
762a801e
RA
21182002-02-07 Robert Anisko <robert@lrde.epita.fr>
2119
2120 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
2121
4bb2bc3f
RA
21222002-02-07 Robert Anisko <robert@lrde.epita.fr>
2123
2124 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
2125 C++ parsers.
2126 (yy::b4_name::parse): Build verbose error messages, and use error_.
2127
6b45a3ca
RA
21282002-02-06 Robert Anisko <robert@lrde.epita.fr>
2129
2130 * data/bison.c++: Fix m4 quoting in comments.
2131
50997c6e
RA
21322002-02-06 Robert Anisko <robert@lrde.epita.fr>
2133
2134 * data/bison.c++: Adjust the parser code. Fix some muscles that were
2135 not expanded by m4.
2136
3f3eed27
AD
21372002-02-05 Akim Demaille <akim@epita.fr>
2138
2139 * data/bison.c++: Adjust to the M4 back end.
2140 More is certainly needed.
2141
be2a1a68
AD
21422002-02-05 Akim Demaille <akim@epita.fr>
2143
2144 Give a try to M4 as a back end.
2145
2146 * lib/readpipe.c: New, from wdiff.
2147 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
2148 BISON_HAIRY.
2149 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
2150 specific values. Now it is m4 that performs the lookup.
2151 * src/parse-skel.y: Remove.
2152 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
2153 * src/output.c (actions_output, guards_output)
2154 (token_definitions_output): No longer keeps track of the output
2155 line number, hence remove the second argument.
2156 (guards_output): Check against the guard member of a rule, not the
2157 action member.
2158 Adjust callers.
2159 (output_skeleton): Don't look for the skeleton location, let m4 do
2160 that.
2161 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
2162 file will be used.
2163 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
2164 (prepare): Given that for the time being changesyntax is not
2165 usable in M4, rename the muscles using `-' to `_'.
2166 Define `defines_flag', `output_parser_name' and `output_header_name'.
2167 * src/output.h (actions_output, guards_output)
2168 (token_definitions_output): Adjust prototypes.
2169 * src/scan-skel.l: Instead of scanning the skeletons, it now
2170 processes the output of m4: `__oline__' and `#output'.
2171 * data/bison.simple: Adjust to be used by M4(sugar).
2172 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
2173 to date.
2174 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
2175 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
2176 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
2177 shamelessly stolen from CVS Autoconf.
2178
beda758b
AD
21792002-02-05 Akim Demaille <akim@epita.fr>
2180
2181 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
2182 * configure.in: Check for the declarations of free and malloc.
2183 * src/muscle_tab.c: Adjust.
2184
5ece6d43
AD
21852002-02-05 Akim Demaille <akim@epita.fr>
2186
2187 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
2188 which have no values.
2189
5bb18f9a
AD
21902002-02-05 Akim Demaille <akim@epita.fr>
2191
2192 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
2193 * data/: here.
2194
894dd62e
PE
21952002-01-29 Paul Eggert <eggert@twinsun.com>
2196
2197 * src/bison.simple (YYSIZE_T): Do not define merely because
2198 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
2199 On some platforms, <alloca.h> does not declare YYSTD (size_t).
2200
82841af7
AD
22012002-01-27 Akim Demaille <akim@epita.fr>
2202
2203 Fix `%nonassoc and eof'.
2204
2205 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
2206 which were not properly copied! Replace
2207 memcpy (res->errs, src->errs, src->nerrs);
2208 with
2209 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
2210 !!!
2211 * tests/regression.at (%nonassoc and eof): Adjust to newest
2212 Autotest: `.' is not in the PATH.
2213
318b76e9
AD
22142002-01-27 Akim Demaille <akim@epita.fr>
2215
2216 * tests/sets.at (AT_EXTRACT_SETS): New.
2217 (Nullable): Use it.
2218 (Firsts): New.
2219
30d2f3d5
AD
22202002-01-26 Akim Demaille <akim@epita.fr>
2221
2222 * tests/actions.at, tests/calc.at, tests/headers.at,
2223 * tests/torture.at: Adjust to the newest Autotest which no longer
2224 forces `.' in the PATH.
2225
30f8c395
AD
22262002-01-25 Akim Demaille <akim@epita.fr>
2227
2228 * tests/regression.at (%nonassoc and eof): New.
2229 Suggested by Robert Anisko.
2230
29ae55f1
AD
22312002-01-24 Akim Demaille <akim@epita.fr>
2232
2233 Bison dumps core when trying to complain about broken input files.
2234 Reported by Cris van Pelt.
2235
2236 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2237 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2238 into...
2239 (Invalid inputs): Strengthen: exercise parse_percent_token.
2240
2b548aa6
RA
22412002-01-24 Robert Anisko <robert.anisko@epita.fr>
2242
2243 * src/Makefile.am: Add bison.c++.
2244 * src/bison.c++: New skeleton.
2245
bb0146c2
AD
22462002-01-21 Paolo Bonzini <bonzini@gnu.org>
2247
2248 * po/it.po: New.
2249
bec30531
AD
22502002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2251
2252 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2253
fc6edc45
MA
22542002-01-20 Marc Autret <marc@gnu.org>
2255
2256 * src/files.c (compute_output_file_names): Fix
2257
5e5d5415
MA
22582002-01-20 Marc Autret <marc@gnu.org>
2259
2260 * tests/output.at: New test.
2261 * src/files.c (compute_base_names): Don't map extensions when
2262 the YACC flag is set, use defaults.
2263 Reported by Evgeny Stambulchik.
2264
44ea3fbd
MA
22652002-01-20 Marc Autret <marc@gnu.org>
2266
bb0146c2 2267 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2268 compilers as well (i.e. the vendor C compiler).
2269 Suggested by Albert Chin-A-Young.
2270
338963d1
TVH
22712002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2272
2273 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2274 canonical definition.
2275 * src/system.h: Use the canonical definition for PARAMS (avoids
2276 a conflict with the macro from lib/hash.h).
2277
c57b2479
AD
22782002-01-11 Akim Demaille <akim@epita.fr>
2279
2280 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2281 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2282
b85810ae
AD
22832002-01-09 Akim Demaille <akim@epita.fr>
2284
2285 * src/files.c, src/files.h (output_infix): New.
2286 (tab_extension): Remove.
2287 (compute_base_names): Compute the former, drop the latter.
2288 * src/output.c (prepare): Insert the muscles `output-infix', and
2289 `output-suffix'.
2290 * src/parse-skel.y (string, string.1): New.
2291 (section.header): Use it.
2292 (section.yacc): Remove.
2293 (prefix): Remove too.
2294 * src/scan-skel.l: Adjust.
2295 * src/bison.simple, src/bison.hairy: Adjust.
2296
cae60122
AD
22972002-01-09 Akim Demaille <akim@epita.fr>
2298
2299 * configure.in (WERROR_CFLAGS): Compute it.
2300 * src/Makefile.am (CFLAGS): Pass it.
2301 * tests/atlocal.in (CFLAGS): Idem.
2302 * src/files.c: Fix a few warnings.
2303 (get_extension_index): Remove, unused.
2304
ae404801
AD
23052002-01-08 Akim Demaille <akim@epita.fr>
2306
2307 * src/getargs.c (AS_FILE_NAME): New.
2308 (getargs): Use it to convert DOSish file names.
2309 * src/files.c (base_name): Rename as full_base_name to avoid
2310 clashes with `base_name ()'.
2311 (filename_split): New.
2312 (compute_base_names): N-th rewrite, using filename_split.
2313
22312b71
AD
23142002-01-08 Akim Demaille <akim@epita.fr>
2315
2316 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2317 New, stolen from the Fileutils 4.1.
2318 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2319 * configure.in: Check for the presence of memrchr, and of its
2320 prototype.
2321
a67cef01
TVH
23222002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2323
2324 * lib/hash.h (__P): Added definition for this macro.
2325 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2326 BUILT_SOURCES, to ensure they are generated first.
2327 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2328 %error-verbose to allow bootstrapping with bison 1.30x.
2329
2b25d624
AD
23302002-01-06 Akim Demaille <akim@epita.fr>
2331
2332 * src/reader.c (parse_braces): Don't fetch the next char, the
2333 convention is to fetch on entry.
2334 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2335 'switch' without a following semicolon.
2336 * tests/regression.at (braces parsing): New.
2337
3460813b
AD
23382002-01-06 Akim Demaille <akim@epita.fr>
2339
2340 Bison is dead wrong in its RR conflict reports.
2341
2342 * tests/torture.at (GNU Cim Grammar): New.
2343 * src/conflicts.c (count_rr_conflicts): Fix.
2344
73784c64
AD
23452002-01-06 Akim Demaille <akim@epita.fr>
2346
2347 Creating package.m4 from configure.ac causes too many problems.
2348
2349 * tests/Makefile.am (package.m4): Create it by hand,
2350 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2351
25d81090
AD
23522002-01-06 Akim Demaille <akim@epita.fr>
2353
2354 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2355 skeleton.h.
2356
a9b8959e
PE
23572002-01-04 Paul Eggert <eggert@twinsun.com>
2358
2359 * doc/bison.texinfo (Debugging):
2360 Remove YYSTDERR; it's no longer defined or used.
2361 Also, s/cstdio.h/cstdio/.
2362
25d81090
AD
23632002-01-03 Akim Demaille <akim@epita.fr>
2364
2365 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2366
1109455c
AD
23672002-01-03 Akim Demaille <akim@epita.fr>
2368
2369 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2370 tracing code to --trace, wait for a better --trace option, with
2371 args.
2372
7ea5e977
AD
23732002-01-03 Akim Demaille <akim@epita.fr>
2374
2375 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2376 The ISO C++ standard is extremely clear about it: stderr is
2377 considered a macro, not a regular symbol (see table 94 `Header
2378 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2379 Therefore std:: does not apply to it. It still does with fprintf.
2380 Also, s/cstdio.h/cstdio/.
2381
fab5b110
AD
23822002-01-03 Akim Demaille <akim@epita.fr>
2383
2384 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2385 for non system headers.
2386
aed7fd9b
AD
23872002-01-02 Akim Demaille <akim@epita.fr>
2388
2389 Equip the skeleton chain with location tracking, runtime trace,
2390 pure parser and scanner.
2391
2392 * src/parse-skel.y: Request a pure parser, locations, and prefix
2393 renaming.
2394 (%union): Having several members with the same type does not help
2395 type mismatches, simplify.
2396 (YYPRINT, yyprint): New.
2397 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2398 (skel_error): this.
2399 Handle locations.
2400 * src/scan-skel.l: Adjust to these changes.
2401 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2402 (LOCATION_PRINT, skel_control_t): New.
2403
24fad99e
AD
24042001-12-30 Akim Demaille <akim@epita.fr>
2405
2406 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2407 replace `gb' with BLANKS.
2408 * src/scan-skel.l: Adjust.
2409
a4b36db4
AD
24102001-12-30 Akim Demaille <akim@epita.fr>
2411
2412 * src/system.h: We don't need nor want bcopy.
2413 Throw away MS-DOS crap: we don't need getpid.
2414 * configure.in: We don't need strndup. It was even causing
2415 problems: because Flex includes the headers *before* us,
2416 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2417 not visible.
2418 * lib/xstrndup.c: New.
2419 * src/scan-skel.l: Use it.
2420 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2421 * src/parse-skel.y: Use %directives instead of #defines.
2422
1239777d
AD
24232001-12-30 Akim Demaille <akim@epita.fr>
2424
2425 * src/skeleton.h: New.
2426 * src/output.c (output_parser, output_master_parser): Remove, dead
2427 code.
2428 * src/output.h (get_lines_number, actions_output, guards_output)
2429 (token_definitions_output): Prototype them.
2430 * src/parse-skel.y: Add the license notice.
2431 Include output.h and skeleton.h.
2432 (process_skeleton): Returns void, and takes a single parameter.
2433 * src/scan-skel.l: Add the license notice.
2434 Include skeleton.h.
2435 Don't use %option yylineno: it seems that then Flex imagines
2436 REJECT has been used, and therefore it won't reallocate its
2437 buffers (which makes no other sense to me than a bug). It results
2438 in warnings for `unused: yy_flex_realloc'.
2439
9b3add5b
RA
24402001-12-30 Robert Anisko <robert.anisko@epita.fr>
2441
2442 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2443 (MUSCLE_INSERT_PREFIX): ...to there.
2444 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2445 (MUSCLE_INSERT_PREFIX): Move from here...
2446
2447 * src/bison.hairy: Add a section directive. Put braces around muscle
2448 names. This parser skeleton is still broken, but Bison should not
2449 choke on a bad muscle 'syntax'.
2450 * src/bison.simple: Add a section directive. Put braces around muscle
2451 names.
2452
2453 * src/files.h (strsuffix, stringappend): Add declarations.
2454 (tab_extension): Add declaration.
2455 (short_base_name): Add declaration.
2456
2457 * src/files.c (strsuffix, stringappend): No longer static. These
2458 functions are used in the skeleton parser.
2459 (tab_extension): New.
2460 (compute_base_names): Use the computations done in this function
fab5b110 2461 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
2462 names.
2463 (short_base_name): No longer static.
2464
2465 * src/output.c (output_skeleton): New.
2466 (output): Disable call to output_master_parser, and give a try to
2467 a new skeleton handling system.
2468 (guards_output, actions_output): No longer static.
2469 (token_definitions_output, get_lines_number): No longer static.
2470
2471 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2472
fab5b110 2473 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
2474 parse-skel.y.
2475
2476 * src/parse-skel.y: New file.
2477 * src/scan-skel.l: New file.
2478
b5b61c61
AD
24792001-12-29 Akim Demaille <akim@epita.fr>
2480
2481 %name-prefix is broken.
2482
2483 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2484 Adjust all dependencies.
2485 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2486 %name-prefix.
2487
2488 Renaming yylval but not yylloc is not consistent. Now we do.
2489
2490 * src/bison.simple: Prefix yylloc if used.
2491 * doc/bison.texinfo (Decl Summary): Document that.
2492
8c9a50be
AD
24932001-12-29 Akim Demaille <akim@epita.fr>
2494
2495 * doc/bison.texinfo: Promote `%long-directive' over
2496 `%long_directive'.
2497 Remove all references to fixed-output-files, yacc is enough.
2498
d99361e6
AD
24992001-12-29 Akim Demaille <akim@epita.fr>
2500
2501 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2502 user prologue. These are defaults.
2503 * tests/actions.at (Mid-rule actions): Make sure the user can
2504 define YYDEBUG and YYERROR_VERBOSE.
2505
b9cecb91
AD
25062001-12-29 Akim Demaille <akim@epita.fr>
2507
2508 * src/output.c (header_output): Don't forget to export YYLTYPE and
2509 yylloc.
2510 * tests/headers.at (export YYLTYPE): New, make sure it does.
2511 * tests/regression.at (%union and --defines, Invalid CPP headers):
2512 Move to...
2513 * tests/headers.at: here.
2514
aea13e97
AD
25152001-12-29 Akim Demaille <akim@epita.fr>
2516
2517 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2518
931394cb
AD
25192001-12-29 Akim Demaille <akim@epita.fr>
2520
2521 * tests/actions.at (Mid-rule actions): Output on a single line
2522 instead of several.
2523
704a47c4
AD
25242001-12-29 Akim Demaille <akim@epita.fr>
2525
2526 * doc/bison.texinfo: Formatting changes.
2527
091e20bb
AD
25282001-12-29 Akim Demaille <akim@epita.fr>
2529
2530 Don't store the token defs in a muscle, just be ready to output it
2531 on command. Now possible via `symbols'. Fixes a memory leak.
2532
2533 * src/output.c (token_definitions_output): New.
2534 (output_parser, header_output): Use it.
2535 * src/reader.c (symbols_save): Remove.
2536
cce71710
AD
25372001-12-29 Akim Demaille <akim@epita.fr>
2538
2539 * src/bison.simple: Do not provide a default for YYSTYPE and
2540 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2541 default.
2542
82c035a8
AD
25432001-12-29 Akim Demaille <akim@epita.fr>
2544
2545 Mid-rule actions are simply... ignored!
2546
2547 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2548 the empty-rule associated to the dummy symbol, not to the host
2549 rule.
2550 * tests/actions.at (Mid-rule actions): New.
2551
8419d367
AD
25522001-12-29 Akim Demaille <akim@epita.fr>
2553
2554 Memory leak.
2555
2556 * src/reader.c (reader): Free grammar.
2557
375d5806
AD
25582001-12-29 Akim Demaille <akim@epita.fr>
2559
2560 Memory leak.
2561
2562 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2563 since it allocates it for each state, although only one is needed.
2564 (allocate_storage): Do it here.
2565
f51cb8ff
AD
25662001-12-29 Akim Demaille <akim@epita.fr>
2567
2568 * src/options.h, src/options.c (create_long_option_table): Rename
2569 as...
2570 (long_option_table_new): this, with a clearer prototype.
2571 (percent_table): Remove, unused,
2572 * src/getargs.c (getargs): Adjust.
2573
29e88316
AD
25742001-12-29 Akim Demaille <akim@epita.fr>
2575
2576 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2577 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2578 as states.
2579
b9f71f19
AD
25802001-12-29 Akim Demaille <akim@epita.fr>
2581
2582 * src/lalr.c (build_relations): Rename `states' as `states1'.
2583 Sorry, I don't understand exactly what it is, no better name...
2584
1a2b5d37
AD
25852001-12-29 Akim Demaille <akim@epita.fr>
2586
2587 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2588 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2589 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2590 as rules.
2591
1cca533e
AD
25922001-12-29 Akim Demaille <akim@epita.fr>
2593
2594 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2595 ago.
2596
c03ae966
AD
25972001-12-29 Akim Demaille <akim@epita.fr>
2598
2599 * src/reader.c, src/reader.h (user_toknums): Remove.
2600 Adjust all users to use symbols[i]->user_token_number.
2601
5a670b1e
AD
26022001-12-29 Akim Demaille <akim@epita.fr>
2603
2604 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2605 Adjust all users to use symbols[i]->prec or ->assoc.
2606
ad949da9
AD
26072001-12-29 Akim Demaille <akim@epita.fr>
2608
2609 * src/reader.c, src/reader.h (tags): Remove.
2610 Adjust all users to use symbols[i]->tag.
2611
0e78e603
AD
26122001-12-29 Akim Demaille <akim@epita.fr>
2613
2614 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2615 and rule_table.
2616 * src/reader.c (packsymbols): Fill this table.
2617 Drop sprec.
2618 * src/conflicts.c (resolve_sr_conflict): Adjust.
2619 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2620 single table.
2621 Use symbols[i]->tag instead of tags[i].
2622
213e640e
AD
26232001-12-29 Akim Demaille <akim@epita.fr>
2624
2625 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2626 In addition, put a comment in there, to replace...
2627 * tests/regression.at (%union and C comments): Remove.
2628
e7b8bef1
AD
26292001-12-29 Akim Demaille <akim@epita.fr>
2630
2631 * tests/regression.at (Web2c Actions): Blindly move the actual
2632 output as expected output. The contents *seem* right to me, but I
2633 can't pretend reading perfectly parser tables... Nonetheless, all
2634 the other tests pass correctly, the table look OK, even though the
2635 presence of `$axiom' is to be noted: AFAICS it is useless (but
2636 harmless).
2637
b68e7744
AD
26382001-12-29 Akim Demaille <akim@epita.fr>
2639
2640 * src/reader.c (readgram): Don't add the rule 0 if there were no
2641 rules read. In other words, add it _after_ having performed
2642 grammar sanity checks.
2643 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2644
78d5bae9
AD
26452001-12-29 Akim Demaille <akim@epita.fr>
2646
2647 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2648 visible, and some states have now a different number.
2649
ff442794
AD
26502001-12-29 Akim Demaille <akim@epita.fr>
2651
2652 * src/reader.c (readgram): Bind the initial rule's lineno to that
2653 of the first rule.
2654 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2655 (Solved SR Conflicts): Adjust rule 0's line number.
2656
610ab194
AD
26572001-12-29 Akim Demaille <akim@epita.fr>
2658
2659 Fix the `GAWK Grammar' failure.
2660
2661 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2662 the reductions of the first state which was mistakenly confused
2663 with the final state because precisely final_state was initialized
2664 to 0.
2665 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2666 now noticed by Bison.
2667 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2668 have a reduction on $default.
2669
29d29c8f
AD
26702001-12-29 Akim Demaille <akim@epita.fr>
2671
2672 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2673 rule line numbers.
2674 * src/closure.c (print_closure): Likewise.
2675 * src/derives.c (print_derives): Likewise.
2676 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2677 now.
2678
7c6b64d0
AD
26792001-12-29 Akim Demaille <akim@epita.fr>
2680
2681 * src/lalr.c (lookaheads_print): New.
2682 (lalr): Call it when --trace-flag.
2683 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2684 are dumped.
2685
3d4daee3
AD
26862001-12-29 Akim Demaille <akim@epita.fr>
2687
2688 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2689 when walking through ritem, even via rule->rhs.
2690 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2691 (useful_production, useless_nonterminals): Likewise.
2692 (reduce_grammar_tables): Likewise, plus update nritems.
2693 * src/nullable.c (set_nullable): Likewise.
2694 * src/lalr.c (build_relations): Likewise.
2695 * tests/sets.at (Nullable): Adjust.
2696 Fortunately, now, the $axiom is no longer nullable.
2697
9e7f6bbd
AD
26982001-12-29 Akim Demaille <akim@epita.fr>
2699
2700 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2701 the 0-sentinel.
2702 * src/gram.c (ritem_longest_rhs): Likewise.
2703 * src/reduce.c (nonterminals_reduce): Likewise.
2704 * src/print_graph.c (print_graph): Likewise.
2705 * src/output.c (output_rule_data): Likewise.
2706 * src/nullable.c (set_nullable): Likewise.
2707
255ef638
AD
27082001-12-29 Akim Demaille <akim@epita.fr>
2709
2710 * src/output.c: Comment changes.
2711
0d8a7363
AD
27122001-12-27 Paul Eggert <eggert@twinsun.com>
2713
2714 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2715 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2716 Sparc, as they were causing more porting problems than the
2717 (minor) performance improvement was worth.
2718
2719 Also, catch up with 1.31's YYSTD.
2720
3db472b9
AD
27212001-12-27 Akim Demaille <akim@epita.fr>
2722
2723 * src/output.c (output_gram): Rely on nritems, not the
2724 0-sentinel. See below.
2725 Use -1 as separator, not 0.
2726 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2727 Rely on -1 as separator in yyrhs, instead of 0.
2728 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2729 twice `Now at end of input', therefore there are two lines less to
2730 expect.
2731
b365aa05
AD
27322001-12-27 Akim Demaille <akim@epita.fr>
2733
2734 * tests/regression.at (Unresolved SR Conflicts):
2735 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2736 below.
2737
30171f79
AD
27382001-12-27 Akim Demaille <akim@epita.fr>
2739
2740 * src/LR0.c (new_state): Recognize the final state by the fact it
2741 is reached by eoftoken.
2742 (insert_start_shifting_state, insert_eof_shifting_state)
2743 (insert_accepting_state, augment_automaton): Remove, since now
2744 these states are automatically computed from the initial state.
2745 (generate_states): Adjust.
2746 * src/print.c: When reporting a rule number to the user, substract
2747 1, so that the axiom rule is rule 0, and the first user rule is 1.
2748 * src/reduce.c: Likewise.
2749 * src/print_graph.c (print_core): For the time being, just as for
2750 the report, depend upon --trace-flags to dump the full set of
2751 items.
2752 * src/reader.c (readgram): Once the grammar read, insert the rule
2753 0: `$axiom: START-SYMBOL $'.
2754 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2755 number of the states has changed (the final state is no longer
2756 necessarily the last), catch up.
2757
75142d45
AD
27582001-12-27 Akim Demaille <akim@epita.fr>
2759
2760 Try to make the use of the eoftoken valid. Given that its value
2761 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2762 is used instead of > 0 where appropriate, (ii), depend upon nritems
2763 instead of the 0-sentinel.
2764
2765 * src/gram.h, src/gram.c (nritems): New.
2766 Expected to be duplication of nitems, but for the time being...
2767 * src/reader.c (packgram): Assert nritems and nitems are equal.
2768 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2769 * src/closure.c (print_closure, print_fderives): Likewise.
2770 * src/gram.c (ritem_print): Likewise.
2771 * src/print.c (print_core, print_grammar): Likewise.
2772 * src/print_graph.c: Likewise.
2773
b7c49edf
AD
27742001-12-27 Akim Demaille <akim@epita.fr>
2775
2776 * src/main.c (main): If there are complains after grammar
2777 reductions, then output the report anyway if requested, then die.
2778 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2779 * src/reader.c (eoftoken): New.
2780 (parse_token_decl): If the token being defined has value `0', it
2781 is the eoftoken.
2782 (packsymbols): No longer hack `tags' to insert `$' by hand.
2783 Be sure to preserve the value of the eoftoken.
2784 (reader): Make sure eoftoken is defined.
2785 Initialize nsyms to 0: now eoftoken is created just like the others.
2786 * src/print.c (print_grammar): Don't special case the eof token.
2787 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2788 lie anyway, albeit pleasant.
2789 * tests/calc.at: Exercise error messages with eoftoken.
2790 Change the grammar so that empty input is invalid.
2791 Adjust expectations.
2792 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2793
ec2da99f
AD
27942001-12-27 Akim Demaille <akim@epita.fr>
2795
2796 * configure.in: Check the protos of strchr ans strspn.
2797 Replace strchr if needed.
2798 * src/system.h: Provide the protos of strchr, strspn and memchr if
2799 missing.
2800 * lib/strchr.c: New.
2801 * src/reader.c (symbols_save): Use strchr.
2802
8adfa272
AD
28032001-12-27 Akim Demaille <akim@epita.fr>
2804
2805 * src/print.c, src/print_graph.c (escape): New.
2806 Use it to quote the TAGS outputs.
2807 * src/print_graph.c (print_state): Now errors are in red, and
2808 reductions in green.
2809 Prefer high to wide: output the state number on a line of its own.
2810
80dac38c
AD
28112001-12-27 Akim Demaille <akim@epita.fr>
2812
2813 * src/state.h, src/state.c (reductions_new): New.
2814 * src/LR0.c (set_state_table): Let all the states have a
2815 `reductions', even if reduced to 0.
2816 (save_reductions): Adjust.
2817 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2818 * src/print.c (print_reductions, print_actions): Adjust.
2819 * src/output.c (action_row): Adjust.
2820
2cec70b9
AD
28212001-12-27 Akim Demaille <akim@epita.fr>
2822
2823 * src/state.h, src/state.c (errs_new, errs_dup): New.
2824 * src/LR0.c (set_state_table): Let all the states have an errs,
2825 even if reduced to 0.
2826 * src/print.c (print_errs, print_reductions): Adjust.
2827 * src/output.c (output_actions, action_row): Adjust.
2828 * src/conflicts.c (resolve_sr_conflict): Adjust.
2829
13ca549a
AD
28302001-12-27 Akim Demaille <akim@epita.fr>
2831
2832 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2833
5092aba5
AD
28342001-12-27 Akim Demaille <akim@epita.fr>
2835
2836 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2837 * src/print.c: here.
2838 (lookaheadset, shiftset): New, used as additional storage by
2839 print_reductions.
2840 (print_results): Adjust.
2841 (print_shifts, print_gotos, print_errs): New, extracted from...
2842 (print_actions): here.
2843 * src/print_graph.c (print_actions): Remove dead code.
2844
11e2beca
AD
28452001-12-27 Akim Demaille <akim@epita.fr>
2846
2847 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2848 `$n' and `@n'.
2849
dac3c910
AD
28502001-12-27 Akim Demaille <akim@epita.fr>
2851
2852 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2853 (build_relations): Adjust.
2854
d0b0fefa
AD
28552001-12-27 Akim Demaille <akim@epita.fr>
2856
2857 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2858 duplication.
2859
adc8c848
AD
28602001-12-27 Akim Demaille <akim@epita.fr>
2861
2862 * src/reader.c (packgram): Catch nitems overflows.
2863
14d293ac
AD
28642001-12-27 Akim Demaille <akim@epita.fr>
2865
2866 * src/files.c, src/files.h (guard_obstack): Remove.
2867 * src/output.c (output): Adjust.
2868 * src/reader.c (parse_braces): New, factoring...
2869 (copy_action, copy_guard): these two which are renamed as...
2870 (parse_action, parse_guard): these.
2871 As a voluntary consequence, using braces around guards is now
2872 mandatory.
2873
f499b062
AD
28742001-12-27 Akim Demaille <akim@epita.fr>
2875
2876 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2877 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2878 members.
2879 (symbol_list_new): Adjust.
2880 (copy_action): action_line is the first line, not the last.
2881 (copy_guard): Just as for actions, store the `action' only, not
2882 the switch/case/break flesh.
2883 Don't parse the user action that might follow the guard, let...
2884 (readgram): do it, i.e., now, there can be an action after a
2885 guard.
2886 In other words the guard is just explicitly optional.
2887 (packgram): Adjust.
2888 * src/output.c (guards_output): New.
2889 (output_parser): Call it when needed.
2890 (output): Also free the guard and attrs obstacks.
2891 * src/files.c, src/files.h (obstack_save): Remove.
2892 (output_files): Remove.
2893 As a result, if one needs the former `.act' file, using an
2894 appropriate skeleton which requires actions and guards is now
2895 required.
2896 * src/main.c (main): Adjust.
2897 * tests/semantic.at: New.
2898 * tests/regression.at: Use `input.y' as input file name.
2899 Avoid 8+3 problems by requiring input.c when the test needs the
2900 parser.
2901
d945f5cd
AD
29022001-12-27 Akim Demaille <akim@epita.fr>
2903
2904 * src/reader.c (symbol_list_new): Be sure to initialize all the
2905 fields.
2906
d200e455
AD
29072001-12-27 Akim Demaille <akim@epita.fr>
2908
2909 All the hacks using a final pseudo state are now useless.
2910
2911 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2912 * src/lalr.c (nLA): New.
2913 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2914 instead of lookaheadsp from the pseudo state (nstate + 1).
2915
f9507c28
AD
29162001-12-27 Akim Demaille <akim@epita.fr>
2917
2918 * src/output.c (action_row, token_actions): Use a state_t instead
2919 of a integer, and nlookaheads instead of the following state's
2920 lookaheadsp.
2921
065fbd27
AD
29222001-12-27 Akim Demaille <akim@epita.fr>
2923
2924 * src/conflicts.c (log_resolution, flush_shift)
2925 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2926 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2927 (conflicts_print, print_reductions): Use a state_t instead of an
2928 integer when referring to a state.
2929 As much as possible, depend upon nlookaheads, instead of the
2930 `lookaheadsp' member of the following state (since lookaheads of
2931 successive states are successive, the difference between state n + 1
2932 and n served as the number of lookaheads for state n).
2933 * src/lalr.c (add_lookback_edge): Likewise.
2934 * src/print.c (print_core, print_actions, print_state)
2935 (print_results): Likewise.
2936 * src/print_graph.c (print_core, print_actions, print_state)
2937 (print_graph): Likewise.
2938 * src/conflicts.h: Adjust.
2939
1b177bd7
AD
29402001-12-27 Akim Demaille <akim@epita.fr>
2941
2942 * src/bison.hairy: Formatting/comment changes.
2943 ANSIfy.
2944 Remove `register' indications.
2945 Add plenty of `static'.
2946
7742ddeb
AD
29472001-12-27 Akim Demaille <akim@epita.fr>
2948
2949 * src/output.c (prepare): Drop the muscle `ntbase' which
2950 duplicates ntokens.
2951 * src/bison.simple: Formatting/comment changes.
2952 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2953 is an undocumented synonym.
2954
1fa14068
AD
29552001-12-22 Akim Demaille <akim@epita.fr>
2956
2957 * src/output.c (output_table_data): Change the prototype to use
2958 `int' for array ranges: some invocations do pass an int, not a
2959 short.
2960 Reported by Wayne Green.
2961
b9752825
AD
29622001-12-22 Akim Demaille <akim@epita.fr>
2963
2964 Some actions of web2c.y are improperly triggered.
2965 Reported by Mike Castle.
2966
2967 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2968 * tests/regression.at (Web2c): Rename as...
2969 (Web2c Report): this.
2970 (Web2c Actions): New.
2971
776209d6
AD
29722001-12-22 Akim Demaille <akim@epita.fr>
2973
2974 Reductions in web2c.y are improperly reported.
2975 Reported by Mike Castle.
2976
2977 * src/conflicts.c (print_reductions): Fix.
2978 * tests/regression.at (Web2c): New.
2979
275fc3ad
AD
29802001-12-18 Akim Demaille <akim@epita.fr>
2981
2982 Some host fail on `assert (!"foo")', which expands to
2983 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2984 Reported by Nelson Beebee.
2985
2986 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2987 `#define it_succeeded 0' and `assert (it_succeeded)'.
2988
897668ee
MA
29892001-12-17 Marc Autret <autret_m@epita.fr>
2990
2991 * src/bison.simple: Don't hard code the skeleton line and filename.
2992 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2993 New line counter 'skeleton_line' (skeleton-line muscle).
2994
ab3399e0
PE
29952001-12-17 Paul Eggert <eggert@twinsun.com>
2996
2997 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2998 YYDEBUG must be defined to a nonzero value.
2999
3000 * src/bison.simple (yytname): Do not assume that the user defines
3001 YYDEBUG to a properly parenthesized expression.
3002
3877f72b
AD
30032001-12-17 Akim Demaille <akim@epita.fr>
3004
3005 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
3006 nlookaheads is a new member.
3007 Adjust all users.
3008 * src/lalr.h (nlookaheads): Remove this orphan declaration.
3009 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
3010 state.
776209d6 3011
331dbc1b
AD
30122001-12-17 Akim Demaille <akim@epita.fr>
3013
3014 * src/files.h, src/files.c (open_files, close_files): Remove.
3015 * src/main.c (main): Don't open/close files, nor invoke lex_free,
3016 let...
3017 * src/reader.c (reader): Do it.
776209d6 3018
be750e4c
AD
30192001-12-17 Akim Demaille <akim@epita.fr>
3020
3021 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 3022
709ae8c6
AD
30232001-12-17 Akim Demaille <akim@epita.fr>
3024
3025 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
3026 (flush_reduce): New.
3027 (resolve_sr_conflict): Adjust.
776209d6 3028
f87685c3
AD
30292001-12-17 Akim Demaille <akim@epita.fr>
3030
3031 * src/output.c (output_obstack): Be static and rename as...
3032 (format_obstack): this, to avoid any confusion with files.c's
3033 output_obstack.
3034 * src/reader.h (muscle_obstack): Move to...
3035 * src/output.h: here, since it's defined in output.c.
3036
837491d8
AD
30372001-12-17 Akim Demaille <akim@epita.fr>
3038
3039 * src/output.c (action_row, save_column, default_goto)
3040 (sort_actions, matching_state, pack_vector): Better variable
3041 locality.
3042
796d61fb
AD
30432001-12-17 Akim Demaille <akim@epita.fr>
3044
3045 * src/output.c: Various formatting changes.
776209d6 3046
64d15509
AD
30472001-12-17 Akim Demaille <akim@epita.fr>
3048
3049 * src/files.c (output_files): Free the output_obstack.
3050 * src/main.c (main): Call print and print_graph conditionally.
3051 * src/print.c (print): Work unconditionally.
3052 * src/print_graph.c (print_graph): Work unconditionally.
3053 * src/conflicts.c (log_resolution): Output only if verbose_flag.
3054
fbc8ecb7
MA
30552001-12-16 Marc Autret <autret_m@epita.fr>
3056
3057 * src/output.c (actions_output): Fix. When we use %no-lines,
3058 there is one less line per action.
3059
f0440388
MA
30602001-12-16 Marc Autret <autret_m@epita.fr>
3061
3062 * src/bison.simple: Remove a useless #line directive.
3063 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
3064 * src/output.c (get_lines_number): New.
776209d6 3065 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
3066 output muscles.
3067 Fix line numbering.
3068 (actions_output): Computes the number of lines taken by actions.
3069 (output_master_parser): Insert new skeleton which is the name of
3070 the output parser file name.
3071
a79986b8
MA
30722001-12-15 Marc Autret <autret_m@epita.fr>
3073
3074 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
3075
4ec8e00f
MA
30762001-12-15 Marc Autret <autret_m@epita.fr>
3077
3078 * src/output.c (output_gram): Keep track of the hairy one.
3079
1a4648ff
AD
30802001-12-15 Akim Demaille <akim@epita.fr>
3081
3082 Make `make distcheck' work.
3083
3084 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
3085 system.h which uses libgettext.h.
3086
9c2c67e6
AD
30872001-12-15 Akim Demaille <akim@epita.fr>
3088
3089 * src/nullable.c (set_nullable): Useless rules must be skipped,
3090 otherwise, since we range over their symbols, we might look at a
3091 nonterminal which no longer ``exists'', i.e., it is not counted in
3092 `nvars', hence we overflow our arrays.
3093
93ede233
AD
30942001-12-15 Akim Demaille <akim@epita.fr>
3095
3096 The header can also be produced directly, without any obstack!
3097 Yahoo!
3098
3099 * src/files.c, src/files.h (defines_obstack): Remove.
3100 (compute_header_macro): Global.
3101 (defines_obstack_save): Remove.
3102 * src/reader.c (parse_union_decl): No longer output to
3103 defines_obstack: its content can be found in the `stype' muscle
3104 anyway.
3105 (output_token_translations): Merge into...
3106 (symbols_output): this.
3107 Rename as...
3108 (symbols_save): this.
3109 (reader): Adjust.
3110 * src/output.c (header_output): New.
3111 (output): Call it.
3112
2666f928
AD
31132001-12-15 Akim Demaille <akim@epita.fr>
3114
3115 * src/reader.c (parse_union_decl): Instead of handling two obstack
3116 simultaneously, use one to define the `stype' muscle, and use the
3117 value of the latter to fill defines_obstack.
3118 (copy_comment): Remove.
3119 (copy_comment2): Work for a single obstack.
3120 Rename as...
3121 (copy_comment): this.
3122
428046f8
AD
31232001-12-15 Akim Demaille <akim@epita.fr>
3124
3125 * src/lex.c, src/lex.h (xgetc): No longer static.
3126 * src/reader.c (parse_union_decl): Revamp.
3127
ea52d706
AD
31282001-12-15 Akim Demaille <akim@epita.fr>
3129
3130 Still making progress in separating Bison into (i) input, (ii)
3131 process, (iii) output: now we can directly output the parser file
3132 without using table_obstack at all.
3133
3134 * src/files.c, src/files.h (table_obstack): Bye bye.
3135 (parser_file_name): New.
3136 * src/files.c (compute_output_file_names): Compute it.
3137 * src/output.c (actions_output, output_parser)
3138 (output_master_parser): To a file instead of an obstack.
3139
3f96f4dc
AD
31402001-12-15 Akim Demaille <akim@epita.fr>
3141
3142 Attach actions to rules, instead of pre-outputting them to
3143 actions_obstack.
3144
3145 * src/gram.h (rule_t): action and action_line are new members.
3146 * src/reader.c (symbol_list): Likewise.
3147 (copy_action): Save the actions within the rule.
3148 (packgram): Save them in rule_table.
3149 * src/output.c (actions_output): New.
3150 (output_parser): Use it on `%%actions'.
3151 (output_rule_data): Don't free rule_table.
3152 (output): Do it.
3153 (prepare): Don't save the `action' muscle.
3154 * src/bison.simple: s/%%action/%%actions/.
3155
51576fb3
AD
31562001-12-15 Akim Demaille <akim@epita.fr>
3157
3158 * src/reader.c (copy_action): When --yacc, don't append a `;'
3159 to the user action: let it fail if lacking.
dee049eb 3160 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 3161
2648a72d
AD
31622001-12-14 Akim Demaille <akim@epita.fr>
3163
3164 * src/lex.c (literalchar): Simply return the char you decoded, non
3165 longer mess around with obstacks and int pointers.
3166 Adjust all callers.
3167
92790e5b
AD
31682001-12-14 Akim Demaille <akim@epita.fr>
3169
3170 * src/lex.c (literalchar): Don't escape the special characters,
3171 just decode them, and keep them as char (before, eol was output as
3172 the 2 char string `\n' etc.).
3173 * src/output.c (output_rule_data): Use quotearg to output the
3174 token strings.
3175
927c1557
PE
31762001-12-13 Paul Eggert <eggert@twinsun.com>
3177
3178 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
3179 Do not infringe on the global user namespace when using C++.
3180 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
3181 All uses of `fprintf' and `stderr' changed.
3182
3183 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
3184
ed8e1f68
AD
31852001-12-13 Akim Demaille <akim@epita.fr>
3186
3187 The computation of nullable is broken: it doesn't handle empty
3188 RHS's properly.
3189
3190 * tests/torture.at (GNU AWK Grammar): New.
3191 * tests/sets.at (Nullable): New.
3192 * src/nullable.c (set_nullable): Instead of blindly looping over
3193 `ritems', loop over the rules, and then over their rhs's.
3194
3195 Work around Autotest bugs.
3196
3197 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
3198 frame, because Autotest understand lines starting with a `+' as
3199 traces from the shell. Then, they are not processed properly.
3200 Admittedly an Autotest bug, but we don't have time to wait for
3201 Autotest to catch up.
3202 * tests/regression.at (Broken Closure): Adjust to the new table
3203 frames.
3204 Move to...
3205 * tests/sets.at: here.
3206
cb581495
AD
32072001-12-13 Akim Demaille <akim@epita.fr>
3208
3209 * src/closure.c (closure): Use nrules instead of playing tricks
3210 with BITS_PER_WORD.
3211
2e729273
AD
32122001-12-13 Akim Demaille <akim@epita.fr>
3213
3214 * src/print.c (print_actions): Output the handling of `$' as the
3215 traces do: shifting the token EOF. Before EOF was treated as a
3216 nonterminal.
3217 * tests/regression.at: Adjust some tests.
3218 * src/print_graph.c (print_core): Complete the set of items via
3219 closure. The next-to-final and final states are still unsatisfying,
3220 but that's to be addressed elsewhere.
3221 No longer output the rule numbers, but do output the state number.
3222 A single loop for the shifts + gotos is enough, but picked a
3223 distinct color for each.
3224 (print_graph): Initialize and finalize closure.
3225
107f7dfb
AD
32262001-12-13 Akim Demaille <akim@epita.fr>
3227
3228 * src/reader.c (readgram): Remove dead code, an strip useless
3229 braces.
3230 (get_type): Remove, unused.
3231
9b53a24f
AD
32322001-12-12 Akim Demaille <akim@epita.fr>
3233
3234 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3235 on that of lib/error.c.
3236
dbfb6dcd
AD
32372001-12-12 Akim Demaille <akim@epita.fr>
3238
3239 Some hosts don't like `/' in includes.
3240
3241 * src/system.h: Include libgettext.h without qualifying the path.
3242 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3243 $(top_srcdir).
3244
c25fb648
MA
32452001-12-11 Marc Autret <autret_m@epita.fr>
3246
3247 * src/output.c (output_parser): Remove useless muscle.
3248
710ddc4f
MA
32492001-12-11 Marc Autret <autret_m@epita.fr>
3250
3251 * src/bison.simple: Remove #line just before %%epilogue. It
3252 is now handled in ...
3253 * src/reader.c (read_additionnal_code): Add the output of a
3254 #line for the epilogue.
3255
e83d80b8
MA
32562001-12-10 Marc Autret <autret_m@epita.fr>
3257
927c1557 3258 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3259 replace precedent remove.
3260 * src/bison.simple: Remove #line before %%prologue because
3261 %%input-line is wrong at this time.
3262
971d5158
MA
32632001-12-10 Marc Autret <autret_m@epita.fr>
3264
3265 * src/reader.c (symbols_output): Clean up.
927c1557 3266 * src/output.c (output_gram, output): Clean up.
971d5158 3267
5edafffd
AD
32682001-12-10 Akim Demaille <akim@epita.fr>
3269
3270 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3271 * src/LR0.c (set_state_table): here.
3272 * src/lalr.c (lalr): Call it.
3273
0279f8e9
AD
32742001-12-10 Akim Demaille <akim@epita.fr>
3275
3276 * src/state.h (shifts): Remove the `number' member: shifts are
3277 attached to state, hence no longer need to be labelled with a
3278 state number.
3279
190c4f5f
AD
32802001-12-10 Akim Demaille <akim@epita.fr>
3281
3282 Now that states have a complete set of members, the linked list of
3283 shifts is useless: just fill directly the state's shifts member.
3284
3285 * src/state.h (shifts): Remove the `next' member.
3286 * src/LR0.c (first_state, last_state): Remove.
3287 Adjust the callers.
3288 (augment_automaton): Don't look for the shifts that must be added
3289 a shift on EOF: it is those of the state we looked for! But now,
3290 since shifts are attached, it is no longer needed to looking
3291 merely by its id: its number.
3292
2a73b93d
AD
32932001-12-10 Akim Demaille <akim@epita.fr>
3294
3295 * src/LR0.c (augment_automaton): Better variable locality.
3296 Remove an impossible branch: if there is a state corresponding to
3297 the start symbol being shifted, then there is shift for the start
3298 symbol from the initial state.
3299
74392f6a
AD
33002001-12-10 Akim Demaille <akim@epita.fr>
3301
3302 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3303 only when appropriate: when insert_start_shifting_state' is not
3304 invoked.
3305 * tests/regression.at (Rule Line Numbers): Adjust.
3306
37c82725
AD
33072001-12-10 Akim Demaille <akim@epita.fr>
3308
3309 * src/LR0.c (augment_automaton): Now that all states have shifts,
3310 merge the two cases addition shifts to the initial state.
3311
6a164e0c
AD
33122001-12-10 Akim Demaille <akim@epita.fr>
3313
3314 * src/lalr.c (set_state_table): Move to...
3315 * src/LR0.c: here.
3316 * src/lalr.c (lalr): Don't call it...
3317 * src/LR0.c (generate_states): do it.
3318 * src/LR0.h (first_state): Remove, only the table is used.
3319
7215de24
AD
33202001-12-10 Akim Demaille <akim@epita.fr>
3321
3322 * src/LR0.h (first_shift, first_reduction): Remove.
3323 * src/lalr.c: Don't use first_shift: find shifts through the
3324 states.
3325
80e25d4d
AD
33262001-12-10 Akim Demaille <akim@epita.fr>
3327
3328 * src/LR0.c: Attach shifts to states as soon as they are
3329 computed.
3330 * src/lalr.c (set_state_table): Instead of assigning shifts to
3331 state, just assert that the mapping was properly done.
3332
0ab3728b
AD
33332001-12-10 Akim Demaille <akim@epita.fr>
3334
3335 * src/LR0.c (insert_start_shift): Rename as...
3336 (insert_start_shifting_state): this.
3337 (insert_eof_shifting_state, insert_accepting_state): New.
3338 (augment_automaton): Adjust.
3339 Better locality of the variables.
3340 When looking if the start_symbol is shifted from the initial
3341 state, using `while (... symbol != start_symbol ...)' sounds
3342 better than `while (... symbol < start_symbol ...)': If fail
3343 to see how the order between symbols could be relevant!
3344
78af9bbc
AD
33452001-12-10 Akim Demaille <akim@epita.fr>
3346
3347 * src/getargs.h: Don't declare `spec_name_prefix' and
3348 `spec_file_prefix', declared by src/files.h.
3349 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3350 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3351 * src/output.c (prepare): Adjust.
3352 * src/reader.c (symbols_output): Likewise.
3353 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3354
bdef2a41
AD
33552001-12-10 Akim Demaille <akim@epita.fr>
3356
3357 * src/muscle_tab.c (muscle_init): NULL is a better default than
3358 `"0"'.
3359
3735969c
AD
33602001-12-10 Akim Demaille <akim@epita.fr>
3361
3362 * src/reader.c (reader): Calling symbols_output once is enough.
3363
49701457
AD
33642001-12-10 Akim Demaille <akim@epita.fr>
3365
3366 Now that states have a complete set of members, the linked list of
3367 reductions is useless: just fill directly the state's reductions
3368 member.
3369
3370 * src/state.h (struct reductions): Remove member `number' and
3371 `next'.
3372 * src/LR0.c (first_reduction, last_reduction): Remove.
3373 (save_reductions): Don't link the new reductions, store them in
3374 this_state.
3375 * src/lalr.c (set_state_table): No need to attach reductions to
3376 states, it's already done.
3377 * src/output.c (output_actions): No longer free the shifts, then
3378 the reductions, then the states: free all the states and their
3379 members.
3380
0edad749
AD
33812001-12-10 Akim Demaille <akim@epita.fr>
3382
3383 * src/options.c (OPTN, DRTV, BOTH): New.
3384 (option_table): Use them.
3385
0edad749
AD
3386 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3387 the job of system.h.
3388 * src/options.c: Don't include stdio.h and xalloc.h for the same
3389 reasons.
3390
5449dd0f
AD
33912001-12-10 Akim Demaille <akim@epita.fr>
3392
3393 * src/output.c (output, prepare): Make sure the values of the
3394 muscles `action' and `prologue' are 0-terminated.
3395
a870c567
AD
33962001-12-10 Akim Demaille <akim@epita.fr>
3397
3398 Clean up GCC warnings.
3399
3400 * src/reader.c (copy_action): `buf' is not used.
3401 (parse_skel_decl): Be static.
3402 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3403 * src/options.h (create_long_option_table): Have a real prototype.
3404 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3405 (hash_delete_at): Return const void *.
3406 Adjust casts to preserve the const.
3407
80df8768
AD
34082001-12-10 Akim Demaille <akim@epita.fr>
3409
3410 * configure.in: Require 2.52g.
3411 M4 is not needed, but AUTOM4TE is.
3412 * m4/m4.m4: Remove.
3413 * tests/Makefile.am: Adjust.
3414
f693ad14
AD
34152001-12-10 Akim Demaille <akim@epita.fr>
3416
3417 One structure for states is enough, even though theoretically
3418 there are LR(0) states and LALR(1) states.
3419
3420 * src/lalr.h (state_t): Remove.
3421 (state_table): Be state_t **, not state_t *.
3422 * src/state.h (core, CORE_ALLOC): Rename as...
3423 (state_t, STATE_ALLOC): this.
3424 Add the LALR(1) members: shifts, reductions, errs.
3425 * src/LR0.c (state_table): Rename as...
3426 (state_hash): this, to avoid name clashes with the global
3427 `state_table'.
3428 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3429 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3430
74ffbcb6
AD
34312001-12-10 Akim Demaille <akim@epita.fr>
3432
3433 Bison dumps core on bash.y.
3434 Reported by Pascal Bart.
3435
3436 * src/warshall.c (bitmatrix_print): New.
3437 (TC): Use it.
3438 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3439 j must be the outer loop.
3440 * tests/regression.at (Broken Closure): New.
3441
07708e19
AD
34422001-12-05 Akim Demaille <akim@epita.fr>
3443
3444 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3445 its argument.
3446