]>
Commit | Line | Data |
---|---|---|
3f96f4dc AD |
1 | 2001-12-15 Akim Demaille <akim@epita.fr> |
2 | ||
3 | Attach actions to rules, instead of pre-outputting them to | |
4 | actions_obstack. | |
5 | ||
6 | * src/gram.h (rule_t): action and action_line are new members. | |
7 | * src/reader.c (symbol_list): Likewise. | |
8 | (copy_action): Save the actions within the rule. | |
9 | (packgram): Save them in rule_table. | |
10 | * src/output.c (actions_output): New. | |
11 | (output_parser): Use it on `%%actions'. | |
12 | (output_rule_data): Don't free rule_table. | |
13 | (output): Do it. | |
14 | (prepare): Don't save the `action' muscle. | |
15 | * src/bison.simple: s/%%action/%%actions/. | |
16 | ||
51576fb3 AD |
17 | 2001-12-15 Akim Demaille <akim@epita.fr> |
18 | ||
19 | * src/reader.c (copy_action): When --yacc, don't append a `;' | |
20 | to the user action: let it fail if lacking. | |
21 | Suggested by Aharon Robbins and Tom Tromey. | |
22 | ||
2648a72d AD |
23 | 2001-12-14 Akim Demaille <akim@epita.fr> |
24 | ||
25 | * src/lex.c (literalchar): Simply return the char you decoded, non | |
26 | longer mess around with obstacks and int pointers. | |
27 | Adjust all callers. | |
28 | ||
92790e5b AD |
29 | 2001-12-14 Akim Demaille <akim@epita.fr> |
30 | ||
31 | * src/lex.c (literalchar): Don't escape the special characters, | |
32 | just decode them, and keep them as char (before, eol was output as | |
33 | the 2 char string `\n' etc.). | |
34 | * src/output.c (output_rule_data): Use quotearg to output the | |
35 | token strings. | |
36 | ||
927c1557 PE |
37 | 2001-12-13 Paul Eggert <eggert@twinsun.com> |
38 | ||
39 | * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE): | |
40 | Do not infringe on the global user namespace when using C++. | |
41 | (YYFPRINTF, YYSTDERR): New macros, needed for the above. | |
42 | All uses of `fprintf' and `stderr' changed. | |
43 | ||
44 | * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR. | |
45 | ||
ed8e1f68 AD |
46 | 2001-12-13 Akim Demaille <akim@epita.fr> |
47 | ||
48 | The computation of nullable is broken: it doesn't handle empty | |
49 | RHS's properly. | |
50 | ||
51 | * tests/torture.at (GNU AWK Grammar): New. | |
52 | * tests/sets.at (Nullable): New. | |
53 | * src/nullable.c (set_nullable): Instead of blindly looping over | |
54 | `ritems', loop over the rules, and then over their rhs's. | |
55 | ||
56 | Work around Autotest bugs. | |
57 | ||
58 | * src/warshall.c (bitmatrix_print): Don't use `+--+' as table | |
59 | frame, because Autotest understand lines starting with a `+' as | |
60 | traces from the shell. Then, they are not processed properly. | |
61 | Admittedly an Autotest bug, but we don't have time to wait for | |
62 | Autotest to catch up. | |
63 | * tests/regression.at (Broken Closure): Adjust to the new table | |
64 | frames. | |
65 | Move to... | |
66 | * tests/sets.at: here. | |
67 | ||
cb581495 AD |
68 | 2001-12-13 Akim Demaille <akim@epita.fr> |
69 | ||
70 | * src/closure.c (closure): Use nrules instead of playing tricks | |
71 | with BITS_PER_WORD. | |
72 | ||
2e729273 AD |
73 | 2001-12-13 Akim Demaille <akim@epita.fr> |
74 | ||
75 | * src/print.c (print_actions): Output the handling of `$' as the | |
76 | traces do: shifting the token EOF. Before EOF was treated as a | |
77 | nonterminal. | |
78 | * tests/regression.at: Adjust some tests. | |
79 | * src/print_graph.c (print_core): Complete the set of items via | |
80 | closure. The next-to-final and final states are still unsatisfying, | |
81 | but that's to be addressed elsewhere. | |
82 | No longer output the rule numbers, but do output the state number. | |
83 | A single loop for the shifts + gotos is enough, but picked a | |
84 | distinct color for each. | |
85 | (print_graph): Initialize and finalize closure. | |
86 | ||
107f7dfb AD |
87 | 2001-12-13 Akim Demaille <akim@epita.fr> |
88 | ||
89 | * src/reader.c (readgram): Remove dead code, an strip useless | |
90 | braces. | |
91 | (get_type): Remove, unused. | |
92 | ||
9b53a24f AD |
93 | 2001-12-12 Akim Demaille <akim@epita.fr> |
94 | ||
95 | * src/complain.h, src/complain.c: Remove error_one_per_line, rely | |
96 | on that of lib/error.c. | |
97 | ||
dbfb6dcd AD |
98 | 2001-12-12 Akim Demaille <akim@epita.fr> |
99 | ||
100 | Some hosts don't like `/' in includes. | |
101 | ||
102 | * src/system.h: Include libgettext.h without qualifying the path. | |
103 | * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove | |
104 | $(top_srcdir). | |
105 | ||
c25fb648 MA |
106 | 2001-12-11 Marc Autret <autret_m@epita.fr> |
107 | ||
108 | * src/output.c (output_parser): Remove useless muscle. | |
109 | ||
710ddc4f MA |
110 | 2001-12-11 Marc Autret <autret_m@epita.fr> |
111 | ||
112 | * src/bison.simple: Remove #line just before %%epilogue. It | |
113 | is now handled in ... | |
114 | * src/reader.c (read_additionnal_code): Add the output of a | |
115 | #line for the epilogue. | |
116 | ||
e83d80b8 MA |
117 | 2001-12-10 Marc Autret <autret_m@epita.fr> |
118 | ||
927c1557 | 119 | * src/reader.c (copy_definition): Re-use CPP-outed code which |
e83d80b8 MA |
120 | replace precedent remove. |
121 | * src/bison.simple: Remove #line before %%prologue because | |
122 | %%input-line is wrong at this time. | |
123 | ||
971d5158 MA |
124 | 2001-12-10 Marc Autret <autret_m@epita.fr> |
125 | ||
126 | * src/reader.c (symbols_output): Clean up. | |
927c1557 | 127 | * src/output.c (output_gram, output): Clean up. |
971d5158 | 128 | |
5edafffd AD |
129 | 2001-12-10 Akim Demaille <akim@epita.fr> |
130 | ||
131 | * src/lalr.c (initialize_lookaheads): New. Extracted from... | |
132 | * src/LR0.c (set_state_table): here. | |
133 | * src/lalr.c (lalr): Call it. | |
134 | ||
0279f8e9 AD |
135 | 2001-12-10 Akim Demaille <akim@epita.fr> |
136 | ||
137 | * src/state.h (shifts): Remove the `number' member: shifts are | |
138 | attached to state, hence no longer need to be labelled with a | |
139 | state number. | |
140 | ||
190c4f5f AD |
141 | 2001-12-10 Akim Demaille <akim@epita.fr> |
142 | ||
143 | Now that states have a complete set of members, the linked list of | |
144 | shifts is useless: just fill directly the state's shifts member. | |
145 | ||
146 | * src/state.h (shifts): Remove the `next' member. | |
147 | * src/LR0.c (first_state, last_state): Remove. | |
148 | Adjust the callers. | |
149 | (augment_automaton): Don't look for the shifts that must be added | |
150 | a shift on EOF: it is those of the state we looked for! But now, | |
151 | since shifts are attached, it is no longer needed to looking | |
152 | merely by its id: its number. | |
153 | ||
2a73b93d AD |
154 | 2001-12-10 Akim Demaille <akim@epita.fr> |
155 | ||
156 | * src/LR0.c (augment_automaton): Better variable locality. | |
157 | Remove an impossible branch: if there is a state corresponding to | |
158 | the start symbol being shifted, then there is shift for the start | |
159 | symbol from the initial state. | |
160 | ||
74392f6a AD |
161 | 2001-12-10 Akim Demaille <akim@epita.fr> |
162 | ||
163 | * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state' | |
164 | only when appropriate: when insert_start_shifting_state' is not | |
165 | invoked. | |
166 | * tests/regression.at (Rule Line Numbers): Adjust. | |
167 | ||
37c82725 AD |
168 | 2001-12-10 Akim Demaille <akim@epita.fr> |
169 | ||
170 | * src/LR0.c (augment_automaton): Now that all states have shifts, | |
171 | merge the two cases addition shifts to the initial state. | |
172 | ||
6a164e0c AD |
173 | 2001-12-10 Akim Demaille <akim@epita.fr> |
174 | ||
175 | * src/lalr.c (set_state_table): Move to... | |
176 | * src/LR0.c: here. | |
177 | * src/lalr.c (lalr): Don't call it... | |
178 | * src/LR0.c (generate_states): do it. | |
179 | * src/LR0.h (first_state): Remove, only the table is used. | |
180 | ||
7215de24 AD |
181 | 2001-12-10 Akim Demaille <akim@epita.fr> |
182 | ||
183 | * src/LR0.h (first_shift, first_reduction): Remove. | |
184 | * src/lalr.c: Don't use first_shift: find shifts through the | |
185 | states. | |
186 | ||
80e25d4d AD |
187 | 2001-12-10 Akim Demaille <akim@epita.fr> |
188 | ||
189 | * src/LR0.c: Attach shifts to states as soon as they are | |
190 | computed. | |
191 | * src/lalr.c (set_state_table): Instead of assigning shifts to | |
192 | state, just assert that the mapping was properly done. | |
193 | ||
0ab3728b AD |
194 | 2001-12-10 Akim Demaille <akim@epita.fr> |
195 | ||
196 | * src/LR0.c (insert_start_shift): Rename as... | |
197 | (insert_start_shifting_state): this. | |
198 | (insert_eof_shifting_state, insert_accepting_state): New. | |
199 | (augment_automaton): Adjust. | |
200 | Better locality of the variables. | |
201 | When looking if the start_symbol is shifted from the initial | |
202 | state, using `while (... symbol != start_symbol ...)' sounds | |
203 | better than `while (... symbol < start_symbol ...)': If fail | |
204 | to see how the order between symbols could be relevant! | |
205 | ||
78af9bbc AD |
206 | 2001-12-10 Akim Demaille <akim@epita.fr> |
207 | ||
208 | * src/getargs.h: Don't declare `spec_name_prefix' and | |
209 | `spec_file_prefix', declared by src/files.h. | |
210 | * src/files.c, src/files.h: Default for spec_name_prefix is "yy". | |
211 | * src/muscle_tab.c (muscle_init): Default prefix to NULL. | |
212 | * src/output.c (prepare): Adjust. | |
213 | * src/reader.c (symbols_output): Likewise. | |
214 | * src/vmsgetargs.c: Vaguely adjust, but who cares? | |
215 | ||
bdef2a41 AD |
216 | 2001-12-10 Akim Demaille <akim@epita.fr> |
217 | ||
218 | * src/muscle_tab.c (muscle_init): NULL is a better default than | |
219 | `"0"'. | |
220 | ||
3735969c AD |
221 | 2001-12-10 Akim Demaille <akim@epita.fr> |
222 | ||
223 | * src/reader.c (reader): Calling symbols_output once is enough. | |
224 | ||
49701457 AD |
225 | 2001-12-10 Akim Demaille <akim@epita.fr> |
226 | ||
227 | Now that states have a complete set of members, the linked list of | |
228 | reductions is useless: just fill directly the state's reductions | |
229 | member. | |
230 | ||
231 | * src/state.h (struct reductions): Remove member `number' and | |
232 | `next'. | |
233 | * src/LR0.c (first_reduction, last_reduction): Remove. | |
234 | (save_reductions): Don't link the new reductions, store them in | |
235 | this_state. | |
236 | * src/lalr.c (set_state_table): No need to attach reductions to | |
237 | states, it's already done. | |
238 | * src/output.c (output_actions): No longer free the shifts, then | |
239 | the reductions, then the states: free all the states and their | |
240 | members. | |
241 | ||
0edad749 AD |
242 | 2001-12-10 Akim Demaille <akim@epita.fr> |
243 | ||
244 | * src/options.c (OPTN, DRTV, BOTH): New. | |
245 | (option_table): Use them. | |
246 | ||
0edad749 AD |
247 | * src/muscle_tab.c: Don't include xalloc.h and string.h: that's |
248 | the job of system.h. | |
249 | * src/options.c: Don't include stdio.h and xalloc.h for the same | |
250 | reasons. | |
251 | ||
5449dd0f AD |
252 | 2001-12-10 Akim Demaille <akim@epita.fr> |
253 | ||
254 | * src/output.c (output, prepare): Make sure the values of the | |
255 | muscles `action' and `prologue' are 0-terminated. | |
256 | ||
a870c567 AD |
257 | 2001-12-10 Akim Demaille <akim@epita.fr> |
258 | ||
259 | Clean up GCC warnings. | |
260 | ||
261 | * src/reader.c (copy_action): `buf' is not used. | |
262 | (parse_skel_decl): Be static. | |
263 | * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'. | |
264 | * src/options.h (create_long_option_table): Have a real prototype. | |
265 | * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete) | |
266 | (hash_delete_at): Return const void *. | |
267 | Adjust casts to preserve the const. | |
268 | ||
80df8768 AD |
269 | 2001-12-10 Akim Demaille <akim@epita.fr> |
270 | ||
271 | * configure.in: Require 2.52g. | |
272 | M4 is not needed, but AUTOM4TE is. | |
273 | * m4/m4.m4: Remove. | |
274 | * tests/Makefile.am: Adjust. | |
275 | ||
f693ad14 AD |
276 | 2001-12-10 Akim Demaille <akim@epita.fr> |
277 | ||
278 | One structure for states is enough, even though theoretically | |
279 | there are LR(0) states and LALR(1) states. | |
280 | ||
281 | * src/lalr.h (state_t): Remove. | |
282 | (state_table): Be state_t **, not state_t *. | |
283 | * src/state.h (core, CORE_ALLOC): Rename as... | |
284 | (state_t, STATE_ALLOC): this. | |
285 | Add the LALR(1) members: shifts, reductions, errs. | |
286 | * src/LR0.c (state_table): Rename as... | |
287 | (state_hash): this, to avoid name clashes with the global | |
288 | `state_table'. | |
289 | * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c | |
290 | * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust. | |
291 | ||
74ffbcb6 AD |
292 | 2001-12-10 Akim Demaille <akim@epita.fr> |
293 | ||
294 | Bison dumps core on bash.y. | |
295 | Reported by Pascal Bart. | |
296 | ||
297 | * src/warshall.c (bitmatrix_print): New. | |
298 | (TC): Use it. | |
299 | When performing a transitive closure R(i, j) && R(j, k) => R(i, k), | |
300 | j must be the outer loop. | |
301 | * tests/regression.at (Broken Closure): New. | |
302 | ||
07708e19 AD |
303 | 2001-12-05 Akim Demaille <akim@epita.fr> |
304 | ||
305 | * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and | |
306 | its argument. | |
307 |