]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* data/bison.simple (YYCOPY): Fix [] quoting problem in the non-GCC case.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-04-26 Paul Eggert <eggert@twinsun.com>
2
3 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
4 Define if we define YYSTYPE and YYLTYPE, respectively.
5 (YYCOPY): Fix [] quoting problem in the non-GCC case.
6
72002-04-25 Robert Anisko <robert@lrde.epita.fr>
8
9 * src/scan-skel.l: Postprocess quadrigraphs.
10
11 * src/reader.c (copy_character): New function, used to output
12 single characters while replacing `[' and `]' with quadrigraphs, to
13 avoid troubles with M4 quotes.
14 (copy_comment): Output characters with copy_character.
15 (read_additionnal_code): Likewise.
16 (copy_string2): Likewise.
17 (copy_definition): Likewise.
18
19 * tests/calc.at: Exercise M4 quoting.
20
212002-04-25 Akim Demaille <akim@epita.fr>
22
23 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
24 between `!' and the command.
25 Reported by Paul Eggert.
26
272002-04-24 Robert Anisko <robert@lrde.epita.fr>
28
29 * tests/calc.at: Exercise prologue splitting.
30
31 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
32 `b4_post_prologue' instead of `b4_prologue'.
33
34 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
35 muscles.
36 (output): Free pre_prologue_obstack and post_prologue_obstack.
37 * src/files.h, src/files.c (attrs_obstack): Remove.
38 (pre_prologue_obstack, post_prologue_obstack): New.
39 * src/reader.c (copy_definition): Add a parameter to specify the
40 obstack to fill, instead of using attrs_obstack unconditionally.
41 (read_declarations): Pass pre_prologue_obstack to copy_definition if
42 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
43
442002-04-23 Paul Eggert <eggert@twinsun.com>
45
46 * data/bison.simple: Remove unnecessary commentary and white
47 space differences from 1_29-branch.
48 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
49
50 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
51 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
52 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
53 constructors or destructors.
54
55 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
56
572002-04-23 Akim Demaille <akim@epita.fr>
58
59 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
60 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
61 location with columns.
62 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
63 All reported by Paul Eggert.
64
652002-04-22 Akim Demaille <akim@epita.fr>
66
67 * src/reduce.c (dump_grammar): Move to...
68 * src/gram.h, src/gram.c (grammar_dump): here.
69 Be sure to separate long item numbers.
70 Don't read the members of a rule's prec if its nil.
71
722002-04-22 Akim Demaille <akim@epita.fr>
73
74 * src/output.c (table_size, table_grow): New.
75 (MAXTABLE): Remove, replace uses with table_size.
76 (pack_vector): Instead of dying when the table is too big, grow it.
77
782002-04-22 Akim Demaille <akim@epita.fr>
79
80 * data/bison.simple (yyr1): Its type is that of a token number.
81 * data/bison.c++ (r1_): Likewise.
82 * tests/regression.at (Web2c Actions): Adjust.
83
842002-04-22 Akim Demaille <akim@epita.fr>
85
86 * src/reader.c (token_translations_init): 256 is now the default
87 value for the error token, i.e., it will be assigned another
88 number if the user assigned 256 to one of her tokens.
89 (reader): Don't force 256 to error.
90 * doc/bison.texinfo (Symbols): Adjust.
91 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
92 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
93 etc. instead of 10, 20, 30 (which was used to `jump' over error
94 (256) and undefined (2)).
95
962002-04-22 Akim Demaille <akim@epita.fr>
97
98 Propagate more token_number_t.
99
100 * src/gram.h (token_number_as_item_number)
101 (item_number_as_token_number): New.
102 * src/output.c (GENERATE_OUTPUT_TABLE): New.
103 Use it to create output_item_number_table and
104 output_token_number_table.
105 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
106 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
107 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
108 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
109
1102002-04-22 Akim Demaille <akim@epita.fr>
111
112 * src/output.h, src/output.c (get_lines_number): Remove.
113
1142002-04-19 Akim Demaille <akim@epita.fr>
115
116 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
117 as Lex/Flex'.
118 (Debugging): More details about enabling the debugging features.
119 (Table of Symbols): Describe $$, $n, @$, and @n.
120 Suggested by Tim Josling.
121
1222002-04-19 Akim Demaille <akim@epita.fr>
123
124 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
125
1262002-04-10 Akim Demaille <akim@epita.fr>
127
128 * src/system.h: Rely on HAVE_LIMITS_H.
129 Suggested by Paul Eggert.
130
1312002-04-09 Akim Demaille <akim@epita.fr>
132
133 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
134 full stderr, and strip it according to the bison options, instead
135 of composing the error message from different bits.
136 This makes it easier to check for several error messages.
137 Adjust all the invocations.
138 Add an invocation exercising the error token.
139 Add an invocation demonstrating a stupid error message.
140 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
141 Adjust the tests.
142 Error message are for stderr, not stdout.
143
1442002-04-09 Akim Demaille <akim@epita.fr>
145
146 * src/gram.h, src/gram.c (error_token_number): Remove, use
147 errtoken->number.
148 * src/reader.c (reader): Don't specify the user token number (2)
149 for $undefined, as it uselessly prevents using it.
150 * src/gram.h (token_number_t): Move to...
151 * src/symtab.h: here.
152 (state_t.number): Is a token_number_t.
153 * src/print.c, src/reader.c: Use undeftoken->number instead of
154 hard coded 2.
155 (Even though this 2 is not the same as above: the number of the
156 undeftoken remains being 2, it is its user token number which
157 might not be 2).
158 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
159 `user_token_number_max'.
160 Output `undef_token_number'.
161 * data/bison.simple, data/bison.c++: Use them.
162 Be sure to map invalid yylex return values to
163 `undef_token_number'. This saves us from gratuitous SEGV.
164
165 * tests/conflicts.at (Solved SR Conflicts)
166 (Unresolved SR Conflicts): Adjust.
167 * tests/regression.at (Web2c Actions): Adjust.
168
1692002-04-08 Akim Demaille <akim@epita.fr>
170
171 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
172 Adding #line.
173 Remove the duplicate `typedefs'.
174 (RhsNumberType): Fix the declaration and various other typos.
175 Use __ofile__.
176 * data/bison.simple: Use __ofile__.
177 * src/scan-skel.l: Handle __ofile__.
178
1792002-04-08 Akim Demaille <akim@epita.fr>
180
181 * src/gram.h (item_number_t): New, the type of item numbers in
182 RITEM. Note that it must be able to code symbol numbers as
183 positive number, and the negation of rule numbers as negative
184 numbers.
185 Adjust all dependencies (pretty many).
186 * src/reduce.c (rule): Remove this `short *' pointer: use
187 item_number_t.
188 * src/system.h (MINSHORT, MAXSHORT): Remove.
189 Include `limits.h'.
190 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
191 (shortcpy): Remove.
192 (MAXTABLE): Move to...
193 * src/output.c (MAXTABLE): here.
194 (prepare_rules): Use output_int_table to output rhs.
195 * data/bison.simple, data/bison.c++: Adjust.
196 * tests/torture.at (Big triangle): Move the limit from 254 to
197 500.
198 * tests/regression.at (Web2c Actions): Ajust.
199
200 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
201 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
202 passes, but produces negative #line number, once fixed, GCC is
203 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
204 C), it passes.
205 * src/state.h (state_h): Code input lines on ints, not shorts.
206
2072002-04-08 Akim Demaille <akim@epita.fr>
208
209 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
210 and then the grammar.
211
2122002-04-08 Akim Demaille <akim@epita.fr>
213
214 * src/system.h: No longer using strndup.
215
2162002-04-07 Akim Demaille <akim@epita.fr>
217
218 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
219 * src/output.c (output_table_data): Return the longest number.
220 (prepare_tokens): Output `token_number_max').
221 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
222 New.
223 Use them to define yy_token_number_type/TokenNumberType.
224 Use this type for yytranslate.
225 * tests/torture.at (Big triangle): Push the limit from 124 to
226 253.
227 * tests/regression.at (Web2c Actions): Adjust.
228
2292002-04-07 Akim Demaille <akim@epita.fr>
230
231 * tests/torture.at (Big triangle): New.
232 (GNU AWK Grammar, GNU Cim Grammar): Move to...
233 * tests/existing.at: here.
234
2352002-04-07 Akim Demaille <akim@epita.fr>
236
237 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
238 nritems.
239 Adjust dependencies.
240
2412002-04-07 Akim Demaille <akim@epita.fr>
242
243 * src/reader.c: Normalize increments to prefix form.
244
2452002-04-07 Akim Demaille <akim@epita.fr>
246
247 * src/reader.c, symtab.c: Remove debugging code.
248
2492002-04-07 Akim Demaille <akim@epita.fr>
250
251 Rename all the `bucket's as `symbol_t'.
252
253 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
254 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
255 * src/symtab.c, src/symtab.h (bucket): Rename as...
256 (symbol_t): this.
257 (symbol_list_new, bucket_check_defined, bucket_make_alias)
258 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
259 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
260 (buckets_new, buckets_free, buckets_do): Rename as...
261 (symbol_list_new, symbol_check_defined, symbol_make_alias)
262 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
263 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
264 (symbols_new, symbols_free, symbols_do): these.
265
2662002-04-07 Akim Demaille <akim@epita.fr>
267
268 Use lib/hash for the symbol table.
269
270 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
271 EOF.
272 * src/lex.c (lex): Set the `number' member of new terminals.
273 * src/reader.c (bucket_check_defined, bucket_make_alias)
274 (bucket_check_alias_consistence, bucket_translation): New.
275 (reader, grammar_free, readgram, token_translations_init)
276 (packsymbols): Adjust.
277 (reader): Number the predefined tokens.
278 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
279 for predefined tokens.
280 * src/symtab.h (bucket): Remove all the hash table related
281 members.
282 * src/symtab.c (symtab): Replace by...
283 (bucket_table): this.
284 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
285 (buckets_new, buckets_do): New.
286
2872002-04-07 Akim Demaille <akim@epita.fr>
288
289 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
290 (start_symbol, max_user_token_number, semantic_parser)
291 (error_token_number): Initialize.
292 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
293 Initialize.
294 (reader): Don't.
295 (errtoken, eoftoken, undeftoken, axiom): Extern.
296
2972002-04-07 Akim Demaille <akim@epita.fr>
298
299 * src/gram.h (rule_s): prec and precsym are now pointers
300 to the bucket giving the priority/associativity.
301 Member `associativity' removed: useless.
302 * src/reduce.c, src/conflicts.c: Adjust.
303
3042002-04-07 Akim Demaille <akim@epita.fr>
305
306 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
307 Properly escape the symbols' TAG when outputting them.
308
3092002-04-07 Akim Demaille <akim@epita.fr>
310
311 * src/lalr.h (LA): Is a bitsetv, not bitset*.
312
3132002-04-07 Akim Demaille <akim@epita.fr>
314
315 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
316 (LArule): this, which is an array to rule_t*.
317 * src/print.c, src/conflicts.c: Adjust.
318
3192002-04-07 Akim Demaille <akim@epita.fr>
320
321 * src/gram.h (rule_t): Rename `number' as `user_number'.
322 `number' is a new member.
323 Adjust dependencies.
324 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
325
3262002-04-07 Akim Demaille <akim@epita.fr>
327
328 As a result of the previous patch, it is no longer needed
329 to reorder ritem itself.
330
331 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
332
3332002-04-07 Akim Demaille <akim@epita.fr>
334
335 Be sure never to walk through RITEMS, but use only data related to
336 the rules themselves. RITEMS should be banished.
337
338 * src/output.c (output_token_translations): Rename as...
339 (prepare_tokens): this.
340 In addition to `translate', prepare the muscles `tname' and
341 `toknum', which were handled by...
342 (output_rule_data): this.
343 Remove, and move the remainder of its outputs into...
344 (prepare_rules): this new routines, which also merges content from
345 (output_gram): this.
346 (prepare_rules): Be sure never to walk through RITEMS.
347 (output_stos): Rename as...
348 (prepare_stos): this.
349 (output): Always invoke prepare_states, after all, just don't use it
350 in the output if you don't need it.
351
3522002-04-07 Akim Demaille <akim@epita.fr>
353
354 * src/LR0.c (new_state): Display `nstates' as the name of the
355 newly created state.
356 Adjust to initialize first_state and last_state if needed.
357 Be sure to distinguish the initial from the final state.
358 (new_states): Create the itemset of the initial state, and use
359 new_state.
360 * src/closure.c (closure): Now that the initial state has its
361 items properly set, there is no need for a special case when
362 creating `ruleset'.
363
364 As a result, now the rule 0, reducing to $axiom, is visible in the
365 outputs. Adjust the test suite.
366
367 * tests/conflicts.at (Solved SR Conflicts)
368 (Unresolved SR Conflicts): Adjust.
369 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
370 * tests/conflicts.at (S/R in initial): New.
371
3722002-04-07 Akim Demaille <akim@epita.fr>
373
374 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
375 the RHS of the rules.
376 * src/output.c (output_gram): Likewise.
377
3782002-04-07 Akim Demaille <akim@epita.fr>
379
380 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
381 bucket.
382 Adjust all dependencies.
383 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
384 `number' of the buckets too.
385 * src/gram.h: Include `symtab.h'.
386 (associativity): Move to...
387 * src/symtab.h: here.
388 No longer include `gram.h'.
389
3902002-04-07 Akim Demaille <akim@epita.fr>
391
392 * src/gram.h, src/gram.c (rules_rhs_length): New.
393 (ritem_longest_rhs): Use it.
394 * src/gram.h (rule_t): `number' is a new member.
395 * src/reader.c (packgram): Set it.
396 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
397 the end of `rules', and count them out of `nrules'.
398 (reduce_output, dump_grammar): Adjust.
399 * src/print.c (print_grammar): It is no longer needed to check for
400 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
401 * tests/reduce.at (Reduced Automaton): New test.
402
4032002-04-07 Akim Demaille <akim@epita.fr>
404
405 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
406 lacking `+ 1' to nrules, Bison reported as useless a token if it
407 was used solely to set the precedence of the last rule...
408
4092002-04-07 Akim Demaille <akim@epita.fr>
410
411 * data/bison.c++, data/bison.simple: Don't output the current file
412 name in #line, to avoid useless diffs between two identical
413 outputs under different names.
414
4152002-04-07 Akim Demaille <akim@epita.fr>
416
417 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
418 Normalize loops to using `< nrules + 1', not `<= nrules'.
419
4202002-04-07 Akim Demaille <akim@epita.fr>
421
422 * TODO: Update.
423
4242002-04-07 Akim Demaille <akim@epita.fr>
425
426 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
427 bucket.value as bucket.number.
428
4292002-04-07 Akim Demaille <akim@epita.fr>
430
431 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
432 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
433 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
434 RHS, instead of being an index in RITEMS.
435
4362002-04-04 Paul Eggert <eggert@twinsun.com>
437
438 * doc/bison.texinfo: Update copyright date.
439 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
440 (Symbols): Warn about running Bison in one character set,
441 but compiling and/or running in an incompatible one.
442 Warn about character code 256, too.
443
4442002-04-03 Paul Eggert <eggert@twinsun.com>
445
446 * src/bison.data (YYSTACK_ALLOC): Depend on whether
447 YYERROR_VERBOSE is nonzero, not whether it is defined.
448
449 Merge changes from bison-1_29-branch.
450
4512002-03-20 Paul Eggert <eggert@twinsun.com>
452
453 Merge fixes from Debian bison_1.34-1.diff.
454
455 * configure.in (AC_PREREQ): 2.53.
456
4572002-03-20 Akim Demaille <akim@epita.fr>
458
459 * src/conflicts.c (log_resolution): Argument `resolution' is const.
460
4612002-03-19 Paul Eggert <eggert@twinsun.com>
462
463 * src/bison.simple (YYCOPY): New macro.
464 (YYSTACK_RELOCATE): Use it.
465 Remove Type arg; no longer needed. All callers changed.
466 (yymemcpy): Remove; no longer needed.
467
468 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
469 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
470
4712002-03-19 Akim Demaille <akim@epita.fr>
472
473 Test and fix the #line outputs.
474
475 * tests/atlocal.at (GCC): New.
476 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
477 (Prologue synch line, ,%union synch line, Postprologue synch line)
478 (Action synch line, Epilogue synch line): New tests.
479 * src/reader.c (parse_union_decl): Define the muscle stype_line.
480 * data/bison.simple, data/bison.c++: Use it.
481
4822002-03-19 Akim Demaille <akim@epita.fr>
483
484 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
485 (Solved SR Conflicts, %expect not enough, %expect right)
486 (%expect too much): Move to...
487 * tests/conflicts.at: this new file.
488
4892002-03-19 Akim Demaille <akim@epita.fr>
490
491 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
492 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
493 that we can move to enums for instance.
494 * src/output.c (token_definitions_output): Output a list of
495 `token-name, token-number' instead of the #define.
496 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
497
4982002-03-14 Akim Demaille <akim@epita.fr>
499
500 Use Gettext 0.11.1.
501
5022002-03-09 Robert Anisko <robert@lrde.epita.fr>
503
504 * data/bison.c++: Make the user able to add members to the generated
505 parser by subclassing.
506
5072002-03-05 Robert Anisko <robert@lrde.epita.fr>
508
509 * src/reader.c (read_additionnal_code): `c' should be an integer, not
510 a character.
511 Reported by Nicolas Tisserand and Nicolas Burrus.
512
5132002-03-04 Robert Anisko <robert@lrde.epita.fr>
514
515 * src/reader.c: Warn about lacking semi-colons, do not complain.
516
5172002-03-04 Robert Anisko <robert@lrde.epita.fr>
518
519 * data/bison.c++: Remove a debug line.
520
5212002-03-04 Robert Anisko <robert@lrde.epita.fr>
522
523 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
524 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
525 provide a default implementation.
526
5272002-03-04 Akim Demaille <akim@epita.fr>
528
529 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
530 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
531 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
532 * tests/semantic.at (Parsing Guards): Similarly.
533 * src/reader.at (readgram): Complain if the last rule is not ended
534 with a semi-colon.
535
5362002-03-04 Akim Demaille <akim@epita.fr>
537
538 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
539 * src/closure.c: here.
540 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
541 RTC.
542 * src/warshall.h, src/warshall.c: Remove.
543 * tests/sets.at (Broken Closure): Adjust.
544
5452002-03-04 Akim Demaille <akim@epita.fr>
546
547 * src/output.c (output_skeleton): tempdir is const.
548 bytes_read is unused.
549
5502002-03-04 Akim Demaille <akim@epita.fr>
551
552 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
553 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
554 Update.
555 From Michael Hayes.
556
5572002-03-04 Akim Demaille <akim@epita.fr>
558
559 * src/closure.c (closure): `r' is unused.
560
5612002-03-04 Akim Demaille <akim@epita.fr>
562
563 * tests/sets.at (Broken Closure): Add the ending `;'.
564 * src/reader.at (readgram): Complain if a rule is not ended with a
565 semi-colon.
566
5672002-03-04 Akim Demaille <akim@epita.fr>
568
569 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
570 (count_sr_conflicts): Use bitset_count.
571 * src/reduce.c (inaccessable_symbols): Ditto.
572 (bits_size): Remove.
573 * src/warshall.h, src/warshall.c: Convert to bitsetv.
574
5752002-03-04 Akim Demaille <akim@epita.fr>
576
577 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
578 * src/reduce.c: Remove the `bitset_zero's following the
579 `bitset_create's, as now it is performed by the latter.
580
5812002-03-04 Akim Demaille <akim@epita.fr>
582
583 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
584 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
585 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
586 latest sources from Michael.
587
5882002-03-04 Akim Demaille <akim@epita.fr>
589
590 * src/output.c (output): Don't free the grammar.
591 * src/reader.c (grammar_free): New.
592 * src/main.c (main): Call it and don't free symtab here.
593
5942002-03-04 Akim Demaille <akim@epita.fr>
595
596 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
597 before returning.
598 Reported by Benoit Perrot.
599
6002002-03-04 Akim Demaille <akim@epita.fr>
601
602 Use bitset operations when possible, not loops over bits.
603
604 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
605 bitset_or.
606 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
607 * src/reduce.c (useless_nonterminals): Formatting changes.
608 * src/warshall.c (TC): Use bitset_or.
609
6102002-03-04 Akim Demaille <akim@epita.fr>
611
612 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
613 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
614 Ditto.
615
6162002-03-04 Akim Demaille <akim@epita.fr>
617
618 * src/lalr.c (F): Now a bitset*.
619 Adjust all dependencies.
620
6212002-03-04 Akim Demaille <akim@epita.fr>
622
623 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
624 Adjust all dependencies.
625
6262002-03-04 Akim Demaille <akim@epita.fr>
627
628 * src/L0.c, src/LR0.h (nstates): Be size_t.
629 Adjust comparisons (signed vs unsigned).
630 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
631 bitset*.
632 Adjust all dependencies.
633
6342002-03-04 Akim Demaille <akim@epita.fr>
635
636 * src/closure.c (firsts): Now, also a bitset.
637 Adjust all dependencies.
638 (varsetsize): Remove, now unused.
639 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
640
6412002-03-04 Akim Demaille <akim@epita.fr>
642
643 * src/print.c: Convert to use bitset.h, not hand coded iterations
644 over ints.
645
6462002-03-04 Akim Demaille <akim@epita.fr>
647
648 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
649
6502002-03-04 Akim Demaille <akim@epita.fr>
651
652 * src/closure.c (ruleset): Be a bitset.
653 (rulesetsize): Remove.
654
6552002-03-04 Akim Demaille <akim@epita.fr>
656
657 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
658 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
659 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
660 * src/closure.c (fderives): Be an array of bitsets.
661
6622002-02-28 Robert Anisko <robert@lrde.epita.fr>
663
664 * data/bison.c++: Merge the two generated headers. Insert a copyright
665 notice in each output file.
666
6672002-02-28 Akim Demaille <akim@epita.fr>
668
669 * data/bison.c++: Copy the prologue of bison.simple to fetch
670 useful M4 definitions, such as b4_header_guard.
671
6722002-02-25 Akim Demaille <akim@epita.fr>
673
674 * src/getargs.c (version): Give the name of the authors, and use a
675 translator friendly scheme for the bgr
676 copyright notice.
677
6782002-02-25 Akim Demaille <akim@epita.fr>
679
680 * src/output.c (header_output): Remove, now handled completely via
681 M4.
682
6832002-02-25 Akim Demaille <akim@epita.fr>
684
685 * m4/m4.m4: New, from CVS Autoconf.
686 * configure.in: Invoke it.
687 * src/output.c (output_skeleton): Use its result instead of the
688 hard coded name.
689
6902002-02-25 Akim Demaille <akim@epita.fr>
691
692 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
693 Fileutils 4.1.5.
694 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
695 * src/output.c (output_skeleton): Use mkstemp to create a real
696 temporary file.
697 Move the filling of `skeleton' and its muscle to...
698 (prepare): here.
699 (output): Move the definition of the prologue muscle to...
700 (prepare): here.
701 * src/system.h (DEFAULT_TMPDIR): New.
702
7032002-02-14 Paul Eggert <eggert@twinsun.com>
704
705 Remove the support for C++ namespace cleanliness; it was
706 causing more problems than it was curing, since it didn't work
707 properly on some nonstandard C++ compilers. This can wait
708 for a proper C++ parser.
709
710 * NEWS: Document this.
711 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
712 of C++, as it's treated like C now.
713 * src/bison.simple (YYSTD): Remove.
714 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
715 Treat C++ just like Standard C instead of trying to support
716 namespace cleanliness.
717
7182002-02-14 Akim Demaille <akim@epita.fr>
719
720 * tests/regression.at (else): Adjust to Andreas' change.
721
7222002-02-14 Akim Demaille <akim@epita.fr>
723
724 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
725
7262002-02-13 Andreas Schwab <schwab@suse.de>
727
728 * src/output.c (output_rule_data): Don't output NULL, it might
729 not be defined yet.
730
7312002-02-11 Robert Anisko <robert@lrde.epita.fr>
732
733 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
734 (Copyright notice): Update.
735
7362002-02-11 Akim Demaille <akim@epita.fr>
737
738 * tests/regression.at (%nonassoc and eof): Don't include
739 nonportable headers.
740
7412002-02-08 Robert Anisko <robert@lrde.epita.fr>
742
743 * data/bison.c++: Correct error recovery. Make the user able to
744 initialize the starting location.
745
7462002-02-07 Akim Demaille <akim@epita.fr>
747
748 * tests/input.at: New.
749
7502002-02-07 Robert Anisko <robert@lrde.epita.fr>
751
752 * data/bison.c++: Replace some direct m4 expansions by constants. Be
753 more consistent when naming methods and variables. Put preprocessor
754 directives around tables only needed for debugging.
755
7562002-02-07 Robert Anisko <robert@lrde.epita.fr>
757
758 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
759 C++ parsers.
760 (yy::b4_name::parse): Use print_.
761
7622002-02-07 Robert Anisko <robert@lrde.epita.fr>
763
764 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
765
7662002-02-07 Robert Anisko <robert@lrde.epita.fr>
767
768 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
769 C++ parsers.
770 (yy::b4_name::parse): Build verbose error messages, and use error_.
771
7722002-02-06 Robert Anisko <robert@lrde.epita.fr>
773
774 * data/bison.c++: Fix m4 quoting in comments.
775
7762002-02-06 Robert Anisko <robert@lrde.epita.fr>
777
778 * data/bison.c++: Adjust the parser code. Fix some muscles that were
779 not expanded by m4.
780
7812002-02-05 Akim Demaille <akim@epita.fr>
782
783 * data/bison.c++: Adjust to the M4 back end.
784 More is certainly needed.
785
7862002-02-05 Akim Demaille <akim@epita.fr>
787
788 Give a try to M4 as a back end.
789
790 * lib/readpipe.c: New, from wdiff.
791 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
792 BISON_HAIRY.
793 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
794 specific values. Now it is m4 that performs the lookup.
795 * src/parse-skel.y: Remove.
796 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
797 * src/output.c (actions_output, guards_output)
798 (token_definitions_output): No longer keeps track of the output
799 line number, hence remove the second argument.
800 (guards_output): Check against the guard member of a rule, not the
801 action member.
802 Adjust callers.
803 (output_skeleton): Don't look for the skeleton location, let m4 do
804 that.
805 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
806 file will be used.
807 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
808 (prepare): Given that for the time being changesyntax is not
809 usable in M4, rename the muscles using `-' to `_'.
810 Define `defines_flag', `output_parser_name' and `output_header_name'.
811 * src/output.h (actions_output, guards_output)
812 (token_definitions_output): Adjust prototypes.
813 * src/scan-skel.l: Instead of scanning the skeletons, it now
814 processes the output of m4: `__oline__' and `#output'.
815 * data/bison.simple: Adjust to be used by M4(sugar).
816 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
817 to date.
818 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
819 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
820 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
821 shamelessly stolen from CVS Autoconf.
822
8232002-02-05 Akim Demaille <akim@epita.fr>
824
825 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
826 * configure.in: Check for the declarations of free and malloc.
827 * src/muscle_tab.c: Adjust.
828
8292002-02-05 Akim Demaille <akim@epita.fr>
830
831 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
832 which have no values.
833
8342002-02-05 Akim Demaille <akim@epita.fr>
835
836 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
837 * data/: here.
838
8392002-01-29 Paul Eggert <eggert@twinsun.com>
840
841 * src/bison.simple (YYSIZE_T): Do not define merely because
842 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
843 On some platforms, <alloca.h> does not declare YYSTD (size_t).
844
8452002-01-27 Akim Demaille <akim@epita.fr>
846
847 Fix `%nonassoc and eof'.
848
849 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
850 which were not properly copied! Replace
851 memcpy (res->errs, src->errs, src->nerrs);
852 with
853 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
854 !!!
855 * tests/regression.at (%nonassoc and eof): Adjust to newest
856 Autotest: `.' is not in the PATH.
857
8582002-01-27 Akim Demaille <akim@epita.fr>
859
860 * tests/sets.at (AT_EXTRACT_SETS): New.
861 (Nullable): Use it.
862 (Firsts): New.
863
8642002-01-26 Akim Demaille <akim@epita.fr>
865
866 * tests/actions.at, tests/calc.at, tests/headers.at,
867 * tests/torture.at: Adjust to the newest Autotest which no longer
868 forces `.' in the PATH.
869
8702002-01-25 Akim Demaille <akim@epita.fr>
871
872 * tests/regression.at (%nonassoc and eof): New.
873 Suggested by Robert Anisko.
874
8752002-01-24 Akim Demaille <akim@epita.fr>
876
877 Bison dumps core when trying to complain about broken input files.
878 Reported by Cris van Pelt.
879
880 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
881 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
882 into...
883 (Invalid inputs): Strengthen: exercise parse_percent_token.
884
8852002-01-24 Robert Anisko <robert.anisko@epita.fr>
886
887 * src/Makefile.am: Add bison.c++.
888 * src/bison.c++: New skeleton.
889
8902002-01-21 Paolo Bonzini <bonzini@gnu.org>
891
892 * po/it.po: New.
893
8942002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
895
896 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
897
8982002-01-20 Marc Autret <marc@gnu.org>
899
900 * src/files.c (compute_output_file_names): Fix
901
9022002-01-20 Marc Autret <marc@gnu.org>
903
904 * tests/output.at: New test.
905 * src/files.c (compute_base_names): Don't map extensions when
906 the YACC flag is set, use defaults.
907 Reported by Evgeny Stambulchik.
908
9092002-01-20 Marc Autret <marc@gnu.org>
910
911 * src/system.h: Need to define __attribute__ away for non-GCC
912 compilers as well (i.e. the vendor C compiler).
913 Suggested by Albert Chin-A-Young.
914
9152002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
916
917 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
918 canonical definition.
919 * src/system.h: Use the canonical definition for PARAMS (avoids
920 a conflict with the macro from lib/hash.h).
921
9222002-01-11 Akim Demaille <akim@epita.fr>
923
924 * configure.in: Use AC_FUNC_STRNLEN.
925 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
926
9272002-01-09 Akim Demaille <akim@epita.fr>
928
929 * src/files.c, src/files.h (output_infix): New.
930 (tab_extension): Remove.
931 (compute_base_names): Compute the former, drop the latter.
932 * src/output.c (prepare): Insert the muscles `output-infix', and
933 `output-suffix'.
934 * src/parse-skel.y (string, string.1): New.
935 (section.header): Use it.
936 (section.yacc): Remove.
937 (prefix): Remove too.
938 * src/scan-skel.l: Adjust.
939 * src/bison.simple, src/bison.hairy: Adjust.
940
9412002-01-09 Akim Demaille <akim@epita.fr>
942
943 * configure.in (WERROR_CFLAGS): Compute it.
944 * src/Makefile.am (CFLAGS): Pass it.
945 * tests/atlocal.in (CFLAGS): Idem.
946 * src/files.c: Fix a few warnings.
947 (get_extension_index): Remove, unused.
948
9492002-01-08 Akim Demaille <akim@epita.fr>
950
951 * src/getargs.c (AS_FILE_NAME): New.
952 (getargs): Use it to convert DOSish file names.
953 * src/files.c (base_name): Rename as full_base_name to avoid
954 clashes with `base_name ()'.
955 (filename_split): New.
956 (compute_base_names): N-th rewrite, using filename_split.
957
9582002-01-08 Akim Demaille <akim@epita.fr>
959
960 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
961 New, stolen from the Fileutils 4.1.
962 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
963 * configure.in: Check for the presence of memrchr, and of its
964 prototype.
965
9662002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
967
968 * lib/hash.h (__P): Added definition for this macro.
969 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
970 BUILT_SOURCES, to ensure they are generated first.
971 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
972 %error-verbose to allow bootstrapping with bison 1.30x.
973
9742002-01-06 Akim Demaille <akim@epita.fr>
975
976 * src/reader.c (parse_braces): Don't fetch the next char, the
977 convention is to fetch on entry.
978 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
979 'switch' without a following semicolon.
980 * tests/regression.at (braces parsing): New.
981
9822002-01-06 Akim Demaille <akim@epita.fr>
983
984 Bison is dead wrong in its RR conflict reports.
985
986 * tests/torture.at (GNU Cim Grammar): New.
987 * src/conflicts.c (count_rr_conflicts): Fix.
988
9892002-01-06 Akim Demaille <akim@epita.fr>
990
991 Creating package.m4 from configure.ac causes too many problems.
992
993 * tests/Makefile.am (package.m4): Create it by hand,
994 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
995
9962002-01-06 Akim Demaille <akim@epita.fr>
997
998 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
999 skeleton.h.
1000
10012002-01-04 Paul Eggert <eggert@twinsun.com>
1002
1003 * doc/bison.texinfo (Debugging):
1004 Remove YYSTDERR; it's no longer defined or used.
1005 Also, s/cstdio.h/cstdio/.
1006
10072002-01-03 Akim Demaille <akim@epita.fr>
1008
1009 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1010
10112002-01-03 Akim Demaille <akim@epita.fr>
1012
1013 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1014 tracing code to --trace, wait for a better --trace option, with
1015 args.
1016
10172002-01-03 Akim Demaille <akim@epita.fr>
1018
1019 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1020 The ISO C++ standard is extremely clear about it: stderr is
1021 considered a macro, not a regular symbol (see table 94 `Header
1022 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1023 Therefore std:: does not apply to it. It still does with fprintf.
1024 Also, s/cstdio.h/cstdio/.
1025
10262002-01-03 Akim Demaille <akim@epita.fr>
1027
1028 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1029 for non system headers.
1030
10312002-01-02 Akim Demaille <akim@epita.fr>
1032
1033 Equip the skeleton chain with location tracking, runtime trace,
1034 pure parser and scanner.
1035
1036 * src/parse-skel.y: Request a pure parser, locations, and prefix
1037 renaming.
1038 (%union): Having several members with the same type does not help
1039 type mismatches, simplify.
1040 (YYPRINT, yyprint): New.
1041 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1042 (skel_error): this.
1043 Handle locations.
1044 * src/scan-skel.l: Adjust to these changes.
1045 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1046 (LOCATION_PRINT, skel_control_t): New.
1047
10482001-12-30 Akim Demaille <akim@epita.fr>
1049
1050 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1051 replace `gb' with BLANKS.
1052 * src/scan-skel.l: Adjust.
1053
10542001-12-30 Akim Demaille <akim@epita.fr>
1055
1056 * src/system.h: We don't need nor want bcopy.
1057 Throw away MS-DOS crap: we don't need getpid.
1058 * configure.in: We don't need strndup. It was even causing
1059 problems: because Flex includes the headers *before* us,
1060 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1061 not visible.
1062 * lib/xstrndup.c: New.
1063 * src/scan-skel.l: Use it.
1064 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1065 * src/parse-skel.y: Use %directives instead of #defines.
1066
10672001-12-30 Akim Demaille <akim@epita.fr>
1068
1069 * src/skeleton.h: New.
1070 * src/output.c (output_parser, output_master_parser): Remove, dead
1071 code.
1072 * src/output.h (get_lines_number, actions_output, guards_output)
1073 (token_definitions_output): Prototype them.
1074 * src/parse-skel.y: Add the license notice.
1075 Include output.h and skeleton.h.
1076 (process_skeleton): Returns void, and takes a single parameter.
1077 * src/scan-skel.l: Add the license notice.
1078 Include skeleton.h.
1079 Don't use %option yylineno: it seems that then Flex imagines
1080 REJECT has been used, and therefore it won't reallocate its
1081 buffers (which makes no other sense to me than a bug). It results
1082 in warnings for `unused: yy_flex_realloc'.
1083
10842001-12-30 Robert Anisko <robert.anisko@epita.fr>
1085
1086 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1087 (MUSCLE_INSERT_PREFIX): ...to there.
1088 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1089 (MUSCLE_INSERT_PREFIX): Move from here...
1090
1091 * src/bison.hairy: Add a section directive. Put braces around muscle
1092 names. This parser skeleton is still broken, but Bison should not
1093 choke on a bad muscle 'syntax'.
1094 * src/bison.simple: Add a section directive. Put braces around muscle
1095 names.
1096
1097 * src/files.h (strsuffix, stringappend): Add declarations.
1098 (tab_extension): Add declaration.
1099 (short_base_name): Add declaration.
1100
1101 * src/files.c (strsuffix, stringappend): No longer static. These
1102 functions are used in the skeleton parser.
1103 (tab_extension): New.
1104 (compute_base_names): Use the computations done in this function
1105 to guess if the generated parsers should have '.tab' in their
1106 names.
1107 (short_base_name): No longer static.
1108
1109 * src/output.c (output_skeleton): New.
1110 (output): Disable call to output_master_parser, and give a try to
1111 a new skeleton handling system.
1112 (guards_output, actions_output): No longer static.
1113 (token_definitions_output, get_lines_number): No longer static.
1114
1115 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1116
1117 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
1118 parse-skel.y.
1119
1120 * src/parse-skel.y: New file.
1121 * src/scan-skel.l: New file.
1122
11232001-12-29 Akim Demaille <akim@epita.fr>
1124
1125 %name-prefix is broken.
1126
1127 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1128 Adjust all dependencies.
1129 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1130 %name-prefix.
1131
1132 Renaming yylval but not yylloc is not consistent. Now we do.
1133
1134 * src/bison.simple: Prefix yylloc if used.
1135 * doc/bison.texinfo (Decl Summary): Document that.
1136
11372001-12-29 Akim Demaille <akim@epita.fr>
1138
1139 * doc/bison.texinfo: Promote `%long-directive' over
1140 `%long_directive'.
1141 Remove all references to fixed-output-files, yacc is enough.
1142
11432001-12-29 Akim Demaille <akim@epita.fr>
1144
1145 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1146 user prologue. These are defaults.
1147 * tests/actions.at (Mid-rule actions): Make sure the user can
1148 define YYDEBUG and YYERROR_VERBOSE.
1149
11502001-12-29 Akim Demaille <akim@epita.fr>
1151
1152 * src/output.c (header_output): Don't forget to export YYLTYPE and
1153 yylloc.
1154 * tests/headers.at (export YYLTYPE): New, make sure it does.
1155 * tests/regression.at (%union and --defines, Invalid CPP headers):
1156 Move to...
1157 * tests/headers.at: here.
1158
11592001-12-29 Akim Demaille <akim@epita.fr>
1160
1161 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1162
11632001-12-29 Akim Demaille <akim@epita.fr>
1164
1165 * tests/actions.at (Mid-rule actions): Output on a single line
1166 instead of several.
1167
11682001-12-29 Akim Demaille <akim@epita.fr>
1169
1170 * doc/bison.texinfo: Formatting changes.
1171
11722001-12-29 Akim Demaille <akim@epita.fr>
1173
1174 Don't store the token defs in a muscle, just be ready to output it
1175 on command. Now possible via `symbols'. Fixes a memory leak.
1176
1177 * src/output.c (token_definitions_output): New.
1178 (output_parser, header_output): Use it.
1179 * src/reader.c (symbols_save): Remove.
1180
11812001-12-29 Akim Demaille <akim@epita.fr>
1182
1183 * src/bison.simple: Do not provide a default for YYSTYPE and
1184 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1185 default.
1186
11872001-12-29 Akim Demaille <akim@epita.fr>
1188
1189 Mid-rule actions are simply... ignored!
1190
1191 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1192 the empty-rule associated to the dummy symbol, not to the host
1193 rule.
1194 * tests/actions.at (Mid-rule actions): New.
1195
11962001-12-29 Akim Demaille <akim@epita.fr>
1197
1198 Memory leak.
1199
1200 * src/reader.c (reader): Free grammar.
1201
12022001-12-29 Akim Demaille <akim@epita.fr>
1203
1204 Memory leak.
1205
1206 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1207 since it allocates it for each state, although only one is needed.
1208 (allocate_storage): Do it here.
1209
12102001-12-29 Akim Demaille <akim@epita.fr>
1211
1212 * src/options.h, src/options.c (create_long_option_table): Rename
1213 as...
1214 (long_option_table_new): this, with a clearer prototype.
1215 (percent_table): Remove, unused,
1216 * src/getargs.c (getargs): Adjust.
1217
12182001-12-29 Akim Demaille <akim@epita.fr>
1219
1220 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1221 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1222 as states.
1223
12242001-12-29 Akim Demaille <akim@epita.fr>
1225
1226 * src/lalr.c (build_relations): Rename `states' as `states1'.
1227 Sorry, I don't understand exactly what it is, no better name...
1228
12292001-12-29 Akim Demaille <akim@epita.fr>
1230
1231 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1232 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1233 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1234 as rules.
1235
12362001-12-29 Akim Demaille <akim@epita.fr>
1237
1238 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1239 ago.
1240
12412001-12-29 Akim Demaille <akim@epita.fr>
1242
1243 * src/reader.c, src/reader.h (user_toknums): Remove.
1244 Adjust all users to use symbols[i]->user_token_number.
1245
12462001-12-29 Akim Demaille <akim@epita.fr>
1247
1248 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1249 Adjust all users to use symbols[i]->prec or ->assoc.
1250
12512001-12-29 Akim Demaille <akim@epita.fr>
1252
1253 * src/reader.c, src/reader.h (tags): Remove.
1254 Adjust all users to use symbols[i]->tag.
1255
12562001-12-29 Akim Demaille <akim@epita.fr>
1257
1258 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1259 and rule_table.
1260 * src/reader.c (packsymbols): Fill this table.
1261 Drop sprec.
1262 * src/conflicts.c (resolve_sr_conflict): Adjust.
1263 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1264 single table.
1265 Use symbols[i]->tag instead of tags[i].
1266
12672001-12-29 Akim Demaille <akim@epita.fr>
1268
1269 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1270 In addition, put a comment in there, to replace...
1271 * tests/regression.at (%union and C comments): Remove.
1272
12732001-12-29 Akim Demaille <akim@epita.fr>
1274
1275 * tests/regression.at (Web2c Actions): Blindly move the actual
1276 output as expected output. The contents *seem* right to me, but I
1277 can't pretend reading perfectly parser tables... Nonetheless, all
1278 the other tests pass correctly, the table look OK, even though the
1279 presence of `$axiom' is to be noted: AFAICS it is useless (but
1280 harmless).
1281
12822001-12-29 Akim Demaille <akim@epita.fr>
1283
1284 * src/reader.c (readgram): Don't add the rule 0 if there were no
1285 rules read. In other words, add it _after_ having performed
1286 grammar sanity checks.
1287 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1288
12892001-12-29 Akim Demaille <akim@epita.fr>
1290
1291 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1292 visible, and some states have now a different number.
1293
12942001-12-29 Akim Demaille <akim@epita.fr>
1295
1296 * src/reader.c (readgram): Bind the initial rule's lineno to that
1297 of the first rule.
1298 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1299 (Solved SR Conflicts): Adjust rule 0's line number.
1300
13012001-12-29 Akim Demaille <akim@epita.fr>
1302
1303 Fix the `GAWK Grammar' failure.
1304
1305 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1306 the reductions of the first state which was mistakenly confused
1307 with the final state because precisely final_state was initialized
1308 to 0.
1309 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1310 now noticed by Bison.
1311 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1312 have a reduction on $default.
1313
13142001-12-29 Akim Demaille <akim@epita.fr>
1315
1316 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1317 rule line numbers.
1318 * src/closure.c (print_closure): Likewise.
1319 * src/derives.c (print_derives): Likewise.
1320 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1321 now.
1322
13232001-12-29 Akim Demaille <akim@epita.fr>
1324
1325 * src/lalr.c (lookaheads_print): New.
1326 (lalr): Call it when --trace-flag.
1327 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1328 are dumped.
1329
13302001-12-29 Akim Demaille <akim@epita.fr>
1331
1332 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1333 when walking through ritem, even via rule->rhs.
1334 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1335 (useful_production, useless_nonterminals): Likewise.
1336 (reduce_grammar_tables): Likewise, plus update nritems.
1337 * src/nullable.c (set_nullable): Likewise.
1338 * src/lalr.c (build_relations): Likewise.
1339 * tests/sets.at (Nullable): Adjust.
1340 Fortunately, now, the $axiom is no longer nullable.
1341
13422001-12-29 Akim Demaille <akim@epita.fr>
1343
1344 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1345 the 0-sentinel.
1346 * src/gram.c (ritem_longest_rhs): Likewise.
1347 * src/reduce.c (nonterminals_reduce): Likewise.
1348 * src/print_graph.c (print_graph): Likewise.
1349 * src/output.c (output_rule_data): Likewise.
1350 * src/nullable.c (set_nullable): Likewise.
1351
13522001-12-29 Akim Demaille <akim@epita.fr>
1353
1354 * src/output.c: Comment changes.
1355
13562001-12-27 Paul Eggert <eggert@twinsun.com>
1357
1358 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1359 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1360 Sparc, as they were causing more porting problems than the
1361 (minor) performance improvement was worth.
1362
1363 Also, catch up with 1.31's YYSTD.
1364
13652001-12-27 Akim Demaille <akim@epita.fr>
1366
1367 * src/output.c (output_gram): Rely on nritems, not the
1368 0-sentinel. See below.
1369 Use -1 as separator, not 0.
1370 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1371 Rely on -1 as separator in yyrhs, instead of 0.
1372 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1373 twice `Now at end of input', therefore there are two lines less to
1374 expect.
1375
13762001-12-27 Akim Demaille <akim@epita.fr>
1377
1378 * tests/regression.at (Unresolved SR Conflicts):
1379 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1380 below.
1381
13822001-12-27 Akim Demaille <akim@epita.fr>
1383
1384 * src/LR0.c (new_state): Recognize the final state by the fact it
1385 is reached by eoftoken.
1386 (insert_start_shifting_state, insert_eof_shifting_state)
1387 (insert_accepting_state, augment_automaton): Remove, since now
1388 these states are automatically computed from the initial state.
1389 (generate_states): Adjust.
1390 * src/print.c: When reporting a rule number to the user, substract
1391 1, so that the axiom rule is rule 0, and the first user rule is 1.
1392 * src/reduce.c: Likewise.
1393 * src/print_graph.c (print_core): For the time being, just as for
1394 the report, depend upon --trace-flags to dump the full set of
1395 items.
1396 * src/reader.c (readgram): Once the grammar read, insert the rule
1397 0: `$axiom: START-SYMBOL $'.
1398 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1399 number of the states has changed (the final state is no longer
1400 necessarily the last), catch up.
1401
14022001-12-27 Akim Demaille <akim@epita.fr>
1403
1404 Try to make the use of the eoftoken valid. Given that its value
1405 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1406 is used instead of > 0 where appropriate, (ii), depend upon nritems
1407 instead of the 0-sentinel.
1408
1409 * src/gram.h, src/gram.c (nritems): New.
1410 Expected to be duplication of nitems, but for the time being...
1411 * src/reader.c (packgram): Assert nritems and nitems are equal.
1412 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1413 * src/closure.c (print_closure, print_fderives): Likewise.
1414 * src/gram.c (ritem_print): Likewise.
1415 * src/print.c (print_core, print_grammar): Likewise.
1416 * src/print_graph.c: Likewise.
1417
14182001-12-27 Akim Demaille <akim@epita.fr>
1419
1420 * src/main.c (main): If there are complains after grammar
1421 reductions, then output the report anyway if requested, then die.
1422 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1423 * src/reader.c (eoftoken): New.
1424 (parse_token_decl): If the token being defined has value `0', it
1425 is the eoftoken.
1426 (packsymbols): No longer hack `tags' to insert `$' by hand.
1427 Be sure to preserve the value of the eoftoken.
1428 (reader): Make sure eoftoken is defined.
1429 Initialize nsyms to 0: now eoftoken is created just like the others.
1430 * src/print.c (print_grammar): Don't special case the eof token.
1431 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1432 lie anyway, albeit pleasant.
1433 * tests/calc.at: Exercise error messages with eoftoken.
1434 Change the grammar so that empty input is invalid.
1435 Adjust expectations.
1436 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1437
14382001-12-27 Akim Demaille <akim@epita.fr>
1439
1440 * configure.in: Check the protos of strchr ans strspn.
1441 Replace strchr if needed.
1442 * src/system.h: Provide the protos of strchr, strspn and memchr if
1443 missing.
1444 * lib/strchr.c: New.
1445 * src/reader.c (symbols_save): Use strchr.
1446
14472001-12-27 Akim Demaille <akim@epita.fr>
1448
1449 * src/print.c, src/print_graph.c (escape): New.
1450 Use it to quote the TAGS outputs.
1451 * src/print_graph.c (print_state): Now errors are in red, and
1452 reductions in green.
1453 Prefer high to wide: output the state number on a line of its own.
1454
14552001-12-27 Akim Demaille <akim@epita.fr>
1456
1457 * src/state.h, src/state.c (reductions_new): New.
1458 * src/LR0.c (set_state_table): Let all the states have a
1459 `reductions', even if reduced to 0.
1460 (save_reductions): Adjust.
1461 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1462 * src/print.c (print_reductions, print_actions): Adjust.
1463 * src/output.c (action_row): Adjust.
1464
14652001-12-27 Akim Demaille <akim@epita.fr>
1466
1467 * src/state.h, src/state.c (errs_new, errs_dup): New.
1468 * src/LR0.c (set_state_table): Let all the states have an errs,
1469 even if reduced to 0.
1470 * src/print.c (print_errs, print_reductions): Adjust.
1471 * src/output.c (output_actions, action_row): Adjust.
1472 * src/conflicts.c (resolve_sr_conflict): Adjust.
1473
14742001-12-27 Akim Demaille <akim@epita.fr>
1475
1476 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1477
14782001-12-27 Akim Demaille <akim@epita.fr>
1479
1480 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1481 * src/print.c: here.
1482 (lookaheadset, shiftset): New, used as additional storage by
1483 print_reductions.
1484 (print_results): Adjust.
1485 (print_shifts, print_gotos, print_errs): New, extracted from...
1486 (print_actions): here.
1487 * src/print_graph.c (print_actions): Remove dead code.
1488
14892001-12-27 Akim Demaille <akim@epita.fr>
1490
1491 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1492 `$n' and `@n'.
1493
14942001-12-27 Akim Demaille <akim@epita.fr>
1495
1496 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1497 (build_relations): Adjust.
1498
14992001-12-27 Akim Demaille <akim@epita.fr>
1500
1501 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1502 duplication.
1503
15042001-12-27 Akim Demaille <akim@epita.fr>
1505
1506 * src/reader.c (packgram): Catch nitems overflows.
1507
15082001-12-27 Akim Demaille <akim@epita.fr>
1509
1510 * src/files.c, src/files.h (guard_obstack): Remove.
1511 * src/output.c (output): Adjust.
1512 * src/reader.c (parse_braces): New, factoring...
1513 (copy_action, copy_guard): these two which are renamed as...
1514 (parse_action, parse_guard): these.
1515 As a voluntary consequence, using braces around guards is now
1516 mandatory.
1517
15182001-12-27 Akim Demaille <akim@epita.fr>
1519
1520 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1521 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1522 members.
1523 (symbol_list_new): Adjust.
1524 (copy_action): action_line is the first line, not the last.
1525 (copy_guard): Just as for actions, store the `action' only, not
1526 the switch/case/break flesh.
1527 Don't parse the user action that might follow the guard, let...
1528 (readgram): do it, i.e., now, there can be an action after a
1529 guard.
1530 In other words the guard is just explicitly optional.
1531 (packgram): Adjust.
1532 * src/output.c (guards_output): New.
1533 (output_parser): Call it when needed.
1534 (output): Also free the guard and attrs obstacks.
1535 * src/files.c, src/files.h (obstack_save): Remove.
1536 (output_files): Remove.
1537 As a result, if one needs the former `.act' file, using an
1538 appropriate skeleton which requires actions and guards is now
1539 required.
1540 * src/main.c (main): Adjust.
1541 * tests/semantic.at: New.
1542 * tests/regression.at: Use `input.y' as input file name.
1543 Avoid 8+3 problems by requiring input.c when the test needs the
1544 parser.
1545
15462001-12-27 Akim Demaille <akim@epita.fr>
1547
1548 * src/reader.c (symbol_list_new): Be sure to initialize all the
1549 fields.
1550
15512001-12-27 Akim Demaille <akim@epita.fr>
1552
1553 All the hacks using a final pseudo state are now useless.
1554
1555 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1556 * src/lalr.c (nLA): New.
1557 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1558 instead of lookaheadsp from the pseudo state (nstate + 1).
1559
15602001-12-27 Akim Demaille <akim@epita.fr>
1561
1562 * src/output.c (action_row, token_actions): Use a state_t instead
1563 of a integer, and nlookaheads instead of the following state's
1564 lookaheadsp.
1565
15662001-12-27 Akim Demaille <akim@epita.fr>
1567
1568 * src/conflicts.c (log_resolution, flush_shift)
1569 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1570 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1571 (conflicts_print, print_reductions): Use a state_t instead of an
1572 integer when referring to a state.
1573 As much as possible, depend upon nlookaheads, instead of the
1574 `lookaheadsp' member of the following state (since lookaheads of
1575 successive states are successive, the difference between state n + 1
1576 and n served as the number of lookaheads for state n).
1577 * src/lalr.c (add_lookback_edge): Likewise.
1578 * src/print.c (print_core, print_actions, print_state)
1579 (print_results): Likewise.
1580 * src/print_graph.c (print_core, print_actions, print_state)
1581 (print_graph): Likewise.
1582 * src/conflicts.h: Adjust.
1583
15842001-12-27 Akim Demaille <akim@epita.fr>
1585
1586 * src/bison.hairy: Formatting/comment changes.
1587 ANSIfy.
1588 Remove `register' indications.
1589 Add plenty of `static'.
1590
15912001-12-27 Akim Demaille <akim@epita.fr>
1592
1593 * src/output.c (prepare): Drop the muscle `ntbase' which
1594 duplicates ntokens.
1595 * src/bison.simple: Formatting/comment changes.
1596 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1597 is an undocumented synonym.
1598
15992001-12-22 Akim Demaille <akim@epita.fr>
1600
1601 * src/output.c (output_table_data): Change the prototype to use
1602 `int' for array ranges: some invocations do pass an int, not a
1603 short.
1604 Reported by Wayne Green.
1605
16062001-12-22 Akim Demaille <akim@epita.fr>
1607
1608 Some actions of web2c.y are improperly triggered.
1609 Reported by Mike Castle.
1610
1611 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1612 * tests/regression.at (Web2c): Rename as...
1613 (Web2c Report): this.
1614 (Web2c Actions): New.
1615
16162001-12-22 Akim Demaille <akim@epita.fr>
1617
1618 Reductions in web2c.y are improperly reported.
1619 Reported by Mike Castle.
1620
1621 * src/conflicts.c (print_reductions): Fix.
1622 * tests/regression.at (Web2c): New.
1623
16242001-12-18 Akim Demaille <akim@epita.fr>
1625
1626 Some host fail on `assert (!"foo")', which expands to
1627 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1628 Reported by Nelson Beebee.
1629
1630 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1631 `#define it_succeeded 0' and `assert (it_succeeded)'.
1632
16332001-12-17 Marc Autret <autret_m@epita.fr>
1634
1635 * src/bison.simple: Don't hard code the skeleton line and filename.
1636 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1637 New line counter 'skeleton_line' (skeleton-line muscle).
1638
16392001-12-17 Paul Eggert <eggert@twinsun.com>
1640
1641 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1642 YYDEBUG must be defined to a nonzero value.
1643
1644 * src/bison.simple (yytname): Do not assume that the user defines
1645 YYDEBUG to a properly parenthesized expression.
1646
16472001-12-17 Akim Demaille <akim@epita.fr>
1648
1649 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1650 nlookaheads is a new member.
1651 Adjust all users.
1652 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1653 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1654 state.
1655
16562001-12-17 Akim Demaille <akim@epita.fr>
1657
1658 * src/files.h, src/files.c (open_files, close_files): Remove.
1659 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1660 let...
1661 * src/reader.c (reader): Do it.
1662
16632001-12-17 Akim Demaille <akim@epita.fr>
1664
1665 * src/conflicts.c (print_reductions): Formatting changes.
1666
16672001-12-17 Akim Demaille <akim@epita.fr>
1668
1669 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1670 (flush_reduce): New.
1671 (resolve_sr_conflict): Adjust.
1672
16732001-12-17 Akim Demaille <akim@epita.fr>
1674
1675 * src/output.c (output_obstack): Be static and rename as...
1676 (format_obstack): this, to avoid any confusion with files.c's
1677 output_obstack.
1678 * src/reader.h (muscle_obstack): Move to...
1679 * src/output.h: here, since it's defined in output.c.
1680
16812001-12-17 Akim Demaille <akim@epita.fr>
1682
1683 * src/output.c (action_row, save_column, default_goto)
1684 (sort_actions, matching_state, pack_vector): Better variable
1685 locality.
1686
16872001-12-17 Akim Demaille <akim@epita.fr>
1688
1689 * src/output.c: Various formatting changes.
1690
16912001-12-17 Akim Demaille <akim@epita.fr>
1692
1693 * src/files.c (output_files): Free the output_obstack.
1694 * src/main.c (main): Call print and print_graph conditionally.
1695 * src/print.c (print): Work unconditionally.
1696 * src/print_graph.c (print_graph): Work unconditionally.
1697 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1698
16992001-12-16 Marc Autret <autret_m@epita.fr>
1700
1701 * src/output.c (actions_output): Fix. When we use %no-lines,
1702 there is one less line per action.
1703
17042001-12-16 Marc Autret <autret_m@epita.fr>
1705
1706 * src/bison.simple: Remove a useless #line directive.
1707 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1708 * src/output.c (get_lines_number): New.
1709 (output_parser): Adjust, now takes care about the lines of a
1710 output muscles.
1711 Fix line numbering.
1712 (actions_output): Computes the number of lines taken by actions.
1713 (output_master_parser): Insert new skeleton which is the name of
1714 the output parser file name.
1715
17162001-12-15 Marc Autret <autret_m@epita.fr>
1717
1718 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1719
17202001-12-15 Marc Autret <autret_m@epita.fr>
1721
1722 * src/output.c (output_gram): Keep track of the hairy one.
1723
17242001-12-15 Akim Demaille <akim@epita.fr>
1725
1726 Make `make distcheck' work.
1727
1728 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1729 system.h which uses libgettext.h.
1730
17312001-12-15 Akim Demaille <akim@epita.fr>
1732
1733 * src/nullable.c (set_nullable): Useless rules must be skipped,
1734 otherwise, since we range over their symbols, we might look at a
1735 nonterminal which no longer ``exists'', i.e., it is not counted in
1736 `nvars', hence we overflow our arrays.
1737
17382001-12-15 Akim Demaille <akim@epita.fr>
1739
1740 The header can also be produced directly, without any obstack!
1741 Yahoo!
1742
1743 * src/files.c, src/files.h (defines_obstack): Remove.
1744 (compute_header_macro): Global.
1745 (defines_obstack_save): Remove.
1746 * src/reader.c (parse_union_decl): No longer output to
1747 defines_obstack: its content can be found in the `stype' muscle
1748 anyway.
1749 (output_token_translations): Merge into...
1750 (symbols_output): this.
1751 Rename as...
1752 (symbols_save): this.
1753 (reader): Adjust.
1754 * src/output.c (header_output): New.
1755 (output): Call it.
1756
17572001-12-15 Akim Demaille <akim@epita.fr>
1758
1759 * src/reader.c (parse_union_decl): Instead of handling two obstack
1760 simultaneously, use one to define the `stype' muscle, and use the
1761 value of the latter to fill defines_obstack.
1762 (copy_comment): Remove.
1763 (copy_comment2): Work for a single obstack.
1764 Rename as...
1765 (copy_comment): this.
1766
17672001-12-15 Akim Demaille <akim@epita.fr>
1768
1769 * src/lex.c, src/lex.h (xgetc): No longer static.
1770 * src/reader.c (parse_union_decl): Revamp.
1771
17722001-12-15 Akim Demaille <akim@epita.fr>
1773
1774 Still making progress in separating Bison into (i) input, (ii)
1775 process, (iii) output: now we can directly output the parser file
1776 without using table_obstack at all.
1777
1778 * src/files.c, src/files.h (table_obstack): Bye bye.
1779 (parser_file_name): New.
1780 * src/files.c (compute_output_file_names): Compute it.
1781 * src/output.c (actions_output, output_parser)
1782 (output_master_parser): To a file instead of an obstack.
1783
17842001-12-15 Akim Demaille <akim@epita.fr>
1785
1786 Attach actions to rules, instead of pre-outputting them to
1787 actions_obstack.
1788
1789 * src/gram.h (rule_t): action and action_line are new members.
1790 * src/reader.c (symbol_list): Likewise.
1791 (copy_action): Save the actions within the rule.
1792 (packgram): Save them in rule_table.
1793 * src/output.c (actions_output): New.
1794 (output_parser): Use it on `%%actions'.
1795 (output_rule_data): Don't free rule_table.
1796 (output): Do it.
1797 (prepare): Don't save the `action' muscle.
1798 * src/bison.simple: s/%%action/%%actions/.
1799
18002001-12-15 Akim Demaille <akim@epita.fr>
1801
1802 * src/reader.c (copy_action): When --yacc, don't append a `;'
1803 to the user action: let it fail if lacking.
1804 Suggested by Arnold Robbins and Tom Tromey.
1805
18062001-12-14 Akim Demaille <akim@epita.fr>
1807
1808 * src/lex.c (literalchar): Simply return the char you decoded, non
1809 longer mess around with obstacks and int pointers.
1810 Adjust all callers.
1811
18122001-12-14 Akim Demaille <akim@epita.fr>
1813
1814 * src/lex.c (literalchar): Don't escape the special characters,
1815 just decode them, and keep them as char (before, eol was output as
1816 the 2 char string `\n' etc.).
1817 * src/output.c (output_rule_data): Use quotearg to output the
1818 token strings.
1819
18202001-12-13 Paul Eggert <eggert@twinsun.com>
1821
1822 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1823 Do not infringe on the global user namespace when using C++.
1824 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1825 All uses of `fprintf' and `stderr' changed.
1826
1827 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1828
18292001-12-13 Akim Demaille <akim@epita.fr>
1830
1831 The computation of nullable is broken: it doesn't handle empty
1832 RHS's properly.
1833
1834 * tests/torture.at (GNU AWK Grammar): New.
1835 * tests/sets.at (Nullable): New.
1836 * src/nullable.c (set_nullable): Instead of blindly looping over
1837 `ritems', loop over the rules, and then over their rhs's.
1838
1839 Work around Autotest bugs.
1840
1841 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1842 frame, because Autotest understand lines starting with a `+' as
1843 traces from the shell. Then, they are not processed properly.
1844 Admittedly an Autotest bug, but we don't have time to wait for
1845 Autotest to catch up.
1846 * tests/regression.at (Broken Closure): Adjust to the new table
1847 frames.
1848 Move to...
1849 * tests/sets.at: here.
1850
18512001-12-13 Akim Demaille <akim@epita.fr>
1852
1853 * src/closure.c (closure): Use nrules instead of playing tricks
1854 with BITS_PER_WORD.
1855
18562001-12-13 Akim Demaille <akim@epita.fr>
1857
1858 * src/print.c (print_actions): Output the handling of `$' as the
1859 traces do: shifting the token EOF. Before EOF was treated as a
1860 nonterminal.
1861 * tests/regression.at: Adjust some tests.
1862 * src/print_graph.c (print_core): Complete the set of items via
1863 closure. The next-to-final and final states are still unsatisfying,
1864 but that's to be addressed elsewhere.
1865 No longer output the rule numbers, but do output the state number.
1866 A single loop for the shifts + gotos is enough, but picked a
1867 distinct color for each.
1868 (print_graph): Initialize and finalize closure.
1869
18702001-12-13 Akim Demaille <akim@epita.fr>
1871
1872 * src/reader.c (readgram): Remove dead code, an strip useless
1873 braces.
1874 (get_type): Remove, unused.
1875
18762001-12-12 Akim Demaille <akim@epita.fr>
1877
1878 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1879 on that of lib/error.c.
1880
18812001-12-12 Akim Demaille <akim@epita.fr>
1882
1883 Some hosts don't like `/' in includes.
1884
1885 * src/system.h: Include libgettext.h without qualifying the path.
1886 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1887 $(top_srcdir).
1888
18892001-12-11 Marc Autret <autret_m@epita.fr>
1890
1891 * src/output.c (output_parser): Remove useless muscle.
1892
18932001-12-11 Marc Autret <autret_m@epita.fr>
1894
1895 * src/bison.simple: Remove #line just before %%epilogue. It
1896 is now handled in ...
1897 * src/reader.c (read_additionnal_code): Add the output of a
1898 #line for the epilogue.
1899
19002001-12-10 Marc Autret <autret_m@epita.fr>
1901
1902 * src/reader.c (copy_definition): Re-use CPP-outed code which
1903 replace precedent remove.
1904 * src/bison.simple: Remove #line before %%prologue because
1905 %%input-line is wrong at this time.
1906
19072001-12-10 Marc Autret <autret_m@epita.fr>
1908
1909 * src/reader.c (symbols_output): Clean up.
1910 * src/output.c (output_gram, output): Clean up.
1911
19122001-12-10 Akim Demaille <akim@epita.fr>
1913
1914 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1915 * src/LR0.c (set_state_table): here.
1916 * src/lalr.c (lalr): Call it.
1917
19182001-12-10 Akim Demaille <akim@epita.fr>
1919
1920 * src/state.h (shifts): Remove the `number' member: shifts are
1921 attached to state, hence no longer need to be labelled with a
1922 state number.
1923
19242001-12-10 Akim Demaille <akim@epita.fr>
1925
1926 Now that states have a complete set of members, the linked list of
1927 shifts is useless: just fill directly the state's shifts member.
1928
1929 * src/state.h (shifts): Remove the `next' member.
1930 * src/LR0.c (first_state, last_state): Remove.
1931 Adjust the callers.
1932 (augment_automaton): Don't look for the shifts that must be added
1933 a shift on EOF: it is those of the state we looked for! But now,
1934 since shifts are attached, it is no longer needed to looking
1935 merely by its id: its number.
1936
19372001-12-10 Akim Demaille <akim@epita.fr>
1938
1939 * src/LR0.c (augment_automaton): Better variable locality.
1940 Remove an impossible branch: if there is a state corresponding to
1941 the start symbol being shifted, then there is shift for the start
1942 symbol from the initial state.
1943
19442001-12-10 Akim Demaille <akim@epita.fr>
1945
1946 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1947 only when appropriate: when insert_start_shifting_state' is not
1948 invoked.
1949 * tests/regression.at (Rule Line Numbers): Adjust.
1950
19512001-12-10 Akim Demaille <akim@epita.fr>
1952
1953 * src/LR0.c (augment_automaton): Now that all states have shifts,
1954 merge the two cases addition shifts to the initial state.
1955
19562001-12-10 Akim Demaille <akim@epita.fr>
1957
1958 * src/lalr.c (set_state_table): Move to...
1959 * src/LR0.c: here.
1960 * src/lalr.c (lalr): Don't call it...
1961 * src/LR0.c (generate_states): do it.
1962 * src/LR0.h (first_state): Remove, only the table is used.
1963
19642001-12-10 Akim Demaille <akim@epita.fr>
1965
1966 * src/LR0.h (first_shift, first_reduction): Remove.
1967 * src/lalr.c: Don't use first_shift: find shifts through the
1968 states.
1969
19702001-12-10 Akim Demaille <akim@epita.fr>
1971
1972 * src/LR0.c: Attach shifts to states as soon as they are
1973 computed.
1974 * src/lalr.c (set_state_table): Instead of assigning shifts to
1975 state, just assert that the mapping was properly done.
1976
19772001-12-10 Akim Demaille <akim@epita.fr>
1978
1979 * src/LR0.c (insert_start_shift): Rename as...
1980 (insert_start_shifting_state): this.
1981 (insert_eof_shifting_state, insert_accepting_state): New.
1982 (augment_automaton): Adjust.
1983 Better locality of the variables.
1984 When looking if the start_symbol is shifted from the initial
1985 state, using `while (... symbol != start_symbol ...)' sounds
1986 better than `while (... symbol < start_symbol ...)': If fail
1987 to see how the order between symbols could be relevant!
1988
19892001-12-10 Akim Demaille <akim@epita.fr>
1990
1991 * src/getargs.h: Don't declare `spec_name_prefix' and
1992 `spec_file_prefix', declared by src/files.h.
1993 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
1994 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
1995 * src/output.c (prepare): Adjust.
1996 * src/reader.c (symbols_output): Likewise.
1997 * src/vmsgetargs.c: Vaguely adjust, but who cares?
1998
19992001-12-10 Akim Demaille <akim@epita.fr>
2000
2001 * src/muscle_tab.c (muscle_init): NULL is a better default than
2002 `"0"'.
2003
20042001-12-10 Akim Demaille <akim@epita.fr>
2005
2006 * src/reader.c (reader): Calling symbols_output once is enough.
2007
20082001-12-10 Akim Demaille <akim@epita.fr>
2009
2010 Now that states have a complete set of members, the linked list of
2011 reductions is useless: just fill directly the state's reductions
2012 member.
2013
2014 * src/state.h (struct reductions): Remove member `number' and
2015 `next'.
2016 * src/LR0.c (first_reduction, last_reduction): Remove.
2017 (save_reductions): Don't link the new reductions, store them in
2018 this_state.
2019 * src/lalr.c (set_state_table): No need to attach reductions to
2020 states, it's already done.
2021 * src/output.c (output_actions): No longer free the shifts, then
2022 the reductions, then the states: free all the states and their
2023 members.
2024
20252001-12-10 Akim Demaille <akim@epita.fr>
2026
2027 * src/options.c (OPTN, DRTV, BOTH): New.
2028 (option_table): Use them.
2029
2030 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2031 the job of system.h.
2032 * src/options.c: Don't include stdio.h and xalloc.h for the same
2033 reasons.
2034
20352001-12-10 Akim Demaille <akim@epita.fr>
2036
2037 * src/output.c (output, prepare): Make sure the values of the
2038 muscles `action' and `prologue' are 0-terminated.
2039
20402001-12-10 Akim Demaille <akim@epita.fr>
2041
2042 Clean up GCC warnings.
2043
2044 * src/reader.c (copy_action): `buf' is not used.
2045 (parse_skel_decl): Be static.
2046 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2047 * src/options.h (create_long_option_table): Have a real prototype.
2048 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2049 (hash_delete_at): Return const void *.
2050 Adjust casts to preserve the const.
2051
20522001-12-10 Akim Demaille <akim@epita.fr>
2053
2054 * configure.in: Require 2.52g.
2055 M4 is not needed, but AUTOM4TE is.
2056 * m4/m4.m4: Remove.
2057 * tests/Makefile.am: Adjust.
2058
20592001-12-10 Akim Demaille <akim@epita.fr>
2060
2061 One structure for states is enough, even though theoretically
2062 there are LR(0) states and LALR(1) states.
2063
2064 * src/lalr.h (state_t): Remove.
2065 (state_table): Be state_t **, not state_t *.
2066 * src/state.h (core, CORE_ALLOC): Rename as...
2067 (state_t, STATE_ALLOC): this.
2068 Add the LALR(1) members: shifts, reductions, errs.
2069 * src/LR0.c (state_table): Rename as...
2070 (state_hash): this, to avoid name clashes with the global
2071 `state_table'.
2072 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2073 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2074
20752001-12-10 Akim Demaille <akim@epita.fr>
2076
2077 Bison dumps core on bash.y.
2078 Reported by Pascal Bart.
2079
2080 * src/warshall.c (bitmatrix_print): New.
2081 (TC): Use it.
2082 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2083 j must be the outer loop.
2084 * tests/regression.at (Broken Closure): New.
2085
20862001-12-05 Akim Demaille <akim@epita.fr>
2087
2088 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2089 its argument.
2090