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