]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
Note: the previous patch partially drops `semantic-parser' support: it always does...
[bison.git] / ChangeLog
... / ...
CommitLineData
12002-05-02 Akim Demaille <akim@epita.fr>
2
3 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
4 (parse_guard): Rename the formal argument `stack_offset' as
5 `rule_length', which is more readable.
6 Adjust callers.
7 (copy_at, copy_dollar): Instead of outputting the hard coded
8 values of $$, $n and so forth, output invocation to b4_lhs_value,
9 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
10 Note: this patch partially drops `semantic-parser' support: it
11 always does `rule_length - n', where semantic parsers ought to
12 always use `-n'.
13 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
15
162002-05-02 Akim Demaille <akim@epita.fr>
17
18 * configure.in (AC_INIT): Bump to 1.49b.
19 (AM_INIT_AUTOMAKE): Short invocation.
20
212002-05-02 Akim Demaille <akim@epita.fr>
22
23 Version 1.49a.
24
252002-05-01 Akim Demaille <akim@epita.fr>
26
27 * src/skeleton.h: Remove.
28
292002-05-01 Akim Demaille <akim@epita.fr>
30
31 * src/skeleton.h: Fix the #endif.
32 Reported by Magnus Fromreide.
33
342002-04-26 Paul Eggert <eggert@twinsun.com>
35
36 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
37 Define if we define YYSTYPE and YYLTYPE, respectively.
38 (YYCOPY): Fix [] quoting problem in the non-GCC case.
39
402002-04-25 Robert Anisko <robert@lrde.epita.fr>
41
42 * src/scan-skel.l: Postprocess quadrigraphs.
43
44 * src/reader.c (copy_character): New function, used to output
45 single characters while replacing `[' and `]' with quadrigraphs, to
46 avoid troubles with M4 quotes.
47 (copy_comment): Output characters with copy_character.
48 (read_additionnal_code): Likewise.
49 (copy_string2): Likewise.
50 (copy_definition): Likewise.
51
52 * tests/calc.at: Exercise M4 quoting.
53
542002-04-25 Akim Demaille <akim@epita.fr>
55
56 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
57 between `!' and the command.
58 Reported by Paul Eggert.
59
602002-04-24 Robert Anisko <robert@lrde.epita.fr>
61
62 * tests/calc.at: Exercise prologue splitting.
63
64 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
65 `b4_post_prologue' instead of `b4_prologue'.
66
67 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
68 muscles.
69 (output): Free pre_prologue_obstack and post_prologue_obstack.
70 * src/files.h, src/files.c (attrs_obstack): Remove.
71 (pre_prologue_obstack, post_prologue_obstack): New.
72 * src/reader.c (copy_definition): Add a parameter to specify the
73 obstack to fill, instead of using attrs_obstack unconditionally.
74 (read_declarations): Pass pre_prologue_obstack to copy_definition if
75 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
76
772002-04-23 Paul Eggert <eggert@twinsun.com>
78
79 * data/bison.simple: Remove unnecessary commentary and white
80 space differences from 1_29-branch.
81 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
82
83 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
84 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
85 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
86 constructors or destructors.
87
88 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
89
902002-04-23 Akim Demaille <akim@epita.fr>
91
92 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
93 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
94 location with columns.
95 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
96 All reported by Paul Eggert.
97
982002-04-22 Akim Demaille <akim@epita.fr>
99
100 * src/reduce.c (dump_grammar): Move to...
101 * src/gram.h, src/gram.c (grammar_dump): here.
102 Be sure to separate long item numbers.
103 Don't read the members of a rule's prec if its nil.
104
1052002-04-22 Akim Demaille <akim@epita.fr>
106
107 * src/output.c (table_size, table_grow): New.
108 (MAXTABLE): Remove, replace uses with table_size.
109 (pack_vector): Instead of dying when the table is too big, grow it.
110
1112002-04-22 Akim Demaille <akim@epita.fr>
112
113 * data/bison.simple (yyr1): Its type is that of a token number.
114 * data/bison.c++ (r1_): Likewise.
115 * tests/regression.at (Web2c Actions): Adjust.
116
1172002-04-22 Akim Demaille <akim@epita.fr>
118
119 * src/reader.c (token_translations_init): 256 is now the default
120 value for the error token, i.e., it will be assigned another
121 number if the user assigned 256 to one of her tokens.
122 (reader): Don't force 256 to error.
123 * doc/bison.texinfo (Symbols): Adjust.
124 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
125 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
126 etc. instead of 10, 20, 30 (which was used to `jump' over error
127 (256) and undefined (2)).
128
1292002-04-22 Akim Demaille <akim@epita.fr>
130
131 Propagate more token_number_t.
132
133 * src/gram.h (token_number_as_item_number)
134 (item_number_as_token_number): New.
135 * src/output.c (GENERATE_OUTPUT_TABLE): New.
136 Use it to create output_item_number_table and
137 output_token_number_table.
138 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
139 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
140 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
141 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
142
1432002-04-22 Akim Demaille <akim@epita.fr>
144
145 * src/output.h, src/output.c (get_lines_number): Remove.
146
1472002-04-19 Akim Demaille <akim@epita.fr>
148
149 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
150 as Lex/Flex'.
151 (Debugging): More details about enabling the debugging features.
152 (Table of Symbols): Describe $$, $n, @$, and @n.
153 Suggested by Tim Josling.
154
1552002-04-19 Akim Demaille <akim@epita.fr>
156
157 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
158
1592002-04-10 Akim Demaille <akim@epita.fr>
160
161 * src/system.h: Rely on HAVE_LIMITS_H.
162 Suggested by Paul Eggert.
163
1642002-04-09 Akim Demaille <akim@epita.fr>
165
166 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
167 full stderr, and strip it according to the bison options, instead
168 of composing the error message from different bits.
169 This makes it easier to check for several error messages.
170 Adjust all the invocations.
171 Add an invocation exercising the error token.
172 Add an invocation demonstrating a stupid error message.
173 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
174 Adjust the tests.
175 Error message are for stderr, not stdout.
176
1772002-04-09 Akim Demaille <akim@epita.fr>
178
179 * src/gram.h, src/gram.c (error_token_number): Remove, use
180 errtoken->number.
181 * src/reader.c (reader): Don't specify the user token number (2)
182 for $undefined, as it uselessly prevents using it.
183 * src/gram.h (token_number_t): Move to...
184 * src/symtab.h: here.
185 (state_t.number): Is a token_number_t.
186 * src/print.c, src/reader.c: Use undeftoken->number instead of
187 hard coded 2.
188 (Even though this 2 is not the same as above: the number of the
189 undeftoken remains being 2, it is its user token number which
190 might not be 2).
191 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
192 `user_token_number_max'.
193 Output `undef_token_number'.
194 * data/bison.simple, data/bison.c++: Use them.
195 Be sure to map invalid yylex return values to
196 `undef_token_number'. This saves us from gratuitous SEGV.
197
198 * tests/conflicts.at (Solved SR Conflicts)
199 (Unresolved SR Conflicts): Adjust.
200 * tests/regression.at (Web2c Actions): Adjust.
201
2022002-04-08 Akim Demaille <akim@epita.fr>
203
204 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
205 Adding #line.
206 Remove the duplicate `typedefs'.
207 (RhsNumberType): Fix the declaration and various other typos.
208 Use __ofile__.
209 * data/bison.simple: Use __ofile__.
210 * src/scan-skel.l: Handle __ofile__.
211
2122002-04-08 Akim Demaille <akim@epita.fr>
213
214 * src/gram.h (item_number_t): New, the type of item numbers in
215 RITEM. Note that it must be able to code symbol numbers as
216 positive number, and the negation of rule numbers as negative
217 numbers.
218 Adjust all dependencies (pretty many).
219 * src/reduce.c (rule): Remove this `short *' pointer: use
220 item_number_t.
221 * src/system.h (MINSHORT, MAXSHORT): Remove.
222 Include `limits.h'.
223 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
224 (shortcpy): Remove.
225 (MAXTABLE): Move to...
226 * src/output.c (MAXTABLE): here.
227 (prepare_rules): Use output_int_table to output rhs.
228 * data/bison.simple, data/bison.c++: Adjust.
229 * tests/torture.at (Big triangle): Move the limit from 254 to
230 500.
231 * tests/regression.at (Web2c Actions): Ajust.
232
233 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
234 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
235 passes, but produces negative #line number, once fixed, GCC is
236 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
237 C), it passes.
238 * src/state.h (state_h): Code input lines on ints, not shorts.
239
2402002-04-08 Akim Demaille <akim@epita.fr>
241
242 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
243 and then the grammar.
244
2452002-04-08 Akim Demaille <akim@epita.fr>
246
247 * src/system.h: No longer using strndup.
248
2492002-04-07 Akim Demaille <akim@epita.fr>
250
251 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
252 * src/output.c (output_table_data): Return the longest number.
253 (prepare_tokens): Output `token_number_max').
254 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
255 New.
256 Use them to define yy_token_number_type/TokenNumberType.
257 Use this type for yytranslate.
258 * tests/torture.at (Big triangle): Push the limit from 124 to
259 253.
260 * tests/regression.at (Web2c Actions): Adjust.
261
2622002-04-07 Akim Demaille <akim@epita.fr>
263
264 * tests/torture.at (Big triangle): New.
265 (GNU AWK Grammar, GNU Cim Grammar): Move to...
266 * tests/existing.at: here.
267
2682002-04-07 Akim Demaille <akim@epita.fr>
269
270 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
271 nritems.
272 Adjust dependencies.
273
2742002-04-07 Akim Demaille <akim@epita.fr>
275
276 * src/reader.c: Normalize increments to prefix form.
277
2782002-04-07 Akim Demaille <akim@epita.fr>
279
280 * src/reader.c, symtab.c: Remove debugging code.
281
2822002-04-07 Akim Demaille <akim@epita.fr>
283
284 Rename all the `bucket's as `symbol_t'.
285
286 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
287 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
288 * src/symtab.c, src/symtab.h (bucket): Rename as...
289 (symbol_t): this.
290 (symbol_list_new, bucket_check_defined, bucket_make_alias)
291 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
292 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
293 (buckets_new, buckets_free, buckets_do): Rename as...
294 (symbol_list_new, symbol_check_defined, symbol_make_alias)
295 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
296 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
297 (symbols_new, symbols_free, symbols_do): these.
298
2992002-04-07 Akim Demaille <akim@epita.fr>
300
301 Use lib/hash for the symbol table.
302
303 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
304 EOF.
305 * src/lex.c (lex): Set the `number' member of new terminals.
306 * src/reader.c (bucket_check_defined, bucket_make_alias)
307 (bucket_check_alias_consistence, bucket_translation): New.
308 (reader, grammar_free, readgram, token_translations_init)
309 (packsymbols): Adjust.
310 (reader): Number the predefined tokens.
311 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
312 for predefined tokens.
313 * src/symtab.h (bucket): Remove all the hash table related
314 members.
315 * src/symtab.c (symtab): Replace by...
316 (bucket_table): this.
317 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
318 (buckets_new, buckets_do): New.
319
3202002-04-07 Akim Demaille <akim@epita.fr>
321
322 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
323 (start_symbol, max_user_token_number, semantic_parser)
324 (error_token_number): Initialize.
325 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
326 Initialize.
327 (reader): Don't.
328 (errtoken, eoftoken, undeftoken, axiom): Extern.
329
3302002-04-07 Akim Demaille <akim@epita.fr>
331
332 * src/gram.h (rule_s): prec and precsym are now pointers
333 to the bucket giving the priority/associativity.
334 Member `associativity' removed: useless.
335 * src/reduce.c, src/conflicts.c: Adjust.
336
3372002-04-07 Akim Demaille <akim@epita.fr>
338
339 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
340 Properly escape the symbols' TAG when outputting them.
341
3422002-04-07 Akim Demaille <akim@epita.fr>
343
344 * src/lalr.h (LA): Is a bitsetv, not bitset*.
345
3462002-04-07 Akim Demaille <akim@epita.fr>
347
348 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
349 (LArule): this, which is an array to rule_t*.
350 * src/print.c, src/conflicts.c: Adjust.
351
3522002-04-07 Akim Demaille <akim@epita.fr>
353
354 * src/gram.h (rule_t): Rename `number' as `user_number'.
355 `number' is a new member.
356 Adjust dependencies.
357 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
358
3592002-04-07 Akim Demaille <akim@epita.fr>
360
361 As a result of the previous patch, it is no longer needed
362 to reorder ritem itself.
363
364 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
365
3662002-04-07 Akim Demaille <akim@epita.fr>
367
368 Be sure never to walk through RITEMS, but use only data related to
369 the rules themselves. RITEMS should be banished.
370
371 * src/output.c (output_token_translations): Rename as...
372 (prepare_tokens): this.
373 In addition to `translate', prepare the muscles `tname' and
374 `toknum', which were handled by...
375 (output_rule_data): this.
376 Remove, and move the remainder of its outputs into...
377 (prepare_rules): this new routines, which also merges content from
378 (output_gram): this.
379 (prepare_rules): Be sure never to walk through RITEMS.
380 (output_stos): Rename as...
381 (prepare_stos): this.
382 (output): Always invoke prepare_states, after all, just don't use it
383 in the output if you don't need it.
384
3852002-04-07 Akim Demaille <akim@epita.fr>
386
387 * src/LR0.c (new_state): Display `nstates' as the name of the
388 newly created state.
389 Adjust to initialize first_state and last_state if needed.
390 Be sure to distinguish the initial from the final state.
391 (new_states): Create the itemset of the initial state, and use
392 new_state.
393 * src/closure.c (closure): Now that the initial state has its
394 items properly set, there is no need for a special case when
395 creating `ruleset'.
396
397 As a result, now the rule 0, reducing to $axiom, is visible in the
398 outputs. Adjust the test suite.
399
400 * tests/conflicts.at (Solved SR Conflicts)
401 (Unresolved SR Conflicts): Adjust.
402 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
403 * tests/conflicts.at (S/R in initial): New.
404
4052002-04-07 Akim Demaille <akim@epita.fr>
406
407 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
408 the RHS of the rules.
409 * src/output.c (output_gram): Likewise.
410
4112002-04-07 Akim Demaille <akim@epita.fr>
412
413 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
414 bucket.
415 Adjust all dependencies.
416 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
417 `number' of the buckets too.
418 * src/gram.h: Include `symtab.h'.
419 (associativity): Move to...
420 * src/symtab.h: here.
421 No longer include `gram.h'.
422
4232002-04-07 Akim Demaille <akim@epita.fr>
424
425 * src/gram.h, src/gram.c (rules_rhs_length): New.
426 (ritem_longest_rhs): Use it.
427 * src/gram.h (rule_t): `number' is a new member.
428 * src/reader.c (packgram): Set it.
429 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
430 the end of `rules', and count them out of `nrules'.
431 (reduce_output, dump_grammar): Adjust.
432 * src/print.c (print_grammar): It is no longer needed to check for
433 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
434 * tests/reduce.at (Reduced Automaton): New test.
435
4362002-04-07 Akim Demaille <akim@epita.fr>
437
438 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
439 lacking `+ 1' to nrules, Bison reported as useless a token if it
440 was used solely to set the precedence of the last rule...
441
4422002-04-07 Akim Demaille <akim@epita.fr>
443
444 * data/bison.c++, data/bison.simple: Don't output the current file
445 name in #line, to avoid useless diffs between two identical
446 outputs under different names.
447
4482002-04-07 Akim Demaille <akim@epita.fr>
449
450 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
451 Normalize loops to using `< nrules + 1', not `<= nrules'.
452
4532002-04-07 Akim Demaille <akim@epita.fr>
454
455 * TODO: Update.
456
4572002-04-07 Akim Demaille <akim@epita.fr>
458
459 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
460 bucket.value as bucket.number.
461
4622002-04-07 Akim Demaille <akim@epita.fr>
463
464 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
465 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
466 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
467 RHS, instead of being an index in RITEMS.
468
4692002-04-04 Paul Eggert <eggert@twinsun.com>
470
471 * doc/bison.texinfo: Update copyright date.
472 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
473 (Symbols): Warn about running Bison in one character set,
474 but compiling and/or running in an incompatible one.
475 Warn about character code 256, too.
476
4772002-04-03 Paul Eggert <eggert@twinsun.com>
478
479 * src/bison.data (YYSTACK_ALLOC): Depend on whether
480 YYERROR_VERBOSE is nonzero, not whether it is defined.
481
482 Merge changes from bison-1_29-branch.
483
4842002-03-20 Paul Eggert <eggert@twinsun.com>
485
486 Merge fixes from Debian bison_1.34-1.diff.
487
488 * configure.in (AC_PREREQ): 2.53.
489
4902002-03-20 Akim Demaille <akim@epita.fr>
491
492 * src/conflicts.c (log_resolution): Argument `resolution' is const.
493
4942002-03-19 Paul Eggert <eggert@twinsun.com>
495
496 * src/bison.simple (YYCOPY): New macro.
497 (YYSTACK_RELOCATE): Use it.
498 Remove Type arg; no longer needed. All callers changed.
499 (yymemcpy): Remove; no longer needed.
500
501 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
502 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
503
5042002-03-19 Akim Demaille <akim@epita.fr>
505
506 Test and fix the #line outputs.
507
508 * tests/atlocal.at (GCC): New.
509 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
510 (Prologue synch line, ,%union synch line, Postprologue synch line)
511 (Action synch line, Epilogue synch line): New tests.
512 * src/reader.c (parse_union_decl): Define the muscle stype_line.
513 * data/bison.simple, data/bison.c++: Use it.
514
5152002-03-19 Akim Demaille <akim@epita.fr>
516
517 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
518 (Solved SR Conflicts, %expect not enough, %expect right)
519 (%expect too much): Move to...
520 * tests/conflicts.at: this new file.
521
5222002-03-19 Akim Demaille <akim@epita.fr>
523
524 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
525 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
526 that we can move to enums for instance.
527 * src/output.c (token_definitions_output): Output a list of
528 `token-name, token-number' instead of the #define.
529 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
530
5312002-03-14 Akim Demaille <akim@epita.fr>
532
533 Use Gettext 0.11.1.
534
5352002-03-09 Robert Anisko <robert@lrde.epita.fr>
536
537 * data/bison.c++: Make the user able to add members to the generated
538 parser by subclassing.
539
5402002-03-05 Robert Anisko <robert@lrde.epita.fr>
541
542 * src/reader.c (read_additionnal_code): `c' should be an integer, not
543 a character.
544 Reported by Nicolas Tisserand and Nicolas Burrus.
545
5462002-03-04 Robert Anisko <robert@lrde.epita.fr>
547
548 * src/reader.c: Warn about lacking semi-colons, do not complain.
549
5502002-03-04 Robert Anisko <robert@lrde.epita.fr>
551
552 * data/bison.c++: Remove a debug line.
553
5542002-03-04 Robert Anisko <robert@lrde.epita.fr>
555
556 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
557 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
558 provide a default implementation.
559
5602002-03-04 Akim Demaille <akim@epita.fr>
561
562 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
563 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
564 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
565 * tests/semantic.at (Parsing Guards): Similarly.
566 * src/reader.at (readgram): Complain if the last rule is not ended
567 with a semi-colon.
568
5692002-03-04 Akim Demaille <akim@epita.fr>
570
571 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
572 * src/closure.c: here.
573 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
574 RTC.
575 * src/warshall.h, src/warshall.c: Remove.
576 * tests/sets.at (Broken Closure): Adjust.
577
5782002-03-04 Akim Demaille <akim@epita.fr>
579
580 * src/output.c (output_skeleton): tempdir is const.
581 bytes_read is unused.
582
5832002-03-04 Akim Demaille <akim@epita.fr>
584
585 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
586 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
587 Update.
588 From Michael Hayes.
589
5902002-03-04 Akim Demaille <akim@epita.fr>
591
592 * src/closure.c (closure): `r' is unused.
593
5942002-03-04 Akim Demaille <akim@epita.fr>
595
596 * tests/sets.at (Broken Closure): Add the ending `;'.
597 * src/reader.at (readgram): Complain if a rule is not ended with a
598 semi-colon.
599
6002002-03-04 Akim Demaille <akim@epita.fr>
601
602 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
603 (count_sr_conflicts): Use bitset_count.
604 * src/reduce.c (inaccessable_symbols): Ditto.
605 (bits_size): Remove.
606 * src/warshall.h, src/warshall.c: Convert to bitsetv.
607
6082002-03-04 Akim Demaille <akim@epita.fr>
609
610 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
611 * src/reduce.c: Remove the `bitset_zero's following the
612 `bitset_create's, as now it is performed by the latter.
613
6142002-03-04 Akim Demaille <akim@epita.fr>
615
616 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
617 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
618 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
619 latest sources from Michael.
620
6212002-03-04 Akim Demaille <akim@epita.fr>
622
623 * src/output.c (output): Don't free the grammar.
624 * src/reader.c (grammar_free): New.
625 * src/main.c (main): Call it and don't free symtab here.
626
6272002-03-04 Akim Demaille <akim@epita.fr>
628
629 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
630 before returning.
631 Reported by Benoit Perrot.
632
6332002-03-04 Akim Demaille <akim@epita.fr>
634
635 Use bitset operations when possible, not loops over bits.
636
637 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
638 bitset_or.
639 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
640 * src/reduce.c (useless_nonterminals): Formatting changes.
641 * src/warshall.c (TC): Use bitset_or.
642
6432002-03-04 Akim Demaille <akim@epita.fr>
644
645 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
646 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
647 Ditto.
648
6492002-03-04 Akim Demaille <akim@epita.fr>
650
651 * src/lalr.c (F): Now a bitset*.
652 Adjust all dependencies.
653
6542002-03-04 Akim Demaille <akim@epita.fr>
655
656 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
657 Adjust all dependencies.
658
6592002-03-04 Akim Demaille <akim@epita.fr>
660
661 * src/L0.c, src/LR0.h (nstates): Be size_t.
662 Adjust comparisons (signed vs unsigned).
663 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
664 bitset*.
665 Adjust all dependencies.
666
6672002-03-04 Akim Demaille <akim@epita.fr>
668
669 * src/closure.c (firsts): Now, also a bitset.
670 Adjust all dependencies.
671 (varsetsize): Remove, now unused.
672 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
673
6742002-03-04 Akim Demaille <akim@epita.fr>
675
676 * src/print.c: Convert to use bitset.h, not hand coded iterations
677 over ints.
678
6792002-03-04 Akim Demaille <akim@epita.fr>
680
681 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
682
6832002-03-04 Akim Demaille <akim@epita.fr>
684
685 * src/closure.c (ruleset): Be a bitset.
686 (rulesetsize): Remove.
687
6882002-03-04 Akim Demaille <akim@epita.fr>
689
690 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
691 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
692 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
693 * src/closure.c (fderives): Be an array of bitsets.
694
6952002-02-28 Robert Anisko <robert@lrde.epita.fr>
696
697 * data/bison.c++: Merge the two generated headers. Insert a copyright
698 notice in each output file.
699
7002002-02-28 Akim Demaille <akim@epita.fr>
701
702 * data/bison.c++: Copy the prologue of bison.simple to fetch
703 useful M4 definitions, such as b4_header_guard.
704
7052002-02-25 Akim Demaille <akim@epita.fr>
706
707 * src/getargs.c (version): Give the name of the authors, and use a
708 translator friendly scheme for the bgr
709 copyright notice.
710
7112002-02-25 Akim Demaille <akim@epita.fr>
712
713 * src/output.c (header_output): Remove, now handled completely via
714 M4.
715
7162002-02-25 Akim Demaille <akim@epita.fr>
717
718 * m4/m4.m4: New, from CVS Autoconf.
719 * configure.in: Invoke it.
720 * src/output.c (output_skeleton): Use its result instead of the
721 hard coded name.
722
7232002-02-25 Akim Demaille <akim@epita.fr>
724
725 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
726 Fileutils 4.1.5.
727 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
728 * src/output.c (output_skeleton): Use mkstemp to create a real
729 temporary file.
730 Move the filling of `skeleton' and its muscle to...
731 (prepare): here.
732 (output): Move the definition of the prologue muscle to...
733 (prepare): here.
734 * src/system.h (DEFAULT_TMPDIR): New.
735
7362002-02-14 Paul Eggert <eggert@twinsun.com>
737
738 Remove the support for C++ namespace cleanliness; it was
739 causing more problems than it was curing, since it didn't work
740 properly on some nonstandard C++ compilers. This can wait
741 for a proper C++ parser.
742
743 * NEWS: Document this.
744 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
745 of C++, as it's treated like C now.
746 * src/bison.simple (YYSTD): Remove.
747 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
748 Treat C++ just like Standard C instead of trying to support
749 namespace cleanliness.
750
7512002-02-14 Akim Demaille <akim@epita.fr>
752
753 * tests/regression.at (else): Adjust to Andreas' change.
754
7552002-02-14 Akim Demaille <akim@epita.fr>
756
757 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
758
7592002-02-13 Andreas Schwab <schwab@suse.de>
760
761 * src/output.c (output_rule_data): Don't output NULL, it might
762 not be defined yet.
763
7642002-02-11 Robert Anisko <robert@lrde.epita.fr>
765
766 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
767 (Copyright notice): Update.
768
7692002-02-11 Akim Demaille <akim@epita.fr>
770
771 * tests/regression.at (%nonassoc and eof): Don't include
772 nonportable headers.
773
7742002-02-08 Robert Anisko <robert@lrde.epita.fr>
775
776 * data/bison.c++: Correct error recovery. Make the user able to
777 initialize the starting location.
778
7792002-02-07 Akim Demaille <akim@epita.fr>
780
781 * tests/input.at: New.
782
7832002-02-07 Robert Anisko <robert@lrde.epita.fr>
784
785 * data/bison.c++: Replace some direct m4 expansions by constants. Be
786 more consistent when naming methods and variables. Put preprocessor
787 directives around tables only needed for debugging.
788
7892002-02-07 Robert Anisko <robert@lrde.epita.fr>
790
791 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
792 C++ parsers.
793 (yy::b4_name::parse): Use print_.
794
7952002-02-07 Robert Anisko <robert@lrde.epita.fr>
796
797 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
798
7992002-02-07 Robert Anisko <robert@lrde.epita.fr>
800
801 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
802 C++ parsers.
803 (yy::b4_name::parse): Build verbose error messages, and use error_.
804
8052002-02-06 Robert Anisko <robert@lrde.epita.fr>
806
807 * data/bison.c++: Fix m4 quoting in comments.
808
8092002-02-06 Robert Anisko <robert@lrde.epita.fr>
810
811 * data/bison.c++: Adjust the parser code. Fix some muscles that were
812 not expanded by m4.
813
8142002-02-05 Akim Demaille <akim@epita.fr>
815
816 * data/bison.c++: Adjust to the M4 back end.
817 More is certainly needed.
818
8192002-02-05 Akim Demaille <akim@epita.fr>
820
821 Give a try to M4 as a back end.
822
823 * lib/readpipe.c: New, from wdiff.
824 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
825 BISON_HAIRY.
826 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
827 specific values. Now it is m4 that performs the lookup.
828 * src/parse-skel.y: Remove.
829 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
830 * src/output.c (actions_output, guards_output)
831 (token_definitions_output): No longer keeps track of the output
832 line number, hence remove the second argument.
833 (guards_output): Check against the guard member of a rule, not the
834 action member.
835 Adjust callers.
836 (output_skeleton): Don't look for the skeleton location, let m4 do
837 that.
838 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
839 file will be used.
840 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
841 (prepare): Given that for the time being changesyntax is not
842 usable in M4, rename the muscles using `-' to `_'.
843 Define `defines_flag', `output_parser_name' and `output_header_name'.
844 * src/output.h (actions_output, guards_output)
845 (token_definitions_output): Adjust prototypes.
846 * src/scan-skel.l: Instead of scanning the skeletons, it now
847 processes the output of m4: `__oline__' and `#output'.
848 * data/bison.simple: Adjust to be used by M4(sugar).
849 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
850 to date.
851 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
852 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
853 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
854 shamelessly stolen from CVS Autoconf.
855
8562002-02-05 Akim Demaille <akim@epita.fr>
857
858 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
859 * configure.in: Check for the declarations of free and malloc.
860 * src/muscle_tab.c: Adjust.
861
8622002-02-05 Akim Demaille <akim@epita.fr>
863
864 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
865 which have no values.
866
8672002-02-05 Akim Demaille <akim@epita.fr>
868
869 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
870 * data/: here.
871
8722002-01-29 Paul Eggert <eggert@twinsun.com>
873
874 * src/bison.simple (YYSIZE_T): Do not define merely because
875 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
876 On some platforms, <alloca.h> does not declare YYSTD (size_t).
877
8782002-01-27 Akim Demaille <akim@epita.fr>
879
880 Fix `%nonassoc and eof'.
881
882 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
883 which were not properly copied! Replace
884 memcpy (res->errs, src->errs, src->nerrs);
885 with
886 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
887 !!!
888 * tests/regression.at (%nonassoc and eof): Adjust to newest
889 Autotest: `.' is not in the PATH.
890
8912002-01-27 Akim Demaille <akim@epita.fr>
892
893 * tests/sets.at (AT_EXTRACT_SETS): New.
894 (Nullable): Use it.
895 (Firsts): New.
896
8972002-01-26 Akim Demaille <akim@epita.fr>
898
899 * tests/actions.at, tests/calc.at, tests/headers.at,
900 * tests/torture.at: Adjust to the newest Autotest which no longer
901 forces `.' in the PATH.
902
9032002-01-25 Akim Demaille <akim@epita.fr>
904
905 * tests/regression.at (%nonassoc and eof): New.
906 Suggested by Robert Anisko.
907
9082002-01-24 Akim Demaille <akim@epita.fr>
909
910 Bison dumps core when trying to complain about broken input files.
911 Reported by Cris van Pelt.
912
913 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
914 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
915 into...
916 (Invalid inputs): Strengthen: exercise parse_percent_token.
917
9182002-01-24 Robert Anisko <robert.anisko@epita.fr>
919
920 * src/Makefile.am: Add bison.c++.
921 * src/bison.c++: New skeleton.
922
9232002-01-21 Paolo Bonzini <bonzini@gnu.org>
924
925 * po/it.po: New.
926
9272002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
928
929 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
930
9312002-01-20 Marc Autret <marc@gnu.org>
932
933 * src/files.c (compute_output_file_names): Fix
934
9352002-01-20 Marc Autret <marc@gnu.org>
936
937 * tests/output.at: New test.
938 * src/files.c (compute_base_names): Don't map extensions when
939 the YACC flag is set, use defaults.
940 Reported by Evgeny Stambulchik.
941
9422002-01-20 Marc Autret <marc@gnu.org>
943
944 * src/system.h: Need to define __attribute__ away for non-GCC
945 compilers as well (i.e. the vendor C compiler).
946 Suggested by Albert Chin-A-Young.
947
9482002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
949
950 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
951 canonical definition.
952 * src/system.h: Use the canonical definition for PARAMS (avoids
953 a conflict with the macro from lib/hash.h).
954
9552002-01-11 Akim Demaille <akim@epita.fr>
956
957 * configure.in: Use AC_FUNC_STRNLEN.
958 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
959
9602002-01-09 Akim Demaille <akim@epita.fr>
961
962 * src/files.c, src/files.h (output_infix): New.
963 (tab_extension): Remove.
964 (compute_base_names): Compute the former, drop the latter.
965 * src/output.c (prepare): Insert the muscles `output-infix', and
966 `output-suffix'.
967 * src/parse-skel.y (string, string.1): New.
968 (section.header): Use it.
969 (section.yacc): Remove.
970 (prefix): Remove too.
971 * src/scan-skel.l: Adjust.
972 * src/bison.simple, src/bison.hairy: Adjust.
973
9742002-01-09 Akim Demaille <akim@epita.fr>
975
976 * configure.in (WERROR_CFLAGS): Compute it.
977 * src/Makefile.am (CFLAGS): Pass it.
978 * tests/atlocal.in (CFLAGS): Idem.
979 * src/files.c: Fix a few warnings.
980 (get_extension_index): Remove, unused.
981
9822002-01-08 Akim Demaille <akim@epita.fr>
983
984 * src/getargs.c (AS_FILE_NAME): New.
985 (getargs): Use it to convert DOSish file names.
986 * src/files.c (base_name): Rename as full_base_name to avoid
987 clashes with `base_name ()'.
988 (filename_split): New.
989 (compute_base_names): N-th rewrite, using filename_split.
990
9912002-01-08 Akim Demaille <akim@epita.fr>
992
993 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
994 New, stolen from the Fileutils 4.1.
995 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
996 * configure.in: Check for the presence of memrchr, and of its
997 prototype.
998
9992002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1000
1001 * lib/hash.h (__P): Added definition for this macro.
1002 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1003 BUILT_SOURCES, to ensure they are generated first.
1004 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1005 %error-verbose to allow bootstrapping with bison 1.30x.
1006
10072002-01-06 Akim Demaille <akim@epita.fr>
1008
1009 * src/reader.c (parse_braces): Don't fetch the next char, the
1010 convention is to fetch on entry.
1011 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1012 'switch' without a following semicolon.
1013 * tests/regression.at (braces parsing): New.
1014
10152002-01-06 Akim Demaille <akim@epita.fr>
1016
1017 Bison is dead wrong in its RR conflict reports.
1018
1019 * tests/torture.at (GNU Cim Grammar): New.
1020 * src/conflicts.c (count_rr_conflicts): Fix.
1021
10222002-01-06 Akim Demaille <akim@epita.fr>
1023
1024 Creating package.m4 from configure.ac causes too many problems.
1025
1026 * tests/Makefile.am (package.m4): Create it by hand,
1027 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1028
10292002-01-06 Akim Demaille <akim@epita.fr>
1030
1031 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1032 skeleton.h.
1033
10342002-01-04 Paul Eggert <eggert@twinsun.com>
1035
1036 * doc/bison.texinfo (Debugging):
1037 Remove YYSTDERR; it's no longer defined or used.
1038 Also, s/cstdio.h/cstdio/.
1039
10402002-01-03 Akim Demaille <akim@epita.fr>
1041
1042 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1043
10442002-01-03 Akim Demaille <akim@epita.fr>
1045
1046 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1047 tracing code to --trace, wait for a better --trace option, with
1048 args.
1049
10502002-01-03 Akim Demaille <akim@epita.fr>
1051
1052 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1053 The ISO C++ standard is extremely clear about it: stderr is
1054 considered a macro, not a regular symbol (see table 94 `Header
1055 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1056 Therefore std:: does not apply to it. It still does with fprintf.
1057 Also, s/cstdio.h/cstdio/.
1058
10592002-01-03 Akim Demaille <akim@epita.fr>
1060
1061 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1062 for non system headers.
1063
10642002-01-02 Akim Demaille <akim@epita.fr>
1065
1066 Equip the skeleton chain with location tracking, runtime trace,
1067 pure parser and scanner.
1068
1069 * src/parse-skel.y: Request a pure parser, locations, and prefix
1070 renaming.
1071 (%union): Having several members with the same type does not help
1072 type mismatches, simplify.
1073 (YYPRINT, yyprint): New.
1074 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1075 (skel_error): this.
1076 Handle locations.
1077 * src/scan-skel.l: Adjust to these changes.
1078 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1079 (LOCATION_PRINT, skel_control_t): New.
1080
10812001-12-30 Akim Demaille <akim@epita.fr>
1082
1083 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1084 replace `gb' with BLANKS.
1085 * src/scan-skel.l: Adjust.
1086
10872001-12-30 Akim Demaille <akim@epita.fr>
1088
1089 * src/system.h: We don't need nor want bcopy.
1090 Throw away MS-DOS crap: we don't need getpid.
1091 * configure.in: We don't need strndup. It was even causing
1092 problems: because Flex includes the headers *before* us,
1093 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1094 not visible.
1095 * lib/xstrndup.c: New.
1096 * src/scan-skel.l: Use it.
1097 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1098 * src/parse-skel.y: Use %directives instead of #defines.
1099
11002001-12-30 Akim Demaille <akim@epita.fr>
1101
1102 * src/skeleton.h: New.
1103 * src/output.c (output_parser, output_master_parser): Remove, dead
1104 code.
1105 * src/output.h (get_lines_number, actions_output, guards_output)
1106 (token_definitions_output): Prototype them.
1107 * src/parse-skel.y: Add the license notice.
1108 Include output.h and skeleton.h.
1109 (process_skeleton): Returns void, and takes a single parameter.
1110 * src/scan-skel.l: Add the license notice.
1111 Include skeleton.h.
1112 Don't use %option yylineno: it seems that then Flex imagines
1113 REJECT has been used, and therefore it won't reallocate its
1114 buffers (which makes no other sense to me than a bug). It results
1115 in warnings for `unused: yy_flex_realloc'.
1116
11172001-12-30 Robert Anisko <robert.anisko@epita.fr>
1118
1119 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1120 (MUSCLE_INSERT_PREFIX): ...to there.
1121 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1122 (MUSCLE_INSERT_PREFIX): Move from here...
1123
1124 * src/bison.hairy: Add a section directive. Put braces around muscle
1125 names. This parser skeleton is still broken, but Bison should not
1126 choke on a bad muscle 'syntax'.
1127 * src/bison.simple: Add a section directive. Put braces around muscle
1128 names.
1129
1130 * src/files.h (strsuffix, stringappend): Add declarations.
1131 (tab_extension): Add declaration.
1132 (short_base_name): Add declaration.
1133
1134 * src/files.c (strsuffix, stringappend): No longer static. These
1135 functions are used in the skeleton parser.
1136 (tab_extension): New.
1137 (compute_base_names): Use the computations done in this function
1138 to guess if the generated parsers should have '.tab' in their
1139 names.
1140 (short_base_name): No longer static.
1141
1142 * src/output.c (output_skeleton): New.
1143 (output): Disable call to output_master_parser, and give a try to
1144 a new skeleton handling system.
1145 (guards_output, actions_output): No longer static.
1146 (token_definitions_output, get_lines_number): No longer static.
1147
1148 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1149
1150 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
1151 parse-skel.y.
1152
1153 * src/parse-skel.y: New file.
1154 * src/scan-skel.l: New file.
1155
11562001-12-29 Akim Demaille <akim@epita.fr>
1157
1158 %name-prefix is broken.
1159
1160 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1161 Adjust all dependencies.
1162 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1163 %name-prefix.
1164
1165 Renaming yylval but not yylloc is not consistent. Now we do.
1166
1167 * src/bison.simple: Prefix yylloc if used.
1168 * doc/bison.texinfo (Decl Summary): Document that.
1169
11702001-12-29 Akim Demaille <akim@epita.fr>
1171
1172 * doc/bison.texinfo: Promote `%long-directive' over
1173 `%long_directive'.
1174 Remove all references to fixed-output-files, yacc is enough.
1175
11762001-12-29 Akim Demaille <akim@epita.fr>
1177
1178 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1179 user prologue. These are defaults.
1180 * tests/actions.at (Mid-rule actions): Make sure the user can
1181 define YYDEBUG and YYERROR_VERBOSE.
1182
11832001-12-29 Akim Demaille <akim@epita.fr>
1184
1185 * src/output.c (header_output): Don't forget to export YYLTYPE and
1186 yylloc.
1187 * tests/headers.at (export YYLTYPE): New, make sure it does.
1188 * tests/regression.at (%union and --defines, Invalid CPP headers):
1189 Move to...
1190 * tests/headers.at: here.
1191
11922001-12-29 Akim Demaille <akim@epita.fr>
1193
1194 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1195
11962001-12-29 Akim Demaille <akim@epita.fr>
1197
1198 * tests/actions.at (Mid-rule actions): Output on a single line
1199 instead of several.
1200
12012001-12-29 Akim Demaille <akim@epita.fr>
1202
1203 * doc/bison.texinfo: Formatting changes.
1204
12052001-12-29 Akim Demaille <akim@epita.fr>
1206
1207 Don't store the token defs in a muscle, just be ready to output it
1208 on command. Now possible via `symbols'. Fixes a memory leak.
1209
1210 * src/output.c (token_definitions_output): New.
1211 (output_parser, header_output): Use it.
1212 * src/reader.c (symbols_save): Remove.
1213
12142001-12-29 Akim Demaille <akim@epita.fr>
1215
1216 * src/bison.simple: Do not provide a default for YYSTYPE and
1217 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1218 default.
1219
12202001-12-29 Akim Demaille <akim@epita.fr>
1221
1222 Mid-rule actions are simply... ignored!
1223
1224 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1225 the empty-rule associated to the dummy symbol, not to the host
1226 rule.
1227 * tests/actions.at (Mid-rule actions): New.
1228
12292001-12-29 Akim Demaille <akim@epita.fr>
1230
1231 Memory leak.
1232
1233 * src/reader.c (reader): Free grammar.
1234
12352001-12-29 Akim Demaille <akim@epita.fr>
1236
1237 Memory leak.
1238
1239 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1240 since it allocates it for each state, although only one is needed.
1241 (allocate_storage): Do it here.
1242
12432001-12-29 Akim Demaille <akim@epita.fr>
1244
1245 * src/options.h, src/options.c (create_long_option_table): Rename
1246 as...
1247 (long_option_table_new): this, with a clearer prototype.
1248 (percent_table): Remove, unused,
1249 * src/getargs.c (getargs): Adjust.
1250
12512001-12-29 Akim Demaille <akim@epita.fr>
1252
1253 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1254 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1255 as states.
1256
12572001-12-29 Akim Demaille <akim@epita.fr>
1258
1259 * src/lalr.c (build_relations): Rename `states' as `states1'.
1260 Sorry, I don't understand exactly what it is, no better name...
1261
12622001-12-29 Akim Demaille <akim@epita.fr>
1263
1264 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1265 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1266 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1267 as rules.
1268
12692001-12-29 Akim Demaille <akim@epita.fr>
1270
1271 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1272 ago.
1273
12742001-12-29 Akim Demaille <akim@epita.fr>
1275
1276 * src/reader.c, src/reader.h (user_toknums): Remove.
1277 Adjust all users to use symbols[i]->user_token_number.
1278
12792001-12-29 Akim Demaille <akim@epita.fr>
1280
1281 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1282 Adjust all users to use symbols[i]->prec or ->assoc.
1283
12842001-12-29 Akim Demaille <akim@epita.fr>
1285
1286 * src/reader.c, src/reader.h (tags): Remove.
1287 Adjust all users to use symbols[i]->tag.
1288
12892001-12-29 Akim Demaille <akim@epita.fr>
1290
1291 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1292 and rule_table.
1293 * src/reader.c (packsymbols): Fill this table.
1294 Drop sprec.
1295 * src/conflicts.c (resolve_sr_conflict): Adjust.
1296 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1297 single table.
1298 Use symbols[i]->tag instead of tags[i].
1299
13002001-12-29 Akim Demaille <akim@epita.fr>
1301
1302 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1303 In addition, put a comment in there, to replace...
1304 * tests/regression.at (%union and C comments): Remove.
1305
13062001-12-29 Akim Demaille <akim@epita.fr>
1307
1308 * tests/regression.at (Web2c Actions): Blindly move the actual
1309 output as expected output. The contents *seem* right to me, but I
1310 can't pretend reading perfectly parser tables... Nonetheless, all
1311 the other tests pass correctly, the table look OK, even though the
1312 presence of `$axiom' is to be noted: AFAICS it is useless (but
1313 harmless).
1314
13152001-12-29 Akim Demaille <akim@epita.fr>
1316
1317 * src/reader.c (readgram): Don't add the rule 0 if there were no
1318 rules read. In other words, add it _after_ having performed
1319 grammar sanity checks.
1320 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1321
13222001-12-29 Akim Demaille <akim@epita.fr>
1323
1324 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1325 visible, and some states have now a different number.
1326
13272001-12-29 Akim Demaille <akim@epita.fr>
1328
1329 * src/reader.c (readgram): Bind the initial rule's lineno to that
1330 of the first rule.
1331 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1332 (Solved SR Conflicts): Adjust rule 0's line number.
1333
13342001-12-29 Akim Demaille <akim@epita.fr>
1335
1336 Fix the `GAWK Grammar' failure.
1337
1338 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1339 the reductions of the first state which was mistakenly confused
1340 with the final state because precisely final_state was initialized
1341 to 0.
1342 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1343 now noticed by Bison.
1344 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1345 have a reduction on $default.
1346
13472001-12-29 Akim Demaille <akim@epita.fr>
1348
1349 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1350 rule line numbers.
1351 * src/closure.c (print_closure): Likewise.
1352 * src/derives.c (print_derives): Likewise.
1353 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1354 now.
1355
13562001-12-29 Akim Demaille <akim@epita.fr>
1357
1358 * src/lalr.c (lookaheads_print): New.
1359 (lalr): Call it when --trace-flag.
1360 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1361 are dumped.
1362
13632001-12-29 Akim Demaille <akim@epita.fr>
1364
1365 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1366 when walking through ritem, even via rule->rhs.
1367 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1368 (useful_production, useless_nonterminals): Likewise.
1369 (reduce_grammar_tables): Likewise, plus update nritems.
1370 * src/nullable.c (set_nullable): Likewise.
1371 * src/lalr.c (build_relations): Likewise.
1372 * tests/sets.at (Nullable): Adjust.
1373 Fortunately, now, the $axiom is no longer nullable.
1374
13752001-12-29 Akim Demaille <akim@epita.fr>
1376
1377 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1378 the 0-sentinel.
1379 * src/gram.c (ritem_longest_rhs): Likewise.
1380 * src/reduce.c (nonterminals_reduce): Likewise.
1381 * src/print_graph.c (print_graph): Likewise.
1382 * src/output.c (output_rule_data): Likewise.
1383 * src/nullable.c (set_nullable): Likewise.
1384
13852001-12-29 Akim Demaille <akim@epita.fr>
1386
1387 * src/output.c: Comment changes.
1388
13892001-12-27 Paul Eggert <eggert@twinsun.com>
1390
1391 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1392 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1393 Sparc, as they were causing more porting problems than the
1394 (minor) performance improvement was worth.
1395
1396 Also, catch up with 1.31's YYSTD.
1397
13982001-12-27 Akim Demaille <akim@epita.fr>
1399
1400 * src/output.c (output_gram): Rely on nritems, not the
1401 0-sentinel. See below.
1402 Use -1 as separator, not 0.
1403 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1404 Rely on -1 as separator in yyrhs, instead of 0.
1405 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1406 twice `Now at end of input', therefore there are two lines less to
1407 expect.
1408
14092001-12-27 Akim Demaille <akim@epita.fr>
1410
1411 * tests/regression.at (Unresolved SR Conflicts):
1412 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1413 below.
1414
14152001-12-27 Akim Demaille <akim@epita.fr>
1416
1417 * src/LR0.c (new_state): Recognize the final state by the fact it
1418 is reached by eoftoken.
1419 (insert_start_shifting_state, insert_eof_shifting_state)
1420 (insert_accepting_state, augment_automaton): Remove, since now
1421 these states are automatically computed from the initial state.
1422 (generate_states): Adjust.
1423 * src/print.c: When reporting a rule number to the user, substract
1424 1, so that the axiom rule is rule 0, and the first user rule is 1.
1425 * src/reduce.c: Likewise.
1426 * src/print_graph.c (print_core): For the time being, just as for
1427 the report, depend upon --trace-flags to dump the full set of
1428 items.
1429 * src/reader.c (readgram): Once the grammar read, insert the rule
1430 0: `$axiom: START-SYMBOL $'.
1431 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1432 number of the states has changed (the final state is no longer
1433 necessarily the last), catch up.
1434
14352001-12-27 Akim Demaille <akim@epita.fr>
1436
1437 Try to make the use of the eoftoken valid. Given that its value
1438 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1439 is used instead of > 0 where appropriate, (ii), depend upon nritems
1440 instead of the 0-sentinel.
1441
1442 * src/gram.h, src/gram.c (nritems): New.
1443 Expected to be duplication of nitems, but for the time being...
1444 * src/reader.c (packgram): Assert nritems and nitems are equal.
1445 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1446 * src/closure.c (print_closure, print_fderives): Likewise.
1447 * src/gram.c (ritem_print): Likewise.
1448 * src/print.c (print_core, print_grammar): Likewise.
1449 * src/print_graph.c: Likewise.
1450
14512001-12-27 Akim Demaille <akim@epita.fr>
1452
1453 * src/main.c (main): If there are complains after grammar
1454 reductions, then output the report anyway if requested, then die.
1455 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1456 * src/reader.c (eoftoken): New.
1457 (parse_token_decl): If the token being defined has value `0', it
1458 is the eoftoken.
1459 (packsymbols): No longer hack `tags' to insert `$' by hand.
1460 Be sure to preserve the value of the eoftoken.
1461 (reader): Make sure eoftoken is defined.
1462 Initialize nsyms to 0: now eoftoken is created just like the others.
1463 * src/print.c (print_grammar): Don't special case the eof token.
1464 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1465 lie anyway, albeit pleasant.
1466 * tests/calc.at: Exercise error messages with eoftoken.
1467 Change the grammar so that empty input is invalid.
1468 Adjust expectations.
1469 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1470
14712001-12-27 Akim Demaille <akim@epita.fr>
1472
1473 * configure.in: Check the protos of strchr ans strspn.
1474 Replace strchr if needed.
1475 * src/system.h: Provide the protos of strchr, strspn and memchr if
1476 missing.
1477 * lib/strchr.c: New.
1478 * src/reader.c (symbols_save): Use strchr.
1479
14802001-12-27 Akim Demaille <akim@epita.fr>
1481
1482 * src/print.c, src/print_graph.c (escape): New.
1483 Use it to quote the TAGS outputs.
1484 * src/print_graph.c (print_state): Now errors are in red, and
1485 reductions in green.
1486 Prefer high to wide: output the state number on a line of its own.
1487
14882001-12-27 Akim Demaille <akim@epita.fr>
1489
1490 * src/state.h, src/state.c (reductions_new): New.
1491 * src/LR0.c (set_state_table): Let all the states have a
1492 `reductions', even if reduced to 0.
1493 (save_reductions): Adjust.
1494 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1495 * src/print.c (print_reductions, print_actions): Adjust.
1496 * src/output.c (action_row): Adjust.
1497
14982001-12-27 Akim Demaille <akim@epita.fr>
1499
1500 * src/state.h, src/state.c (errs_new, errs_dup): New.
1501 * src/LR0.c (set_state_table): Let all the states have an errs,
1502 even if reduced to 0.
1503 * src/print.c (print_errs, print_reductions): Adjust.
1504 * src/output.c (output_actions, action_row): Adjust.
1505 * src/conflicts.c (resolve_sr_conflict): Adjust.
1506
15072001-12-27 Akim Demaille <akim@epita.fr>
1508
1509 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1510
15112001-12-27 Akim Demaille <akim@epita.fr>
1512
1513 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1514 * src/print.c: here.
1515 (lookaheadset, shiftset): New, used as additional storage by
1516 print_reductions.
1517 (print_results): Adjust.
1518 (print_shifts, print_gotos, print_errs): New, extracted from...
1519 (print_actions): here.
1520 * src/print_graph.c (print_actions): Remove dead code.
1521
15222001-12-27 Akim Demaille <akim@epita.fr>
1523
1524 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1525 `$n' and `@n'.
1526
15272001-12-27 Akim Demaille <akim@epita.fr>
1528
1529 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1530 (build_relations): Adjust.
1531
15322001-12-27 Akim Demaille <akim@epita.fr>
1533
1534 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1535 duplication.
1536
15372001-12-27 Akim Demaille <akim@epita.fr>
1538
1539 * src/reader.c (packgram): Catch nitems overflows.
1540
15412001-12-27 Akim Demaille <akim@epita.fr>
1542
1543 * src/files.c, src/files.h (guard_obstack): Remove.
1544 * src/output.c (output): Adjust.
1545 * src/reader.c (parse_braces): New, factoring...
1546 (copy_action, copy_guard): these two which are renamed as...
1547 (parse_action, parse_guard): these.
1548 As a voluntary consequence, using braces around guards is now
1549 mandatory.
1550
15512001-12-27 Akim Demaille <akim@epita.fr>
1552
1553 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1554 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1555 members.
1556 (symbol_list_new): Adjust.
1557 (copy_action): action_line is the first line, not the last.
1558 (copy_guard): Just as for actions, store the `action' only, not
1559 the switch/case/break flesh.
1560 Don't parse the user action that might follow the guard, let...
1561 (readgram): do it, i.e., now, there can be an action after a
1562 guard.
1563 In other words the guard is just explicitly optional.
1564 (packgram): Adjust.
1565 * src/output.c (guards_output): New.
1566 (output_parser): Call it when needed.
1567 (output): Also free the guard and attrs obstacks.
1568 * src/files.c, src/files.h (obstack_save): Remove.
1569 (output_files): Remove.
1570 As a result, if one needs the former `.act' file, using an
1571 appropriate skeleton which requires actions and guards is now
1572 required.
1573 * src/main.c (main): Adjust.
1574 * tests/semantic.at: New.
1575 * tests/regression.at: Use `input.y' as input file name.
1576 Avoid 8+3 problems by requiring input.c when the test needs the
1577 parser.
1578
15792001-12-27 Akim Demaille <akim@epita.fr>
1580
1581 * src/reader.c (symbol_list_new): Be sure to initialize all the
1582 fields.
1583
15842001-12-27 Akim Demaille <akim@epita.fr>
1585
1586 All the hacks using a final pseudo state are now useless.
1587
1588 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1589 * src/lalr.c (nLA): New.
1590 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1591 instead of lookaheadsp from the pseudo state (nstate + 1).
1592
15932001-12-27 Akim Demaille <akim@epita.fr>
1594
1595 * src/output.c (action_row, token_actions): Use a state_t instead
1596 of a integer, and nlookaheads instead of the following state's
1597 lookaheadsp.
1598
15992001-12-27 Akim Demaille <akim@epita.fr>
1600
1601 * src/conflicts.c (log_resolution, flush_shift)
1602 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1603 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1604 (conflicts_print, print_reductions): Use a state_t instead of an
1605 integer when referring to a state.
1606 As much as possible, depend upon nlookaheads, instead of the
1607 `lookaheadsp' member of the following state (since lookaheads of
1608 successive states are successive, the difference between state n + 1
1609 and n served as the number of lookaheads for state n).
1610 * src/lalr.c (add_lookback_edge): Likewise.
1611 * src/print.c (print_core, print_actions, print_state)
1612 (print_results): Likewise.
1613 * src/print_graph.c (print_core, print_actions, print_state)
1614 (print_graph): Likewise.
1615 * src/conflicts.h: Adjust.
1616
16172001-12-27 Akim Demaille <akim@epita.fr>
1618
1619 * src/bison.hairy: Formatting/comment changes.
1620 ANSIfy.
1621 Remove `register' indications.
1622 Add plenty of `static'.
1623
16242001-12-27 Akim Demaille <akim@epita.fr>
1625
1626 * src/output.c (prepare): Drop the muscle `ntbase' which
1627 duplicates ntokens.
1628 * src/bison.simple: Formatting/comment changes.
1629 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
1630 is an undocumented synonym.
1631
16322001-12-22 Akim Demaille <akim@epita.fr>
1633
1634 * src/output.c (output_table_data): Change the prototype to use
1635 `int' for array ranges: some invocations do pass an int, not a
1636 short.
1637 Reported by Wayne Green.
1638
16392001-12-22 Akim Demaille <akim@epita.fr>
1640
1641 Some actions of web2c.y are improperly triggered.
1642 Reported by Mike Castle.
1643
1644 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
1645 * tests/regression.at (Web2c): Rename as...
1646 (Web2c Report): this.
1647 (Web2c Actions): New.
1648
16492001-12-22 Akim Demaille <akim@epita.fr>
1650
1651 Reductions in web2c.y are improperly reported.
1652 Reported by Mike Castle.
1653
1654 * src/conflicts.c (print_reductions): Fix.
1655 * tests/regression.at (Web2c): New.
1656
16572001-12-18 Akim Demaille <akim@epita.fr>
1658
1659 Some host fail on `assert (!"foo")', which expands to
1660 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
1661 Reported by Nelson Beebee.
1662
1663 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
1664 `#define it_succeeded 0' and `assert (it_succeeded)'.
1665
16662001-12-17 Marc Autret <autret_m@epita.fr>
1667
1668 * src/bison.simple: Don't hard code the skeleton line and filename.
1669 * src/output.c (output_parser): Rename 'line' as 'output_line'.
1670 New line counter 'skeleton_line' (skeleton-line muscle).
1671
16722001-12-17 Paul Eggert <eggert@twinsun.com>
1673
1674 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
1675 YYDEBUG must be defined to a nonzero value.
1676
1677 * src/bison.simple (yytname): Do not assume that the user defines
1678 YYDEBUG to a properly parenthesized expression.
1679
16802001-12-17 Akim Demaille <akim@epita.fr>
1681
1682 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
1683 nlookaheads is a new member.
1684 Adjust all users.
1685 * src/lalr.h (nlookaheads): Remove this orphan declaration.
1686 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
1687 state.
1688
16892001-12-17 Akim Demaille <akim@epita.fr>
1690
1691 * src/files.h, src/files.c (open_files, close_files): Remove.
1692 * src/main.c (main): Don't open/close files, nor invoke lex_free,
1693 let...
1694 * src/reader.c (reader): Do it.
1695
16962001-12-17 Akim Demaille <akim@epita.fr>
1697
1698 * src/conflicts.c (print_reductions): Formatting changes.
1699
17002001-12-17 Akim Demaille <akim@epita.fr>
1701
1702 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
1703 (flush_reduce): New.
1704 (resolve_sr_conflict): Adjust.
1705
17062001-12-17 Akim Demaille <akim@epita.fr>
1707
1708 * src/output.c (output_obstack): Be static and rename as...
1709 (format_obstack): this, to avoid any confusion with files.c's
1710 output_obstack.
1711 * src/reader.h (muscle_obstack): Move to...
1712 * src/output.h: here, since it's defined in output.c.
1713
17142001-12-17 Akim Demaille <akim@epita.fr>
1715
1716 * src/output.c (action_row, save_column, default_goto)
1717 (sort_actions, matching_state, pack_vector): Better variable
1718 locality.
1719
17202001-12-17 Akim Demaille <akim@epita.fr>
1721
1722 * src/output.c: Various formatting changes.
1723
17242001-12-17 Akim Demaille <akim@epita.fr>
1725
1726 * src/files.c (output_files): Free the output_obstack.
1727 * src/main.c (main): Call print and print_graph conditionally.
1728 * src/print.c (print): Work unconditionally.
1729 * src/print_graph.c (print_graph): Work unconditionally.
1730 * src/conflicts.c (log_resolution): Output only if verbose_flag.
1731
17322001-12-16 Marc Autret <autret_m@epita.fr>
1733
1734 * src/output.c (actions_output): Fix. When we use %no-lines,
1735 there is one less line per action.
1736
17372001-12-16 Marc Autret <autret_m@epita.fr>
1738
1739 * src/bison.simple: Remove a useless #line directive.
1740 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
1741 * src/output.c (get_lines_number): New.
1742 (output_parser): Adjust, now takes care about the lines of a
1743 output muscles.
1744 Fix line numbering.
1745 (actions_output): Computes the number of lines taken by actions.
1746 (output_master_parser): Insert new skeleton which is the name of
1747 the output parser file name.
1748
17492001-12-15 Marc Autret <autret_m@epita.fr>
1750
1751 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
1752
17532001-12-15 Marc Autret <autret_m@epita.fr>
1754
1755 * src/output.c (output_gram): Keep track of the hairy one.
1756
17572001-12-15 Akim Demaille <akim@epita.fr>
1758
1759 Make `make distcheck' work.
1760
1761 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
1762 system.h which uses libgettext.h.
1763
17642001-12-15 Akim Demaille <akim@epita.fr>
1765
1766 * src/nullable.c (set_nullable): Useless rules must be skipped,
1767 otherwise, since we range over their symbols, we might look at a
1768 nonterminal which no longer ``exists'', i.e., it is not counted in
1769 `nvars', hence we overflow our arrays.
1770
17712001-12-15 Akim Demaille <akim@epita.fr>
1772
1773 The header can also be produced directly, without any obstack!
1774 Yahoo!
1775
1776 * src/files.c, src/files.h (defines_obstack): Remove.
1777 (compute_header_macro): Global.
1778 (defines_obstack_save): Remove.
1779 * src/reader.c (parse_union_decl): No longer output to
1780 defines_obstack: its content can be found in the `stype' muscle
1781 anyway.
1782 (output_token_translations): Merge into...
1783 (symbols_output): this.
1784 Rename as...
1785 (symbols_save): this.
1786 (reader): Adjust.
1787 * src/output.c (header_output): New.
1788 (output): Call it.
1789
17902001-12-15 Akim Demaille <akim@epita.fr>
1791
1792 * src/reader.c (parse_union_decl): Instead of handling two obstack
1793 simultaneously, use one to define the `stype' muscle, and use the
1794 value of the latter to fill defines_obstack.
1795 (copy_comment): Remove.
1796 (copy_comment2): Work for a single obstack.
1797 Rename as...
1798 (copy_comment): this.
1799
18002001-12-15 Akim Demaille <akim@epita.fr>
1801
1802 * src/lex.c, src/lex.h (xgetc): No longer static.
1803 * src/reader.c (parse_union_decl): Revamp.
1804
18052001-12-15 Akim Demaille <akim@epita.fr>
1806
1807 Still making progress in separating Bison into (i) input, (ii)
1808 process, (iii) output: now we can directly output the parser file
1809 without using table_obstack at all.
1810
1811 * src/files.c, src/files.h (table_obstack): Bye bye.
1812 (parser_file_name): New.
1813 * src/files.c (compute_output_file_names): Compute it.
1814 * src/output.c (actions_output, output_parser)
1815 (output_master_parser): To a file instead of an obstack.
1816
18172001-12-15 Akim Demaille <akim@epita.fr>
1818
1819 Attach actions to rules, instead of pre-outputting them to
1820 actions_obstack.
1821
1822 * src/gram.h (rule_t): action and action_line are new members.
1823 * src/reader.c (symbol_list): Likewise.
1824 (copy_action): Save the actions within the rule.
1825 (packgram): Save them in rule_table.
1826 * src/output.c (actions_output): New.
1827 (output_parser): Use it on `%%actions'.
1828 (output_rule_data): Don't free rule_table.
1829 (output): Do it.
1830 (prepare): Don't save the `action' muscle.
1831 * src/bison.simple: s/%%action/%%actions/.
1832
18332001-12-15 Akim Demaille <akim@epita.fr>
1834
1835 * src/reader.c (copy_action): When --yacc, don't append a `;'
1836 to the user action: let it fail if lacking.
1837 Suggested by Arnold Robbins and Tom Tromey.
1838
18392001-12-14 Akim Demaille <akim@epita.fr>
1840
1841 * src/lex.c (literalchar): Simply return the char you decoded, non
1842 longer mess around with obstacks and int pointers.
1843 Adjust all callers.
1844
18452001-12-14 Akim Demaille <akim@epita.fr>
1846
1847 * src/lex.c (literalchar): Don't escape the special characters,
1848 just decode them, and keep them as char (before, eol was output as
1849 the 2 char string `\n' etc.).
1850 * src/output.c (output_rule_data): Use quotearg to output the
1851 token strings.
1852
18532001-12-13 Paul Eggert <eggert@twinsun.com>
1854
1855 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
1856 Do not infringe on the global user namespace when using C++.
1857 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
1858 All uses of `fprintf' and `stderr' changed.
1859
1860 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
1861
18622001-12-13 Akim Demaille <akim@epita.fr>
1863
1864 The computation of nullable is broken: it doesn't handle empty
1865 RHS's properly.
1866
1867 * tests/torture.at (GNU AWK Grammar): New.
1868 * tests/sets.at (Nullable): New.
1869 * src/nullable.c (set_nullable): Instead of blindly looping over
1870 `ritems', loop over the rules, and then over their rhs's.
1871
1872 Work around Autotest bugs.
1873
1874 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
1875 frame, because Autotest understand lines starting with a `+' as
1876 traces from the shell. Then, they are not processed properly.
1877 Admittedly an Autotest bug, but we don't have time to wait for
1878 Autotest to catch up.
1879 * tests/regression.at (Broken Closure): Adjust to the new table
1880 frames.
1881 Move to...
1882 * tests/sets.at: here.
1883
18842001-12-13 Akim Demaille <akim@epita.fr>
1885
1886 * src/closure.c (closure): Use nrules instead of playing tricks
1887 with BITS_PER_WORD.
1888
18892001-12-13 Akim Demaille <akim@epita.fr>
1890
1891 * src/print.c (print_actions): Output the handling of `$' as the
1892 traces do: shifting the token EOF. Before EOF was treated as a
1893 nonterminal.
1894 * tests/regression.at: Adjust some tests.
1895 * src/print_graph.c (print_core): Complete the set of items via
1896 closure. The next-to-final and final states are still unsatisfying,
1897 but that's to be addressed elsewhere.
1898 No longer output the rule numbers, but do output the state number.
1899 A single loop for the shifts + gotos is enough, but picked a
1900 distinct color for each.
1901 (print_graph): Initialize and finalize closure.
1902
19032001-12-13 Akim Demaille <akim@epita.fr>
1904
1905 * src/reader.c (readgram): Remove dead code, an strip useless
1906 braces.
1907 (get_type): Remove, unused.
1908
19092001-12-12 Akim Demaille <akim@epita.fr>
1910
1911 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
1912 on that of lib/error.c.
1913
19142001-12-12 Akim Demaille <akim@epita.fr>
1915
1916 Some hosts don't like `/' in includes.
1917
1918 * src/system.h: Include libgettext.h without qualifying the path.
1919 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
1920 $(top_srcdir).
1921
19222001-12-11 Marc Autret <autret_m@epita.fr>
1923
1924 * src/output.c (output_parser): Remove useless muscle.
1925
19262001-12-11 Marc Autret <autret_m@epita.fr>
1927
1928 * src/bison.simple: Remove #line just before %%epilogue. It
1929 is now handled in ...
1930 * src/reader.c (read_additionnal_code): Add the output of a
1931 #line for the epilogue.
1932
19332001-12-10 Marc Autret <autret_m@epita.fr>
1934
1935 * src/reader.c (copy_definition): Re-use CPP-outed code which
1936 replace precedent remove.
1937 * src/bison.simple: Remove #line before %%prologue because
1938 %%input-line is wrong at this time.
1939
19402001-12-10 Marc Autret <autret_m@epita.fr>
1941
1942 * src/reader.c (symbols_output): Clean up.
1943 * src/output.c (output_gram, output): Clean up.
1944
19452001-12-10 Akim Demaille <akim@epita.fr>
1946
1947 * src/lalr.c (initialize_lookaheads): New. Extracted from...
1948 * src/LR0.c (set_state_table): here.
1949 * src/lalr.c (lalr): Call it.
1950
19512001-12-10 Akim Demaille <akim@epita.fr>
1952
1953 * src/state.h (shifts): Remove the `number' member: shifts are
1954 attached to state, hence no longer need to be labelled with a
1955 state number.
1956
19572001-12-10 Akim Demaille <akim@epita.fr>
1958
1959 Now that states have a complete set of members, the linked list of
1960 shifts is useless: just fill directly the state's shifts member.
1961
1962 * src/state.h (shifts): Remove the `next' member.
1963 * src/LR0.c (first_state, last_state): Remove.
1964 Adjust the callers.
1965 (augment_automaton): Don't look for the shifts that must be added
1966 a shift on EOF: it is those of the state we looked for! But now,
1967 since shifts are attached, it is no longer needed to looking
1968 merely by its id: its number.
1969
19702001-12-10 Akim Demaille <akim@epita.fr>
1971
1972 * src/LR0.c (augment_automaton): Better variable locality.
1973 Remove an impossible branch: if there is a state corresponding to
1974 the start symbol being shifted, then there is shift for the start
1975 symbol from the initial state.
1976
19772001-12-10 Akim Demaille <akim@epita.fr>
1978
1979 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
1980 only when appropriate: when insert_start_shifting_state' is not
1981 invoked.
1982 * tests/regression.at (Rule Line Numbers): Adjust.
1983
19842001-12-10 Akim Demaille <akim@epita.fr>
1985
1986 * src/LR0.c (augment_automaton): Now that all states have shifts,
1987 merge the two cases addition shifts to the initial state.
1988
19892001-12-10 Akim Demaille <akim@epita.fr>
1990
1991 * src/lalr.c (set_state_table): Move to...
1992 * src/LR0.c: here.
1993 * src/lalr.c (lalr): Don't call it...
1994 * src/LR0.c (generate_states): do it.
1995 * src/LR0.h (first_state): Remove, only the table is used.
1996
19972001-12-10 Akim Demaille <akim@epita.fr>
1998
1999 * src/LR0.h (first_shift, first_reduction): Remove.
2000 * src/lalr.c: Don't use first_shift: find shifts through the
2001 states.
2002
20032001-12-10 Akim Demaille <akim@epita.fr>
2004
2005 * src/LR0.c: Attach shifts to states as soon as they are
2006 computed.
2007 * src/lalr.c (set_state_table): Instead of assigning shifts to
2008 state, just assert that the mapping was properly done.
2009
20102001-12-10 Akim Demaille <akim@epita.fr>
2011
2012 * src/LR0.c (insert_start_shift): Rename as...
2013 (insert_start_shifting_state): this.
2014 (insert_eof_shifting_state, insert_accepting_state): New.
2015 (augment_automaton): Adjust.
2016 Better locality of the variables.
2017 When looking if the start_symbol is shifted from the initial
2018 state, using `while (... symbol != start_symbol ...)' sounds
2019 better than `while (... symbol < start_symbol ...)': If fail
2020 to see how the order between symbols could be relevant!
2021
20222001-12-10 Akim Demaille <akim@epita.fr>
2023
2024 * src/getargs.h: Don't declare `spec_name_prefix' and
2025 `spec_file_prefix', declared by src/files.h.
2026 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2027 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2028 * src/output.c (prepare): Adjust.
2029 * src/reader.c (symbols_output): Likewise.
2030 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2031
20322001-12-10 Akim Demaille <akim@epita.fr>
2033
2034 * src/muscle_tab.c (muscle_init): NULL is a better default than
2035 `"0"'.
2036
20372001-12-10 Akim Demaille <akim@epita.fr>
2038
2039 * src/reader.c (reader): Calling symbols_output once is enough.
2040
20412001-12-10 Akim Demaille <akim@epita.fr>
2042
2043 Now that states have a complete set of members, the linked list of
2044 reductions is useless: just fill directly the state's reductions
2045 member.
2046
2047 * src/state.h (struct reductions): Remove member `number' and
2048 `next'.
2049 * src/LR0.c (first_reduction, last_reduction): Remove.
2050 (save_reductions): Don't link the new reductions, store them in
2051 this_state.
2052 * src/lalr.c (set_state_table): No need to attach reductions to
2053 states, it's already done.
2054 * src/output.c (output_actions): No longer free the shifts, then
2055 the reductions, then the states: free all the states and their
2056 members.
2057
20582001-12-10 Akim Demaille <akim@epita.fr>
2059
2060 * src/options.c (OPTN, DRTV, BOTH): New.
2061 (option_table): Use them.
2062
2063 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2064 the job of system.h.
2065 * src/options.c: Don't include stdio.h and xalloc.h for the same
2066 reasons.
2067
20682001-12-10 Akim Demaille <akim@epita.fr>
2069
2070 * src/output.c (output, prepare): Make sure the values of the
2071 muscles `action' and `prologue' are 0-terminated.
2072
20732001-12-10 Akim Demaille <akim@epita.fr>
2074
2075 Clean up GCC warnings.
2076
2077 * src/reader.c (copy_action): `buf' is not used.
2078 (parse_skel_decl): Be static.
2079 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2080 * src/options.h (create_long_option_table): Have a real prototype.
2081 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2082 (hash_delete_at): Return const void *.
2083 Adjust casts to preserve the const.
2084
20852001-12-10 Akim Demaille <akim@epita.fr>
2086
2087 * configure.in: Require 2.52g.
2088 M4 is not needed, but AUTOM4TE is.
2089 * m4/m4.m4: Remove.
2090 * tests/Makefile.am: Adjust.
2091
20922001-12-10 Akim Demaille <akim@epita.fr>
2093
2094 One structure for states is enough, even though theoretically
2095 there are LR(0) states and LALR(1) states.
2096
2097 * src/lalr.h (state_t): Remove.
2098 (state_table): Be state_t **, not state_t *.
2099 * src/state.h (core, CORE_ALLOC): Rename as...
2100 (state_t, STATE_ALLOC): this.
2101 Add the LALR(1) members: shifts, reductions, errs.
2102 * src/LR0.c (state_table): Rename as...
2103 (state_hash): this, to avoid name clashes with the global
2104 `state_table'.
2105 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2106 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2107
21082001-12-10 Akim Demaille <akim@epita.fr>
2109
2110 Bison dumps core on bash.y.
2111 Reported by Pascal Bart.
2112
2113 * src/warshall.c (bitmatrix_print): New.
2114 (TC): Use it.
2115 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2116 j must be the outer loop.
2117 * tests/regression.at (Broken Closure): New.
2118
21192001-12-05 Akim Demaille <akim@epita.fr>
2120
2121 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2122 its argument.
2123