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