]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Warnings.
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-05-03 Akim Demaille <akim@epita.fr>
2
3 * data/bison.simple (b4_token_enum): New.
4 (b4_token_defines): Use it to output tokens both as #define and
5 enums.
6 Suggested by Paul Eggert.
7 * src/output.c (token_definitions_output): Don't output spurious
8 white spaces.
9
102002-05-03 Akim Demaille <akim@epita.fr>
11
12 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13
142002-05-02 Robert Anisko <robert@lrde.epita.fr>
15
16 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
17 Update the stack class, give a try to deque as the default container.
18
192002-05-02 Akim Demaille <akim@epita.fr>
20
21 * data/bison.simple (yyparse): Do not implement @$ = @1.
22 (YYLLOC_DEFAULT): Adjust to do it.
23 * doc/bison.texinfo (Location Default Action): Fix.
24
252002-05-02 Akim Demaille <akim@epita.fr>
26
27 * src/reader.c (parse_braces): Merge into...
28 (parse_action): this.
29
302002-05-02 Akim Demaille <akim@epita.fr>
31
32 * configure.in (ALL_LINGUAS): Remove.
33 * po/LINGUAS, hr.po: New.
34
352002-05-02 Akim Demaille <akim@epita.fr>
36
37 Remove the so called hairy (semantic) parsers.
38
39 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
40 * src/gram.h, src/gram.c (semantic_parser): Remove.
41 (rule_t): Remove the guard and guard_line members.
42 * src/lex.h (token_t): remove tok_guard.
43 * src/options.c (option_table): Remove %guard and %semantic_parser
44 support.
45 * src/output.c, src/output.h (guards_output): Remove.
46 (prepare): Adjust.
47 (token_definitions_output): Don't output the `T'
48 tokens (???).
49 (output_skeleton): Don't output the guards.
50 * src/files.c, src/files.c (attrsfile): Remove.
51 * src/reader.c (symbol_list): Remove the guard and guard_line
52 members.
53 Adjust dependencies.
54 (parse_guard): Remove.
55 * data/bison.hairy: Remove.
56 * doc/bison.texinfo (Environment Variables): Remove occurrences of
57 BISON_HAIRY.
58
592002-05-02 Akim Demaille <akim@epita.fr>
60
61 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
62 (parse_guard): Rename the formal argument `stack_offset' as
63 `rule_length', which is more readable.
64 Adjust callers.
65 (copy_at, copy_dollar): Instead of outputting the hard coded
66 values of $$, $n and so forth, output invocation to b4_lhs_value,
67 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
68 Note: this patch partially drops `semantic-parser' support: it
69 always does `rule_length - n', where semantic parsers ought to
70 always use `-n'.
71 * data/bison.simple, data/bison.c++ (b4_lhs_value)
72 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
73
742002-05-02 Akim Demaille <akim@epita.fr>
75
76 * configure.in (AC_INIT): Bump to 1.49b.
77 (AM_INIT_AUTOMAKE): Short invocation.
78
792002-05-02 Akim Demaille <akim@epita.fr>
80
81 Version 1.49a.
82
832002-05-01 Akim Demaille <akim@epita.fr>
84
85 * src/skeleton.h: Remove.
86
872002-05-01 Akim Demaille <akim@epita.fr>
88
89 * src/skeleton.h: Fix the #endif.
90 Reported by Magnus Fromreide.
91
922002-04-26 Paul Eggert <eggert@twinsun.com>
93
94 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
95 Define if we define YYSTYPE and YYLTYPE, respectively.
96 (YYCOPY): Fix [] quoting problem in the non-GCC case.
97
982002-04-25 Robert Anisko <robert@lrde.epita.fr>
99
100 * src/scan-skel.l: Postprocess quadrigraphs.
101
102 * src/reader.c (copy_character): New function, used to output
103 single characters while replacing `[' and `]' with quadrigraphs, to
104 avoid troubles with M4 quotes.
105 (copy_comment): Output characters with copy_character.
106 (read_additionnal_code): Likewise.
107 (copy_string2): Likewise.
108 (copy_definition): Likewise.
109
110 * tests/calc.at: Exercise M4 quoting.
111
1122002-04-25 Akim Demaille <akim@epita.fr>
113
114 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
115 between `!' and the command.
116 Reported by Paul Eggert.
117
1182002-04-24 Robert Anisko <robert@lrde.epita.fr>
119
120 * tests/calc.at: Exercise prologue splitting.
121
122 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
123 `b4_post_prologue' instead of `b4_prologue'.
124
125 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
126 muscles.
127 (output): Free pre_prologue_obstack and post_prologue_obstack.
128 * src/files.h, src/files.c (attrs_obstack): Remove.
129 (pre_prologue_obstack, post_prologue_obstack): New.
130 * src/reader.c (copy_definition): Add a parameter to specify the
131 obstack to fill, instead of using attrs_obstack unconditionally.
132 (read_declarations): Pass pre_prologue_obstack to copy_definition if
133 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
134
1352002-04-23 Paul Eggert <eggert@twinsun.com>
136
137 * data/bison.simple: Remove unnecessary commentary and white
138 space differences from 1_29-branch.
139 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
140
141 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
142 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
143 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
144 constructors or destructors.
145
146 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
147
1482002-04-23 Akim Demaille <akim@epita.fr>
149
150 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
151 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
152 location with columns.
153 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
154 All reported by Paul Eggert.
155
1562002-04-22 Akim Demaille <akim@epita.fr>
157
158 * src/reduce.c (dump_grammar): Move to...
159 * src/gram.h, src/gram.c (grammar_dump): here.
160 Be sure to separate long item numbers.
161 Don't read the members of a rule's prec if its nil.
162
1632002-04-22 Akim Demaille <akim@epita.fr>
164
165 * src/output.c (table_size, table_grow): New.
166 (MAXTABLE): Remove, replace uses with table_size.
167 (pack_vector): Instead of dying when the table is too big, grow it.
168
1692002-04-22 Akim Demaille <akim@epita.fr>
170
171 * data/bison.simple (yyr1): Its type is that of a token number.
172 * data/bison.c++ (r1_): Likewise.
173 * tests/regression.at (Web2c Actions): Adjust.
174
1752002-04-22 Akim Demaille <akim@epita.fr>
176
177 * src/reader.c (token_translations_init): 256 is now the default
178 value for the error token, i.e., it will be assigned another
179 number if the user assigned 256 to one of her tokens.
180 (reader): Don't force 256 to error.
181 * doc/bison.texinfo (Symbols): Adjust.
182 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
183 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
184 etc. instead of 10, 20, 30 (which was used to `jump' over error
185 (256) and undefined (2)).
186
1872002-04-22 Akim Demaille <akim@epita.fr>
188
189 Propagate more token_number_t.
190
191 * src/gram.h (token_number_as_item_number)
192 (item_number_as_token_number): New.
193 * src/output.c (GENERATE_OUTPUT_TABLE): New.
194 Use it to create output_item_number_table and
195 output_token_number_table.
196 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
197 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
198 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
199 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
200
2012002-04-22 Akim Demaille <akim@epita.fr>
202
203 * src/output.h, src/output.c (get_lines_number): Remove.
204
2052002-04-19 Akim Demaille <akim@epita.fr>
206
207 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
208 as Lex/Flex'.
209 (Debugging): More details about enabling the debugging features.
210 (Table of Symbols): Describe $$, $n, @$, and @n.
211 Suggested by Tim Josling.
212
2132002-04-19 Akim Demaille <akim@epita.fr>
214
215 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
216
2172002-04-10 Akim Demaille <akim@epita.fr>
218
219 * src/system.h: Rely on HAVE_LIMITS_H.
220 Suggested by Paul Eggert.
221
2222002-04-09 Akim Demaille <akim@epita.fr>
223
224 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
225 full stderr, and strip it according to the bison options, instead
226 of composing the error message from different bits.
227 This makes it easier to check for several error messages.
228 Adjust all the invocations.
229 Add an invocation exercising the error token.
230 Add an invocation demonstrating a stupid error message.
231 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
232 Adjust the tests.
233 Error message are for stderr, not stdout.
234
2352002-04-09 Akim Demaille <akim@epita.fr>
236
237 * src/gram.h, src/gram.c (error_token_number): Remove, use
238 errtoken->number.
239 * src/reader.c (reader): Don't specify the user token number (2)
240 for $undefined, as it uselessly prevents using it.
241 * src/gram.h (token_number_t): Move to...
242 * src/symtab.h: here.
243 (state_t.number): Is a token_number_t.
244 * src/print.c, src/reader.c: Use undeftoken->number instead of
245 hard coded 2.
246 (Even though this 2 is not the same as above: the number of the
247 undeftoken remains being 2, it is its user token number which
248 might not be 2).
249 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
250 `user_token_number_max'.
251 Output `undef_token_number'.
252 * data/bison.simple, data/bison.c++: Use them.
253 Be sure to map invalid yylex return values to
254 `undef_token_number'. This saves us from gratuitous SEGV.
255
256 * tests/conflicts.at (Solved SR Conflicts)
257 (Unresolved SR Conflicts): Adjust.
258 * tests/regression.at (Web2c Actions): Adjust.
259
2602002-04-08 Akim Demaille <akim@epita.fr>
261
262 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
263 Adding #line.
264 Remove the duplicate `typedefs'.
265 (RhsNumberType): Fix the declaration and various other typos.
266 Use __ofile__.
267 * data/bison.simple: Use __ofile__.
268 * src/scan-skel.l: Handle __ofile__.
269
2702002-04-08 Akim Demaille <akim@epita.fr>
271
272 * src/gram.h (item_number_t): New, the type of item numbers in
273 RITEM. Note that it must be able to code symbol numbers as
274 positive number, and the negation of rule numbers as negative
275 numbers.
276 Adjust all dependencies (pretty many).
277 * src/reduce.c (rule): Remove this `short *' pointer: use
278 item_number_t.
279 * src/system.h (MINSHORT, MAXSHORT): Remove.
280 Include `limits.h'.
281 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
282 (shortcpy): Remove.
283 (MAXTABLE): Move to...
284 * src/output.c (MAXTABLE): here.
285 (prepare_rules): Use output_int_table to output rhs.
286 * data/bison.simple, data/bison.c++: Adjust.
287 * tests/torture.at (Big triangle): Move the limit from 254 to
288 500.
289 * tests/regression.at (Web2c Actions): Ajust.
290
291 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
292 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
293 passes, but produces negative #line number, once fixed, GCC is
294 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
295 C), it passes.
296 * src/state.h (state_h): Code input lines on ints, not shorts.
297
2982002-04-08 Akim Demaille <akim@epita.fr>
299
300 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
301 and then the grammar.
302
3032002-04-08 Akim Demaille <akim@epita.fr>
304
305 * src/system.h: No longer using strndup.
306
3072002-04-07 Akim Demaille <akim@epita.fr>
308
309 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
310 * src/output.c (output_table_data): Return the longest number.
311 (prepare_tokens): Output `token_number_max').
312 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
313 New.
314 Use them to define yy_token_number_type/TokenNumberType.
315 Use this type for yytranslate.
316 * tests/torture.at (Big triangle): Push the limit from 124 to
317 253.
318 * tests/regression.at (Web2c Actions): Adjust.
319
3202002-04-07 Akim Demaille <akim@epita.fr>
321
322 * tests/torture.at (Big triangle): New.
323 (GNU AWK Grammar, GNU Cim Grammar): Move to...
324 * tests/existing.at: here.
325
3262002-04-07 Akim Demaille <akim@epita.fr>
327
328 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
329 nritems.
330 Adjust dependencies.
331
3322002-04-07 Akim Demaille <akim@epita.fr>
333
334 * src/reader.c: Normalize increments to prefix form.
335
3362002-04-07 Akim Demaille <akim@epita.fr>
337
338 * src/reader.c, symtab.c: Remove debugging code.
339
3402002-04-07 Akim Demaille <akim@epita.fr>
341
342 Rename all the `bucket's as `symbol_t'.
343
344 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
345 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
346 * src/symtab.c, src/symtab.h (bucket): Rename as...
347 (symbol_t): this.
348 (symbol_list_new, bucket_check_defined, bucket_make_alias)
349 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
350 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
351 (buckets_new, buckets_free, buckets_do): Rename as...
352 (symbol_list_new, symbol_check_defined, symbol_make_alias)
353 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
354 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
355 (symbols_new, symbols_free, symbols_do): these.
356
3572002-04-07 Akim Demaille <akim@epita.fr>
358
359 Use lib/hash for the symbol table.
360
361 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
362 EOF.
363 * src/lex.c (lex): Set the `number' member of new terminals.
364 * src/reader.c (bucket_check_defined, bucket_make_alias)
365 (bucket_check_alias_consistence, bucket_translation): New.
366 (reader, grammar_free, readgram, token_translations_init)
367 (packsymbols): Adjust.
368 (reader): Number the predefined tokens.
369 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
370 for predefined tokens.
371 * src/symtab.h (bucket): Remove all the hash table related
372 members.
373 * src/symtab.c (symtab): Replace by...
374 (bucket_table): this.
375 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
376 (buckets_new, buckets_do): New.
377
3782002-04-07 Akim Demaille <akim@epita.fr>
379
380 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
381 (start_symbol, max_user_token_number, semantic_parser)
382 (error_token_number): Initialize.
383 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
384 Initialize.
385 (reader): Don't.
386 (errtoken, eoftoken, undeftoken, axiom): Extern.
387
3882002-04-07 Akim Demaille <akim@epita.fr>
389
390 * src/gram.h (rule_s): prec and precsym are now pointers
391 to the bucket giving the priority/associativity.
392 Member `associativity' removed: useless.
393 * src/reduce.c, src/conflicts.c: Adjust.
394
3952002-04-07 Akim Demaille <akim@epita.fr>
396
397 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
398 Properly escape the symbols' TAG when outputting them.
399
4002002-04-07 Akim Demaille <akim@epita.fr>
401
402 * src/lalr.h (LA): Is a bitsetv, not bitset*.
403
4042002-04-07 Akim Demaille <akim@epita.fr>
405
406 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
407 (LArule): this, which is an array to rule_t*.
408 * src/print.c, src/conflicts.c: Adjust.
409
4102002-04-07 Akim Demaille <akim@epita.fr>
411
412 * src/gram.h (rule_t): Rename `number' as `user_number'.
413 `number' is a new member.
414 Adjust dependencies.
415 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
416
4172002-04-07 Akim Demaille <akim@epita.fr>
418
419 As a result of the previous patch, it is no longer needed
420 to reorder ritem itself.
421
422 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
423
4242002-04-07 Akim Demaille <akim@epita.fr>
425
426 Be sure never to walk through RITEMS, but use only data related to
427 the rules themselves. RITEMS should be banished.
428
429 * src/output.c (output_token_translations): Rename as...
430 (prepare_tokens): this.
431 In addition to `translate', prepare the muscles `tname' and
432 `toknum', which were handled by...
433 (output_rule_data): this.
434 Remove, and move the remainder of its outputs into...
435 (prepare_rules): this new routines, which also merges content from
436 (output_gram): this.
437 (prepare_rules): Be sure never to walk through RITEMS.
438 (output_stos): Rename as...
439 (prepare_stos): this.
440 (output): Always invoke prepare_states, after all, just don't use it
441 in the output if you don't need it.
442
4432002-04-07 Akim Demaille <akim@epita.fr>
444
445 * src/LR0.c (new_state): Display `nstates' as the name of the
446 newly created state.
447 Adjust to initialize first_state and last_state if needed.
448 Be sure to distinguish the initial from the final state.
449 (new_states): Create the itemset of the initial state, and use
450 new_state.
451 * src/closure.c (closure): Now that the initial state has its
452 items properly set, there is no need for a special case when
453 creating `ruleset'.
454
455 As a result, now the rule 0, reducing to $axiom, is visible in the
456 outputs. Adjust the test suite.
457
458 * tests/conflicts.at (Solved SR Conflicts)
459 (Unresolved SR Conflicts): Adjust.
460 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
461 * tests/conflicts.at (S/R in initial): New.
462
4632002-04-07 Akim Demaille <akim@epita.fr>
464
465 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
466 the RHS of the rules.
467 * src/output.c (output_gram): Likewise.
468
4692002-04-07 Akim Demaille <akim@epita.fr>
470
471 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
472 bucket.
473 Adjust all dependencies.
474 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
475 `number' of the buckets too.
476 * src/gram.h: Include `symtab.h'.
477 (associativity): Move to...
478 * src/symtab.h: here.
479 No longer include `gram.h'.
480
4812002-04-07 Akim Demaille <akim@epita.fr>
482
483 * src/gram.h, src/gram.c (rules_rhs_length): New.
484 (ritem_longest_rhs): Use it.
485 * src/gram.h (rule_t): `number' is a new member.
486 * src/reader.c (packgram): Set it.
487 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
488 the end of `rules', and count them out of `nrules'.
489 (reduce_output, dump_grammar): Adjust.
490 * src/print.c (print_grammar): It is no longer needed to check for
491 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
492 * tests/reduce.at (Reduced Automaton): New test.
493
4942002-04-07 Akim Demaille <akim@epita.fr>
495
496 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
497 lacking `+ 1' to nrules, Bison reported as useless a token if it
498 was used solely to set the precedence of the last rule...
499
5002002-04-07 Akim Demaille <akim@epita.fr>
501
502 * data/bison.c++, data/bison.simple: Don't output the current file
503 name in #line, to avoid useless diffs between two identical
504 outputs under different names.
505
5062002-04-07 Akim Demaille <akim@epita.fr>
507
508 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
509 Normalize loops to using `< nrules + 1', not `<= nrules'.
510
5112002-04-07 Akim Demaille <akim@epita.fr>
512
513 * TODO: Update.
514
5152002-04-07 Akim Demaille <akim@epita.fr>
516
517 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
518 bucket.value as bucket.number.
519
5202002-04-07 Akim Demaille <akim@epita.fr>
521
522 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
523 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
524 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
525 RHS, instead of being an index in RITEMS.
526
5272002-04-04 Paul Eggert <eggert@twinsun.com>
528
529 * doc/bison.texinfo: Update copyright date.
530 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
531 (Symbols): Warn about running Bison in one character set,
532 but compiling and/or running in an incompatible one.
533 Warn about character code 256, too.
534
5352002-04-03 Paul Eggert <eggert@twinsun.com>
536
537 * src/bison.data (YYSTACK_ALLOC): Depend on whether
538 YYERROR_VERBOSE is nonzero, not whether it is defined.
539
540 Merge changes from bison-1_29-branch.
541
5422002-03-20 Paul Eggert <eggert@twinsun.com>
543
544 Merge fixes from Debian bison_1.34-1.diff.
545
546 * configure.in (AC_PREREQ): 2.53.
547
5482002-03-20 Akim Demaille <akim@epita.fr>
549
550 * src/conflicts.c (log_resolution): Argument `resolution' is const.
551
5522002-03-19 Paul Eggert <eggert@twinsun.com>
553
554 * src/bison.simple (YYCOPY): New macro.
555 (YYSTACK_RELOCATE): Use it.
556 Remove Type arg; no longer needed. All callers changed.
557 (yymemcpy): Remove; no longer needed.
558
559 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
560 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
561
5622002-03-19 Akim Demaille <akim@epita.fr>
563
564 Test and fix the #line outputs.
565
566 * tests/atlocal.at (GCC): New.
567 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
568 (Prologue synch line, ,%union synch line, Postprologue synch line)
569 (Action synch line, Epilogue synch line): New tests.
570 * src/reader.c (parse_union_decl): Define the muscle stype_line.
571 * data/bison.simple, data/bison.c++: Use it.
572
5732002-03-19 Akim Demaille <akim@epita.fr>
574
575 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
576 (Solved SR Conflicts, %expect not enough, %expect right)
577 (%expect too much): Move to...
578 * tests/conflicts.at: this new file.
579
5802002-03-19 Akim Demaille <akim@epita.fr>
581
582 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
583 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
584 that we can move to enums for instance.
585 * src/output.c (token_definitions_output): Output a list of
586 `token-name, token-number' instead of the #define.
587 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
588
5892002-03-14 Akim Demaille <akim@epita.fr>
590
591 Use Gettext 0.11.1.
592
5932002-03-09 Robert Anisko <robert@lrde.epita.fr>
594
595 * data/bison.c++: Make the user able to add members to the generated
596 parser by subclassing.
597
5982002-03-05 Robert Anisko <robert@lrde.epita.fr>
599
600 * src/reader.c (read_additionnal_code): `c' should be an integer, not
601 a character.
602 Reported by Nicolas Tisserand and Nicolas Burrus.
603
6042002-03-04 Robert Anisko <robert@lrde.epita.fr>
605
606 * src/reader.c: Warn about lacking semi-colons, do not complain.
607
6082002-03-04 Robert Anisko <robert@lrde.epita.fr>
609
610 * data/bison.c++: Remove a debug line.
611
6122002-03-04 Robert Anisko <robert@lrde.epita.fr>
613
614 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
615 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
616 provide a default implementation.
617
6182002-03-04 Akim Demaille <akim@epita.fr>
619
620 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
621 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
622 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
623 * tests/semantic.at (Parsing Guards): Similarly.
624 * src/reader.at (readgram): Complain if the last rule is not ended
625 with a semi-colon.
626
6272002-03-04 Akim Demaille <akim@epita.fr>
628
629 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
630 * src/closure.c: here.
631 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
632 RTC.
633 * src/warshall.h, src/warshall.c: Remove.
634 * tests/sets.at (Broken Closure): Adjust.
635
6362002-03-04 Akim Demaille <akim@epita.fr>
637
638 * src/output.c (output_skeleton): tempdir is const.
639 bytes_read is unused.
640
6412002-03-04 Akim Demaille <akim@epita.fr>
642
643 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
644 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
645 Update.
646 From Michael Hayes.
647
6482002-03-04 Akim Demaille <akim@epita.fr>
649
650 * src/closure.c (closure): `r' is unused.
651
6522002-03-04 Akim Demaille <akim@epita.fr>
653
654 * tests/sets.at (Broken Closure): Add the ending `;'.
655 * src/reader.at (readgram): Complain if a rule is not ended with a
656 semi-colon.
657
6582002-03-04 Akim Demaille <akim@epita.fr>
659
660 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
661 (count_sr_conflicts): Use bitset_count.
662 * src/reduce.c (inaccessable_symbols): Ditto.
663 (bits_size): Remove.
664 * src/warshall.h, src/warshall.c: Convert to bitsetv.
665
6662002-03-04 Akim Demaille <akim@epita.fr>
667
668 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
669 * src/reduce.c: Remove the `bitset_zero's following the
670 `bitset_create's, as now it is performed by the latter.
671
6722002-03-04 Akim Demaille <akim@epita.fr>
673
674 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
675 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
676 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
677 latest sources from Michael.
678
6792002-03-04 Akim Demaille <akim@epita.fr>
680
681 * src/output.c (output): Don't free the grammar.
682 * src/reader.c (grammar_free): New.
683 * src/main.c (main): Call it and don't free symtab here.
684
6852002-03-04 Akim Demaille <akim@epita.fr>
686
687 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
688 before returning.
689 Reported by Benoit Perrot.
690
6912002-03-04 Akim Demaille <akim@epita.fr>
692
693 Use bitset operations when possible, not loops over bits.
694
695 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
696 bitset_or.
697 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
698 * src/reduce.c (useless_nonterminals): Formatting changes.
699 * src/warshall.c (TC): Use bitset_or.
700
7012002-03-04 Akim Demaille <akim@epita.fr>
702
703 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
704 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
705 Ditto.
706
7072002-03-04 Akim Demaille <akim@epita.fr>
708
709 * src/lalr.c (F): Now a bitset*.
710 Adjust all dependencies.
711
7122002-03-04 Akim Demaille <akim@epita.fr>
713
714 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
715 Adjust all dependencies.
716
7172002-03-04 Akim Demaille <akim@epita.fr>
718
719 * src/L0.c, src/LR0.h (nstates): Be size_t.
720 Adjust comparisons (signed vs unsigned).
721 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
722 bitset*.
723 Adjust all dependencies.
724
7252002-03-04 Akim Demaille <akim@epita.fr>
726
727 * src/closure.c (firsts): Now, also a bitset.
728 Adjust all dependencies.
729 (varsetsize): Remove, now unused.
730 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
731
7322002-03-04 Akim Demaille <akim@epita.fr>
733
734 * src/print.c: Convert to use bitset.h, not hand coded iterations
735 over ints.
736
7372002-03-04 Akim Demaille <akim@epita.fr>
738
739 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
740
7412002-03-04 Akim Demaille <akim@epita.fr>
742
743 * src/closure.c (ruleset): Be a bitset.
744 (rulesetsize): Remove.
745
7462002-03-04 Akim Demaille <akim@epita.fr>
747
748 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
749 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
750 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
751 * src/closure.c (fderives): Be an array of bitsets.
752
7532002-02-28 Robert Anisko <robert@lrde.epita.fr>
754
755 * data/bison.c++: Merge the two generated headers. Insert a copyright
756 notice in each output file.
757
7582002-02-28 Akim Demaille <akim@epita.fr>
759
760 * data/bison.c++: Copy the prologue of bison.simple to fetch
761 useful M4 definitions, such as b4_header_guard.
762
7632002-02-25 Akim Demaille <akim@epita.fr>
764
765 * src/getargs.c (version): Give the name of the authors, and use a
766 translator friendly scheme for the bgr
767 copyright notice.
768
7692002-02-25 Akim Demaille <akim@epita.fr>
770
771 * src/output.c (header_output): Remove, now handled completely via
772 M4.
773
7742002-02-25 Akim Demaille <akim@epita.fr>
775
776 * m4/m4.m4: New, from CVS Autoconf.
777 * configure.in: Invoke it.
778 * src/output.c (output_skeleton): Use its result instead of the
779 hard coded name.
780
7812002-02-25 Akim Demaille <akim@epita.fr>
782
783 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
784 Fileutils 4.1.5.
785 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
786 * src/output.c (output_skeleton): Use mkstemp to create a real
787 temporary file.
788 Move the filling of `skeleton' and its muscle to...
789 (prepare): here.
790 (output): Move the definition of the prologue muscle to...
791 (prepare): here.
792 * src/system.h (DEFAULT_TMPDIR): New.
793
7942002-02-14 Paul Eggert <eggert@twinsun.com>
795
796 Remove the support for C++ namespace cleanliness; it was
797 causing more problems than it was curing, since it didn't work
798 properly on some nonstandard C++ compilers. This can wait
799 for a proper C++ parser.
800
801 * NEWS: Document this.
802 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
803 of C++, as it's treated like C now.
804 * src/bison.simple (YYSTD): Remove.
805 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
806 Treat C++ just like Standard C instead of trying to support
807 namespace cleanliness.
808
8092002-02-14 Akim Demaille <akim@epita.fr>
810
811 * tests/regression.at (else): Adjust to Andreas' change.
812
8132002-02-14 Akim Demaille <akim@epita.fr>
814
815 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
816
8172002-02-13 Andreas Schwab <schwab@suse.de>
818
819 * src/output.c (output_rule_data): Don't output NULL, it might
820 not be defined yet.
821
8222002-02-11 Robert Anisko <robert@lrde.epita.fr>
823
824 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
825 (Copyright notice): Update.
826
8272002-02-11 Akim Demaille <akim@epita.fr>
828
829 * tests/regression.at (%nonassoc and eof): Don't include
830 nonportable headers.
831
8322002-02-08 Robert Anisko <robert@lrde.epita.fr>
833
834 * data/bison.c++: Correct error recovery. Make the user able to
835 initialize the starting location.
836
8372002-02-07 Akim Demaille <akim@epita.fr>
838
839 * tests/input.at: New.
840
8412002-02-07 Robert Anisko <robert@lrde.epita.fr>
842
843 * data/bison.c++: Replace some direct m4 expansions by constants. Be
844 more consistent when naming methods and variables. Put preprocessor
845 directives around tables only needed for debugging.
846
8472002-02-07 Robert Anisko <robert@lrde.epita.fr>
848
849 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
850 C++ parsers.
851 (yy::b4_name::parse): Use print_.
852
8532002-02-07 Robert Anisko <robert@lrde.epita.fr>
854
855 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
856
8572002-02-07 Robert Anisko <robert@lrde.epita.fr>
858
859 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
860 C++ parsers.
861 (yy::b4_name::parse): Build verbose error messages, and use error_.
862
8632002-02-06 Robert Anisko <robert@lrde.epita.fr>
864
865 * data/bison.c++: Fix m4 quoting in comments.
866
8672002-02-06 Robert Anisko <robert@lrde.epita.fr>
868
869 * data/bison.c++: Adjust the parser code. Fix some muscles that were
870 not expanded by m4.
871
8722002-02-05 Akim Demaille <akim@epita.fr>
873
874 * data/bison.c++: Adjust to the M4 back end.
875 More is certainly needed.
876
8772002-02-05 Akim Demaille <akim@epita.fr>
878
879 Give a try to M4 as a back end.
880
881 * lib/readpipe.c: New, from wdiff.
882 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
883 BISON_HAIRY.
884 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
885 specific values. Now it is m4 that performs the lookup.
886 * src/parse-skel.y: Remove.
887 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
888 * src/output.c (actions_output, guards_output)
889 (token_definitions_output): No longer keeps track of the output
890 line number, hence remove the second argument.
891 (guards_output): Check against the guard member of a rule, not the
892 action member.
893 Adjust callers.
894 (output_skeleton): Don't look for the skeleton location, let m4 do
895 that.
896 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
897 file will be used.
898 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
899 (prepare): Given that for the time being changesyntax is not
900 usable in M4, rename the muscles using `-' to `_'.
901 Define `defines_flag', `output_parser_name' and `output_header_name'.
902 * src/output.h (actions_output, guards_output)
903 (token_definitions_output): Adjust prototypes.
904 * src/scan-skel.l: Instead of scanning the skeletons, it now
905 processes the output of m4: `__oline__' and `#output'.
906 * data/bison.simple: Adjust to be used by M4(sugar).
907 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
908 to date.
909 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
910 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
911 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
912 shamelessly stolen from CVS Autoconf.
913
9142002-02-05 Akim Demaille <akim@epita.fr>
915
916 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
917 * configure.in: Check for the declarations of free and malloc.
918 * src/muscle_tab.c: Adjust.
919
9202002-02-05 Akim Demaille <akim@epita.fr>
921
922 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
923 which have no values.
924
9252002-02-05 Akim Demaille <akim@epita.fr>
926
927 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
928 * data/: here.
929
9302002-01-29 Paul Eggert <eggert@twinsun.com>
931
932 * src/bison.simple (YYSIZE_T): Do not define merely because
933 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
934 On some platforms, <alloca.h> does not declare YYSTD (size_t).
935
9362002-01-27 Akim Demaille <akim@epita.fr>
937
938 Fix `%nonassoc and eof'.
939
940 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
941 which were not properly copied! Replace
942 memcpy (res->errs, src->errs, src->nerrs);
943 with
944 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
945 !!!
946 * tests/regression.at (%nonassoc and eof): Adjust to newest
947 Autotest: `.' is not in the PATH.
948
9492002-01-27 Akim Demaille <akim@epita.fr>
950
951 * tests/sets.at (AT_EXTRACT_SETS): New.
952 (Nullable): Use it.
953 (Firsts): New.
954
9552002-01-26 Akim Demaille <akim@epita.fr>
956
957 * tests/actions.at, tests/calc.at, tests/headers.at,
958 * tests/torture.at: Adjust to the newest Autotest which no longer
959 forces `.' in the PATH.
960
9612002-01-25 Akim Demaille <akim@epita.fr>
962
963 * tests/regression.at (%nonassoc and eof): New.
964 Suggested by Robert Anisko.
965
9662002-01-24 Akim Demaille <akim@epita.fr>
967
968 Bison dumps core when trying to complain about broken input files.
969 Reported by Cris van Pelt.
970
971 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
972 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
973 into...
974 (Invalid inputs): Strengthen: exercise parse_percent_token.
975
9762002-01-24 Robert Anisko <robert.anisko@epita.fr>
977
978 * src/Makefile.am: Add bison.c++.
979 * src/bison.c++: New skeleton.
980
9812002-01-21 Paolo Bonzini <bonzini@gnu.org>
982
983 * po/it.po: New.
984
9852002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
986
987 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
988
9892002-01-20 Marc Autret <marc@gnu.org>
990
991 * src/files.c (compute_output_file_names): Fix
992
9932002-01-20 Marc Autret <marc@gnu.org>
994
995 * tests/output.at: New test.
996 * src/files.c (compute_base_names): Don't map extensions when
997 the YACC flag is set, use defaults.
998 Reported by Evgeny Stambulchik.
999
10002002-01-20 Marc Autret <marc@gnu.org>
1001
1002 * src/system.h: Need to define __attribute__ away for non-GCC
1003 compilers as well (i.e. the vendor C compiler).
1004 Suggested by Albert Chin-A-Young.
1005
10062002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1007
1008 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1009 canonical definition.
1010 * src/system.h: Use the canonical definition for PARAMS (avoids
1011 a conflict with the macro from lib/hash.h).
1012
10132002-01-11 Akim Demaille <akim@epita.fr>
1014
1015 * configure.in: Use AC_FUNC_STRNLEN.
1016 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
1017
10182002-01-09 Akim Demaille <akim@epita.fr>
1019
1020 * src/files.c, src/files.h (output_infix): New.
1021 (tab_extension): Remove.
1022 (compute_base_names): Compute the former, drop the latter.
1023 * src/output.c (prepare): Insert the muscles `output-infix', and
1024 `output-suffix'.
1025 * src/parse-skel.y (string, string.1): New.
1026 (section.header): Use it.
1027 (section.yacc): Remove.
1028 (prefix): Remove too.
1029 * src/scan-skel.l: Adjust.
1030 * src/bison.simple, src/bison.hairy: Adjust.
1031
10322002-01-09 Akim Demaille <akim@epita.fr>
1033
1034 * configure.in (WERROR_CFLAGS): Compute it.
1035 * src/Makefile.am (CFLAGS): Pass it.
1036 * tests/atlocal.in (CFLAGS): Idem.
1037 * src/files.c: Fix a few warnings.
1038 (get_extension_index): Remove, unused.
1039
10402002-01-08 Akim Demaille <akim@epita.fr>
1041
1042 * src/getargs.c (AS_FILE_NAME): New.
1043 (getargs): Use it to convert DOSish file names.
1044 * src/files.c (base_name): Rename as full_base_name to avoid
1045 clashes with `base_name ()'.
1046 (filename_split): New.
1047 (compute_base_names): N-th rewrite, using filename_split.
1048
10492002-01-08 Akim Demaille <akim@epita.fr>
1050
1051 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1052 New, stolen from the Fileutils 4.1.
1053 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1054 * configure.in: Check for the presence of memrchr, and of its
1055 prototype.
1056
10572002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1058
1059 * lib/hash.h (__P): Added definition for this macro.
1060 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1061 BUILT_SOURCES, to ensure they are generated first.
1062 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1063 %error-verbose to allow bootstrapping with bison 1.30x.
1064
10652002-01-06 Akim Demaille <akim@epita.fr>
1066
1067 * src/reader.c (parse_braces): Don't fetch the next char, the
1068 convention is to fetch on entry.
1069 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1070 'switch' without a following semicolon.
1071 * tests/regression.at (braces parsing): New.
1072
10732002-01-06 Akim Demaille <akim@epita.fr>
1074
1075 Bison is dead wrong in its RR conflict reports.
1076
1077 * tests/torture.at (GNU Cim Grammar): New.
1078 * src/conflicts.c (count_rr_conflicts): Fix.
1079
10802002-01-06 Akim Demaille <akim@epita.fr>
1081
1082 Creating package.m4 from configure.ac causes too many problems.
1083
1084 * tests/Makefile.am (package.m4): Create it by hand,
1085 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1086
10872002-01-06 Akim Demaille <akim@epita.fr>
1088
1089 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1090 skeleton.h.
1091
10922002-01-04 Paul Eggert <eggert@twinsun.com>
1093
1094 * doc/bison.texinfo (Debugging):
1095 Remove YYSTDERR; it's no longer defined or used.
1096 Also, s/cstdio.h/cstdio/.
1097
10982002-01-03 Akim Demaille <akim@epita.fr>
1099
1100 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1101
11022002-01-03 Akim Demaille <akim@epita.fr>
1103
1104 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1105 tracing code to --trace, wait for a better --trace option, with
1106 args.
1107
11082002-01-03 Akim Demaille <akim@epita.fr>
1109
1110 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1111 The ISO C++ standard is extremely clear about it: stderr is
1112 considered a macro, not a regular symbol (see table 94 `Header
1113 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1114 Therefore std:: does not apply to it. It still does with fprintf.
1115 Also, s/cstdio.h/cstdio/.
1116
11172002-01-03 Akim Demaille <akim@epita.fr>
1118
1119 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1120 for non system headers.
1121
11222002-01-02 Akim Demaille <akim@epita.fr>
1123
1124 Equip the skeleton chain with location tracking, runtime trace,
1125 pure parser and scanner.
1126
1127 * src/parse-skel.y: Request a pure parser, locations, and prefix
1128 renaming.
1129 (%union): Having several members with the same type does not help
1130 type mismatches, simplify.
1131 (YYPRINT, yyprint): New.
1132 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1133 (skel_error): this.
1134 Handle locations.
1135 * src/scan-skel.l: Adjust to these changes.
1136 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1137 (LOCATION_PRINT, skel_control_t): New.
1138
11392001-12-30 Akim Demaille <akim@epita.fr>
1140
1141 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1142 replace `gb' with BLANKS.
1143 * src/scan-skel.l: Adjust.
1144
11452001-12-30 Akim Demaille <akim@epita.fr>
1146
1147 * src/system.h: We don't need nor want bcopy.
1148 Throw away MS-DOS crap: we don't need getpid.
1149 * configure.in: We don't need strndup. It was even causing
1150 problems: because Flex includes the headers *before* us,
1151 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1152 not visible.
1153 * lib/xstrndup.c: New.
1154 * src/scan-skel.l: Use it.
1155 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1156 * src/parse-skel.y: Use %directives instead of #defines.
1157
11582001-12-30 Akim Demaille <akim@epita.fr>
1159
1160 * src/skeleton.h: New.
1161 * src/output.c (output_parser, output_master_parser): Remove, dead
1162 code.
1163 * src/output.h (get_lines_number, actions_output, guards_output)
1164 (token_definitions_output): Prototype them.
1165 * src/parse-skel.y: Add the license notice.
1166 Include output.h and skeleton.h.
1167 (process_skeleton): Returns void, and takes a single parameter.
1168 * src/scan-skel.l: Add the license notice.
1169 Include skeleton.h.
1170 Don't use %option yylineno: it seems that then Flex imagines
1171 REJECT has been used, and therefore it won't reallocate its
1172 buffers (which makes no other sense to me than a bug). It results
1173 in warnings for `unused: yy_flex_realloc'.
1174
11752001-12-30 Robert Anisko <robert.anisko@epita.fr>
1176
1177 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1178 (MUSCLE_INSERT_PREFIX): ...to there.
1179 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1180 (MUSCLE_INSERT_PREFIX): Move from here...
1181
1182 * src/bison.hairy: Add a section directive. Put braces around muscle
1183 names. This parser skeleton is still broken, but Bison should not
1184 choke on a bad muscle 'syntax'.
1185 * src/bison.simple: Add a section directive. Put braces around muscle
1186 names.
1187
1188 * src/files.h (strsuffix, stringappend): Add declarations.
1189 (tab_extension): Add declaration.
1190 (short_base_name): Add declaration.
1191
1192 * src/files.c (strsuffix, stringappend): No longer static. These
1193 functions are used in the skeleton parser.
1194 (tab_extension): New.
1195 (compute_base_names): Use the computations done in this function
1196 to guess if the generated parsers should have '.tab' in their
1197 names.
1198 (short_base_name): No longer static.
1199
1200 * src/output.c (output_skeleton): New.
1201 (output): Disable call to output_master_parser, and give a try to
1202 a new skeleton handling system.
1203 (guards_output, actions_output): No longer static.
1204 (token_definitions_output, get_lines_number): No longer static.
1205
1206 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1207
1208 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
1209 parse-skel.y.
1210
1211 * src/parse-skel.y: New file.
1212 * src/scan-skel.l: New file.
1213
12142001-12-29 Akim Demaille <akim@epita.fr>
1215
1216 %name-prefix is broken.
1217
1218 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1219 Adjust all dependencies.
1220 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1221 %name-prefix.
1222
1223 Renaming yylval but not yylloc is not consistent. Now we do.
1224
1225 * src/bison.simple: Prefix yylloc if used.
1226 * doc/bison.texinfo (Decl Summary): Document that.
1227
12282001-12-29 Akim Demaille <akim@epita.fr>
1229
1230 * doc/bison.texinfo: Promote `%long-directive' over
1231 `%long_directive'.
1232 Remove all references to fixed-output-files, yacc is enough.
1233
12342001-12-29 Akim Demaille <akim@epita.fr>
1235
1236 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1237 user prologue. These are defaults.
1238 * tests/actions.at (Mid-rule actions): Make sure the user can
1239 define YYDEBUG and YYERROR_VERBOSE.
1240
12412001-12-29 Akim Demaille <akim@epita.fr>
1242
1243 * src/output.c (header_output): Don't forget to export YYLTYPE and
1244 yylloc.
1245 * tests/headers.at (export YYLTYPE): New, make sure it does.
1246 * tests/regression.at (%union and --defines, Invalid CPP headers):
1247 Move to...
1248 * tests/headers.at: here.
1249
12502001-12-29 Akim Demaille <akim@epita.fr>
1251
1252 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1253
12542001-12-29 Akim Demaille <akim@epita.fr>
1255
1256 * tests/actions.at (Mid-rule actions): Output on a single line
1257 instead of several.
1258
12592001-12-29 Akim Demaille <akim@epita.fr>
1260
1261 * doc/bison.texinfo: Formatting changes.
1262
12632001-12-29 Akim Demaille <akim@epita.fr>
1264
1265 Don't store the token defs in a muscle, just be ready to output it
1266 on command. Now possible via `symbols'. Fixes a memory leak.
1267
1268 * src/output.c (token_definitions_output): New.
1269 (output_parser, header_output): Use it.
1270 * src/reader.c (symbols_save): Remove.
1271
12722001-12-29 Akim Demaille <akim@epita.fr>
1273
1274 * src/bison.simple: Do not provide a default for YYSTYPE and
1275 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1276 default.
1277
12782001-12-29 Akim Demaille <akim@epita.fr>
1279
1280 Mid-rule actions are simply... ignored!
1281
1282 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1283 the empty-rule associated to the dummy symbol, not to the host
1284 rule.
1285 * tests/actions.at (Mid-rule actions): New.
1286
12872001-12-29 Akim Demaille <akim@epita.fr>
1288
1289 Memory leak.
1290
1291 * src/reader.c (reader): Free grammar.
1292
12932001-12-29 Akim Demaille <akim@epita.fr>
1294
1295 Memory leak.
1296
1297 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1298 since it allocates it for each state, although only one is needed.
1299 (allocate_storage): Do it here.
1300
13012001-12-29 Akim Demaille <akim@epita.fr>
1302
1303 * src/options.h, src/options.c (create_long_option_table): Rename
1304 as...
1305 (long_option_table_new): this, with a clearer prototype.
1306 (percent_table): Remove, unused,
1307 * src/getargs.c (getargs): Adjust.
1308
13092001-12-29 Akim Demaille <akim@epita.fr>
1310
1311 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1312 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1313 as states.
1314
13152001-12-29 Akim Demaille <akim@epita.fr>
1316
1317 * src/lalr.c (build_relations): Rename `states' as `states1'.
1318 Sorry, I don't understand exactly what it is, no better name...
1319
13202001-12-29 Akim Demaille <akim@epita.fr>
1321
1322 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1323 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1324 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1325 as rules.
1326
13272001-12-29 Akim Demaille <akim@epita.fr>
1328
1329 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1330 ago.
1331
13322001-12-29 Akim Demaille <akim@epita.fr>
1333
1334 * src/reader.c, src/reader.h (user_toknums): Remove.
1335 Adjust all users to use symbols[i]->user_token_number.
1336
13372001-12-29 Akim Demaille <akim@epita.fr>
1338
1339 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1340 Adjust all users to use symbols[i]->prec or ->assoc.
1341
13422001-12-29 Akim Demaille <akim@epita.fr>
1343
1344 * src/reader.c, src/reader.h (tags): Remove.
1345 Adjust all users to use symbols[i]->tag.
1346
13472001-12-29 Akim Demaille <akim@epita.fr>
1348
1349 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1350 and rule_table.
1351 * src/reader.c (packsymbols): Fill this table.
1352 Drop sprec.
1353 * src/conflicts.c (resolve_sr_conflict): Adjust.
1354 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1355 single table.
1356 Use symbols[i]->tag instead of tags[i].
1357
13582001-12-29 Akim Demaille <akim@epita.fr>
1359
1360 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1361 In addition, put a comment in there, to replace...
1362 * tests/regression.at (%union and C comments): Remove.
1363
13642001-12-29 Akim Demaille <akim@epita.fr>
1365
1366 * tests/regression.at (Web2c Actions): Blindly move the actual
1367 output as expected output. The contents *seem* right to me, but I
1368 can't pretend reading perfectly parser tables... Nonetheless, all
1369 the other tests pass correctly, the table look OK, even though the
1370 presence of `$axiom' is to be noted: AFAICS it is useless (but
1371 harmless).
1372
13732001-12-29 Akim Demaille <akim@epita.fr>
1374
1375 * src/reader.c (readgram): Don't add the rule 0 if there were no
1376 rules read. In other words, add it _after_ having performed
1377 grammar sanity checks.
1378 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1379
13802001-12-29 Akim Demaille <akim@epita.fr>
1381
1382 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1383 visible, and some states have now a different number.
1384
13852001-12-29 Akim Demaille <akim@epita.fr>
1386
1387 * src/reader.c (readgram): Bind the initial rule's lineno to that
1388 of the first rule.
1389 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1390 (Solved SR Conflicts): Adjust rule 0's line number.
1391
13922001-12-29 Akim Demaille <akim@epita.fr>
1393
1394 Fix the `GAWK Grammar' failure.
1395
1396 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1397 the reductions of the first state which was mistakenly confused
1398 with the final state because precisely final_state was initialized
1399 to 0.
1400 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1401 now noticed by Bison.
1402 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1403 have a reduction on $default.
1404
14052001-12-29 Akim Demaille <akim@epita.fr>
1406
1407 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1408 rule line numbers.
1409 * src/closure.c (print_closure): Likewise.
1410 * src/derives.c (print_derives): Likewise.
1411 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1412 now.
1413
14142001-12-29 Akim Demaille <akim@epita.fr>
1415
1416 * src/lalr.c (lookaheads_print): New.
1417 (lalr): Call it when --trace-flag.
1418 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1419 are dumped.
1420
14212001-12-29 Akim Demaille <akim@epita.fr>
1422
1423 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1424 when walking through ritem, even via rule->rhs.
1425 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1426 (useful_production, useless_nonterminals): Likewise.
1427 (reduce_grammar_tables): Likewise, plus update nritems.
1428 * src/nullable.c (set_nullable): Likewise.
1429 * src/lalr.c (build_relations): Likewise.
1430 * tests/sets.at (Nullable): Adjust.
1431 Fortunately, now, the $axiom is no longer nullable.
1432
14332001-12-29 Akim Demaille <akim@epita.fr>
1434
1435 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1436 the 0-sentinel.
1437 * src/gram.c (ritem_longest_rhs): Likewise.
1438 * src/reduce.c (nonterminals_reduce): Likewise.
1439 * src/print_graph.c (print_graph): Likewise.
1440 * src/output.c (output_rule_data): Likewise.
1441 * src/nullable.c (set_nullable): Likewise.
1442
14432001-12-29 Akim Demaille <akim@epita.fr>
1444
1445 * src/output.c: Comment changes.
1446
14472001-12-27 Paul Eggert <eggert@twinsun.com>
1448
1449 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1450 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1451 Sparc, as they were causing more porting problems than the
1452 (minor) performance improvement was worth.
1453
1454 Also, catch up with 1.31's YYSTD.
1455
14562001-12-27 Akim Demaille <akim@epita.fr>
1457
1458 * src/output.c (output_gram): Rely on nritems, not the
1459 0-sentinel. See below.
1460 Use -1 as separator, not 0.
1461 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1462 Rely on -1 as separator in yyrhs, instead of 0.
1463 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1464 twice `Now at end of input', therefore there are two lines less to
1465 expect.
1466
14672001-12-27 Akim Demaille <akim@epita.fr>
1468
1469 * tests/regression.at (Unresolved SR Conflicts):
1470 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1471 below.
1472
14732001-12-27 Akim Demaille <akim@epita.fr>
1474
1475 * src/LR0.c (new_state): Recognize the final state by the fact it
1476 is reached by eoftoken.
1477 (insert_start_shifting_state, insert_eof_shifting_state)
1478 (insert_accepting_state, augment_automaton): Remove, since now
1479 these states are automatically computed from the initial state.
1480 (generate_states): Adjust.
1481 * src/print.c: When reporting a rule number to the user, substract
1482 1, so that the axiom rule is rule 0, and the first user rule is 1.
1483 * src/reduce.c: Likewise.
1484 * src/print_graph.c (print_core): For the time being, just as for
1485 the report, depend upon --trace-flags to dump the full set of
1486 items.
1487 * src/reader.c (readgram): Once the grammar read, insert the rule
1488 0: `$axiom: START-SYMBOL $'.
1489 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1490 number of the states has changed (the final state is no longer
1491 necessarily the last), catch up.
1492
14932001-12-27 Akim Demaille <akim@epita.fr>
1494
1495 Try to make the use of the eoftoken valid. Given that its value
1496 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1497 is used instead of > 0 where appropriate, (ii), depend upon nritems
1498 instead of the 0-sentinel.
1499
1500 * src/gram.h, src/gram.c (nritems): New.
1501 Expected to be duplication of nitems, but for the time being...
1502 * src/reader.c (packgram): Assert nritems and nitems are equal.
1503 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1504 * src/closure.c (print_closure, print_fderives): Likewise.
1505 * src/gram.c (ritem_print): Likewise.
1506 * src/print.c (print_core, print_grammar): Likewise.
1507 * src/print_graph.c: Likewise.
1508
15092001-12-27 Akim Demaille <akim@epita.fr>
1510
1511 * src/main.c (main): If there are complains after grammar
1512 reductions, then output the report anyway if requested, then die.
1513 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1514 * src/reader.c (eoftoken): New.
1515 (parse_token_decl): If the token being defined has value `0', it
1516 is the eoftoken.
1517 (packsymbols): No longer hack `tags' to insert `$' by hand.
1518 Be sure to preserve the value of the eoftoken.
1519 (reader): Make sure eoftoken is defined.
1520 Initialize nsyms to 0: now eoftoken is created just like the others.
1521 * src/print.c (print_grammar): Don't special case the eof token.
1522 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1523 lie anyway, albeit pleasant.
1524 * tests/calc.at: Exercise error messages with eoftoken.
1525 Change the grammar so that empty input is invalid.
1526 Adjust expectations.
1527 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1528
15292001-12-27 Akim Demaille <akim@epita.fr>
1530
1531 * configure.in: Check the protos of strchr ans strspn.
1532 Replace strchr if needed.
1533 * src/system.h: Provide the protos of strchr, strspn and memchr if
1534 missing.
1535 * lib/strchr.c: New.
1536 * src/reader.c (symbols_save): Use strchr.
1537
15382001-12-27 Akim Demaille <akim@epita.fr>
1539
1540 * src/print.c, src/print_graph.c (escape): New.
1541 Use it to quote the TAGS outputs.
1542 * src/print_graph.c (print_state): Now errors are in red, and
1543 reductions in green.
1544 Prefer high to wide: output the state number on a line of its own.
1545
15462001-12-27 Akim Demaille <akim@epita.fr>
1547
1548 * src/state.h, src/state.c (reductions_new): New.
1549 * src/LR0.c (set_state_table): Let all the states have a
1550 `reductions', even if reduced to 0.
1551 (save_reductions): Adjust.
1552 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1553 * src/print.c (print_reductions, print_actions): Adjust.
1554 * src/output.c (action_row): Adjust.
1555
15562001-12-27 Akim Demaille <akim@epita.fr>
1557
1558 * src/state.h, src/state.c (errs_new, errs_dup): New.
1559 * src/LR0.c (set_state_table): Let all the states have an errs,
1560 even if reduced to 0.
1561 * src/print.c (print_errs, print_reductions): Adjust.
1562 * src/output.c (output_actions, action_row): Adjust.
1563 * src/conflicts.c (resolve_sr_conflict): Adjust.
1564
15652001-12-27 Akim Demaille <akim@epita.fr>
1566
1567 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1568
15692001-12-27 Akim Demaille <akim@epita.fr>
1570
1571 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1572 * src/print.c: here.
1573 (lookaheadset, shiftset): New, used as additional storage by
1574 print_reductions.
1575 (print_results): Adjust.
1576 (print_shifts, print_gotos, print_errs): New, extracted from...
1577 (print_actions): here.
1578 * src/print_graph.c (print_actions): Remove dead code.
1579
15802001-12-27 Akim Demaille <akim@epita.fr>
1581
1582 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1583 `$n' and `@n'.
1584
15852001-12-27 Akim Demaille <akim@epita.fr>
1586
1587 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1588 (build_relations): Adjust.
1589
15902001-12-27 Akim Demaille <akim@epita.fr>
1591
1592 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1593 duplication.
1594
15952001-12-27 Akim Demaille <akim@epita.fr>
1596
1597 * src/reader.c (packgram): Catch nitems overflows.
1598
15992001-12-27 Akim Demaille <akim@epita.fr>
1600
1601 * src/files.c, src/files.h (guard_obstack): Remove.
1602 * src/output.c (output): Adjust.
1603 * src/reader.c (parse_braces): New, factoring...
1604 (copy_action, copy_guard): these two which are renamed as...
1605 (parse_action, parse_guard): these.
1606 As a voluntary consequence, using braces around guards is now
1607 mandatory.
1608
16092001-12-27 Akim Demaille <akim@epita.fr>
1610
1611 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1612 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1613 members.
1614 (symbol_list_new): Adjust.
1615 (copy_action): action_line is the first line, not the last.
1616 (copy_guard): Just as for actions, store the `action' only, not
1617 the switch/case/break flesh.
1618 Don't parse the user action that might follow the guard, let...
1619 (readgram): do it, i.e., now, there can be an action after a
1620 guard.
1621 In other words the guard is just explicitly optional.
1622 (packgram): Adjust.
1623 * src/output.c (guards_output): New.
1624 (output_parser): Call it when needed.
1625 (output): Also free the guard and attrs obstacks.
1626 * src/files.c, src/files.h (obstack_save): Remove.
1627 (output_files): Remove.
1628 As a result, if one needs the former `.act' file, using an
1629 appropriate skeleton which requires actions and guards is now
1630 required.
1631 * src/main.c (main): Adjust.
1632 * tests/semantic.at: New.
1633 * tests/regression.at: Use `input.y' as input file name.
1634 Avoid 8+3 problems by requiring input.c when the test needs the
1635 parser.
1636
16372001-12-27 Akim Demaille <akim@epita.fr>
1638
1639 * src/reader.c (symbol_list_new): Be sure to initialize all the
1640 fields.
1641
16422001-12-27 Akim Demaille <akim@epita.fr>
1643
1644 All the hacks using a final pseudo state are now useless.
1645
1646 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1647 * src/lalr.c (nLA): New.
1648 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1649 instead of lookaheadsp from the pseudo state (nstate + 1).
1650
16512001-12-27 Akim Demaille <akim@epita.fr>
1652
1653 * src/output.c (action_row, token_actions): Use a state_t instead
1654 of a integer, and nlookaheads instead of the following state's
1655 lookaheadsp.
1656
16572001-12-27 Akim Demaille <akim@epita.fr>
1658
1659 * src/conflicts.c (log_resolution, flush_shift)
1660 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1661 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1662 (conflicts_print, print_reductions): Use a state_t instead of an
1663 integer when referring to a state.
1664 As much as possible, depend upon nlookaheads, instead of the
1665 `lookaheadsp' member of the following state (since lookaheads of
1666 successive states are successive, the difference between state n + 1
1667 and n served as the number of lookaheads for state n).
1668 * src/lalr.c (add_lookback_edge): Likewise.
1669 * src/print.c (print_core, print_actions, print_state)
1670 (print_results): Likewise.
1671 * src/print_graph.c (print_core, print_actions, print_state)
1672 (print_graph): Likewise.
1673 * src/conflicts.h: Adjust.
1674
16752001-12-27 Akim Demaille <akim@epita.fr>
1676
1677 * src/bison.hairy: Formatting/comment changes.
1678 ANSIfy.
1679 Remove `register' indications.
1680 Add plenty of `static'.
1681
16822001-12-27 Akim Demaille <akim@epita.fr>
1683
1684 * src/output.c (prepare): Drop the muscle `ntbase' which
1685 duplicates ntokens.
1686 * src/bison.simple: Formatting/comment changes.
1687 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1688 is an undocumented synonym.
1689
16902001-12-22 Akim Demaille <akim@epita.fr>
1691
1692 * src/output.c (output_table_data): Change the prototype to use
1693 `int' for array ranges: some invocations do pass an int, not a
1694 short.
1695 Reported by Wayne Green.
1696
16972001-12-22 Akim Demaille <akim@epita.fr>
1698
1699 Some actions of web2c.y are improperly triggered.
1700 Reported by Mike Castle.
1701
1702 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1703 * tests/regression.at (Web2c): Rename as...
1704 (Web2c Report): this.
1705 (Web2c Actions): New.
1706
17072001-12-22 Akim Demaille <akim@epita.fr>
1708
1709 Reductions in web2c.y are improperly reported.
1710 Reported by Mike Castle.
1711
1712 * src/conflicts.c (print_reductions): Fix.
1713 * tests/regression.at (Web2c): New.
1714
17152001-12-18 Akim Demaille <akim@epita.fr>
1716
1717 Some host fail on `assert (!"foo")', which expands to
1718 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1719 Reported by Nelson Beebee.
1720
1721 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1722 `#define it_succeeded 0' and `assert (it_succeeded)'.
1723
17242001-12-17 Marc Autret <autret_m@epita.fr>
1725
1726 * src/bison.simple: Don't hard code the skeleton line and filename.
1727 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1728 New line counter 'skeleton_line' (skeleton-line muscle).
1729
17302001-12-17 Paul Eggert <eggert@twinsun.com>
1731
1732 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1733 YYDEBUG must be defined to a nonzero value.
1734
1735 * src/bison.simple (yytname): Do not assume that the user defines
1736 YYDEBUG to a properly parenthesized expression.
1737
17382001-12-17 Akim Demaille <akim@epita.fr>
1739
1740 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1741 nlookaheads is a new member.
1742 Adjust all users.
1743 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1744 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1745 state.
1746
17472001-12-17 Akim Demaille <akim@epita.fr>
1748
1749 * src/files.h, src/files.c (open_files, close_files): Remove.
1750 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1751 let...
1752 * src/reader.c (reader): Do it.
1753
17542001-12-17 Akim Demaille <akim@epita.fr>
1755
1756 * src/conflicts.c (print_reductions): Formatting changes.
1757
17582001-12-17 Akim Demaille <akim@epita.fr>
1759
1760 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1761 (flush_reduce): New.
1762 (resolve_sr_conflict): Adjust.
1763
17642001-12-17 Akim Demaille <akim@epita.fr>
1765
1766 * src/output.c (output_obstack): Be static and rename as...
1767 (format_obstack): this, to avoid any confusion with files.c's
1768 output_obstack.
1769 * src/reader.h (muscle_obstack): Move to...
1770 * src/output.h: here, since it's defined in output.c.
1771
17722001-12-17 Akim Demaille <akim@epita.fr>
1773
1774 * src/output.c (action_row, save_column, default_goto)
1775 (sort_actions, matching_state, pack_vector): Better variable
1776 locality.
1777
17782001-12-17 Akim Demaille <akim@epita.fr>
1779
1780 * src/output.c: Various formatting changes.
1781
17822001-12-17 Akim Demaille <akim@epita.fr>
1783
1784 * src/files.c (output_files): Free the output_obstack.
1785 * src/main.c (main): Call print and print_graph conditionally.
1786 * src/print.c (print): Work unconditionally.
1787 * src/print_graph.c (print_graph): Work unconditionally.
1788 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1789
17902001-12-16 Marc Autret <autret_m@epita.fr>
1791
1792 * src/output.c (actions_output): Fix. When we use %no-lines,
1793 there is one less line per action.
1794
17952001-12-16 Marc Autret <autret_m@epita.fr>
1796
1797 * src/bison.simple: Remove a useless #line directive.
1798 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1799 * src/output.c (get_lines_number): New.
1800 (output_parser): Adjust, now takes care about the lines of a
1801 output muscles.
1802 Fix line numbering.
1803 (actions_output): Computes the number of lines taken by actions.
1804 (output_master_parser): Insert new skeleton which is the name of
1805 the output parser file name.
1806
18072001-12-15 Marc Autret <autret_m@epita.fr>
1808
1809 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1810
18112001-12-15 Marc Autret <autret_m@epita.fr>
1812
1813 * src/output.c (output_gram): Keep track of the hairy one.
1814
18152001-12-15 Akim Demaille <akim@epita.fr>
1816
1817 Make `make distcheck' work.
1818
1819 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1820 system.h which uses libgettext.h.
1821
18222001-12-15 Akim Demaille <akim@epita.fr>
1823
1824 * src/nullable.c (set_nullable): Useless rules must be skipped,
1825 otherwise, since we range over their symbols, we might look at a
1826 nonterminal which no longer ``exists'', i.e., it is not counted in
1827 `nvars', hence we overflow our arrays.
1828
18292001-12-15 Akim Demaille <akim@epita.fr>
1830
1831 The header can also be produced directly, without any obstack!
1832 Yahoo!
1833
1834 * src/files.c, src/files.h (defines_obstack): Remove.
1835 (compute_header_macro): Global.
1836 (defines_obstack_save): Remove.
1837 * src/reader.c (parse_union_decl): No longer output to
1838 defines_obstack: its content can be found in the `stype' muscle
1839 anyway.
1840 (output_token_translations): Merge into...
1841 (symbols_output): this.
1842 Rename as...
1843 (symbols_save): this.
1844 (reader): Adjust.
1845 * src/output.c (header_output): New.
1846 (output): Call it.
1847
18482001-12-15 Akim Demaille <akim@epita.fr>
1849
1850 * src/reader.c (parse_union_decl): Instead of handling two obstack
1851 simultaneously, use one to define the `stype' muscle, and use the
1852 value of the latter to fill defines_obstack.
1853 (copy_comment): Remove.
1854 (copy_comment2): Work for a single obstack.
1855 Rename as...
1856 (copy_comment): this.
1857
18582001-12-15 Akim Demaille <akim@epita.fr>
1859
1860 * src/lex.c, src/lex.h (xgetc): No longer static.
1861 * src/reader.c (parse_union_decl): Revamp.
1862
18632001-12-15 Akim Demaille <akim@epita.fr>
1864
1865 Still making progress in separating Bison into (i) input, (ii)
1866 process, (iii) output: now we can directly output the parser file
1867 without using table_obstack at all.
1868
1869 * src/files.c, src/files.h (table_obstack): Bye bye.
1870 (parser_file_name): New.
1871 * src/files.c (compute_output_file_names): Compute it.
1872 * src/output.c (actions_output, output_parser)
1873 (output_master_parser): To a file instead of an obstack.
1874
18752001-12-15 Akim Demaille <akim@epita.fr>
1876
1877 Attach actions to rules, instead of pre-outputting them to
1878 actions_obstack.
1879
1880 * src/gram.h (rule_t): action and action_line are new members.
1881 * src/reader.c (symbol_list): Likewise.
1882 (copy_action): Save the actions within the rule.
1883 (packgram): Save them in rule_table.
1884 * src/output.c (actions_output): New.
1885 (output_parser): Use it on `%%actions'.
1886 (output_rule_data): Don't free rule_table.
1887 (output): Do it.
1888 (prepare): Don't save the `action' muscle.
1889 * src/bison.simple: s/%%action/%%actions/.
1890
18912001-12-15 Akim Demaille <akim@epita.fr>
1892
1893 * src/reader.c (copy_action): When --yacc, don't append a `;'
1894 to the user action: let it fail if lacking.
1895 Suggested by Arnold Robbins and Tom Tromey.
1896
18972001-12-14 Akim Demaille <akim@epita.fr>
1898
1899 * src/lex.c (literalchar): Simply return the char you decoded, non
1900 longer mess around with obstacks and int pointers.
1901 Adjust all callers.
1902
19032001-12-14 Akim Demaille <akim@epita.fr>
1904
1905 * src/lex.c (literalchar): Don't escape the special characters,
1906 just decode them, and keep them as char (before, eol was output as
1907 the 2 char string `\n' etc.).
1908 * src/output.c (output_rule_data): Use quotearg to output the
1909 token strings.
1910
19112001-12-13 Paul Eggert <eggert@twinsun.com>
1912
1913 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1914 Do not infringe on the global user namespace when using C++.
1915 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1916 All uses of `fprintf' and `stderr' changed.
1917
1918 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1919
19202001-12-13 Akim Demaille <akim@epita.fr>
1921
1922 The computation of nullable is broken: it doesn't handle empty
1923 RHS's properly.
1924
1925 * tests/torture.at (GNU AWK Grammar): New.
1926 * tests/sets.at (Nullable): New.
1927 * src/nullable.c (set_nullable): Instead of blindly looping over
1928 `ritems', loop over the rules, and then over their rhs's.
1929
1930 Work around Autotest bugs.
1931
1932 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1933 frame, because Autotest understand lines starting with a `+' as
1934 traces from the shell. Then, they are not processed properly.
1935 Admittedly an Autotest bug, but we don't have time to wait for
1936 Autotest to catch up.
1937 * tests/regression.at (Broken Closure): Adjust to the new table
1938 frames.
1939 Move to...
1940 * tests/sets.at: here.
1941
19422001-12-13 Akim Demaille <akim@epita.fr>
1943
1944 * src/closure.c (closure): Use nrules instead of playing tricks
1945 with BITS_PER_WORD.
1946
19472001-12-13 Akim Demaille <akim@epita.fr>
1948
1949 * src/print.c (print_actions): Output the handling of `$' as the
1950 traces do: shifting the token EOF. Before EOF was treated as a
1951 nonterminal.
1952 * tests/regression.at: Adjust some tests.
1953 * src/print_graph.c (print_core): Complete the set of items via
1954 closure. The next-to-final and final states are still unsatisfying,
1955 but that's to be addressed elsewhere.
1956 No longer output the rule numbers, but do output the state number.
1957 A single loop for the shifts + gotos is enough, but picked a
1958 distinct color for each.
1959 (print_graph): Initialize and finalize closure.
1960
19612001-12-13 Akim Demaille <akim@epita.fr>
1962
1963 * src/reader.c (readgram): Remove dead code, an strip useless
1964 braces.
1965 (get_type): Remove, unused.
1966
19672001-12-12 Akim Demaille <akim@epita.fr>
1968
1969 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1970 on that of lib/error.c.
1971
19722001-12-12 Akim Demaille <akim@epita.fr>
1973
1974 Some hosts don't like `/' in includes.
1975
1976 * src/system.h: Include libgettext.h without qualifying the path.
1977 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1978 $(top_srcdir).
1979
19802001-12-11 Marc Autret <autret_m@epita.fr>
1981
1982 * src/output.c (output_parser): Remove useless muscle.
1983
19842001-12-11 Marc Autret <autret_m@epita.fr>
1985
1986 * src/bison.simple: Remove #line just before %%epilogue. It
1987 is now handled in ...
1988 * src/reader.c (read_additionnal_code): Add the output of a
1989 #line for the epilogue.
1990
19912001-12-10 Marc Autret <autret_m@epita.fr>
1992
1993 * src/reader.c (copy_definition): Re-use CPP-outed code which
1994 replace precedent remove.
1995 * src/bison.simple: Remove #line before %%prologue because
1996 %%input-line is wrong at this time.
1997
19982001-12-10 Marc Autret <autret_m@epita.fr>
1999
2000 * src/reader.c (symbols_output): Clean up.
2001 * src/output.c (output_gram, output): Clean up.
2002
20032001-12-10 Akim Demaille <akim@epita.fr>
2004
2005 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2006 * src/LR0.c (set_state_table): here.
2007 * src/lalr.c (lalr): Call it.
2008
20092001-12-10 Akim Demaille <akim@epita.fr>
2010
2011 * src/state.h (shifts): Remove the `number' member: shifts are
2012 attached to state, hence no longer need to be labelled with a
2013 state number.
2014
20152001-12-10 Akim Demaille <akim@epita.fr>
2016
2017 Now that states have a complete set of members, the linked list of
2018 shifts is useless: just fill directly the state's shifts member.
2019
2020 * src/state.h (shifts): Remove the `next' member.
2021 * src/LR0.c (first_state, last_state): Remove.
2022 Adjust the callers.
2023 (augment_automaton): Don't look for the shifts that must be added
2024 a shift on EOF: it is those of the state we looked for! But now,
2025 since shifts are attached, it is no longer needed to looking
2026 merely by its id: its number.
2027
20282001-12-10 Akim Demaille <akim@epita.fr>
2029
2030 * src/LR0.c (augment_automaton): Better variable locality.
2031 Remove an impossible branch: if there is a state corresponding to
2032 the start symbol being shifted, then there is shift for the start
2033 symbol from the initial state.
2034
20352001-12-10 Akim Demaille <akim@epita.fr>
2036
2037 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2038 only when appropriate: when insert_start_shifting_state' is not
2039 invoked.
2040 * tests/regression.at (Rule Line Numbers): Adjust.
2041
20422001-12-10 Akim Demaille <akim@epita.fr>
2043
2044 * src/LR0.c (augment_automaton): Now that all states have shifts,
2045 merge the two cases addition shifts to the initial state.
2046
20472001-12-10 Akim Demaille <akim@epita.fr>
2048
2049 * src/lalr.c (set_state_table): Move to...
2050 * src/LR0.c: here.
2051 * src/lalr.c (lalr): Don't call it...
2052 * src/LR0.c (generate_states): do it.
2053 * src/LR0.h (first_state): Remove, only the table is used.
2054
20552001-12-10 Akim Demaille <akim@epita.fr>
2056
2057 * src/LR0.h (first_shift, first_reduction): Remove.
2058 * src/lalr.c: Don't use first_shift: find shifts through the
2059 states.
2060
20612001-12-10 Akim Demaille <akim@epita.fr>
2062
2063 * src/LR0.c: Attach shifts to states as soon as they are
2064 computed.
2065 * src/lalr.c (set_state_table): Instead of assigning shifts to
2066 state, just assert that the mapping was properly done.
2067
20682001-12-10 Akim Demaille <akim@epita.fr>
2069
2070 * src/LR0.c (insert_start_shift): Rename as...
2071 (insert_start_shifting_state): this.
2072 (insert_eof_shifting_state, insert_accepting_state): New.
2073 (augment_automaton): Adjust.
2074 Better locality of the variables.
2075 When looking if the start_symbol is shifted from the initial
2076 state, using `while (... symbol != start_symbol ...)' sounds
2077 better than `while (... symbol < start_symbol ...)': If fail
2078 to see how the order between symbols could be relevant!
2079
20802001-12-10 Akim Demaille <akim@epita.fr>
2081
2082 * src/getargs.h: Don't declare `spec_name_prefix' and
2083 `spec_file_prefix', declared by src/files.h.
2084 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2085 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2086 * src/output.c (prepare): Adjust.
2087 * src/reader.c (symbols_output): Likewise.
2088 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2089
20902001-12-10 Akim Demaille <akim@epita.fr>
2091
2092 * src/muscle_tab.c (muscle_init): NULL is a better default than
2093 `"0"'.
2094
20952001-12-10 Akim Demaille <akim@epita.fr>
2096
2097 * src/reader.c (reader): Calling symbols_output once is enough.
2098
20992001-12-10 Akim Demaille <akim@epita.fr>
2100
2101 Now that states have a complete set of members, the linked list of
2102 reductions is useless: just fill directly the state's reductions
2103 member.
2104
2105 * src/state.h (struct reductions): Remove member `number' and
2106 `next'.
2107 * src/LR0.c (first_reduction, last_reduction): Remove.
2108 (save_reductions): Don't link the new reductions, store them in
2109 this_state.
2110 * src/lalr.c (set_state_table): No need to attach reductions to
2111 states, it's already done.
2112 * src/output.c (output_actions): No longer free the shifts, then
2113 the reductions, then the states: free all the states and their
2114 members.
2115
21162001-12-10 Akim Demaille <akim@epita.fr>
2117
2118 * src/options.c (OPTN, DRTV, BOTH): New.
2119 (option_table): Use them.
2120
2121 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2122 the job of system.h.
2123 * src/options.c: Don't include stdio.h and xalloc.h for the same
2124 reasons.
2125
21262001-12-10 Akim Demaille <akim@epita.fr>
2127
2128 * src/output.c (output, prepare): Make sure the values of the
2129 muscles `action' and `prologue' are 0-terminated.
2130
21312001-12-10 Akim Demaille <akim@epita.fr>
2132
2133 Clean up GCC warnings.
2134
2135 * src/reader.c (copy_action): `buf' is not used.
2136 (parse_skel_decl): Be static.
2137 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2138 * src/options.h (create_long_option_table): Have a real prototype.
2139 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2140 (hash_delete_at): Return const void *.
2141 Adjust casts to preserve the const.
2142
21432001-12-10 Akim Demaille <akim@epita.fr>
2144
2145 * configure.in: Require 2.52g.
2146 M4 is not needed, but AUTOM4TE is.
2147 * m4/m4.m4: Remove.
2148 * tests/Makefile.am: Adjust.
2149
21502001-12-10 Akim Demaille <akim@epita.fr>
2151
2152 One structure for states is enough, even though theoretically
2153 there are LR(0) states and LALR(1) states.
2154
2155 * src/lalr.h (state_t): Remove.
2156 (state_table): Be state_t **, not state_t *.
2157 * src/state.h (core, CORE_ALLOC): Rename as...
2158 (state_t, STATE_ALLOC): this.
2159 Add the LALR(1) members: shifts, reductions, errs.
2160 * src/LR0.c (state_table): Rename as...
2161 (state_hash): this, to avoid name clashes with the global
2162 `state_table'.
2163 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2164 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2165
21662001-12-10 Akim Demaille <akim@epita.fr>
2167
2168 Bison dumps core on bash.y.
2169 Reported by Pascal Bart.
2170
2171 * src/warshall.c (bitmatrix_print): New.
2172 (TC): Use it.
2173 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2174 j must be the outer loop.
2175 * tests/regression.at (Broken Closure): New.
2176
21772001-12-05 Akim Demaille <akim@epita.fr>
2178
2179 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2180 its argument.
2181