]>
Commit | Line | Data |
---|---|---|
1 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
2 | ||
3 | * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the | |
4 | user prologue. These are defaults. | |
5 | * tests/actions.at (Mid-rule actions): Make sure the user can | |
6 | define YYDEBUG and YYERROR_VERBOSE. | |
7 | ||
8 | ||
9 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
10 | ||
11 | * src/output.c (header_output): Don't forget to export YYLTYPE and | |
12 | yylloc. | |
13 | * tests/headers.at (export YYLTYPE): New, make sure it does. | |
14 | * tests/regression.at (%union and --defines, Invalid CPP headers): | |
15 | Move to... | |
16 | * tests/headers.at: here. | |
17 | ||
18 | ||
19 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
20 | ||
21 | * src/gram.h (rule_s): Member `assoc' is of type `associativity'. | |
22 | ||
23 | ||
24 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
25 | ||
26 | * tests/actions.at (Mid-rule actions): Output on a single line | |
27 | instead of several. | |
28 | ||
29 | ||
30 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
31 | ||
32 | * doc/bison.texinfo: Formatting changes. | |
33 | ||
34 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
35 | ||
36 | Don't store the token defs in a muscle, just be ready to output it | |
37 | on command. Now possible via `symbols'. Fixes a memory leak. | |
38 | ||
39 | * src/output.c (token_definitions_output): New. | |
40 | (output_parser, header_output): Use it. | |
41 | * src/reader.c (symbols_save): Remove. | |
42 | ||
43 | ||
44 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
45 | ||
46 | * src/bison.simple: Do not provide a default for YYSTYPE and | |
47 | YYLTYPE before the user's prologue. Otherwise it's hardly... a | |
48 | default. | |
49 | ||
50 | ||
51 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
52 | ||
53 | Mid-rule actions are simply... ignored! | |
54 | ||
55 | * src/reader.c (readgram): Be sure to attach mid-rule actions to | |
56 | the empty-rule associated to the dummy symbol, not to the host | |
57 | rule. | |
58 | * tests/actions.at (Mid-rule actions): New. | |
59 | ||
60 | ||
61 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
62 | ||
63 | Memory leak. | |
64 | ||
65 | * src/reader.c (reader): Free grammar. | |
66 | ||
67 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
68 | ||
69 | Memory leak. | |
70 | ||
71 | * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here, | |
72 | since it allocates it for each state, although only one is needed. | |
73 | (allocate_storage): Do it here. | |
74 | ||
75 | ||
76 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
77 | ||
78 | * src/options.h, src/options.c (create_long_option_table): Rename | |
79 | as... | |
80 | (long_option_table_new): this, with a clearer prototype. | |
81 | (percent_table): Remove, unused, | |
82 | * src/getargs.c (getargs): Adjust. | |
83 | ||
84 | ||
85 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
86 | ||
87 | * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c | |
88 | * src/print.c, src/print_graph.c, src/state.h: Rename state_table | |
89 | as states. | |
90 | ||
91 | ||
92 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
93 | ||
94 | * src/lalr.c (build_relations): Rename `states' as `states1'. | |
95 | Sorry, I don't understand exactly what it is, no better name... | |
96 | ||
97 | ||
98 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
99 | ||
100 | * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c | |
101 | * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c | |
102 | * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table | |
103 | as rules. | |
104 | ||
105 | ||
106 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
107 | ||
108 | * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long | |
109 | ago. | |
110 | ||
111 | ||
112 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
113 | ||
114 | * src/reader.c, src/reader.h (user_toknums): Remove. | |
115 | Adjust all users to use symbols[i]->user_token_number. | |
116 | ||
117 | ||
118 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
119 | ||
120 | * src/gram.c, src/gram.h (sprec, sassoc): Remove. | |
121 | Adjust all users to use symbols[i]->prec or ->assoc. | |
122 | ||
123 | ||
124 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
125 | ||
126 | * src/reader.c, src/reader.h (tags): Remove. | |
127 | Adjust all users to use symbols[i]->tag. | |
128 | ||
129 | ||
130 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
131 | ||
132 | * src/gram.h, src/gram.c (symbols): New, similar to state_table | |
133 | and rule_table. | |
134 | * src/reader.c (packsymbols): Fill this table. | |
135 | Drop sprec. | |
136 | * src/conflicts.c (resolve_sr_conflict): Adjust. | |
137 | * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a | |
138 | single table. | |
139 | Use symbols[i]->tag instead of tags[i]. | |
140 | ||
141 | ||
142 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
143 | ||
144 | * tests/calc.at (_AT_DATA_CALC_Y): Also use %union. | |
145 | In addition, put a comment in there, to replace... | |
146 | * tests/regression.at (%union and C comments): Remove. | |
147 | ||
148 | ||
149 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
150 | ||
151 | * tests/regression.at (Web2c Actions): Blindly move the actual | |
152 | output as expected output. The contents *seem* right to me, but I | |
153 | can't pretend reading perfectly parser tables... Nonetheless, all | |
154 | the other tests pass correctly, the table look OK, even though the | |
155 | presence of `$axiom' is to be noted: AFAICS it is useless (but | |
156 | harmless). | |
157 | ||
158 | ||
159 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
160 | ||
161 | * src/reader.c (readgram): Don't add the rule 0 if there were no | |
162 | rules read. In other words, add it _after_ having performed | |
163 | grammar sanity checks. | |
164 | Fixes the `tests/regression.at (Invalid input: 1)' Failure. | |
165 | ||
166 | ||
167 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
168 | ||
169 | * tests/regression.at (Web2c Report): Catch up: the rule 0 is now | |
170 | visible, and some states have now a different number. | |
171 | ||
172 | ||
173 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
174 | ||
175 | * src/reader.c (readgram): Bind the initial rule's lineno to that | |
176 | of the first rule. | |
177 | * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts): | |
178 | (Solved SR Conflicts): Adjust rule 0's line number. | |
179 | ||
180 | ||
181 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
182 | ||
183 | Fix the `GAWK Grammar' failure. | |
184 | ||
185 | * src/LR0.c (final_state): Initialize to -1 so that we do compute | |
186 | the reductions of the first state which was mistakenly confused | |
187 | with the final state because precisely final_state was initialized | |
188 | to 0. | |
189 | * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads, | |
190 | now noticed by Bison. | |
191 | * tests/regression.at (Rule Line Numbers): Adjust: state 0 does | |
192 | have a reduction on $default. | |
193 | ||
194 | ||
195 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
196 | ||
197 | * src/gram.c (ritem_print): Be sure to subtract 1 when displaying | |
198 | rule line numbers. | |
199 | * src/closure.c (print_closure): Likewise. | |
200 | * src/derives.c (print_derives): Likewise. | |
201 | * tests/sets.at (Nullable): Adjust: the rule numbers are correct | |
202 | now. | |
203 | ||
204 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
205 | ||
206 | * src/lalr.c (lookaheads_print): New. | |
207 | (lalr): Call it when --trace-flag. | |
208 | * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads | |
209 | are dumped. | |
210 | ||
211 | ||
212 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
213 | ||
214 | * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0', | |
215 | when walking through ritem, even via rule->rhs. | |
216 | * src/reduce.c (dump_grammar, useful_production, reduce_output) | |
217 | (useful_production, useless_nonterminals): Likewise. | |
218 | (reduce_grammar_tables): Likewise, plus update nritems. | |
219 | * src/nullable.c (set_nullable): Likewise. | |
220 | * src/lalr.c (build_relations): Likewise. | |
221 | * tests/sets.at (Nullable): Adjust. | |
222 | Fortunately, now, the $axiom is no longer nullable. | |
223 | ||
224 | ||
225 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
226 | ||
227 | * src/LR0.c (generate_states): Use nritems, not nitems, nor using | |
228 | the 0-sentinel. | |
229 | * src/gram.c (ritem_longest_rhs): Likewise. | |
230 | * src/reduce.c (nonterminals_reduce): Likewise. | |
231 | * src/print_graph.c (print_graph): Likewise. | |
232 | * src/output.c (output_rule_data): Likewise. | |
233 | * src/nullable.c (set_nullable): Likewise. | |
234 | ||
235 | 2001-12-29 Akim Demaille <akim@epita.fr> | |
236 | ||
237 | * src/output.c: Comment changes. | |
238 | ||
239 | 2001-12-27 Paul Eggert <eggert@twinsun.com> | |
240 | ||
241 | * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special | |
242 | cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and | |
243 | Sparc, as they were causing more porting problems than the | |
244 | (minor) performance improvement was worth. | |
245 | ||
246 | Also, catch up with 1.31's YYSTD. | |
247 | ||
248 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
249 | ||
250 | * src/output.c (output_gram): Rely on nritems, not the | |
251 | 0-sentinel. See below. | |
252 | Use -1 as separator, not 0. | |
253 | * src/bison.simple (yyparse): Subtract 1 to the rule numbers. | |
254 | Rely on -1 as separator in yyrhs, instead of 0. | |
255 | * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue | |
256 | twice `Now at end of input', therefore there are two lines less to | |
257 | expect. | |
258 | ||
259 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
260 | ||
261 | * tests/regression.at (Unresolved SR Conflicts): | |
262 | (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes | |
263 | below. | |
264 | ||
265 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
266 | ||
267 | * src/LR0.c (new_state): Recognize the final state by the fact it | |
268 | is reached by eoftoken. | |
269 | (insert_start_shifting_state, insert_eof_shifting_state) | |
270 | (insert_accepting_state, augment_automaton): Remove, since now | |
271 | these states are automatically computed from the initial state. | |
272 | (generate_states): Adjust. | |
273 | * src/print.c: When reporting a rule number to the user, substract | |
274 | 1, so that the axiom rule is rule 0, and the first user rule is 1. | |
275 | * src/reduce.c: Likewise. | |
276 | * src/print_graph.c (print_core): For the time being, just as for | |
277 | the report, depend upon --trace-flags to dump the full set of | |
278 | items. | |
279 | * src/reader.c (readgram): Once the grammar read, insert the rule | |
280 | 0: `$axiom: START-SYMBOL $'. | |
281 | * tests/set.at: Adjust: rule 0 is now displayed, and since the | |
282 | number of the states has changed (the final state is no longer | |
283 | necessarily the last), catch up. | |
284 | ||
285 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
286 | ||
287 | Try to make the use of the eoftoken valid. Given that its value | |
288 | is 0 which was also used as a sentinel in ritem, (i) make sure >= 0 | |
289 | is used instead of > 0 where appropriate, (ii), depend upon nritems | |
290 | instead of the 0-sentinel. | |
291 | ||
292 | * src/gram.h, src/gram.c (nritems): New. | |
293 | Expected to be duplication of nitems, but for the time being... | |
294 | * src/reader.c (packgram): Assert nritems and nitems are equal. | |
295 | * src/LR0.c (allocate_itemsets, new_itemsets): Adjust. | |
296 | * src/closure.c (print_closure, print_fderives): Likewise. | |
297 | * src/gram.c (ritem_print): Likewise. | |
298 | * src/print.c (print_core, print_grammar): Likewise. | |
299 | * src/print_graph.c: Likewise. | |
300 | ||
301 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
302 | ||
303 | * src/main.c (main): If there are complains after grammar | |
304 | reductions, then output the report anyway if requested, then die. | |
305 | * src/symtab.c (bucket_new): Initialize `value' to -1, not 0. | |
306 | * src/reader.c (eoftoken): New. | |
307 | (parse_token_decl): If the token being defined has value `0', it | |
308 | is the eoftoken. | |
309 | (packsymbols): No longer hack `tags' to insert `$' by hand. | |
310 | Be sure to preserve the value of the eoftoken. | |
311 | (reader): Make sure eoftoken is defined. | |
312 | Initialize nsyms to 0: now eoftoken is created just like the others. | |
313 | * src/print.c (print_grammar): Don't special case the eof token. | |
314 | * src/regression.at: Adjust: `$' has value 0, not -1, which was a | |
315 | lie anyway, albeit pleasant. | |
316 | * tests/calc.at: Exercise error messages with eoftoken. | |
317 | Change the grammar so that empty input is invalid. | |
318 | Adjust expectations. | |
319 | When yyungeting, be sure to use a valid yylloc: use last_yylloc. | |
320 | ||
321 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
322 | ||
323 | * configure.in: Check the protos of strchr ans strspn. | |
324 | Replace strchr if needed. | |
325 | * src/system.h: Provide the protos of strchr, strspn and memchr if | |
326 | missing. | |
327 | * lib/strchr.c: New. | |
328 | * src/reader.c (symbols_save): Use strchr. | |
329 | ||
330 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
331 | ||
332 | * src/print.c, src/print_graph.c (escape): New. | |
333 | Use it to quote the TAGS outputs. | |
334 | * src/print_graph.c (print_state): Now errors are in red, and | |
335 | reductions in green. | |
336 | Prefer high to wide: output the state number on a line of its own. | |
337 | ||
338 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
339 | ||
340 | * src/state.h, src/state.c (reductions_new): New. | |
341 | * src/LR0.c (set_state_table): Let all the states have a | |
342 | `reductions', even if reduced to 0. | |
343 | (save_reductions): Adjust. | |
344 | * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust. | |
345 | * src/print.c (print_reductions, print_actions): Adjust. | |
346 | * src/output.c (action_row): Adjust. | |
347 | ||
348 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
349 | ||
350 | * src/state.h, src/state.c (errs_new, errs_dup): New. | |
351 | * src/LR0.c (set_state_table): Let all the states have an errs, | |
352 | even if reduced to 0. | |
353 | * src/print.c (print_errs, print_reductions): Adjust. | |
354 | * src/output.c (output_actions, action_row): Adjust. | |
355 | * src/conflicts.c (resolve_sr_conflict): Adjust. | |
356 | ||
357 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
358 | ||
359 | * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL. | |
360 | ||
361 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
362 | ||
363 | * src/conflicts.c, src/conflicts.h (print_reductions): Move to... | |
364 | * src/print.c: here. | |
365 | (lookaheadset, shiftset): New, used as additional storage by | |
366 | print_reductions. | |
367 | (print_results): Adjust. | |
368 | (print_shifts, print_gotos, print_errs): New, extracted from... | |
369 | (print_actions): here. | |
370 | * src/print_graph.c (print_actions): Remove dead code. | |
371 | ||
372 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
373 | ||
374 | * src/reader.c (copy_dollar, copy_at): Better checking of `n' in | |
375 | `$n' and `@n'. | |
376 | ||
377 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
378 | ||
379 | * src/lalr.c (add_lookback_edge): Use state_t instead of ints. | |
380 | (build_relations): Adjust. | |
381 | ||
382 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
383 | ||
384 | * src/lalr.c (set_goto_map): Remove a wrong but benign loop | |
385 | duplication. | |
386 | ||
387 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
388 | ||
389 | * src/reader.c (packgram): Catch nitems overflows. | |
390 | ||
391 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
392 | ||
393 | * src/files.c, src/files.h (guard_obstack): Remove. | |
394 | * src/output.c (output): Adjust. | |
395 | * src/reader.c (parse_braces): New, factoring... | |
396 | (copy_action, copy_guard): these two which are renamed as... | |
397 | (parse_action, parse_guard): these. | |
398 | As a voluntary consequence, using braces around guards is now | |
399 | mandatory. | |
400 | ||
401 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
402 | ||
403 | * src/gram.h (rule_t): `guard' and `guard_line' are new members. | |
404 | * src/reader.c (symbol_list): `guard' and `guard_line' are new | |
405 | members. | |
406 | (symbol_list_new): Adjust. | |
407 | (copy_action): action_line is the first line, not the last. | |
408 | (copy_guard): Just as for actions, store the `action' only, not | |
409 | the switch/case/break flesh. | |
410 | Don't parse the user action that might follow the guard, let... | |
411 | (readgram): do it, i.e., now, there can be an action after a | |
412 | guard. | |
413 | In other words the guard is just explicitly optional. | |
414 | (packgram): Adjust. | |
415 | * src/output.c (guards_output): New. | |
416 | (output_parser): Call it when needed. | |
417 | (output): Also free the guard and attrs obstacks. | |
418 | * src/files.c, src/files.h (obstack_save): Remove. | |
419 | (output_files): Remove. | |
420 | As a result, if one needs the former `.act' file, using an | |
421 | appropriate skeleton which requires actions and guards is now | |
422 | required. | |
423 | * src/main.c (main): Adjust. | |
424 | * tests/semantic.at: New. | |
425 | * tests/regression.at: Use `input.y' as input file name. | |
426 | Avoid 8+3 problems by requiring input.c when the test needs the | |
427 | parser. | |
428 | ||
429 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
430 | ||
431 | * src/reader.c (symbol_list_new): Be sure to initialize all the | |
432 | fields. | |
433 | ||
434 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
435 | ||
436 | All the hacks using a final pseudo state are now useless. | |
437 | ||
438 | * src/LR0.c (set_state_table): state_table holds exactly nstates. | |
439 | * src/lalr.c (nLA): New. | |
440 | (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it | |
441 | instead of lookaheadsp from the pseudo state (nstate + 1). | |
442 | ||
443 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
444 | ||
445 | * src/output.c (action_row, token_actions): Use a state_t instead | |
446 | of a integer, and nlookaheads instead of the following state's | |
447 | lookaheadsp. | |
448 | ||
449 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
450 | ||
451 | * src/conflicts.c (log_resolution, flush_shift) | |
452 | (resolve_sr_conflict, set_conflicts, solve_conflicts) | |
453 | (count_sr_conflicts, count_rr_conflicts, conflicts_output) | |
454 | (conflicts_print, print_reductions): Use a state_t instead of an | |
455 | integer when referring to a state. | |
456 | As much as possible, depend upon nlookaheads, instead of the | |
457 | `lookaheadsp' member of the following state (since lookaheads of | |
458 | successive states are successive, the difference between state n + 1 | |
459 | and n served as the number of lookaheads for state n). | |
460 | * src/lalr.c (add_lookback_edge): Likewise. | |
461 | * src/print.c (print_core, print_actions, print_state) | |
462 | (print_results): Likewise. | |
463 | * src/print_graph.c (print_core, print_actions, print_state) | |
464 | (print_graph): Likewise. | |
465 | * src/conflicts.h: Adjust. | |
466 | ||
467 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
468 | ||
469 | * src/bison.hairy: Formatting/comment changes. | |
470 | ANSIfy. | |
471 | Remove `register' indications. | |
472 | Add plenty of `static'. | |
473 | ||
474 | 2001-12-27 Akim Demaille <akim@epita.fr> | |
475 | ||
476 | * src/output.c (prepare): Drop the muscle `ntbase' which | |
477 | duplicates ntokens. | |
478 | * src/bison.simple: Formatting/comment changes. | |
479 | Use YYNTOKENS only, which is documented, but not YYNTBASE, which | |
480 | is an undocumented synonym. | |
481 | ||
482 | 2001-12-22 Akim Demaille <akim@epita.fr> | |
483 | ||
484 | * src/output.c (output_table_data): Change the prototype to use | |
485 | `int' for array ranges: some invocations do pass an int, not a | |
486 | short. | |
487 | Reported by Wayne Green. | |
488 | ||
489 | 2001-12-22 Akim Demaille <akim@epita.fr> | |
490 | ||
491 | Some actions of web2c.y are improperly triggered. | |
492 | Reported by Mike Castle. | |
493 | ||
494 | * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/. | |
495 | * tests/regression.at (Web2c): Rename as... | |
496 | (Web2c Report): this. | |
497 | (Web2c Actions): New. | |
498 | ||
499 | 2001-12-22 Akim Demaille <akim@epita.fr> | |
500 | ||
501 | Reductions in web2c.y are improperly reported. | |
502 | Reported by Mike Castle. | |
503 | ||
504 | * src/conflicts.c (print_reductions): Fix. | |
505 | * tests/regression.at (Web2c): New. | |
506 | ||
507 | 2001-12-18 Akim Demaille <akim@epita.fr> | |
508 | ||
509 | Some host fail on `assert (!"foo")', which expands to | |
510 | ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__)) | |
511 | Reported by Nelson Beebee. | |
512 | ||
513 | * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with | |
514 | `#define it_succeeded 0' and `assert (it_succeeded)'. | |
515 | ||
516 | 2001-12-17 Marc Autret <autret_m@epita.fr> | |
517 | ||
518 | * src/bison.simple: Don't hard code the skeleton line and filename. | |
519 | * src/output.c (output_parser): Rename 'line' as 'output_line'. | |
520 | New line counter 'skeleton_line' (skeleton-line muscle). | |
521 | ||
522 | 2001-12-17 Paul Eggert <eggert@twinsun.com> | |
523 | ||
524 | * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that | |
525 | YYDEBUG must be defined to a nonzero value. | |
526 | ||
527 | * src/bison.simple (yytname): Do not assume that the user defines | |
528 | YYDEBUG to a properly parenthesized expression. | |
529 | ||
530 | 2001-12-17 Akim Demaille <akim@epita.fr> | |
531 | ||
532 | * src/state.h (state_t): Rename lookaheads as lookaheadsp. | |
533 | nlookaheads is a new member. | |
534 | Adjust all users. | |
535 | * src/lalr.h (nlookaheads): Remove this orphan declaration. | |
536 | * src/lalr.c (initialize_lookaheads): Set nlookaheads for each | |
537 | state. | |
538 | ||
539 | 2001-12-17 Akim Demaille <akim@epita.fr> | |
540 | ||
541 | * src/files.h, src/files.c (open_files, close_files): Remove. | |
542 | * src/main.c (main): Don't open/close files, nor invoke lex_free, | |
543 | let... | |
544 | * src/reader.c (reader): Do it. | |
545 | ||
546 | 2001-12-17 Akim Demaille <akim@epita.fr> | |
547 | ||
548 | * src/conflicts.c (print_reductions): Formatting changes. | |
549 | ||
550 | 2001-12-17 Akim Demaille <akim@epita.fr> | |
551 | ||
552 | * src/conflicts.c (flush_shift): Also adjust lookaheadset. | |
553 | (flush_reduce): New. | |
554 | (resolve_sr_conflict): Adjust. | |
555 | ||
556 | 2001-12-17 Akim Demaille <akim@epita.fr> | |
557 | ||
558 | * src/output.c (output_obstack): Be static and rename as... | |
559 | (format_obstack): this, to avoid any confusion with files.c's | |
560 | output_obstack. | |
561 | * src/reader.h (muscle_obstack): Move to... | |
562 | * src/output.h: here, since it's defined in output.c. | |
563 | ||
564 | 2001-12-17 Akim Demaille <akim@epita.fr> | |
565 | ||
566 | * src/output.c (action_row, save_column, default_goto) | |
567 | (sort_actions, matching_state, pack_vector): Better variable | |
568 | locality. | |
569 | ||
570 | 2001-12-17 Akim Demaille <akim@epita.fr> | |
571 | ||
572 | * src/output.c: Various formatting changes. | |
573 | ||
574 | 2001-12-17 Akim Demaille <akim@epita.fr> | |
575 | ||
576 | * src/files.c (output_files): Free the output_obstack. | |
577 | * src/main.c (main): Call print and print_graph conditionally. | |
578 | * src/print.c (print): Work unconditionally. | |
579 | * src/print_graph.c (print_graph): Work unconditionally. | |
580 | * src/conflicts.c (log_resolution): Output only if verbose_flag. | |
581 | ||
582 | 2001-12-16 Marc Autret <autret_m@epita.fr> | |
583 | ||
584 | * src/output.c (actions_output): Fix. When we use %no-lines, | |
585 | there is one less line per action. | |
586 | ||
587 | 2001-12-16 Marc Autret <autret_m@epita.fr> | |
588 | ||
589 | * src/bison.simple: Remove a useless #line directive. | |
590 | s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'. | |
591 | * src/output.c (get_lines_number): New. | |
592 | (output_parser): Adjust, now takes care about the lines of a | |
593 | output muscles. | |
594 | Fix line numbering. | |
595 | (actions_output): Computes the number of lines taken by actions. | |
596 | (output_master_parser): Insert new skeleton which is the name of | |
597 | the output parser file name. | |
598 | ||
599 | 2001-12-15 Marc Autret <autret_m@epita.fr> | |
600 | ||
601 | * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility. | |
602 | ||
603 | 2001-12-15 Marc Autret <autret_m@epita.fr> | |
604 | ||
605 | * src/output.c (output_gram): Keep track of the hairy one. | |
606 | ||
607 | 2001-12-15 Akim Demaille <akim@epita.fr> | |
608 | ||
609 | Make `make distcheck' work. | |
610 | ||
611 | * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses | |
612 | system.h which uses libgettext.h. | |
613 | ||
614 | 2001-12-15 Akim Demaille <akim@epita.fr> | |
615 | ||
616 | * src/nullable.c (set_nullable): Useless rules must be skipped, | |
617 | otherwise, since we range over their symbols, we might look at a | |
618 | nonterminal which no longer ``exists'', i.e., it is not counted in | |
619 | `nvars', hence we overflow our arrays. | |
620 | ||
621 | 2001-12-15 Akim Demaille <akim@epita.fr> | |
622 | ||
623 | The header can also be produced directly, without any obstack! | |
624 | Yahoo! | |
625 | ||
626 | * src/files.c, src/files.h (defines_obstack): Remove. | |
627 | (compute_header_macro): Global. | |
628 | (defines_obstack_save): Remove. | |
629 | * src/reader.c (parse_union_decl): No longer output to | |
630 | defines_obstack: its content can be found in the `stype' muscle | |
631 | anyway. | |
632 | (output_token_translations): Merge into... | |
633 | (symbols_output): this. | |
634 | Rename as... | |
635 | (symbols_save): this. | |
636 | (reader): Adjust. | |
637 | * src/output.c (header_output): New. | |
638 | (output): Call it. | |
639 | ||
640 | 2001-12-15 Akim Demaille <akim@epita.fr> | |
641 | ||
642 | * src/reader.c (parse_union_decl): Instead of handling two obstack | |
643 | simultaneously, use one to define the `stype' muscle, and use the | |
644 | value of the latter to fill defines_obstack. | |
645 | (copy_comment): Remove. | |
646 | (copy_comment2): Work for a single obstack. | |
647 | Rename as... | |
648 | (copy_comment): this. | |
649 | ||
650 | 2001-12-15 Akim Demaille <akim@epita.fr> | |
651 | ||
652 | * src/lex.c, src/lex.h (xgetc): No longer static. | |
653 | * src/reader.c (parse_union_decl): Revamp. | |
654 | ||
655 | 2001-12-15 Akim Demaille <akim@epita.fr> | |
656 | ||
657 | Still making progress in separating Bison into (i) input, (ii) | |
658 | process, (iii) output: now we can directly output the parser file | |
659 | without using table_obstack at all. | |
660 | ||
661 | * src/files.c, src/files.h (table_obstack): Bye bye. | |
662 | (parser_file_name): New. | |
663 | * src/files.c (compute_output_file_names): Compute it. | |
664 | * src/output.c (actions_output, output_parser) | |
665 | (output_master_parser): To a file instead of an obstack. | |
666 | ||
667 | 2001-12-15 Akim Demaille <akim@epita.fr> | |
668 | ||
669 | Attach actions to rules, instead of pre-outputting them to | |
670 | actions_obstack. | |
671 | ||
672 | * src/gram.h (rule_t): action and action_line are new members. | |
673 | * src/reader.c (symbol_list): Likewise. | |
674 | (copy_action): Save the actions within the rule. | |
675 | (packgram): Save them in rule_table. | |
676 | * src/output.c (actions_output): New. | |
677 | (output_parser): Use it on `%%actions'. | |
678 | (output_rule_data): Don't free rule_table. | |
679 | (output): Do it. | |
680 | (prepare): Don't save the `action' muscle. | |
681 | * src/bison.simple: s/%%action/%%actions/. | |
682 | ||
683 | 2001-12-15 Akim Demaille <akim@epita.fr> | |
684 | ||
685 | * src/reader.c (copy_action): When --yacc, don't append a `;' | |
686 | to the user action: let it fail if lacking. | |
687 | Suggested by Arnold Robbins and Tom Tromey. | |
688 | ||
689 | 2001-12-14 Akim Demaille <akim@epita.fr> | |
690 | ||
691 | * src/lex.c (literalchar): Simply return the char you decoded, non | |
692 | longer mess around with obstacks and int pointers. | |
693 | Adjust all callers. | |
694 | ||
695 | 2001-12-14 Akim Demaille <akim@epita.fr> | |
696 | ||
697 | * src/lex.c (literalchar): Don't escape the special characters, | |
698 | just decode them, and keep them as char (before, eol was output as | |
699 | the 2 char string `\n' etc.). | |
700 | * src/output.c (output_rule_data): Use quotearg to output the | |
701 | token strings. | |
702 | ||
703 | 2001-12-13 Paul Eggert <eggert@twinsun.com> | |
704 | ||
705 | * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE): | |
706 | Do not infringe on the global user namespace when using C++. | |
707 | (YYFPRINTF, YYSTDERR): New macros, needed for the above. | |
708 | All uses of `fprintf' and `stderr' changed. | |
709 | ||
710 | * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR. | |
711 | ||
712 | 2001-12-13 Akim Demaille <akim@epita.fr> | |
713 | ||
714 | The computation of nullable is broken: it doesn't handle empty | |
715 | RHS's properly. | |
716 | ||
717 | * tests/torture.at (GNU AWK Grammar): New. | |
718 | * tests/sets.at (Nullable): New. | |
719 | * src/nullable.c (set_nullable): Instead of blindly looping over | |
720 | `ritems', loop over the rules, and then over their rhs's. | |
721 | ||
722 | Work around Autotest bugs. | |
723 | ||
724 | * src/warshall.c (bitmatrix_print): Don't use `+--+' as table | |
725 | frame, because Autotest understand lines starting with a `+' as | |
726 | traces from the shell. Then, they are not processed properly. | |
727 | Admittedly an Autotest bug, but we don't have time to wait for | |
728 | Autotest to catch up. | |
729 | * tests/regression.at (Broken Closure): Adjust to the new table | |
730 | frames. | |
731 | Move to... | |
732 | * tests/sets.at: here. | |
733 | ||
734 | 2001-12-13 Akim Demaille <akim@epita.fr> | |
735 | ||
736 | * src/closure.c (closure): Use nrules instead of playing tricks | |
737 | with BITS_PER_WORD. | |
738 | ||
739 | 2001-12-13 Akim Demaille <akim@epita.fr> | |
740 | ||
741 | * src/print.c (print_actions): Output the handling of `$' as the | |
742 | traces do: shifting the token EOF. Before EOF was treated as a | |
743 | nonterminal. | |
744 | * tests/regression.at: Adjust some tests. | |
745 | * src/print_graph.c (print_core): Complete the set of items via | |
746 | closure. The next-to-final and final states are still unsatisfying, | |
747 | but that's to be addressed elsewhere. | |
748 | No longer output the rule numbers, but do output the state number. | |
749 | A single loop for the shifts + gotos is enough, but picked a | |
750 | distinct color for each. | |
751 | (print_graph): Initialize and finalize closure. | |
752 | ||
753 | 2001-12-13 Akim Demaille <akim@epita.fr> | |
754 | ||
755 | * src/reader.c (readgram): Remove dead code, an strip useless | |
756 | braces. | |
757 | (get_type): Remove, unused. | |
758 | ||
759 | 2001-12-12 Akim Demaille <akim@epita.fr> | |
760 | ||
761 | * src/complain.h, src/complain.c: Remove error_one_per_line, rely | |
762 | on that of lib/error.c. | |
763 | ||
764 | 2001-12-12 Akim Demaille <akim@epita.fr> | |
765 | ||
766 | Some hosts don't like `/' in includes. | |
767 | ||
768 | * src/system.h: Include libgettext.h without qualifying the path. | |
769 | * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove | |
770 | $(top_srcdir). | |
771 | ||
772 | 2001-12-11 Marc Autret <autret_m@epita.fr> | |
773 | ||
774 | * src/output.c (output_parser): Remove useless muscle. | |
775 | ||
776 | 2001-12-11 Marc Autret <autret_m@epita.fr> | |
777 | ||
778 | * src/bison.simple: Remove #line just before %%epilogue. It | |
779 | is now handled in ... | |
780 | * src/reader.c (read_additionnal_code): Add the output of a | |
781 | #line for the epilogue. | |
782 | ||
783 | 2001-12-10 Marc Autret <autret_m@epita.fr> | |
784 | ||
785 | * src/reader.c (copy_definition): Re-use CPP-outed code which | |
786 | replace precedent remove. | |
787 | * src/bison.simple: Remove #line before %%prologue because | |
788 | %%input-line is wrong at this time. | |
789 | ||
790 | 2001-12-10 Marc Autret <autret_m@epita.fr> | |
791 | ||
792 | * src/reader.c (symbols_output): Clean up. | |
793 | * src/output.c (output_gram, output): Clean up. | |
794 | ||
795 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
796 | ||
797 | * src/lalr.c (initialize_lookaheads): New. Extracted from... | |
798 | * src/LR0.c (set_state_table): here. | |
799 | * src/lalr.c (lalr): Call it. | |
800 | ||
801 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
802 | ||
803 | * src/state.h (shifts): Remove the `number' member: shifts are | |
804 | attached to state, hence no longer need to be labelled with a | |
805 | state number. | |
806 | ||
807 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
808 | ||
809 | Now that states have a complete set of members, the linked list of | |
810 | shifts is useless: just fill directly the state's shifts member. | |
811 | ||
812 | * src/state.h (shifts): Remove the `next' member. | |
813 | * src/LR0.c (first_state, last_state): Remove. | |
814 | Adjust the callers. | |
815 | (augment_automaton): Don't look for the shifts that must be added | |
816 | a shift on EOF: it is those of the state we looked for! But now, | |
817 | since shifts are attached, it is no longer needed to looking | |
818 | merely by its id: its number. | |
819 | ||
820 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
821 | ||
822 | * src/LR0.c (augment_automaton): Better variable locality. | |
823 | Remove an impossible branch: if there is a state corresponding to | |
824 | the start symbol being shifted, then there is shift for the start | |
825 | symbol from the initial state. | |
826 | ||
827 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
828 | ||
829 | * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state' | |
830 | only when appropriate: when insert_start_shifting_state' is not | |
831 | invoked. | |
832 | * tests/regression.at (Rule Line Numbers): Adjust. | |
833 | ||
834 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
835 | ||
836 | * src/LR0.c (augment_automaton): Now that all states have shifts, | |
837 | merge the two cases addition shifts to the initial state. | |
838 | ||
839 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
840 | ||
841 | * src/lalr.c (set_state_table): Move to... | |
842 | * src/LR0.c: here. | |
843 | * src/lalr.c (lalr): Don't call it... | |
844 | * src/LR0.c (generate_states): do it. | |
845 | * src/LR0.h (first_state): Remove, only the table is used. | |
846 | ||
847 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
848 | ||
849 | * src/LR0.h (first_shift, first_reduction): Remove. | |
850 | * src/lalr.c: Don't use first_shift: find shifts through the | |
851 | states. | |
852 | ||
853 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
854 | ||
855 | * src/LR0.c: Attach shifts to states as soon as they are | |
856 | computed. | |
857 | * src/lalr.c (set_state_table): Instead of assigning shifts to | |
858 | state, just assert that the mapping was properly done. | |
859 | ||
860 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
861 | ||
862 | * src/LR0.c (insert_start_shift): Rename as... | |
863 | (insert_start_shifting_state): this. | |
864 | (insert_eof_shifting_state, insert_accepting_state): New. | |
865 | (augment_automaton): Adjust. | |
866 | Better locality of the variables. | |
867 | When looking if the start_symbol is shifted from the initial | |
868 | state, using `while (... symbol != start_symbol ...)' sounds | |
869 | better than `while (... symbol < start_symbol ...)': If fail | |
870 | to see how the order between symbols could be relevant! | |
871 | ||
872 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
873 | ||
874 | * src/getargs.h: Don't declare `spec_name_prefix' and | |
875 | `spec_file_prefix', declared by src/files.h. | |
876 | * src/files.c, src/files.h: Default for spec_name_prefix is "yy". | |
877 | * src/muscle_tab.c (muscle_init): Default prefix to NULL. | |
878 | * src/output.c (prepare): Adjust. | |
879 | * src/reader.c (symbols_output): Likewise. | |
880 | * src/vmsgetargs.c: Vaguely adjust, but who cares? | |
881 | ||
882 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
883 | ||
884 | * src/muscle_tab.c (muscle_init): NULL is a better default than | |
885 | `"0"'. | |
886 | ||
887 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
888 | ||
889 | * src/reader.c (reader): Calling symbols_output once is enough. | |
890 | ||
891 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
892 | ||
893 | Now that states have a complete set of members, the linked list of | |
894 | reductions is useless: just fill directly the state's reductions | |
895 | member. | |
896 | ||
897 | * src/state.h (struct reductions): Remove member `number' and | |
898 | `next'. | |
899 | * src/LR0.c (first_reduction, last_reduction): Remove. | |
900 | (save_reductions): Don't link the new reductions, store them in | |
901 | this_state. | |
902 | * src/lalr.c (set_state_table): No need to attach reductions to | |
903 | states, it's already done. | |
904 | * src/output.c (output_actions): No longer free the shifts, then | |
905 | the reductions, then the states: free all the states and their | |
906 | members. | |
907 | ||
908 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
909 | ||
910 | * src/options.c (OPTN, DRTV, BOTH): New. | |
911 | (option_table): Use them. | |
912 | ||
913 | * src/muscle_tab.c: Don't include xalloc.h and string.h: that's | |
914 | the job of system.h. | |
915 | * src/options.c: Don't include stdio.h and xalloc.h for the same | |
916 | reasons. | |
917 | ||
918 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
919 | ||
920 | * src/output.c (output, prepare): Make sure the values of the | |
921 | muscles `action' and `prologue' are 0-terminated. | |
922 | ||
923 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
924 | ||
925 | Clean up GCC warnings. | |
926 | ||
927 | * src/reader.c (copy_action): `buf' is not used. | |
928 | (parse_skel_decl): Be static. | |
929 | * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'. | |
930 | * src/options.h (create_long_option_table): Have a real prototype. | |
931 | * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete) | |
932 | (hash_delete_at): Return const void *. | |
933 | Adjust casts to preserve the const. | |
934 | ||
935 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
936 | ||
937 | * configure.in: Require 2.52g. | |
938 | M4 is not needed, but AUTOM4TE is. | |
939 | * m4/m4.m4: Remove. | |
940 | * tests/Makefile.am: Adjust. | |
941 | ||
942 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
943 | ||
944 | One structure for states is enough, even though theoretically | |
945 | there are LR(0) states and LALR(1) states. | |
946 | ||
947 | * src/lalr.h (state_t): Remove. | |
948 | (state_table): Be state_t **, not state_t *. | |
949 | * src/state.h (core, CORE_ALLOC): Rename as... | |
950 | (state_t, STATE_ALLOC): this. | |
951 | Add the LALR(1) members: shifts, reductions, errs. | |
952 | * src/LR0.c (state_table): Rename as... | |
953 | (state_hash): this, to avoid name clashes with the global | |
954 | `state_table'. | |
955 | * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c | |
956 | * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust. | |
957 | ||
958 | 2001-12-10 Akim Demaille <akim@epita.fr> | |
959 | ||
960 | Bison dumps core on bash.y. | |
961 | Reported by Pascal Bart. | |
962 | ||
963 | * src/warshall.c (bitmatrix_print): New. | |
964 | (TC): Use it. | |
965 | When performing a transitive closure R(i, j) && R(j, k) => R(i, k), | |
966 | j must be the outer loop. | |
967 | * tests/regression.at (Broken Closure): New. | |
968 | ||
969 | 2001-12-05 Akim Demaille <akim@epita.fr> | |
970 | ||
971 | * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and | |
972 | its argument. | |
973 |