]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
[bison.git] / ChangeLog
... / ...
CommitLineData
12001-12-27 Akim Demaille <akim@epita.fr>
2
3 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
4
52001-12-27 Akim Demaille <akim@epita.fr>
6
7 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
8 * src/print.c: here.
9 (lookaheadset, shiftset): New, used as additional storage by
10 print_reductions.
11 (print_results): Adjust.
12 (print_shifts, print_gotos, print_errs): New, extracted from...
13 (print_actions): here.
14 * src/print_graph.c (print_actions): Remove dead code.
15
16
172001-12-27 Akim Demaille <akim@epita.fr>
18
19 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
20 `$n' and `@n'.
21
22
232001-12-27 Akim Demaille <akim@epita.fr>
24
25 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
26 (build_relations): Adjust.
27
28
292001-12-27 Akim Demaille <akim@epita.fr>
30
31 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
32 duplication.
33
34
352001-12-27 Akim Demaille <akim@epita.fr>
36
37 * src/reader.c (packgram): Catch nitems overflows.
38
39
402001-12-27 Akim Demaille <akim@epita.fr>
41
42 * src/files.c, src/files.h (guard_obstack): Remove.
43 * src/output.c (output): Adjust.
44 * src/reader.c (parse_braces): New, factoring...
45 (copy_action, copy_guard): these two which are renamed as...
46 (parse_action, parse_guard): these.
47 As a voluntary consequence, using braces around guards is now
48 mandatory.
49
50
512001-12-27 Akim Demaille <akim@epita.fr>
52
53 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
54 * src/reader.c (symbol_list): `guard' and `guard_line' are new
55 members.
56 (symbol_list_new): Adjust.
57 (copy_action): action_line is the first line, not the last.
58 (copy_guard): Just as for actions, store the `action' only, not
59 the switch/case/break flesh.
60 Don't parse the user action that might follow the guard, let...
61 (readgram): do it, i.e., now, there can be an action after a
62 guard.
63 In other words the guard is just explicitly optional.
64 (packgram): Adjust.
65 * src/output.c (guards_output): New.
66 (output_parser): Call it when needed.
67 (output): Also free the guard and attrs obstacks.
68 * src/files.c, src/files.h (obstack_save): Remove.
69 (output_files): Remove.
70 As a result, if one needs the former `.act' file, using an
71 appropriate skeleton which requires actions and guards is now
72 required.
73 * src/main.c (main): Adjust.
74 * tests/semantic.at: New.
75 * tests/regression.at: Use `input.y' as input file name.
76 Avoid 8+3 problems by requiring input.c when the test needs the
77 parser.
78
792001-12-27 Akim Demaille <akim@epita.fr>
80
81 * src/reader.c (symbol_list_new): Be sure to initialize all the
82 fields.
83
842001-12-27 Akim Demaille <akim@epita.fr>
85
86 All the hacks using a final pseudo state are now useless.
87
88 * src/LR0.c (set_state_table): state_table holds exactly nstates.
89 * src/lalr.c (nLA): New.
90 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
91 instead of lookaheadsp from the pseudo state (nstate + 1).
92
932001-12-27 Akim Demaille <akim@epita.fr>
94
95 * src/output.c (action_row, token_actions): Use a state_t instead
96 of a integer, and nlookaheads instead of the following state's
97 lookaheadsp.
98
99
1002001-12-27 Akim Demaille <akim@epita.fr>
101
102 * src/conflicts.c (log_resolution, flush_shift)
103 (resolve_sr_conflict, set_conflicts, solve_conflicts)
104 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
105 (conflicts_print, print_reductions): Use a state_t instead of an
106 integer when referring to a state.
107 As much as possible, depend upon nlookaheads, instead of the
108 `lookaheadsp' member of the following state (since lookaheads of
109 successive states are successive, the difference between state n + 1
110 and n served as the number of lookaheads for state n).
111 * src/lalr.c (add_lookback_edge): Likewise.
112 * src/print.c (print_core, print_actions, print_state)
113 (print_results): Likewise.
114 * src/print_graph.c (print_core, print_actions, print_state)
115 (print_graph): Likewise.
116 * src/conflicts.h: Adjust.
117
1182001-12-27 Akim Demaille <akim@epita.fr>
119
120 * src/bison.hairy: Formatting/comment changes.
121 ANSIfy.
122 Remove `register' indications.
123 Add plenty of `static'.
124
1252001-12-27 Akim Demaille <akim@epita.fr>
126
127 * src/output.c (prepare): Drop the muscle `ntbase' which
128 duplicates ntokens.
129 * src/bison.simple: Formatting/comment changes.
130 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
131 is an undocumented synonym.
132
133
1342001-12-22 Akim Demaille <akim@epita.fr>
135
136 * src/output.c (output_table_data): Change the prototype to use
137 `int' for array ranges: some invocations do pass an int, not a
138 short.
139 Reported by Wayne Green.
140
1412001-12-22 Akim Demaille <akim@epita.fr>
142
143 Some actions of web2c.y are improperly triggered.
144 Reported by Mike Castle.
145
146 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
147 * tests/regression.at (Web2c): Rename as...
148 (Web2c Report): this.
149 (Web2c Actions): New.
150
1512001-12-22 Akim Demaille <akim@epita.fr>
152
153 Reductions in web2c.y are improperly reported.
154 Reported by Mike Castle.
155
156 * src/conflicts.c (print_reductions): Fix.
157 * tests/regression.at (Web2c): New.
158
1592001-12-18 Akim Demaille <akim@epita.fr>
160
161 Some host fail on `assert (!"foo")', which expands to
162 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
163 Reported by Nelson Beebee.
164
165 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
166 `#define it_succeeded 0' and `assert (it_succeeded)'.
167
1682001-12-17 Marc Autret <autret_m@epita.fr>
169
170 * src/bison.simple: Don't hard code the skeleton line and filename.
171 * src/output.c (output_parser): Rename 'line' as 'output_line'.
172 New line counter 'skeleton_line' (skeleton-line muscle).
173
1742001-12-17 Paul Eggert <eggert@twinsun.com>
175
176 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
177 YYDEBUG must be defined to a nonzero value.
178
179 * src/bison.simple (yytname): Do not assume that the user defines
180 YYDEBUG to a properly parenthesized expression.
181
1822001-12-17 Akim Demaille <akim@epita.fr>
183
184 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
185 nlookaheads is a new member.
186 Adjust all users.
187 * src/lalr.h (nlookaheads): Remove this orphan declaration.
188 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
189 state.
190
1912001-12-17 Akim Demaille <akim@epita.fr>
192
193 * src/files.h, src/files.c (open_files, close_files): Remove.
194 * src/main.c (main): Don't open/close files, nor invoke lex_free,
195 let...
196 * src/reader.c (reader): Do it.
197
1982001-12-17 Akim Demaille <akim@epita.fr>
199
200 * src/conflicts.c (print_reductions): Formatting changes.
201
2022001-12-17 Akim Demaille <akim@epita.fr>
203
204 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
205 (flush_reduce): New.
206 (resolve_sr_conflict): Adjust.
207
2082001-12-17 Akim Demaille <akim@epita.fr>
209
210 * src/output.c (output_obstack): Be static and rename as...
211 (format_obstack): this, to avoid any confusion with files.c's
212 output_obstack.
213 * src/reader.h (muscle_obstack): Move to...
214 * src/output.h: here, since it's defined in output.c.
215
2162001-12-17 Akim Demaille <akim@epita.fr>
217
218 * src/output.c (action_row, save_column, default_goto)
219 (sort_actions, matching_state, pack_vector): Better variable
220 locality.
221
2222001-12-17 Akim Demaille <akim@epita.fr>
223
224 * src/output.c: Various formatting changes.
225
2262001-12-17 Akim Demaille <akim@epita.fr>
227
228 * src/files.c (output_files): Free the output_obstack.
229 * src/main.c (main): Call print and print_graph conditionally.
230 * src/print.c (print): Work unconditionally.
231 * src/print_graph.c (print_graph): Work unconditionally.
232 * src/conflicts.c (log_resolution): Output only if verbose_flag.
233
2342001-12-16 Marc Autret <autret_m@epita.fr>
235
236 * src/output.c (actions_output): Fix. When we use %no-lines,
237 there is one less line per action.
238
2392001-12-16 Marc Autret <autret_m@epita.fr>
240
241 * src/bison.simple: Remove a useless #line directive.
242 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
243 * src/output.c (get_lines_number): New.
244 (output_parser): Adjust, now takes care about the lines of a
245 output muscles.
246 Fix line numbering.
247 (actions_output): Computes the number of lines taken by actions.
248 (output_master_parser): Insert new skeleton which is the name of
249 the output parser file name.
250
2512001-12-15 Marc Autret <autret_m@epita.fr>
252
253 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
254
2552001-12-15 Marc Autret <autret_m@epita.fr>
256
257 * src/output.c (output_gram): Keep track of the hairy one.
258
2592001-12-15 Akim Demaille <akim@epita.fr>
260
261 Make `make distcheck' work.
262
263 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
264 system.h which uses libgettext.h.
265
2662001-12-15 Akim Demaille <akim@epita.fr>
267
268 * src/nullable.c (set_nullable): Useless rules must be skipped,
269 otherwise, since we range over their symbols, we might look at a
270 nonterminal which no longer ``exists'', i.e., it is not counted in
271 `nvars', hence we overflow our arrays.
272
2732001-12-15 Akim Demaille <akim@epita.fr>
274
275 The header can also be produced directly, without any obstack!
276 Yahoo!
277
278 * src/files.c, src/files.h (defines_obstack): Remove.
279 (compute_header_macro): Global.
280 (defines_obstack_save): Remove.
281 * src/reader.c (parse_union_decl): No longer output to
282 defines_obstack: its content can be found in the `stype' muscle
283 anyway.
284 (output_token_translations): Merge into...
285 (symbols_output): this.
286 Rename as...
287 (symbols_save): this.
288 (reader): Adjust.
289 * src/output.c (header_output): New.
290 (output): Call it.
291
2922001-12-15 Akim Demaille <akim@epita.fr>
293
294 * src/reader.c (parse_union_decl): Instead of handling two obstack
295 simultaneously, use one to define the `stype' muscle, and use the
296 value of the latter to fill defines_obstack.
297 (copy_comment): Remove.
298 (copy_comment2): Work for a single obstack.
299 Rename as...
300 (copy_comment): this.
301
3022001-12-15 Akim Demaille <akim@epita.fr>
303
304 * src/lex.c, src/lex.h (xgetc): No longer static.
305 * src/reader.c (parse_union_decl): Revamp.
306
3072001-12-15 Akim Demaille <akim@epita.fr>
308
309 Still making progress in separating Bison into (i) input, (ii)
310 process, (iii) output: now we can directly output the parser file
311 without using table_obstack at all.
312
313 * src/files.c, src/files.h (table_obstack): Bye bye.
314 (parser_file_name): New.
315 * src/files.c (compute_output_file_names): Compute it.
316 * src/output.c (actions_output, output_parser)
317 (output_master_parser): To a file instead of an obstack.
318
3192001-12-15 Akim Demaille <akim@epita.fr>
320
321 Attach actions to rules, instead of pre-outputting them to
322 actions_obstack.
323
324 * src/gram.h (rule_t): action and action_line are new members.
325 * src/reader.c (symbol_list): Likewise.
326 (copy_action): Save the actions within the rule.
327 (packgram): Save them in rule_table.
328 * src/output.c (actions_output): New.
329 (output_parser): Use it on `%%actions'.
330 (output_rule_data): Don't free rule_table.
331 (output): Do it.
332 (prepare): Don't save the `action' muscle.
333 * src/bison.simple: s/%%action/%%actions/.
334
3352001-12-15 Akim Demaille <akim@epita.fr>
336
337 * src/reader.c (copy_action): When --yacc, don't append a `;'
338 to the user action: let it fail if lacking.
339 Suggested by Arnold Robbins and Tom Tromey.
340
3412001-12-14 Akim Demaille <akim@epita.fr>
342
343 * src/lex.c (literalchar): Simply return the char you decoded, non
344 longer mess around with obstacks and int pointers.
345 Adjust all callers.
346
3472001-12-14 Akim Demaille <akim@epita.fr>
348
349 * src/lex.c (literalchar): Don't escape the special characters,
350 just decode them, and keep them as char (before, eol was output as
351 the 2 char string `\n' etc.).
352 * src/output.c (output_rule_data): Use quotearg to output the
353 token strings.
354
3552001-12-13 Paul Eggert <eggert@twinsun.com>
356
357 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
358 Do not infringe on the global user namespace when using C++.
359 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
360 All uses of `fprintf' and `stderr' changed.
361
362 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
363
3642001-12-13 Akim Demaille <akim@epita.fr>
365
366 The computation of nullable is broken: it doesn't handle empty
367 RHS's properly.
368
369 * tests/torture.at (GNU AWK Grammar): New.
370 * tests/sets.at (Nullable): New.
371 * src/nullable.c (set_nullable): Instead of blindly looping over
372 `ritems', loop over the rules, and then over their rhs's.
373
374 Work around Autotest bugs.
375
376 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
377 frame, because Autotest understand lines starting with a `+' as
378 traces from the shell. Then, they are not processed properly.
379 Admittedly an Autotest bug, but we don't have time to wait for
380 Autotest to catch up.
381 * tests/regression.at (Broken Closure): Adjust to the new table
382 frames.
383 Move to...
384 * tests/sets.at: here.
385
3862001-12-13 Akim Demaille <akim@epita.fr>
387
388 * src/closure.c (closure): Use nrules instead of playing tricks
389 with BITS_PER_WORD.
390
3912001-12-13 Akim Demaille <akim@epita.fr>
392
393 * src/print.c (print_actions): Output the handling of `$' as the
394 traces do: shifting the token EOF. Before EOF was treated as a
395 nonterminal.
396 * tests/regression.at: Adjust some tests.
397 * src/print_graph.c (print_core): Complete the set of items via
398 closure. The next-to-final and final states are still unsatisfying,
399 but that's to be addressed elsewhere.
400 No longer output the rule numbers, but do output the state number.
401 A single loop for the shifts + gotos is enough, but picked a
402 distinct color for each.
403 (print_graph): Initialize and finalize closure.
404
4052001-12-13 Akim Demaille <akim@epita.fr>
406
407 * src/reader.c (readgram): Remove dead code, an strip useless
408 braces.
409 (get_type): Remove, unused.
410
4112001-12-12 Akim Demaille <akim@epita.fr>
412
413 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
414 on that of lib/error.c.
415
4162001-12-12 Akim Demaille <akim@epita.fr>
417
418 Some hosts don't like `/' in includes.
419
420 * src/system.h: Include libgettext.h without qualifying the path.
421 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
422 $(top_srcdir).
423
4242001-12-11 Marc Autret <autret_m@epita.fr>
425
426 * src/output.c (output_parser): Remove useless muscle.
427
4282001-12-11 Marc Autret <autret_m@epita.fr>
429
430 * src/bison.simple: Remove #line just before %%epilogue. It
431 is now handled in ...
432 * src/reader.c (read_additionnal_code): Add the output of a
433 #line for the epilogue.
434
4352001-12-10 Marc Autret <autret_m@epita.fr>
436
437 * src/reader.c (copy_definition): Re-use CPP-outed code which
438 replace precedent remove.
439 * src/bison.simple: Remove #line before %%prologue because
440 %%input-line is wrong at this time.
441
4422001-12-10 Marc Autret <autret_m@epita.fr>
443
444 * src/reader.c (symbols_output): Clean up.
445 * src/output.c (output_gram, output): Clean up.
446
4472001-12-10 Akim Demaille <akim@epita.fr>
448
449 * src/lalr.c (initialize_lookaheads): New. Extracted from...
450 * src/LR0.c (set_state_table): here.
451 * src/lalr.c (lalr): Call it.
452
4532001-12-10 Akim Demaille <akim@epita.fr>
454
455 * src/state.h (shifts): Remove the `number' member: shifts are
456 attached to state, hence no longer need to be labelled with a
457 state number.
458
4592001-12-10 Akim Demaille <akim@epita.fr>
460
461 Now that states have a complete set of members, the linked list of
462 shifts is useless: just fill directly the state's shifts member.
463
464 * src/state.h (shifts): Remove the `next' member.
465 * src/LR0.c (first_state, last_state): Remove.
466 Adjust the callers.
467 (augment_automaton): Don't look for the shifts that must be added
468 a shift on EOF: it is those of the state we looked for! But now,
469 since shifts are attached, it is no longer needed to looking
470 merely by its id: its number.
471
4722001-12-10 Akim Demaille <akim@epita.fr>
473
474 * src/LR0.c (augment_automaton): Better variable locality.
475 Remove an impossible branch: if there is a state corresponding to
476 the start symbol being shifted, then there is shift for the start
477 symbol from the initial state.
478
4792001-12-10 Akim Demaille <akim@epita.fr>
480
481 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
482 only when appropriate: when insert_start_shifting_state' is not
483 invoked.
484 * tests/regression.at (Rule Line Numbers): Adjust.
485
4862001-12-10 Akim Demaille <akim@epita.fr>
487
488 * src/LR0.c (augment_automaton): Now that all states have shifts,
489 merge the two cases addition shifts to the initial state.
490
4912001-12-10 Akim Demaille <akim@epita.fr>
492
493 * src/lalr.c (set_state_table): Move to...
494 * src/LR0.c: here.
495 * src/lalr.c (lalr): Don't call it...
496 * src/LR0.c (generate_states): do it.
497 * src/LR0.h (first_state): Remove, only the table is used.
498
4992001-12-10 Akim Demaille <akim@epita.fr>
500
501 * src/LR0.h (first_shift, first_reduction): Remove.
502 * src/lalr.c: Don't use first_shift: find shifts through the
503 states.
504
5052001-12-10 Akim Demaille <akim@epita.fr>
506
507 * src/LR0.c: Attach shifts to states as soon as they are
508 computed.
509 * src/lalr.c (set_state_table): Instead of assigning shifts to
510 state, just assert that the mapping was properly done.
511
5122001-12-10 Akim Demaille <akim@epita.fr>
513
514 * src/LR0.c (insert_start_shift): Rename as...
515 (insert_start_shifting_state): this.
516 (insert_eof_shifting_state, insert_accepting_state): New.
517 (augment_automaton): Adjust.
518 Better locality of the variables.
519 When looking if the start_symbol is shifted from the initial
520 state, using `while (... symbol != start_symbol ...)' sounds
521 better than `while (... symbol < start_symbol ...)': If fail
522 to see how the order between symbols could be relevant!
523
5242001-12-10 Akim Demaille <akim@epita.fr>
525
526 * src/getargs.h: Don't declare `spec_name_prefix' and
527 `spec_file_prefix', declared by src/files.h.
528 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
529 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
530 * src/output.c (prepare): Adjust.
531 * src/reader.c (symbols_output): Likewise.
532 * src/vmsgetargs.c: Vaguely adjust, but who cares?
533
5342001-12-10 Akim Demaille <akim@epita.fr>
535
536 * src/muscle_tab.c (muscle_init): NULL is a better default than
537 `"0"'.
538
5392001-12-10 Akim Demaille <akim@epita.fr>
540
541 * src/reader.c (reader): Calling symbols_output once is enough.
542
5432001-12-10 Akim Demaille <akim@epita.fr>
544
545 Now that states have a complete set of members, the linked list of
546 reductions is useless: just fill directly the state's reductions
547 member.
548
549 * src/state.h (struct reductions): Remove member `number' and
550 `next'.
551 * src/LR0.c (first_reduction, last_reduction): Remove.
552 (save_reductions): Don't link the new reductions, store them in
553 this_state.
554 * src/lalr.c (set_state_table): No need to attach reductions to
555 states, it's already done.
556 * src/output.c (output_actions): No longer free the shifts, then
557 the reductions, then the states: free all the states and their
558 members.
559
5602001-12-10 Akim Demaille <akim@epita.fr>
561
562 * src/options.c (OPTN, DRTV, BOTH): New.
563 (option_table): Use them.
564
565 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
566 the job of system.h.
567 * src/options.c: Don't include stdio.h and xalloc.h for the same
568 reasons.
569
5702001-12-10 Akim Demaille <akim@epita.fr>
571
572 * src/output.c (output, prepare): Make sure the values of the
573 muscles `action' and `prologue' are 0-terminated.
574
5752001-12-10 Akim Demaille <akim@epita.fr>
576
577 Clean up GCC warnings.
578
579 * src/reader.c (copy_action): `buf' is not used.
580 (parse_skel_decl): Be static.
581 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
582 * src/options.h (create_long_option_table): Have a real prototype.
583 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
584 (hash_delete_at): Return const void *.
585 Adjust casts to preserve the const.
586
5872001-12-10 Akim Demaille <akim@epita.fr>
588
589 * configure.in: Require 2.52g.
590 M4 is not needed, but AUTOM4TE is.
591 * m4/m4.m4: Remove.
592 * tests/Makefile.am: Adjust.
593
5942001-12-10 Akim Demaille <akim@epita.fr>
595
596 One structure for states is enough, even though theoretically
597 there are LR(0) states and LALR(1) states.
598
599 * src/lalr.h (state_t): Remove.
600 (state_table): Be state_t **, not state_t *.
601 * src/state.h (core, CORE_ALLOC): Rename as...
602 (state_t, STATE_ALLOC): this.
603 Add the LALR(1) members: shifts, reductions, errs.
604 * src/LR0.c (state_table): Rename as...
605 (state_hash): this, to avoid name clashes with the global
606 `state_table'.
607 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
608 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
609
6102001-12-10 Akim Demaille <akim@epita.fr>
611
612 Bison dumps core on bash.y.
613 Reported by Pascal Bart.
614
615 * src/warshall.c (bitmatrix_print): New.
616 (TC): Use it.
617 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
618 j must be the outer loop.
619 * tests/regression.at (Broken Closure): New.
620
6212001-12-05 Akim Demaille <akim@epita.fr>
622
623 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
624 its argument.
625