]> git.saurik.com Git - bison.git/blame - ChangeLog
* configure.in (AC_INIT): Bump to 1.49b.
[bison.git] / ChangeLog
CommitLineData
6cbfbcc5
AD
12002-05-02 Akim Demaille <akim@epita.fr>
2
3 * configure.in (AC_INIT): Bump to 1.49b.
4 (AM_INIT_AUTOMAKE): Short invocation.
5
b8548114
AD
62002-05-02 Akim Demaille <akim@epita.fr>
7
8 Version 1.49a.
9
c20cd1fa
AD
102002-05-01 Akim Demaille <akim@epita.fr>
11
12 * src/skeleton.h: Remove.
13
8a9566d4
AD
142002-05-01 Akim Demaille <akim@epita.fr>
15
16 * src/skeleton.h: Fix the #endif.
17 Reported by Magnus Fromreide.
18
8c6d399a
PE
192002-04-26 Paul Eggert <eggert@twinsun.com>
20
21 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
22 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 23 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 24
2b7ed18a
RA
252002-04-25 Robert Anisko <robert@lrde.epita.fr>
26
27 * src/scan-skel.l: Postprocess quadrigraphs.
28
29 * src/reader.c (copy_character): New function, used to output
30 single characters while replacing `[' and `]' with quadrigraphs, to
31 avoid troubles with M4 quotes.
32 (copy_comment): Output characters with copy_character.
33 (read_additionnal_code): Likewise.
34 (copy_string2): Likewise.
35 (copy_definition): Likewise.
36
37 * tests/calc.at: Exercise M4 quoting.
38
34a89c50
AD
392002-04-25 Akim Demaille <akim@epita.fr>
40
41 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
42 between `!' and the command.
43 Reported by Paul Eggert.
44
0dd1580a
RA
452002-04-24 Robert Anisko <robert@lrde.epita.fr>
46
47 * tests/calc.at: Exercise prologue splitting.
48
49 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
50 `b4_post_prologue' instead of `b4_prologue'.
51
52 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
53 muscles.
54 (output): Free pre_prologue_obstack and post_prologue_obstack.
55 * src/files.h, src/files.c (attrs_obstack): Remove.
56 (pre_prologue_obstack, post_prologue_obstack): New.
57 * src/reader.c (copy_definition): Add a parameter to specify the
58 obstack to fill, instead of using attrs_obstack unconditionally.
59 (read_declarations): Pass pre_prologue_obstack to copy_definition if
60 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
61
83c1796f
PE
622002-04-23 Paul Eggert <eggert@twinsun.com>
63
64 * data/bison.simple: Remove unnecessary commentary and white
65 space differences from 1_29-branch.
66 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
67
68 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
69 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
70 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
71 constructors or destructors.
72
73 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
74
1207eeac
AD
752002-04-23 Akim Demaille <akim@epita.fr>
76
77 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
78 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
79 location with columns.
80 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
81 All reported by Paul Eggert.
82
78ab8f67
AD
832002-04-22 Akim Demaille <akim@epita.fr>
84
85 * src/reduce.c (dump_grammar): Move to...
86 * src/gram.h, src/gram.c (grammar_dump): here.
87 Be sure to separate long item numbers.
88 Don't read the members of a rule's prec if its nil.
89
133c20e2
AD
902002-04-22 Akim Demaille <akim@epita.fr>
91
92 * src/output.c (table_size, table_grow): New.
93 (MAXTABLE): Remove, replace uses with table_size.
94 (pack_vector): Instead of dying when the table is too big, grow it.
95
9515e8a7
AD
962002-04-22 Akim Demaille <akim@epita.fr>
97
98 * data/bison.simple (yyr1): Its type is that of a token number.
99 * data/bison.c++ (r1_): Likewise.
100 * tests/regression.at (Web2c Actions): Adjust.
101
23c5a174
AD
1022002-04-22 Akim Demaille <akim@epita.fr>
103
104 * src/reader.c (token_translations_init): 256 is now the default
105 value for the error token, i.e., it will be assigned another
106 number if the user assigned 256 to one of her tokens.
107 (reader): Don't force 256 to error.
108 * doc/bison.texinfo (Symbols): Adjust.
109 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
110 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
111 etc. instead of 10, 20, 30 (which was used to `jump' over error
112 (256) and undefined (2)).
113
5fbb0954
AD
1142002-04-22 Akim Demaille <akim@epita.fr>
115
116 Propagate more token_number_t.
117
118 * src/gram.h (token_number_as_item_number)
119 (item_number_as_token_number): New.
120 * src/output.c (GENERATE_OUTPUT_TABLE): New.
121 Use it to create output_item_number_table and
122 output_token_number_table.
123 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
124 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
125 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
126 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
127
4f940944
AD
1282002-04-22 Akim Demaille <akim@epita.fr>
129
130 * src/output.h, src/output.c (get_lines_number): Remove.
131
3ded9a63
AD
1322002-04-19 Akim Demaille <akim@epita.fr>
133
134 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
135 as Lex/Flex'.
136 (Debugging): More details about enabling the debugging features.
137 (Table of Symbols): Describe $$, $n, @$, and @n.
138 Suggested by Tim Josling.
139
e0c471a9
AD
1402002-04-19 Akim Demaille <akim@epita.fr>
141
142 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
143
fecc10cd
AD
1442002-04-10 Akim Demaille <akim@epita.fr>
145
146 * src/system.h: Rely on HAVE_LIMITS_H.
147 Suggested by Paul Eggert.
148
51dec47b
AD
1492002-04-09 Akim Demaille <akim@epita.fr>
150
151 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
152 full stderr, and strip it according to the bison options, instead
153 of composing the error message from different bits.
154 This makes it easier to check for several error messages.
155 Adjust all the invocations.
156 Add an invocation exercising the error token.
157 Add an invocation demonstrating a stupid error message.
158 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
159 Adjust the tests.
160 Error message are for stderr, not stdout.
161
007a50a4
AD
1622002-04-09 Akim Demaille <akim@epita.fr>
163
164 * src/gram.h, src/gram.c (error_token_number): Remove, use
165 errtoken->number.
166 * src/reader.c (reader): Don't specify the user token number (2)
167 for $undefined, as it uselessly prevents using it.
168 * src/gram.h (token_number_t): Move to...
169 * src/symtab.h: here.
170 (state_t.number): Is a token_number_t.
171 * src/print.c, src/reader.c: Use undeftoken->number instead of
172 hard coded 2.
173 (Even though this 2 is not the same as above: the number of the
174 undeftoken remains being 2, it is its user token number which
175 might not be 2).
176 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
177 `user_token_number_max'.
178 Output `undef_token_number'.
179 * data/bison.simple, data/bison.c++: Use them.
180 Be sure to map invalid yylex return values to
181 `undef_token_number'. This saves us from gratuitous SEGV.
182
183 * tests/conflicts.at (Solved SR Conflicts)
184 (Unresolved SR Conflicts): Adjust.
185 * tests/regression.at (Web2c Actions): Adjust.
186
06446ccf
AD
1872002-04-08 Akim Demaille <akim@epita.fr>
188
189 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
190 Adding #line.
191 Remove the duplicate `typedefs'.
192 (RhsNumberType): Fix the declaration and various other typos.
193 Use __ofile__.
194 * data/bison.simple: Use __ofile__.
195 * src/scan-skel.l: Handle __ofile__.
196
62a3e4f0
AD
1972002-04-08 Akim Demaille <akim@epita.fr>
198
199 * src/gram.h (item_number_t): New, the type of item numbers in
200 RITEM. Note that it must be able to code symbol numbers as
201 positive number, and the negation of rule numbers as negative
202 numbers.
203 Adjust all dependencies (pretty many).
204 * src/reduce.c (rule): Remove this `short *' pointer: use
205 item_number_t.
206 * src/system.h (MINSHORT, MAXSHORT): Remove.
207 Include `limits.h'.
208 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
209 (shortcpy): Remove.
210 (MAXTABLE): Move to...
211 * src/output.c (MAXTABLE): here.
212 (prepare_rules): Use output_int_table to output rhs.
213 * data/bison.simple, data/bison.c++: Adjust.
214 * tests/torture.at (Big triangle): Move the limit from 254 to
215 500.
216 * tests/regression.at (Web2c Actions): Ajust.
217
218 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
219 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
220 passes, but produces negative #line number, once fixed, GCC is
221 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
222 C), it passes.
223 * src/state.h (state_h): Code input lines on ints, not shorts.
224
bb88b0fc
AD
2252002-04-08 Akim Demaille <akim@epita.fr>
226
227 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
228 and then the grammar.
229
9a636f47
AD
2302002-04-08 Akim Demaille <akim@epita.fr>
231
232 * src/system.h: No longer using strndup.
233
680e8701
AD
2342002-04-07 Akim Demaille <akim@epita.fr>
235
236 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
237 * src/output.c (output_table_data): Return the longest number.
238 (prepare_tokens): Output `token_number_max').
239 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
240 New.
241 Use them to define yy_token_number_type/TokenNumberType.
242 Use this type for yytranslate.
243 * tests/torture.at (Big triangle): Push the limit from 124 to
244 253.
245 * tests/regression.at (Web2c Actions): Adjust.
246
817e9f41
AD
2472002-04-07 Akim Demaille <akim@epita.fr>
248
249 * tests/torture.at (Big triangle): New.
250 (GNU AWK Grammar, GNU Cim Grammar): Move to...
251 * tests/existing.at: here.
252
5123689b
AD
2532002-04-07 Akim Demaille <akim@epita.fr>
254
255 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
256 nritems.
257 Adjust dependencies.
258
f3849179
AD
2592002-04-07 Akim Demaille <akim@epita.fr>
260
261 * src/reader.c: Normalize increments to prefix form.
262
bd02036a
AD
2632002-04-07 Akim Demaille <akim@epita.fr>
264
265 * src/reader.c, symtab.c: Remove debugging code.
266
db8837cb
AD
2672002-04-07 Akim Demaille <akim@epita.fr>
268
269 Rename all the `bucket's as `symbol_t'.
270
271 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
272 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
273 * src/symtab.c, src/symtab.h (bucket): Rename as...
274 (symbol_t): this.
275 (symbol_list_new, bucket_check_defined, bucket_make_alias)
276 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
277 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
278 (buckets_new, buckets_free, buckets_do): Rename as...
279 (symbol_list_new, symbol_check_defined, symbol_make_alias)
280 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
281 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
282 (symbols_new, symbols_free, symbols_do): these.
283
72a23c97
AD
2842002-04-07 Akim Demaille <akim@epita.fr>
285
286 Use lib/hash for the symbol table.
287
288 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
289 EOF.
290 * src/lex.c (lex): Set the `number' member of new terminals.
291 * src/reader.c (bucket_check_defined, bucket_make_alias)
292 (bucket_check_alias_consistence, bucket_translation): New.
293 (reader, grammar_free, readgram, token_translations_init)
294 (packsymbols): Adjust.
295 (reader): Number the predefined tokens.
296 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
297 for predefined tokens.
298 * src/symtab.h (bucket): Remove all the hash table related
299 members.
300 * src/symtab.c (symtab): Replace by...
301 (bucket_table): this.
302 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
303 (buckets_new, buckets_do): New.
304
280a38c3
AD
3052002-04-07 Akim Demaille <akim@epita.fr>
306
307 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
308 (start_symbol, max_user_token_number, semantic_parser)
309 (error_token_number): Initialize.
310 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
311 Initialize.
312 (reader): Don't.
313 (errtoken, eoftoken, undeftoken, axiom): Extern.
314
03b31c0c
AD
3152002-04-07 Akim Demaille <akim@epita.fr>
316
317 * src/gram.h (rule_s): prec and precsym are now pointers
318 to the bucket giving the priority/associativity.
319 Member `associativity' removed: useless.
320 * src/reduce.c, src/conflicts.c: Adjust.
321
8b3df748
AD
3222002-04-07 Akim Demaille <akim@epita.fr>
323
324 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
325 Properly escape the symbols' TAG when outputting them.
326
e601aa1d
AD
3272002-04-07 Akim Demaille <akim@epita.fr>
328
329 * src/lalr.h (LA): Is a bitsetv, not bitset*.
330
b0299a2e
AD
3312002-04-07 Akim Demaille <akim@epita.fr>
332
333 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
334 (LArule): this, which is an array to rule_t*.
335 * src/print.c, src/conflicts.c: Adjust.
336
d7e1f00c
AD
3372002-04-07 Akim Demaille <akim@epita.fr>
338
339 * src/gram.h (rule_t): Rename `number' as `user_number'.
340 `number' is a new member.
341 Adjust dependencies.
342 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
343
cc9305dd
AD
3442002-04-07 Akim Demaille <akim@epita.fr>
345
346 As a result of the previous patch, it is no longer needed
347 to reorder ritem itself.
348
349 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
350
b0940840
AD
3512002-04-07 Akim Demaille <akim@epita.fr>
352
353 Be sure never to walk through RITEMS, but use only data related to
354 the rules themselves. RITEMS should be banished.
355
356 * src/output.c (output_token_translations): Rename as...
357 (prepare_tokens): this.
358 In addition to `translate', prepare the muscles `tname' and
359 `toknum', which were handled by...
360 (output_rule_data): this.
361 Remove, and move the remainder of its outputs into...
362 (prepare_rules): this new routines, which also merges content from
363 (output_gram): this.
364 (prepare_rules): Be sure never to walk through RITEMS.
365 (output_stos): Rename as...
366 (prepare_stos): this.
367 (output): Always invoke prepare_states, after all, just don't use it
368 in the output if you don't need it.
369
643a5994
AD
3702002-04-07 Akim Demaille <akim@epita.fr>
371
372 * src/LR0.c (new_state): Display `nstates' as the name of the
373 newly created state.
374 Adjust to initialize first_state and last_state if needed.
375 Be sure to distinguish the initial from the final state.
376 (new_states): Create the itemset of the initial state, and use
377 new_state.
378 * src/closure.c (closure): Now that the initial state has its
379 items properly set, there is no need for a special case when
380 creating `ruleset'.
381
382 As a result, now the rule 0, reducing to $axiom, is visible in the
383 outputs. Adjust the test suite.
384
385 * tests/conflicts.at (Solved SR Conflicts)
386 (Unresolved SR Conflicts): Adjust.
387 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
388 * tests/conflicts.at (S/R in initial): New.
389
b4c4ccc2
AD
3902002-04-07 Akim Demaille <akim@epita.fr>
391
392 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
393 the RHS of the rules.
394 * src/output.c (output_gram): Likewise.
395
bba97eb2
AD
3962002-04-07 Akim Demaille <akim@epita.fr>
397
398 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
399 bucket.
400 Adjust all dependencies.
401 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
402 `number' of the buckets too.
403 * src/gram.h: Include `symtab.h'.
404 (associativity): Move to...
405 * src/symtab.h: here.
406 No longer include `gram.h'.
407
c3b407f4
AD
4082002-04-07 Akim Demaille <akim@epita.fr>
409
410 * src/gram.h, src/gram.c (rules_rhs_length): New.
411 (ritem_longest_rhs): Use it.
412 * src/gram.h (rule_t): `number' is a new member.
413 * src/reader.c (packgram): Set it.
414 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
415 the end of `rules', and count them out of `nrules'.
416 (reduce_output, dump_grammar): Adjust.
417 * src/print.c (print_grammar): It is no longer needed to check for
418 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
419 * tests/reduce.at (Reduced Automaton): New test.
420
11652ab3
AD
4212002-04-07 Akim Demaille <akim@epita.fr>
422
423 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
424 lacking `+ 1' to nrules, Bison reported as useless a token if it
425 was used solely to set the precedence of the last rule...
426
26b23c1a
AD
4272002-04-07 Akim Demaille <akim@epita.fr>
428
429 * data/bison.c++, data/bison.simple: Don't output the current file
430 name in #line, to avoid useless diffs between two identical
431 outputs under different names.
432
18bcecb0
AD
4332002-04-07 Akim Demaille <akim@epita.fr>
434
435 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
436 Normalize loops to using `< nrules + 1', not `<= nrules'.
437
fa770c86
AD
4382002-04-07 Akim Demaille <akim@epita.fr>
439
440 * TODO: Update.
441
d9b739c3
AD
4422002-04-07 Akim Demaille <akim@epita.fr>
443
444 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
445 bucket.value as bucket.number.
446
99013900
AD
4472002-04-07 Akim Demaille <akim@epita.fr>
448
449 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
450 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
451 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
452 RHS, instead of being an index in RITEMS.
453
e966383b
PE
4542002-04-04 Paul Eggert <eggert@twinsun.com>
455
456 * doc/bison.texinfo: Update copyright date.
457 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
458 (Symbols): Warn about running Bison in one character set,
459 but compiling and/or running in an incompatible one.
460 Warn about character code 256, too.
461
4622002-04-03 Paul Eggert <eggert@twinsun.com>
463
464 * src/bison.data (YYSTACK_ALLOC): Depend on whether
465 YYERROR_VERBOSE is nonzero, not whether it is defined.
466
467 Merge changes from bison-1_29-branch.
c307773e 468
8d6c48b9
PE
4692002-03-20 Paul Eggert <eggert@twinsun.com>
470
471 Merge fixes from Debian bison_1.34-1.diff.
472
473 * configure.in (AC_PREREQ): 2.53.
474
e53c6322
AD
4752002-03-20 Akim Demaille <akim@epita.fr>
476
477 * src/conflicts.c (log_resolution): Argument `resolution' is const.
478
9ffbeca7
PE
4792002-03-19 Paul Eggert <eggert@twinsun.com>
480
21db0b2a
PE
481 * src/bison.simple (YYCOPY): New macro.
482 (YYSTACK_RELOCATE): Use it.
483 Remove Type arg; no longer needed. All callers changed.
484 (yymemcpy): Remove; no longer needed.
485
9ffbeca7
PE
486 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
487 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
488
642cb8f8
AD
4892002-03-19 Akim Demaille <akim@epita.fr>
490
491 Test and fix the #line outputs.
492
493 * tests/atlocal.at (GCC): New.
494 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
495 (Prologue synch line, ,%union synch line, Postprologue synch line)
496 (Action synch line, Epilogue synch line): New tests.
497 * src/reader.c (parse_union_decl): Define the muscle stype_line.
498 * data/bison.simple, data/bison.c++: Use it.
499
3c31a486
AD
5002002-03-19 Akim Demaille <akim@epita.fr>
501
502 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
503 (Solved SR Conflicts, %expect not enough, %expect right)
504 (%expect too much): Move to...
505 * tests/conflicts.at: this new file.
506
0d8bed56
AD
5072002-03-19 Akim Demaille <akim@epita.fr>
508
509 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
510 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
511 that we can move to enums for instance.
512 * src/output.c (token_definitions_output): Output a list of
513 `token-name, token-number' instead of the #define.
514 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
515
9208d17f
AD
5162002-03-14 Akim Demaille <akim@epita.fr>
517
518 Use Gettext 0.11.1.
519
af27eacb
RA
5202002-03-09 Robert Anisko <robert@lrde.epita.fr>
521
522 * data/bison.c++: Make the user able to add members to the generated
523 parser by subclassing.
524
9101a310
RA
5252002-03-05 Robert Anisko <robert@lrde.epita.fr>
526
527 * src/reader.c (read_additionnal_code): `c' should be an integer, not
528 a character.
529 Reported by Nicolas Tisserand and Nicolas Burrus.
530
fff9bf0b
RA
5312002-03-04 Robert Anisko <robert@lrde.epita.fr>
532
533 * src/reader.c: Warn about lacking semi-colons, do not complain.
534
64dba31e
RA
5352002-03-04 Robert Anisko <robert@lrde.epita.fr>
536
537 * data/bison.c++: Remove a debug line.
538
374f5a14
RA
5392002-03-04 Robert Anisko <robert@lrde.epita.fr>
540
541 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
542 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
543 provide a default implementation.
544
bfcf1f3a
AD
5452002-03-04 Akim Demaille <akim@epita.fr>
546
547 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
548 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
549 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
550 * tests/semantic.at (Parsing Guards): Similarly.
551 * src/reader.at (readgram): Complain if the last rule is not ended
552 with a semi-colon.
553
65ccf9fc
AD
5542002-03-04 Akim Demaille <akim@epita.fr>
555
556 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
557 * src/closure.c: here.
558 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
559 RTC.
560 * src/warshall.h, src/warshall.c: Remove.
561 * tests/sets.at (Broken Closure): Adjust.
562
d0039cbc
AD
5632002-03-04 Akim Demaille <akim@epita.fr>
564
565 * src/output.c (output_skeleton): tempdir is const.
566 bytes_read is unused.
567
345cea78
AD
5682002-03-04 Akim Demaille <akim@epita.fr>
569
570 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
571 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
572 Update.
573 From Michael Hayes.
574
564801f7
AD
5752002-03-04 Akim Demaille <akim@epita.fr>
576
577 * src/closure.c (closure): `r' is unused.
578
e5352bc7
AD
5792002-03-04 Akim Demaille <akim@epita.fr>
580
581 * tests/sets.at (Broken Closure): Add the ending `;'.
582 * src/reader.at (readgram): Complain if a rule is not ended with a
583 semi-colon.
584
914feea9
AD
5852002-03-04 Akim Demaille <akim@epita.fr>
586
587 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
588 (count_sr_conflicts): Use bitset_count.
589 * src/reduce.c (inaccessable_symbols): Ditto.
590 (bits_size): Remove.
591 * src/warshall.h, src/warshall.c: Convert to bitsetv.
592
f0250de6
AD
5932002-03-04 Akim Demaille <akim@epita.fr>
594
595 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
596 * src/reduce.c: Remove the `bitset_zero's following the
597 `bitset_create's, as now it is performed by the latter.
598
ef017502
AD
5992002-03-04 Akim Demaille <akim@epita.fr>
600
601 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
602 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
603 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
604 latest sources from Michael.
605
76514394
AD
6062002-03-04 Akim Demaille <akim@epita.fr>
607
608 * src/output.c (output): Don't free the grammar.
609 * src/reader.c (grammar_free): New.
610 * src/main.c (main): Call it and don't free symtab here.
611
55024580
AD
6122002-03-04 Akim Demaille <akim@epita.fr>
613
614 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
615 before returning.
616 Reported by Benoit Perrot.
617
f9abaa2c
AD
6182002-03-04 Akim Demaille <akim@epita.fr>
619
620 Use bitset operations when possible, not loops over bits.
621
622 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
623 bitset_or.
624 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
625 * src/reduce.c (useless_nonterminals): Formatting changes.
626 * src/warshall.c (TC): Use bitset_or.
627
0e721e75
AD
6282002-03-04 Akim Demaille <akim@epita.fr>
629
630 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
631 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
632 Ditto.
633
0fb1ffb1
AD
6342002-03-04 Akim Demaille <akim@epita.fr>
635
636 * src/lalr.c (F): Now a bitset*.
637 Adjust all dependencies.
638
b86796bf
AD
6392002-03-04 Akim Demaille <akim@epita.fr>
640
641 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
642 Adjust all dependencies.
643
602bbf31
AD
6442002-03-04 Akim Demaille <akim@epita.fr>
645
646 * src/L0.c, src/LR0.h (nstates): Be size_t.
647 Adjust comparisons (signed vs unsigned).
648 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
649 bitset*.
650 Adjust all dependencies.
651
d8a0245c
AD
6522002-03-04 Akim Demaille <akim@epita.fr>
653
654 * src/closure.c (firsts): Now, also a bitset.
655 Adjust all dependencies.
656 (varsetsize): Remove, now unused.
657 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
658
34ba9743
AD
6592002-03-04 Akim Demaille <akim@epita.fr>
660
661 * src/print.c: Convert to use bitset.h, not hand coded iterations
662 over ints.
663
ed86e78c
AD
6642002-03-04 Akim Demaille <akim@epita.fr>
665
666 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
667
dfdb1797
AD
6682002-03-04 Akim Demaille <akim@epita.fr>
669
670 * src/closure.c (ruleset): Be a bitset.
671 (rulesetsize): Remove.
672
7086e707
AD
6732002-03-04 Akim Demaille <akim@epita.fr>
674
675 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
676 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
677 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
678 * src/closure.c (fderives): Be an array of bitsets.
679
98254360
RA
6802002-02-28 Robert Anisko <robert@lrde.epita.fr>
681
682 * data/bison.c++: Merge the two generated headers. Insert a copyright
683 notice in each output file.
684
a75c057f
AD
6852002-02-28 Akim Demaille <akim@epita.fr>
686
687 * data/bison.c++: Copy the prologue of bison.simple to fetch
688 useful M4 definitions, such as b4_header_guard.
689
06b00abc
AD
6902002-02-25 Akim Demaille <akim@epita.fr>
691
692 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
693 translator friendly scheme for the bgr
694 copyright notice.
06b00abc 695
70e7d534
AD
6962002-02-25 Akim Demaille <akim@epita.fr>
697
698 * src/output.c (header_output): Remove, now handled completely via
699 M4.
700
abe017f6
AD
7012002-02-25 Akim Demaille <akim@epita.fr>
702
703 * m4/m4.m4: New, from CVS Autoconf.
704 * configure.in: Invoke it.
705 * src/output.c (output_skeleton): Use its result instead of the
706 hard coded name.
707
381fb12e
AD
7082002-02-25 Akim Demaille <akim@epita.fr>
709
710 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
711 Fileutils 4.1.5.
712 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
713 * src/output.c (output_skeleton): Use mkstemp to create a real
714 temporary file.
715 Move the filling of `skeleton' and its muscle to...
716 (prepare): here.
717 (output): Move the definition of the prologue muscle to...
718 (prepare): here.
719 * src/system.h (DEFAULT_TMPDIR): New.
720
6f38107f
PE
7212002-02-14 Paul Eggert <eggert@twinsun.com>
722
723 Remove the support for C++ namespace cleanliness; it was
724 causing more problems than it was curing, since it didn't work
725 properly on some nonstandard C++ compilers. This can wait
726 for a proper C++ parser.
727
728 * NEWS: Document this.
729 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
730 of C++, as it's treated like C now.
731 * src/bison.simple (YYSTD): Remove.
732 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
733 Treat C++ just like Standard C instead of trying to support
734 namespace cleanliness.
735
80cce3da
AD
7362002-02-14 Akim Demaille <akim@epita.fr>
737
738 * tests/regression.at (else): Adjust to Andreas' change.
739
842e8679
AD
7402002-02-14 Akim Demaille <akim@epita.fr>
741
742 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
743
4bda3f10
AD
7442002-02-13 Andreas Schwab <schwab@suse.de>
745
746 * src/output.c (output_rule_data): Don't output NULL, it might
747 not be defined yet.
748
4162fa07 7492002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 750
4162fa07
RA
751 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
752 (Copyright notice): Update.
b418ecd8 753
bd16a5dc
AD
7542002-02-11 Akim Demaille <akim@epita.fr>
755
756 * tests/regression.at (%nonassoc and eof): Don't include
757 nonportable headers.
758
8d69a1a3
RA
7592002-02-08 Robert Anisko <robert@lrde.epita.fr>
760
761 * data/bison.c++: Correct error recovery. Make the user able to
762 initialize the starting location.
763
9b2d0677
AD
7642002-02-07 Akim Demaille <akim@epita.fr>
765
766 * tests/input.at: New.
767
69e2658b
RA
7682002-02-07 Robert Anisko <robert@lrde.epita.fr>
769
770 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 771 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
772 directives around tables only needed for debugging.
773
4aacc3a7
RA
7742002-02-07 Robert Anisko <robert@lrde.epita.fr>
775
776 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
777 C++ parsers.
778 (yy::b4_name::parse): Use print_.
779
762a801e
RA
7802002-02-07 Robert Anisko <robert@lrde.epita.fr>
781
782 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
783
4bb2bc3f
RA
7842002-02-07 Robert Anisko <robert@lrde.epita.fr>
785
786 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
787 C++ parsers.
788 (yy::b4_name::parse): Build verbose error messages, and use error_.
789
6b45a3ca
RA
7902002-02-06 Robert Anisko <robert@lrde.epita.fr>
791
792 * data/bison.c++: Fix m4 quoting in comments.
793
50997c6e
RA
7942002-02-06 Robert Anisko <robert@lrde.epita.fr>
795
796 * data/bison.c++: Adjust the parser code. Fix some muscles that were
797 not expanded by m4.
798
3f3eed27
AD
7992002-02-05 Akim Demaille <akim@epita.fr>
800
801 * data/bison.c++: Adjust to the M4 back end.
802 More is certainly needed.
803
be2a1a68
AD
8042002-02-05 Akim Demaille <akim@epita.fr>
805
806 Give a try to M4 as a back end.
807
808 * lib/readpipe.c: New, from wdiff.
809 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
810 BISON_HAIRY.
811 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
812 specific values. Now it is m4 that performs the lookup.
813 * src/parse-skel.y: Remove.
814 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
815 * src/output.c (actions_output, guards_output)
816 (token_definitions_output): No longer keeps track of the output
817 line number, hence remove the second argument.
818 (guards_output): Check against the guard member of a rule, not the
819 action member.
820 Adjust callers.
821 (output_skeleton): Don't look for the skeleton location, let m4 do
822 that.
823 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
824 file will be used.
825 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
826 (prepare): Given that for the time being changesyntax is not
827 usable in M4, rename the muscles using `-' to `_'.
828 Define `defines_flag', `output_parser_name' and `output_header_name'.
829 * src/output.h (actions_output, guards_output)
830 (token_definitions_output): Adjust prototypes.
831 * src/scan-skel.l: Instead of scanning the skeletons, it now
832 processes the output of m4: `__oline__' and `#output'.
833 * data/bison.simple: Adjust to be used by M4(sugar).
834 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
835 to date.
836 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
837 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
838 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
839 shamelessly stolen from CVS Autoconf.
840
beda758b
AD
8412002-02-05 Akim Demaille <akim@epita.fr>
842
843 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
844 * configure.in: Check for the declarations of free and malloc.
845 * src/muscle_tab.c: Adjust.
846
5ece6d43
AD
8472002-02-05 Akim Demaille <akim@epita.fr>
848
849 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
850 which have no values.
851
5bb18f9a
AD
8522002-02-05 Akim Demaille <akim@epita.fr>
853
854 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
855 * data/: here.
856
894dd62e
PE
8572002-01-29 Paul Eggert <eggert@twinsun.com>
858
859 * src/bison.simple (YYSIZE_T): Do not define merely because
860 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
861 On some platforms, <alloca.h> does not declare YYSTD (size_t).
862
82841af7
AD
8632002-01-27 Akim Demaille <akim@epita.fr>
864
865 Fix `%nonassoc and eof'.
866
867 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
868 which were not properly copied! Replace
869 memcpy (res->errs, src->errs, src->nerrs);
870 with
871 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
872 !!!
873 * tests/regression.at (%nonassoc and eof): Adjust to newest
874 Autotest: `.' is not in the PATH.
875
318b76e9
AD
8762002-01-27 Akim Demaille <akim@epita.fr>
877
878 * tests/sets.at (AT_EXTRACT_SETS): New.
879 (Nullable): Use it.
880 (Firsts): New.
881
30d2f3d5
AD
8822002-01-26 Akim Demaille <akim@epita.fr>
883
884 * tests/actions.at, tests/calc.at, tests/headers.at,
885 * tests/torture.at: Adjust to the newest Autotest which no longer
886 forces `.' in the PATH.
887
30f8c395
AD
8882002-01-25 Akim Demaille <akim@epita.fr>
889
890 * tests/regression.at (%nonassoc and eof): New.
891 Suggested by Robert Anisko.
892
29ae55f1
AD
8932002-01-24 Akim Demaille <akim@epita.fr>
894
895 Bison dumps core when trying to complain about broken input files.
896 Reported by Cris van Pelt.
897
898 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
899 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
900 into...
901 (Invalid inputs): Strengthen: exercise parse_percent_token.
902
2b548aa6
RA
9032002-01-24 Robert Anisko <robert.anisko@epita.fr>
904
905 * src/Makefile.am: Add bison.c++.
906 * src/bison.c++: New skeleton.
907
bb0146c2
AD
9082002-01-21 Paolo Bonzini <bonzini@gnu.org>
909
910 * po/it.po: New.
911
bec30531
AD
9122002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
913
914 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
915
fc6edc45
MA
9162002-01-20 Marc Autret <marc@gnu.org>
917
918 * src/files.c (compute_output_file_names): Fix
919
5e5d5415
MA
9202002-01-20 Marc Autret <marc@gnu.org>
921
922 * tests/output.at: New test.
923 * src/files.c (compute_base_names): Don't map extensions when
924 the YACC flag is set, use defaults.
925 Reported by Evgeny Stambulchik.
926
44ea3fbd
MA
9272002-01-20 Marc Autret <marc@gnu.org>
928
bb0146c2 929 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
930 compilers as well (i.e. the vendor C compiler).
931 Suggested by Albert Chin-A-Young.
932
338963d1
TVH
9332002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
934
935 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
936 canonical definition.
937 * src/system.h: Use the canonical definition for PARAMS (avoids
938 a conflict with the macro from lib/hash.h).
939
c57b2479
AD
9402002-01-11 Akim Demaille <akim@epita.fr>
941
942 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 943 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 944
b85810ae
AD
9452002-01-09 Akim Demaille <akim@epita.fr>
946
947 * src/files.c, src/files.h (output_infix): New.
948 (tab_extension): Remove.
949 (compute_base_names): Compute the former, drop the latter.
950 * src/output.c (prepare): Insert the muscles `output-infix', and
951 `output-suffix'.
952 * src/parse-skel.y (string, string.1): New.
953 (section.header): Use it.
954 (section.yacc): Remove.
955 (prefix): Remove too.
956 * src/scan-skel.l: Adjust.
957 * src/bison.simple, src/bison.hairy: Adjust.
958
cae60122
AD
9592002-01-09 Akim Demaille <akim@epita.fr>
960
961 * configure.in (WERROR_CFLAGS): Compute it.
962 * src/Makefile.am (CFLAGS): Pass it.
963 * tests/atlocal.in (CFLAGS): Idem.
964 * src/files.c: Fix a few warnings.
965 (get_extension_index): Remove, unused.
966
ae404801
AD
9672002-01-08 Akim Demaille <akim@epita.fr>
968
969 * src/getargs.c (AS_FILE_NAME): New.
970 (getargs): Use it to convert DOSish file names.
971 * src/files.c (base_name): Rename as full_base_name to avoid
972 clashes with `base_name ()'.
973 (filename_split): New.
974 (compute_base_names): N-th rewrite, using filename_split.
975
22312b71
AD
9762002-01-08 Akim Demaille <akim@epita.fr>
977
978 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
979 New, stolen from the Fileutils 4.1.
980 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
981 * configure.in: Check for the presence of memrchr, and of its
982 prototype.
983
a67cef01
TVH
9842002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
985
986 * lib/hash.h (__P): Added definition for this macro.
987 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
988 BUILT_SOURCES, to ensure they are generated first.
989 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
990 %error-verbose to allow bootstrapping with bison 1.30x.
991
2b25d624
AD
9922002-01-06 Akim Demaille <akim@epita.fr>
993
994 * src/reader.c (parse_braces): Don't fetch the next char, the
995 convention is to fetch on entry.
996 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
997 'switch' without a following semicolon.
998 * tests/regression.at (braces parsing): New.
999
3460813b
AD
10002002-01-06 Akim Demaille <akim@epita.fr>
1001
1002 Bison is dead wrong in its RR conflict reports.
1003
1004 * tests/torture.at (GNU Cim Grammar): New.
1005 * src/conflicts.c (count_rr_conflicts): Fix.
1006
73784c64
AD
10072002-01-06 Akim Demaille <akim@epita.fr>
1008
1009 Creating package.m4 from configure.ac causes too many problems.
1010
1011 * tests/Makefile.am (package.m4): Create it by hand,
1012 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1013
25d81090
AD
10142002-01-06 Akim Demaille <akim@epita.fr>
1015
1016 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1017 skeleton.h.
1018
a9b8959e
PE
10192002-01-04 Paul Eggert <eggert@twinsun.com>
1020
1021 * doc/bison.texinfo (Debugging):
1022 Remove YYSTDERR; it's no longer defined or used.
1023 Also, s/cstdio.h/cstdio/.
1024
25d81090
AD
10252002-01-03 Akim Demaille <akim@epita.fr>
1026
1027 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1028
1109455c
AD
10292002-01-03 Akim Demaille <akim@epita.fr>
1030
1031 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1032 tracing code to --trace, wait for a better --trace option, with
1033 args.
1034
7ea5e977
AD
10352002-01-03 Akim Demaille <akim@epita.fr>
1036
1037 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1038 The ISO C++ standard is extremely clear about it: stderr is
1039 considered a macro, not a regular symbol (see table 94 `Header
1040 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1041 Therefore std:: does not apply to it. It still does with fprintf.
1042 Also, s/cstdio.h/cstdio/.
1043
fab5b110
AD
10442002-01-03 Akim Demaille <akim@epita.fr>
1045
1046 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1047 for non system headers.
1048
aed7fd9b
AD
10492002-01-02 Akim Demaille <akim@epita.fr>
1050
1051 Equip the skeleton chain with location tracking, runtime trace,
1052 pure parser and scanner.
1053
1054 * src/parse-skel.y: Request a pure parser, locations, and prefix
1055 renaming.
1056 (%union): Having several members with the same type does not help
1057 type mismatches, simplify.
1058 (YYPRINT, yyprint): New.
1059 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1060 (skel_error): this.
1061 Handle locations.
1062 * src/scan-skel.l: Adjust to these changes.
1063 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1064 (LOCATION_PRINT, skel_control_t): New.
1065
24fad99e
AD
10662001-12-30 Akim Demaille <akim@epita.fr>
1067
1068 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1069 replace `gb' with BLANKS.
1070 * src/scan-skel.l: Adjust.
1071
a4b36db4
AD
10722001-12-30 Akim Demaille <akim@epita.fr>
1073
1074 * src/system.h: We don't need nor want bcopy.
1075 Throw away MS-DOS crap: we don't need getpid.
1076 * configure.in: We don't need strndup. It was even causing
1077 problems: because Flex includes the headers *before* us,
1078 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1079 not visible.
1080 * lib/xstrndup.c: New.
1081 * src/scan-skel.l: Use it.
1082 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1083 * src/parse-skel.y: Use %directives instead of #defines.
1084
1239777d
AD
10852001-12-30 Akim Demaille <akim@epita.fr>
1086
1087 * src/skeleton.h: New.
1088 * src/output.c (output_parser, output_master_parser): Remove, dead
1089 code.
1090 * src/output.h (get_lines_number, actions_output, guards_output)
1091 (token_definitions_output): Prototype them.
1092 * src/parse-skel.y: Add the license notice.
1093 Include output.h and skeleton.h.
1094 (process_skeleton): Returns void, and takes a single parameter.
1095 * src/scan-skel.l: Add the license notice.
1096 Include skeleton.h.
1097 Don't use %option yylineno: it seems that then Flex imagines
1098 REJECT has been used, and therefore it won't reallocate its
1099 buffers (which makes no other sense to me than a bug). It results
1100 in warnings for `unused: yy_flex_realloc'.
1101
9b3add5b
RA
11022001-12-30 Robert Anisko <robert.anisko@epita.fr>
1103
1104 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1105 (MUSCLE_INSERT_PREFIX): ...to there.
1106 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1107 (MUSCLE_INSERT_PREFIX): Move from here...
1108
1109 * src/bison.hairy: Add a section directive. Put braces around muscle
1110 names. This parser skeleton is still broken, but Bison should not
1111 choke on a bad muscle 'syntax'.
1112 * src/bison.simple: Add a section directive. Put braces around muscle
1113 names.
1114
1115 * src/files.h (strsuffix, stringappend): Add declarations.
1116 (tab_extension): Add declaration.
1117 (short_base_name): Add declaration.
1118
1119 * src/files.c (strsuffix, stringappend): No longer static. These
1120 functions are used in the skeleton parser.
1121 (tab_extension): New.
1122 (compute_base_names): Use the computations done in this function
fab5b110 1123 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1124 names.
1125 (short_base_name): No longer static.
1126
1127 * src/output.c (output_skeleton): New.
1128 (output): Disable call to output_master_parser, and give a try to
1129 a new skeleton handling system.
1130 (guards_output, actions_output): No longer static.
1131 (token_definitions_output, get_lines_number): No longer static.
1132
1133 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1134
fab5b110 1135 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1136 parse-skel.y.
1137
1138 * src/parse-skel.y: New file.
1139 * src/scan-skel.l: New file.
1140
b5b61c61
AD
11412001-12-29 Akim Demaille <akim@epita.fr>
1142
1143 %name-prefix is broken.
1144
1145 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1146 Adjust all dependencies.
1147 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1148 %name-prefix.
1149
1150 Renaming yylval but not yylloc is not consistent. Now we do.
1151
1152 * src/bison.simple: Prefix yylloc if used.
1153 * doc/bison.texinfo (Decl Summary): Document that.
1154
8c9a50be
AD
11552001-12-29 Akim Demaille <akim@epita.fr>
1156
1157 * doc/bison.texinfo: Promote `%long-directive' over
1158 `%long_directive'.
1159 Remove all references to fixed-output-files, yacc is enough.
1160
d99361e6
AD
11612001-12-29 Akim Demaille <akim@epita.fr>
1162
1163 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1164 user prologue. These are defaults.
1165 * tests/actions.at (Mid-rule actions): Make sure the user can
1166 define YYDEBUG and YYERROR_VERBOSE.
1167
b9cecb91
AD
11682001-12-29 Akim Demaille <akim@epita.fr>
1169
1170 * src/output.c (header_output): Don't forget to export YYLTYPE and
1171 yylloc.
1172 * tests/headers.at (export YYLTYPE): New, make sure it does.
1173 * tests/regression.at (%union and --defines, Invalid CPP headers):
1174 Move to...
1175 * tests/headers.at: here.
1176
aea13e97
AD
11772001-12-29 Akim Demaille <akim@epita.fr>
1178
1179 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1180
931394cb
AD
11812001-12-29 Akim Demaille <akim@epita.fr>
1182
1183 * tests/actions.at (Mid-rule actions): Output on a single line
1184 instead of several.
1185
704a47c4
AD
11862001-12-29 Akim Demaille <akim@epita.fr>
1187
1188 * doc/bison.texinfo: Formatting changes.
1189
091e20bb
AD
11902001-12-29 Akim Demaille <akim@epita.fr>
1191
1192 Don't store the token defs in a muscle, just be ready to output it
1193 on command. Now possible via `symbols'. Fixes a memory leak.
1194
1195 * src/output.c (token_definitions_output): New.
1196 (output_parser, header_output): Use it.
1197 * src/reader.c (symbols_save): Remove.
1198
cce71710
AD
11992001-12-29 Akim Demaille <akim@epita.fr>
1200
1201 * src/bison.simple: Do not provide a default for YYSTYPE and
1202 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1203 default.
1204
82c035a8
AD
12052001-12-29 Akim Demaille <akim@epita.fr>
1206
1207 Mid-rule actions are simply... ignored!
1208
1209 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1210 the empty-rule associated to the dummy symbol, not to the host
1211 rule.
1212 * tests/actions.at (Mid-rule actions): New.
1213
8419d367
AD
12142001-12-29 Akim Demaille <akim@epita.fr>
1215
1216 Memory leak.
1217
1218 * src/reader.c (reader): Free grammar.
1219
375d5806
AD
12202001-12-29 Akim Demaille <akim@epita.fr>
1221
1222 Memory leak.
1223
1224 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1225 since it allocates it for each state, although only one is needed.
1226 (allocate_storage): Do it here.
1227
f51cb8ff
AD
12282001-12-29 Akim Demaille <akim@epita.fr>
1229
1230 * src/options.h, src/options.c (create_long_option_table): Rename
1231 as...
1232 (long_option_table_new): this, with a clearer prototype.
1233 (percent_table): Remove, unused,
1234 * src/getargs.c (getargs): Adjust.
1235
29e88316
AD
12362001-12-29 Akim Demaille <akim@epita.fr>
1237
1238 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1239 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1240 as states.
1241
b9f71f19
AD
12422001-12-29 Akim Demaille <akim@epita.fr>
1243
1244 * src/lalr.c (build_relations): Rename `states' as `states1'.
1245 Sorry, I don't understand exactly what it is, no better name...
1246
1a2b5d37
AD
12472001-12-29 Akim Demaille <akim@epita.fr>
1248
1249 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1250 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1251 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1252 as rules.
1253
1cca533e
AD
12542001-12-29 Akim Demaille <akim@epita.fr>
1255
1256 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1257 ago.
1258
c03ae966
AD
12592001-12-29 Akim Demaille <akim@epita.fr>
1260
1261 * src/reader.c, src/reader.h (user_toknums): Remove.
1262 Adjust all users to use symbols[i]->user_token_number.
1263
5a670b1e
AD
12642001-12-29 Akim Demaille <akim@epita.fr>
1265
1266 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1267 Adjust all users to use symbols[i]->prec or ->assoc.
1268
ad949da9
AD
12692001-12-29 Akim Demaille <akim@epita.fr>
1270
1271 * src/reader.c, src/reader.h (tags): Remove.
1272 Adjust all users to use symbols[i]->tag.
1273
0e78e603
AD
12742001-12-29 Akim Demaille <akim@epita.fr>
1275
1276 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1277 and rule_table.
1278 * src/reader.c (packsymbols): Fill this table.
1279 Drop sprec.
1280 * src/conflicts.c (resolve_sr_conflict): Adjust.
1281 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1282 single table.
1283 Use symbols[i]->tag instead of tags[i].
1284
213e640e
AD
12852001-12-29 Akim Demaille <akim@epita.fr>
1286
1287 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1288 In addition, put a comment in there, to replace...
1289 * tests/regression.at (%union and C comments): Remove.
1290
e7b8bef1
AD
12912001-12-29 Akim Demaille <akim@epita.fr>
1292
1293 * tests/regression.at (Web2c Actions): Blindly move the actual
1294 output as expected output. The contents *seem* right to me, but I
1295 can't pretend reading perfectly parser tables... Nonetheless, all
1296 the other tests pass correctly, the table look OK, even though the
1297 presence of `$axiom' is to be noted: AFAICS it is useless (but
1298 harmless).
1299
b68e7744
AD
13002001-12-29 Akim Demaille <akim@epita.fr>
1301
1302 * src/reader.c (readgram): Don't add the rule 0 if there were no
1303 rules read. In other words, add it _after_ having performed
1304 grammar sanity checks.
1305 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1306
78d5bae9
AD
13072001-12-29 Akim Demaille <akim@epita.fr>
1308
1309 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1310 visible, and some states have now a different number.
1311
ff442794
AD
13122001-12-29 Akim Demaille <akim@epita.fr>
1313
1314 * src/reader.c (readgram): Bind the initial rule's lineno to that
1315 of the first rule.
1316 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1317 (Solved SR Conflicts): Adjust rule 0's line number.
1318
610ab194
AD
13192001-12-29 Akim Demaille <akim@epita.fr>
1320
1321 Fix the `GAWK Grammar' failure.
1322
1323 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1324 the reductions of the first state which was mistakenly confused
1325 with the final state because precisely final_state was initialized
1326 to 0.
1327 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1328 now noticed by Bison.
1329 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1330 have a reduction on $default.
1331
29d29c8f
AD
13322001-12-29 Akim Demaille <akim@epita.fr>
1333
1334 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1335 rule line numbers.
1336 * src/closure.c (print_closure): Likewise.
1337 * src/derives.c (print_derives): Likewise.
1338 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1339 now.
1340
7c6b64d0
AD
13412001-12-29 Akim Demaille <akim@epita.fr>
1342
1343 * src/lalr.c (lookaheads_print): New.
1344 (lalr): Call it when --trace-flag.
1345 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1346 are dumped.
1347
3d4daee3
AD
13482001-12-29 Akim Demaille <akim@epita.fr>
1349
1350 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1351 when walking through ritem, even via rule->rhs.
1352 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1353 (useful_production, useless_nonterminals): Likewise.
1354 (reduce_grammar_tables): Likewise, plus update nritems.
1355 * src/nullable.c (set_nullable): Likewise.
1356 * src/lalr.c (build_relations): Likewise.
1357 * tests/sets.at (Nullable): Adjust.
1358 Fortunately, now, the $axiom is no longer nullable.
1359
9e7f6bbd
AD
13602001-12-29 Akim Demaille <akim@epita.fr>
1361
1362 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1363 the 0-sentinel.
1364 * src/gram.c (ritem_longest_rhs): Likewise.
1365 * src/reduce.c (nonterminals_reduce): Likewise.
1366 * src/print_graph.c (print_graph): Likewise.
1367 * src/output.c (output_rule_data): Likewise.
1368 * src/nullable.c (set_nullable): Likewise.
1369
255ef638
AD
13702001-12-29 Akim Demaille <akim@epita.fr>
1371
1372 * src/output.c: Comment changes.
1373
0d8a7363
AD
13742001-12-27 Paul Eggert <eggert@twinsun.com>
1375
1376 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1377 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1378 Sparc, as they were causing more porting problems than the
1379 (minor) performance improvement was worth.
1380
1381 Also, catch up with 1.31's YYSTD.
1382
3db472b9
AD
13832001-12-27 Akim Demaille <akim@epita.fr>
1384
1385 * src/output.c (output_gram): Rely on nritems, not the
1386 0-sentinel. See below.
1387 Use -1 as separator, not 0.
1388 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1389 Rely on -1 as separator in yyrhs, instead of 0.
1390 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1391 twice `Now at end of input', therefore there are two lines less to
1392 expect.
1393
b365aa05
AD
13942001-12-27 Akim Demaille <akim@epita.fr>
1395
1396 * tests/regression.at (Unresolved SR Conflicts):
1397 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1398 below.
1399
30171f79
AD
14002001-12-27 Akim Demaille <akim@epita.fr>
1401
1402 * src/LR0.c (new_state): Recognize the final state by the fact it
1403 is reached by eoftoken.
1404 (insert_start_shifting_state, insert_eof_shifting_state)
1405 (insert_accepting_state, augment_automaton): Remove, since now
1406 these states are automatically computed from the initial state.
1407 (generate_states): Adjust.
1408 * src/print.c: When reporting a rule number to the user, substract
1409 1, so that the axiom rule is rule 0, and the first user rule is 1.
1410 * src/reduce.c: Likewise.
1411 * src/print_graph.c (print_core): For the time being, just as for
1412 the report, depend upon --trace-flags to dump the full set of
1413 items.
1414 * src/reader.c (readgram): Once the grammar read, insert the rule
1415 0: `$axiom: START-SYMBOL $'.
1416 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1417 number of the states has changed (the final state is no longer
1418 necessarily the last), catch up.
1419
75142d45
AD
14202001-12-27 Akim Demaille <akim@epita.fr>
1421
1422 Try to make the use of the eoftoken valid. Given that its value
1423 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1424 is used instead of > 0 where appropriate, (ii), depend upon nritems
1425 instead of the 0-sentinel.
1426
1427 * src/gram.h, src/gram.c (nritems): New.
1428 Expected to be duplication of nitems, but for the time being...
1429 * src/reader.c (packgram): Assert nritems and nitems are equal.
1430 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1431 * src/closure.c (print_closure, print_fderives): Likewise.
1432 * src/gram.c (ritem_print): Likewise.
1433 * src/print.c (print_core, print_grammar): Likewise.
1434 * src/print_graph.c: Likewise.
1435
b7c49edf
AD
14362001-12-27 Akim Demaille <akim@epita.fr>
1437
1438 * src/main.c (main): If there are complains after grammar
1439 reductions, then output the report anyway if requested, then die.
1440 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1441 * src/reader.c (eoftoken): New.
1442 (parse_token_decl): If the token being defined has value `0', it
1443 is the eoftoken.
1444 (packsymbols): No longer hack `tags' to insert `$' by hand.
1445 Be sure to preserve the value of the eoftoken.
1446 (reader): Make sure eoftoken is defined.
1447 Initialize nsyms to 0: now eoftoken is created just like the others.
1448 * src/print.c (print_grammar): Don't special case the eof token.
1449 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1450 lie anyway, albeit pleasant.
1451 * tests/calc.at: Exercise error messages with eoftoken.
1452 Change the grammar so that empty input is invalid.
1453 Adjust expectations.
1454 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1455
ec2da99f
AD
14562001-12-27 Akim Demaille <akim@epita.fr>
1457
1458 * configure.in: Check the protos of strchr ans strspn.
1459 Replace strchr if needed.
1460 * src/system.h: Provide the protos of strchr, strspn and memchr if
1461 missing.
1462 * lib/strchr.c: New.
1463 * src/reader.c (symbols_save): Use strchr.
1464
8adfa272
AD
14652001-12-27 Akim Demaille <akim@epita.fr>
1466
1467 * src/print.c, src/print_graph.c (escape): New.
1468 Use it to quote the TAGS outputs.
1469 * src/print_graph.c (print_state): Now errors are in red, and
1470 reductions in green.
1471 Prefer high to wide: output the state number on a line of its own.
1472
80dac38c
AD
14732001-12-27 Akim Demaille <akim@epita.fr>
1474
1475 * src/state.h, src/state.c (reductions_new): New.
1476 * src/LR0.c (set_state_table): Let all the states have a
1477 `reductions', even if reduced to 0.
1478 (save_reductions): Adjust.
1479 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1480 * src/print.c (print_reductions, print_actions): Adjust.
1481 * src/output.c (action_row): Adjust.
1482
2cec70b9
AD
14832001-12-27 Akim Demaille <akim@epita.fr>
1484
1485 * src/state.h, src/state.c (errs_new, errs_dup): New.
1486 * src/LR0.c (set_state_table): Let all the states have an errs,
1487 even if reduced to 0.
1488 * src/print.c (print_errs, print_reductions): Adjust.
1489 * src/output.c (output_actions, action_row): Adjust.
1490 * src/conflicts.c (resolve_sr_conflict): Adjust.
1491
13ca549a
AD
14922001-12-27 Akim Demaille <akim@epita.fr>
1493
1494 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1495
5092aba5
AD
14962001-12-27 Akim Demaille <akim@epita.fr>
1497
1498 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1499 * src/print.c: here.
1500 (lookaheadset, shiftset): New, used as additional storage by
1501 print_reductions.
1502 (print_results): Adjust.
1503 (print_shifts, print_gotos, print_errs): New, extracted from...
1504 (print_actions): here.
1505 * src/print_graph.c (print_actions): Remove dead code.
1506
11e2beca
AD
15072001-12-27 Akim Demaille <akim@epita.fr>
1508
1509 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1510 `$n' and `@n'.
1511
dac3c910
AD
15122001-12-27 Akim Demaille <akim@epita.fr>
1513
1514 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1515 (build_relations): Adjust.
1516
d0b0fefa
AD
15172001-12-27 Akim Demaille <akim@epita.fr>
1518
1519 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1520 duplication.
1521
adc8c848
AD
15222001-12-27 Akim Demaille <akim@epita.fr>
1523
1524 * src/reader.c (packgram): Catch nitems overflows.
1525
14d293ac
AD
15262001-12-27 Akim Demaille <akim@epita.fr>
1527
1528 * src/files.c, src/files.h (guard_obstack): Remove.
1529 * src/output.c (output): Adjust.
1530 * src/reader.c (parse_braces): New, factoring...
1531 (copy_action, copy_guard): these two which are renamed as...
1532 (parse_action, parse_guard): these.
1533 As a voluntary consequence, using braces around guards is now
1534 mandatory.
1535
f499b062
AD
15362001-12-27 Akim Demaille <akim@epita.fr>
1537
1538 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1539 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1540 members.
1541 (symbol_list_new): Adjust.
1542 (copy_action): action_line is the first line, not the last.
1543 (copy_guard): Just as for actions, store the `action' only, not
1544 the switch/case/break flesh.
1545 Don't parse the user action that might follow the guard, let...
1546 (readgram): do it, i.e., now, there can be an action after a
1547 guard.
1548 In other words the guard is just explicitly optional.
1549 (packgram): Adjust.
1550 * src/output.c (guards_output): New.
1551 (output_parser): Call it when needed.
1552 (output): Also free the guard and attrs obstacks.
1553 * src/files.c, src/files.h (obstack_save): Remove.
1554 (output_files): Remove.
1555 As a result, if one needs the former `.act' file, using an
1556 appropriate skeleton which requires actions and guards is now
1557 required.
1558 * src/main.c (main): Adjust.
1559 * tests/semantic.at: New.
1560 * tests/regression.at: Use `input.y' as input file name.
1561 Avoid 8+3 problems by requiring input.c when the test needs the
1562 parser.
1563
d945f5cd
AD
15642001-12-27 Akim Demaille <akim@epita.fr>
1565
1566 * src/reader.c (symbol_list_new): Be sure to initialize all the
1567 fields.
1568
d200e455
AD
15692001-12-27 Akim Demaille <akim@epita.fr>
1570
1571 All the hacks using a final pseudo state are now useless.
1572
1573 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1574 * src/lalr.c (nLA): New.
1575 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1576 instead of lookaheadsp from the pseudo state (nstate + 1).
1577
f9507c28
AD
15782001-12-27 Akim Demaille <akim@epita.fr>
1579
1580 * src/output.c (action_row, token_actions): Use a state_t instead
1581 of a integer, and nlookaheads instead of the following state's
1582 lookaheadsp.
1583
065fbd27
AD
15842001-12-27 Akim Demaille <akim@epita.fr>
1585
1586 * src/conflicts.c (log_resolution, flush_shift)
1587 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1588 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1589 (conflicts_print, print_reductions): Use a state_t instead of an
1590 integer when referring to a state.
1591 As much as possible, depend upon nlookaheads, instead of the
1592 `lookaheadsp' member of the following state (since lookaheads of
1593 successive states are successive, the difference between state n + 1
1594 and n served as the number of lookaheads for state n).
1595 * src/lalr.c (add_lookback_edge): Likewise.
1596 * src/print.c (print_core, print_actions, print_state)
1597 (print_results): Likewise.
1598 * src/print_graph.c (print_core, print_actions, print_state)
1599 (print_graph): Likewise.
1600 * src/conflicts.h: Adjust.
1601
1b177bd7
AD
16022001-12-27 Akim Demaille <akim@epita.fr>
1603
1604 * src/bison.hairy: Formatting/comment changes.
1605 ANSIfy.
1606 Remove `register' indications.
1607 Add plenty of `static'.
1608
7742ddeb
AD
16092001-12-27 Akim Demaille <akim@epita.fr>
1610
1611 * src/output.c (prepare): Drop the muscle `ntbase' which
1612 duplicates ntokens.
1613 * src/bison.simple: Formatting/comment changes.
1614 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1615 is an undocumented synonym.
1616
1fa14068
AD
16172001-12-22 Akim Demaille <akim@epita.fr>
1618
1619 * src/output.c (output_table_data): Change the prototype to use
1620 `int' for array ranges: some invocations do pass an int, not a
1621 short.
1622 Reported by Wayne Green.
1623
b9752825
AD
16242001-12-22 Akim Demaille <akim@epita.fr>
1625
1626 Some actions of web2c.y are improperly triggered.
1627 Reported by Mike Castle.
1628
1629 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1630 * tests/regression.at (Web2c): Rename as...
1631 (Web2c Report): this.
1632 (Web2c Actions): New.
1633
776209d6
AD
16342001-12-22 Akim Demaille <akim@epita.fr>
1635
1636 Reductions in web2c.y are improperly reported.
1637 Reported by Mike Castle.
1638
1639 * src/conflicts.c (print_reductions): Fix.
1640 * tests/regression.at (Web2c): New.
1641
275fc3ad
AD
16422001-12-18 Akim Demaille <akim@epita.fr>
1643
1644 Some host fail on `assert (!"foo")', which expands to
1645 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1646 Reported by Nelson Beebee.
1647
1648 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1649 `#define it_succeeded 0' and `assert (it_succeeded)'.
1650
897668ee
MA
16512001-12-17 Marc Autret <autret_m@epita.fr>
1652
1653 * src/bison.simple: Don't hard code the skeleton line and filename.
1654 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1655 New line counter 'skeleton_line' (skeleton-line muscle).
1656
ab3399e0
PE
16572001-12-17 Paul Eggert <eggert@twinsun.com>
1658
1659 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1660 YYDEBUG must be defined to a nonzero value.
1661
1662 * src/bison.simple (yytname): Do not assume that the user defines
1663 YYDEBUG to a properly parenthesized expression.
1664
3877f72b
AD
16652001-12-17 Akim Demaille <akim@epita.fr>
1666
1667 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1668 nlookaheads is a new member.
1669 Adjust all users.
1670 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1671 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1672 state.
776209d6 1673
331dbc1b
AD
16742001-12-17 Akim Demaille <akim@epita.fr>
1675
1676 * src/files.h, src/files.c (open_files, close_files): Remove.
1677 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1678 let...
1679 * src/reader.c (reader): Do it.
776209d6 1680
be750e4c
AD
16812001-12-17 Akim Demaille <akim@epita.fr>
1682
1683 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 1684
709ae8c6
AD
16852001-12-17 Akim Demaille <akim@epita.fr>
1686
1687 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1688 (flush_reduce): New.
1689 (resolve_sr_conflict): Adjust.
776209d6 1690
f87685c3
AD
16912001-12-17 Akim Demaille <akim@epita.fr>
1692
1693 * src/output.c (output_obstack): Be static and rename as...
1694 (format_obstack): this, to avoid any confusion with files.c's
1695 output_obstack.
1696 * src/reader.h (muscle_obstack): Move to...
1697 * src/output.h: here, since it's defined in output.c.
1698
837491d8
AD
16992001-12-17 Akim Demaille <akim@epita.fr>
1700
1701 * src/output.c (action_row, save_column, default_goto)
1702 (sort_actions, matching_state, pack_vector): Better variable
1703 locality.
1704
796d61fb
AD
17052001-12-17 Akim Demaille <akim@epita.fr>
1706
1707 * src/output.c: Various formatting changes.
776209d6 1708
64d15509
AD
17092001-12-17 Akim Demaille <akim@epita.fr>
1710
1711 * src/files.c (output_files): Free the output_obstack.
1712 * src/main.c (main): Call print and print_graph conditionally.
1713 * src/print.c (print): Work unconditionally.
1714 * src/print_graph.c (print_graph): Work unconditionally.
1715 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1716
fbc8ecb7
MA
17172001-12-16 Marc Autret <autret_m@epita.fr>
1718
1719 * src/output.c (actions_output): Fix. When we use %no-lines,
1720 there is one less line per action.
1721
f0440388
MA
17222001-12-16 Marc Autret <autret_m@epita.fr>
1723
1724 * src/bison.simple: Remove a useless #line directive.
1725 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1726 * src/output.c (get_lines_number): New.
776209d6 1727 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
1728 output muscles.
1729 Fix line numbering.
1730 (actions_output): Computes the number of lines taken by actions.
1731 (output_master_parser): Insert new skeleton which is the name of
1732 the output parser file name.
1733
a79986b8
MA
17342001-12-15 Marc Autret <autret_m@epita.fr>
1735
1736 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1737
4ec8e00f
MA
17382001-12-15 Marc Autret <autret_m@epita.fr>
1739
1740 * src/output.c (output_gram): Keep track of the hairy one.
1741
1a4648ff
AD
17422001-12-15 Akim Demaille <akim@epita.fr>
1743
1744 Make `make distcheck' work.
1745
1746 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1747 system.h which uses libgettext.h.
1748
9c2c67e6
AD
17492001-12-15 Akim Demaille <akim@epita.fr>
1750
1751 * src/nullable.c (set_nullable): Useless rules must be skipped,
1752 otherwise, since we range over their symbols, we might look at a
1753 nonterminal which no longer ``exists'', i.e., it is not counted in
1754 `nvars', hence we overflow our arrays.
1755
93ede233
AD
17562001-12-15 Akim Demaille <akim@epita.fr>
1757
1758 The header can also be produced directly, without any obstack!
1759 Yahoo!
1760
1761 * src/files.c, src/files.h (defines_obstack): Remove.
1762 (compute_header_macro): Global.
1763 (defines_obstack_save): Remove.
1764 * src/reader.c (parse_union_decl): No longer output to
1765 defines_obstack: its content can be found in the `stype' muscle
1766 anyway.
1767 (output_token_translations): Merge into...
1768 (symbols_output): this.
1769 Rename as...
1770 (symbols_save): this.
1771 (reader): Adjust.
1772 * src/output.c (header_output): New.
1773 (output): Call it.
1774
2666f928
AD
17752001-12-15 Akim Demaille <akim@epita.fr>
1776
1777 * src/reader.c (parse_union_decl): Instead of handling two obstack
1778 simultaneously, use one to define the `stype' muscle, and use the
1779 value of the latter to fill defines_obstack.
1780 (copy_comment): Remove.
1781 (copy_comment2): Work for a single obstack.
1782 Rename as...
1783 (copy_comment): this.
1784
428046f8
AD
17852001-12-15 Akim Demaille <akim@epita.fr>
1786
1787 * src/lex.c, src/lex.h (xgetc): No longer static.
1788 * src/reader.c (parse_union_decl): Revamp.
1789
ea52d706
AD
17902001-12-15 Akim Demaille <akim@epita.fr>
1791
1792 Still making progress in separating Bison into (i) input, (ii)
1793 process, (iii) output: now we can directly output the parser file
1794 without using table_obstack at all.
1795
1796 * src/files.c, src/files.h (table_obstack): Bye bye.
1797 (parser_file_name): New.
1798 * src/files.c (compute_output_file_names): Compute it.
1799 * src/output.c (actions_output, output_parser)
1800 (output_master_parser): To a file instead of an obstack.
1801
3f96f4dc
AD
18022001-12-15 Akim Demaille <akim@epita.fr>
1803
1804 Attach actions to rules, instead of pre-outputting them to
1805 actions_obstack.
1806
1807 * src/gram.h (rule_t): action and action_line are new members.
1808 * src/reader.c (symbol_list): Likewise.
1809 (copy_action): Save the actions within the rule.
1810 (packgram): Save them in rule_table.
1811 * src/output.c (actions_output): New.
1812 (output_parser): Use it on `%%actions'.
1813 (output_rule_data): Don't free rule_table.
1814 (output): Do it.
1815 (prepare): Don't save the `action' muscle.
1816 * src/bison.simple: s/%%action/%%actions/.
1817
51576fb3
AD
18182001-12-15 Akim Demaille <akim@epita.fr>
1819
1820 * src/reader.c (copy_action): When --yacc, don't append a `;'
1821 to the user action: let it fail if lacking.
dee049eb 1822 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 1823
2648a72d
AD
18242001-12-14 Akim Demaille <akim@epita.fr>
1825
1826 * src/lex.c (literalchar): Simply return the char you decoded, non
1827 longer mess around with obstacks and int pointers.
1828 Adjust all callers.
1829
92790e5b
AD
18302001-12-14 Akim Demaille <akim@epita.fr>
1831
1832 * src/lex.c (literalchar): Don't escape the special characters,
1833 just decode them, and keep them as char (before, eol was output as
1834 the 2 char string `\n' etc.).
1835 * src/output.c (output_rule_data): Use quotearg to output the
1836 token strings.
1837
927c1557
PE
18382001-12-13 Paul Eggert <eggert@twinsun.com>
1839
1840 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1841 Do not infringe on the global user namespace when using C++.
1842 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1843 All uses of `fprintf' and `stderr' changed.
1844
1845 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1846
ed8e1f68
AD
18472001-12-13 Akim Demaille <akim@epita.fr>
1848
1849 The computation of nullable is broken: it doesn't handle empty
1850 RHS's properly.
1851
1852 * tests/torture.at (GNU AWK Grammar): New.
1853 * tests/sets.at (Nullable): New.
1854 * src/nullable.c (set_nullable): Instead of blindly looping over
1855 `ritems', loop over the rules, and then over their rhs's.
1856
1857 Work around Autotest bugs.
1858
1859 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1860 frame, because Autotest understand lines starting with a `+' as
1861 traces from the shell. Then, they are not processed properly.
1862 Admittedly an Autotest bug, but we don't have time to wait for
1863 Autotest to catch up.
1864 * tests/regression.at (Broken Closure): Adjust to the new table
1865 frames.
1866 Move to...
1867 * tests/sets.at: here.
1868
cb581495
AD
18692001-12-13 Akim Demaille <akim@epita.fr>
1870
1871 * src/closure.c (closure): Use nrules instead of playing tricks
1872 with BITS_PER_WORD.
1873
2e729273
AD
18742001-12-13 Akim Demaille <akim@epita.fr>
1875
1876 * src/print.c (print_actions): Output the handling of `$' as the
1877 traces do: shifting the token EOF. Before EOF was treated as a
1878 nonterminal.
1879 * tests/regression.at: Adjust some tests.
1880 * src/print_graph.c (print_core): Complete the set of items via
1881 closure. The next-to-final and final states are still unsatisfying,
1882 but that's to be addressed elsewhere.
1883 No longer output the rule numbers, but do output the state number.
1884 A single loop for the shifts + gotos is enough, but picked a
1885 distinct color for each.
1886 (print_graph): Initialize and finalize closure.
1887
107f7dfb
AD
18882001-12-13 Akim Demaille <akim@epita.fr>
1889
1890 * src/reader.c (readgram): Remove dead code, an strip useless
1891 braces.
1892 (get_type): Remove, unused.
1893
9b53a24f
AD
18942001-12-12 Akim Demaille <akim@epita.fr>
1895
1896 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1897 on that of lib/error.c.
1898
dbfb6dcd
AD
18992001-12-12 Akim Demaille <akim@epita.fr>
1900
1901 Some hosts don't like `/' in includes.
1902
1903 * src/system.h: Include libgettext.h without qualifying the path.
1904 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1905 $(top_srcdir).
1906
c25fb648
MA
19072001-12-11 Marc Autret <autret_m@epita.fr>
1908
1909 * src/output.c (output_parser): Remove useless muscle.
1910
710ddc4f
MA
19112001-12-11 Marc Autret <autret_m@epita.fr>
1912
1913 * src/bison.simple: Remove #line just before %%epilogue. It
1914 is now handled in ...
1915 * src/reader.c (read_additionnal_code): Add the output of a
1916 #line for the epilogue.
1917
e83d80b8
MA
19182001-12-10 Marc Autret <autret_m@epita.fr>
1919
927c1557 1920 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
1921 replace precedent remove.
1922 * src/bison.simple: Remove #line before %%prologue because
1923 %%input-line is wrong at this time.
1924
971d5158
MA
19252001-12-10 Marc Autret <autret_m@epita.fr>
1926
1927 * src/reader.c (symbols_output): Clean up.
927c1557 1928 * src/output.c (output_gram, output): Clean up.
971d5158 1929
5edafffd
AD
19302001-12-10 Akim Demaille <akim@epita.fr>
1931
1932 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1933 * src/LR0.c (set_state_table): here.
1934 * src/lalr.c (lalr): Call it.
1935
0279f8e9
AD
19362001-12-10 Akim Demaille <akim@epita.fr>
1937
1938 * src/state.h (shifts): Remove the `number' member: shifts are
1939 attached to state, hence no longer need to be labelled with a
1940 state number.
1941
190c4f5f
AD
19422001-12-10 Akim Demaille <akim@epita.fr>
1943
1944 Now that states have a complete set of members, the linked list of
1945 shifts is useless: just fill directly the state's shifts member.
1946
1947 * src/state.h (shifts): Remove the `next' member.
1948 * src/LR0.c (first_state, last_state): Remove.
1949 Adjust the callers.
1950 (augment_automaton): Don't look for the shifts that must be added
1951 a shift on EOF: it is those of the state we looked for! But now,
1952 since shifts are attached, it is no longer needed to looking
1953 merely by its id: its number.
1954
2a73b93d
AD
19552001-12-10 Akim Demaille <akim@epita.fr>
1956
1957 * src/LR0.c (augment_automaton): Better variable locality.
1958 Remove an impossible branch: if there is a state corresponding to
1959 the start symbol being shifted, then there is shift for the start
1960 symbol from the initial state.
1961
74392f6a
AD
19622001-12-10 Akim Demaille <akim@epita.fr>
1963
1964 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1965 only when appropriate: when insert_start_shifting_state' is not
1966 invoked.
1967 * tests/regression.at (Rule Line Numbers): Adjust.
1968
37c82725
AD
19692001-12-10 Akim Demaille <akim@epita.fr>
1970
1971 * src/LR0.c (augment_automaton): Now that all states have shifts,
1972 merge the two cases addition shifts to the initial state.
1973
6a164e0c
AD
19742001-12-10 Akim Demaille <akim@epita.fr>
1975
1976 * src/lalr.c (set_state_table): Move to...
1977 * src/LR0.c: here.
1978 * src/lalr.c (lalr): Don't call it...
1979 * src/LR0.c (generate_states): do it.
1980 * src/LR0.h (first_state): Remove, only the table is used.
1981
7215de24
AD
19822001-12-10 Akim Demaille <akim@epita.fr>
1983
1984 * src/LR0.h (first_shift, first_reduction): Remove.
1985 * src/lalr.c: Don't use first_shift: find shifts through the
1986 states.
1987
80e25d4d
AD
19882001-12-10 Akim Demaille <akim@epita.fr>
1989
1990 * src/LR0.c: Attach shifts to states as soon as they are
1991 computed.
1992 * src/lalr.c (set_state_table): Instead of assigning shifts to
1993 state, just assert that the mapping was properly done.
1994
0ab3728b
AD
19952001-12-10 Akim Demaille <akim@epita.fr>
1996
1997 * src/LR0.c (insert_start_shift): Rename as...
1998 (insert_start_shifting_state): this.
1999 (insert_eof_shifting_state, insert_accepting_state): New.
2000 (augment_automaton): Adjust.
2001 Better locality of the variables.
2002 When looking if the start_symbol is shifted from the initial
2003 state, using `while (... symbol != start_symbol ...)' sounds
2004 better than `while (... symbol < start_symbol ...)': If fail
2005 to see how the order between symbols could be relevant!
2006
78af9bbc
AD
20072001-12-10 Akim Demaille <akim@epita.fr>
2008
2009 * src/getargs.h: Don't declare `spec_name_prefix' and
2010 `spec_file_prefix', declared by src/files.h.
2011 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2012 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2013 * src/output.c (prepare): Adjust.
2014 * src/reader.c (symbols_output): Likewise.
2015 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2016
bdef2a41
AD
20172001-12-10 Akim Demaille <akim@epita.fr>
2018
2019 * src/muscle_tab.c (muscle_init): NULL is a better default than
2020 `"0"'.
2021
3735969c
AD
20222001-12-10 Akim Demaille <akim@epita.fr>
2023
2024 * src/reader.c (reader): Calling symbols_output once is enough.
2025
49701457
AD
20262001-12-10 Akim Demaille <akim@epita.fr>
2027
2028 Now that states have a complete set of members, the linked list of
2029 reductions is useless: just fill directly the state's reductions
2030 member.
2031
2032 * src/state.h (struct reductions): Remove member `number' and
2033 `next'.
2034 * src/LR0.c (first_reduction, last_reduction): Remove.
2035 (save_reductions): Don't link the new reductions, store them in
2036 this_state.
2037 * src/lalr.c (set_state_table): No need to attach reductions to
2038 states, it's already done.
2039 * src/output.c (output_actions): No longer free the shifts, then
2040 the reductions, then the states: free all the states and their
2041 members.
2042
0edad749
AD
20432001-12-10 Akim Demaille <akim@epita.fr>
2044
2045 * src/options.c (OPTN, DRTV, BOTH): New.
2046 (option_table): Use them.
2047
0edad749
AD
2048 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2049 the job of system.h.
2050 * src/options.c: Don't include stdio.h and xalloc.h for the same
2051 reasons.
2052
5449dd0f
AD
20532001-12-10 Akim Demaille <akim@epita.fr>
2054
2055 * src/output.c (output, prepare): Make sure the values of the
2056 muscles `action' and `prologue' are 0-terminated.
2057
a870c567
AD
20582001-12-10 Akim Demaille <akim@epita.fr>
2059
2060 Clean up GCC warnings.
2061
2062 * src/reader.c (copy_action): `buf' is not used.
2063 (parse_skel_decl): Be static.
2064 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2065 * src/options.h (create_long_option_table): Have a real prototype.
2066 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2067 (hash_delete_at): Return const void *.
2068 Adjust casts to preserve the const.
2069
80df8768
AD
20702001-12-10 Akim Demaille <akim@epita.fr>
2071
2072 * configure.in: Require 2.52g.
2073 M4 is not needed, but AUTOM4TE is.
2074 * m4/m4.m4: Remove.
2075 * tests/Makefile.am: Adjust.
2076
f693ad14
AD
20772001-12-10 Akim Demaille <akim@epita.fr>
2078
2079 One structure for states is enough, even though theoretically
2080 there are LR(0) states and LALR(1) states.
2081
2082 * src/lalr.h (state_t): Remove.
2083 (state_table): Be state_t **, not state_t *.
2084 * src/state.h (core, CORE_ALLOC): Rename as...
2085 (state_t, STATE_ALLOC): this.
2086 Add the LALR(1) members: shifts, reductions, errs.
2087 * src/LR0.c (state_table): Rename as...
2088 (state_hash): this, to avoid name clashes with the global
2089 `state_table'.
2090 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2091 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2092
74ffbcb6
AD
20932001-12-10 Akim Demaille <akim@epita.fr>
2094
2095 Bison dumps core on bash.y.
2096 Reported by Pascal Bart.
2097
2098 * src/warshall.c (bitmatrix_print): New.
2099 (TC): Use it.
2100 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2101 j must be the outer loop.
2102 * tests/regression.at (Broken Closure): New.
2103
07708e19
AD
21042001-12-05 Akim Demaille <akim@epita.fr>
2105
2106 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2107 its argument.
2108