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