]> git.saurik.com Git - bison.git/blame - ChangeLog
ChangeLog fixes, and PO regen.
[bison.git] / ChangeLog
CommitLineData
3db472b9
AD
12001-12-27 Akim Demaille <akim@epita.fr>
2
3 * src/output.c (output_gram): Rely on nritems, not the
4 0-sentinel. See below.
5 Use -1 as separator, not 0.
6 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
7 Rely on -1 as separator in yyrhs, instead of 0.
8 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
9 twice `Now at end of input', therefore there are two lines less to
10 expect.
11
b365aa05
AD
122001-12-27 Akim Demaille <akim@epita.fr>
13
14 * tests/regression.at (Unresolved SR Conflicts):
15 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
16 below.
17
30171f79
AD
182001-12-27 Akim Demaille <akim@epita.fr>
19
20 * src/LR0.c (new_state): Recognize the final state by the fact it
21 is reached by eoftoken.
22 (insert_start_shifting_state, insert_eof_shifting_state)
23 (insert_accepting_state, augment_automaton): Remove, since now
24 these states are automatically computed from the initial state.
25 (generate_states): Adjust.
26 * src/print.c: When reporting a rule number to the user, substract
27 1, so that the axiom rule is rule 0, and the first user rule is 1.
28 * src/reduce.c: Likewise.
29 * src/print_graph.c (print_core): For the time being, just as for
30 the report, depend upon --trace-flags to dump the full set of
31 items.
32 * src/reader.c (readgram): Once the grammar read, insert the rule
33 0: `$axiom: START-SYMBOL $'.
34 * tests/set.at: Adjust: rule 0 is now displayed, and since the
35 number of the states has changed (the final state is no longer
36 necessarily the last), catch up.
37
75142d45
AD
382001-12-27 Akim Demaille <akim@epita.fr>
39
40 Try to make the use of the eoftoken valid. Given that its value
41 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
42 is used instead of > 0 where appropriate, (ii), depend upon nritems
43 instead of the 0-sentinel.
44
45 * src/gram.h, src/gram.c (nritems): New.
46 Expected to be duplication of nitems, but for the time being...
47 * src/reader.c (packgram): Assert nritems and nitems are equal.
48 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
49 * src/closure.c (print_closure, print_fderives): Likewise.
50 * src/gram.c (ritem_print): Likewise.
51 * src/print.c (print_core, print_grammar): Likewise.
52 * src/print_graph.c: Likewise.
53
b7c49edf
AD
542001-12-27 Akim Demaille <akim@epita.fr>
55
56 * src/main.c (main): If there are complains after grammar
57 reductions, then output the report anyway if requested, then die.
58 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
59 * src/reader.c (eoftoken): New.
60 (parse_token_decl): If the token being defined has value `0', it
61 is the eoftoken.
62 (packsymbols): No longer hack `tags' to insert `$' by hand.
63 Be sure to preserve the value of the eoftoken.
64 (reader): Make sure eoftoken is defined.
65 Initialize nsyms to 0: now eoftoken is created just like the others.
66 * src/print.c (print_grammar): Don't special case the eof token.
67 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
68 lie anyway, albeit pleasant.
69 * tests/calc.at: Exercise error messages with eoftoken.
70 Change the grammar so that empty input is invalid.
71 Adjust expectations.
72 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
73
ec2da99f
AD
742001-12-27 Akim Demaille <akim@epita.fr>
75
76 * configure.in: Check the protos of strchr ans strspn.
77 Replace strchr if needed.
78 * src/system.h: Provide the protos of strchr, strspn and memchr if
79 missing.
80 * lib/strchr.c: New.
81 * src/reader.c (symbols_save): Use strchr.
82
8adfa272
AD
832001-12-27 Akim Demaille <akim@epita.fr>
84
85 * src/print.c, src/print_graph.c (escape): New.
86 Use it to quote the TAGS outputs.
87 * src/print_graph.c (print_state): Now errors are in red, and
88 reductions in green.
89 Prefer high to wide: output the state number on a line of its own.
90
80dac38c
AD
912001-12-27 Akim Demaille <akim@epita.fr>
92
93 * src/state.h, src/state.c (reductions_new): New.
94 * src/LR0.c (set_state_table): Let all the states have a
95 `reductions', even if reduced to 0.
96 (save_reductions): Adjust.
97 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
98 * src/print.c (print_reductions, print_actions): Adjust.
99 * src/output.c (action_row): Adjust.
100
2cec70b9
AD
1012001-12-27 Akim Demaille <akim@epita.fr>
102
103 * src/state.h, src/state.c (errs_new, errs_dup): New.
104 * src/LR0.c (set_state_table): Let all the states have an errs,
105 even if reduced to 0.
106 * src/print.c (print_errs, print_reductions): Adjust.
107 * src/output.c (output_actions, action_row): Adjust.
108 * src/conflicts.c (resolve_sr_conflict): Adjust.
109
13ca549a
AD
1102001-12-27 Akim Demaille <akim@epita.fr>
111
112 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
113
5092aba5
AD
1142001-12-27 Akim Demaille <akim@epita.fr>
115
116 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
117 * src/print.c: here.
118 (lookaheadset, shiftset): New, used as additional storage by
119 print_reductions.
120 (print_results): Adjust.
121 (print_shifts, print_gotos, print_errs): New, extracted from...
122 (print_actions): here.
123 * src/print_graph.c (print_actions): Remove dead code.
124
11e2beca
AD
1252001-12-27 Akim Demaille <akim@epita.fr>
126
127 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
128 `$n' and `@n'.
129
dac3c910
AD
1302001-12-27 Akim Demaille <akim@epita.fr>
131
132 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
133 (build_relations): Adjust.
134
d0b0fefa
AD
1352001-12-27 Akim Demaille <akim@epita.fr>
136
137 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
138 duplication.
139
adc8c848
AD
1402001-12-27 Akim Demaille <akim@epita.fr>
141
142 * src/reader.c (packgram): Catch nitems overflows.
143
14d293ac
AD
1442001-12-27 Akim Demaille <akim@epita.fr>
145
146 * src/files.c, src/files.h (guard_obstack): Remove.
147 * src/output.c (output): Adjust.
148 * src/reader.c (parse_braces): New, factoring...
149 (copy_action, copy_guard): these two which are renamed as...
150 (parse_action, parse_guard): these.
151 As a voluntary consequence, using braces around guards is now
152 mandatory.
153
f499b062
AD
1542001-12-27 Akim Demaille <akim@epita.fr>
155
156 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
157 * src/reader.c (symbol_list): `guard' and `guard_line' are new
158 members.
159 (symbol_list_new): Adjust.
160 (copy_action): action_line is the first line, not the last.
161 (copy_guard): Just as for actions, store the `action' only, not
162 the switch/case/break flesh.
163 Don't parse the user action that might follow the guard, let...
164 (readgram): do it, i.e., now, there can be an action after a
165 guard.
166 In other words the guard is just explicitly optional.
167 (packgram): Adjust.
168 * src/output.c (guards_output): New.
169 (output_parser): Call it when needed.
170 (output): Also free the guard and attrs obstacks.
171 * src/files.c, src/files.h (obstack_save): Remove.
172 (output_files): Remove.
173 As a result, if one needs the former `.act' file, using an
174 appropriate skeleton which requires actions and guards is now
175 required.
176 * src/main.c (main): Adjust.
177 * tests/semantic.at: New.
178 * tests/regression.at: Use `input.y' as input file name.
179 Avoid 8+3 problems by requiring input.c when the test needs the
180 parser.
181
d945f5cd
AD
1822001-12-27 Akim Demaille <akim@epita.fr>
183
184 * src/reader.c (symbol_list_new): Be sure to initialize all the
185 fields.
186
d200e455
AD
1872001-12-27 Akim Demaille <akim@epita.fr>
188
189 All the hacks using a final pseudo state are now useless.
190
191 * src/LR0.c (set_state_table): state_table holds exactly nstates.
192 * src/lalr.c (nLA): New.
193 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
194 instead of lookaheadsp from the pseudo state (nstate + 1).
195
f9507c28
AD
1962001-12-27 Akim Demaille <akim@epita.fr>
197
198 * src/output.c (action_row, token_actions): Use a state_t instead
199 of a integer, and nlookaheads instead of the following state's
200 lookaheadsp.
201
065fbd27
AD
2022001-12-27 Akim Demaille <akim@epita.fr>
203
204 * src/conflicts.c (log_resolution, flush_shift)
205 (resolve_sr_conflict, set_conflicts, solve_conflicts)
206 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
207 (conflicts_print, print_reductions): Use a state_t instead of an
208 integer when referring to a state.
209 As much as possible, depend upon nlookaheads, instead of the
210 `lookaheadsp' member of the following state (since lookaheads of
211 successive states are successive, the difference between state n + 1
212 and n served as the number of lookaheads for state n).
213 * src/lalr.c (add_lookback_edge): Likewise.
214 * src/print.c (print_core, print_actions, print_state)
215 (print_results): Likewise.
216 * src/print_graph.c (print_core, print_actions, print_state)
217 (print_graph): Likewise.
218 * src/conflicts.h: Adjust.
219
1b177bd7
AD
2202001-12-27 Akim Demaille <akim@epita.fr>
221
222 * src/bison.hairy: Formatting/comment changes.
223 ANSIfy.
224 Remove `register' indications.
225 Add plenty of `static'.
226
7742ddeb
AD
2272001-12-27 Akim Demaille <akim@epita.fr>
228
229 * src/output.c (prepare): Drop the muscle `ntbase' which
230 duplicates ntokens.
231 * src/bison.simple: Formatting/comment changes.
232 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
233 is an undocumented synonym.
234
1fa14068
AD
2352001-12-22 Akim Demaille <akim@epita.fr>
236
237 * src/output.c (output_table_data): Change the prototype to use
238 `int' for array ranges: some invocations do pass an int, not a
239 short.
240 Reported by Wayne Green.
241
b9752825
AD
2422001-12-22 Akim Demaille <akim@epita.fr>
243
244 Some actions of web2c.y are improperly triggered.
245 Reported by Mike Castle.
246
247 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
248 * tests/regression.at (Web2c): Rename as...
249 (Web2c Report): this.
250 (Web2c Actions): New.
251
776209d6
AD
2522001-12-22 Akim Demaille <akim@epita.fr>
253
254 Reductions in web2c.y are improperly reported.
255 Reported by Mike Castle.
256
257 * src/conflicts.c (print_reductions): Fix.
258 * tests/regression.at (Web2c): New.
259
275fc3ad
AD
2602001-12-18 Akim Demaille <akim@epita.fr>
261
262 Some host fail on `assert (!"foo")', which expands to
263 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
264 Reported by Nelson Beebee.
265
266 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
267 `#define it_succeeded 0' and `assert (it_succeeded)'.
268
897668ee
MA
2692001-12-17 Marc Autret <autret_m@epita.fr>
270
271 * src/bison.simple: Don't hard code the skeleton line and filename.
272 * src/output.c (output_parser): Rename 'line' as 'output_line'.
273 New line counter 'skeleton_line' (skeleton-line muscle).
274
ab3399e0
PE
2752001-12-17 Paul Eggert <eggert@twinsun.com>
276
277 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
278 YYDEBUG must be defined to a nonzero value.
279
280 * src/bison.simple (yytname): Do not assume that the user defines
281 YYDEBUG to a properly parenthesized expression.
282
3877f72b
AD
2832001-12-17 Akim Demaille <akim@epita.fr>
284
285 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
286 nlookaheads is a new member.
287 Adjust all users.
288 * src/lalr.h (nlookaheads): Remove this orphan declaration.
289 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
290 state.
776209d6 291
331dbc1b
AD
2922001-12-17 Akim Demaille <akim@epita.fr>
293
294 * src/files.h, src/files.c (open_files, close_files): Remove.
295 * src/main.c (main): Don't open/close files, nor invoke lex_free,
296 let...
297 * src/reader.c (reader): Do it.
776209d6 298
be750e4c
AD
2992001-12-17 Akim Demaille <akim@epita.fr>
300
301 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 302
709ae8c6
AD
3032001-12-17 Akim Demaille <akim@epita.fr>
304
305 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
306 (flush_reduce): New.
307 (resolve_sr_conflict): Adjust.
776209d6 308
f87685c3
AD
3092001-12-17 Akim Demaille <akim@epita.fr>
310
311 * src/output.c (output_obstack): Be static and rename as...
312 (format_obstack): this, to avoid any confusion with files.c's
313 output_obstack.
314 * src/reader.h (muscle_obstack): Move to...
315 * src/output.h: here, since it's defined in output.c.
316
837491d8
AD
3172001-12-17 Akim Demaille <akim@epita.fr>
318
319 * src/output.c (action_row, save_column, default_goto)
320 (sort_actions, matching_state, pack_vector): Better variable
321 locality.
322
796d61fb
AD
3232001-12-17 Akim Demaille <akim@epita.fr>
324
325 * src/output.c: Various formatting changes.
776209d6 326
64d15509
AD
3272001-12-17 Akim Demaille <akim@epita.fr>
328
329 * src/files.c (output_files): Free the output_obstack.
330 * src/main.c (main): Call print and print_graph conditionally.
331 * src/print.c (print): Work unconditionally.
332 * src/print_graph.c (print_graph): Work unconditionally.
333 * src/conflicts.c (log_resolution): Output only if verbose_flag.
334
fbc8ecb7
MA
3352001-12-16 Marc Autret <autret_m@epita.fr>
336
337 * src/output.c (actions_output): Fix. When we use %no-lines,
338 there is one less line per action.
339
f0440388
MA
3402001-12-16 Marc Autret <autret_m@epita.fr>
341
342 * src/bison.simple: Remove a useless #line directive.
343 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
344 * src/output.c (get_lines_number): New.
776209d6 345 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
346 output muscles.
347 Fix line numbering.
348 (actions_output): Computes the number of lines taken by actions.
349 (output_master_parser): Insert new skeleton which is the name of
350 the output parser file name.
351
a79986b8
MA
3522001-12-15 Marc Autret <autret_m@epita.fr>
353
354 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
355
4ec8e00f
MA
3562001-12-15 Marc Autret <autret_m@epita.fr>
357
358 * src/output.c (output_gram): Keep track of the hairy one.
359
1a4648ff
AD
3602001-12-15 Akim Demaille <akim@epita.fr>
361
362 Make `make distcheck' work.
363
364 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
365 system.h which uses libgettext.h.
366
9c2c67e6
AD
3672001-12-15 Akim Demaille <akim@epita.fr>
368
369 * src/nullable.c (set_nullable): Useless rules must be skipped,
370 otherwise, since we range over their symbols, we might look at a
371 nonterminal which no longer ``exists'', i.e., it is not counted in
372 `nvars', hence we overflow our arrays.
373
93ede233
AD
3742001-12-15 Akim Demaille <akim@epita.fr>
375
376 The header can also be produced directly, without any obstack!
377 Yahoo!
378
379 * src/files.c, src/files.h (defines_obstack): Remove.
380 (compute_header_macro): Global.
381 (defines_obstack_save): Remove.
382 * src/reader.c (parse_union_decl): No longer output to
383 defines_obstack: its content can be found in the `stype' muscle
384 anyway.
385 (output_token_translations): Merge into...
386 (symbols_output): this.
387 Rename as...
388 (symbols_save): this.
389 (reader): Adjust.
390 * src/output.c (header_output): New.
391 (output): Call it.
392
2666f928
AD
3932001-12-15 Akim Demaille <akim@epita.fr>
394
395 * src/reader.c (parse_union_decl): Instead of handling two obstack
396 simultaneously, use one to define the `stype' muscle, and use the
397 value of the latter to fill defines_obstack.
398 (copy_comment): Remove.
399 (copy_comment2): Work for a single obstack.
400 Rename as...
401 (copy_comment): this.
402
428046f8
AD
4032001-12-15 Akim Demaille <akim@epita.fr>
404
405 * src/lex.c, src/lex.h (xgetc): No longer static.
406 * src/reader.c (parse_union_decl): Revamp.
407
ea52d706
AD
4082001-12-15 Akim Demaille <akim@epita.fr>
409
410 Still making progress in separating Bison into (i) input, (ii)
411 process, (iii) output: now we can directly output the parser file
412 without using table_obstack at all.
413
414 * src/files.c, src/files.h (table_obstack): Bye bye.
415 (parser_file_name): New.
416 * src/files.c (compute_output_file_names): Compute it.
417 * src/output.c (actions_output, output_parser)
418 (output_master_parser): To a file instead of an obstack.
419
3f96f4dc
AD
4202001-12-15 Akim Demaille <akim@epita.fr>
421
422 Attach actions to rules, instead of pre-outputting them to
423 actions_obstack.
424
425 * src/gram.h (rule_t): action and action_line are new members.
426 * src/reader.c (symbol_list): Likewise.
427 (copy_action): Save the actions within the rule.
428 (packgram): Save them in rule_table.
429 * src/output.c (actions_output): New.
430 (output_parser): Use it on `%%actions'.
431 (output_rule_data): Don't free rule_table.
432 (output): Do it.
433 (prepare): Don't save the `action' muscle.
434 * src/bison.simple: s/%%action/%%actions/.
435
51576fb3
AD
4362001-12-15 Akim Demaille <akim@epita.fr>
437
438 * src/reader.c (copy_action): When --yacc, don't append a `;'
439 to the user action: let it fail if lacking.
dee049eb 440 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 441
2648a72d
AD
4422001-12-14 Akim Demaille <akim@epita.fr>
443
444 * src/lex.c (literalchar): Simply return the char you decoded, non
445 longer mess around with obstacks and int pointers.
446 Adjust all callers.
447
92790e5b
AD
4482001-12-14 Akim Demaille <akim@epita.fr>
449
450 * src/lex.c (literalchar): Don't escape the special characters,
451 just decode them, and keep them as char (before, eol was output as
452 the 2 char string `\n' etc.).
453 * src/output.c (output_rule_data): Use quotearg to output the
454 token strings.
455
927c1557
PE
4562001-12-13 Paul Eggert <eggert@twinsun.com>
457
458 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
459 Do not infringe on the global user namespace when using C++.
460 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
461 All uses of `fprintf' and `stderr' changed.
462
463 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
464
ed8e1f68
AD
4652001-12-13 Akim Demaille <akim@epita.fr>
466
467 The computation of nullable is broken: it doesn't handle empty
468 RHS's properly.
469
470 * tests/torture.at (GNU AWK Grammar): New.
471 * tests/sets.at (Nullable): New.
472 * src/nullable.c (set_nullable): Instead of blindly looping over
473 `ritems', loop over the rules, and then over their rhs's.
474
475 Work around Autotest bugs.
476
477 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
478 frame, because Autotest understand lines starting with a `+' as
479 traces from the shell. Then, they are not processed properly.
480 Admittedly an Autotest bug, but we don't have time to wait for
481 Autotest to catch up.
482 * tests/regression.at (Broken Closure): Adjust to the new table
483 frames.
484 Move to...
485 * tests/sets.at: here.
486
cb581495
AD
4872001-12-13 Akim Demaille <akim@epita.fr>
488
489 * src/closure.c (closure): Use nrules instead of playing tricks
490 with BITS_PER_WORD.
491
2e729273
AD
4922001-12-13 Akim Demaille <akim@epita.fr>
493
494 * src/print.c (print_actions): Output the handling of `$' as the
495 traces do: shifting the token EOF. Before EOF was treated as a
496 nonterminal.
497 * tests/regression.at: Adjust some tests.
498 * src/print_graph.c (print_core): Complete the set of items via
499 closure. The next-to-final and final states are still unsatisfying,
500 but that's to be addressed elsewhere.
501 No longer output the rule numbers, but do output the state number.
502 A single loop for the shifts + gotos is enough, but picked a
503 distinct color for each.
504 (print_graph): Initialize and finalize closure.
505
107f7dfb
AD
5062001-12-13 Akim Demaille <akim@epita.fr>
507
508 * src/reader.c (readgram): Remove dead code, an strip useless
509 braces.
510 (get_type): Remove, unused.
511
9b53a24f
AD
5122001-12-12 Akim Demaille <akim@epita.fr>
513
514 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
515 on that of lib/error.c.
516
dbfb6dcd
AD
5172001-12-12 Akim Demaille <akim@epita.fr>
518
519 Some hosts don't like `/' in includes.
520
521 * src/system.h: Include libgettext.h without qualifying the path.
522 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
523 $(top_srcdir).
524
c25fb648
MA
5252001-12-11 Marc Autret <autret_m@epita.fr>
526
527 * src/output.c (output_parser): Remove useless muscle.
528
710ddc4f
MA
5292001-12-11 Marc Autret <autret_m@epita.fr>
530
531 * src/bison.simple: Remove #line just before %%epilogue. It
532 is now handled in ...
533 * src/reader.c (read_additionnal_code): Add the output of a
534 #line for the epilogue.
535
e83d80b8
MA
5362001-12-10 Marc Autret <autret_m@epita.fr>
537
927c1557 538 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
539 replace precedent remove.
540 * src/bison.simple: Remove #line before %%prologue because
541 %%input-line is wrong at this time.
542
971d5158
MA
5432001-12-10 Marc Autret <autret_m@epita.fr>
544
545 * src/reader.c (symbols_output): Clean up.
927c1557 546 * src/output.c (output_gram, output): Clean up.
971d5158 547
5edafffd
AD
5482001-12-10 Akim Demaille <akim@epita.fr>
549
550 * src/lalr.c (initialize_lookaheads): New. Extracted from...
551 * src/LR0.c (set_state_table): here.
552 * src/lalr.c (lalr): Call it.
553
0279f8e9
AD
5542001-12-10 Akim Demaille <akim@epita.fr>
555
556 * src/state.h (shifts): Remove the `number' member: shifts are
557 attached to state, hence no longer need to be labelled with a
558 state number.
559
190c4f5f
AD
5602001-12-10 Akim Demaille <akim@epita.fr>
561
562 Now that states have a complete set of members, the linked list of
563 shifts is useless: just fill directly the state's shifts member.
564
565 * src/state.h (shifts): Remove the `next' member.
566 * src/LR0.c (first_state, last_state): Remove.
567 Adjust the callers.
568 (augment_automaton): Don't look for the shifts that must be added
569 a shift on EOF: it is those of the state we looked for! But now,
570 since shifts are attached, it is no longer needed to looking
571 merely by its id: its number.
572
2a73b93d
AD
5732001-12-10 Akim Demaille <akim@epita.fr>
574
575 * src/LR0.c (augment_automaton): Better variable locality.
576 Remove an impossible branch: if there is a state corresponding to
577 the start symbol being shifted, then there is shift for the start
578 symbol from the initial state.
579
74392f6a
AD
5802001-12-10 Akim Demaille <akim@epita.fr>
581
582 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
583 only when appropriate: when insert_start_shifting_state' is not
584 invoked.
585 * tests/regression.at (Rule Line Numbers): Adjust.
586
37c82725
AD
5872001-12-10 Akim Demaille <akim@epita.fr>
588
589 * src/LR0.c (augment_automaton): Now that all states have shifts,
590 merge the two cases addition shifts to the initial state.
591
6a164e0c
AD
5922001-12-10 Akim Demaille <akim@epita.fr>
593
594 * src/lalr.c (set_state_table): Move to...
595 * src/LR0.c: here.
596 * src/lalr.c (lalr): Don't call it...
597 * src/LR0.c (generate_states): do it.
598 * src/LR0.h (first_state): Remove, only the table is used.
599
7215de24
AD
6002001-12-10 Akim Demaille <akim@epita.fr>
601
602 * src/LR0.h (first_shift, first_reduction): Remove.
603 * src/lalr.c: Don't use first_shift: find shifts through the
604 states.
605
80e25d4d
AD
6062001-12-10 Akim Demaille <akim@epita.fr>
607
608 * src/LR0.c: Attach shifts to states as soon as they are
609 computed.
610 * src/lalr.c (set_state_table): Instead of assigning shifts to
611 state, just assert that the mapping was properly done.
612
0ab3728b
AD
6132001-12-10 Akim Demaille <akim@epita.fr>
614
615 * src/LR0.c (insert_start_shift): Rename as...
616 (insert_start_shifting_state): this.
617 (insert_eof_shifting_state, insert_accepting_state): New.
618 (augment_automaton): Adjust.
619 Better locality of the variables.
620 When looking if the start_symbol is shifted from the initial
621 state, using `while (... symbol != start_symbol ...)' sounds
622 better than `while (... symbol < start_symbol ...)': If fail
623 to see how the order between symbols could be relevant!
624
78af9bbc
AD
6252001-12-10 Akim Demaille <akim@epita.fr>
626
627 * src/getargs.h: Don't declare `spec_name_prefix' and
628 `spec_file_prefix', declared by src/files.h.
629 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
630 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
631 * src/output.c (prepare): Adjust.
632 * src/reader.c (symbols_output): Likewise.
633 * src/vmsgetargs.c: Vaguely adjust, but who cares?
634
bdef2a41
AD
6352001-12-10 Akim Demaille <akim@epita.fr>
636
637 * src/muscle_tab.c (muscle_init): NULL is a better default than
638 `"0"'.
639
3735969c
AD
6402001-12-10 Akim Demaille <akim@epita.fr>
641
642 * src/reader.c (reader): Calling symbols_output once is enough.
643
49701457
AD
6442001-12-10 Akim Demaille <akim@epita.fr>
645
646 Now that states have a complete set of members, the linked list of
647 reductions is useless: just fill directly the state's reductions
648 member.
649
650 * src/state.h (struct reductions): Remove member `number' and
651 `next'.
652 * src/LR0.c (first_reduction, last_reduction): Remove.
653 (save_reductions): Don't link the new reductions, store them in
654 this_state.
655 * src/lalr.c (set_state_table): No need to attach reductions to
656 states, it's already done.
657 * src/output.c (output_actions): No longer free the shifts, then
658 the reductions, then the states: free all the states and their
659 members.
660
0edad749
AD
6612001-12-10 Akim Demaille <akim@epita.fr>
662
663 * src/options.c (OPTN, DRTV, BOTH): New.
664 (option_table): Use them.
665
0edad749
AD
666 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
667 the job of system.h.
668 * src/options.c: Don't include stdio.h and xalloc.h for the same
669 reasons.
670
5449dd0f
AD
6712001-12-10 Akim Demaille <akim@epita.fr>
672
673 * src/output.c (output, prepare): Make sure the values of the
674 muscles `action' and `prologue' are 0-terminated.
675
a870c567
AD
6762001-12-10 Akim Demaille <akim@epita.fr>
677
678 Clean up GCC warnings.
679
680 * src/reader.c (copy_action): `buf' is not used.
681 (parse_skel_decl): Be static.
682 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
683 * src/options.h (create_long_option_table): Have a real prototype.
684 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
685 (hash_delete_at): Return const void *.
686 Adjust casts to preserve the const.
687
80df8768
AD
6882001-12-10 Akim Demaille <akim@epita.fr>
689
690 * configure.in: Require 2.52g.
691 M4 is not needed, but AUTOM4TE is.
692 * m4/m4.m4: Remove.
693 * tests/Makefile.am: Adjust.
694
f693ad14
AD
6952001-12-10 Akim Demaille <akim@epita.fr>
696
697 One structure for states is enough, even though theoretically
698 there are LR(0) states and LALR(1) states.
699
700 * src/lalr.h (state_t): Remove.
701 (state_table): Be state_t **, not state_t *.
702 * src/state.h (core, CORE_ALLOC): Rename as...
703 (state_t, STATE_ALLOC): this.
704 Add the LALR(1) members: shifts, reductions, errs.
705 * src/LR0.c (state_table): Rename as...
706 (state_hash): this, to avoid name clashes with the global
707 `state_table'.
708 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
709 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
710
74ffbcb6
AD
7112001-12-10 Akim Demaille <akim@epita.fr>
712
713 Bison dumps core on bash.y.
714 Reported by Pascal Bart.
715
716 * src/warshall.c (bitmatrix_print): New.
717 (TC): Use it.
718 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
719 j must be the outer loop.
720 * tests/regression.at (Broken Closure): New.
721
07708e19
AD
7222001-12-05 Akim Demaille <akim@epita.fr>
723
724 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
725 its argument.
726