]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/reader.c (readgram): Don't add the rule 0 if there were no
[bison.git] / ChangeLog
CommitLineData
b68e7744
AD
12001-12-29 Akim Demaille <akim@epita.fr>
2
3 * src/reader.c (readgram): Don't add the rule 0 if there were no
4 rules read. In other words, add it _after_ having performed
5 grammar sanity checks.
6 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
7
8
78d5bae9
AD
92001-12-29 Akim Demaille <akim@epita.fr>
10
11 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
12 visible, and some states have now a different number.
13
14
ff442794
AD
152001-12-29 Akim Demaille <akim@epita.fr>
16
17 * src/reader.c (readgram): Bind the initial rule's lineno to that
18 of the first rule.
19 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
20 (Solved SR Conflicts): Adjust rule 0's line number.
21
22
610ab194
AD
232001-12-29 Akim Demaille <akim@epita.fr>
24
25 Fix the `GAWK Grammar' failure.
26
27 * src/LR0.c (final_state): Initialize to -1 so that we do compute
28 the reductions of the first state which was mistakenly confused
29 with the final state because precisely final_state was initialized
30 to 0.
31 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
32 now noticed by Bison.
33 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
34 have a reduction on $default.
35
36
29d29c8f
AD
372001-12-29 Akim Demaille <akim@epita.fr>
38
39 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
40 rule line numbers.
41 * src/closure.c (print_closure): Likewise.
42 * src/derives.c (print_derives): Likewise.
43 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
44 now.
45
7c6b64d0
AD
462001-12-29 Akim Demaille <akim@epita.fr>
47
48 * src/lalr.c (lookaheads_print): New.
49 (lalr): Call it when --trace-flag.
50 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
51 are dumped.
52
53
3d4daee3
AD
542001-12-29 Akim Demaille <akim@epita.fr>
55
56 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
57 when walking through ritem, even via rule->rhs.
58 * src/reduce.c (dump_grammar, useful_production, reduce_output)
59 (useful_production, useless_nonterminals): Likewise.
60 (reduce_grammar_tables): Likewise, plus update nritems.
61 * src/nullable.c (set_nullable): Likewise.
62 * src/lalr.c (build_relations): Likewise.
63 * tests/sets.at (Nullable): Adjust.
64 Fortunately, now, the $axiom is no longer nullable.
65
66
9e7f6bbd
AD
672001-12-29 Akim Demaille <akim@epita.fr>
68
69 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
70 the 0-sentinel.
71 * src/gram.c (ritem_longest_rhs): Likewise.
72 * src/reduce.c (nonterminals_reduce): Likewise.
73 * src/print_graph.c (print_graph): Likewise.
74 * src/output.c (output_rule_data): Likewise.
75 * src/nullable.c (set_nullable): Likewise.
76
255ef638
AD
772001-12-29 Akim Demaille <akim@epita.fr>
78
79 * src/output.c: Comment changes.
80
0d8a7363
AD
812001-12-27 Paul Eggert <eggert@twinsun.com>
82
83 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
84 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
85 Sparc, as they were causing more porting problems than the
86 (minor) performance improvement was worth.
87
88 Also, catch up with 1.31's YYSTD.
89
3db472b9
AD
902001-12-27 Akim Demaille <akim@epita.fr>
91
92 * src/output.c (output_gram): Rely on nritems, not the
93 0-sentinel. See below.
94 Use -1 as separator, not 0.
95 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
96 Rely on -1 as separator in yyrhs, instead of 0.
97 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
98 twice `Now at end of input', therefore there are two lines less to
99 expect.
100
b365aa05
AD
1012001-12-27 Akim Demaille <akim@epita.fr>
102
103 * tests/regression.at (Unresolved SR Conflicts):
104 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
105 below.
106
30171f79
AD
1072001-12-27 Akim Demaille <akim@epita.fr>
108
109 * src/LR0.c (new_state): Recognize the final state by the fact it
110 is reached by eoftoken.
111 (insert_start_shifting_state, insert_eof_shifting_state)
112 (insert_accepting_state, augment_automaton): Remove, since now
113 these states are automatically computed from the initial state.
114 (generate_states): Adjust.
115 * src/print.c: When reporting a rule number to the user, substract
116 1, so that the axiom rule is rule 0, and the first user rule is 1.
117 * src/reduce.c: Likewise.
118 * src/print_graph.c (print_core): For the time being, just as for
119 the report, depend upon --trace-flags to dump the full set of
120 items.
121 * src/reader.c (readgram): Once the grammar read, insert the rule
122 0: `$axiom: START-SYMBOL $'.
123 * tests/set.at: Adjust: rule 0 is now displayed, and since the
124 number of the states has changed (the final state is no longer
125 necessarily the last), catch up.
126
75142d45
AD
1272001-12-27 Akim Demaille <akim@epita.fr>
128
129 Try to make the use of the eoftoken valid. Given that its value
130 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
131 is used instead of > 0 where appropriate, (ii), depend upon nritems
132 instead of the 0-sentinel.
133
134 * src/gram.h, src/gram.c (nritems): New.
135 Expected to be duplication of nitems, but for the time being...
136 * src/reader.c (packgram): Assert nritems and nitems are equal.
137 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
138 * src/closure.c (print_closure, print_fderives): Likewise.
139 * src/gram.c (ritem_print): Likewise.
140 * src/print.c (print_core, print_grammar): Likewise.
141 * src/print_graph.c: Likewise.
142
b7c49edf
AD
1432001-12-27 Akim Demaille <akim@epita.fr>
144
145 * src/main.c (main): If there are complains after grammar
146 reductions, then output the report anyway if requested, then die.
147 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
148 * src/reader.c (eoftoken): New.
149 (parse_token_decl): If the token being defined has value `0', it
150 is the eoftoken.
151 (packsymbols): No longer hack `tags' to insert `$' by hand.
152 Be sure to preserve the value of the eoftoken.
153 (reader): Make sure eoftoken is defined.
154 Initialize nsyms to 0: now eoftoken is created just like the others.
155 * src/print.c (print_grammar): Don't special case the eof token.
156 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
157 lie anyway, albeit pleasant.
158 * tests/calc.at: Exercise error messages with eoftoken.
159 Change the grammar so that empty input is invalid.
160 Adjust expectations.
161 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
162
ec2da99f
AD
1632001-12-27 Akim Demaille <akim@epita.fr>
164
165 * configure.in: Check the protos of strchr ans strspn.
166 Replace strchr if needed.
167 * src/system.h: Provide the protos of strchr, strspn and memchr if
168 missing.
169 * lib/strchr.c: New.
170 * src/reader.c (symbols_save): Use strchr.
171
8adfa272
AD
1722001-12-27 Akim Demaille <akim@epita.fr>
173
174 * src/print.c, src/print_graph.c (escape): New.
175 Use it to quote the TAGS outputs.
176 * src/print_graph.c (print_state): Now errors are in red, and
177 reductions in green.
178 Prefer high to wide: output the state number on a line of its own.
179
80dac38c
AD
1802001-12-27 Akim Demaille <akim@epita.fr>
181
182 * src/state.h, src/state.c (reductions_new): New.
183 * src/LR0.c (set_state_table): Let all the states have a
184 `reductions', even if reduced to 0.
185 (save_reductions): Adjust.
186 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
187 * src/print.c (print_reductions, print_actions): Adjust.
188 * src/output.c (action_row): Adjust.
189
2cec70b9
AD
1902001-12-27 Akim Demaille <akim@epita.fr>
191
192 * src/state.h, src/state.c (errs_new, errs_dup): New.
193 * src/LR0.c (set_state_table): Let all the states have an errs,
194 even if reduced to 0.
195 * src/print.c (print_errs, print_reductions): Adjust.
196 * src/output.c (output_actions, action_row): Adjust.
197 * src/conflicts.c (resolve_sr_conflict): Adjust.
198
13ca549a
AD
1992001-12-27 Akim Demaille <akim@epita.fr>
200
201 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
202
5092aba5
AD
2032001-12-27 Akim Demaille <akim@epita.fr>
204
205 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
206 * src/print.c: here.
207 (lookaheadset, shiftset): New, used as additional storage by
208 print_reductions.
209 (print_results): Adjust.
210 (print_shifts, print_gotos, print_errs): New, extracted from...
211 (print_actions): here.
212 * src/print_graph.c (print_actions): Remove dead code.
213
11e2beca
AD
2142001-12-27 Akim Demaille <akim@epita.fr>
215
216 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
217 `$n' and `@n'.
218
dac3c910
AD
2192001-12-27 Akim Demaille <akim@epita.fr>
220
221 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
222 (build_relations): Adjust.
223
d0b0fefa
AD
2242001-12-27 Akim Demaille <akim@epita.fr>
225
226 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
227 duplication.
228
adc8c848
AD
2292001-12-27 Akim Demaille <akim@epita.fr>
230
231 * src/reader.c (packgram): Catch nitems overflows.
232
14d293ac
AD
2332001-12-27 Akim Demaille <akim@epita.fr>
234
235 * src/files.c, src/files.h (guard_obstack): Remove.
236 * src/output.c (output): Adjust.
237 * src/reader.c (parse_braces): New, factoring...
238 (copy_action, copy_guard): these two which are renamed as...
239 (parse_action, parse_guard): these.
240 As a voluntary consequence, using braces around guards is now
241 mandatory.
242
f499b062
AD
2432001-12-27 Akim Demaille <akim@epita.fr>
244
245 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
246 * src/reader.c (symbol_list): `guard' and `guard_line' are new
247 members.
248 (symbol_list_new): Adjust.
249 (copy_action): action_line is the first line, not the last.
250 (copy_guard): Just as for actions, store the `action' only, not
251 the switch/case/break flesh.
252 Don't parse the user action that might follow the guard, let...
253 (readgram): do it, i.e., now, there can be an action after a
254 guard.
255 In other words the guard is just explicitly optional.
256 (packgram): Adjust.
257 * src/output.c (guards_output): New.
258 (output_parser): Call it when needed.
259 (output): Also free the guard and attrs obstacks.
260 * src/files.c, src/files.h (obstack_save): Remove.
261 (output_files): Remove.
262 As a result, if one needs the former `.act' file, using an
263 appropriate skeleton which requires actions and guards is now
264 required.
265 * src/main.c (main): Adjust.
266 * tests/semantic.at: New.
267 * tests/regression.at: Use `input.y' as input file name.
268 Avoid 8+3 problems by requiring input.c when the test needs the
269 parser.
270
d945f5cd
AD
2712001-12-27 Akim Demaille <akim@epita.fr>
272
273 * src/reader.c (symbol_list_new): Be sure to initialize all the
274 fields.
275
d200e455
AD
2762001-12-27 Akim Demaille <akim@epita.fr>
277
278 All the hacks using a final pseudo state are now useless.
279
280 * src/LR0.c (set_state_table): state_table holds exactly nstates.
281 * src/lalr.c (nLA): New.
282 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
283 instead of lookaheadsp from the pseudo state (nstate + 1).
284
f9507c28
AD
2852001-12-27 Akim Demaille <akim@epita.fr>
286
287 * src/output.c (action_row, token_actions): Use a state_t instead
288 of a integer, and nlookaheads instead of the following state's
289 lookaheadsp.
290
065fbd27
AD
2912001-12-27 Akim Demaille <akim@epita.fr>
292
293 * src/conflicts.c (log_resolution, flush_shift)
294 (resolve_sr_conflict, set_conflicts, solve_conflicts)
295 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
296 (conflicts_print, print_reductions): Use a state_t instead of an
297 integer when referring to a state.
298 As much as possible, depend upon nlookaheads, instead of the
299 `lookaheadsp' member of the following state (since lookaheads of
300 successive states are successive, the difference between state n + 1
301 and n served as the number of lookaheads for state n).
302 * src/lalr.c (add_lookback_edge): Likewise.
303 * src/print.c (print_core, print_actions, print_state)
304 (print_results): Likewise.
305 * src/print_graph.c (print_core, print_actions, print_state)
306 (print_graph): Likewise.
307 * src/conflicts.h: Adjust.
308
1b177bd7
AD
3092001-12-27 Akim Demaille <akim@epita.fr>
310
311 * src/bison.hairy: Formatting/comment changes.
312 ANSIfy.
313 Remove `register' indications.
314 Add plenty of `static'.
315
7742ddeb
AD
3162001-12-27 Akim Demaille <akim@epita.fr>
317
318 * src/output.c (prepare): Drop the muscle `ntbase' which
319 duplicates ntokens.
320 * src/bison.simple: Formatting/comment changes.
321 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
322 is an undocumented synonym.
323
1fa14068
AD
3242001-12-22 Akim Demaille <akim@epita.fr>
325
326 * src/output.c (output_table_data): Change the prototype to use
327 `int' for array ranges: some invocations do pass an int, not a
328 short.
329 Reported by Wayne Green.
330
b9752825
AD
3312001-12-22 Akim Demaille <akim@epita.fr>
332
333 Some actions of web2c.y are improperly triggered.
334 Reported by Mike Castle.
335
336 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
337 * tests/regression.at (Web2c): Rename as...
338 (Web2c Report): this.
339 (Web2c Actions): New.
340
776209d6
AD
3412001-12-22 Akim Demaille <akim@epita.fr>
342
343 Reductions in web2c.y are improperly reported.
344 Reported by Mike Castle.
345
346 * src/conflicts.c (print_reductions): Fix.
347 * tests/regression.at (Web2c): New.
348
275fc3ad
AD
3492001-12-18 Akim Demaille <akim@epita.fr>
350
351 Some host fail on `assert (!"foo")', which expands to
352 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
353 Reported by Nelson Beebee.
354
355 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
356 `#define it_succeeded 0' and `assert (it_succeeded)'.
357
897668ee
MA
3582001-12-17 Marc Autret <autret_m@epita.fr>
359
360 * src/bison.simple: Don't hard code the skeleton line and filename.
361 * src/output.c (output_parser): Rename 'line' as 'output_line'.
362 New line counter 'skeleton_line' (skeleton-line muscle).
363
ab3399e0
PE
3642001-12-17 Paul Eggert <eggert@twinsun.com>
365
366 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
367 YYDEBUG must be defined to a nonzero value.
368
369 * src/bison.simple (yytname): Do not assume that the user defines
370 YYDEBUG to a properly parenthesized expression.
371
3877f72b
AD
3722001-12-17 Akim Demaille <akim@epita.fr>
373
374 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
375 nlookaheads is a new member.
376 Adjust all users.
377 * src/lalr.h (nlookaheads): Remove this orphan declaration.
378 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
379 state.
776209d6 380
331dbc1b
AD
3812001-12-17 Akim Demaille <akim@epita.fr>
382
383 * src/files.h, src/files.c (open_files, close_files): Remove.
384 * src/main.c (main): Don't open/close files, nor invoke lex_free,
385 let...
386 * src/reader.c (reader): Do it.
776209d6 387
be750e4c
AD
3882001-12-17 Akim Demaille <akim@epita.fr>
389
390 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 391
709ae8c6
AD
3922001-12-17 Akim Demaille <akim@epita.fr>
393
394 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
395 (flush_reduce): New.
396 (resolve_sr_conflict): Adjust.
776209d6 397
f87685c3
AD
3982001-12-17 Akim Demaille <akim@epita.fr>
399
400 * src/output.c (output_obstack): Be static and rename as...
401 (format_obstack): this, to avoid any confusion with files.c's
402 output_obstack.
403 * src/reader.h (muscle_obstack): Move to...
404 * src/output.h: here, since it's defined in output.c.
405
837491d8
AD
4062001-12-17 Akim Demaille <akim@epita.fr>
407
408 * src/output.c (action_row, save_column, default_goto)
409 (sort_actions, matching_state, pack_vector): Better variable
410 locality.
411
796d61fb
AD
4122001-12-17 Akim Demaille <akim@epita.fr>
413
414 * src/output.c: Various formatting changes.
776209d6 415
64d15509
AD
4162001-12-17 Akim Demaille <akim@epita.fr>
417
418 * src/files.c (output_files): Free the output_obstack.
419 * src/main.c (main): Call print and print_graph conditionally.
420 * src/print.c (print): Work unconditionally.
421 * src/print_graph.c (print_graph): Work unconditionally.
422 * src/conflicts.c (log_resolution): Output only if verbose_flag.
423
fbc8ecb7
MA
4242001-12-16 Marc Autret <autret_m@epita.fr>
425
426 * src/output.c (actions_output): Fix. When we use %no-lines,
427 there is one less line per action.
428
f0440388
MA
4292001-12-16 Marc Autret <autret_m@epita.fr>
430
431 * src/bison.simple: Remove a useless #line directive.
432 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
433 * src/output.c (get_lines_number): New.
776209d6 434 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
435 output muscles.
436 Fix line numbering.
437 (actions_output): Computes the number of lines taken by actions.
438 (output_master_parser): Insert new skeleton which is the name of
439 the output parser file name.
440
a79986b8
MA
4412001-12-15 Marc Autret <autret_m@epita.fr>
442
443 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
444
4ec8e00f
MA
4452001-12-15 Marc Autret <autret_m@epita.fr>
446
447 * src/output.c (output_gram): Keep track of the hairy one.
448
1a4648ff
AD
4492001-12-15 Akim Demaille <akim@epita.fr>
450
451 Make `make distcheck' work.
452
453 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
454 system.h which uses libgettext.h.
455
9c2c67e6
AD
4562001-12-15 Akim Demaille <akim@epita.fr>
457
458 * src/nullable.c (set_nullable): Useless rules must be skipped,
459 otherwise, since we range over their symbols, we might look at a
460 nonterminal which no longer ``exists'', i.e., it is not counted in
461 `nvars', hence we overflow our arrays.
462
93ede233
AD
4632001-12-15 Akim Demaille <akim@epita.fr>
464
465 The header can also be produced directly, without any obstack!
466 Yahoo!
467
468 * src/files.c, src/files.h (defines_obstack): Remove.
469 (compute_header_macro): Global.
470 (defines_obstack_save): Remove.
471 * src/reader.c (parse_union_decl): No longer output to
472 defines_obstack: its content can be found in the `stype' muscle
473 anyway.
474 (output_token_translations): Merge into...
475 (symbols_output): this.
476 Rename as...
477 (symbols_save): this.
478 (reader): Adjust.
479 * src/output.c (header_output): New.
480 (output): Call it.
481
2666f928
AD
4822001-12-15 Akim Demaille <akim@epita.fr>
483
484 * src/reader.c (parse_union_decl): Instead of handling two obstack
485 simultaneously, use one to define the `stype' muscle, and use the
486 value of the latter to fill defines_obstack.
487 (copy_comment): Remove.
488 (copy_comment2): Work for a single obstack.
489 Rename as...
490 (copy_comment): this.
491
428046f8
AD
4922001-12-15 Akim Demaille <akim@epita.fr>
493
494 * src/lex.c, src/lex.h (xgetc): No longer static.
495 * src/reader.c (parse_union_decl): Revamp.
496
ea52d706
AD
4972001-12-15 Akim Demaille <akim@epita.fr>
498
499 Still making progress in separating Bison into (i) input, (ii)
500 process, (iii) output: now we can directly output the parser file
501 without using table_obstack at all.
502
503 * src/files.c, src/files.h (table_obstack): Bye bye.
504 (parser_file_name): New.
505 * src/files.c (compute_output_file_names): Compute it.
506 * src/output.c (actions_output, output_parser)
507 (output_master_parser): To a file instead of an obstack.
508
3f96f4dc
AD
5092001-12-15 Akim Demaille <akim@epita.fr>
510
511 Attach actions to rules, instead of pre-outputting them to
512 actions_obstack.
513
514 * src/gram.h (rule_t): action and action_line are new members.
515 * src/reader.c (symbol_list): Likewise.
516 (copy_action): Save the actions within the rule.
517 (packgram): Save them in rule_table.
518 * src/output.c (actions_output): New.
519 (output_parser): Use it on `%%actions'.
520 (output_rule_data): Don't free rule_table.
521 (output): Do it.
522 (prepare): Don't save the `action' muscle.
523 * src/bison.simple: s/%%action/%%actions/.
524
51576fb3
AD
5252001-12-15 Akim Demaille <akim@epita.fr>
526
527 * src/reader.c (copy_action): When --yacc, don't append a `;'
528 to the user action: let it fail if lacking.
dee049eb 529 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 530
2648a72d
AD
5312001-12-14 Akim Demaille <akim@epita.fr>
532
533 * src/lex.c (literalchar): Simply return the char you decoded, non
534 longer mess around with obstacks and int pointers.
535 Adjust all callers.
536
92790e5b
AD
5372001-12-14 Akim Demaille <akim@epita.fr>
538
539 * src/lex.c (literalchar): Don't escape the special characters,
540 just decode them, and keep them as char (before, eol was output as
541 the 2 char string `\n' etc.).
542 * src/output.c (output_rule_data): Use quotearg to output the
543 token strings.
544
927c1557
PE
5452001-12-13 Paul Eggert <eggert@twinsun.com>
546
547 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
548 Do not infringe on the global user namespace when using C++.
549 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
550 All uses of `fprintf' and `stderr' changed.
551
552 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
553
ed8e1f68
AD
5542001-12-13 Akim Demaille <akim@epita.fr>
555
556 The computation of nullable is broken: it doesn't handle empty
557 RHS's properly.
558
559 * tests/torture.at (GNU AWK Grammar): New.
560 * tests/sets.at (Nullable): New.
561 * src/nullable.c (set_nullable): Instead of blindly looping over
562 `ritems', loop over the rules, and then over their rhs's.
563
564 Work around Autotest bugs.
565
566 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
567 frame, because Autotest understand lines starting with a `+' as
568 traces from the shell. Then, they are not processed properly.
569 Admittedly an Autotest bug, but we don't have time to wait for
570 Autotest to catch up.
571 * tests/regression.at (Broken Closure): Adjust to the new table
572 frames.
573 Move to...
574 * tests/sets.at: here.
575
cb581495
AD
5762001-12-13 Akim Demaille <akim@epita.fr>
577
578 * src/closure.c (closure): Use nrules instead of playing tricks
579 with BITS_PER_WORD.
580
2e729273
AD
5812001-12-13 Akim Demaille <akim@epita.fr>
582
583 * src/print.c (print_actions): Output the handling of `$' as the
584 traces do: shifting the token EOF. Before EOF was treated as a
585 nonterminal.
586 * tests/regression.at: Adjust some tests.
587 * src/print_graph.c (print_core): Complete the set of items via
588 closure. The next-to-final and final states are still unsatisfying,
589 but that's to be addressed elsewhere.
590 No longer output the rule numbers, but do output the state number.
591 A single loop for the shifts + gotos is enough, but picked a
592 distinct color for each.
593 (print_graph): Initialize and finalize closure.
594
107f7dfb
AD
5952001-12-13 Akim Demaille <akim@epita.fr>
596
597 * src/reader.c (readgram): Remove dead code, an strip useless
598 braces.
599 (get_type): Remove, unused.
600
9b53a24f
AD
6012001-12-12 Akim Demaille <akim@epita.fr>
602
603 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
604 on that of lib/error.c.
605
dbfb6dcd
AD
6062001-12-12 Akim Demaille <akim@epita.fr>
607
608 Some hosts don't like `/' in includes.
609
610 * src/system.h: Include libgettext.h without qualifying the path.
611 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
612 $(top_srcdir).
613
c25fb648
MA
6142001-12-11 Marc Autret <autret_m@epita.fr>
615
616 * src/output.c (output_parser): Remove useless muscle.
617
710ddc4f
MA
6182001-12-11 Marc Autret <autret_m@epita.fr>
619
620 * src/bison.simple: Remove #line just before %%epilogue. It
621 is now handled in ...
622 * src/reader.c (read_additionnal_code): Add the output of a
623 #line for the epilogue.
624
e83d80b8
MA
6252001-12-10 Marc Autret <autret_m@epita.fr>
626
927c1557 627 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
628 replace precedent remove.
629 * src/bison.simple: Remove #line before %%prologue because
630 %%input-line is wrong at this time.
631
971d5158
MA
6322001-12-10 Marc Autret <autret_m@epita.fr>
633
634 * src/reader.c (symbols_output): Clean up.
927c1557 635 * src/output.c (output_gram, output): Clean up.
971d5158 636
5edafffd
AD
6372001-12-10 Akim Demaille <akim@epita.fr>
638
639 * src/lalr.c (initialize_lookaheads): New. Extracted from...
640 * src/LR0.c (set_state_table): here.
641 * src/lalr.c (lalr): Call it.
642
0279f8e9
AD
6432001-12-10 Akim Demaille <akim@epita.fr>
644
645 * src/state.h (shifts): Remove the `number' member: shifts are
646 attached to state, hence no longer need to be labelled with a
647 state number.
648
190c4f5f
AD
6492001-12-10 Akim Demaille <akim@epita.fr>
650
651 Now that states have a complete set of members, the linked list of
652 shifts is useless: just fill directly the state's shifts member.
653
654 * src/state.h (shifts): Remove the `next' member.
655 * src/LR0.c (first_state, last_state): Remove.
656 Adjust the callers.
657 (augment_automaton): Don't look for the shifts that must be added
658 a shift on EOF: it is those of the state we looked for! But now,
659 since shifts are attached, it is no longer needed to looking
660 merely by its id: its number.
661
2a73b93d
AD
6622001-12-10 Akim Demaille <akim@epita.fr>
663
664 * src/LR0.c (augment_automaton): Better variable locality.
665 Remove an impossible branch: if there is a state corresponding to
666 the start symbol being shifted, then there is shift for the start
667 symbol from the initial state.
668
74392f6a
AD
6692001-12-10 Akim Demaille <akim@epita.fr>
670
671 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
672 only when appropriate: when insert_start_shifting_state' is not
673 invoked.
674 * tests/regression.at (Rule Line Numbers): Adjust.
675
37c82725
AD
6762001-12-10 Akim Demaille <akim@epita.fr>
677
678 * src/LR0.c (augment_automaton): Now that all states have shifts,
679 merge the two cases addition shifts to the initial state.
680
6a164e0c
AD
6812001-12-10 Akim Demaille <akim@epita.fr>
682
683 * src/lalr.c (set_state_table): Move to...
684 * src/LR0.c: here.
685 * src/lalr.c (lalr): Don't call it...
686 * src/LR0.c (generate_states): do it.
687 * src/LR0.h (first_state): Remove, only the table is used.
688
7215de24
AD
6892001-12-10 Akim Demaille <akim@epita.fr>
690
691 * src/LR0.h (first_shift, first_reduction): Remove.
692 * src/lalr.c: Don't use first_shift: find shifts through the
693 states.
694
80e25d4d
AD
6952001-12-10 Akim Demaille <akim@epita.fr>
696
697 * src/LR0.c: Attach shifts to states as soon as they are
698 computed.
699 * src/lalr.c (set_state_table): Instead of assigning shifts to
700 state, just assert that the mapping was properly done.
701
0ab3728b
AD
7022001-12-10 Akim Demaille <akim@epita.fr>
703
704 * src/LR0.c (insert_start_shift): Rename as...
705 (insert_start_shifting_state): this.
706 (insert_eof_shifting_state, insert_accepting_state): New.
707 (augment_automaton): Adjust.
708 Better locality of the variables.
709 When looking if the start_symbol is shifted from the initial
710 state, using `while (... symbol != start_symbol ...)' sounds
711 better than `while (... symbol < start_symbol ...)': If fail
712 to see how the order between symbols could be relevant!
713
78af9bbc
AD
7142001-12-10 Akim Demaille <akim@epita.fr>
715
716 * src/getargs.h: Don't declare `spec_name_prefix' and
717 `spec_file_prefix', declared by src/files.h.
718 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
719 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
720 * src/output.c (prepare): Adjust.
721 * src/reader.c (symbols_output): Likewise.
722 * src/vmsgetargs.c: Vaguely adjust, but who cares?
723
bdef2a41
AD
7242001-12-10 Akim Demaille <akim@epita.fr>
725
726 * src/muscle_tab.c (muscle_init): NULL is a better default than
727 `"0"'.
728
3735969c
AD
7292001-12-10 Akim Demaille <akim@epita.fr>
730
731 * src/reader.c (reader): Calling symbols_output once is enough.
732
49701457
AD
7332001-12-10 Akim Demaille <akim@epita.fr>
734
735 Now that states have a complete set of members, the linked list of
736 reductions is useless: just fill directly the state's reductions
737 member.
738
739 * src/state.h (struct reductions): Remove member `number' and
740 `next'.
741 * src/LR0.c (first_reduction, last_reduction): Remove.
742 (save_reductions): Don't link the new reductions, store them in
743 this_state.
744 * src/lalr.c (set_state_table): No need to attach reductions to
745 states, it's already done.
746 * src/output.c (output_actions): No longer free the shifts, then
747 the reductions, then the states: free all the states and their
748 members.
749
0edad749
AD
7502001-12-10 Akim Demaille <akim@epita.fr>
751
752 * src/options.c (OPTN, DRTV, BOTH): New.
753 (option_table): Use them.
754
0edad749
AD
755 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
756 the job of system.h.
757 * src/options.c: Don't include stdio.h and xalloc.h for the same
758 reasons.
759
5449dd0f
AD
7602001-12-10 Akim Demaille <akim@epita.fr>
761
762 * src/output.c (output, prepare): Make sure the values of the
763 muscles `action' and `prologue' are 0-terminated.
764
a870c567
AD
7652001-12-10 Akim Demaille <akim@epita.fr>
766
767 Clean up GCC warnings.
768
769 * src/reader.c (copy_action): `buf' is not used.
770 (parse_skel_decl): Be static.
771 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
772 * src/options.h (create_long_option_table): Have a real prototype.
773 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
774 (hash_delete_at): Return const void *.
775 Adjust casts to preserve the const.
776
80df8768
AD
7772001-12-10 Akim Demaille <akim@epita.fr>
778
779 * configure.in: Require 2.52g.
780 M4 is not needed, but AUTOM4TE is.
781 * m4/m4.m4: Remove.
782 * tests/Makefile.am: Adjust.
783
f693ad14
AD
7842001-12-10 Akim Demaille <akim@epita.fr>
785
786 One structure for states is enough, even though theoretically
787 there are LR(0) states and LALR(1) states.
788
789 * src/lalr.h (state_t): Remove.
790 (state_table): Be state_t **, not state_t *.
791 * src/state.h (core, CORE_ALLOC): Rename as...
792 (state_t, STATE_ALLOC): this.
793 Add the LALR(1) members: shifts, reductions, errs.
794 * src/LR0.c (state_table): Rename as...
795 (state_hash): this, to avoid name clashes with the global
796 `state_table'.
797 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
798 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
799
74ffbcb6
AD
8002001-12-10 Akim Demaille <akim@epita.fr>
801
802 Bison dumps core on bash.y.
803 Reported by Pascal Bart.
804
805 * src/warshall.c (bitmatrix_print): New.
806 (TC): Use it.
807 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
808 j must be the outer loop.
809 * tests/regression.at (Broken Closure): New.
810
07708e19
AD
8112001-12-05 Akim Demaille <akim@epita.fr>
812
813 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
814 its argument.
815