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