]> git.saurik.com Git - bison.git/blame - ChangeLog
Remove `%thong' support as it is undocumented, unused, duplicates
[bison.git] / ChangeLog
CommitLineData
8b9f2372
AD
12002-06-10 Akim Demaille <akim@epita.fr>
2
3 Remove `%thong' support as it is undocumented, unused, duplicates
4 `%token's job, and creates useless e-mail traffic with people who
5 want to know what it is, why it is undocumented, unused, and
6 duplicates `%token's job.
7
8 * src/reader.c (parse_thong_decl): Remove.
9 * src/options.c (option_table): Remove "thong".
10 * src/lex.h (tok_thong): Remove.
11
3ae2b51f
AD
122002-06-10 Akim Demaille <akim@epita.fr>
13
14 * src/symtab.c, src/symtab.c (symbol_type_set)
15 (symbol_precedence_set): New.
16 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
17 (value_components_used): Remove, unused.
18
2f1afb73
AD
192002-06-09 Akim Demaille <akim@epita.fr>
20
21 Move symbols handling code out of the reader.
22
23 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
24 (axiom): Move to...
25 * src/symtab.h, src/symtab.c: here.
26
27 * src/gram.c (start_symbol): Remove: use startsymbol->number.
28 * src/reader.c (startval): Rename as...
29 * src/symtab.h, src/symtab.c (startsymbol): this.
30 * src/reader.c: Adjust.
31
32 * src/reader.c (symbol_check_defined, symbol_make_alias)
33 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
34 (token_translations_init)
35 Move to...
36 * src/symtab.c: here.
37 * src/reader.c (packsymbols): Move to...
38 * src/symtab.h, src/symtab.c (symbols_pack): here.
39 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
40 argument.
41
e9bca3ad
AD
422002-06-03 Akim Demaille <akim@epita.fr>
43
44 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
45 then statements.
46
86eff183
AD
472002-06-03 Akim Demaille <akim@epita.fr>
48
49 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
50 structs with non literals.
51 * src/scan-skel.l: never-interactive.
52 * src/conflicts.c (enum conflict_resolution_e): No trailing
53 comma.
54 * src/getargs.c (usage): Split long literal strings.
55 Reported by Hans Aberg.
56
717be197
AD
572002-05-28 Akim Demaille <akim@epita.fr>
58
59 * data/bison.c++: Use C++ ostreams.
60 (cdebug_): New member.
61
670ddffd
AD
622002-05-28 Akim Demaille <akim@epita.fr>
63
64 * src/output.c (output_skeleton): Be sure to allocate enough room
65 for `/' _and_ for `\0' in full_skeleton.
66
769b430f
AD
672002-05-28 Akim Demaille <akim@epita.fr>
68
69 * data/bison.c++: Catch up with bison.simple:
70 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
71 and Paul Eggert <eggert@twinsun.com>: `error' handing.
72 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
73 and popping traces.
74
7067cb36
PH
752002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
76
77 * src/output.c (output_skeleton): Put an explicit path in front of
78 the skeleton file name, rather than relying on the -I directory,
79 to partially alleviate effects of having a skeleton file lying around
80 in the current directory.
769b430f 81
4a713ec2
PH
822002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
83
769b430f 84 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
85 obstack_printf should be obstack_fgrow1.
86
b408954b
AD
872002-05-26 Akim Demaille <akim@epita.fr>
88
89 * src/state.h (state_t): `solved_conflicts' is a new member.
90 * src/LR0.c (new_state): Set it to 0.
91 * src/conflicts.h, src/conflicts.c (print_conflicts)
92 (free_conflicts, solve_conflicts): Rename as...
93 (conflicts_print, conflicts_free, conflicts_solve): these.
94 Adjust callers.
95 * src/conflicts.c (enum conflict_resolution_e)
96 (solved_conflicts_obstack): New, used by...
97 (log_resolution): this.
98 Adjust to attach the conflict resolution to each state.
99 Complete the description with the precedence/associativity
100 information.
101 (resolve_sr_conflict): Adjust.
102 * src/print.c (print_state): Output its solved_conflicts.
103 * tests/conflicts.at (Unresolved SR Conflicts)
104 (Solved SR Conflicts): Exercise --report=all.
105
a49aecd5
AD
1062002-05-26 Akim Demaille <akim@epita.fr>
107
108 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
109 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
110 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
111 (token_number_t, item_number_as_token_number)
112 (token_number_as_item_number, muscle_insert_token_number_table):
113 Rename as...
114 (symbol_number_t, item_number_as_symbol_number)
115 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
116 these, since it is more appropriate.
117
5504898e
AD
1182002-05-26 Akim Demaille <akim@epita.fr>
119
120 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
121 `Error:' lines.
122 * data/bison.simple (yystos) [YYDEBUG]: New.
123 (yyparse) [YYDEBUG]: Display the symbols which are popped during
124 error recovery.
125 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
126
ec3bc396
AD
1272002-05-25 Akim Demaille <akim@epita.fr>
128
129 * doc/bison.texinfo (Debugging): Split into...
130 (Tracing): this new section, its former contents, and...
131 (Understanding): this new section.
132 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
133 by...
134 (report_flag): this.
135 Adjust all dependencies.
136 (report_args, report_types, report_argmatch): New.
137 (usage, getargs): Report/support -r, --report.
138 * src/options.h
139 (struct option_table_struct): Rename as..,
140 (struct option_table_s): this.
141 Rename the `set_flag' member to `flag' to match with getopt_long's
142 struct.
143 * src/options.c (option_table): Split verbose into an entry for
144 %verbose, and another for --verbose.
145 Support --report/-r, so remove -r from the obsolete --raw.
146 * src/print.c: Attach full item sets and lookaheads reports to
147 report_flag instead of trace_flag.
148 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
149
78df8250
PE
1502002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
151 and Paul Eggert <eggert@twinsun.com>
769b430f 152
78df8250
PE
153 * data/bison.simple (yyparse): Correct error handling to conform to
154 POSIX and yacc. Specifically, after syntax error is discovered,
155 do not reduce further before shifting the error token.
156 Clean up the code a bit by removing the labels yyerrdefault,
157 yyerrhandle, yyerrpop.
158 * NEWS: Document the above.
159
c0c9ea05
PH
1602002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
161
162 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
163 type; it isn't always big enough, since it doesn't necessarily
164 include non-terminals.
769b430f 165 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
166 the latter can be removed.
167 (yy_token_number_type): Remove, only one use.
168 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
169 don't use TokenNumberType as element type.
769b430f 170
c0c9ea05
PH
171 * tests/regression.at: Modify expected output to agree with change
172 to yyr1 and yytranslate.
769b430f 173
6390a83f
FK
1742002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
175
176 * src/reader.c (parse_action): Use copy_character instead of
177 obstack_1grow.
178
db7c8e9a
AD
1792002-05-13 Akim Demaille <akim@epita.fr>
180
181 * tests/regression.at (Token definitions): Prototype yylex and
182 yyerror.
183
fcc61800
PH
1842002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
185
158c687b 186 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
187 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
188 32-bit arithmetic.
189 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
190
5683e9b2
AD
1912002-05-07 Akim Demaille <akim@epita.fr>
192
193 * tests/synclines.at: Be sure to prototype yylex and yyerror to
194 avoid GCC warnings.
195
0c2d3f4c
AD
1962002-05-07 Akim Demaille <akim@epita.fr>
197
198 Kill GCC warnings.
199
200 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
201 over the RHS of each rule.
202 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
203 * src/state.h (state_t): Member `nitems' is unsigned short.
204 * src/LR0.c (get_state): Adjust.
205 * src/reader.c (packgram): Likewise.
206 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
207 `Type'.
208 (muscle_insert_int_table): Remove, unused.
209 (prepare_rules): Remove `max'.
210
1565b720
AD
2112002-05-06 Akim Demaille <akim@epita.fr>
212
213 * src/closure.c (print_firsts): Display of the symbol tags.
214 (bitmatrix_print): Move to...
215 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
216 here.
217 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
218
cfaee611
AD
2192002-05-06 Akim Demaille <akim@epita.fr>
220
221 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
222 hash_do_for_each.
223
458be8e0
AD
2242002-05-06 Akim Demaille <akim@epita.fr>
225
226 * src/LR0.c (new_state, get_state): Instead of using the global
227 `kernel_size' and `kernel_base', have two new arguments:
228 `core_size' and `core'.
229 Adjust callers.
230
a900a624
AD
2312002-05-06 Akim Demaille <akim@epita.fr>
232
233 * src/reader.c (packgram): No longer end `ritem' with a 0
234 sentinel: it is not used.
235
d4e7d3a1
AD
2362002-05-05 Akim Demaille <akim@epita.fr>
237
238 New experimental feature: display the lookaheads in the report and
239 graph.
240
241 * src/print (print_core): When --trace-flag, display the rules
242 lookaheads.
243 * src/print_graph.c (print_core): Likewise.
244 Swap the arguments.
245 Adjust caller.
246
39ceb25b
AD
2472002-05-05 Akim Demaille <akim@epita.fr>
248
249 * tests/torture.at (Many lookaheads): New test.
250
5372019f
AD
2512002-05-05 Akim Demaille <akim@epita.fr>
252
253 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
254 (GENERATE_MUSCLE_INSERT_TABLE): this.
255 (output_int_table, output_unsigned_int_table, output_short_table)
256 (output_token_number_table, output_item_number_table): Replace with...
257 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
258 (muscle_insert_short_table, muscle_insert_token_number_table)
259 (muscle_insert_item_number_table): these.
260 Adjust all callers.
261 (prepare_tokens): Don't free `translations', since...
262 * src/reader.h, src/reader.c (grammar_free): do it.
263 Move to...
264 * src/gram.h, src/gram.c (grammar_free): here.
265 * data/bison.simple, data/bison.c++: b4_token_number_max is now
266 b4_translate_max.
267
5df5f6d5
AD
2682002-05-05 Akim Demaille <akim@epita.fr>
269
270 * src/output.c (output_unsigned_int_table): New.
271 (prepare_rules): `i' is unsigned.
272 `prhs', `rline', `r2' are unsigned int.
273 Rename muscle `rhs_number_max' as `rhs_max'.
274 Output muscles `prhs_max', `rline_max', and `r2_max'.
275 Free rline and r1.
276 * data/bison.simple, data/bison.c++: Adjust to use these muscles
277 to compute types instead of constant types.
278 * tests/regression.at (Web2c Actions): Adjust.
279
b87f8b21
AD
2802002-05-04 Akim Demaille <akim@epita.fr>
281
282 * src/symtab.h (SALIAS, SUNDEF): Rename as...
283 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
284 Adjust dependencies.
285 * src/output.c (token_definitions_output): Be sure not to output a
286 `#define 'a'' when fed with `%token 'a' "a"'.
287 * tests/regression.at (Token definitions): New.
288
8bb936e4
PE
2892002-05-03 Paul Eggert <eggert@twinsun.com>
290
291 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
292 for K&R C.
293
2942002-05-03 gettextize <bug-gnu-gettext@gnu.org>
295
296 * Makefile.am (SUBDIRS): Remove intl.
297 (EXTRA_DIST): Add config/config.rpath.
298
53c71a12
AD
2992002-05-03 Akim Demaille <akim@epita.fr>
300
301 * data/bison.simple (m4_if): Don't output empty enums.
302 And actually, output valid enum definitions :(.
303
289dd0cf
AD
3042002-05-03 Akim Demaille <akim@epita.fr>
305
306 * configure.bat: Remove, completely obsolete.
307 * Makefile.am (EXTRA_DIST): Adjust.
308 Don't distribute config.rpath...
309 * config/Makefile.am (EXTRA_DIST): Do it.
310
db85e524
AD
3112002-05-03 Akim Demaille <akim@epita.fr>
312
313 * configure.in (GETTEXT_VERSION): New.
314 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
315
83ccf991
AD
3162002-05-03 Akim Demaille <akim@epita.fr>
317
318 * data/bison.simple (b4_token_enum): New.
319 (b4_token_defines): Use it to output tokens both as #define and
320 enums.
321 Suggested by Paul Eggert.
322 * src/output.c (token_definitions_output): Don't output spurious
323 white spaces.
324
1f418995
AD
3252002-05-03 Akim Demaille <akim@epita.fr>
326
327 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
328
45119f04
RA
3292002-05-02 Robert Anisko <robert@lrde.epita.fr>
330
331 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
332 Update the stack class, give a try to deque as the default container.
333
b2d52318
AD
3342002-05-02 Akim Demaille <akim@epita.fr>
335
336 * data/bison.simple (yyparse): Do not implement @$ = @1.
337 (YYLLOC_DEFAULT): Adjust to do it.
338 * doc/bison.texinfo (Location Default Action): Fix.
339
3a8b4109
AD
3402002-05-02 Akim Demaille <akim@epita.fr>
341
342 * src/reader.c (parse_braces): Merge into...
343 (parse_action): this.
344
84614e13
AD
3452002-05-02 Akim Demaille <akim@epita.fr>
346
347 * configure.in (ALL_LINGUAS): Remove.
348 * po/LINGUAS, hr.po: New.
349
fdbcd8e2
AD
3502002-05-02 Akim Demaille <akim@epita.fr>
351
352 Remove the so called hairy (semantic) parsers.
353
354 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
355 * src/gram.h, src/gram.c (semantic_parser): Remove.
356 (rule_t): Remove the guard and guard_line members.
357 * src/lex.h (token_t): remove tok_guard.
358 * src/options.c (option_table): Remove %guard and %semantic_parser
359 support.
360 * src/output.c, src/output.h (guards_output): Remove.
361 (prepare): Adjust.
362 (token_definitions_output): Don't output the `T'
363 tokens (???).
364 (output_skeleton): Don't output the guards.
365 * src/files.c, src/files.c (attrsfile): Remove.
366 * src/reader.c (symbol_list): Remove the guard and guard_line
367 members.
368 Adjust dependencies.
369 (parse_guard): Remove.
370 * data/bison.hairy: Remove.
371 * doc/bison.texinfo (Environment Variables): Remove occurrences of
372 BISON_HAIRY.
373
82b6cb3f
AD
3742002-05-02 Akim Demaille <akim@epita.fr>
375
376 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
377 (parse_guard): Rename the formal argument `stack_offset' as
378 `rule_length', which is more readable.
379 Adjust callers.
380 (copy_at, copy_dollar): Instead of outputting the hard coded
381 values of $$, $n and so forth, output invocation to b4_lhs_value,
382 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
383 Note: this patch partially drops `semantic-parser' support: it
384 always does `rule_length - n', where semantic parsers ought to
385 always use `-n'.
82b6cb3f
AD
386 * data/bison.simple, data/bison.c++ (b4_lhs_value)
387 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
388
6cbfbcc5
AD
3892002-05-02 Akim Demaille <akim@epita.fr>
390
391 * configure.in (AC_INIT): Bump to 1.49b.
392 (AM_INIT_AUTOMAKE): Short invocation.
393
b8548114
AD
3942002-05-02 Akim Demaille <akim@epita.fr>
395
396 Version 1.49a.
397
c20cd1fa
AD
3982002-05-01 Akim Demaille <akim@epita.fr>
399
400 * src/skeleton.h: Remove.
401
8a9566d4
AD
4022002-05-01 Akim Demaille <akim@epita.fr>
403
404 * src/skeleton.h: Fix the #endif.
405 Reported by Magnus Fromreide.
406
8c6d399a
PE
4072002-04-26 Paul Eggert <eggert@twinsun.com>
408
409 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
410 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 411 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 412
2b7ed18a
RA
4132002-04-25 Robert Anisko <robert@lrde.epita.fr>
414
415 * src/scan-skel.l: Postprocess quadrigraphs.
416
417 * src/reader.c (copy_character): New function, used to output
418 single characters while replacing `[' and `]' with quadrigraphs, to
419 avoid troubles with M4 quotes.
420 (copy_comment): Output characters with copy_character.
421 (read_additionnal_code): Likewise.
422 (copy_string2): Likewise.
423 (copy_definition): Likewise.
424
425 * tests/calc.at: Exercise M4 quoting.
426
34a89c50
AD
4272002-04-25 Akim Demaille <akim@epita.fr>
428
429 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
430 between `!' and the command.
431 Reported by Paul Eggert.
432
0dd1580a
RA
4332002-04-24 Robert Anisko <robert@lrde.epita.fr>
434
435 * tests/calc.at: Exercise prologue splitting.
436
437 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
438 `b4_post_prologue' instead of `b4_prologue'.
439
440 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
441 muscles.
442 (output): Free pre_prologue_obstack and post_prologue_obstack.
443 * src/files.h, src/files.c (attrs_obstack): Remove.
444 (pre_prologue_obstack, post_prologue_obstack): New.
445 * src/reader.c (copy_definition): Add a parameter to specify the
446 obstack to fill, instead of using attrs_obstack unconditionally.
447 (read_declarations): Pass pre_prologue_obstack to copy_definition if
448 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
449
83c1796f
PE
4502002-04-23 Paul Eggert <eggert@twinsun.com>
451
452 * data/bison.simple: Remove unnecessary commentary and white
453 space differences from 1_29-branch.
454 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
455
456 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
457 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
458 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
459 constructors or destructors.
460
461 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
462
1207eeac
AD
4632002-04-23 Akim Demaille <akim@epita.fr>
464
465 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
466 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
467 location with columns.
468 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
469 All reported by Paul Eggert.
470
78ab8f67
AD
4712002-04-22 Akim Demaille <akim@epita.fr>
472
473 * src/reduce.c (dump_grammar): Move to...
474 * src/gram.h, src/gram.c (grammar_dump): here.
475 Be sure to separate long item numbers.
476 Don't read the members of a rule's prec if its nil.
477
133c20e2
AD
4782002-04-22 Akim Demaille <akim@epita.fr>
479
480 * src/output.c (table_size, table_grow): New.
481 (MAXTABLE): Remove, replace uses with table_size.
482 (pack_vector): Instead of dying when the table is too big, grow it.
483
9515e8a7
AD
4842002-04-22 Akim Demaille <akim@epita.fr>
485
486 * data/bison.simple (yyr1): Its type is that of a token number.
487 * data/bison.c++ (r1_): Likewise.
488 * tests/regression.at (Web2c Actions): Adjust.
489
23c5a174
AD
4902002-04-22 Akim Demaille <akim@epita.fr>
491
492 * src/reader.c (token_translations_init): 256 is now the default
493 value for the error token, i.e., it will be assigned another
494 number if the user assigned 256 to one of her tokens.
495 (reader): Don't force 256 to error.
496 * doc/bison.texinfo (Symbols): Adjust.
497 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
498 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
499 etc. instead of 10, 20, 30 (which was used to `jump' over error
500 (256) and undefined (2)).
501
5fbb0954
AD
5022002-04-22 Akim Demaille <akim@epita.fr>
503
504 Propagate more token_number_t.
505
506 * src/gram.h (token_number_as_item_number)
507 (item_number_as_token_number): New.
508 * src/output.c (GENERATE_OUTPUT_TABLE): New.
509 Use it to create output_item_number_table and
510 output_token_number_table.
511 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
512 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
513 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
514 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
515
4f940944
AD
5162002-04-22 Akim Demaille <akim@epita.fr>
517
518 * src/output.h, src/output.c (get_lines_number): Remove.
519
3ded9a63
AD
5202002-04-19 Akim Demaille <akim@epita.fr>
521
522 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
523 as Lex/Flex'.
524 (Debugging): More details about enabling the debugging features.
525 (Table of Symbols): Describe $$, $n, @$, and @n.
526 Suggested by Tim Josling.
527
e0c471a9
AD
5282002-04-19 Akim Demaille <akim@epita.fr>
529
530 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
531
fecc10cd
AD
5322002-04-10 Akim Demaille <akim@epita.fr>
533
534 * src/system.h: Rely on HAVE_LIMITS_H.
535 Suggested by Paul Eggert.
536
51dec47b
AD
5372002-04-09 Akim Demaille <akim@epita.fr>
538
539 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
540 full stderr, and strip it according to the bison options, instead
541 of composing the error message from different bits.
542 This makes it easier to check for several error messages.
543 Adjust all the invocations.
544 Add an invocation exercising the error token.
545 Add an invocation demonstrating a stupid error message.
546 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
547 Adjust the tests.
548 Error message are for stderr, not stdout.
549
007a50a4
AD
5502002-04-09 Akim Demaille <akim@epita.fr>
551
552 * src/gram.h, src/gram.c (error_token_number): Remove, use
553 errtoken->number.
554 * src/reader.c (reader): Don't specify the user token number (2)
555 for $undefined, as it uselessly prevents using it.
556 * src/gram.h (token_number_t): Move to...
557 * src/symtab.h: here.
558 (state_t.number): Is a token_number_t.
559 * src/print.c, src/reader.c: Use undeftoken->number instead of
560 hard coded 2.
561 (Even though this 2 is not the same as above: the number of the
562 undeftoken remains being 2, it is its user token number which
563 might not be 2).
564 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
565 `user_token_number_max'.
566 Output `undef_token_number'.
567 * data/bison.simple, data/bison.c++: Use them.
568 Be sure to map invalid yylex return values to
569 `undef_token_number'. This saves us from gratuitous SEGV.
570
571 * tests/conflicts.at (Solved SR Conflicts)
572 (Unresolved SR Conflicts): Adjust.
573 * tests/regression.at (Web2c Actions): Adjust.
574
06446ccf
AD
5752002-04-08 Akim Demaille <akim@epita.fr>
576
577 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
578 Adding #line.
579 Remove the duplicate `typedefs'.
580 (RhsNumberType): Fix the declaration and various other typos.
581 Use __ofile__.
582 * data/bison.simple: Use __ofile__.
583 * src/scan-skel.l: Handle __ofile__.
584
62a3e4f0
AD
5852002-04-08 Akim Demaille <akim@epita.fr>
586
587 * src/gram.h (item_number_t): New, the type of item numbers in
588 RITEM. Note that it must be able to code symbol numbers as
589 positive number, and the negation of rule numbers as negative
590 numbers.
591 Adjust all dependencies (pretty many).
592 * src/reduce.c (rule): Remove this `short *' pointer: use
593 item_number_t.
594 * src/system.h (MINSHORT, MAXSHORT): Remove.
595 Include `limits.h'.
596 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
597 (shortcpy): Remove.
598 (MAXTABLE): Move to...
599 * src/output.c (MAXTABLE): here.
600 (prepare_rules): Use output_int_table to output rhs.
601 * data/bison.simple, data/bison.c++: Adjust.
602 * tests/torture.at (Big triangle): Move the limit from 254 to
603 500.
604 * tests/regression.at (Web2c Actions): Ajust.
605
606 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
607 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
608 passes, but produces negative #line number, once fixed, GCC is
609 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
610 C), it passes.
611 * src/state.h (state_h): Code input lines on ints, not shorts.
612
bb88b0fc
AD
6132002-04-08 Akim Demaille <akim@epita.fr>
614
615 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
616 and then the grammar.
617
9a636f47
AD
6182002-04-08 Akim Demaille <akim@epita.fr>
619
620 * src/system.h: No longer using strndup.
621
680e8701
AD
6222002-04-07 Akim Demaille <akim@epita.fr>
623
624 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
625 * src/output.c (output_table_data): Return the longest number.
626 (prepare_tokens): Output `token_number_max').
627 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
628 New.
629 Use them to define yy_token_number_type/TokenNumberType.
630 Use this type for yytranslate.
631 * tests/torture.at (Big triangle): Push the limit from 124 to
632 253.
633 * tests/regression.at (Web2c Actions): Adjust.
634
817e9f41
AD
6352002-04-07 Akim Demaille <akim@epita.fr>
636
637 * tests/torture.at (Big triangle): New.
638 (GNU AWK Grammar, GNU Cim Grammar): Move to...
639 * tests/existing.at: here.
640
5123689b
AD
6412002-04-07 Akim Demaille <akim@epita.fr>
642
643 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
644 nritems.
645 Adjust dependencies.
646
f3849179
AD
6472002-04-07 Akim Demaille <akim@epita.fr>
648
649 * src/reader.c: Normalize increments to prefix form.
650
bd02036a
AD
6512002-04-07 Akim Demaille <akim@epita.fr>
652
653 * src/reader.c, symtab.c: Remove debugging code.
654
db8837cb
AD
6552002-04-07 Akim Demaille <akim@epita.fr>
656
657 Rename all the `bucket's as `symbol_t'.
658
659 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
660 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
661 * src/symtab.c, src/symtab.h (bucket): Rename as...
662 (symbol_t): this.
663 (symbol_list_new, bucket_check_defined, bucket_make_alias)
664 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
665 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
666 (buckets_new, buckets_free, buckets_do): Rename as...
667 (symbol_list_new, symbol_check_defined, symbol_make_alias)
668 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
669 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
670 (symbols_new, symbols_free, symbols_do): these.
671
72a23c97
AD
6722002-04-07 Akim Demaille <akim@epita.fr>
673
674 Use lib/hash for the symbol table.
675
676 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
677 EOF.
678 * src/lex.c (lex): Set the `number' member of new terminals.
679 * src/reader.c (bucket_check_defined, bucket_make_alias)
680 (bucket_check_alias_consistence, bucket_translation): New.
681 (reader, grammar_free, readgram, token_translations_init)
682 (packsymbols): Adjust.
683 (reader): Number the predefined tokens.
684 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
685 for predefined tokens.
686 * src/symtab.h (bucket): Remove all the hash table related
687 members.
688 * src/symtab.c (symtab): Replace by...
689 (bucket_table): this.
690 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
691 (buckets_new, buckets_do): New.
692
280a38c3
AD
6932002-04-07 Akim Demaille <akim@epita.fr>
694
695 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
696 (start_symbol, max_user_token_number, semantic_parser)
697 (error_token_number): Initialize.
698 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
699 Initialize.
700 (reader): Don't.
701 (errtoken, eoftoken, undeftoken, axiom): Extern.
702
03b31c0c
AD
7032002-04-07 Akim Demaille <akim@epita.fr>
704
705 * src/gram.h (rule_s): prec and precsym are now pointers
706 to the bucket giving the priority/associativity.
707 Member `associativity' removed: useless.
708 * src/reduce.c, src/conflicts.c: Adjust.
709
8b3df748
AD
7102002-04-07 Akim Demaille <akim@epita.fr>
711
712 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
713 Properly escape the symbols' TAG when outputting them.
714
e601aa1d
AD
7152002-04-07 Akim Demaille <akim@epita.fr>
716
717 * src/lalr.h (LA): Is a bitsetv, not bitset*.
718
b0299a2e
AD
7192002-04-07 Akim Demaille <akim@epita.fr>
720
721 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
722 (LArule): this, which is an array to rule_t*.
723 * src/print.c, src/conflicts.c: Adjust.
724
d7e1f00c
AD
7252002-04-07 Akim Demaille <akim@epita.fr>
726
727 * src/gram.h (rule_t): Rename `number' as `user_number'.
728 `number' is a new member.
729 Adjust dependencies.
730 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
731
cc9305dd
AD
7322002-04-07 Akim Demaille <akim@epita.fr>
733
734 As a result of the previous patch, it is no longer needed
735 to reorder ritem itself.
736
737 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
738
b0940840
AD
7392002-04-07 Akim Demaille <akim@epita.fr>
740
741 Be sure never to walk through RITEMS, but use only data related to
742 the rules themselves. RITEMS should be banished.
743
744 * src/output.c (output_token_translations): Rename as...
745 (prepare_tokens): this.
746 In addition to `translate', prepare the muscles `tname' and
747 `toknum', which were handled by...
748 (output_rule_data): this.
749 Remove, and move the remainder of its outputs into...
750 (prepare_rules): this new routines, which also merges content from
751 (output_gram): this.
752 (prepare_rules): Be sure never to walk through RITEMS.
753 (output_stos): Rename as...
754 (prepare_stos): this.
755 (output): Always invoke prepare_states, after all, just don't use it
756 in the output if you don't need it.
757
643a5994
AD
7582002-04-07 Akim Demaille <akim@epita.fr>
759
760 * src/LR0.c (new_state): Display `nstates' as the name of the
761 newly created state.
762 Adjust to initialize first_state and last_state if needed.
763 Be sure to distinguish the initial from the final state.
764 (new_states): Create the itemset of the initial state, and use
765 new_state.
766 * src/closure.c (closure): Now that the initial state has its
767 items properly set, there is no need for a special case when
768 creating `ruleset'.
769
770 As a result, now the rule 0, reducing to $axiom, is visible in the
771 outputs. Adjust the test suite.
772
773 * tests/conflicts.at (Solved SR Conflicts)
774 (Unresolved SR Conflicts): Adjust.
775 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
776 * tests/conflicts.at (S/R in initial): New.
777
b4c4ccc2
AD
7782002-04-07 Akim Demaille <akim@epita.fr>
779
780 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
781 the RHS of the rules.
782 * src/output.c (output_gram): Likewise.
783
bba97eb2
AD
7842002-04-07 Akim Demaille <akim@epita.fr>
785
786 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
787 bucket.
788 Adjust all dependencies.
789 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
790 `number' of the buckets too.
791 * src/gram.h: Include `symtab.h'.
792 (associativity): Move to...
793 * src/symtab.h: here.
794 No longer include `gram.h'.
795
c3b407f4
AD
7962002-04-07 Akim Demaille <akim@epita.fr>
797
798 * src/gram.h, src/gram.c (rules_rhs_length): New.
799 (ritem_longest_rhs): Use it.
800 * src/gram.h (rule_t): `number' is a new member.
801 * src/reader.c (packgram): Set it.
802 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
803 the end of `rules', and count them out of `nrules'.
804 (reduce_output, dump_grammar): Adjust.
805 * src/print.c (print_grammar): It is no longer needed to check for
806 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
807 * tests/reduce.at (Reduced Automaton): New test.
808
11652ab3
AD
8092002-04-07 Akim Demaille <akim@epita.fr>
810
811 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
812 lacking `+ 1' to nrules, Bison reported as useless a token if it
813 was used solely to set the precedence of the last rule...
814
26b23c1a
AD
8152002-04-07 Akim Demaille <akim@epita.fr>
816
817 * data/bison.c++, data/bison.simple: Don't output the current file
818 name in #line, to avoid useless diffs between two identical
819 outputs under different names.
820
18bcecb0
AD
8212002-04-07 Akim Demaille <akim@epita.fr>
822
823 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
824 Normalize loops to using `< nrules + 1', not `<= nrules'.
825
fa770c86
AD
8262002-04-07 Akim Demaille <akim@epita.fr>
827
828 * TODO: Update.
829
d9b739c3
AD
8302002-04-07 Akim Demaille <akim@epita.fr>
831
832 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
833 bucket.value as bucket.number.
834
99013900
AD
8352002-04-07 Akim Demaille <akim@epita.fr>
836
837 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
838 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
839 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
840 RHS, instead of being an index in RITEMS.
841
e966383b
PE
8422002-04-04 Paul Eggert <eggert@twinsun.com>
843
844 * doc/bison.texinfo: Update copyright date.
845 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
846 (Symbols): Warn about running Bison in one character set,
847 but compiling and/or running in an incompatible one.
848 Warn about character code 256, too.
849
8502002-04-03 Paul Eggert <eggert@twinsun.com>
851
852 * src/bison.data (YYSTACK_ALLOC): Depend on whether
853 YYERROR_VERBOSE is nonzero, not whether it is defined.
854
855 Merge changes from bison-1_29-branch.
c307773e 856
8d6c48b9
PE
8572002-03-20 Paul Eggert <eggert@twinsun.com>
858
859 Merge fixes from Debian bison_1.34-1.diff.
860
861 * configure.in (AC_PREREQ): 2.53.
862
e53c6322
AD
8632002-03-20 Akim Demaille <akim@epita.fr>
864
865 * src/conflicts.c (log_resolution): Argument `resolution' is const.
866
9ffbeca7
PE
8672002-03-19 Paul Eggert <eggert@twinsun.com>
868
21db0b2a
PE
869 * src/bison.simple (YYCOPY): New macro.
870 (YYSTACK_RELOCATE): Use it.
871 Remove Type arg; no longer needed. All callers changed.
872 (yymemcpy): Remove; no longer needed.
873
9ffbeca7
PE
874 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
875 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
876
642cb8f8
AD
8772002-03-19 Akim Demaille <akim@epita.fr>
878
879 Test and fix the #line outputs.
880
881 * tests/atlocal.at (GCC): New.
882 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
883 (Prologue synch line, ,%union synch line, Postprologue synch line)
884 (Action synch line, Epilogue synch line): New tests.
885 * src/reader.c (parse_union_decl): Define the muscle stype_line.
886 * data/bison.simple, data/bison.c++: Use it.
887
3c31a486
AD
8882002-03-19 Akim Demaille <akim@epita.fr>
889
890 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
891 (Solved SR Conflicts, %expect not enough, %expect right)
892 (%expect too much): Move to...
893 * tests/conflicts.at: this new file.
894
0d8bed56
AD
8952002-03-19 Akim Demaille <akim@epita.fr>
896
897 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
898 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
899 that we can move to enums for instance.
900 * src/output.c (token_definitions_output): Output a list of
901 `token-name, token-number' instead of the #define.
902 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
903
9208d17f
AD
9042002-03-14 Akim Demaille <akim@epita.fr>
905
906 Use Gettext 0.11.1.
907
af27eacb
RA
9082002-03-09 Robert Anisko <robert@lrde.epita.fr>
909
910 * data/bison.c++: Make the user able to add members to the generated
911 parser by subclassing.
912
9101a310
RA
9132002-03-05 Robert Anisko <robert@lrde.epita.fr>
914
915 * src/reader.c (read_additionnal_code): `c' should be an integer, not
916 a character.
917 Reported by Nicolas Tisserand and Nicolas Burrus.
918
fff9bf0b
RA
9192002-03-04 Robert Anisko <robert@lrde.epita.fr>
920
921 * src/reader.c: Warn about lacking semi-colons, do not complain.
922
64dba31e
RA
9232002-03-04 Robert Anisko <robert@lrde.epita.fr>
924
925 * data/bison.c++: Remove a debug line.
926
374f5a14
RA
9272002-03-04 Robert Anisko <robert@lrde.epita.fr>
928
929 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
930 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
931 provide a default implementation.
932
bfcf1f3a
AD
9332002-03-04 Akim Demaille <akim@epita.fr>
934
935 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
936 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
937 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
938 * tests/semantic.at (Parsing Guards): Similarly.
939 * src/reader.at (readgram): Complain if the last rule is not ended
940 with a semi-colon.
941
65ccf9fc
AD
9422002-03-04 Akim Demaille <akim@epita.fr>
943
944 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
945 * src/closure.c: here.
946 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
947 RTC.
948 * src/warshall.h, src/warshall.c: Remove.
949 * tests/sets.at (Broken Closure): Adjust.
950
d0039cbc
AD
9512002-03-04 Akim Demaille <akim@epita.fr>
952
953 * src/output.c (output_skeleton): tempdir is const.
954 bytes_read is unused.
955
345cea78
AD
9562002-03-04 Akim Demaille <akim@epita.fr>
957
958 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
959 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
960 Update.
961 From Michael Hayes.
962
564801f7
AD
9632002-03-04 Akim Demaille <akim@epita.fr>
964
965 * src/closure.c (closure): `r' is unused.
966
e5352bc7
AD
9672002-03-04 Akim Demaille <akim@epita.fr>
968
969 * tests/sets.at (Broken Closure): Add the ending `;'.
970 * src/reader.at (readgram): Complain if a rule is not ended with a
971 semi-colon.
972
914feea9
AD
9732002-03-04 Akim Demaille <akim@epita.fr>
974
975 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
976 (count_sr_conflicts): Use bitset_count.
977 * src/reduce.c (inaccessable_symbols): Ditto.
978 (bits_size): Remove.
979 * src/warshall.h, src/warshall.c: Convert to bitsetv.
980
f0250de6
AD
9812002-03-04 Akim Demaille <akim@epita.fr>
982
983 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
984 * src/reduce.c: Remove the `bitset_zero's following the
985 `bitset_create's, as now it is performed by the latter.
986
ef017502
AD
9872002-03-04 Akim Demaille <akim@epita.fr>
988
989 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
990 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
991 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
992 latest sources from Michael.
993
76514394
AD
9942002-03-04 Akim Demaille <akim@epita.fr>
995
996 * src/output.c (output): Don't free the grammar.
997 * src/reader.c (grammar_free): New.
998 * src/main.c (main): Call it and don't free symtab here.
999
55024580
AD
10002002-03-04 Akim Demaille <akim@epita.fr>
1001
1002 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1003 before returning.
1004 Reported by Benoit Perrot.
1005
f9abaa2c
AD
10062002-03-04 Akim Demaille <akim@epita.fr>
1007
1008 Use bitset operations when possible, not loops over bits.
1009
1010 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1011 bitset_or.
1012 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1013 * src/reduce.c (useless_nonterminals): Formatting changes.
1014 * src/warshall.c (TC): Use bitset_or.
1015
0e721e75
AD
10162002-03-04 Akim Demaille <akim@epita.fr>
1017
1018 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1019 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1020 Ditto.
1021
0fb1ffb1
AD
10222002-03-04 Akim Demaille <akim@epita.fr>
1023
1024 * src/lalr.c (F): Now a bitset*.
1025 Adjust all dependencies.
1026
b86796bf
AD
10272002-03-04 Akim Demaille <akim@epita.fr>
1028
1029 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1030 Adjust all dependencies.
1031
602bbf31
AD
10322002-03-04 Akim Demaille <akim@epita.fr>
1033
1034 * src/L0.c, src/LR0.h (nstates): Be size_t.
1035 Adjust comparisons (signed vs unsigned).
1036 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1037 bitset*.
1038 Adjust all dependencies.
1039
d8a0245c
AD
10402002-03-04 Akim Demaille <akim@epita.fr>
1041
1042 * src/closure.c (firsts): Now, also a bitset.
1043 Adjust all dependencies.
1044 (varsetsize): Remove, now unused.
1045 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1046
34ba9743
AD
10472002-03-04 Akim Demaille <akim@epita.fr>
1048
1049 * src/print.c: Convert to use bitset.h, not hand coded iterations
1050 over ints.
1051
ed86e78c
AD
10522002-03-04 Akim Demaille <akim@epita.fr>
1053
1054 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1055
dfdb1797
AD
10562002-03-04 Akim Demaille <akim@epita.fr>
1057
1058 * src/closure.c (ruleset): Be a bitset.
1059 (rulesetsize): Remove.
1060
7086e707
AD
10612002-03-04 Akim Demaille <akim@epita.fr>
1062
1063 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1064 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1065 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1066 * src/closure.c (fderives): Be an array of bitsets.
1067
98254360
RA
10682002-02-28 Robert Anisko <robert@lrde.epita.fr>
1069
1070 * data/bison.c++: Merge the two generated headers. Insert a copyright
1071 notice in each output file.
1072
a75c057f
AD
10732002-02-28 Akim Demaille <akim@epita.fr>
1074
1075 * data/bison.c++: Copy the prologue of bison.simple to fetch
1076 useful M4 definitions, such as b4_header_guard.
1077
06b00abc
AD
10782002-02-25 Akim Demaille <akim@epita.fr>
1079
1080 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1081 translator friendly scheme for the bgr
1082 copyright notice.
06b00abc 1083
70e7d534
AD
10842002-02-25 Akim Demaille <akim@epita.fr>
1085
1086 * src/output.c (header_output): Remove, now handled completely via
1087 M4.
1088
abe017f6
AD
10892002-02-25 Akim Demaille <akim@epita.fr>
1090
1091 * m4/m4.m4: New, from CVS Autoconf.
1092 * configure.in: Invoke it.
1093 * src/output.c (output_skeleton): Use its result instead of the
1094 hard coded name.
1095
381fb12e
AD
10962002-02-25 Akim Demaille <akim@epita.fr>
1097
1098 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1099 Fileutils 4.1.5.
1100 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1101 * src/output.c (output_skeleton): Use mkstemp to create a real
1102 temporary file.
1103 Move the filling of `skeleton' and its muscle to...
1104 (prepare): here.
1105 (output): Move the definition of the prologue muscle to...
1106 (prepare): here.
1107 * src/system.h (DEFAULT_TMPDIR): New.
1108
6f38107f
PE
11092002-02-14 Paul Eggert <eggert@twinsun.com>
1110
1111 Remove the support for C++ namespace cleanliness; it was
1112 causing more problems than it was curing, since it didn't work
1113 properly on some nonstandard C++ compilers. This can wait
1114 for a proper C++ parser.
1115
1116 * NEWS: Document this.
1117 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1118 of C++, as it's treated like C now.
1119 * src/bison.simple (YYSTD): Remove.
1120 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1121 Treat C++ just like Standard C instead of trying to support
1122 namespace cleanliness.
1123
80cce3da
AD
11242002-02-14 Akim Demaille <akim@epita.fr>
1125
1126 * tests/regression.at (else): Adjust to Andreas' change.
1127
842e8679
AD
11282002-02-14 Akim Demaille <akim@epita.fr>
1129
1130 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1131
4bda3f10
AD
11322002-02-13 Andreas Schwab <schwab@suse.de>
1133
1134 * src/output.c (output_rule_data): Don't output NULL, it might
1135 not be defined yet.
1136
4162fa07 11372002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 1138
4162fa07
RA
1139 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1140 (Copyright notice): Update.
b418ecd8 1141
bd16a5dc
AD
11422002-02-11 Akim Demaille <akim@epita.fr>
1143
1144 * tests/regression.at (%nonassoc and eof): Don't include
1145 nonportable headers.
1146
8d69a1a3
RA
11472002-02-08 Robert Anisko <robert@lrde.epita.fr>
1148
1149 * data/bison.c++: Correct error recovery. Make the user able to
1150 initialize the starting location.
1151
9b2d0677
AD
11522002-02-07 Akim Demaille <akim@epita.fr>
1153
1154 * tests/input.at: New.
1155
69e2658b
RA
11562002-02-07 Robert Anisko <robert@lrde.epita.fr>
1157
1158 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 1159 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
1160 directives around tables only needed for debugging.
1161
4aacc3a7
RA
11622002-02-07 Robert Anisko <robert@lrde.epita.fr>
1163
1164 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1165 C++ parsers.
1166 (yy::b4_name::parse): Use print_.
1167
762a801e
RA
11682002-02-07 Robert Anisko <robert@lrde.epita.fr>
1169
1170 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1171
4bb2bc3f
RA
11722002-02-07 Robert Anisko <robert@lrde.epita.fr>
1173
1174 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1175 C++ parsers.
1176 (yy::b4_name::parse): Build verbose error messages, and use error_.
1177
6b45a3ca
RA
11782002-02-06 Robert Anisko <robert@lrde.epita.fr>
1179
1180 * data/bison.c++: Fix m4 quoting in comments.
1181
50997c6e
RA
11822002-02-06 Robert Anisko <robert@lrde.epita.fr>
1183
1184 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1185 not expanded by m4.
1186
3f3eed27
AD
11872002-02-05 Akim Demaille <akim@epita.fr>
1188
1189 * data/bison.c++: Adjust to the M4 back end.
1190 More is certainly needed.
1191
be2a1a68
AD
11922002-02-05 Akim Demaille <akim@epita.fr>
1193
1194 Give a try to M4 as a back end.
1195
1196 * lib/readpipe.c: New, from wdiff.
1197 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1198 BISON_HAIRY.
1199 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1200 specific values. Now it is m4 that performs the lookup.
1201 * src/parse-skel.y: Remove.
1202 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1203 * src/output.c (actions_output, guards_output)
1204 (token_definitions_output): No longer keeps track of the output
1205 line number, hence remove the second argument.
1206 (guards_output): Check against the guard member of a rule, not the
1207 action member.
1208 Adjust callers.
1209 (output_skeleton): Don't look for the skeleton location, let m4 do
1210 that.
1211 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1212 file will be used.
1213 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1214 (prepare): Given that for the time being changesyntax is not
1215 usable in M4, rename the muscles using `-' to `_'.
1216 Define `defines_flag', `output_parser_name' and `output_header_name'.
1217 * src/output.h (actions_output, guards_output)
1218 (token_definitions_output): Adjust prototypes.
1219 * src/scan-skel.l: Instead of scanning the skeletons, it now
1220 processes the output of m4: `__oline__' and `#output'.
1221 * data/bison.simple: Adjust to be used by M4(sugar).
1222 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1223 to date.
1224 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1225 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1226 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1227 shamelessly stolen from CVS Autoconf.
1228
beda758b
AD
12292002-02-05 Akim Demaille <akim@epita.fr>
1230
1231 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1232 * configure.in: Check for the declarations of free and malloc.
1233 * src/muscle_tab.c: Adjust.
1234
5ece6d43
AD
12352002-02-05 Akim Demaille <akim@epita.fr>
1236
1237 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1238 which have no values.
1239
5bb18f9a
AD
12402002-02-05 Akim Demaille <akim@epita.fr>
1241
1242 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1243 * data/: here.
1244
894dd62e
PE
12452002-01-29 Paul Eggert <eggert@twinsun.com>
1246
1247 * src/bison.simple (YYSIZE_T): Do not define merely because
1248 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1249 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1250
82841af7
AD
12512002-01-27 Akim Demaille <akim@epita.fr>
1252
1253 Fix `%nonassoc and eof'.
1254
1255 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1256 which were not properly copied! Replace
1257 memcpy (res->errs, src->errs, src->nerrs);
1258 with
1259 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1260 !!!
1261 * tests/regression.at (%nonassoc and eof): Adjust to newest
1262 Autotest: `.' is not in the PATH.
1263
318b76e9
AD
12642002-01-27 Akim Demaille <akim@epita.fr>
1265
1266 * tests/sets.at (AT_EXTRACT_SETS): New.
1267 (Nullable): Use it.
1268 (Firsts): New.
1269
30d2f3d5
AD
12702002-01-26 Akim Demaille <akim@epita.fr>
1271
1272 * tests/actions.at, tests/calc.at, tests/headers.at,
1273 * tests/torture.at: Adjust to the newest Autotest which no longer
1274 forces `.' in the PATH.
1275
30f8c395
AD
12762002-01-25 Akim Demaille <akim@epita.fr>
1277
1278 * tests/regression.at (%nonassoc and eof): New.
1279 Suggested by Robert Anisko.
1280
29ae55f1
AD
12812002-01-24 Akim Demaille <akim@epita.fr>
1282
1283 Bison dumps core when trying to complain about broken input files.
1284 Reported by Cris van Pelt.
1285
1286 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
1287 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
1288 into...
1289 (Invalid inputs): Strengthen: exercise parse_percent_token.
1290
2b548aa6
RA
12912002-01-24 Robert Anisko <robert.anisko@epita.fr>
1292
1293 * src/Makefile.am: Add bison.c++.
1294 * src/bison.c++: New skeleton.
1295
bb0146c2
AD
12962002-01-21 Paolo Bonzini <bonzini@gnu.org>
1297
1298 * po/it.po: New.
1299
bec30531
AD
13002002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
1301
1302 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
1303
fc6edc45
MA
13042002-01-20 Marc Autret <marc@gnu.org>
1305
1306 * src/files.c (compute_output_file_names): Fix
1307
5e5d5415
MA
13082002-01-20 Marc Autret <marc@gnu.org>
1309
1310 * tests/output.at: New test.
1311 * src/files.c (compute_base_names): Don't map extensions when
1312 the YACC flag is set, use defaults.
1313 Reported by Evgeny Stambulchik.
1314
44ea3fbd
MA
13152002-01-20 Marc Autret <marc@gnu.org>
1316
bb0146c2 1317 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
1318 compilers as well (i.e. the vendor C compiler).
1319 Suggested by Albert Chin-A-Young.
1320
338963d1
TVH
13212002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1322
1323 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1324 canonical definition.
1325 * src/system.h: Use the canonical definition for PARAMS (avoids
1326 a conflict with the macro from lib/hash.h).
1327
c57b2479
AD
13282002-01-11 Akim Demaille <akim@epita.fr>
1329
1330 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 1331 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 1332
b85810ae
AD
13332002-01-09 Akim Demaille <akim@epita.fr>
1334
1335 * src/files.c, src/files.h (output_infix): New.
1336 (tab_extension): Remove.
1337 (compute_base_names): Compute the former, drop the latter.
1338 * src/output.c (prepare): Insert the muscles `output-infix', and
1339 `output-suffix'.
1340 * src/parse-skel.y (string, string.1): New.
1341 (section.header): Use it.
1342 (section.yacc): Remove.
1343 (prefix): Remove too.
1344 * src/scan-skel.l: Adjust.
1345 * src/bison.simple, src/bison.hairy: Adjust.
1346
cae60122
AD
13472002-01-09 Akim Demaille <akim@epita.fr>
1348
1349 * configure.in (WERROR_CFLAGS): Compute it.
1350 * src/Makefile.am (CFLAGS): Pass it.
1351 * tests/atlocal.in (CFLAGS): Idem.
1352 * src/files.c: Fix a few warnings.
1353 (get_extension_index): Remove, unused.
1354
ae404801
AD
13552002-01-08 Akim Demaille <akim@epita.fr>
1356
1357 * src/getargs.c (AS_FILE_NAME): New.
1358 (getargs): Use it to convert DOSish file names.
1359 * src/files.c (base_name): Rename as full_base_name to avoid
1360 clashes with `base_name ()'.
1361 (filename_split): New.
1362 (compute_base_names): N-th rewrite, using filename_split.
1363
22312b71
AD
13642002-01-08 Akim Demaille <akim@epita.fr>
1365
1366 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1367 New, stolen from the Fileutils 4.1.
1368 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1369 * configure.in: Check for the presence of memrchr, and of its
1370 prototype.
1371
a67cef01
TVH
13722002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1373
1374 * lib/hash.h (__P): Added definition for this macro.
1375 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1376 BUILT_SOURCES, to ensure they are generated first.
1377 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1378 %error-verbose to allow bootstrapping with bison 1.30x.
1379
2b25d624
AD
13802002-01-06 Akim Demaille <akim@epita.fr>
1381
1382 * src/reader.c (parse_braces): Don't fetch the next char, the
1383 convention is to fetch on entry.
1384 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1385 'switch' without a following semicolon.
1386 * tests/regression.at (braces parsing): New.
1387
3460813b
AD
13882002-01-06 Akim Demaille <akim@epita.fr>
1389
1390 Bison is dead wrong in its RR conflict reports.
1391
1392 * tests/torture.at (GNU Cim Grammar): New.
1393 * src/conflicts.c (count_rr_conflicts): Fix.
1394
73784c64
AD
13952002-01-06 Akim Demaille <akim@epita.fr>
1396
1397 Creating package.m4 from configure.ac causes too many problems.
1398
1399 * tests/Makefile.am (package.m4): Create it by hand,
1400 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1401
25d81090
AD
14022002-01-06 Akim Demaille <akim@epita.fr>
1403
1404 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1405 skeleton.h.
1406
a9b8959e
PE
14072002-01-04 Paul Eggert <eggert@twinsun.com>
1408
1409 * doc/bison.texinfo (Debugging):
1410 Remove YYSTDERR; it's no longer defined or used.
1411 Also, s/cstdio.h/cstdio/.
1412
25d81090
AD
14132002-01-03 Akim Demaille <akim@epita.fr>
1414
1415 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1416
1109455c
AD
14172002-01-03 Akim Demaille <akim@epita.fr>
1418
1419 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1420 tracing code to --trace, wait for a better --trace option, with
1421 args.
1422
7ea5e977
AD
14232002-01-03 Akim Demaille <akim@epita.fr>
1424
1425 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1426 The ISO C++ standard is extremely clear about it: stderr is
1427 considered a macro, not a regular symbol (see table 94 `Header
1428 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1429 Therefore std:: does not apply to it. It still does with fprintf.
1430 Also, s/cstdio.h/cstdio/.
1431
fab5b110
AD
14322002-01-03 Akim Demaille <akim@epita.fr>
1433
1434 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1435 for non system headers.
1436
aed7fd9b
AD
14372002-01-02 Akim Demaille <akim@epita.fr>
1438
1439 Equip the skeleton chain with location tracking, runtime trace,
1440 pure parser and scanner.
1441
1442 * src/parse-skel.y: Request a pure parser, locations, and prefix
1443 renaming.
1444 (%union): Having several members with the same type does not help
1445 type mismatches, simplify.
1446 (YYPRINT, yyprint): New.
1447 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1448 (skel_error): this.
1449 Handle locations.
1450 * src/scan-skel.l: Adjust to these changes.
1451 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1452 (LOCATION_PRINT, skel_control_t): New.
1453
24fad99e
AD
14542001-12-30 Akim Demaille <akim@epita.fr>
1455
1456 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1457 replace `gb' with BLANKS.
1458 * src/scan-skel.l: Adjust.
1459
a4b36db4
AD
14602001-12-30 Akim Demaille <akim@epita.fr>
1461
1462 * src/system.h: We don't need nor want bcopy.
1463 Throw away MS-DOS crap: we don't need getpid.
1464 * configure.in: We don't need strndup. It was even causing
1465 problems: because Flex includes the headers *before* us,
1466 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1467 not visible.
1468 * lib/xstrndup.c: New.
1469 * src/scan-skel.l: Use it.
1470 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1471 * src/parse-skel.y: Use %directives instead of #defines.
1472
1239777d
AD
14732001-12-30 Akim Demaille <akim@epita.fr>
1474
1475 * src/skeleton.h: New.
1476 * src/output.c (output_parser, output_master_parser): Remove, dead
1477 code.
1478 * src/output.h (get_lines_number, actions_output, guards_output)
1479 (token_definitions_output): Prototype them.
1480 * src/parse-skel.y: Add the license notice.
1481 Include output.h and skeleton.h.
1482 (process_skeleton): Returns void, and takes a single parameter.
1483 * src/scan-skel.l: Add the license notice.
1484 Include skeleton.h.
1485 Don't use %option yylineno: it seems that then Flex imagines
1486 REJECT has been used, and therefore it won't reallocate its
1487 buffers (which makes no other sense to me than a bug). It results
1488 in warnings for `unused: yy_flex_realloc'.
1489
9b3add5b
RA
14902001-12-30 Robert Anisko <robert.anisko@epita.fr>
1491
1492 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1493 (MUSCLE_INSERT_PREFIX): ...to there.
1494 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1495 (MUSCLE_INSERT_PREFIX): Move from here...
1496
1497 * src/bison.hairy: Add a section directive. Put braces around muscle
1498 names. This parser skeleton is still broken, but Bison should not
1499 choke on a bad muscle 'syntax'.
1500 * src/bison.simple: Add a section directive. Put braces around muscle
1501 names.
1502
1503 * src/files.h (strsuffix, stringappend): Add declarations.
1504 (tab_extension): Add declaration.
1505 (short_base_name): Add declaration.
1506
1507 * src/files.c (strsuffix, stringappend): No longer static. These
1508 functions are used in the skeleton parser.
1509 (tab_extension): New.
1510 (compute_base_names): Use the computations done in this function
fab5b110 1511 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1512 names.
1513 (short_base_name): No longer static.
1514
1515 * src/output.c (output_skeleton): New.
1516 (output): Disable call to output_master_parser, and give a try to
1517 a new skeleton handling system.
1518 (guards_output, actions_output): No longer static.
1519 (token_definitions_output, get_lines_number): No longer static.
1520
1521 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1522
fab5b110 1523 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1524 parse-skel.y.
1525
1526 * src/parse-skel.y: New file.
1527 * src/scan-skel.l: New file.
1528
b5b61c61
AD
15292001-12-29 Akim Demaille <akim@epita.fr>
1530
1531 %name-prefix is broken.
1532
1533 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1534 Adjust all dependencies.
1535 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1536 %name-prefix.
1537
1538 Renaming yylval but not yylloc is not consistent. Now we do.
1539
1540 * src/bison.simple: Prefix yylloc if used.
1541 * doc/bison.texinfo (Decl Summary): Document that.
1542
8c9a50be
AD
15432001-12-29 Akim Demaille <akim@epita.fr>
1544
1545 * doc/bison.texinfo: Promote `%long-directive' over
1546 `%long_directive'.
1547 Remove all references to fixed-output-files, yacc is enough.
1548
d99361e6
AD
15492001-12-29 Akim Demaille <akim@epita.fr>
1550
1551 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1552 user prologue. These are defaults.
1553 * tests/actions.at (Mid-rule actions): Make sure the user can
1554 define YYDEBUG and YYERROR_VERBOSE.
1555
b9cecb91
AD
15562001-12-29 Akim Demaille <akim@epita.fr>
1557
1558 * src/output.c (header_output): Don't forget to export YYLTYPE and
1559 yylloc.
1560 * tests/headers.at (export YYLTYPE): New, make sure it does.
1561 * tests/regression.at (%union and --defines, Invalid CPP headers):
1562 Move to...
1563 * tests/headers.at: here.
1564
aea13e97
AD
15652001-12-29 Akim Demaille <akim@epita.fr>
1566
1567 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1568
931394cb
AD
15692001-12-29 Akim Demaille <akim@epita.fr>
1570
1571 * tests/actions.at (Mid-rule actions): Output on a single line
1572 instead of several.
1573
704a47c4
AD
15742001-12-29 Akim Demaille <akim@epita.fr>
1575
1576 * doc/bison.texinfo: Formatting changes.
1577
091e20bb
AD
15782001-12-29 Akim Demaille <akim@epita.fr>
1579
1580 Don't store the token defs in a muscle, just be ready to output it
1581 on command. Now possible via `symbols'. Fixes a memory leak.
1582
1583 * src/output.c (token_definitions_output): New.
1584 (output_parser, header_output): Use it.
1585 * src/reader.c (symbols_save): Remove.
1586
cce71710
AD
15872001-12-29 Akim Demaille <akim@epita.fr>
1588
1589 * src/bison.simple: Do not provide a default for YYSTYPE and
1590 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1591 default.
1592
82c035a8
AD
15932001-12-29 Akim Demaille <akim@epita.fr>
1594
1595 Mid-rule actions are simply... ignored!
1596
1597 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1598 the empty-rule associated to the dummy symbol, not to the host
1599 rule.
1600 * tests/actions.at (Mid-rule actions): New.
1601
8419d367
AD
16022001-12-29 Akim Demaille <akim@epita.fr>
1603
1604 Memory leak.
1605
1606 * src/reader.c (reader): Free grammar.
1607
375d5806
AD
16082001-12-29 Akim Demaille <akim@epita.fr>
1609
1610 Memory leak.
1611
1612 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1613 since it allocates it for each state, although only one is needed.
1614 (allocate_storage): Do it here.
1615
f51cb8ff
AD
16162001-12-29 Akim Demaille <akim@epita.fr>
1617
1618 * src/options.h, src/options.c (create_long_option_table): Rename
1619 as...
1620 (long_option_table_new): this, with a clearer prototype.
1621 (percent_table): Remove, unused,
1622 * src/getargs.c (getargs): Adjust.
1623
29e88316
AD
16242001-12-29 Akim Demaille <akim@epita.fr>
1625
1626 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1627 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1628 as states.
1629
b9f71f19
AD
16302001-12-29 Akim Demaille <akim@epita.fr>
1631
1632 * src/lalr.c (build_relations): Rename `states' as `states1'.
1633 Sorry, I don't understand exactly what it is, no better name...
1634
1a2b5d37
AD
16352001-12-29 Akim Demaille <akim@epita.fr>
1636
1637 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1638 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1639 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1640 as rules.
1641
1cca533e
AD
16422001-12-29 Akim Demaille <akim@epita.fr>
1643
1644 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1645 ago.
1646
c03ae966
AD
16472001-12-29 Akim Demaille <akim@epita.fr>
1648
1649 * src/reader.c, src/reader.h (user_toknums): Remove.
1650 Adjust all users to use symbols[i]->user_token_number.
1651
5a670b1e
AD
16522001-12-29 Akim Demaille <akim@epita.fr>
1653
1654 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1655 Adjust all users to use symbols[i]->prec or ->assoc.
1656
ad949da9
AD
16572001-12-29 Akim Demaille <akim@epita.fr>
1658
1659 * src/reader.c, src/reader.h (tags): Remove.
1660 Adjust all users to use symbols[i]->tag.
1661
0e78e603
AD
16622001-12-29 Akim Demaille <akim@epita.fr>
1663
1664 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1665 and rule_table.
1666 * src/reader.c (packsymbols): Fill this table.
1667 Drop sprec.
1668 * src/conflicts.c (resolve_sr_conflict): Adjust.
1669 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1670 single table.
1671 Use symbols[i]->tag instead of tags[i].
1672
213e640e
AD
16732001-12-29 Akim Demaille <akim@epita.fr>
1674
1675 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1676 In addition, put a comment in there, to replace...
1677 * tests/regression.at (%union and C comments): Remove.
1678
e7b8bef1
AD
16792001-12-29 Akim Demaille <akim@epita.fr>
1680
1681 * tests/regression.at (Web2c Actions): Blindly move the actual
1682 output as expected output. The contents *seem* right to me, but I
1683 can't pretend reading perfectly parser tables... Nonetheless, all
1684 the other tests pass correctly, the table look OK, even though the
1685 presence of `$axiom' is to be noted: AFAICS it is useless (but
1686 harmless).
1687
b68e7744
AD
16882001-12-29 Akim Demaille <akim@epita.fr>
1689
1690 * src/reader.c (readgram): Don't add the rule 0 if there were no
1691 rules read. In other words, add it _after_ having performed
1692 grammar sanity checks.
1693 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1694
78d5bae9
AD
16952001-12-29 Akim Demaille <akim@epita.fr>
1696
1697 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1698 visible, and some states have now a different number.
1699
ff442794
AD
17002001-12-29 Akim Demaille <akim@epita.fr>
1701
1702 * src/reader.c (readgram): Bind the initial rule's lineno to that
1703 of the first rule.
1704 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1705 (Solved SR Conflicts): Adjust rule 0's line number.
1706
610ab194
AD
17072001-12-29 Akim Demaille <akim@epita.fr>
1708
1709 Fix the `GAWK Grammar' failure.
1710
1711 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1712 the reductions of the first state which was mistakenly confused
1713 with the final state because precisely final_state was initialized
1714 to 0.
1715 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1716 now noticed by Bison.
1717 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1718 have a reduction on $default.
1719
29d29c8f
AD
17202001-12-29 Akim Demaille <akim@epita.fr>
1721
1722 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1723 rule line numbers.
1724 * src/closure.c (print_closure): Likewise.
1725 * src/derives.c (print_derives): Likewise.
1726 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1727 now.
1728
7c6b64d0
AD
17292001-12-29 Akim Demaille <akim@epita.fr>
1730
1731 * src/lalr.c (lookaheads_print): New.
1732 (lalr): Call it when --trace-flag.
1733 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1734 are dumped.
1735
3d4daee3
AD
17362001-12-29 Akim Demaille <akim@epita.fr>
1737
1738 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1739 when walking through ritem, even via rule->rhs.
1740 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1741 (useful_production, useless_nonterminals): Likewise.
1742 (reduce_grammar_tables): Likewise, plus update nritems.
1743 * src/nullable.c (set_nullable): Likewise.
1744 * src/lalr.c (build_relations): Likewise.
1745 * tests/sets.at (Nullable): Adjust.
1746 Fortunately, now, the $axiom is no longer nullable.
1747
9e7f6bbd
AD
17482001-12-29 Akim Demaille <akim@epita.fr>
1749
1750 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1751 the 0-sentinel.
1752 * src/gram.c (ritem_longest_rhs): Likewise.
1753 * src/reduce.c (nonterminals_reduce): Likewise.
1754 * src/print_graph.c (print_graph): Likewise.
1755 * src/output.c (output_rule_data): Likewise.
1756 * src/nullable.c (set_nullable): Likewise.
1757
255ef638
AD
17582001-12-29 Akim Demaille <akim@epita.fr>
1759
1760 * src/output.c: Comment changes.
1761
0d8a7363
AD
17622001-12-27 Paul Eggert <eggert@twinsun.com>
1763
1764 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1765 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1766 Sparc, as they were causing more porting problems than the
1767 (minor) performance improvement was worth.
1768
1769 Also, catch up with 1.31's YYSTD.
1770
3db472b9
AD
17712001-12-27 Akim Demaille <akim@epita.fr>
1772
1773 * src/output.c (output_gram): Rely on nritems, not the
1774 0-sentinel. See below.
1775 Use -1 as separator, not 0.
1776 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1777 Rely on -1 as separator in yyrhs, instead of 0.
1778 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1779 twice `Now at end of input', therefore there are two lines less to
1780 expect.
1781
b365aa05
AD
17822001-12-27 Akim Demaille <akim@epita.fr>
1783
1784 * tests/regression.at (Unresolved SR Conflicts):
1785 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1786 below.
1787
30171f79
AD
17882001-12-27 Akim Demaille <akim@epita.fr>
1789
1790 * src/LR0.c (new_state): Recognize the final state by the fact it
1791 is reached by eoftoken.
1792 (insert_start_shifting_state, insert_eof_shifting_state)
1793 (insert_accepting_state, augment_automaton): Remove, since now
1794 these states are automatically computed from the initial state.
1795 (generate_states): Adjust.
1796 * src/print.c: When reporting a rule number to the user, substract
1797 1, so that the axiom rule is rule 0, and the first user rule is 1.
1798 * src/reduce.c: Likewise.
1799 * src/print_graph.c (print_core): For the time being, just as for
1800 the report, depend upon --trace-flags to dump the full set of
1801 items.
1802 * src/reader.c (readgram): Once the grammar read, insert the rule
1803 0: `$axiom: START-SYMBOL $'.
1804 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1805 number of the states has changed (the final state is no longer
1806 necessarily the last), catch up.
1807
75142d45
AD
18082001-12-27 Akim Demaille <akim@epita.fr>
1809
1810 Try to make the use of the eoftoken valid. Given that its value
1811 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1812 is used instead of > 0 where appropriate, (ii), depend upon nritems
1813 instead of the 0-sentinel.
1814
1815 * src/gram.h, src/gram.c (nritems): New.
1816 Expected to be duplication of nitems, but for the time being...
1817 * src/reader.c (packgram): Assert nritems and nitems are equal.
1818 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1819 * src/closure.c (print_closure, print_fderives): Likewise.
1820 * src/gram.c (ritem_print): Likewise.
1821 * src/print.c (print_core, print_grammar): Likewise.
1822 * src/print_graph.c: Likewise.
1823
b7c49edf
AD
18242001-12-27 Akim Demaille <akim@epita.fr>
1825
1826 * src/main.c (main): If there are complains after grammar
1827 reductions, then output the report anyway if requested, then die.
1828 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1829 * src/reader.c (eoftoken): New.
1830 (parse_token_decl): If the token being defined has value `0', it
1831 is the eoftoken.
1832 (packsymbols): No longer hack `tags' to insert `$' by hand.
1833 Be sure to preserve the value of the eoftoken.
1834 (reader): Make sure eoftoken is defined.
1835 Initialize nsyms to 0: now eoftoken is created just like the others.
1836 * src/print.c (print_grammar): Don't special case the eof token.
1837 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1838 lie anyway, albeit pleasant.
1839 * tests/calc.at: Exercise error messages with eoftoken.
1840 Change the grammar so that empty input is invalid.
1841 Adjust expectations.
1842 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1843
ec2da99f
AD
18442001-12-27 Akim Demaille <akim@epita.fr>
1845
1846 * configure.in: Check the protos of strchr ans strspn.
1847 Replace strchr if needed.
1848 * src/system.h: Provide the protos of strchr, strspn and memchr if
1849 missing.
1850 * lib/strchr.c: New.
1851 * src/reader.c (symbols_save): Use strchr.
1852
8adfa272
AD
18532001-12-27 Akim Demaille <akim@epita.fr>
1854
1855 * src/print.c, src/print_graph.c (escape): New.
1856 Use it to quote the TAGS outputs.
1857 * src/print_graph.c (print_state): Now errors are in red, and
1858 reductions in green.
1859 Prefer high to wide: output the state number on a line of its own.
1860
80dac38c
AD
18612001-12-27 Akim Demaille <akim@epita.fr>
1862
1863 * src/state.h, src/state.c (reductions_new): New.
1864 * src/LR0.c (set_state_table): Let all the states have a
1865 `reductions', even if reduced to 0.
1866 (save_reductions): Adjust.
1867 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1868 * src/print.c (print_reductions, print_actions): Adjust.
1869 * src/output.c (action_row): Adjust.
1870
2cec70b9
AD
18712001-12-27 Akim Demaille <akim@epita.fr>
1872
1873 * src/state.h, src/state.c (errs_new, errs_dup): New.
1874 * src/LR0.c (set_state_table): Let all the states have an errs,
1875 even if reduced to 0.
1876 * src/print.c (print_errs, print_reductions): Adjust.
1877 * src/output.c (output_actions, action_row): Adjust.
1878 * src/conflicts.c (resolve_sr_conflict): Adjust.
1879
13ca549a
AD
18802001-12-27 Akim Demaille <akim@epita.fr>
1881
1882 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1883
5092aba5
AD
18842001-12-27 Akim Demaille <akim@epita.fr>
1885
1886 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1887 * src/print.c: here.
1888 (lookaheadset, shiftset): New, used as additional storage by
1889 print_reductions.
1890 (print_results): Adjust.
1891 (print_shifts, print_gotos, print_errs): New, extracted from...
1892 (print_actions): here.
1893 * src/print_graph.c (print_actions): Remove dead code.
1894
11e2beca
AD
18952001-12-27 Akim Demaille <akim@epita.fr>
1896
1897 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1898 `$n' and `@n'.
1899
dac3c910
AD
19002001-12-27 Akim Demaille <akim@epita.fr>
1901
1902 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1903 (build_relations): Adjust.
1904
d0b0fefa
AD
19052001-12-27 Akim Demaille <akim@epita.fr>
1906
1907 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1908 duplication.
1909
adc8c848
AD
19102001-12-27 Akim Demaille <akim@epita.fr>
1911
1912 * src/reader.c (packgram): Catch nitems overflows.
1913
14d293ac
AD
19142001-12-27 Akim Demaille <akim@epita.fr>
1915
1916 * src/files.c, src/files.h (guard_obstack): Remove.
1917 * src/output.c (output): Adjust.
1918 * src/reader.c (parse_braces): New, factoring...
1919 (copy_action, copy_guard): these two which are renamed as...
1920 (parse_action, parse_guard): these.
1921 As a voluntary consequence, using braces around guards is now
1922 mandatory.
1923
f499b062
AD
19242001-12-27 Akim Demaille <akim@epita.fr>
1925
1926 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1927 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1928 members.
1929 (symbol_list_new): Adjust.
1930 (copy_action): action_line is the first line, not the last.
1931 (copy_guard): Just as for actions, store the `action' only, not
1932 the switch/case/break flesh.
1933 Don't parse the user action that might follow the guard, let...
1934 (readgram): do it, i.e., now, there can be an action after a
1935 guard.
1936 In other words the guard is just explicitly optional.
1937 (packgram): Adjust.
1938 * src/output.c (guards_output): New.
1939 (output_parser): Call it when needed.
1940 (output): Also free the guard and attrs obstacks.
1941 * src/files.c, src/files.h (obstack_save): Remove.
1942 (output_files): Remove.
1943 As a result, if one needs the former `.act' file, using an
1944 appropriate skeleton which requires actions and guards is now
1945 required.
1946 * src/main.c (main): Adjust.
1947 * tests/semantic.at: New.
1948 * tests/regression.at: Use `input.y' as input file name.
1949 Avoid 8+3 problems by requiring input.c when the test needs the
1950 parser.
1951
d945f5cd
AD
19522001-12-27 Akim Demaille <akim@epita.fr>
1953
1954 * src/reader.c (symbol_list_new): Be sure to initialize all the
1955 fields.
1956
d200e455
AD
19572001-12-27 Akim Demaille <akim@epita.fr>
1958
1959 All the hacks using a final pseudo state are now useless.
1960
1961 * src/LR0.c (set_state_table): state_table holds exactly nstates.
1962 * src/lalr.c (nLA): New.
1963 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
1964 instead of lookaheadsp from the pseudo state (nstate + 1).
1965
f9507c28
AD
19662001-12-27 Akim Demaille <akim@epita.fr>
1967
1968 * src/output.c (action_row, token_actions): Use a state_t instead
1969 of a integer, and nlookaheads instead of the following state's
1970 lookaheadsp.
1971
065fbd27
AD
19722001-12-27 Akim Demaille <akim@epita.fr>
1973
1974 * src/conflicts.c (log_resolution, flush_shift)
1975 (resolve_sr_conflict, set_conflicts, solve_conflicts)
1976 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
1977 (conflicts_print, print_reductions): Use a state_t instead of an
1978 integer when referring to a state.
1979 As much as possible, depend upon nlookaheads, instead of the
1980 `lookaheadsp' member of the following state (since lookaheads of
1981 successive states are successive, the difference between state n + 1
1982 and n served as the number of lookaheads for state n).
1983 * src/lalr.c (add_lookback_edge): Likewise.
1984 * src/print.c (print_core, print_actions, print_state)
1985 (print_results): Likewise.
1986 * src/print_graph.c (print_core, print_actions, print_state)
1987 (print_graph): Likewise.
1988 * src/conflicts.h: Adjust.
1989
1b177bd7
AD
19902001-12-27 Akim Demaille <akim@epita.fr>
1991
1992 * src/bison.hairy: Formatting/comment changes.
1993 ANSIfy.
1994 Remove `register' indications.
1995 Add plenty of `static'.
1996
7742ddeb
AD
19972001-12-27 Akim Demaille <akim@epita.fr>
1998
1999 * src/output.c (prepare): Drop the muscle `ntbase' which
2000 duplicates ntokens.
2001 * src/bison.simple: Formatting/comment changes.
2002 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2003 is an undocumented synonym.
2004
1fa14068
AD
20052001-12-22 Akim Demaille <akim@epita.fr>
2006
2007 * src/output.c (output_table_data): Change the prototype to use
2008 `int' for array ranges: some invocations do pass an int, not a
2009 short.
2010 Reported by Wayne Green.
2011
b9752825
AD
20122001-12-22 Akim Demaille <akim@epita.fr>
2013
2014 Some actions of web2c.y are improperly triggered.
2015 Reported by Mike Castle.
2016
2017 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2018 * tests/regression.at (Web2c): Rename as...
2019 (Web2c Report): this.
2020 (Web2c Actions): New.
2021
776209d6
AD
20222001-12-22 Akim Demaille <akim@epita.fr>
2023
2024 Reductions in web2c.y are improperly reported.
2025 Reported by Mike Castle.
2026
2027 * src/conflicts.c (print_reductions): Fix.
2028 * tests/regression.at (Web2c): New.
2029
275fc3ad
AD
20302001-12-18 Akim Demaille <akim@epita.fr>
2031
2032 Some host fail on `assert (!"foo")', which expands to
2033 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2034 Reported by Nelson Beebee.
2035
2036 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2037 `#define it_succeeded 0' and `assert (it_succeeded)'.
2038
897668ee
MA
20392001-12-17 Marc Autret <autret_m@epita.fr>
2040
2041 * src/bison.simple: Don't hard code the skeleton line and filename.
2042 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2043 New line counter 'skeleton_line' (skeleton-line muscle).
2044
ab3399e0
PE
20452001-12-17 Paul Eggert <eggert@twinsun.com>
2046
2047 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2048 YYDEBUG must be defined to a nonzero value.
2049
2050 * src/bison.simple (yytname): Do not assume that the user defines
2051 YYDEBUG to a properly parenthesized expression.
2052
3877f72b
AD
20532001-12-17 Akim Demaille <akim@epita.fr>
2054
2055 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2056 nlookaheads is a new member.
2057 Adjust all users.
2058 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2059 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2060 state.
776209d6 2061
331dbc1b
AD
20622001-12-17 Akim Demaille <akim@epita.fr>
2063
2064 * src/files.h, src/files.c (open_files, close_files): Remove.
2065 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2066 let...
2067 * src/reader.c (reader): Do it.
776209d6 2068
be750e4c
AD
20692001-12-17 Akim Demaille <akim@epita.fr>
2070
2071 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2072
709ae8c6
AD
20732001-12-17 Akim Demaille <akim@epita.fr>
2074
2075 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2076 (flush_reduce): New.
2077 (resolve_sr_conflict): Adjust.
776209d6 2078
f87685c3
AD
20792001-12-17 Akim Demaille <akim@epita.fr>
2080
2081 * src/output.c (output_obstack): Be static and rename as...
2082 (format_obstack): this, to avoid any confusion with files.c's
2083 output_obstack.
2084 * src/reader.h (muscle_obstack): Move to...
2085 * src/output.h: here, since it's defined in output.c.
2086
837491d8
AD
20872001-12-17 Akim Demaille <akim@epita.fr>
2088
2089 * src/output.c (action_row, save_column, default_goto)
2090 (sort_actions, matching_state, pack_vector): Better variable
2091 locality.
2092
796d61fb
AD
20932001-12-17 Akim Demaille <akim@epita.fr>
2094
2095 * src/output.c: Various formatting changes.
776209d6 2096
64d15509
AD
20972001-12-17 Akim Demaille <akim@epita.fr>
2098
2099 * src/files.c (output_files): Free the output_obstack.
2100 * src/main.c (main): Call print and print_graph conditionally.
2101 * src/print.c (print): Work unconditionally.
2102 * src/print_graph.c (print_graph): Work unconditionally.
2103 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2104
fbc8ecb7
MA
21052001-12-16 Marc Autret <autret_m@epita.fr>
2106
2107 * src/output.c (actions_output): Fix. When we use %no-lines,
2108 there is one less line per action.
2109
f0440388
MA
21102001-12-16 Marc Autret <autret_m@epita.fr>
2111
2112 * src/bison.simple: Remove a useless #line directive.
2113 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2114 * src/output.c (get_lines_number): New.
776209d6 2115 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2116 output muscles.
2117 Fix line numbering.
2118 (actions_output): Computes the number of lines taken by actions.
2119 (output_master_parser): Insert new skeleton which is the name of
2120 the output parser file name.
2121
a79986b8
MA
21222001-12-15 Marc Autret <autret_m@epita.fr>
2123
2124 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2125
4ec8e00f
MA
21262001-12-15 Marc Autret <autret_m@epita.fr>
2127
2128 * src/output.c (output_gram): Keep track of the hairy one.
2129
1a4648ff
AD
21302001-12-15 Akim Demaille <akim@epita.fr>
2131
2132 Make `make distcheck' work.
2133
2134 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2135 system.h which uses libgettext.h.
2136
9c2c67e6
AD
21372001-12-15 Akim Demaille <akim@epita.fr>
2138
2139 * src/nullable.c (set_nullable): Useless rules must be skipped,
2140 otherwise, since we range over their symbols, we might look at a
2141 nonterminal which no longer ``exists'', i.e., it is not counted in
2142 `nvars', hence we overflow our arrays.
2143
93ede233
AD
21442001-12-15 Akim Demaille <akim@epita.fr>
2145
2146 The header can also be produced directly, without any obstack!
2147 Yahoo!
2148
2149 * src/files.c, src/files.h (defines_obstack): Remove.
2150 (compute_header_macro): Global.
2151 (defines_obstack_save): Remove.
2152 * src/reader.c (parse_union_decl): No longer output to
2153 defines_obstack: its content can be found in the `stype' muscle
2154 anyway.
2155 (output_token_translations): Merge into...
2156 (symbols_output): this.
2157 Rename as...
2158 (symbols_save): this.
2159 (reader): Adjust.
2160 * src/output.c (header_output): New.
2161 (output): Call it.
2162
2666f928
AD
21632001-12-15 Akim Demaille <akim@epita.fr>
2164
2165 * src/reader.c (parse_union_decl): Instead of handling two obstack
2166 simultaneously, use one to define the `stype' muscle, and use the
2167 value of the latter to fill defines_obstack.
2168 (copy_comment): Remove.
2169 (copy_comment2): Work for a single obstack.
2170 Rename as...
2171 (copy_comment): this.
2172
428046f8
AD
21732001-12-15 Akim Demaille <akim@epita.fr>
2174
2175 * src/lex.c, src/lex.h (xgetc): No longer static.
2176 * src/reader.c (parse_union_decl): Revamp.
2177
ea52d706
AD
21782001-12-15 Akim Demaille <akim@epita.fr>
2179
2180 Still making progress in separating Bison into (i) input, (ii)
2181 process, (iii) output: now we can directly output the parser file
2182 without using table_obstack at all.
2183
2184 * src/files.c, src/files.h (table_obstack): Bye bye.
2185 (parser_file_name): New.
2186 * src/files.c (compute_output_file_names): Compute it.
2187 * src/output.c (actions_output, output_parser)
2188 (output_master_parser): To a file instead of an obstack.
2189
3f96f4dc
AD
21902001-12-15 Akim Demaille <akim@epita.fr>
2191
2192 Attach actions to rules, instead of pre-outputting them to
2193 actions_obstack.
2194
2195 * src/gram.h (rule_t): action and action_line are new members.
2196 * src/reader.c (symbol_list): Likewise.
2197 (copy_action): Save the actions within the rule.
2198 (packgram): Save them in rule_table.
2199 * src/output.c (actions_output): New.
2200 (output_parser): Use it on `%%actions'.
2201 (output_rule_data): Don't free rule_table.
2202 (output): Do it.
2203 (prepare): Don't save the `action' muscle.
2204 * src/bison.simple: s/%%action/%%actions/.
2205
51576fb3
AD
22062001-12-15 Akim Demaille <akim@epita.fr>
2207
2208 * src/reader.c (copy_action): When --yacc, don't append a `;'
2209 to the user action: let it fail if lacking.
dee049eb 2210 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 2211
2648a72d
AD
22122001-12-14 Akim Demaille <akim@epita.fr>
2213
2214 * src/lex.c (literalchar): Simply return the char you decoded, non
2215 longer mess around with obstacks and int pointers.
2216 Adjust all callers.
2217
92790e5b
AD
22182001-12-14 Akim Demaille <akim@epita.fr>
2219
2220 * src/lex.c (literalchar): Don't escape the special characters,
2221 just decode them, and keep them as char (before, eol was output as
2222 the 2 char string `\n' etc.).
2223 * src/output.c (output_rule_data): Use quotearg to output the
2224 token strings.
2225
927c1557
PE
22262001-12-13 Paul Eggert <eggert@twinsun.com>
2227
2228 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2229 Do not infringe on the global user namespace when using C++.
2230 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2231 All uses of `fprintf' and `stderr' changed.
2232
2233 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2234
ed8e1f68
AD
22352001-12-13 Akim Demaille <akim@epita.fr>
2236
2237 The computation of nullable is broken: it doesn't handle empty
2238 RHS's properly.
2239
2240 * tests/torture.at (GNU AWK Grammar): New.
2241 * tests/sets.at (Nullable): New.
2242 * src/nullable.c (set_nullable): Instead of blindly looping over
2243 `ritems', loop over the rules, and then over their rhs's.
2244
2245 Work around Autotest bugs.
2246
2247 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2248 frame, because Autotest understand lines starting with a `+' as
2249 traces from the shell. Then, they are not processed properly.
2250 Admittedly an Autotest bug, but we don't have time to wait for
2251 Autotest to catch up.
2252 * tests/regression.at (Broken Closure): Adjust to the new table
2253 frames.
2254 Move to...
2255 * tests/sets.at: here.
2256
cb581495
AD
22572001-12-13 Akim Demaille <akim@epita.fr>
2258
2259 * src/closure.c (closure): Use nrules instead of playing tricks
2260 with BITS_PER_WORD.
2261
2e729273
AD
22622001-12-13 Akim Demaille <akim@epita.fr>
2263
2264 * src/print.c (print_actions): Output the handling of `$' as the
2265 traces do: shifting the token EOF. Before EOF was treated as a
2266 nonterminal.
2267 * tests/regression.at: Adjust some tests.
2268 * src/print_graph.c (print_core): Complete the set of items via
2269 closure. The next-to-final and final states are still unsatisfying,
2270 but that's to be addressed elsewhere.
2271 No longer output the rule numbers, but do output the state number.
2272 A single loop for the shifts + gotos is enough, but picked a
2273 distinct color for each.
2274 (print_graph): Initialize and finalize closure.
2275
107f7dfb
AD
22762001-12-13 Akim Demaille <akim@epita.fr>
2277
2278 * src/reader.c (readgram): Remove dead code, an strip useless
2279 braces.
2280 (get_type): Remove, unused.
2281
9b53a24f
AD
22822001-12-12 Akim Demaille <akim@epita.fr>
2283
2284 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
2285 on that of lib/error.c.
2286
dbfb6dcd
AD
22872001-12-12 Akim Demaille <akim@epita.fr>
2288
2289 Some hosts don't like `/' in includes.
2290
2291 * src/system.h: Include libgettext.h without qualifying the path.
2292 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
2293 $(top_srcdir).
2294
c25fb648
MA
22952001-12-11 Marc Autret <autret_m@epita.fr>
2296
2297 * src/output.c (output_parser): Remove useless muscle.
2298
710ddc4f
MA
22992001-12-11 Marc Autret <autret_m@epita.fr>
2300
2301 * src/bison.simple: Remove #line just before %%epilogue. It
2302 is now handled in ...
2303 * src/reader.c (read_additionnal_code): Add the output of a
2304 #line for the epilogue.
2305
e83d80b8
MA
23062001-12-10 Marc Autret <autret_m@epita.fr>
2307
927c1557 2308 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
2309 replace precedent remove.
2310 * src/bison.simple: Remove #line before %%prologue because
2311 %%input-line is wrong at this time.
2312
971d5158
MA
23132001-12-10 Marc Autret <autret_m@epita.fr>
2314
2315 * src/reader.c (symbols_output): Clean up.
927c1557 2316 * src/output.c (output_gram, output): Clean up.
971d5158 2317
5edafffd
AD
23182001-12-10 Akim Demaille <akim@epita.fr>
2319
2320 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2321 * src/LR0.c (set_state_table): here.
2322 * src/lalr.c (lalr): Call it.
2323
0279f8e9
AD
23242001-12-10 Akim Demaille <akim@epita.fr>
2325
2326 * src/state.h (shifts): Remove the `number' member: shifts are
2327 attached to state, hence no longer need to be labelled with a
2328 state number.
2329
190c4f5f
AD
23302001-12-10 Akim Demaille <akim@epita.fr>
2331
2332 Now that states have a complete set of members, the linked list of
2333 shifts is useless: just fill directly the state's shifts member.
2334
2335 * src/state.h (shifts): Remove the `next' member.
2336 * src/LR0.c (first_state, last_state): Remove.
2337 Adjust the callers.
2338 (augment_automaton): Don't look for the shifts that must be added
2339 a shift on EOF: it is those of the state we looked for! But now,
2340 since shifts are attached, it is no longer needed to looking
2341 merely by its id: its number.
2342
2a73b93d
AD
23432001-12-10 Akim Demaille <akim@epita.fr>
2344
2345 * src/LR0.c (augment_automaton): Better variable locality.
2346 Remove an impossible branch: if there is a state corresponding to
2347 the start symbol being shifted, then there is shift for the start
2348 symbol from the initial state.
2349
74392f6a
AD
23502001-12-10 Akim Demaille <akim@epita.fr>
2351
2352 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2353 only when appropriate: when insert_start_shifting_state' is not
2354 invoked.
2355 * tests/regression.at (Rule Line Numbers): Adjust.
2356
37c82725
AD
23572001-12-10 Akim Demaille <akim@epita.fr>
2358
2359 * src/LR0.c (augment_automaton): Now that all states have shifts,
2360 merge the two cases addition shifts to the initial state.
2361
6a164e0c
AD
23622001-12-10 Akim Demaille <akim@epita.fr>
2363
2364 * src/lalr.c (set_state_table): Move to...
2365 * src/LR0.c: here.
2366 * src/lalr.c (lalr): Don't call it...
2367 * src/LR0.c (generate_states): do it.
2368 * src/LR0.h (first_state): Remove, only the table is used.
2369
7215de24
AD
23702001-12-10 Akim Demaille <akim@epita.fr>
2371
2372 * src/LR0.h (first_shift, first_reduction): Remove.
2373 * src/lalr.c: Don't use first_shift: find shifts through the
2374 states.
2375
80e25d4d
AD
23762001-12-10 Akim Demaille <akim@epita.fr>
2377
2378 * src/LR0.c: Attach shifts to states as soon as they are
2379 computed.
2380 * src/lalr.c (set_state_table): Instead of assigning shifts to
2381 state, just assert that the mapping was properly done.
2382
0ab3728b
AD
23832001-12-10 Akim Demaille <akim@epita.fr>
2384
2385 * src/LR0.c (insert_start_shift): Rename as...
2386 (insert_start_shifting_state): this.
2387 (insert_eof_shifting_state, insert_accepting_state): New.
2388 (augment_automaton): Adjust.
2389 Better locality of the variables.
2390 When looking if the start_symbol is shifted from the initial
2391 state, using `while (... symbol != start_symbol ...)' sounds
2392 better than `while (... symbol < start_symbol ...)': If fail
2393 to see how the order between symbols could be relevant!
2394
78af9bbc
AD
23952001-12-10 Akim Demaille <akim@epita.fr>
2396
2397 * src/getargs.h: Don't declare `spec_name_prefix' and
2398 `spec_file_prefix', declared by src/files.h.
2399 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2400 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2401 * src/output.c (prepare): Adjust.
2402 * src/reader.c (symbols_output): Likewise.
2403 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2404
bdef2a41
AD
24052001-12-10 Akim Demaille <akim@epita.fr>
2406
2407 * src/muscle_tab.c (muscle_init): NULL is a better default than
2408 `"0"'.
2409
3735969c
AD
24102001-12-10 Akim Demaille <akim@epita.fr>
2411
2412 * src/reader.c (reader): Calling symbols_output once is enough.
2413
49701457
AD
24142001-12-10 Akim Demaille <akim@epita.fr>
2415
2416 Now that states have a complete set of members, the linked list of
2417 reductions is useless: just fill directly the state's reductions
2418 member.
2419
2420 * src/state.h (struct reductions): Remove member `number' and
2421 `next'.
2422 * src/LR0.c (first_reduction, last_reduction): Remove.
2423 (save_reductions): Don't link the new reductions, store them in
2424 this_state.
2425 * src/lalr.c (set_state_table): No need to attach reductions to
2426 states, it's already done.
2427 * src/output.c (output_actions): No longer free the shifts, then
2428 the reductions, then the states: free all the states and their
2429 members.
2430
0edad749
AD
24312001-12-10 Akim Demaille <akim@epita.fr>
2432
2433 * src/options.c (OPTN, DRTV, BOTH): New.
2434 (option_table): Use them.
2435
0edad749
AD
2436 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2437 the job of system.h.
2438 * src/options.c: Don't include stdio.h and xalloc.h for the same
2439 reasons.
2440
5449dd0f
AD
24412001-12-10 Akim Demaille <akim@epita.fr>
2442
2443 * src/output.c (output, prepare): Make sure the values of the
2444 muscles `action' and `prologue' are 0-terminated.
2445
a870c567
AD
24462001-12-10 Akim Demaille <akim@epita.fr>
2447
2448 Clean up GCC warnings.
2449
2450 * src/reader.c (copy_action): `buf' is not used.
2451 (parse_skel_decl): Be static.
2452 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2453 * src/options.h (create_long_option_table): Have a real prototype.
2454 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2455 (hash_delete_at): Return const void *.
2456 Adjust casts to preserve the const.
2457
80df8768
AD
24582001-12-10 Akim Demaille <akim@epita.fr>
2459
2460 * configure.in: Require 2.52g.
2461 M4 is not needed, but AUTOM4TE is.
2462 * m4/m4.m4: Remove.
2463 * tests/Makefile.am: Adjust.
2464
f693ad14
AD
24652001-12-10 Akim Demaille <akim@epita.fr>
2466
2467 One structure for states is enough, even though theoretically
2468 there are LR(0) states and LALR(1) states.
2469
2470 * src/lalr.h (state_t): Remove.
2471 (state_table): Be state_t **, not state_t *.
2472 * src/state.h (core, CORE_ALLOC): Rename as...
2473 (state_t, STATE_ALLOC): this.
2474 Add the LALR(1) members: shifts, reductions, errs.
2475 * src/LR0.c (state_table): Rename as...
2476 (state_hash): this, to avoid name clashes with the global
2477 `state_table'.
2478 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2479 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2480
74ffbcb6
AD
24812001-12-10 Akim Demaille <akim@epita.fr>
2482
2483 Bison dumps core on bash.y.
2484 Reported by Pascal Bart.
2485
2486 * src/warshall.c (bitmatrix_print): New.
2487 (TC): Use it.
2488 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2489 j must be the outer loop.
2490 * tests/regression.at (Broken Closure): New.
2491
07708e19
AD
24922001-12-05 Akim Demaille <akim@epita.fr>
2493
2494 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2495 its argument.
2496