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