]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/reader.c (parse_action): Don't store directly into the
[bison.git] / ChangeLog
CommitLineData
2e047461
AD
12002-06-11 Akim Demaille <akim@epita.fr>
2
3 * src/reader.c (parse_action): Don't store directly into the
4 rule's action member: return the action as a string.
5 Don't require `rule_length' as an argument: compute it.
6 (grammar_current_rule_symbol_append)
7 (grammar_current_rule_action_append): New, eved out from
8 (readgram): here.
9 Remove `action_flag', `rulelength', unused now.
10
9af3fbce
AD
112002-06-11 Akim Demaille <akim@epita.fr>
12
13 * src/reader.c (grammar_current_rule_prec_set).
14 (grammar_current_rule_check): New, eved out from...
15 (readgram): here.
16 Remove `xaction', `first_rhs': useless.
17 * tests/input.at (Type clashes): New.
18 * tests/existing.at (GNU Cim Grammar): Adjust.
19
1485e106
AD
202002-06-11 Akim Demaille <akim@epita.fr>
21
22 * src/reader.c (grammar_midrule_action): New, Eved out from
23 (readgram): here.
24
da4160c3
AD
252002-06-11 Akim Demaille <akim@epita.fr>
26
27 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
28 New.
29 (readgram): Use them as replacement of inlined code, crule and
30 crule1.
31
f6d0f937
AD
322002-06-11 Akim Demaille <akim@epita.fr>
33
34 * src/reader.c (grammar_end, grammar_symbol_append): New.
35 (readgram): Use them.
36 Make the use of `p' as local as possible.
37
69078d4b
AD
382002-06-10 Akim Demaille <akim@epita.fr>
39
40 GCJ's parser requires the tokens to be defined before the prologue.
41
42 * data/bison.simple: Output the token definition before the user's
43 prologue.
44 * tests/regression.at (Braces parsing, Duplicate string)
45 (Mixing %token styles): Check the output from bison.
46 (Early token definitions): New.
47
5e424082
AD
482002-06-10 Akim Demaille <akim@epita.fr>
49
50 * src/symtab.c (symbol_user_token_number_set): Don't complain when
51 assigning twice the same user number to a token, so that we can
52 use it in...
53 * src/lex.c (lex): here.
54 Also use `symbol_class_set' instead of hand written code.
55 * src/reader.c (parse_assoc_decl): Likewise.
56
44536b35
AD
572002-06-10 Akim Demaille <akim@epita.fr>
58
59 * src/symtab.c, src/symtab.c (symbol_class_set)
60 (symbol_user_token_number_set): New.
61 * src/reader.c (parse_token_decl): Use them.
62 Use a switch instead of ifs.
63 Use a single argument.
64
8b9f2372
AD
652002-06-10 Akim Demaille <akim@epita.fr>
66
67 Remove `%thong' support as it is undocumented, unused, duplicates
68 `%token's job, and creates useless e-mail traffic with people who
69 want to know what it is, why it is undocumented, unused, and
70 duplicates `%token's job.
71
72 * src/reader.c (parse_thong_decl): Remove.
73 * src/options.c (option_table): Remove "thong".
74 * src/lex.h (tok_thong): Remove.
75
3ae2b51f
AD
762002-06-10 Akim Demaille <akim@epita.fr>
77
78 * src/symtab.c, src/symtab.c (symbol_type_set)
79 (symbol_precedence_set): New.
80 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
81 (value_components_used): Remove, unused.
82
2f1afb73
AD
832002-06-09 Akim Demaille <akim@epita.fr>
84
85 Move symbols handling code out of the reader.
86
87 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
88 (axiom): Move to...
89 * src/symtab.h, src/symtab.c: here.
90
91 * src/gram.c (start_symbol): Remove: use startsymbol->number.
92 * src/reader.c (startval): Rename as...
93 * src/symtab.h, src/symtab.c (startsymbol): this.
94 * src/reader.c: Adjust.
95
96 * src/reader.c (symbol_check_defined, symbol_make_alias)
97 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
98 (token_translations_init)
99 Move to...
100 * src/symtab.c: here.
101 * src/reader.c (packsymbols): Move to...
102 * src/symtab.h, src/symtab.c (symbols_pack): here.
103 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
104 argument.
105
e9bca3ad
AD
1062002-06-03 Akim Demaille <akim@epita.fr>
107
108 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
109 then statements.
110
86eff183
AD
1112002-06-03 Akim Demaille <akim@epita.fr>
112
113 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
114 structs with non literals.
115 * src/scan-skel.l: never-interactive.
116 * src/conflicts.c (enum conflict_resolution_e): No trailing
117 comma.
118 * src/getargs.c (usage): Split long literal strings.
119 Reported by Hans Aberg.
120
717be197
AD
1212002-05-28 Akim Demaille <akim@epita.fr>
122
123 * data/bison.c++: Use C++ ostreams.
124 (cdebug_): New member.
125
670ddffd
AD
1262002-05-28 Akim Demaille <akim@epita.fr>
127
128 * src/output.c (output_skeleton): Be sure to allocate enough room
129 for `/' _and_ for `\0' in full_skeleton.
130
769b430f
AD
1312002-05-28 Akim Demaille <akim@epita.fr>
132
133 * data/bison.c++: Catch up with bison.simple:
134 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
135 and Paul Eggert <eggert@twinsun.com>: `error' handing.
136 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
137 and popping traces.
138
7067cb36
PH
1392002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
140
141 * src/output.c (output_skeleton): Put an explicit path in front of
142 the skeleton file name, rather than relying on the -I directory,
143 to partially alleviate effects of having a skeleton file lying around
144 in the current directory.
769b430f 145
4a713ec2
PH
1462002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
147
769b430f 148 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
149 obstack_printf should be obstack_fgrow1.
150
b408954b
AD
1512002-05-26 Akim Demaille <akim@epita.fr>
152
153 * src/state.h (state_t): `solved_conflicts' is a new member.
154 * src/LR0.c (new_state): Set it to 0.
155 * src/conflicts.h, src/conflicts.c (print_conflicts)
156 (free_conflicts, solve_conflicts): Rename as...
157 (conflicts_print, conflicts_free, conflicts_solve): these.
158 Adjust callers.
159 * src/conflicts.c (enum conflict_resolution_e)
160 (solved_conflicts_obstack): New, used by...
161 (log_resolution): this.
162 Adjust to attach the conflict resolution to each state.
163 Complete the description with the precedence/associativity
164 information.
165 (resolve_sr_conflict): Adjust.
166 * src/print.c (print_state): Output its solved_conflicts.
167 * tests/conflicts.at (Unresolved SR Conflicts)
168 (Solved SR Conflicts): Exercise --report=all.
169
a49aecd5
AD
1702002-05-26 Akim Demaille <akim@epita.fr>
171
172 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
173 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
174 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
175 (token_number_t, item_number_as_token_number)
176 (token_number_as_item_number, muscle_insert_token_number_table):
177 Rename as...
178 (symbol_number_t, item_number_as_symbol_number)
179 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
180 these, since it is more appropriate.
181
5504898e
AD
1822002-05-26 Akim Demaille <akim@epita.fr>
183
184 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
185 `Error:' lines.
186 * data/bison.simple (yystos) [YYDEBUG]: New.
187 (yyparse) [YYDEBUG]: Display the symbols which are popped during
188 error recovery.
189 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
190
ec3bc396
AD
1912002-05-25 Akim Demaille <akim@epita.fr>
192
193 * doc/bison.texinfo (Debugging): Split into...
194 (Tracing): this new section, its former contents, and...
195 (Understanding): this new section.
196 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
197 by...
198 (report_flag): this.
199 Adjust all dependencies.
200 (report_args, report_types, report_argmatch): New.
201 (usage, getargs): Report/support -r, --report.
202 * src/options.h
203 (struct option_table_struct): Rename as..,
204 (struct option_table_s): this.
205 Rename the `set_flag' member to `flag' to match with getopt_long's
206 struct.
207 * src/options.c (option_table): Split verbose into an entry for
208 %verbose, and another for --verbose.
209 Support --report/-r, so remove -r from the obsolete --raw.
210 * src/print.c: Attach full item sets and lookaheads reports to
211 report_flag instead of trace_flag.
212 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
213
78df8250
PE
2142002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
215 and Paul Eggert <eggert@twinsun.com>
769b430f 216
78df8250
PE
217 * data/bison.simple (yyparse): Correct error handling to conform to
218 POSIX and yacc. Specifically, after syntax error is discovered,
219 do not reduce further before shifting the error token.
220 Clean up the code a bit by removing the labels yyerrdefault,
221 yyerrhandle, yyerrpop.
222 * NEWS: Document the above.
223
c0c9ea05
PH
2242002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
225
226 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
227 type; it isn't always big enough, since it doesn't necessarily
228 include non-terminals.
769b430f 229 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
230 the latter can be removed.
231 (yy_token_number_type): Remove, only one use.
232 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
233 don't use TokenNumberType as element type.
769b430f 234
c0c9ea05
PH
235 * tests/regression.at: Modify expected output to agree with change
236 to yyr1 and yytranslate.
769b430f 237
6390a83f
FK
2382002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
239
240 * src/reader.c (parse_action): Use copy_character instead of
241 obstack_1grow.
242
db7c8e9a
AD
2432002-05-13 Akim Demaille <akim@epita.fr>
244
245 * tests/regression.at (Token definitions): Prototype yylex and
246 yyerror.
247
fcc61800
PH
2482002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
249
158c687b 250 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
251 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
252 32-bit arithmetic.
253 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
254
5683e9b2
AD
2552002-05-07 Akim Demaille <akim@epita.fr>
256
257 * tests/synclines.at: Be sure to prototype yylex and yyerror to
258 avoid GCC warnings.
259
0c2d3f4c
AD
2602002-05-07 Akim Demaille <akim@epita.fr>
261
262 Kill GCC warnings.
263
264 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
265 over the RHS of each rule.
266 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
267 * src/state.h (state_t): Member `nitems' is unsigned short.
268 * src/LR0.c (get_state): Adjust.
269 * src/reader.c (packgram): Likewise.
270 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
271 `Type'.
272 (muscle_insert_int_table): Remove, unused.
273 (prepare_rules): Remove `max'.
274
1565b720
AD
2752002-05-06 Akim Demaille <akim@epita.fr>
276
277 * src/closure.c (print_firsts): Display of the symbol tags.
278 (bitmatrix_print): Move to...
279 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
280 here.
281 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
282
cfaee611
AD
2832002-05-06 Akim Demaille <akim@epita.fr>
284
285 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
286 hash_do_for_each.
287
458be8e0
AD
2882002-05-06 Akim Demaille <akim@epita.fr>
289
290 * src/LR0.c (new_state, get_state): Instead of using the global
291 `kernel_size' and `kernel_base', have two new arguments:
292 `core_size' and `core'.
293 Adjust callers.
294
a900a624
AD
2952002-05-06 Akim Demaille <akim@epita.fr>
296
297 * src/reader.c (packgram): No longer end `ritem' with a 0
298 sentinel: it is not used.
299
d4e7d3a1
AD
3002002-05-05 Akim Demaille <akim@epita.fr>
301
302 New experimental feature: display the lookaheads in the report and
303 graph.
304
305 * src/print (print_core): When --trace-flag, display the rules
306 lookaheads.
307 * src/print_graph.c (print_core): Likewise.
308 Swap the arguments.
309 Adjust caller.
310
39ceb25b
AD
3112002-05-05 Akim Demaille <akim@epita.fr>
312
313 * tests/torture.at (Many lookaheads): New test.
314
5372019f
AD
3152002-05-05 Akim Demaille <akim@epita.fr>
316
317 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
318 (GENERATE_MUSCLE_INSERT_TABLE): this.
319 (output_int_table, output_unsigned_int_table, output_short_table)
320 (output_token_number_table, output_item_number_table): Replace with...
321 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
322 (muscle_insert_short_table, muscle_insert_token_number_table)
323 (muscle_insert_item_number_table): these.
324 Adjust all callers.
325 (prepare_tokens): Don't free `translations', since...
326 * src/reader.h, src/reader.c (grammar_free): do it.
327 Move to...
328 * src/gram.h, src/gram.c (grammar_free): here.
329 * data/bison.simple, data/bison.c++: b4_token_number_max is now
330 b4_translate_max.
331
5df5f6d5
AD
3322002-05-05 Akim Demaille <akim@epita.fr>
333
334 * src/output.c (output_unsigned_int_table): New.
335 (prepare_rules): `i' is unsigned.
336 `prhs', `rline', `r2' are unsigned int.
337 Rename muscle `rhs_number_max' as `rhs_max'.
338 Output muscles `prhs_max', `rline_max', and `r2_max'.
339 Free rline and r1.
340 * data/bison.simple, data/bison.c++: Adjust to use these muscles
341 to compute types instead of constant types.
342 * tests/regression.at (Web2c Actions): Adjust.
343
b87f8b21
AD
3442002-05-04 Akim Demaille <akim@epita.fr>
345
346 * src/symtab.h (SALIAS, SUNDEF): Rename as...
347 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
348 Adjust dependencies.
349 * src/output.c (token_definitions_output): Be sure not to output a
350 `#define 'a'' when fed with `%token 'a' "a"'.
351 * tests/regression.at (Token definitions): New.
352
8bb936e4
PE
3532002-05-03 Paul Eggert <eggert@twinsun.com>
354
355 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
356 for K&R C.
357
3582002-05-03 gettextize <bug-gnu-gettext@gnu.org>
359
360 * Makefile.am (SUBDIRS): Remove intl.
361 (EXTRA_DIST): Add config/config.rpath.
362
53c71a12
AD
3632002-05-03 Akim Demaille <akim@epita.fr>
364
365 * data/bison.simple (m4_if): Don't output empty enums.
366 And actually, output valid enum definitions :(.
367
289dd0cf
AD
3682002-05-03 Akim Demaille <akim@epita.fr>
369
370 * configure.bat: Remove, completely obsolete.
371 * Makefile.am (EXTRA_DIST): Adjust.
372 Don't distribute config.rpath...
373 * config/Makefile.am (EXTRA_DIST): Do it.
374
db85e524
AD
3752002-05-03 Akim Demaille <akim@epita.fr>
376
377 * configure.in (GETTEXT_VERSION): New.
378 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
379
83ccf991
AD
3802002-05-03 Akim Demaille <akim@epita.fr>
381
382 * data/bison.simple (b4_token_enum): New.
383 (b4_token_defines): Use it to output tokens both as #define and
384 enums.
385 Suggested by Paul Eggert.
386 * src/output.c (token_definitions_output): Don't output spurious
387 white spaces.
388
1f418995
AD
3892002-05-03 Akim Demaille <akim@epita.fr>
390
391 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
392
45119f04
RA
3932002-05-02 Robert Anisko <robert@lrde.epita.fr>
394
395 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
396 Update the stack class, give a try to deque as the default container.
397
b2d52318
AD
3982002-05-02 Akim Demaille <akim@epita.fr>
399
400 * data/bison.simple (yyparse): Do not implement @$ = @1.
401 (YYLLOC_DEFAULT): Adjust to do it.
402 * doc/bison.texinfo (Location Default Action): Fix.
403
3a8b4109
AD
4042002-05-02 Akim Demaille <akim@epita.fr>
405
406 * src/reader.c (parse_braces): Merge into...
407 (parse_action): this.
408
84614e13
AD
4092002-05-02 Akim Demaille <akim@epita.fr>
410
411 * configure.in (ALL_LINGUAS): Remove.
412 * po/LINGUAS, hr.po: New.
413
fdbcd8e2
AD
4142002-05-02 Akim Demaille <akim@epita.fr>
415
416 Remove the so called hairy (semantic) parsers.
417
418 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
419 * src/gram.h, src/gram.c (semantic_parser): Remove.
420 (rule_t): Remove the guard and guard_line members.
421 * src/lex.h (token_t): remove tok_guard.
422 * src/options.c (option_table): Remove %guard and %semantic_parser
423 support.
424 * src/output.c, src/output.h (guards_output): Remove.
425 (prepare): Adjust.
426 (token_definitions_output): Don't output the `T'
427 tokens (???).
428 (output_skeleton): Don't output the guards.
429 * src/files.c, src/files.c (attrsfile): Remove.
430 * src/reader.c (symbol_list): Remove the guard and guard_line
431 members.
432 Adjust dependencies.
433 (parse_guard): Remove.
434 * data/bison.hairy: Remove.
435 * doc/bison.texinfo (Environment Variables): Remove occurrences of
436 BISON_HAIRY.
437
82b6cb3f
AD
4382002-05-02 Akim Demaille <akim@epita.fr>
439
440 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
441 (parse_guard): Rename the formal argument `stack_offset' as
442 `rule_length', which is more readable.
443 Adjust callers.
444 (copy_at, copy_dollar): Instead of outputting the hard coded
445 values of $$, $n and so forth, output invocation to b4_lhs_value,
446 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
447 Note: this patch partially drops `semantic-parser' support: it
448 always does `rule_length - n', where semantic parsers ought to
449 always use `-n'.
82b6cb3f
AD
450 * data/bison.simple, data/bison.c++ (b4_lhs_value)
451 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
452
6cbfbcc5
AD
4532002-05-02 Akim Demaille <akim@epita.fr>
454
455 * configure.in (AC_INIT): Bump to 1.49b.
456 (AM_INIT_AUTOMAKE): Short invocation.
457
b8548114
AD
4582002-05-02 Akim Demaille <akim@epita.fr>
459
460 Version 1.49a.
461
c20cd1fa
AD
4622002-05-01 Akim Demaille <akim@epita.fr>
463
464 * src/skeleton.h: Remove.
465
8a9566d4
AD
4662002-05-01 Akim Demaille <akim@epita.fr>
467
468 * src/skeleton.h: Fix the #endif.
469 Reported by Magnus Fromreide.
470
8c6d399a
PE
4712002-04-26 Paul Eggert <eggert@twinsun.com>
472
473 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
474 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 475 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 476
2b7ed18a
RA
4772002-04-25 Robert Anisko <robert@lrde.epita.fr>
478
479 * src/scan-skel.l: Postprocess quadrigraphs.
480
481 * src/reader.c (copy_character): New function, used to output
482 single characters while replacing `[' and `]' with quadrigraphs, to
483 avoid troubles with M4 quotes.
484 (copy_comment): Output characters with copy_character.
485 (read_additionnal_code): Likewise.
486 (copy_string2): Likewise.
487 (copy_definition): Likewise.
488
489 * tests/calc.at: Exercise M4 quoting.
490
34a89c50
AD
4912002-04-25 Akim Demaille <akim@epita.fr>
492
493 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
494 between `!' and the command.
495 Reported by Paul Eggert.
496
0dd1580a
RA
4972002-04-24 Robert Anisko <robert@lrde.epita.fr>
498
499 * tests/calc.at: Exercise prologue splitting.
500
501 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
502 `b4_post_prologue' instead of `b4_prologue'.
503
504 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
505 muscles.
506 (output): Free pre_prologue_obstack and post_prologue_obstack.
507 * src/files.h, src/files.c (attrs_obstack): Remove.
508 (pre_prologue_obstack, post_prologue_obstack): New.
509 * src/reader.c (copy_definition): Add a parameter to specify the
510 obstack to fill, instead of using attrs_obstack unconditionally.
511 (read_declarations): Pass pre_prologue_obstack to copy_definition if
512 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
513
83c1796f
PE
5142002-04-23 Paul Eggert <eggert@twinsun.com>
515
516 * data/bison.simple: Remove unnecessary commentary and white
517 space differences from 1_29-branch.
518 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
519
520 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
521 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
522 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
523 constructors or destructors.
524
525 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
526
1207eeac
AD
5272002-04-23 Akim Demaille <akim@epita.fr>
528
529 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
530 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
531 location with columns.
532 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
533 All reported by Paul Eggert.
534
78ab8f67
AD
5352002-04-22 Akim Demaille <akim@epita.fr>
536
537 * src/reduce.c (dump_grammar): Move to...
538 * src/gram.h, src/gram.c (grammar_dump): here.
539 Be sure to separate long item numbers.
540 Don't read the members of a rule's prec if its nil.
541
133c20e2
AD
5422002-04-22 Akim Demaille <akim@epita.fr>
543
544 * src/output.c (table_size, table_grow): New.
545 (MAXTABLE): Remove, replace uses with table_size.
546 (pack_vector): Instead of dying when the table is too big, grow it.
547
9515e8a7
AD
5482002-04-22 Akim Demaille <akim@epita.fr>
549
550 * data/bison.simple (yyr1): Its type is that of a token number.
551 * data/bison.c++ (r1_): Likewise.
552 * tests/regression.at (Web2c Actions): Adjust.
553
23c5a174
AD
5542002-04-22 Akim Demaille <akim@epita.fr>
555
556 * src/reader.c (token_translations_init): 256 is now the default
557 value for the error token, i.e., it will be assigned another
558 number if the user assigned 256 to one of her tokens.
559 (reader): Don't force 256 to error.
560 * doc/bison.texinfo (Symbols): Adjust.
561 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
562 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
563 etc. instead of 10, 20, 30 (which was used to `jump' over error
564 (256) and undefined (2)).
565
5fbb0954
AD
5662002-04-22 Akim Demaille <akim@epita.fr>
567
568 Propagate more token_number_t.
569
570 * src/gram.h (token_number_as_item_number)
571 (item_number_as_token_number): New.
572 * src/output.c (GENERATE_OUTPUT_TABLE): New.
573 Use it to create output_item_number_table and
574 output_token_number_table.
575 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
576 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
577 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
578 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
579
4f940944
AD
5802002-04-22 Akim Demaille <akim@epita.fr>
581
582 * src/output.h, src/output.c (get_lines_number): Remove.
583
3ded9a63
AD
5842002-04-19 Akim Demaille <akim@epita.fr>
585
586 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
587 as Lex/Flex'.
588 (Debugging): More details about enabling the debugging features.
589 (Table of Symbols): Describe $$, $n, @$, and @n.
590 Suggested by Tim Josling.
591
e0c471a9
AD
5922002-04-19 Akim Demaille <akim@epita.fr>
593
594 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
595
fecc10cd
AD
5962002-04-10 Akim Demaille <akim@epita.fr>
597
598 * src/system.h: Rely on HAVE_LIMITS_H.
599 Suggested by Paul Eggert.
600
51dec47b
AD
6012002-04-09 Akim Demaille <akim@epita.fr>
602
603 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
604 full stderr, and strip it according to the bison options, instead
605 of composing the error message from different bits.
606 This makes it easier to check for several error messages.
607 Adjust all the invocations.
608 Add an invocation exercising the error token.
609 Add an invocation demonstrating a stupid error message.
610 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
611 Adjust the tests.
612 Error message are for stderr, not stdout.
613
007a50a4
AD
6142002-04-09 Akim Demaille <akim@epita.fr>
615
616 * src/gram.h, src/gram.c (error_token_number): Remove, use
617 errtoken->number.
618 * src/reader.c (reader): Don't specify the user token number (2)
619 for $undefined, as it uselessly prevents using it.
620 * src/gram.h (token_number_t): Move to...
621 * src/symtab.h: here.
622 (state_t.number): Is a token_number_t.
623 * src/print.c, src/reader.c: Use undeftoken->number instead of
624 hard coded 2.
625 (Even though this 2 is not the same as above: the number of the
626 undeftoken remains being 2, it is its user token number which
627 might not be 2).
628 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
629 `user_token_number_max'.
630 Output `undef_token_number'.
631 * data/bison.simple, data/bison.c++: Use them.
632 Be sure to map invalid yylex return values to
633 `undef_token_number'. This saves us from gratuitous SEGV.
634
635 * tests/conflicts.at (Solved SR Conflicts)
636 (Unresolved SR Conflicts): Adjust.
637 * tests/regression.at (Web2c Actions): Adjust.
638
06446ccf
AD
6392002-04-08 Akim Demaille <akim@epita.fr>
640
641 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
642 Adding #line.
643 Remove the duplicate `typedefs'.
644 (RhsNumberType): Fix the declaration and various other typos.
645 Use __ofile__.
646 * data/bison.simple: Use __ofile__.
647 * src/scan-skel.l: Handle __ofile__.
648
62a3e4f0
AD
6492002-04-08 Akim Demaille <akim@epita.fr>
650
651 * src/gram.h (item_number_t): New, the type of item numbers in
652 RITEM. Note that it must be able to code symbol numbers as
653 positive number, and the negation of rule numbers as negative
654 numbers.
655 Adjust all dependencies (pretty many).
656 * src/reduce.c (rule): Remove this `short *' pointer: use
657 item_number_t.
658 * src/system.h (MINSHORT, MAXSHORT): Remove.
659 Include `limits.h'.
660 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
661 (shortcpy): Remove.
662 (MAXTABLE): Move to...
663 * src/output.c (MAXTABLE): here.
664 (prepare_rules): Use output_int_table to output rhs.
665 * data/bison.simple, data/bison.c++: Adjust.
666 * tests/torture.at (Big triangle): Move the limit from 254 to
667 500.
668 * tests/regression.at (Web2c Actions): Ajust.
669
670 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
671 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
672 passes, but produces negative #line number, once fixed, GCC is
673 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
674 C), it passes.
675 * src/state.h (state_h): Code input lines on ints, not shorts.
676
bb88b0fc
AD
6772002-04-08 Akim Demaille <akim@epita.fr>
678
679 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
680 and then the grammar.
681
9a636f47
AD
6822002-04-08 Akim Demaille <akim@epita.fr>
683
684 * src/system.h: No longer using strndup.
685
680e8701
AD
6862002-04-07 Akim Demaille <akim@epita.fr>
687
688 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
689 * src/output.c (output_table_data): Return the longest number.
690 (prepare_tokens): Output `token_number_max').
691 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
692 New.
693 Use them to define yy_token_number_type/TokenNumberType.
694 Use this type for yytranslate.
695 * tests/torture.at (Big triangle): Push the limit from 124 to
696 253.
697 * tests/regression.at (Web2c Actions): Adjust.
698
817e9f41
AD
6992002-04-07 Akim Demaille <akim@epita.fr>
700
701 * tests/torture.at (Big triangle): New.
702 (GNU AWK Grammar, GNU Cim Grammar): Move to...
703 * tests/existing.at: here.
704
5123689b
AD
7052002-04-07 Akim Demaille <akim@epita.fr>
706
707 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
708 nritems.
709 Adjust dependencies.
710
f3849179
AD
7112002-04-07 Akim Demaille <akim@epita.fr>
712
713 * src/reader.c: Normalize increments to prefix form.
714
bd02036a
AD
7152002-04-07 Akim Demaille <akim@epita.fr>
716
717 * src/reader.c, symtab.c: Remove debugging code.
718
db8837cb
AD
7192002-04-07 Akim Demaille <akim@epita.fr>
720
721 Rename all the `bucket's as `symbol_t'.
722
723 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
724 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
725 * src/symtab.c, src/symtab.h (bucket): Rename as...
726 (symbol_t): this.
727 (symbol_list_new, bucket_check_defined, bucket_make_alias)
728 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
729 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
730 (buckets_new, buckets_free, buckets_do): Rename as...
731 (symbol_list_new, symbol_check_defined, symbol_make_alias)
732 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
733 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
734 (symbols_new, symbols_free, symbols_do): these.
735
72a23c97
AD
7362002-04-07 Akim Demaille <akim@epita.fr>
737
738 Use lib/hash for the symbol table.
739
740 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
741 EOF.
742 * src/lex.c (lex): Set the `number' member of new terminals.
743 * src/reader.c (bucket_check_defined, bucket_make_alias)
744 (bucket_check_alias_consistence, bucket_translation): New.
745 (reader, grammar_free, readgram, token_translations_init)
746 (packsymbols): Adjust.
747 (reader): Number the predefined tokens.
748 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
749 for predefined tokens.
750 * src/symtab.h (bucket): Remove all the hash table related
751 members.
752 * src/symtab.c (symtab): Replace by...
753 (bucket_table): this.
754 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
755 (buckets_new, buckets_do): New.
756
280a38c3
AD
7572002-04-07 Akim Demaille <akim@epita.fr>
758
759 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
760 (start_symbol, max_user_token_number, semantic_parser)
761 (error_token_number): Initialize.
762 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
763 Initialize.
764 (reader): Don't.
765 (errtoken, eoftoken, undeftoken, axiom): Extern.
766
03b31c0c
AD
7672002-04-07 Akim Demaille <akim@epita.fr>
768
769 * src/gram.h (rule_s): prec and precsym are now pointers
770 to the bucket giving the priority/associativity.
771 Member `associativity' removed: useless.
772 * src/reduce.c, src/conflicts.c: Adjust.
773
8b3df748
AD
7742002-04-07 Akim Demaille <akim@epita.fr>
775
776 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
777 Properly escape the symbols' TAG when outputting them.
778
e601aa1d
AD
7792002-04-07 Akim Demaille <akim@epita.fr>
780
781 * src/lalr.h (LA): Is a bitsetv, not bitset*.
782
b0299a2e
AD
7832002-04-07 Akim Demaille <akim@epita.fr>
784
785 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
786 (LArule): this, which is an array to rule_t*.
787 * src/print.c, src/conflicts.c: Adjust.
788
d7e1f00c
AD
7892002-04-07 Akim Demaille <akim@epita.fr>
790
791 * src/gram.h (rule_t): Rename `number' as `user_number'.
792 `number' is a new member.
793 Adjust dependencies.
794 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
795
cc9305dd
AD
7962002-04-07 Akim Demaille <akim@epita.fr>
797
798 As a result of the previous patch, it is no longer needed
799 to reorder ritem itself.
800
801 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
802
b0940840
AD
8032002-04-07 Akim Demaille <akim@epita.fr>
804
805 Be sure never to walk through RITEMS, but use only data related to
806 the rules themselves. RITEMS should be banished.
807
808 * src/output.c (output_token_translations): Rename as...
809 (prepare_tokens): this.
810 In addition to `translate', prepare the muscles `tname' and
811 `toknum', which were handled by...
812 (output_rule_data): this.
813 Remove, and move the remainder of its outputs into...
814 (prepare_rules): this new routines, which also merges content from
815 (output_gram): this.
816 (prepare_rules): Be sure never to walk through RITEMS.
817 (output_stos): Rename as...
818 (prepare_stos): this.
819 (output): Always invoke prepare_states, after all, just don't use it
820 in the output if you don't need it.
821
643a5994
AD
8222002-04-07 Akim Demaille <akim@epita.fr>
823
824 * src/LR0.c (new_state): Display `nstates' as the name of the
825 newly created state.
826 Adjust to initialize first_state and last_state if needed.
827 Be sure to distinguish the initial from the final state.
828 (new_states): Create the itemset of the initial state, and use
829 new_state.
830 * src/closure.c (closure): Now that the initial state has its
831 items properly set, there is no need for a special case when
832 creating `ruleset'.
833
834 As a result, now the rule 0, reducing to $axiom, is visible in the
835 outputs. Adjust the test suite.
836
837 * tests/conflicts.at (Solved SR Conflicts)
838 (Unresolved SR Conflicts): Adjust.
839 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
840 * tests/conflicts.at (S/R in initial): New.
841
b4c4ccc2
AD
8422002-04-07 Akim Demaille <akim@epita.fr>
843
844 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
845 the RHS of the rules.
846 * src/output.c (output_gram): Likewise.
847
bba97eb2
AD
8482002-04-07 Akim Demaille <akim@epita.fr>
849
850 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
851 bucket.
852 Adjust all dependencies.
853 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
854 `number' of the buckets too.
855 * src/gram.h: Include `symtab.h'.
856 (associativity): Move to...
857 * src/symtab.h: here.
858 No longer include `gram.h'.
859
c3b407f4
AD
8602002-04-07 Akim Demaille <akim@epita.fr>
861
862 * src/gram.h, src/gram.c (rules_rhs_length): New.
863 (ritem_longest_rhs): Use it.
864 * src/gram.h (rule_t): `number' is a new member.
865 * src/reader.c (packgram): Set it.
866 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
867 the end of `rules', and count them out of `nrules'.
868 (reduce_output, dump_grammar): Adjust.
869 * src/print.c (print_grammar): It is no longer needed to check for
870 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
871 * tests/reduce.at (Reduced Automaton): New test.
872
11652ab3
AD
8732002-04-07 Akim Demaille <akim@epita.fr>
874
875 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
876 lacking `+ 1' to nrules, Bison reported as useless a token if it
877 was used solely to set the precedence of the last rule...
878
26b23c1a
AD
8792002-04-07 Akim Demaille <akim@epita.fr>
880
881 * data/bison.c++, data/bison.simple: Don't output the current file
882 name in #line, to avoid useless diffs between two identical
883 outputs under different names.
884
18bcecb0
AD
8852002-04-07 Akim Demaille <akim@epita.fr>
886
887 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
888 Normalize loops to using `< nrules + 1', not `<= nrules'.
889
fa770c86
AD
8902002-04-07 Akim Demaille <akim@epita.fr>
891
892 * TODO: Update.
893
d9b739c3
AD
8942002-04-07 Akim Demaille <akim@epita.fr>
895
896 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
897 bucket.value as bucket.number.
898
99013900
AD
8992002-04-07 Akim Demaille <akim@epita.fr>
900
901 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
902 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
903 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
904 RHS, instead of being an index in RITEMS.
905
e966383b
PE
9062002-04-04 Paul Eggert <eggert@twinsun.com>
907
908 * doc/bison.texinfo: Update copyright date.
909 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
910 (Symbols): Warn about running Bison in one character set,
911 but compiling and/or running in an incompatible one.
912 Warn about character code 256, too.
913
9142002-04-03 Paul Eggert <eggert@twinsun.com>
915
916 * src/bison.data (YYSTACK_ALLOC): Depend on whether
917 YYERROR_VERBOSE is nonzero, not whether it is defined.
918
919 Merge changes from bison-1_29-branch.
c307773e 920
8d6c48b9
PE
9212002-03-20 Paul Eggert <eggert@twinsun.com>
922
923 Merge fixes from Debian bison_1.34-1.diff.
924
925 * configure.in (AC_PREREQ): 2.53.
926
e53c6322
AD
9272002-03-20 Akim Demaille <akim@epita.fr>
928
929 * src/conflicts.c (log_resolution): Argument `resolution' is const.
930
9ffbeca7
PE
9312002-03-19 Paul Eggert <eggert@twinsun.com>
932
21db0b2a
PE
933 * src/bison.simple (YYCOPY): New macro.
934 (YYSTACK_RELOCATE): Use it.
935 Remove Type arg; no longer needed. All callers changed.
936 (yymemcpy): Remove; no longer needed.
937
9ffbeca7
PE
938 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
939 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
940
642cb8f8
AD
9412002-03-19 Akim Demaille <akim@epita.fr>
942
943 Test and fix the #line outputs.
944
945 * tests/atlocal.at (GCC): New.
946 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
947 (Prologue synch line, ,%union synch line, Postprologue synch line)
948 (Action synch line, Epilogue synch line): New tests.
949 * src/reader.c (parse_union_decl): Define the muscle stype_line.
950 * data/bison.simple, data/bison.c++: Use it.
951
3c31a486
AD
9522002-03-19 Akim Demaille <akim@epita.fr>
953
954 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
955 (Solved SR Conflicts, %expect not enough, %expect right)
956 (%expect too much): Move to...
957 * tests/conflicts.at: this new file.
958
0d8bed56
AD
9592002-03-19 Akim Demaille <akim@epita.fr>
960
961 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
962 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
963 that we can move to enums for instance.
964 * src/output.c (token_definitions_output): Output a list of
965 `token-name, token-number' instead of the #define.
966 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
967
9208d17f
AD
9682002-03-14 Akim Demaille <akim@epita.fr>
969
970 Use Gettext 0.11.1.
971
af27eacb
RA
9722002-03-09 Robert Anisko <robert@lrde.epita.fr>
973
974 * data/bison.c++: Make the user able to add members to the generated
975 parser by subclassing.
976
9101a310
RA
9772002-03-05 Robert Anisko <robert@lrde.epita.fr>
978
979 * src/reader.c (read_additionnal_code): `c' should be an integer, not
980 a character.
981 Reported by Nicolas Tisserand and Nicolas Burrus.
982
fff9bf0b
RA
9832002-03-04 Robert Anisko <robert@lrde.epita.fr>
984
985 * src/reader.c: Warn about lacking semi-colons, do not complain.
986
64dba31e
RA
9872002-03-04 Robert Anisko <robert@lrde.epita.fr>
988
989 * data/bison.c++: Remove a debug line.
990
374f5a14
RA
9912002-03-04 Robert Anisko <robert@lrde.epita.fr>
992
993 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
994 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
995 provide a default implementation.
996
bfcf1f3a
AD
9972002-03-04 Akim Demaille <akim@epita.fr>
998
999 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1000 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1001 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1002 * tests/semantic.at (Parsing Guards): Similarly.
1003 * src/reader.at (readgram): Complain if the last rule is not ended
1004 with a semi-colon.
1005
65ccf9fc
AD
10062002-03-04 Akim Demaille <akim@epita.fr>
1007
1008 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1009 * src/closure.c: here.
1010 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1011 RTC.
1012 * src/warshall.h, src/warshall.c: Remove.
1013 * tests/sets.at (Broken Closure): Adjust.
1014
d0039cbc
AD
10152002-03-04 Akim Demaille <akim@epita.fr>
1016
1017 * src/output.c (output_skeleton): tempdir is const.
1018 bytes_read is unused.
1019
345cea78
AD
10202002-03-04 Akim Demaille <akim@epita.fr>
1021
1022 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1023 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1024 Update.
1025 From Michael Hayes.
1026
564801f7
AD
10272002-03-04 Akim Demaille <akim@epita.fr>
1028
1029 * src/closure.c (closure): `r' is unused.
1030
e5352bc7
AD
10312002-03-04 Akim Demaille <akim@epita.fr>
1032
1033 * tests/sets.at (Broken Closure): Add the ending `;'.
1034 * src/reader.at (readgram): Complain if a rule is not ended with a
1035 semi-colon.
1036
914feea9
AD
10372002-03-04 Akim Demaille <akim@epita.fr>
1038
1039 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1040 (count_sr_conflicts): Use bitset_count.
1041 * src/reduce.c (inaccessable_symbols): Ditto.
1042 (bits_size): Remove.
1043 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1044
f0250de6
AD
10452002-03-04 Akim Demaille <akim@epita.fr>
1046
1047 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1048 * src/reduce.c: Remove the `bitset_zero's following the
1049 `bitset_create's, as now it is performed by the latter.
1050
ef017502
AD
10512002-03-04 Akim Demaille <akim@epita.fr>
1052
1053 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1054 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1055 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1056 latest sources from Michael.
1057
76514394
AD
10582002-03-04 Akim Demaille <akim@epita.fr>
1059
1060 * src/output.c (output): Don't free the grammar.
1061 * src/reader.c (grammar_free): New.
1062 * src/main.c (main): Call it and don't free symtab here.
1063
55024580
AD
10642002-03-04 Akim Demaille <akim@epita.fr>
1065
1066 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1067 before returning.
1068 Reported by Benoit Perrot.
1069
f9abaa2c
AD
10702002-03-04 Akim Demaille <akim@epita.fr>
1071
1072 Use bitset operations when possible, not loops over bits.
1073
1074 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1075 bitset_or.
1076 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1077 * src/reduce.c (useless_nonterminals): Formatting changes.
1078 * src/warshall.c (TC): Use bitset_or.
1079
0e721e75
AD
10802002-03-04 Akim Demaille <akim@epita.fr>
1081
1082 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1083 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1084 Ditto.
1085
0fb1ffb1
AD
10862002-03-04 Akim Demaille <akim@epita.fr>
1087
1088 * src/lalr.c (F): Now a bitset*.
1089 Adjust all dependencies.
1090
b86796bf
AD
10912002-03-04 Akim Demaille <akim@epita.fr>
1092
1093 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1094 Adjust all dependencies.
1095
602bbf31
AD
10962002-03-04 Akim Demaille <akim@epita.fr>
1097
1098 * src/L0.c, src/LR0.h (nstates): Be size_t.
1099 Adjust comparisons (signed vs unsigned).
1100 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1101 bitset*.
1102 Adjust all dependencies.
1103
d8a0245c
AD
11042002-03-04 Akim Demaille <akim@epita.fr>
1105
1106 * src/closure.c (firsts): Now, also a bitset.
1107 Adjust all dependencies.
1108 (varsetsize): Remove, now unused.
1109 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1110
34ba9743
AD
11112002-03-04 Akim Demaille <akim@epita.fr>
1112
1113 * src/print.c: Convert to use bitset.h, not hand coded iterations
1114 over ints.
1115
ed86e78c
AD
11162002-03-04 Akim Demaille <akim@epita.fr>
1117
1118 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1119
dfdb1797
AD
11202002-03-04 Akim Demaille <akim@epita.fr>
1121
1122 * src/closure.c (ruleset): Be a bitset.
1123 (rulesetsize): Remove.
1124
7086e707
AD
11252002-03-04 Akim Demaille <akim@epita.fr>
1126
1127 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1128 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1129 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1130 * src/closure.c (fderives): Be an array of bitsets.
1131
98254360
RA
11322002-02-28 Robert Anisko <robert@lrde.epita.fr>
1133
1134 * data/bison.c++: Merge the two generated headers. Insert a copyright
1135 notice in each output file.
1136
a75c057f
AD
11372002-02-28 Akim Demaille <akim@epita.fr>
1138
1139 * data/bison.c++: Copy the prologue of bison.simple to fetch
1140 useful M4 definitions, such as b4_header_guard.
1141
06b00abc
AD
11422002-02-25 Akim Demaille <akim@epita.fr>
1143
1144 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1145 translator friendly scheme for the bgr
1146 copyright notice.
06b00abc 1147
70e7d534
AD
11482002-02-25 Akim Demaille <akim@epita.fr>
1149
1150 * src/output.c (header_output): Remove, now handled completely via
1151 M4.
1152
abe017f6
AD
11532002-02-25 Akim Demaille <akim@epita.fr>
1154
1155 * m4/m4.m4: New, from CVS Autoconf.
1156 * configure.in: Invoke it.
1157 * src/output.c (output_skeleton): Use its result instead of the
1158 hard coded name.
1159
381fb12e
AD
11602002-02-25 Akim Demaille <akim@epita.fr>
1161
1162 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1163 Fileutils 4.1.5.
1164 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1165 * src/output.c (output_skeleton): Use mkstemp to create a real
1166 temporary file.
1167 Move the filling of `skeleton' and its muscle to...
1168 (prepare): here.
1169 (output): Move the definition of the prologue muscle to...
1170 (prepare): here.
1171 * src/system.h (DEFAULT_TMPDIR): New.
1172
6f38107f
PE
11732002-02-14 Paul Eggert <eggert@twinsun.com>
1174
1175 Remove the support for C++ namespace cleanliness; it was
1176 causing more problems than it was curing, since it didn't work
1177 properly on some nonstandard C++ compilers. This can wait
1178 for a proper C++ parser.
1179
1180 * NEWS: Document this.
1181 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1182 of C++, as it's treated like C now.
1183 * src/bison.simple (YYSTD): Remove.
1184 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1185 Treat C++ just like Standard C instead of trying to support
1186 namespace cleanliness.
1187
80cce3da
AD
11882002-02-14 Akim Demaille <akim@epita.fr>
1189
1190 * tests/regression.at (else): Adjust to Andreas' change.
1191
842e8679
AD
11922002-02-14 Akim Demaille <akim@epita.fr>
1193
1194 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1195
4bda3f10
AD
11962002-02-13 Andreas Schwab <schwab@suse.de>
1197
1198 * src/output.c (output_rule_data): Don't output NULL, it might
1199 not be defined yet.
1200
4162fa07 12012002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 1202
4162fa07
RA
1203 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1204 (Copyright notice): Update.
b418ecd8 1205
bd16a5dc
AD
12062002-02-11 Akim Demaille <akim@epita.fr>
1207
1208 * tests/regression.at (%nonassoc and eof): Don't include
1209 nonportable headers.
1210
8d69a1a3
RA
12112002-02-08 Robert Anisko <robert@lrde.epita.fr>
1212
1213 * data/bison.c++: Correct error recovery. Make the user able to
1214 initialize the starting location.
1215
9b2d0677
AD
12162002-02-07 Akim Demaille <akim@epita.fr>
1217
1218 * tests/input.at: New.
1219
69e2658b
RA
12202002-02-07 Robert Anisko <robert@lrde.epita.fr>
1221
1222 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 1223 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
1224 directives around tables only needed for debugging.
1225
4aacc3a7
RA
12262002-02-07 Robert Anisko <robert@lrde.epita.fr>
1227
1228 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1229 C++ parsers.
1230 (yy::b4_name::parse): Use print_.
1231
762a801e
RA
12322002-02-07 Robert Anisko <robert@lrde.epita.fr>
1233
1234 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1235
4bb2bc3f
RA
12362002-02-07 Robert Anisko <robert@lrde.epita.fr>
1237
1238 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1239 C++ parsers.
1240 (yy::b4_name::parse): Build verbose error messages, and use error_.
1241
6b45a3ca
RA
12422002-02-06 Robert Anisko <robert@lrde.epita.fr>
1243
1244 * data/bison.c++: Fix m4 quoting in comments.
1245
50997c6e
RA
12462002-02-06 Robert Anisko <robert@lrde.epita.fr>
1247
1248 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1249 not expanded by m4.
1250
3f3eed27
AD
12512002-02-05 Akim Demaille <akim@epita.fr>
1252
1253 * data/bison.c++: Adjust to the M4 back end.
1254 More is certainly needed.
1255
be2a1a68
AD
12562002-02-05 Akim Demaille <akim@epita.fr>
1257
1258 Give a try to M4 as a back end.
1259
1260 * lib/readpipe.c: New, from wdiff.
1261 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1262 BISON_HAIRY.
1263 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1264 specific values. Now it is m4 that performs the lookup.
1265 * src/parse-skel.y: Remove.
1266 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1267 * src/output.c (actions_output, guards_output)
1268 (token_definitions_output): No longer keeps track of the output
1269 line number, hence remove the second argument.
1270 (guards_output): Check against the guard member of a rule, not the
1271 action member.
1272 Adjust callers.
1273 (output_skeleton): Don't look for the skeleton location, let m4 do
1274 that.
1275 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1276 file will be used.
1277 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1278 (prepare): Given that for the time being changesyntax is not
1279 usable in M4, rename the muscles using `-' to `_'.
1280 Define `defines_flag', `output_parser_name' and `output_header_name'.
1281 * src/output.h (actions_output, guards_output)
1282 (token_definitions_output): Adjust prototypes.
1283 * src/scan-skel.l: Instead of scanning the skeletons, it now
1284 processes the output of m4: `__oline__' and `#output'.
1285 * data/bison.simple: Adjust to be used by M4(sugar).
1286 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1287 to date.
1288 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1289 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1290 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1291 shamelessly stolen from CVS Autoconf.
1292
beda758b
AD
12932002-02-05 Akim Demaille <akim@epita.fr>
1294
1295 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1296 * configure.in: Check for the declarations of free and malloc.
1297 * src/muscle_tab.c: Adjust.
1298
5ece6d43
AD
12992002-02-05 Akim Demaille <akim@epita.fr>
1300
1301 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1302 which have no values.
1303
5bb18f9a
AD
13042002-02-05 Akim Demaille <akim@epita.fr>
1305
1306 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1307 * data/: here.
1308
894dd62e
PE
13092002-01-29 Paul Eggert <eggert@twinsun.com>
1310
1311 * src/bison.simple (YYSIZE_T): Do not define merely because
1312 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1313 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1314
82841af7
AD
13152002-01-27 Akim Demaille <akim@epita.fr>
1316
1317 Fix `%nonassoc and eof'.
1318
1319 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1320 which were not properly copied! Replace
1321 memcpy (res->errs, src->errs, src->nerrs);
1322 with
1323 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1324 !!!
1325 * tests/regression.at (%nonassoc and eof): Adjust to newest
1326 Autotest: `.' is not in the PATH.
1327
318b76e9
AD
13282002-01-27 Akim Demaille <akim@epita.fr>
1329
1330 * tests/sets.at (AT_EXTRACT_SETS): New.
1331 (Nullable): Use it.
1332 (Firsts): New.
1333
30d2f3d5
AD
13342002-01-26 Akim Demaille <akim@epita.fr>
1335
1336 * tests/actions.at, tests/calc.at, tests/headers.at,
1337 * tests/torture.at: Adjust to the newest Autotest which no longer
1338 forces `.' in the PATH.
1339
30f8c395
AD
13402002-01-25 Akim Demaille <akim@epita.fr>
1341
1342 * tests/regression.at (%nonassoc and eof): New.
1343 Suggested by Robert Anisko.
1344
29ae55f1
AD
13452002-01-24 Akim Demaille <akim@epita.fr>
1346
1347 Bison dumps core when trying to complain about broken input files.
1348 Reported by Cris van Pelt.
1349
1350 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
1351 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
1352 into...
1353 (Invalid inputs): Strengthen: exercise parse_percent_token.
1354
2b548aa6
RA
13552002-01-24 Robert Anisko <robert.anisko@epita.fr>
1356
1357 * src/Makefile.am: Add bison.c++.
1358 * src/bison.c++: New skeleton.
1359
bb0146c2
AD
13602002-01-21 Paolo Bonzini <bonzini@gnu.org>
1361
1362 * po/it.po: New.
1363
bec30531
AD
13642002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
1365
1366 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
1367
fc6edc45
MA
13682002-01-20 Marc Autret <marc@gnu.org>
1369
1370 * src/files.c (compute_output_file_names): Fix
1371
5e5d5415
MA
13722002-01-20 Marc Autret <marc@gnu.org>
1373
1374 * tests/output.at: New test.
1375 * src/files.c (compute_base_names): Don't map extensions when
1376 the YACC flag is set, use defaults.
1377 Reported by Evgeny Stambulchik.
1378
44ea3fbd
MA
13792002-01-20 Marc Autret <marc@gnu.org>
1380
bb0146c2 1381 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
1382 compilers as well (i.e. the vendor C compiler).
1383 Suggested by Albert Chin-A-Young.
1384
338963d1
TVH
13852002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1386
1387 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1388 canonical definition.
1389 * src/system.h: Use the canonical definition for PARAMS (avoids
1390 a conflict with the macro from lib/hash.h).
1391
c57b2479
AD
13922002-01-11 Akim Demaille <akim@epita.fr>
1393
1394 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 1395 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 1396
b85810ae
AD
13972002-01-09 Akim Demaille <akim@epita.fr>
1398
1399 * src/files.c, src/files.h (output_infix): New.
1400 (tab_extension): Remove.
1401 (compute_base_names): Compute the former, drop the latter.
1402 * src/output.c (prepare): Insert the muscles `output-infix', and
1403 `output-suffix'.
1404 * src/parse-skel.y (string, string.1): New.
1405 (section.header): Use it.
1406 (section.yacc): Remove.
1407 (prefix): Remove too.
1408 * src/scan-skel.l: Adjust.
1409 * src/bison.simple, src/bison.hairy: Adjust.
1410
cae60122
AD
14112002-01-09 Akim Demaille <akim@epita.fr>
1412
1413 * configure.in (WERROR_CFLAGS): Compute it.
1414 * src/Makefile.am (CFLAGS): Pass it.
1415 * tests/atlocal.in (CFLAGS): Idem.
1416 * src/files.c: Fix a few warnings.
1417 (get_extension_index): Remove, unused.
1418
ae404801
AD
14192002-01-08 Akim Demaille <akim@epita.fr>
1420
1421 * src/getargs.c (AS_FILE_NAME): New.
1422 (getargs): Use it to convert DOSish file names.
1423 * src/files.c (base_name): Rename as full_base_name to avoid
1424 clashes with `base_name ()'.
1425 (filename_split): New.
1426 (compute_base_names): N-th rewrite, using filename_split.
1427
22312b71
AD
14282002-01-08 Akim Demaille <akim@epita.fr>
1429
1430 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1431 New, stolen from the Fileutils 4.1.
1432 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1433 * configure.in: Check for the presence of memrchr, and of its
1434 prototype.
1435
a67cef01
TVH
14362002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1437
1438 * lib/hash.h (__P): Added definition for this macro.
1439 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1440 BUILT_SOURCES, to ensure they are generated first.
1441 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1442 %error-verbose to allow bootstrapping with bison 1.30x.
1443
2b25d624
AD
14442002-01-06 Akim Demaille <akim@epita.fr>
1445
1446 * src/reader.c (parse_braces): Don't fetch the next char, the
1447 convention is to fetch on entry.
1448 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1449 'switch' without a following semicolon.
1450 * tests/regression.at (braces parsing): New.
1451
3460813b
AD
14522002-01-06 Akim Demaille <akim@epita.fr>
1453
1454 Bison is dead wrong in its RR conflict reports.
1455
1456 * tests/torture.at (GNU Cim Grammar): New.
1457 * src/conflicts.c (count_rr_conflicts): Fix.
1458
73784c64
AD
14592002-01-06 Akim Demaille <akim@epita.fr>
1460
1461 Creating package.m4 from configure.ac causes too many problems.
1462
1463 * tests/Makefile.am (package.m4): Create it by hand,
1464 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1465
25d81090
AD
14662002-01-06 Akim Demaille <akim@epita.fr>
1467
1468 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1469 skeleton.h.
1470
a9b8959e
PE
14712002-01-04 Paul Eggert <eggert@twinsun.com>
1472
1473 * doc/bison.texinfo (Debugging):
1474 Remove YYSTDERR; it's no longer defined or used.
1475 Also, s/cstdio.h/cstdio/.
1476
25d81090
AD
14772002-01-03 Akim Demaille <akim@epita.fr>
1478
1479 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1480
1109455c
AD
14812002-01-03 Akim Demaille <akim@epita.fr>
1482
1483 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1484 tracing code to --trace, wait for a better --trace option, with
1485 args.
1486
7ea5e977
AD
14872002-01-03 Akim Demaille <akim@epita.fr>
1488
1489 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1490 The ISO C++ standard is extremely clear about it: stderr is
1491 considered a macro, not a regular symbol (see table 94 `Header
1492 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1493 Therefore std:: does not apply to it. It still does with fprintf.
1494 Also, s/cstdio.h/cstdio/.
1495
fab5b110
AD
14962002-01-03 Akim Demaille <akim@epita.fr>
1497
1498 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1499 for non system headers.
1500
aed7fd9b
AD
15012002-01-02 Akim Demaille <akim@epita.fr>
1502
1503 Equip the skeleton chain with location tracking, runtime trace,
1504 pure parser and scanner.
1505
1506 * src/parse-skel.y: Request a pure parser, locations, and prefix
1507 renaming.
1508 (%union): Having several members with the same type does not help
1509 type mismatches, simplify.
1510 (YYPRINT, yyprint): New.
1511 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1512 (skel_error): this.
1513 Handle locations.
1514 * src/scan-skel.l: Adjust to these changes.
1515 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1516 (LOCATION_PRINT, skel_control_t): New.
1517
24fad99e
AD
15182001-12-30 Akim Demaille <akim@epita.fr>
1519
1520 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1521 replace `gb' with BLANKS.
1522 * src/scan-skel.l: Adjust.
1523
a4b36db4
AD
15242001-12-30 Akim Demaille <akim@epita.fr>
1525
1526 * src/system.h: We don't need nor want bcopy.
1527 Throw away MS-DOS crap: we don't need getpid.
1528 * configure.in: We don't need strndup. It was even causing
1529 problems: because Flex includes the headers *before* us,
1530 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1531 not visible.
1532 * lib/xstrndup.c: New.
1533 * src/scan-skel.l: Use it.
1534 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1535 * src/parse-skel.y: Use %directives instead of #defines.
1536
1239777d
AD
15372001-12-30 Akim Demaille <akim@epita.fr>
1538
1539 * src/skeleton.h: New.
1540 * src/output.c (output_parser, output_master_parser): Remove, dead
1541 code.
1542 * src/output.h (get_lines_number, actions_output, guards_output)
1543 (token_definitions_output): Prototype them.
1544 * src/parse-skel.y: Add the license notice.
1545 Include output.h and skeleton.h.
1546 (process_skeleton): Returns void, and takes a single parameter.
1547 * src/scan-skel.l: Add the license notice.
1548 Include skeleton.h.
1549 Don't use %option yylineno: it seems that then Flex imagines
1550 REJECT has been used, and therefore it won't reallocate its
1551 buffers (which makes no other sense to me than a bug). It results
1552 in warnings for `unused: yy_flex_realloc'.
1553
9b3add5b
RA
15542001-12-30 Robert Anisko <robert.anisko@epita.fr>
1555
1556 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1557 (MUSCLE_INSERT_PREFIX): ...to there.
1558 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1559 (MUSCLE_INSERT_PREFIX): Move from here...
1560
1561 * src/bison.hairy: Add a section directive. Put braces around muscle
1562 names. This parser skeleton is still broken, but Bison should not
1563 choke on a bad muscle 'syntax'.
1564 * src/bison.simple: Add a section directive. Put braces around muscle
1565 names.
1566
1567 * src/files.h (strsuffix, stringappend): Add declarations.
1568 (tab_extension): Add declaration.
1569 (short_base_name): Add declaration.
1570
1571 * src/files.c (strsuffix, stringappend): No longer static. These
1572 functions are used in the skeleton parser.
1573 (tab_extension): New.
1574 (compute_base_names): Use the computations done in this function
fab5b110 1575 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1576 names.
1577 (short_base_name): No longer static.
1578
1579 * src/output.c (output_skeleton): New.
1580 (output): Disable call to output_master_parser, and give a try to
1581 a new skeleton handling system.
1582 (guards_output, actions_output): No longer static.
1583 (token_definitions_output, get_lines_number): No longer static.
1584
1585 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1586
fab5b110 1587 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1588 parse-skel.y.
1589
1590 * src/parse-skel.y: New file.
1591 * src/scan-skel.l: New file.
1592
b5b61c61
AD
15932001-12-29 Akim Demaille <akim@epita.fr>
1594
1595 %name-prefix is broken.
1596
1597 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1598 Adjust all dependencies.
1599 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1600 %name-prefix.
1601
1602 Renaming yylval but not yylloc is not consistent. Now we do.
1603
1604 * src/bison.simple: Prefix yylloc if used.
1605 * doc/bison.texinfo (Decl Summary): Document that.
1606
8c9a50be
AD
16072001-12-29 Akim Demaille <akim@epita.fr>
1608
1609 * doc/bison.texinfo: Promote `%long-directive' over
1610 `%long_directive'.
1611 Remove all references to fixed-output-files, yacc is enough.
1612
d99361e6
AD
16132001-12-29 Akim Demaille <akim@epita.fr>
1614
1615 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1616 user prologue. These are defaults.
1617 * tests/actions.at (Mid-rule actions): Make sure the user can
1618 define YYDEBUG and YYERROR_VERBOSE.
1619
b9cecb91
AD
16202001-12-29 Akim Demaille <akim@epita.fr>
1621
1622 * src/output.c (header_output): Don't forget to export YYLTYPE and
1623 yylloc.
1624 * tests/headers.at (export YYLTYPE): New, make sure it does.
1625 * tests/regression.at (%union and --defines, Invalid CPP headers):
1626 Move to...
1627 * tests/headers.at: here.
1628
aea13e97
AD
16292001-12-29 Akim Demaille <akim@epita.fr>
1630
1631 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1632
931394cb
AD
16332001-12-29 Akim Demaille <akim@epita.fr>
1634
1635 * tests/actions.at (Mid-rule actions): Output on a single line
1636 instead of several.
1637
704a47c4
AD
16382001-12-29 Akim Demaille <akim@epita.fr>
1639
1640 * doc/bison.texinfo: Formatting changes.
1641
091e20bb
AD
16422001-12-29 Akim Demaille <akim@epita.fr>
1643
1644 Don't store the token defs in a muscle, just be ready to output it
1645 on command. Now possible via `symbols'. Fixes a memory leak.
1646
1647 * src/output.c (token_definitions_output): New.
1648 (output_parser, header_output): Use it.
1649 * src/reader.c (symbols_save): Remove.
1650
cce71710
AD
16512001-12-29 Akim Demaille <akim@epita.fr>
1652
1653 * src/bison.simple: Do not provide a default for YYSTYPE and
1654 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1655 default.
1656
82c035a8
AD
16572001-12-29 Akim Demaille <akim@epita.fr>
1658
1659 Mid-rule actions are simply... ignored!
1660
1661 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1662 the empty-rule associated to the dummy symbol, not to the host
1663 rule.
1664 * tests/actions.at (Mid-rule actions): New.
1665
8419d367
AD
16662001-12-29 Akim Demaille <akim@epita.fr>
1667
1668 Memory leak.
1669
1670 * src/reader.c (reader): Free grammar.
1671
375d5806
AD
16722001-12-29 Akim Demaille <akim@epita.fr>
1673
1674 Memory leak.
1675
1676 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1677 since it allocates it for each state, although only one is needed.
1678 (allocate_storage): Do it here.
1679
f51cb8ff
AD
16802001-12-29 Akim Demaille <akim@epita.fr>
1681
1682 * src/options.h, src/options.c (create_long_option_table): Rename
1683 as...
1684 (long_option_table_new): this, with a clearer prototype.
1685 (percent_table): Remove, unused,
1686 * src/getargs.c (getargs): Adjust.
1687
29e88316
AD
16882001-12-29 Akim Demaille <akim@epita.fr>
1689
1690 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1691 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1692 as states.
1693
b9f71f19
AD
16942001-12-29 Akim Demaille <akim@epita.fr>
1695
1696 * src/lalr.c (build_relations): Rename `states' as `states1'.
1697 Sorry, I don't understand exactly what it is, no better name...
1698
1a2b5d37
AD
16992001-12-29 Akim Demaille <akim@epita.fr>
1700
1701 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1702 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1703 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1704 as rules.
1705
1cca533e
AD
17062001-12-29 Akim Demaille <akim@epita.fr>
1707
1708 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1709 ago.
1710
c03ae966
AD
17112001-12-29 Akim Demaille <akim@epita.fr>
1712
1713 * src/reader.c, src/reader.h (user_toknums): Remove.
1714 Adjust all users to use symbols[i]->user_token_number.
1715
5a670b1e
AD
17162001-12-29 Akim Demaille <akim@epita.fr>
1717
1718 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1719 Adjust all users to use symbols[i]->prec or ->assoc.
1720
ad949da9
AD
17212001-12-29 Akim Demaille <akim@epita.fr>
1722
1723 * src/reader.c, src/reader.h (tags): Remove.
1724 Adjust all users to use symbols[i]->tag.
1725
0e78e603
AD
17262001-12-29 Akim Demaille <akim@epita.fr>
1727
1728 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1729 and rule_table.
1730 * src/reader.c (packsymbols): Fill this table.
1731 Drop sprec.
1732 * src/conflicts.c (resolve_sr_conflict): Adjust.
1733 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1734 single table.
1735 Use symbols[i]->tag instead of tags[i].
1736
213e640e
AD
17372001-12-29 Akim Demaille <akim@epita.fr>
1738
1739 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1740 In addition, put a comment in there, to replace...
1741 * tests/regression.at (%union and C comments): Remove.
1742
e7b8bef1
AD
17432001-12-29 Akim Demaille <akim@epita.fr>
1744
1745 * tests/regression.at (Web2c Actions): Blindly move the actual
1746 output as expected output. The contents *seem* right to me, but I
1747 can't pretend reading perfectly parser tables... Nonetheless, all
1748 the other tests pass correctly, the table look OK, even though the
1749 presence of `$axiom' is to be noted: AFAICS it is useless (but
1750 harmless).
1751
b68e7744
AD
17522001-12-29 Akim Demaille <akim@epita.fr>
1753
1754 * src/reader.c (readgram): Don't add the rule 0 if there were no
1755 rules read. In other words, add it _after_ having performed
1756 grammar sanity checks.
1757 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1758
78d5bae9
AD
17592001-12-29 Akim Demaille <akim@epita.fr>
1760
1761 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1762 visible, and some states have now a different number.
1763
ff442794
AD
17642001-12-29 Akim Demaille <akim@epita.fr>
1765
1766 * src/reader.c (readgram): Bind the initial rule's lineno to that
1767 of the first rule.
1768 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1769 (Solved SR Conflicts): Adjust rule 0's line number.
1770
610ab194
AD
17712001-12-29 Akim Demaille <akim@epita.fr>
1772
1773 Fix the `GAWK Grammar' failure.
1774
1775 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1776 the reductions of the first state which was mistakenly confused
1777 with the final state because precisely final_state was initialized
1778 to 0.
1779 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1780 now noticed by Bison.
1781 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1782 have a reduction on $default.
1783
29d29c8f
AD
17842001-12-29 Akim Demaille <akim@epita.fr>
1785
1786 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1787 rule line numbers.
1788 * src/closure.c (print_closure): Likewise.
1789 * src/derives.c (print_derives): Likewise.
1790 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1791 now.
1792
7c6b64d0
AD
17932001-12-29 Akim Demaille <akim@epita.fr>
1794
1795 * src/lalr.c (lookaheads_print): New.
1796 (lalr): Call it when --trace-flag.
1797 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1798 are dumped.
1799
3d4daee3
AD
18002001-12-29 Akim Demaille <akim@epita.fr>
1801
1802 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1803 when walking through ritem, even via rule->rhs.
1804 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1805 (useful_production, useless_nonterminals): Likewise.
1806 (reduce_grammar_tables): Likewise, plus update nritems.
1807 * src/nullable.c (set_nullable): Likewise.
1808 * src/lalr.c (build_relations): Likewise.
1809 * tests/sets.at (Nullable): Adjust.
1810 Fortunately, now, the $axiom is no longer nullable.
1811
9e7f6bbd
AD
18122001-12-29 Akim Demaille <akim@epita.fr>
1813
1814 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1815 the 0-sentinel.
1816 * src/gram.c (ritem_longest_rhs): Likewise.
1817 * src/reduce.c (nonterminals_reduce): Likewise.
1818 * src/print_graph.c (print_graph): Likewise.
1819 * src/output.c (output_rule_data): Likewise.
1820 * src/nullable.c (set_nullable): Likewise.
1821
255ef638
AD
18222001-12-29 Akim Demaille <akim@epita.fr>
1823
1824 * src/output.c: Comment changes.
1825
0d8a7363
AD
18262001-12-27 Paul Eggert <eggert@twinsun.com>
1827
1828 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1829 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1830 Sparc, as they were causing more porting problems than the
1831 (minor) performance improvement was worth.
1832
1833 Also, catch up with 1.31's YYSTD.
1834
3db472b9
AD
18352001-12-27 Akim Demaille <akim@epita.fr>
1836
1837 * src/output.c (output_gram): Rely on nritems, not the
1838 0-sentinel. See below.
1839 Use -1 as separator, not 0.
1840 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1841 Rely on -1 as separator in yyrhs, instead of 0.
1842 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1843 twice `Now at end of input', therefore there are two lines less to
1844 expect.
1845
b365aa05
AD
18462001-12-27 Akim Demaille <akim@epita.fr>
1847
1848 * tests/regression.at (Unresolved SR Conflicts):
1849 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1850 below.
1851
30171f79
AD
18522001-12-27 Akim Demaille <akim@epita.fr>
1853
1854 * src/LR0.c (new_state): Recognize the final state by the fact it
1855 is reached by eoftoken.
1856 (insert_start_shifting_state, insert_eof_shifting_state)
1857 (insert_accepting_state, augment_automaton): Remove, since now
1858 these states are automatically computed from the initial state.
1859 (generate_states): Adjust.
1860 * src/print.c: When reporting a rule number to the user, substract
1861 1, so that the axiom rule is rule 0, and the first user rule is 1.
1862 * src/reduce.c: Likewise.
1863 * src/print_graph.c (print_core): For the time being, just as for
1864 the report, depend upon --trace-flags to dump the full set of
1865 items.
1866 * src/reader.c (readgram): Once the grammar read, insert the rule
1867 0: `$axiom: START-SYMBOL $'.
1868 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1869 number of the states has changed (the final state is no longer
1870 necessarily the last), catch up.
1871
75142d45
AD
18722001-12-27 Akim Demaille <akim@epita.fr>
1873
1874 Try to make the use of the eoftoken valid. Given that its value
1875 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1876 is used instead of > 0 where appropriate, (ii), depend upon nritems
1877 instead of the 0-sentinel.
1878
1879 * src/gram.h, src/gram.c (nritems): New.
1880 Expected to be duplication of nitems, but for the time being...
1881 * src/reader.c (packgram): Assert nritems and nitems are equal.
1882 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
1883 * src/closure.c (print_closure, print_fderives): Likewise.
1884 * src/gram.c (ritem_print): Likewise.
1885 * src/print.c (print_core, print_grammar): Likewise.
1886 * src/print_graph.c: Likewise.
1887
b7c49edf
AD
18882001-12-27 Akim Demaille <akim@epita.fr>
1889
1890 * src/main.c (main): If there are complains after grammar
1891 reductions, then output the report anyway if requested, then die.
1892 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
1893 * src/reader.c (eoftoken): New.
1894 (parse_token_decl): If the token being defined has value `0', it
1895 is the eoftoken.
1896 (packsymbols): No longer hack `tags' to insert `$' by hand.
1897 Be sure to preserve the value of the eoftoken.
1898 (reader): Make sure eoftoken is defined.
1899 Initialize nsyms to 0: now eoftoken is created just like the others.
1900 * src/print.c (print_grammar): Don't special case the eof token.
1901 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
1902 lie anyway, albeit pleasant.
1903 * tests/calc.at: Exercise error messages with eoftoken.
1904 Change the grammar so that empty input is invalid.
1905 Adjust expectations.
1906 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
1907
ec2da99f
AD
19082001-12-27 Akim Demaille <akim@epita.fr>
1909
1910 * configure.in: Check the protos of strchr ans strspn.
1911 Replace strchr if needed.
1912 * src/system.h: Provide the protos of strchr, strspn and memchr if
1913 missing.
1914 * lib/strchr.c: New.
1915 * src/reader.c (symbols_save): Use strchr.
1916
8adfa272
AD
19172001-12-27 Akim Demaille <akim@epita.fr>
1918
1919 * src/print.c, src/print_graph.c (escape): New.
1920 Use it to quote the TAGS outputs.
1921 * src/print_graph.c (print_state): Now errors are in red, and
1922 reductions in green.
1923 Prefer high to wide: output the state number on a line of its own.
1924
80dac38c
AD
19252001-12-27 Akim Demaille <akim@epita.fr>
1926
1927 * src/state.h, src/state.c (reductions_new): New.
1928 * src/LR0.c (set_state_table): Let all the states have a
1929 `reductions', even if reduced to 0.
1930 (save_reductions): Adjust.
1931 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
1932 * src/print.c (print_reductions, print_actions): Adjust.
1933 * src/output.c (action_row): Adjust.
1934
2cec70b9
AD
19352001-12-27 Akim Demaille <akim@epita.fr>
1936
1937 * src/state.h, src/state.c (errs_new, errs_dup): New.
1938 * src/LR0.c (set_state_table): Let all the states have an errs,
1939 even if reduced to 0.
1940 * src/print.c (print_errs, print_reductions): Adjust.
1941 * src/output.c (output_actions, action_row): Adjust.
1942 * src/conflicts.c (resolve_sr_conflict): Adjust.
1943
13ca549a
AD
19442001-12-27 Akim Demaille <akim@epita.fr>
1945
1946 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
1947
5092aba5
AD
19482001-12-27 Akim Demaille <akim@epita.fr>
1949
1950 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
1951 * src/print.c: here.
1952 (lookaheadset, shiftset): New, used as additional storage by
1953 print_reductions.
1954 (print_results): Adjust.
1955 (print_shifts, print_gotos, print_errs): New, extracted from...
1956 (print_actions): here.
1957 * src/print_graph.c (print_actions): Remove dead code.
1958
11e2beca
AD
19592001-12-27 Akim Demaille <akim@epita.fr>
1960
1961 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
1962 `$n' and `@n'.
1963
dac3c910
AD
19642001-12-27 Akim Demaille <akim@epita.fr>
1965
1966 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
1967 (build_relations): Adjust.
1968
d0b0fefa
AD
19692001-12-27 Akim Demaille <akim@epita.fr>
1970
1971 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
1972 duplication.
1973
adc8c848
AD
19742001-12-27 Akim Demaille <akim@epita.fr>
1975
1976 * src/reader.c (packgram): Catch nitems overflows.
1977
14d293ac
AD
19782001-12-27 Akim Demaille <akim@epita.fr>
1979
1980 * src/files.c, src/files.h (guard_obstack): Remove.
1981 * src/output.c (output): Adjust.
1982 * src/reader.c (parse_braces): New, factoring...
1983 (copy_action, copy_guard): these two which are renamed as...
1984 (parse_action, parse_guard): these.
1985 As a voluntary consequence, using braces around guards is now
1986 mandatory.
1987
f499b062
AD
19882001-12-27 Akim Demaille <akim@epita.fr>
1989
1990 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
1991 * src/reader.c (symbol_list): `guard' and `guard_line' are new
1992 members.
1993 (symbol_list_new): Adjust.
1994 (copy_action): action_line is the first line, not the last.
1995 (copy_guard): Just as for actions, store the `action' only, not
1996 the switch/case/break flesh.
1997 Don't parse the user action that might follow the guard, let...
1998 (readgram): do it, i.e., now, there can be an action after a
1999 guard.
2000 In other words the guard is just explicitly optional.
2001 (packgram): Adjust.
2002 * src/output.c (guards_output): New.
2003 (output_parser): Call it when needed.
2004 (output): Also free the guard and attrs obstacks.
2005 * src/files.c, src/files.h (obstack_save): Remove.
2006 (output_files): Remove.
2007 As a result, if one needs the former `.act' file, using an
2008 appropriate skeleton which requires actions and guards is now
2009 required.
2010 * src/main.c (main): Adjust.
2011 * tests/semantic.at: New.
2012 * tests/regression.at: Use `input.y' as input file name.
2013 Avoid 8+3 problems by requiring input.c when the test needs the
2014 parser.
2015
d945f5cd
AD
20162001-12-27 Akim Demaille <akim@epita.fr>
2017
2018 * src/reader.c (symbol_list_new): Be sure to initialize all the
2019 fields.
2020
d200e455
AD
20212001-12-27 Akim Demaille <akim@epita.fr>
2022
2023 All the hacks using a final pseudo state are now useless.
2024
2025 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2026 * src/lalr.c (nLA): New.
2027 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2028 instead of lookaheadsp from the pseudo state (nstate + 1).
2029
f9507c28
AD
20302001-12-27 Akim Demaille <akim@epita.fr>
2031
2032 * src/output.c (action_row, token_actions): Use a state_t instead
2033 of a integer, and nlookaheads instead of the following state's
2034 lookaheadsp.
2035
065fbd27
AD
20362001-12-27 Akim Demaille <akim@epita.fr>
2037
2038 * src/conflicts.c (log_resolution, flush_shift)
2039 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2040 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2041 (conflicts_print, print_reductions): Use a state_t instead of an
2042 integer when referring to a state.
2043 As much as possible, depend upon nlookaheads, instead of the
2044 `lookaheadsp' member of the following state (since lookaheads of
2045 successive states are successive, the difference between state n + 1
2046 and n served as the number of lookaheads for state n).
2047 * src/lalr.c (add_lookback_edge): Likewise.
2048 * src/print.c (print_core, print_actions, print_state)
2049 (print_results): Likewise.
2050 * src/print_graph.c (print_core, print_actions, print_state)
2051 (print_graph): Likewise.
2052 * src/conflicts.h: Adjust.
2053
1b177bd7
AD
20542001-12-27 Akim Demaille <akim@epita.fr>
2055
2056 * src/bison.hairy: Formatting/comment changes.
2057 ANSIfy.
2058 Remove `register' indications.
2059 Add plenty of `static'.
2060
7742ddeb
AD
20612001-12-27 Akim Demaille <akim@epita.fr>
2062
2063 * src/output.c (prepare): Drop the muscle `ntbase' which
2064 duplicates ntokens.
2065 * src/bison.simple: Formatting/comment changes.
2066 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2067 is an undocumented synonym.
2068
1fa14068
AD
20692001-12-22 Akim Demaille <akim@epita.fr>
2070
2071 * src/output.c (output_table_data): Change the prototype to use
2072 `int' for array ranges: some invocations do pass an int, not a
2073 short.
2074 Reported by Wayne Green.
2075
b9752825
AD
20762001-12-22 Akim Demaille <akim@epita.fr>
2077
2078 Some actions of web2c.y are improperly triggered.
2079 Reported by Mike Castle.
2080
2081 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2082 * tests/regression.at (Web2c): Rename as...
2083 (Web2c Report): this.
2084 (Web2c Actions): New.
2085
776209d6
AD
20862001-12-22 Akim Demaille <akim@epita.fr>
2087
2088 Reductions in web2c.y are improperly reported.
2089 Reported by Mike Castle.
2090
2091 * src/conflicts.c (print_reductions): Fix.
2092 * tests/regression.at (Web2c): New.
2093
275fc3ad
AD
20942001-12-18 Akim Demaille <akim@epita.fr>
2095
2096 Some host fail on `assert (!"foo")', which expands to
2097 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2098 Reported by Nelson Beebee.
2099
2100 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2101 `#define it_succeeded 0' and `assert (it_succeeded)'.
2102
897668ee
MA
21032001-12-17 Marc Autret <autret_m@epita.fr>
2104
2105 * src/bison.simple: Don't hard code the skeleton line and filename.
2106 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2107 New line counter 'skeleton_line' (skeleton-line muscle).
2108
ab3399e0
PE
21092001-12-17 Paul Eggert <eggert@twinsun.com>
2110
2111 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2112 YYDEBUG must be defined to a nonzero value.
2113
2114 * src/bison.simple (yytname): Do not assume that the user defines
2115 YYDEBUG to a properly parenthesized expression.
2116
3877f72b
AD
21172001-12-17 Akim Demaille <akim@epita.fr>
2118
2119 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2120 nlookaheads is a new member.
2121 Adjust all users.
2122 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2123 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2124 state.
776209d6 2125
331dbc1b
AD
21262001-12-17 Akim Demaille <akim@epita.fr>
2127
2128 * src/files.h, src/files.c (open_files, close_files): Remove.
2129 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2130 let...
2131 * src/reader.c (reader): Do it.
776209d6 2132
be750e4c
AD
21332001-12-17 Akim Demaille <akim@epita.fr>
2134
2135 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2136
709ae8c6
AD
21372001-12-17 Akim Demaille <akim@epita.fr>
2138
2139 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2140 (flush_reduce): New.
2141 (resolve_sr_conflict): Adjust.
776209d6 2142
f87685c3
AD
21432001-12-17 Akim Demaille <akim@epita.fr>
2144
2145 * src/output.c (output_obstack): Be static and rename as...
2146 (format_obstack): this, to avoid any confusion with files.c's
2147 output_obstack.
2148 * src/reader.h (muscle_obstack): Move to...
2149 * src/output.h: here, since it's defined in output.c.
2150
837491d8
AD
21512001-12-17 Akim Demaille <akim@epita.fr>
2152
2153 * src/output.c (action_row, save_column, default_goto)
2154 (sort_actions, matching_state, pack_vector): Better variable
2155 locality.
2156
796d61fb
AD
21572001-12-17 Akim Demaille <akim@epita.fr>
2158
2159 * src/output.c: Various formatting changes.
776209d6 2160
64d15509
AD
21612001-12-17 Akim Demaille <akim@epita.fr>
2162
2163 * src/files.c (output_files): Free the output_obstack.
2164 * src/main.c (main): Call print and print_graph conditionally.
2165 * src/print.c (print): Work unconditionally.
2166 * src/print_graph.c (print_graph): Work unconditionally.
2167 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2168
fbc8ecb7
MA
21692001-12-16 Marc Autret <autret_m@epita.fr>
2170
2171 * src/output.c (actions_output): Fix. When we use %no-lines,
2172 there is one less line per action.
2173
f0440388
MA
21742001-12-16 Marc Autret <autret_m@epita.fr>
2175
2176 * src/bison.simple: Remove a useless #line directive.
2177 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2178 * src/output.c (get_lines_number): New.
776209d6 2179 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2180 output muscles.
2181 Fix line numbering.
2182 (actions_output): Computes the number of lines taken by actions.
2183 (output_master_parser): Insert new skeleton which is the name of
2184 the output parser file name.
2185
a79986b8
MA
21862001-12-15 Marc Autret <autret_m@epita.fr>
2187
2188 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2189
4ec8e00f
MA
21902001-12-15 Marc Autret <autret_m@epita.fr>
2191
2192 * src/output.c (output_gram): Keep track of the hairy one.
2193
1a4648ff
AD
21942001-12-15 Akim Demaille <akim@epita.fr>
2195
2196 Make `make distcheck' work.
2197
2198 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2199 system.h which uses libgettext.h.
2200
9c2c67e6
AD
22012001-12-15 Akim Demaille <akim@epita.fr>
2202
2203 * src/nullable.c (set_nullable): Useless rules must be skipped,
2204 otherwise, since we range over their symbols, we might look at a
2205 nonterminal which no longer ``exists'', i.e., it is not counted in
2206 `nvars', hence we overflow our arrays.
2207
93ede233
AD
22082001-12-15 Akim Demaille <akim@epita.fr>
2209
2210 The header can also be produced directly, without any obstack!
2211 Yahoo!
2212
2213 * src/files.c, src/files.h (defines_obstack): Remove.
2214 (compute_header_macro): Global.
2215 (defines_obstack_save): Remove.
2216 * src/reader.c (parse_union_decl): No longer output to
2217 defines_obstack: its content can be found in the `stype' muscle
2218 anyway.
2219 (output_token_translations): Merge into...
2220 (symbols_output): this.
2221 Rename as...
2222 (symbols_save): this.
2223 (reader): Adjust.
2224 * src/output.c (header_output): New.
2225 (output): Call it.
2226
2666f928
AD
22272001-12-15 Akim Demaille <akim@epita.fr>
2228
2229 * src/reader.c (parse_union_decl): Instead of handling two obstack
2230 simultaneously, use one to define the `stype' muscle, and use the
2231 value of the latter to fill defines_obstack.
2232 (copy_comment): Remove.
2233 (copy_comment2): Work for a single obstack.
2234 Rename as...
2235 (copy_comment): this.
2236
428046f8
AD
22372001-12-15 Akim Demaille <akim@epita.fr>
2238
2239 * src/lex.c, src/lex.h (xgetc): No longer static.
2240 * src/reader.c (parse_union_decl): Revamp.
2241
ea52d706
AD
22422001-12-15 Akim Demaille <akim@epita.fr>
2243
2244 Still making progress in separating Bison into (i) input, (ii)
2245 process, (iii) output: now we can directly output the parser file
2246 without using table_obstack at all.
2247
2248 * src/files.c, src/files.h (table_obstack): Bye bye.
2249 (parser_file_name): New.
2250 * src/files.c (compute_output_file_names): Compute it.
2251 * src/output.c (actions_output, output_parser)
2252 (output_master_parser): To a file instead of an obstack.
2253
3f96f4dc
AD
22542001-12-15 Akim Demaille <akim@epita.fr>
2255
2256 Attach actions to rules, instead of pre-outputting them to
2257 actions_obstack.
2258
2259 * src/gram.h (rule_t): action and action_line are new members.
2260 * src/reader.c (symbol_list): Likewise.
2261 (copy_action): Save the actions within the rule.
2262 (packgram): Save them in rule_table.
2263 * src/output.c (actions_output): New.
2264 (output_parser): Use it on `%%actions'.
2265 (output_rule_data): Don't free rule_table.
2266 (output): Do it.
2267 (prepare): Don't save the `action' muscle.
2268 * src/bison.simple: s/%%action/%%actions/.
2269
51576fb3
AD
22702001-12-15 Akim Demaille <akim@epita.fr>
2271
2272 * src/reader.c (copy_action): When --yacc, don't append a `;'
2273 to the user action: let it fail if lacking.
dee049eb 2274 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 2275
2648a72d
AD
22762001-12-14 Akim Demaille <akim@epita.fr>
2277
2278 * src/lex.c (literalchar): Simply return the char you decoded, non
2279 longer mess around with obstacks and int pointers.
2280 Adjust all callers.
2281
92790e5b
AD
22822001-12-14 Akim Demaille <akim@epita.fr>
2283
2284 * src/lex.c (literalchar): Don't escape the special characters,
2285 just decode them, and keep them as char (before, eol was output as
2286 the 2 char string `\n' etc.).
2287 * src/output.c (output_rule_data): Use quotearg to output the
2288 token strings.
2289
927c1557
PE
22902001-12-13 Paul Eggert <eggert@twinsun.com>
2291
2292 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2293 Do not infringe on the global user namespace when using C++.
2294 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2295 All uses of `fprintf' and `stderr' changed.
2296
2297 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2298
ed8e1f68
AD
22992001-12-13 Akim Demaille <akim@epita.fr>
2300
2301 The computation of nullable is broken: it doesn't handle empty
2302 RHS's properly.
2303
2304 * tests/torture.at (GNU AWK Grammar): New.
2305 * tests/sets.at (Nullable): New.
2306 * src/nullable.c (set_nullable): Instead of blindly looping over
2307 `ritems', loop over the rules, and then over their rhs's.
2308
2309 Work around Autotest bugs.
2310
2311 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2312 frame, because Autotest understand lines starting with a `+' as
2313 traces from the shell. Then, they are not processed properly.
2314 Admittedly an Autotest bug, but we don't have time to wait for
2315 Autotest to catch up.
2316 * tests/regression.at (Broken Closure): Adjust to the new table
2317 frames.
2318 Move to...
2319 * tests/sets.at: here.
2320
cb581495
AD
23212001-12-13 Akim Demaille <akim@epita.fr>
2322
2323 * src/closure.c (closure): Use nrules instead of playing tricks
2324 with BITS_PER_WORD.
2325
2e729273
AD
23262001-12-13 Akim Demaille <akim@epita.fr>
2327
2328 * src/print.c (print_actions): Output the handling of `$' as the
2329 traces do: shifting the token EOF. Before EOF was treated as a
2330 nonterminal.
2331 * tests/regression.at: Adjust some tests.
2332 * src/print_graph.c (print_core): Complete the set of items via
2333 closure. The next-to-final and final states are still unsatisfying,
2334 but that's to be addressed elsewhere.
2335 No longer output the rule numbers, but do output the state number.
2336 A single loop for the shifts + gotos is enough, but picked a
2337 distinct color for each.
2338 (print_graph): Initialize and finalize closure.
2339
107f7dfb
AD
23402001-12-13 Akim Demaille <akim@epita.fr>
2341
2342 * src/reader.c (readgram): Remove dead code, an strip useless
2343 braces.
2344 (get_type): Remove, unused.
2345
9b53a24f
AD
23462001-12-12 Akim Demaille <akim@epita.fr>
2347
2348 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
2349 on that of lib/error.c.
2350
dbfb6dcd
AD
23512001-12-12 Akim Demaille <akim@epita.fr>
2352
2353 Some hosts don't like `/' in includes.
2354
2355 * src/system.h: Include libgettext.h without qualifying the path.
2356 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
2357 $(top_srcdir).
2358
c25fb648
MA
23592001-12-11 Marc Autret <autret_m@epita.fr>
2360
2361 * src/output.c (output_parser): Remove useless muscle.
2362
710ddc4f
MA
23632001-12-11 Marc Autret <autret_m@epita.fr>
2364
2365 * src/bison.simple: Remove #line just before %%epilogue. It
2366 is now handled in ...
2367 * src/reader.c (read_additionnal_code): Add the output of a
2368 #line for the epilogue.
2369
e83d80b8
MA
23702001-12-10 Marc Autret <autret_m@epita.fr>
2371
927c1557 2372 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
2373 replace precedent remove.
2374 * src/bison.simple: Remove #line before %%prologue because
2375 %%input-line is wrong at this time.
2376
971d5158
MA
23772001-12-10 Marc Autret <autret_m@epita.fr>
2378
2379 * src/reader.c (symbols_output): Clean up.
927c1557 2380 * src/output.c (output_gram, output): Clean up.
971d5158 2381
5edafffd
AD
23822001-12-10 Akim Demaille <akim@epita.fr>
2383
2384 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2385 * src/LR0.c (set_state_table): here.
2386 * src/lalr.c (lalr): Call it.
2387
0279f8e9
AD
23882001-12-10 Akim Demaille <akim@epita.fr>
2389
2390 * src/state.h (shifts): Remove the `number' member: shifts are
2391 attached to state, hence no longer need to be labelled with a
2392 state number.
2393
190c4f5f
AD
23942001-12-10 Akim Demaille <akim@epita.fr>
2395
2396 Now that states have a complete set of members, the linked list of
2397 shifts is useless: just fill directly the state's shifts member.
2398
2399 * src/state.h (shifts): Remove the `next' member.
2400 * src/LR0.c (first_state, last_state): Remove.
2401 Adjust the callers.
2402 (augment_automaton): Don't look for the shifts that must be added
2403 a shift on EOF: it is those of the state we looked for! But now,
2404 since shifts are attached, it is no longer needed to looking
2405 merely by its id: its number.
2406
2a73b93d
AD
24072001-12-10 Akim Demaille <akim@epita.fr>
2408
2409 * src/LR0.c (augment_automaton): Better variable locality.
2410 Remove an impossible branch: if there is a state corresponding to
2411 the start symbol being shifted, then there is shift for the start
2412 symbol from the initial state.
2413
74392f6a
AD
24142001-12-10 Akim Demaille <akim@epita.fr>
2415
2416 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2417 only when appropriate: when insert_start_shifting_state' is not
2418 invoked.
2419 * tests/regression.at (Rule Line Numbers): Adjust.
2420
37c82725
AD
24212001-12-10 Akim Demaille <akim@epita.fr>
2422
2423 * src/LR0.c (augment_automaton): Now that all states have shifts,
2424 merge the two cases addition shifts to the initial state.
2425
6a164e0c
AD
24262001-12-10 Akim Demaille <akim@epita.fr>
2427
2428 * src/lalr.c (set_state_table): Move to...
2429 * src/LR0.c: here.
2430 * src/lalr.c (lalr): Don't call it...
2431 * src/LR0.c (generate_states): do it.
2432 * src/LR0.h (first_state): Remove, only the table is used.
2433
7215de24
AD
24342001-12-10 Akim Demaille <akim@epita.fr>
2435
2436 * src/LR0.h (first_shift, first_reduction): Remove.
2437 * src/lalr.c: Don't use first_shift: find shifts through the
2438 states.
2439
80e25d4d
AD
24402001-12-10 Akim Demaille <akim@epita.fr>
2441
2442 * src/LR0.c: Attach shifts to states as soon as they are
2443 computed.
2444 * src/lalr.c (set_state_table): Instead of assigning shifts to
2445 state, just assert that the mapping was properly done.
2446
0ab3728b
AD
24472001-12-10 Akim Demaille <akim@epita.fr>
2448
2449 * src/LR0.c (insert_start_shift): Rename as...
2450 (insert_start_shifting_state): this.
2451 (insert_eof_shifting_state, insert_accepting_state): New.
2452 (augment_automaton): Adjust.
2453 Better locality of the variables.
2454 When looking if the start_symbol is shifted from the initial
2455 state, using `while (... symbol != start_symbol ...)' sounds
2456 better than `while (... symbol < start_symbol ...)': If fail
2457 to see how the order between symbols could be relevant!
2458
78af9bbc
AD
24592001-12-10 Akim Demaille <akim@epita.fr>
2460
2461 * src/getargs.h: Don't declare `spec_name_prefix' and
2462 `spec_file_prefix', declared by src/files.h.
2463 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2464 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2465 * src/output.c (prepare): Adjust.
2466 * src/reader.c (symbols_output): Likewise.
2467 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2468
bdef2a41
AD
24692001-12-10 Akim Demaille <akim@epita.fr>
2470
2471 * src/muscle_tab.c (muscle_init): NULL is a better default than
2472 `"0"'.
2473
3735969c
AD
24742001-12-10 Akim Demaille <akim@epita.fr>
2475
2476 * src/reader.c (reader): Calling symbols_output once is enough.
2477
49701457
AD
24782001-12-10 Akim Demaille <akim@epita.fr>
2479
2480 Now that states have a complete set of members, the linked list of
2481 reductions is useless: just fill directly the state's reductions
2482 member.
2483
2484 * src/state.h (struct reductions): Remove member `number' and
2485 `next'.
2486 * src/LR0.c (first_reduction, last_reduction): Remove.
2487 (save_reductions): Don't link the new reductions, store them in
2488 this_state.
2489 * src/lalr.c (set_state_table): No need to attach reductions to
2490 states, it's already done.
2491 * src/output.c (output_actions): No longer free the shifts, then
2492 the reductions, then the states: free all the states and their
2493 members.
2494
0edad749
AD
24952001-12-10 Akim Demaille <akim@epita.fr>
2496
2497 * src/options.c (OPTN, DRTV, BOTH): New.
2498 (option_table): Use them.
2499
0edad749
AD
2500 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2501 the job of system.h.
2502 * src/options.c: Don't include stdio.h and xalloc.h for the same
2503 reasons.
2504
5449dd0f
AD
25052001-12-10 Akim Demaille <akim@epita.fr>
2506
2507 * src/output.c (output, prepare): Make sure the values of the
2508 muscles `action' and `prologue' are 0-terminated.
2509
a870c567
AD
25102001-12-10 Akim Demaille <akim@epita.fr>
2511
2512 Clean up GCC warnings.
2513
2514 * src/reader.c (copy_action): `buf' is not used.
2515 (parse_skel_decl): Be static.
2516 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2517 * src/options.h (create_long_option_table): Have a real prototype.
2518 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2519 (hash_delete_at): Return const void *.
2520 Adjust casts to preserve the const.
2521
80df8768
AD
25222001-12-10 Akim Demaille <akim@epita.fr>
2523
2524 * configure.in: Require 2.52g.
2525 M4 is not needed, but AUTOM4TE is.
2526 * m4/m4.m4: Remove.
2527 * tests/Makefile.am: Adjust.
2528
f693ad14
AD
25292001-12-10 Akim Demaille <akim@epita.fr>
2530
2531 One structure for states is enough, even though theoretically
2532 there are LR(0) states and LALR(1) states.
2533
2534 * src/lalr.h (state_t): Remove.
2535 (state_table): Be state_t **, not state_t *.
2536 * src/state.h (core, CORE_ALLOC): Rename as...
2537 (state_t, STATE_ALLOC): this.
2538 Add the LALR(1) members: shifts, reductions, errs.
2539 * src/LR0.c (state_table): Rename as...
2540 (state_hash): this, to avoid name clashes with the global
2541 `state_table'.
2542 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2543 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2544
74ffbcb6
AD
25452001-12-10 Akim Demaille <akim@epita.fr>
2546
2547 Bison dumps core on bash.y.
2548 Reported by Pascal Bart.
2549
2550 * src/warshall.c (bitmatrix_print): New.
2551 (TC): Use it.
2552 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2553 j must be the outer loop.
2554 * tests/regression.at (Broken Closure): New.
2555
07708e19
AD
25562001-12-05 Akim Demaille <akim@epita.fr>
2557
2558 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2559 its argument.
2560