]> git.saurik.com Git - bison.git/blame - ChangeLog
Have Bison grammars parsed by a Bison grammar.
[bison.git] / ChangeLog
CommitLineData
e9955c83
AD
12002-06-11 Akim Demaille <akim@epita.fr>
2
3 Have Bison grammars parsed by a Bison grammar.
4
5 * src/reader.c, src/reader.h (prologue_augment): New.
6 * src/reader.c (copy_definition): Remove.
7
8 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
9 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
10 (grammar_current_rule_prec_set, grammar_current_rule_check)
11 (grammar_current_rule_symbol_append)
12 (grammar_current_rule_action_append): Export.
13 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
14 (symbol_list_action_append): Remove.
15 Hook the routines from reader.
16 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
17 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
18
19 * src/reader.c (read_declarations): Remove, unused.
20
21 * src/parse-gram.y: Handle the epilogue.
22 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
23 (grammar_start_symbol_set): this.
24 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
25 * src/reader.c (readgram): Remove, unused.
26 (reader): Adjust to insert eoftoken and axiom where appropriate.
27
28 * src/reader.c (copy_dollar): Replace with...
29 * src/scan-gram.h (handle_dollar): this.
30 * src/parse-gram.y: Remove `%thong'.
31
32 * src/reader.c (copy_at): Replace with...
33 * src/scan-gram.h (handle_at): this.
34
35 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
36 New.
37
38 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
39 time being.
40
41 * src/reader.h, src/reader.c (grammar_rule_end): New.
42
43 * src/parse.y (current_type, current_class): New.
44 Implement `%nterm', `%token' support.
45 Merge `%term' into `%token'.
46 (string_as_id): New.
47 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
48 type name.
49
50 * src/parse-gram.y: Be sure to handle properly the beginning of
51 rules.
52
53 * src/parse-gram.y: Handle %type.
54 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
55
56 * src/parse-gram.y: More directives support.
57 * src/options.c: No longer handle source directives.
58
59 * src/parse-gram.y: Fix %output.
60
61 * src/parse-gram.y: Handle %union.
62 Use the prologue locations.
63 * src/reader.c (parse_union_decl): Remove.
64
65 * src/reader.h, src/reader.c (epilogue_set): New.
66 * src/parse-gram.y: Use it.
67
68 * data/bison.simple, data/bison.c++: b4_stype is now either not
69 defined, then default to int, or to the contents of %union,
70 without `union' itself.
71 Adjust.
72 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
73
74 * src/output.c (actions_output): Don't output braces, as they are
75 already handled by the scanner.
76
77 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
78 characters to themselves.
79
80 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
81 that the epilogue has a proper #line.
82
83 * src/parse-gram.y: Handle precedence/associativity.
84
85 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
86 a terminal.
87 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
88 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
89 at all to define terminals that cannot be emitted.
90
91 * src/scan-gram.l: Escape M4 characters.
92
93 * src/scan-gram.l: Working properly with escapes in user
94 strings/characters.
95
96 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
97 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
98 grammar.
99 Use more modest sizes, as for the time being the parser does not
100 release memory, and therefore the process swallows a huge amount
101 of memory.
102
103 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
104 stricter %token grammar.
105
106 * src/symtab.h (associativity): Add `undef_assoc'.
107 (symbol_precedence_set): Do nothing when passed an undef_assoc.
108 * src/symtab.c (symbol_check_alias_consistence): Adjust.
109
110 * tests/regression.at (Invalid %directive): Remove, as it is now
111 meaningless.
112 (Invalid inputs): Adjust to the new error messages.
113 (Token definitions): The new grammar doesn't allow too many
114 eccentricities.
115
116 * src/lex.h, src/lex.c: Remove.
117 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
118 (copy_character, copy_string2, copy_string, copy_identifier)
119 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
120 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
121 (parse_action): Remove.
122 * po/POTFILES.in: Adjust.
123
2e047461
AD
1242002-06-11 Akim Demaille <akim@epita.fr>
125
126 * src/reader.c (parse_action): Don't store directly into the
127 rule's action member: return the action as a string.
128 Don't require `rule_length' as an argument: compute it.
129 (grammar_current_rule_symbol_append)
130 (grammar_current_rule_action_append): New, eved out from
131 (readgram): here.
132 Remove `action_flag', `rulelength', unused now.
133
9af3fbce
AD
1342002-06-11 Akim Demaille <akim@epita.fr>
135
136 * src/reader.c (grammar_current_rule_prec_set).
137 (grammar_current_rule_check): New, eved out from...
138 (readgram): here.
139 Remove `xaction', `first_rhs': useless.
140 * tests/input.at (Type clashes): New.
141 * tests/existing.at (GNU Cim Grammar): Adjust.
142
1485e106
AD
1432002-06-11 Akim Demaille <akim@epita.fr>
144
145 * src/reader.c (grammar_midrule_action): New, Eved out from
146 (readgram): here.
147
da4160c3
AD
1482002-06-11 Akim Demaille <akim@epita.fr>
149
150 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
151 New.
152 (readgram): Use them as replacement of inlined code, crule and
153 crule1.
154
f6d0f937
AD
1552002-06-11 Akim Demaille <akim@epita.fr>
156
157 * src/reader.c (grammar_end, grammar_symbol_append): New.
158 (readgram): Use them.
159 Make the use of `p' as local as possible.
160
69078d4b
AD
1612002-06-10 Akim Demaille <akim@epita.fr>
162
163 GCJ's parser requires the tokens to be defined before the prologue.
164
165 * data/bison.simple: Output the token definition before the user's
166 prologue.
167 * tests/regression.at (Braces parsing, Duplicate string)
168 (Mixing %token styles): Check the output from bison.
169 (Early token definitions): New.
170
5e424082
AD
1712002-06-10 Akim Demaille <akim@epita.fr>
172
173 * src/symtab.c (symbol_user_token_number_set): Don't complain when
174 assigning twice the same user number to a token, so that we can
175 use it in...
176 * src/lex.c (lex): here.
177 Also use `symbol_class_set' instead of hand written code.
178 * src/reader.c (parse_assoc_decl): Likewise.
179
44536b35
AD
1802002-06-10 Akim Demaille <akim@epita.fr>
181
182 * src/symtab.c, src/symtab.c (symbol_class_set)
183 (symbol_user_token_number_set): New.
184 * src/reader.c (parse_token_decl): Use them.
185 Use a switch instead of ifs.
186 Use a single argument.
187
8b9f2372
AD
1882002-06-10 Akim Demaille <akim@epita.fr>
189
190 Remove `%thong' support as it is undocumented, unused, duplicates
191 `%token's job, and creates useless e-mail traffic with people who
192 want to know what it is, why it is undocumented, unused, and
193 duplicates `%token's job.
194
195 * src/reader.c (parse_thong_decl): Remove.
196 * src/options.c (option_table): Remove "thong".
197 * src/lex.h (tok_thong): Remove.
198
3ae2b51f
AD
1992002-06-10 Akim Demaille <akim@epita.fr>
200
201 * src/symtab.c, src/symtab.c (symbol_type_set)
202 (symbol_precedence_set): New.
203 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
204 (value_components_used): Remove, unused.
205
2f1afb73
AD
2062002-06-09 Akim Demaille <akim@epita.fr>
207
208 Move symbols handling code out of the reader.
209
210 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
211 (axiom): Move to...
212 * src/symtab.h, src/symtab.c: here.
213
214 * src/gram.c (start_symbol): Remove: use startsymbol->number.
215 * src/reader.c (startval): Rename as...
216 * src/symtab.h, src/symtab.c (startsymbol): this.
217 * src/reader.c: Adjust.
218
219 * src/reader.c (symbol_check_defined, symbol_make_alias)
220 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
221 (token_translations_init)
222 Move to...
223 * src/symtab.c: here.
224 * src/reader.c (packsymbols): Move to...
225 * src/symtab.h, src/symtab.c (symbols_pack): here.
226 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
227 argument.
228
e9bca3ad
AD
2292002-06-03 Akim Demaille <akim@epita.fr>
230
231 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
232 then statements.
233
86eff183
AD
2342002-06-03 Akim Demaille <akim@epita.fr>
235
236 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
237 structs with non literals.
238 * src/scan-skel.l: never-interactive.
239 * src/conflicts.c (enum conflict_resolution_e): No trailing
240 comma.
241 * src/getargs.c (usage): Split long literal strings.
242 Reported by Hans Aberg.
243
717be197
AD
2442002-05-28 Akim Demaille <akim@epita.fr>
245
246 * data/bison.c++: Use C++ ostreams.
247 (cdebug_): New member.
248
670ddffd
AD
2492002-05-28 Akim Demaille <akim@epita.fr>
250
251 * src/output.c (output_skeleton): Be sure to allocate enough room
252 for `/' _and_ for `\0' in full_skeleton.
253
769b430f
AD
2542002-05-28 Akim Demaille <akim@epita.fr>
255
256 * data/bison.c++: Catch up with bison.simple:
257 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
258 and Paul Eggert <eggert@twinsun.com>: `error' handing.
259 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
260 and popping traces.
261
7067cb36
PH
2622002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
263
264 * src/output.c (output_skeleton): Put an explicit path in front of
265 the skeleton file name, rather than relying on the -I directory,
266 to partially alleviate effects of having a skeleton file lying around
267 in the current directory.
769b430f 268
4a713ec2
PH
2692002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
270
769b430f 271 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
272 obstack_printf should be obstack_fgrow1.
273
b408954b
AD
2742002-05-26 Akim Demaille <akim@epita.fr>
275
276 * src/state.h (state_t): `solved_conflicts' is a new member.
277 * src/LR0.c (new_state): Set it to 0.
278 * src/conflicts.h, src/conflicts.c (print_conflicts)
279 (free_conflicts, solve_conflicts): Rename as...
280 (conflicts_print, conflicts_free, conflicts_solve): these.
281 Adjust callers.
282 * src/conflicts.c (enum conflict_resolution_e)
283 (solved_conflicts_obstack): New, used by...
284 (log_resolution): this.
285 Adjust to attach the conflict resolution to each state.
286 Complete the description with the precedence/associativity
287 information.
288 (resolve_sr_conflict): Adjust.
289 * src/print.c (print_state): Output its solved_conflicts.
290 * tests/conflicts.at (Unresolved SR Conflicts)
291 (Solved SR Conflicts): Exercise --report=all.
292
a49aecd5
AD
2932002-05-26 Akim Demaille <akim@epita.fr>
294
295 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
296 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
297 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
298 (token_number_t, item_number_as_token_number)
299 (token_number_as_item_number, muscle_insert_token_number_table):
300 Rename as...
301 (symbol_number_t, item_number_as_symbol_number)
302 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
303 these, since it is more appropriate.
304
5504898e
AD
3052002-05-26 Akim Demaille <akim@epita.fr>
306
307 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
308 `Error:' lines.
309 * data/bison.simple (yystos) [YYDEBUG]: New.
310 (yyparse) [YYDEBUG]: Display the symbols which are popped during
311 error recovery.
312 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
313
ec3bc396
AD
3142002-05-25 Akim Demaille <akim@epita.fr>
315
316 * doc/bison.texinfo (Debugging): Split into...
317 (Tracing): this new section, its former contents, and...
318 (Understanding): this new section.
319 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
320 by...
321 (report_flag): this.
322 Adjust all dependencies.
323 (report_args, report_types, report_argmatch): New.
324 (usage, getargs): Report/support -r, --report.
325 * src/options.h
326 (struct option_table_struct): Rename as..,
327 (struct option_table_s): this.
328 Rename the `set_flag' member to `flag' to match with getopt_long's
329 struct.
330 * src/options.c (option_table): Split verbose into an entry for
331 %verbose, and another for --verbose.
332 Support --report/-r, so remove -r from the obsolete --raw.
333 * src/print.c: Attach full item sets and lookaheads reports to
334 report_flag instead of trace_flag.
335 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
336
78df8250
PE
3372002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
338 and Paul Eggert <eggert@twinsun.com>
769b430f 339
78df8250
PE
340 * data/bison.simple (yyparse): Correct error handling to conform to
341 POSIX and yacc. Specifically, after syntax error is discovered,
342 do not reduce further before shifting the error token.
343 Clean up the code a bit by removing the labels yyerrdefault,
344 yyerrhandle, yyerrpop.
345 * NEWS: Document the above.
346
c0c9ea05
PH
3472002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
348
349 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
350 type; it isn't always big enough, since it doesn't necessarily
351 include non-terminals.
769b430f 352 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
353 the latter can be removed.
354 (yy_token_number_type): Remove, only one use.
355 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
356 don't use TokenNumberType as element type.
769b430f 357
c0c9ea05
PH
358 * tests/regression.at: Modify expected output to agree with change
359 to yyr1 and yytranslate.
769b430f 360
6390a83f
FK
3612002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
362
363 * src/reader.c (parse_action): Use copy_character instead of
364 obstack_1grow.
365
db7c8e9a
AD
3662002-05-13 Akim Demaille <akim@epita.fr>
367
368 * tests/regression.at (Token definitions): Prototype yylex and
369 yyerror.
370
fcc61800
PH
3712002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
372
158c687b 373 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
374 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
375 32-bit arithmetic.
376 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
377
5683e9b2
AD
3782002-05-07 Akim Demaille <akim@epita.fr>
379
380 * tests/synclines.at: Be sure to prototype yylex and yyerror to
381 avoid GCC warnings.
382
0c2d3f4c
AD
3832002-05-07 Akim Demaille <akim@epita.fr>
384
385 Kill GCC warnings.
386
387 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
388 over the RHS of each rule.
389 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
390 * src/state.h (state_t): Member `nitems' is unsigned short.
391 * src/LR0.c (get_state): Adjust.
392 * src/reader.c (packgram): Likewise.
393 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
394 `Type'.
395 (muscle_insert_int_table): Remove, unused.
396 (prepare_rules): Remove `max'.
397
1565b720
AD
3982002-05-06 Akim Demaille <akim@epita.fr>
399
400 * src/closure.c (print_firsts): Display of the symbol tags.
401 (bitmatrix_print): Move to...
402 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
403 here.
404 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
405
cfaee611
AD
4062002-05-06 Akim Demaille <akim@epita.fr>
407
408 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
409 hash_do_for_each.
410
458be8e0
AD
4112002-05-06 Akim Demaille <akim@epita.fr>
412
413 * src/LR0.c (new_state, get_state): Instead of using the global
414 `kernel_size' and `kernel_base', have two new arguments:
415 `core_size' and `core'.
416 Adjust callers.
417
a900a624
AD
4182002-05-06 Akim Demaille <akim@epita.fr>
419
420 * src/reader.c (packgram): No longer end `ritem' with a 0
421 sentinel: it is not used.
422
d4e7d3a1
AD
4232002-05-05 Akim Demaille <akim@epita.fr>
424
425 New experimental feature: display the lookaheads in the report and
426 graph.
427
428 * src/print (print_core): When --trace-flag, display the rules
429 lookaheads.
430 * src/print_graph.c (print_core): Likewise.
431 Swap the arguments.
432 Adjust caller.
433
39ceb25b
AD
4342002-05-05 Akim Demaille <akim@epita.fr>
435
436 * tests/torture.at (Many lookaheads): New test.
437
5372019f
AD
4382002-05-05 Akim Demaille <akim@epita.fr>
439
440 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
441 (GENERATE_MUSCLE_INSERT_TABLE): this.
442 (output_int_table, output_unsigned_int_table, output_short_table)
443 (output_token_number_table, output_item_number_table): Replace with...
444 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
445 (muscle_insert_short_table, muscle_insert_token_number_table)
446 (muscle_insert_item_number_table): these.
447 Adjust all callers.
448 (prepare_tokens): Don't free `translations', since...
449 * src/reader.h, src/reader.c (grammar_free): do it.
450 Move to...
451 * src/gram.h, src/gram.c (grammar_free): here.
452 * data/bison.simple, data/bison.c++: b4_token_number_max is now
453 b4_translate_max.
454
5df5f6d5
AD
4552002-05-05 Akim Demaille <akim@epita.fr>
456
457 * src/output.c (output_unsigned_int_table): New.
458 (prepare_rules): `i' is unsigned.
459 `prhs', `rline', `r2' are unsigned int.
460 Rename muscle `rhs_number_max' as `rhs_max'.
461 Output muscles `prhs_max', `rline_max', and `r2_max'.
462 Free rline and r1.
463 * data/bison.simple, data/bison.c++: Adjust to use these muscles
464 to compute types instead of constant types.
465 * tests/regression.at (Web2c Actions): Adjust.
466
b87f8b21
AD
4672002-05-04 Akim Demaille <akim@epita.fr>
468
469 * src/symtab.h (SALIAS, SUNDEF): Rename as...
470 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
471 Adjust dependencies.
472 * src/output.c (token_definitions_output): Be sure not to output a
473 `#define 'a'' when fed with `%token 'a' "a"'.
474 * tests/regression.at (Token definitions): New.
475
8bb936e4
PE
4762002-05-03 Paul Eggert <eggert@twinsun.com>
477
478 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
479 for K&R C.
480
4812002-05-03 gettextize <bug-gnu-gettext@gnu.org>
482
483 * Makefile.am (SUBDIRS): Remove intl.
484 (EXTRA_DIST): Add config/config.rpath.
485
53c71a12
AD
4862002-05-03 Akim Demaille <akim@epita.fr>
487
488 * data/bison.simple (m4_if): Don't output empty enums.
489 And actually, output valid enum definitions :(.
490
289dd0cf
AD
4912002-05-03 Akim Demaille <akim@epita.fr>
492
493 * configure.bat: Remove, completely obsolete.
494 * Makefile.am (EXTRA_DIST): Adjust.
495 Don't distribute config.rpath...
496 * config/Makefile.am (EXTRA_DIST): Do it.
497
db85e524
AD
4982002-05-03 Akim Demaille <akim@epita.fr>
499
500 * configure.in (GETTEXT_VERSION): New.
501 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
502
83ccf991
AD
5032002-05-03 Akim Demaille <akim@epita.fr>
504
505 * data/bison.simple (b4_token_enum): New.
506 (b4_token_defines): Use it to output tokens both as #define and
507 enums.
508 Suggested by Paul Eggert.
509 * src/output.c (token_definitions_output): Don't output spurious
510 white spaces.
511
1f418995
AD
5122002-05-03 Akim Demaille <akim@epita.fr>
513
514 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
515
45119f04
RA
5162002-05-02 Robert Anisko <robert@lrde.epita.fr>
517
518 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
519 Update the stack class, give a try to deque as the default container.
520
b2d52318
AD
5212002-05-02 Akim Demaille <akim@epita.fr>
522
523 * data/bison.simple (yyparse): Do not implement @$ = @1.
524 (YYLLOC_DEFAULT): Adjust to do it.
525 * doc/bison.texinfo (Location Default Action): Fix.
526
3a8b4109
AD
5272002-05-02 Akim Demaille <akim@epita.fr>
528
529 * src/reader.c (parse_braces): Merge into...
530 (parse_action): this.
531
84614e13
AD
5322002-05-02 Akim Demaille <akim@epita.fr>
533
534 * configure.in (ALL_LINGUAS): Remove.
535 * po/LINGUAS, hr.po: New.
536
fdbcd8e2
AD
5372002-05-02 Akim Demaille <akim@epita.fr>
538
539 Remove the so called hairy (semantic) parsers.
540
541 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
542 * src/gram.h, src/gram.c (semantic_parser): Remove.
543 (rule_t): Remove the guard and guard_line members.
544 * src/lex.h (token_t): remove tok_guard.
545 * src/options.c (option_table): Remove %guard and %semantic_parser
546 support.
547 * src/output.c, src/output.h (guards_output): Remove.
548 (prepare): Adjust.
549 (token_definitions_output): Don't output the `T'
550 tokens (???).
551 (output_skeleton): Don't output the guards.
552 * src/files.c, src/files.c (attrsfile): Remove.
553 * src/reader.c (symbol_list): Remove the guard and guard_line
554 members.
555 Adjust dependencies.
556 (parse_guard): Remove.
557 * data/bison.hairy: Remove.
558 * doc/bison.texinfo (Environment Variables): Remove occurrences of
559 BISON_HAIRY.
560
82b6cb3f
AD
5612002-05-02 Akim Demaille <akim@epita.fr>
562
563 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
564 (parse_guard): Rename the formal argument `stack_offset' as
565 `rule_length', which is more readable.
566 Adjust callers.
567 (copy_at, copy_dollar): Instead of outputting the hard coded
568 values of $$, $n and so forth, output invocation to b4_lhs_value,
569 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
570 Note: this patch partially drops `semantic-parser' support: it
571 always does `rule_length - n', where semantic parsers ought to
572 always use `-n'.
82b6cb3f
AD
573 * data/bison.simple, data/bison.c++ (b4_lhs_value)
574 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
575
6cbfbcc5
AD
5762002-05-02 Akim Demaille <akim@epita.fr>
577
578 * configure.in (AC_INIT): Bump to 1.49b.
579 (AM_INIT_AUTOMAKE): Short invocation.
580
b8548114
AD
5812002-05-02 Akim Demaille <akim@epita.fr>
582
583 Version 1.49a.
584
c20cd1fa
AD
5852002-05-01 Akim Demaille <akim@epita.fr>
586
587 * src/skeleton.h: Remove.
588
8a9566d4
AD
5892002-05-01 Akim Demaille <akim@epita.fr>
590
591 * src/skeleton.h: Fix the #endif.
592 Reported by Magnus Fromreide.
593
8c6d399a
PE
5942002-04-26 Paul Eggert <eggert@twinsun.com>
595
596 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
597 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 598 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 599
2b7ed18a
RA
6002002-04-25 Robert Anisko <robert@lrde.epita.fr>
601
602 * src/scan-skel.l: Postprocess quadrigraphs.
603
604 * src/reader.c (copy_character): New function, used to output
605 single characters while replacing `[' and `]' with quadrigraphs, to
606 avoid troubles with M4 quotes.
607 (copy_comment): Output characters with copy_character.
608 (read_additionnal_code): Likewise.
609 (copy_string2): Likewise.
610 (copy_definition): Likewise.
611
612 * tests/calc.at: Exercise M4 quoting.
613
34a89c50
AD
6142002-04-25 Akim Demaille <akim@epita.fr>
615
616 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
617 between `!' and the command.
618 Reported by Paul Eggert.
619
0dd1580a
RA
6202002-04-24 Robert Anisko <robert@lrde.epita.fr>
621
622 * tests/calc.at: Exercise prologue splitting.
623
624 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
625 `b4_post_prologue' instead of `b4_prologue'.
626
627 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
628 muscles.
629 (output): Free pre_prologue_obstack and post_prologue_obstack.
630 * src/files.h, src/files.c (attrs_obstack): Remove.
631 (pre_prologue_obstack, post_prologue_obstack): New.
632 * src/reader.c (copy_definition): Add a parameter to specify the
633 obstack to fill, instead of using attrs_obstack unconditionally.
634 (read_declarations): Pass pre_prologue_obstack to copy_definition if
635 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
636
83c1796f
PE
6372002-04-23 Paul Eggert <eggert@twinsun.com>
638
639 * data/bison.simple: Remove unnecessary commentary and white
640 space differences from 1_29-branch.
641 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
642
643 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
644 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
645 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
646 constructors or destructors.
647
648 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
649
1207eeac
AD
6502002-04-23 Akim Demaille <akim@epita.fr>
651
652 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
653 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
654 location with columns.
655 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
656 All reported by Paul Eggert.
657
78ab8f67
AD
6582002-04-22 Akim Demaille <akim@epita.fr>
659
660 * src/reduce.c (dump_grammar): Move to...
661 * src/gram.h, src/gram.c (grammar_dump): here.
662 Be sure to separate long item numbers.
663 Don't read the members of a rule's prec if its nil.
664
133c20e2
AD
6652002-04-22 Akim Demaille <akim@epita.fr>
666
667 * src/output.c (table_size, table_grow): New.
668 (MAXTABLE): Remove, replace uses with table_size.
669 (pack_vector): Instead of dying when the table is too big, grow it.
670
9515e8a7
AD
6712002-04-22 Akim Demaille <akim@epita.fr>
672
673 * data/bison.simple (yyr1): Its type is that of a token number.
674 * data/bison.c++ (r1_): Likewise.
675 * tests/regression.at (Web2c Actions): Adjust.
676
23c5a174
AD
6772002-04-22 Akim Demaille <akim@epita.fr>
678
679 * src/reader.c (token_translations_init): 256 is now the default
680 value for the error token, i.e., it will be assigned another
681 number if the user assigned 256 to one of her tokens.
682 (reader): Don't force 256 to error.
683 * doc/bison.texinfo (Symbols): Adjust.
684 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
685 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
686 etc. instead of 10, 20, 30 (which was used to `jump' over error
687 (256) and undefined (2)).
688
5fbb0954
AD
6892002-04-22 Akim Demaille <akim@epita.fr>
690
691 Propagate more token_number_t.
692
693 * src/gram.h (token_number_as_item_number)
694 (item_number_as_token_number): New.
695 * src/output.c (GENERATE_OUTPUT_TABLE): New.
696 Use it to create output_item_number_table and
697 output_token_number_table.
698 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
699 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
700 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
701 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
702
4f940944
AD
7032002-04-22 Akim Demaille <akim@epita.fr>
704
705 * src/output.h, src/output.c (get_lines_number): Remove.
706
3ded9a63
AD
7072002-04-19 Akim Demaille <akim@epita.fr>
708
709 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
710 as Lex/Flex'.
711 (Debugging): More details about enabling the debugging features.
712 (Table of Symbols): Describe $$, $n, @$, and @n.
713 Suggested by Tim Josling.
714
e0c471a9
AD
7152002-04-19 Akim Demaille <akim@epita.fr>
716
717 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
718
fecc10cd
AD
7192002-04-10 Akim Demaille <akim@epita.fr>
720
721 * src/system.h: Rely on HAVE_LIMITS_H.
722 Suggested by Paul Eggert.
723
51dec47b
AD
7242002-04-09 Akim Demaille <akim@epita.fr>
725
726 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
727 full stderr, and strip it according to the bison options, instead
728 of composing the error message from different bits.
729 This makes it easier to check for several error messages.
730 Adjust all the invocations.
731 Add an invocation exercising the error token.
732 Add an invocation demonstrating a stupid error message.
733 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
734 Adjust the tests.
735 Error message are for stderr, not stdout.
736
007a50a4
AD
7372002-04-09 Akim Demaille <akim@epita.fr>
738
739 * src/gram.h, src/gram.c (error_token_number): Remove, use
740 errtoken->number.
741 * src/reader.c (reader): Don't specify the user token number (2)
742 for $undefined, as it uselessly prevents using it.
743 * src/gram.h (token_number_t): Move to...
744 * src/symtab.h: here.
745 (state_t.number): Is a token_number_t.
746 * src/print.c, src/reader.c: Use undeftoken->number instead of
747 hard coded 2.
748 (Even though this 2 is not the same as above: the number of the
749 undeftoken remains being 2, it is its user token number which
750 might not be 2).
751 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
752 `user_token_number_max'.
753 Output `undef_token_number'.
754 * data/bison.simple, data/bison.c++: Use them.
755 Be sure to map invalid yylex return values to
756 `undef_token_number'. This saves us from gratuitous SEGV.
757
758 * tests/conflicts.at (Solved SR Conflicts)
759 (Unresolved SR Conflicts): Adjust.
760 * tests/regression.at (Web2c Actions): Adjust.
761
06446ccf
AD
7622002-04-08 Akim Demaille <akim@epita.fr>
763
764 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
765 Adding #line.
766 Remove the duplicate `typedefs'.
767 (RhsNumberType): Fix the declaration and various other typos.
768 Use __ofile__.
769 * data/bison.simple: Use __ofile__.
770 * src/scan-skel.l: Handle __ofile__.
771
62a3e4f0
AD
7722002-04-08 Akim Demaille <akim@epita.fr>
773
774 * src/gram.h (item_number_t): New, the type of item numbers in
775 RITEM. Note that it must be able to code symbol numbers as
776 positive number, and the negation of rule numbers as negative
777 numbers.
778 Adjust all dependencies (pretty many).
779 * src/reduce.c (rule): Remove this `short *' pointer: use
780 item_number_t.
781 * src/system.h (MINSHORT, MAXSHORT): Remove.
782 Include `limits.h'.
783 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
784 (shortcpy): Remove.
785 (MAXTABLE): Move to...
786 * src/output.c (MAXTABLE): here.
787 (prepare_rules): Use output_int_table to output rhs.
788 * data/bison.simple, data/bison.c++: Adjust.
789 * tests/torture.at (Big triangle): Move the limit from 254 to
790 500.
791 * tests/regression.at (Web2c Actions): Ajust.
792
793 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
794 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
795 passes, but produces negative #line number, once fixed, GCC is
796 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
797 C), it passes.
798 * src/state.h (state_h): Code input lines on ints, not shorts.
799
bb88b0fc
AD
8002002-04-08 Akim Demaille <akim@epita.fr>
801
802 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
803 and then the grammar.
804
9a636f47
AD
8052002-04-08 Akim Demaille <akim@epita.fr>
806
807 * src/system.h: No longer using strndup.
808
680e8701
AD
8092002-04-07 Akim Demaille <akim@epita.fr>
810
811 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
812 * src/output.c (output_table_data): Return the longest number.
813 (prepare_tokens): Output `token_number_max').
814 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
815 New.
816 Use them to define yy_token_number_type/TokenNumberType.
817 Use this type for yytranslate.
818 * tests/torture.at (Big triangle): Push the limit from 124 to
819 253.
820 * tests/regression.at (Web2c Actions): Adjust.
821
817e9f41
AD
8222002-04-07 Akim Demaille <akim@epita.fr>
823
824 * tests/torture.at (Big triangle): New.
825 (GNU AWK Grammar, GNU Cim Grammar): Move to...
826 * tests/existing.at: here.
827
5123689b
AD
8282002-04-07 Akim Demaille <akim@epita.fr>
829
830 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
831 nritems.
832 Adjust dependencies.
833
f3849179
AD
8342002-04-07 Akim Demaille <akim@epita.fr>
835
836 * src/reader.c: Normalize increments to prefix form.
837
bd02036a
AD
8382002-04-07 Akim Demaille <akim@epita.fr>
839
840 * src/reader.c, symtab.c: Remove debugging code.
841
db8837cb
AD
8422002-04-07 Akim Demaille <akim@epita.fr>
843
844 Rename all the `bucket's as `symbol_t'.
845
846 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
847 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
848 * src/symtab.c, src/symtab.h (bucket): Rename as...
849 (symbol_t): this.
850 (symbol_list_new, bucket_check_defined, bucket_make_alias)
851 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
852 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
853 (buckets_new, buckets_free, buckets_do): Rename as...
854 (symbol_list_new, symbol_check_defined, symbol_make_alias)
855 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
856 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
857 (symbols_new, symbols_free, symbols_do): these.
858
72a23c97
AD
8592002-04-07 Akim Demaille <akim@epita.fr>
860
861 Use lib/hash for the symbol table.
862
863 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
864 EOF.
865 * src/lex.c (lex): Set the `number' member of new terminals.
866 * src/reader.c (bucket_check_defined, bucket_make_alias)
867 (bucket_check_alias_consistence, bucket_translation): New.
868 (reader, grammar_free, readgram, token_translations_init)
869 (packsymbols): Adjust.
870 (reader): Number the predefined tokens.
871 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
872 for predefined tokens.
873 * src/symtab.h (bucket): Remove all the hash table related
874 members.
875 * src/symtab.c (symtab): Replace by...
876 (bucket_table): this.
877 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
878 (buckets_new, buckets_do): New.
879
280a38c3
AD
8802002-04-07 Akim Demaille <akim@epita.fr>
881
882 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
883 (start_symbol, max_user_token_number, semantic_parser)
884 (error_token_number): Initialize.
885 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
886 Initialize.
887 (reader): Don't.
888 (errtoken, eoftoken, undeftoken, axiom): Extern.
889
03b31c0c
AD
8902002-04-07 Akim Demaille <akim@epita.fr>
891
892 * src/gram.h (rule_s): prec and precsym are now pointers
893 to the bucket giving the priority/associativity.
894 Member `associativity' removed: useless.
895 * src/reduce.c, src/conflicts.c: Adjust.
896
8b3df748
AD
8972002-04-07 Akim Demaille <akim@epita.fr>
898
899 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
900 Properly escape the symbols' TAG when outputting them.
901
e601aa1d
AD
9022002-04-07 Akim Demaille <akim@epita.fr>
903
904 * src/lalr.h (LA): Is a bitsetv, not bitset*.
905
b0299a2e
AD
9062002-04-07 Akim Demaille <akim@epita.fr>
907
908 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
909 (LArule): this, which is an array to rule_t*.
910 * src/print.c, src/conflicts.c: Adjust.
911
d7e1f00c
AD
9122002-04-07 Akim Demaille <akim@epita.fr>
913
914 * src/gram.h (rule_t): Rename `number' as `user_number'.
915 `number' is a new member.
916 Adjust dependencies.
917 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
918
cc9305dd
AD
9192002-04-07 Akim Demaille <akim@epita.fr>
920
921 As a result of the previous patch, it is no longer needed
922 to reorder ritem itself.
923
924 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
925
b0940840
AD
9262002-04-07 Akim Demaille <akim@epita.fr>
927
928 Be sure never to walk through RITEMS, but use only data related to
929 the rules themselves. RITEMS should be banished.
930
931 * src/output.c (output_token_translations): Rename as...
932 (prepare_tokens): this.
933 In addition to `translate', prepare the muscles `tname' and
934 `toknum', which were handled by...
935 (output_rule_data): this.
936 Remove, and move the remainder of its outputs into...
937 (prepare_rules): this new routines, which also merges content from
938 (output_gram): this.
939 (prepare_rules): Be sure never to walk through RITEMS.
940 (output_stos): Rename as...
941 (prepare_stos): this.
942 (output): Always invoke prepare_states, after all, just don't use it
943 in the output if you don't need it.
944
643a5994
AD
9452002-04-07 Akim Demaille <akim@epita.fr>
946
947 * src/LR0.c (new_state): Display `nstates' as the name of the
948 newly created state.
949 Adjust to initialize first_state and last_state if needed.
950 Be sure to distinguish the initial from the final state.
951 (new_states): Create the itemset of the initial state, and use
952 new_state.
953 * src/closure.c (closure): Now that the initial state has its
954 items properly set, there is no need for a special case when
955 creating `ruleset'.
956
957 As a result, now the rule 0, reducing to $axiom, is visible in the
958 outputs. Adjust the test suite.
959
960 * tests/conflicts.at (Solved SR Conflicts)
961 (Unresolved SR Conflicts): Adjust.
962 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
963 * tests/conflicts.at (S/R in initial): New.
964
b4c4ccc2
AD
9652002-04-07 Akim Demaille <akim@epita.fr>
966
967 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
968 the RHS of the rules.
969 * src/output.c (output_gram): Likewise.
970
bba97eb2
AD
9712002-04-07 Akim Demaille <akim@epita.fr>
972
973 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
974 bucket.
975 Adjust all dependencies.
976 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
977 `number' of the buckets too.
978 * src/gram.h: Include `symtab.h'.
979 (associativity): Move to...
980 * src/symtab.h: here.
981 No longer include `gram.h'.
982
c3b407f4
AD
9832002-04-07 Akim Demaille <akim@epita.fr>
984
985 * src/gram.h, src/gram.c (rules_rhs_length): New.
986 (ritem_longest_rhs): Use it.
987 * src/gram.h (rule_t): `number' is a new member.
988 * src/reader.c (packgram): Set it.
989 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
990 the end of `rules', and count them out of `nrules'.
991 (reduce_output, dump_grammar): Adjust.
992 * src/print.c (print_grammar): It is no longer needed to check for
993 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
994 * tests/reduce.at (Reduced Automaton): New test.
995
11652ab3
AD
9962002-04-07 Akim Demaille <akim@epita.fr>
997
998 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
999 lacking `+ 1' to nrules, Bison reported as useless a token if it
1000 was used solely to set the precedence of the last rule...
1001
26b23c1a
AD
10022002-04-07 Akim Demaille <akim@epita.fr>
1003
1004 * data/bison.c++, data/bison.simple: Don't output the current file
1005 name in #line, to avoid useless diffs between two identical
1006 outputs under different names.
1007
18bcecb0
AD
10082002-04-07 Akim Demaille <akim@epita.fr>
1009
1010 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1011 Normalize loops to using `< nrules + 1', not `<= nrules'.
1012
fa770c86
AD
10132002-04-07 Akim Demaille <akim@epita.fr>
1014
1015 * TODO: Update.
1016
d9b739c3
AD
10172002-04-07 Akim Demaille <akim@epita.fr>
1018
1019 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1020 bucket.value as bucket.number.
1021
99013900
AD
10222002-04-07 Akim Demaille <akim@epita.fr>
1023
1024 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1025 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1026 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1027 RHS, instead of being an index in RITEMS.
1028
e966383b
PE
10292002-04-04 Paul Eggert <eggert@twinsun.com>
1030
1031 * doc/bison.texinfo: Update copyright date.
1032 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1033 (Symbols): Warn about running Bison in one character set,
1034 but compiling and/or running in an incompatible one.
1035 Warn about character code 256, too.
1036
10372002-04-03 Paul Eggert <eggert@twinsun.com>
1038
1039 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1040 YYERROR_VERBOSE is nonzero, not whether it is defined.
1041
1042 Merge changes from bison-1_29-branch.
c307773e 1043
8d6c48b9
PE
10442002-03-20 Paul Eggert <eggert@twinsun.com>
1045
1046 Merge fixes from Debian bison_1.34-1.diff.
1047
1048 * configure.in (AC_PREREQ): 2.53.
1049
e53c6322
AD
10502002-03-20 Akim Demaille <akim@epita.fr>
1051
1052 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1053
9ffbeca7
PE
10542002-03-19 Paul Eggert <eggert@twinsun.com>
1055
21db0b2a
PE
1056 * src/bison.simple (YYCOPY): New macro.
1057 (YYSTACK_RELOCATE): Use it.
1058 Remove Type arg; no longer needed. All callers changed.
1059 (yymemcpy): Remove; no longer needed.
1060
9ffbeca7
PE
1061 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1062 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1063
642cb8f8
AD
10642002-03-19 Akim Demaille <akim@epita.fr>
1065
1066 Test and fix the #line outputs.
1067
1068 * tests/atlocal.at (GCC): New.
1069 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1070 (Prologue synch line, ,%union synch line, Postprologue synch line)
1071 (Action synch line, Epilogue synch line): New tests.
1072 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1073 * data/bison.simple, data/bison.c++: Use it.
1074
3c31a486
AD
10752002-03-19 Akim Demaille <akim@epita.fr>
1076
1077 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1078 (Solved SR Conflicts, %expect not enough, %expect right)
1079 (%expect too much): Move to...
1080 * tests/conflicts.at: this new file.
1081
0d8bed56
AD
10822002-03-19 Akim Demaille <akim@epita.fr>
1083
1084 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1085 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1086 that we can move to enums for instance.
1087 * src/output.c (token_definitions_output): Output a list of
1088 `token-name, token-number' instead of the #define.
1089 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1090
9208d17f
AD
10912002-03-14 Akim Demaille <akim@epita.fr>
1092
1093 Use Gettext 0.11.1.
1094
af27eacb
RA
10952002-03-09 Robert Anisko <robert@lrde.epita.fr>
1096
1097 * data/bison.c++: Make the user able to add members to the generated
1098 parser by subclassing.
1099
9101a310
RA
11002002-03-05 Robert Anisko <robert@lrde.epita.fr>
1101
1102 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1103 a character.
1104 Reported by Nicolas Tisserand and Nicolas Burrus.
1105
fff9bf0b
RA
11062002-03-04 Robert Anisko <robert@lrde.epita.fr>
1107
1108 * src/reader.c: Warn about lacking semi-colons, do not complain.
1109
64dba31e
RA
11102002-03-04 Robert Anisko <robert@lrde.epita.fr>
1111
1112 * data/bison.c++: Remove a debug line.
1113
374f5a14
RA
11142002-03-04 Robert Anisko <robert@lrde.epita.fr>
1115
1116 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1117 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1118 provide a default implementation.
1119
bfcf1f3a
AD
11202002-03-04 Akim Demaille <akim@epita.fr>
1121
1122 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1123 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1124 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1125 * tests/semantic.at (Parsing Guards): Similarly.
1126 * src/reader.at (readgram): Complain if the last rule is not ended
1127 with a semi-colon.
1128
65ccf9fc
AD
11292002-03-04 Akim Demaille <akim@epita.fr>
1130
1131 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1132 * src/closure.c: here.
1133 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1134 RTC.
1135 * src/warshall.h, src/warshall.c: Remove.
1136 * tests/sets.at (Broken Closure): Adjust.
1137
d0039cbc
AD
11382002-03-04 Akim Demaille <akim@epita.fr>
1139
1140 * src/output.c (output_skeleton): tempdir is const.
1141 bytes_read is unused.
1142
345cea78
AD
11432002-03-04 Akim Demaille <akim@epita.fr>
1144
1145 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1146 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1147 Update.
1148 From Michael Hayes.
1149
564801f7
AD
11502002-03-04 Akim Demaille <akim@epita.fr>
1151
1152 * src/closure.c (closure): `r' is unused.
1153
e5352bc7
AD
11542002-03-04 Akim Demaille <akim@epita.fr>
1155
1156 * tests/sets.at (Broken Closure): Add the ending `;'.
1157 * src/reader.at (readgram): Complain if a rule is not ended with a
1158 semi-colon.
1159
914feea9
AD
11602002-03-04 Akim Demaille <akim@epita.fr>
1161
1162 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1163 (count_sr_conflicts): Use bitset_count.
1164 * src/reduce.c (inaccessable_symbols): Ditto.
1165 (bits_size): Remove.
1166 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1167
f0250de6
AD
11682002-03-04 Akim Demaille <akim@epita.fr>
1169
1170 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1171 * src/reduce.c: Remove the `bitset_zero's following the
1172 `bitset_create's, as now it is performed by the latter.
1173
ef017502
AD
11742002-03-04 Akim Demaille <akim@epita.fr>
1175
1176 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1177 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1178 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1179 latest sources from Michael.
1180
76514394
AD
11812002-03-04 Akim Demaille <akim@epita.fr>
1182
1183 * src/output.c (output): Don't free the grammar.
1184 * src/reader.c (grammar_free): New.
1185 * src/main.c (main): Call it and don't free symtab here.
1186
55024580
AD
11872002-03-04 Akim Demaille <akim@epita.fr>
1188
1189 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1190 before returning.
1191 Reported by Benoit Perrot.
1192
f9abaa2c
AD
11932002-03-04 Akim Demaille <akim@epita.fr>
1194
1195 Use bitset operations when possible, not loops over bits.
1196
1197 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1198 bitset_or.
1199 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1200 * src/reduce.c (useless_nonterminals): Formatting changes.
1201 * src/warshall.c (TC): Use bitset_or.
1202
0e721e75
AD
12032002-03-04 Akim Demaille <akim@epita.fr>
1204
1205 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1206 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1207 Ditto.
1208
0fb1ffb1
AD
12092002-03-04 Akim Demaille <akim@epita.fr>
1210
1211 * src/lalr.c (F): Now a bitset*.
1212 Adjust all dependencies.
1213
b86796bf
AD
12142002-03-04 Akim Demaille <akim@epita.fr>
1215
1216 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1217 Adjust all dependencies.
1218
602bbf31
AD
12192002-03-04 Akim Demaille <akim@epita.fr>
1220
1221 * src/L0.c, src/LR0.h (nstates): Be size_t.
1222 Adjust comparisons (signed vs unsigned).
1223 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1224 bitset*.
1225 Adjust all dependencies.
1226
d8a0245c
AD
12272002-03-04 Akim Demaille <akim@epita.fr>
1228
1229 * src/closure.c (firsts): Now, also a bitset.
1230 Adjust all dependencies.
1231 (varsetsize): Remove, now unused.
1232 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1233
34ba9743
AD
12342002-03-04 Akim Demaille <akim@epita.fr>
1235
1236 * src/print.c: Convert to use bitset.h, not hand coded iterations
1237 over ints.
1238
ed86e78c
AD
12392002-03-04 Akim Demaille <akim@epita.fr>
1240
1241 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1242
dfdb1797
AD
12432002-03-04 Akim Demaille <akim@epita.fr>
1244
1245 * src/closure.c (ruleset): Be a bitset.
1246 (rulesetsize): Remove.
1247
7086e707
AD
12482002-03-04 Akim Demaille <akim@epita.fr>
1249
1250 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1251 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1252 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1253 * src/closure.c (fderives): Be an array of bitsets.
1254
98254360
RA
12552002-02-28 Robert Anisko <robert@lrde.epita.fr>
1256
1257 * data/bison.c++: Merge the two generated headers. Insert a copyright
1258 notice in each output file.
1259
a75c057f
AD
12602002-02-28 Akim Demaille <akim@epita.fr>
1261
1262 * data/bison.c++: Copy the prologue of bison.simple to fetch
1263 useful M4 definitions, such as b4_header_guard.
1264
06b00abc
AD
12652002-02-25 Akim Demaille <akim@epita.fr>
1266
1267 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1268 translator friendly scheme for the bgr
1269 copyright notice.
06b00abc 1270
70e7d534
AD
12712002-02-25 Akim Demaille <akim@epita.fr>
1272
1273 * src/output.c (header_output): Remove, now handled completely via
1274 M4.
1275
abe017f6
AD
12762002-02-25 Akim Demaille <akim@epita.fr>
1277
1278 * m4/m4.m4: New, from CVS Autoconf.
1279 * configure.in: Invoke it.
1280 * src/output.c (output_skeleton): Use its result instead of the
1281 hard coded name.
1282
381fb12e
AD
12832002-02-25 Akim Demaille <akim@epita.fr>
1284
1285 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1286 Fileutils 4.1.5.
1287 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1288 * src/output.c (output_skeleton): Use mkstemp to create a real
1289 temporary file.
1290 Move the filling of `skeleton' and its muscle to...
1291 (prepare): here.
1292 (output): Move the definition of the prologue muscle to...
1293 (prepare): here.
1294 * src/system.h (DEFAULT_TMPDIR): New.
1295
6f38107f
PE
12962002-02-14 Paul Eggert <eggert@twinsun.com>
1297
1298 Remove the support for C++ namespace cleanliness; it was
1299 causing more problems than it was curing, since it didn't work
1300 properly on some nonstandard C++ compilers. This can wait
1301 for a proper C++ parser.
1302
1303 * NEWS: Document this.
1304 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1305 of C++, as it's treated like C now.
1306 * src/bison.simple (YYSTD): Remove.
1307 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1308 Treat C++ just like Standard C instead of trying to support
1309 namespace cleanliness.
1310
80cce3da
AD
13112002-02-14 Akim Demaille <akim@epita.fr>
1312
1313 * tests/regression.at (else): Adjust to Andreas' change.
1314
842e8679
AD
13152002-02-14 Akim Demaille <akim@epita.fr>
1316
1317 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1318
4bda3f10
AD
13192002-02-13 Andreas Schwab <schwab@suse.de>
1320
1321 * src/output.c (output_rule_data): Don't output NULL, it might
1322 not be defined yet.
1323
4162fa07 13242002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 1325
4162fa07
RA
1326 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1327 (Copyright notice): Update.
b418ecd8 1328
bd16a5dc
AD
13292002-02-11 Akim Demaille <akim@epita.fr>
1330
1331 * tests/regression.at (%nonassoc and eof): Don't include
1332 nonportable headers.
1333
8d69a1a3
RA
13342002-02-08 Robert Anisko <robert@lrde.epita.fr>
1335
1336 * data/bison.c++: Correct error recovery. Make the user able to
1337 initialize the starting location.
1338
9b2d0677
AD
13392002-02-07 Akim Demaille <akim@epita.fr>
1340
1341 * tests/input.at: New.
1342
69e2658b
RA
13432002-02-07 Robert Anisko <robert@lrde.epita.fr>
1344
1345 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 1346 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
1347 directives around tables only needed for debugging.
1348
4aacc3a7
RA
13492002-02-07 Robert Anisko <robert@lrde.epita.fr>
1350
1351 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1352 C++ parsers.
1353 (yy::b4_name::parse): Use print_.
1354
762a801e
RA
13552002-02-07 Robert Anisko <robert@lrde.epita.fr>
1356
1357 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1358
4bb2bc3f
RA
13592002-02-07 Robert Anisko <robert@lrde.epita.fr>
1360
1361 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1362 C++ parsers.
1363 (yy::b4_name::parse): Build verbose error messages, and use error_.
1364
6b45a3ca
RA
13652002-02-06 Robert Anisko <robert@lrde.epita.fr>
1366
1367 * data/bison.c++: Fix m4 quoting in comments.
1368
50997c6e
RA
13692002-02-06 Robert Anisko <robert@lrde.epita.fr>
1370
1371 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1372 not expanded by m4.
1373
3f3eed27
AD
13742002-02-05 Akim Demaille <akim@epita.fr>
1375
1376 * data/bison.c++: Adjust to the M4 back end.
1377 More is certainly needed.
1378
be2a1a68
AD
13792002-02-05 Akim Demaille <akim@epita.fr>
1380
1381 Give a try to M4 as a back end.
1382
1383 * lib/readpipe.c: New, from wdiff.
1384 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1385 BISON_HAIRY.
1386 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1387 specific values. Now it is m4 that performs the lookup.
1388 * src/parse-skel.y: Remove.
1389 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1390 * src/output.c (actions_output, guards_output)
1391 (token_definitions_output): No longer keeps track of the output
1392 line number, hence remove the second argument.
1393 (guards_output): Check against the guard member of a rule, not the
1394 action member.
1395 Adjust callers.
1396 (output_skeleton): Don't look for the skeleton location, let m4 do
1397 that.
1398 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1399 file will be used.
1400 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1401 (prepare): Given that for the time being changesyntax is not
1402 usable in M4, rename the muscles using `-' to `_'.
1403 Define `defines_flag', `output_parser_name' and `output_header_name'.
1404 * src/output.h (actions_output, guards_output)
1405 (token_definitions_output): Adjust prototypes.
1406 * src/scan-skel.l: Instead of scanning the skeletons, it now
1407 processes the output of m4: `__oline__' and `#output'.
1408 * data/bison.simple: Adjust to be used by M4(sugar).
1409 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1410 to date.
1411 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1412 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1413 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1414 shamelessly stolen from CVS Autoconf.
1415
beda758b
AD
14162002-02-05 Akim Demaille <akim@epita.fr>
1417
1418 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1419 * configure.in: Check for the declarations of free and malloc.
1420 * src/muscle_tab.c: Adjust.
1421
5ece6d43
AD
14222002-02-05 Akim Demaille <akim@epita.fr>
1423
1424 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1425 which have no values.
1426
5bb18f9a
AD
14272002-02-05 Akim Demaille <akim@epita.fr>
1428
1429 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1430 * data/: here.
1431
894dd62e
PE
14322002-01-29 Paul Eggert <eggert@twinsun.com>
1433
1434 * src/bison.simple (YYSIZE_T): Do not define merely because
1435 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1436 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1437
82841af7
AD
14382002-01-27 Akim Demaille <akim@epita.fr>
1439
1440 Fix `%nonassoc and eof'.
1441
1442 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1443 which were not properly copied! Replace
1444 memcpy (res->errs, src->errs, src->nerrs);
1445 with
1446 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1447 !!!
1448 * tests/regression.at (%nonassoc and eof): Adjust to newest
1449 Autotest: `.' is not in the PATH.
1450
318b76e9
AD
14512002-01-27 Akim Demaille <akim@epita.fr>
1452
1453 * tests/sets.at (AT_EXTRACT_SETS): New.
1454 (Nullable): Use it.
1455 (Firsts): New.
1456
30d2f3d5
AD
14572002-01-26 Akim Demaille <akim@epita.fr>
1458
1459 * tests/actions.at, tests/calc.at, tests/headers.at,
1460 * tests/torture.at: Adjust to the newest Autotest which no longer
1461 forces `.' in the PATH.
1462
30f8c395
AD
14632002-01-25 Akim Demaille <akim@epita.fr>
1464
1465 * tests/regression.at (%nonassoc and eof): New.
1466 Suggested by Robert Anisko.
1467
29ae55f1
AD
14682002-01-24 Akim Demaille <akim@epita.fr>
1469
1470 Bison dumps core when trying to complain about broken input files.
1471 Reported by Cris van Pelt.
1472
1473 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
1474 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
1475 into...
1476 (Invalid inputs): Strengthen: exercise parse_percent_token.
1477
2b548aa6
RA
14782002-01-24 Robert Anisko <robert.anisko@epita.fr>
1479
1480 * src/Makefile.am: Add bison.c++.
1481 * src/bison.c++: New skeleton.
1482
bb0146c2
AD
14832002-01-21 Paolo Bonzini <bonzini@gnu.org>
1484
1485 * po/it.po: New.
1486
bec30531
AD
14872002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
1488
1489 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
1490
fc6edc45
MA
14912002-01-20 Marc Autret <marc@gnu.org>
1492
1493 * src/files.c (compute_output_file_names): Fix
1494
5e5d5415
MA
14952002-01-20 Marc Autret <marc@gnu.org>
1496
1497 * tests/output.at: New test.
1498 * src/files.c (compute_base_names): Don't map extensions when
1499 the YACC flag is set, use defaults.
1500 Reported by Evgeny Stambulchik.
1501
44ea3fbd
MA
15022002-01-20 Marc Autret <marc@gnu.org>
1503
bb0146c2 1504 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
1505 compilers as well (i.e. the vendor C compiler).
1506 Suggested by Albert Chin-A-Young.
1507
338963d1
TVH
15082002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1509
1510 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1511 canonical definition.
1512 * src/system.h: Use the canonical definition for PARAMS (avoids
1513 a conflict with the macro from lib/hash.h).
1514
c57b2479
AD
15152002-01-11 Akim Demaille <akim@epita.fr>
1516
1517 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 1518 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 1519
b85810ae
AD
15202002-01-09 Akim Demaille <akim@epita.fr>
1521
1522 * src/files.c, src/files.h (output_infix): New.
1523 (tab_extension): Remove.
1524 (compute_base_names): Compute the former, drop the latter.
1525 * src/output.c (prepare): Insert the muscles `output-infix', and
1526 `output-suffix'.
1527 * src/parse-skel.y (string, string.1): New.
1528 (section.header): Use it.
1529 (section.yacc): Remove.
1530 (prefix): Remove too.
1531 * src/scan-skel.l: Adjust.
1532 * src/bison.simple, src/bison.hairy: Adjust.
1533
cae60122
AD
15342002-01-09 Akim Demaille <akim@epita.fr>
1535
1536 * configure.in (WERROR_CFLAGS): Compute it.
1537 * src/Makefile.am (CFLAGS): Pass it.
1538 * tests/atlocal.in (CFLAGS): Idem.
1539 * src/files.c: Fix a few warnings.
1540 (get_extension_index): Remove, unused.
1541
ae404801
AD
15422002-01-08 Akim Demaille <akim@epita.fr>
1543
1544 * src/getargs.c (AS_FILE_NAME): New.
1545 (getargs): Use it to convert DOSish file names.
1546 * src/files.c (base_name): Rename as full_base_name to avoid
1547 clashes with `base_name ()'.
1548 (filename_split): New.
1549 (compute_base_names): N-th rewrite, using filename_split.
1550
22312b71
AD
15512002-01-08 Akim Demaille <akim@epita.fr>
1552
1553 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1554 New, stolen from the Fileutils 4.1.
1555 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1556 * configure.in: Check for the presence of memrchr, and of its
1557 prototype.
1558
a67cef01
TVH
15592002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1560
1561 * lib/hash.h (__P): Added definition for this macro.
1562 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1563 BUILT_SOURCES, to ensure they are generated first.
1564 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1565 %error-verbose to allow bootstrapping with bison 1.30x.
1566
2b25d624
AD
15672002-01-06 Akim Demaille <akim@epita.fr>
1568
1569 * src/reader.c (parse_braces): Don't fetch the next char, the
1570 convention is to fetch on entry.
1571 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1572 'switch' without a following semicolon.
1573 * tests/regression.at (braces parsing): New.
1574
3460813b
AD
15752002-01-06 Akim Demaille <akim@epita.fr>
1576
1577 Bison is dead wrong in its RR conflict reports.
1578
1579 * tests/torture.at (GNU Cim Grammar): New.
1580 * src/conflicts.c (count_rr_conflicts): Fix.
1581
73784c64
AD
15822002-01-06 Akim Demaille <akim@epita.fr>
1583
1584 Creating package.m4 from configure.ac causes too many problems.
1585
1586 * tests/Makefile.am (package.m4): Create it by hand,
1587 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1588
25d81090
AD
15892002-01-06 Akim Demaille <akim@epita.fr>
1590
1591 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1592 skeleton.h.
1593
a9b8959e
PE
15942002-01-04 Paul Eggert <eggert@twinsun.com>
1595
1596 * doc/bison.texinfo (Debugging):
1597 Remove YYSTDERR; it's no longer defined or used.
1598 Also, s/cstdio.h/cstdio/.
1599
25d81090
AD
16002002-01-03 Akim Demaille <akim@epita.fr>
1601
1602 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1603
1109455c
AD
16042002-01-03 Akim Demaille <akim@epita.fr>
1605
1606 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1607 tracing code to --trace, wait for a better --trace option, with
1608 args.
1609
7ea5e977
AD
16102002-01-03 Akim Demaille <akim@epita.fr>
1611
1612 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1613 The ISO C++ standard is extremely clear about it: stderr is
1614 considered a macro, not a regular symbol (see table 94 `Header
1615 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1616 Therefore std:: does not apply to it. It still does with fprintf.
1617 Also, s/cstdio.h/cstdio/.
1618
fab5b110
AD
16192002-01-03 Akim Demaille <akim@epita.fr>
1620
1621 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1622 for non system headers.
1623
aed7fd9b
AD
16242002-01-02 Akim Demaille <akim@epita.fr>
1625
1626 Equip the skeleton chain with location tracking, runtime trace,
1627 pure parser and scanner.
1628
1629 * src/parse-skel.y: Request a pure parser, locations, and prefix
1630 renaming.
1631 (%union): Having several members with the same type does not help
1632 type mismatches, simplify.
1633 (YYPRINT, yyprint): New.
1634 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1635 (skel_error): this.
1636 Handle locations.
1637 * src/scan-skel.l: Adjust to these changes.
1638 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1639 (LOCATION_PRINT, skel_control_t): New.
1640
24fad99e
AD
16412001-12-30 Akim Demaille <akim@epita.fr>
1642
1643 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1644 replace `gb' with BLANKS.
1645 * src/scan-skel.l: Adjust.
1646
a4b36db4
AD
16472001-12-30 Akim Demaille <akim@epita.fr>
1648
1649 * src/system.h: We don't need nor want bcopy.
1650 Throw away MS-DOS crap: we don't need getpid.
1651 * configure.in: We don't need strndup. It was even causing
1652 problems: because Flex includes the headers *before* us,
1653 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1654 not visible.
1655 * lib/xstrndup.c: New.
1656 * src/scan-skel.l: Use it.
1657 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1658 * src/parse-skel.y: Use %directives instead of #defines.
1659
1239777d
AD
16602001-12-30 Akim Demaille <akim@epita.fr>
1661
1662 * src/skeleton.h: New.
1663 * src/output.c (output_parser, output_master_parser): Remove, dead
1664 code.
1665 * src/output.h (get_lines_number, actions_output, guards_output)
1666 (token_definitions_output): Prototype them.
1667 * src/parse-skel.y: Add the license notice.
1668 Include output.h and skeleton.h.
1669 (process_skeleton): Returns void, and takes a single parameter.
1670 * src/scan-skel.l: Add the license notice.
1671 Include skeleton.h.
1672 Don't use %option yylineno: it seems that then Flex imagines
1673 REJECT has been used, and therefore it won't reallocate its
1674 buffers (which makes no other sense to me than a bug). It results
1675 in warnings for `unused: yy_flex_realloc'.
1676
9b3add5b
RA
16772001-12-30 Robert Anisko <robert.anisko@epita.fr>
1678
1679 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1680 (MUSCLE_INSERT_PREFIX): ...to there.
1681 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1682 (MUSCLE_INSERT_PREFIX): Move from here...
1683
1684 * src/bison.hairy: Add a section directive. Put braces around muscle
1685 names. This parser skeleton is still broken, but Bison should not
1686 choke on a bad muscle 'syntax'.
1687 * src/bison.simple: Add a section directive. Put braces around muscle
1688 names.
1689
1690 * src/files.h (strsuffix, stringappend): Add declarations.
1691 (tab_extension): Add declaration.
1692 (short_base_name): Add declaration.
1693
1694 * src/files.c (strsuffix, stringappend): No longer static. These
1695 functions are used in the skeleton parser.
1696 (tab_extension): New.
1697 (compute_base_names): Use the computations done in this function
fab5b110 1698 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1699 names.
1700 (short_base_name): No longer static.
1701
1702 * src/output.c (output_skeleton): New.
1703 (output): Disable call to output_master_parser, and give a try to
1704 a new skeleton handling system.
1705 (guards_output, actions_output): No longer static.
1706 (token_definitions_output, get_lines_number): No longer static.
1707
1708 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1709
fab5b110 1710 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1711 parse-skel.y.
1712
1713 * src/parse-skel.y: New file.
1714 * src/scan-skel.l: New file.
1715
b5b61c61
AD
17162001-12-29 Akim Demaille <akim@epita.fr>
1717
1718 %name-prefix is broken.
1719
1720 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1721 Adjust all dependencies.
1722 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1723 %name-prefix.
1724
1725 Renaming yylval but not yylloc is not consistent. Now we do.
1726
1727 * src/bison.simple: Prefix yylloc if used.
1728 * doc/bison.texinfo (Decl Summary): Document that.
1729
8c9a50be
AD
17302001-12-29 Akim Demaille <akim@epita.fr>
1731
1732 * doc/bison.texinfo: Promote `%long-directive' over
1733 `%long_directive'.
1734 Remove all references to fixed-output-files, yacc is enough.
1735
d99361e6
AD
17362001-12-29 Akim Demaille <akim@epita.fr>
1737
1738 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1739 user prologue. These are defaults.
1740 * tests/actions.at (Mid-rule actions): Make sure the user can
1741 define YYDEBUG and YYERROR_VERBOSE.
1742
b9cecb91
AD
17432001-12-29 Akim Demaille <akim@epita.fr>
1744
1745 * src/output.c (header_output): Don't forget to export YYLTYPE and
1746 yylloc.
1747 * tests/headers.at (export YYLTYPE): New, make sure it does.
1748 * tests/regression.at (%union and --defines, Invalid CPP headers):
1749 Move to...
1750 * tests/headers.at: here.
1751
aea13e97
AD
17522001-12-29 Akim Demaille <akim@epita.fr>
1753
1754 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1755
931394cb
AD
17562001-12-29 Akim Demaille <akim@epita.fr>
1757
1758 * tests/actions.at (Mid-rule actions): Output on a single line
1759 instead of several.
1760
704a47c4
AD
17612001-12-29 Akim Demaille <akim@epita.fr>
1762
1763 * doc/bison.texinfo: Formatting changes.
1764
091e20bb
AD
17652001-12-29 Akim Demaille <akim@epita.fr>
1766
1767 Don't store the token defs in a muscle, just be ready to output it
1768 on command. Now possible via `symbols'. Fixes a memory leak.
1769
1770 * src/output.c (token_definitions_output): New.
1771 (output_parser, header_output): Use it.
1772 * src/reader.c (symbols_save): Remove.
1773
cce71710
AD
17742001-12-29 Akim Demaille <akim@epita.fr>
1775
1776 * src/bison.simple: Do not provide a default for YYSTYPE and
1777 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1778 default.
1779
82c035a8
AD
17802001-12-29 Akim Demaille <akim@epita.fr>
1781
1782 Mid-rule actions are simply... ignored!
1783
1784 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1785 the empty-rule associated to the dummy symbol, not to the host
1786 rule.
1787 * tests/actions.at (Mid-rule actions): New.
1788
8419d367
AD
17892001-12-29 Akim Demaille <akim@epita.fr>
1790
1791 Memory leak.
1792
1793 * src/reader.c (reader): Free grammar.
1794
375d5806
AD
17952001-12-29 Akim Demaille <akim@epita.fr>
1796
1797 Memory leak.
1798
1799 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1800 since it allocates it for each state, although only one is needed.
1801 (allocate_storage): Do it here.
1802
f51cb8ff
AD
18032001-12-29 Akim Demaille <akim@epita.fr>
1804
1805 * src/options.h, src/options.c (create_long_option_table): Rename
1806 as...
1807 (long_option_table_new): this, with a clearer prototype.
1808 (percent_table): Remove, unused,
1809 * src/getargs.c (getargs): Adjust.
1810
29e88316
AD
18112001-12-29 Akim Demaille <akim@epita.fr>
1812
1813 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
1814 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
1815 as states.
1816
b9f71f19
AD
18172001-12-29 Akim Demaille <akim@epita.fr>
1818
1819 * src/lalr.c (build_relations): Rename `states' as `states1'.
1820 Sorry, I don't understand exactly what it is, no better name...
1821
1a2b5d37
AD
18222001-12-29 Akim Demaille <akim@epita.fr>
1823
1824 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
1825 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
1826 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
1827 as rules.
1828
1cca533e
AD
18292001-12-29 Akim Demaille <akim@epita.fr>
1830
1831 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
1832 ago.
1833
c03ae966
AD
18342001-12-29 Akim Demaille <akim@epita.fr>
1835
1836 * src/reader.c, src/reader.h (user_toknums): Remove.
1837 Adjust all users to use symbols[i]->user_token_number.
1838
5a670b1e
AD
18392001-12-29 Akim Demaille <akim@epita.fr>
1840
1841 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
1842 Adjust all users to use symbols[i]->prec or ->assoc.
1843
ad949da9
AD
18442001-12-29 Akim Demaille <akim@epita.fr>
1845
1846 * src/reader.c, src/reader.h (tags): Remove.
1847 Adjust all users to use symbols[i]->tag.
1848
0e78e603
AD
18492001-12-29 Akim Demaille <akim@epita.fr>
1850
1851 * src/gram.h, src/gram.c (symbols): New, similar to state_table
1852 and rule_table.
1853 * src/reader.c (packsymbols): Fill this table.
1854 Drop sprec.
1855 * src/conflicts.c (resolve_sr_conflict): Adjust.
1856 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
1857 single table.
1858 Use symbols[i]->tag instead of tags[i].
1859
213e640e
AD
18602001-12-29 Akim Demaille <akim@epita.fr>
1861
1862 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
1863 In addition, put a comment in there, to replace...
1864 * tests/regression.at (%union and C comments): Remove.
1865
e7b8bef1
AD
18662001-12-29 Akim Demaille <akim@epita.fr>
1867
1868 * tests/regression.at (Web2c Actions): Blindly move the actual
1869 output as expected output. The contents *seem* right to me, but I
1870 can't pretend reading perfectly parser tables... Nonetheless, all
1871 the other tests pass correctly, the table look OK, even though the
1872 presence of `$axiom' is to be noted: AFAICS it is useless (but
1873 harmless).
1874
b68e7744
AD
18752001-12-29 Akim Demaille <akim@epita.fr>
1876
1877 * src/reader.c (readgram): Don't add the rule 0 if there were no
1878 rules read. In other words, add it _after_ having performed
1879 grammar sanity checks.
1880 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
1881
78d5bae9
AD
18822001-12-29 Akim Demaille <akim@epita.fr>
1883
1884 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
1885 visible, and some states have now a different number.
1886
ff442794
AD
18872001-12-29 Akim Demaille <akim@epita.fr>
1888
1889 * src/reader.c (readgram): Bind the initial rule's lineno to that
1890 of the first rule.
1891 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
1892 (Solved SR Conflicts): Adjust rule 0's line number.
1893
610ab194
AD
18942001-12-29 Akim Demaille <akim@epita.fr>
1895
1896 Fix the `GAWK Grammar' failure.
1897
1898 * src/LR0.c (final_state): Initialize to -1 so that we do compute
1899 the reductions of the first state which was mistakenly confused
1900 with the final state because precisely final_state was initialized
1901 to 0.
1902 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
1903 now noticed by Bison.
1904 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
1905 have a reduction on $default.
1906
29d29c8f
AD
19072001-12-29 Akim Demaille <akim@epita.fr>
1908
1909 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
1910 rule line numbers.
1911 * src/closure.c (print_closure): Likewise.
1912 * src/derives.c (print_derives): Likewise.
1913 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
1914 now.
1915
7c6b64d0
AD
19162001-12-29 Akim Demaille <akim@epita.fr>
1917
1918 * src/lalr.c (lookaheads_print): New.
1919 (lalr): Call it when --trace-flag.
1920 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
1921 are dumped.
1922
3d4daee3
AD
19232001-12-29 Akim Demaille <akim@epita.fr>
1924
1925 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
1926 when walking through ritem, even via rule->rhs.
1927 * src/reduce.c (dump_grammar, useful_production, reduce_output)
1928 (useful_production, useless_nonterminals): Likewise.
1929 (reduce_grammar_tables): Likewise, plus update nritems.
1930 * src/nullable.c (set_nullable): Likewise.
1931 * src/lalr.c (build_relations): Likewise.
1932 * tests/sets.at (Nullable): Adjust.
1933 Fortunately, now, the $axiom is no longer nullable.
1934
9e7f6bbd
AD
19352001-12-29 Akim Demaille <akim@epita.fr>
1936
1937 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
1938 the 0-sentinel.
1939 * src/gram.c (ritem_longest_rhs): Likewise.
1940 * src/reduce.c (nonterminals_reduce): Likewise.
1941 * src/print_graph.c (print_graph): Likewise.
1942 * src/output.c (output_rule_data): Likewise.
1943 * src/nullable.c (set_nullable): Likewise.
1944
255ef638
AD
19452001-12-29 Akim Demaille <akim@epita.fr>
1946
1947 * src/output.c: Comment changes.
1948
0d8a7363
AD
19492001-12-27 Paul Eggert <eggert@twinsun.com>
1950
1951 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
1952 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
1953 Sparc, as they were causing more porting problems than the
1954 (minor) performance improvement was worth.
1955
1956 Also, catch up with 1.31's YYSTD.
1957
3db472b9
AD
19582001-12-27 Akim Demaille <akim@epita.fr>
1959
1960 * src/output.c (output_gram): Rely on nritems, not the
1961 0-sentinel. See below.
1962 Use -1 as separator, not 0.
1963 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
1964 Rely on -1 as separator in yyrhs, instead of 0.
1965 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
1966 twice `Now at end of input', therefore there are two lines less to
1967 expect.
1968
b365aa05
AD
19692001-12-27 Akim Demaille <akim@epita.fr>
1970
1971 * tests/regression.at (Unresolved SR Conflicts):
1972 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
1973 below.
1974
30171f79
AD
19752001-12-27 Akim Demaille <akim@epita.fr>
1976
1977 * src/LR0.c (new_state): Recognize the final state by the fact it
1978 is reached by eoftoken.
1979 (insert_start_shifting_state, insert_eof_shifting_state)
1980 (insert_accepting_state, augment_automaton): Remove, since now
1981 these states are automatically computed from the initial state.
1982 (generate_states): Adjust.
1983 * src/print.c: When reporting a rule number to the user, substract
1984 1, so that the axiom rule is rule 0, and the first user rule is 1.
1985 * src/reduce.c: Likewise.
1986 * src/print_graph.c (print_core): For the time being, just as for
1987 the report, depend upon --trace-flags to dump the full set of
1988 items.
1989 * src/reader.c (readgram): Once the grammar read, insert the rule
1990 0: `$axiom: START-SYMBOL $'.
1991 * tests/set.at: Adjust: rule 0 is now displayed, and since the
1992 number of the states has changed (the final state is no longer
1993 necessarily the last), catch up.
1994
75142d45
AD
19952001-12-27 Akim Demaille <akim@epita.fr>
1996
1997 Try to make the use of the eoftoken valid. Given that its value
1998 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
1999 is used instead of > 0 where appropriate, (ii), depend upon nritems
2000 instead of the 0-sentinel.
2001
2002 * src/gram.h, src/gram.c (nritems): New.
2003 Expected to be duplication of nitems, but for the time being...
2004 * src/reader.c (packgram): Assert nritems and nitems are equal.
2005 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2006 * src/closure.c (print_closure, print_fderives): Likewise.
2007 * src/gram.c (ritem_print): Likewise.
2008 * src/print.c (print_core, print_grammar): Likewise.
2009 * src/print_graph.c: Likewise.
2010
b7c49edf
AD
20112001-12-27 Akim Demaille <akim@epita.fr>
2012
2013 * src/main.c (main): If there are complains after grammar
2014 reductions, then output the report anyway if requested, then die.
2015 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2016 * src/reader.c (eoftoken): New.
2017 (parse_token_decl): If the token being defined has value `0', it
2018 is the eoftoken.
2019 (packsymbols): No longer hack `tags' to insert `$' by hand.
2020 Be sure to preserve the value of the eoftoken.
2021 (reader): Make sure eoftoken is defined.
2022 Initialize nsyms to 0: now eoftoken is created just like the others.
2023 * src/print.c (print_grammar): Don't special case the eof token.
2024 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2025 lie anyway, albeit pleasant.
2026 * tests/calc.at: Exercise error messages with eoftoken.
2027 Change the grammar so that empty input is invalid.
2028 Adjust expectations.
2029 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2030
ec2da99f
AD
20312001-12-27 Akim Demaille <akim@epita.fr>
2032
2033 * configure.in: Check the protos of strchr ans strspn.
2034 Replace strchr if needed.
2035 * src/system.h: Provide the protos of strchr, strspn and memchr if
2036 missing.
2037 * lib/strchr.c: New.
2038 * src/reader.c (symbols_save): Use strchr.
2039
8adfa272
AD
20402001-12-27 Akim Demaille <akim@epita.fr>
2041
2042 * src/print.c, src/print_graph.c (escape): New.
2043 Use it to quote the TAGS outputs.
2044 * src/print_graph.c (print_state): Now errors are in red, and
2045 reductions in green.
2046 Prefer high to wide: output the state number on a line of its own.
2047
80dac38c
AD
20482001-12-27 Akim Demaille <akim@epita.fr>
2049
2050 * src/state.h, src/state.c (reductions_new): New.
2051 * src/LR0.c (set_state_table): Let all the states have a
2052 `reductions', even if reduced to 0.
2053 (save_reductions): Adjust.
2054 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2055 * src/print.c (print_reductions, print_actions): Adjust.
2056 * src/output.c (action_row): Adjust.
2057
2cec70b9
AD
20582001-12-27 Akim Demaille <akim@epita.fr>
2059
2060 * src/state.h, src/state.c (errs_new, errs_dup): New.
2061 * src/LR0.c (set_state_table): Let all the states have an errs,
2062 even if reduced to 0.
2063 * src/print.c (print_errs, print_reductions): Adjust.
2064 * src/output.c (output_actions, action_row): Adjust.
2065 * src/conflicts.c (resolve_sr_conflict): Adjust.
2066
13ca549a
AD
20672001-12-27 Akim Demaille <akim@epita.fr>
2068
2069 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2070
5092aba5
AD
20712001-12-27 Akim Demaille <akim@epita.fr>
2072
2073 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2074 * src/print.c: here.
2075 (lookaheadset, shiftset): New, used as additional storage by
2076 print_reductions.
2077 (print_results): Adjust.
2078 (print_shifts, print_gotos, print_errs): New, extracted from...
2079 (print_actions): here.
2080 * src/print_graph.c (print_actions): Remove dead code.
2081
11e2beca
AD
20822001-12-27 Akim Demaille <akim@epita.fr>
2083
2084 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2085 `$n' and `@n'.
2086
dac3c910
AD
20872001-12-27 Akim Demaille <akim@epita.fr>
2088
2089 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2090 (build_relations): Adjust.
2091
d0b0fefa
AD
20922001-12-27 Akim Demaille <akim@epita.fr>
2093
2094 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2095 duplication.
2096
adc8c848
AD
20972001-12-27 Akim Demaille <akim@epita.fr>
2098
2099 * src/reader.c (packgram): Catch nitems overflows.
2100
14d293ac
AD
21012001-12-27 Akim Demaille <akim@epita.fr>
2102
2103 * src/files.c, src/files.h (guard_obstack): Remove.
2104 * src/output.c (output): Adjust.
2105 * src/reader.c (parse_braces): New, factoring...
2106 (copy_action, copy_guard): these two which are renamed as...
2107 (parse_action, parse_guard): these.
2108 As a voluntary consequence, using braces around guards is now
2109 mandatory.
2110
f499b062
AD
21112001-12-27 Akim Demaille <akim@epita.fr>
2112
2113 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2114 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2115 members.
2116 (symbol_list_new): Adjust.
2117 (copy_action): action_line is the first line, not the last.
2118 (copy_guard): Just as for actions, store the `action' only, not
2119 the switch/case/break flesh.
2120 Don't parse the user action that might follow the guard, let...
2121 (readgram): do it, i.e., now, there can be an action after a
2122 guard.
2123 In other words the guard is just explicitly optional.
2124 (packgram): Adjust.
2125 * src/output.c (guards_output): New.
2126 (output_parser): Call it when needed.
2127 (output): Also free the guard and attrs obstacks.
2128 * src/files.c, src/files.h (obstack_save): Remove.
2129 (output_files): Remove.
2130 As a result, if one needs the former `.act' file, using an
2131 appropriate skeleton which requires actions and guards is now
2132 required.
2133 * src/main.c (main): Adjust.
2134 * tests/semantic.at: New.
2135 * tests/regression.at: Use `input.y' as input file name.
2136 Avoid 8+3 problems by requiring input.c when the test needs the
2137 parser.
2138
d945f5cd
AD
21392001-12-27 Akim Demaille <akim@epita.fr>
2140
2141 * src/reader.c (symbol_list_new): Be sure to initialize all the
2142 fields.
2143
d200e455
AD
21442001-12-27 Akim Demaille <akim@epita.fr>
2145
2146 All the hacks using a final pseudo state are now useless.
2147
2148 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2149 * src/lalr.c (nLA): New.
2150 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2151 instead of lookaheadsp from the pseudo state (nstate + 1).
2152
f9507c28
AD
21532001-12-27 Akim Demaille <akim@epita.fr>
2154
2155 * src/output.c (action_row, token_actions): Use a state_t instead
2156 of a integer, and nlookaheads instead of the following state's
2157 lookaheadsp.
2158
065fbd27
AD
21592001-12-27 Akim Demaille <akim@epita.fr>
2160
2161 * src/conflicts.c (log_resolution, flush_shift)
2162 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2163 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2164 (conflicts_print, print_reductions): Use a state_t instead of an
2165 integer when referring to a state.
2166 As much as possible, depend upon nlookaheads, instead of the
2167 `lookaheadsp' member of the following state (since lookaheads of
2168 successive states are successive, the difference between state n + 1
2169 and n served as the number of lookaheads for state n).
2170 * src/lalr.c (add_lookback_edge): Likewise.
2171 * src/print.c (print_core, print_actions, print_state)
2172 (print_results): Likewise.
2173 * src/print_graph.c (print_core, print_actions, print_state)
2174 (print_graph): Likewise.
2175 * src/conflicts.h: Adjust.
2176
1b177bd7
AD
21772001-12-27 Akim Demaille <akim@epita.fr>
2178
2179 * src/bison.hairy: Formatting/comment changes.
2180 ANSIfy.
2181 Remove `register' indications.
2182 Add plenty of `static'.
2183
7742ddeb
AD
21842001-12-27 Akim Demaille <akim@epita.fr>
2185
2186 * src/output.c (prepare): Drop the muscle `ntbase' which
2187 duplicates ntokens.
2188 * src/bison.simple: Formatting/comment changes.
2189 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2190 is an undocumented synonym.
2191
1fa14068
AD
21922001-12-22 Akim Demaille <akim@epita.fr>
2193
2194 * src/output.c (output_table_data): Change the prototype to use
2195 `int' for array ranges: some invocations do pass an int, not a
2196 short.
2197 Reported by Wayne Green.
2198
b9752825
AD
21992001-12-22 Akim Demaille <akim@epita.fr>
2200
2201 Some actions of web2c.y are improperly triggered.
2202 Reported by Mike Castle.
2203
2204 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2205 * tests/regression.at (Web2c): Rename as...
2206 (Web2c Report): this.
2207 (Web2c Actions): New.
2208
776209d6
AD
22092001-12-22 Akim Demaille <akim@epita.fr>
2210
2211 Reductions in web2c.y are improperly reported.
2212 Reported by Mike Castle.
2213
2214 * src/conflicts.c (print_reductions): Fix.
2215 * tests/regression.at (Web2c): New.
2216
275fc3ad
AD
22172001-12-18 Akim Demaille <akim@epita.fr>
2218
2219 Some host fail on `assert (!"foo")', which expands to
2220 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2221 Reported by Nelson Beebee.
2222
2223 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2224 `#define it_succeeded 0' and `assert (it_succeeded)'.
2225
897668ee
MA
22262001-12-17 Marc Autret <autret_m@epita.fr>
2227
2228 * src/bison.simple: Don't hard code the skeleton line and filename.
2229 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2230 New line counter 'skeleton_line' (skeleton-line muscle).
2231
ab3399e0
PE
22322001-12-17 Paul Eggert <eggert@twinsun.com>
2233
2234 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2235 YYDEBUG must be defined to a nonzero value.
2236
2237 * src/bison.simple (yytname): Do not assume that the user defines
2238 YYDEBUG to a properly parenthesized expression.
2239
3877f72b
AD
22402001-12-17 Akim Demaille <akim@epita.fr>
2241
2242 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2243 nlookaheads is a new member.
2244 Adjust all users.
2245 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2246 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2247 state.
776209d6 2248
331dbc1b
AD
22492001-12-17 Akim Demaille <akim@epita.fr>
2250
2251 * src/files.h, src/files.c (open_files, close_files): Remove.
2252 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2253 let...
2254 * src/reader.c (reader): Do it.
776209d6 2255
be750e4c
AD
22562001-12-17 Akim Demaille <akim@epita.fr>
2257
2258 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2259
709ae8c6
AD
22602001-12-17 Akim Demaille <akim@epita.fr>
2261
2262 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2263 (flush_reduce): New.
2264 (resolve_sr_conflict): Adjust.
776209d6 2265
f87685c3
AD
22662001-12-17 Akim Demaille <akim@epita.fr>
2267
2268 * src/output.c (output_obstack): Be static and rename as...
2269 (format_obstack): this, to avoid any confusion with files.c's
2270 output_obstack.
2271 * src/reader.h (muscle_obstack): Move to...
2272 * src/output.h: here, since it's defined in output.c.
2273
837491d8
AD
22742001-12-17 Akim Demaille <akim@epita.fr>
2275
2276 * src/output.c (action_row, save_column, default_goto)
2277 (sort_actions, matching_state, pack_vector): Better variable
2278 locality.
2279
796d61fb
AD
22802001-12-17 Akim Demaille <akim@epita.fr>
2281
2282 * src/output.c: Various formatting changes.
776209d6 2283
64d15509
AD
22842001-12-17 Akim Demaille <akim@epita.fr>
2285
2286 * src/files.c (output_files): Free the output_obstack.
2287 * src/main.c (main): Call print and print_graph conditionally.
2288 * src/print.c (print): Work unconditionally.
2289 * src/print_graph.c (print_graph): Work unconditionally.
2290 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2291
fbc8ecb7
MA
22922001-12-16 Marc Autret <autret_m@epita.fr>
2293
2294 * src/output.c (actions_output): Fix. When we use %no-lines,
2295 there is one less line per action.
2296
f0440388
MA
22972001-12-16 Marc Autret <autret_m@epita.fr>
2298
2299 * src/bison.simple: Remove a useless #line directive.
2300 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2301 * src/output.c (get_lines_number): New.
776209d6 2302 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2303 output muscles.
2304 Fix line numbering.
2305 (actions_output): Computes the number of lines taken by actions.
2306 (output_master_parser): Insert new skeleton which is the name of
2307 the output parser file name.
2308
a79986b8
MA
23092001-12-15 Marc Autret <autret_m@epita.fr>
2310
2311 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2312
4ec8e00f
MA
23132001-12-15 Marc Autret <autret_m@epita.fr>
2314
2315 * src/output.c (output_gram): Keep track of the hairy one.
2316
1a4648ff
AD
23172001-12-15 Akim Demaille <akim@epita.fr>
2318
2319 Make `make distcheck' work.
2320
2321 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2322 system.h which uses libgettext.h.
2323
9c2c67e6
AD
23242001-12-15 Akim Demaille <akim@epita.fr>
2325
2326 * src/nullable.c (set_nullable): Useless rules must be skipped,
2327 otherwise, since we range over their symbols, we might look at a
2328 nonterminal which no longer ``exists'', i.e., it is not counted in
2329 `nvars', hence we overflow our arrays.
2330
93ede233
AD
23312001-12-15 Akim Demaille <akim@epita.fr>
2332
2333 The header can also be produced directly, without any obstack!
2334 Yahoo!
2335
2336 * src/files.c, src/files.h (defines_obstack): Remove.
2337 (compute_header_macro): Global.
2338 (defines_obstack_save): Remove.
2339 * src/reader.c (parse_union_decl): No longer output to
2340 defines_obstack: its content can be found in the `stype' muscle
2341 anyway.
2342 (output_token_translations): Merge into...
2343 (symbols_output): this.
2344 Rename as...
2345 (symbols_save): this.
2346 (reader): Adjust.
2347 * src/output.c (header_output): New.
2348 (output): Call it.
2349
2666f928
AD
23502001-12-15 Akim Demaille <akim@epita.fr>
2351
2352 * src/reader.c (parse_union_decl): Instead of handling two obstack
2353 simultaneously, use one to define the `stype' muscle, and use the
2354 value of the latter to fill defines_obstack.
2355 (copy_comment): Remove.
2356 (copy_comment2): Work for a single obstack.
2357 Rename as...
2358 (copy_comment): this.
2359
428046f8
AD
23602001-12-15 Akim Demaille <akim@epita.fr>
2361
2362 * src/lex.c, src/lex.h (xgetc): No longer static.
2363 * src/reader.c (parse_union_decl): Revamp.
2364
ea52d706
AD
23652001-12-15 Akim Demaille <akim@epita.fr>
2366
2367 Still making progress in separating Bison into (i) input, (ii)
2368 process, (iii) output: now we can directly output the parser file
2369 without using table_obstack at all.
2370
2371 * src/files.c, src/files.h (table_obstack): Bye bye.
2372 (parser_file_name): New.
2373 * src/files.c (compute_output_file_names): Compute it.
2374 * src/output.c (actions_output, output_parser)
2375 (output_master_parser): To a file instead of an obstack.
2376
3f96f4dc
AD
23772001-12-15 Akim Demaille <akim@epita.fr>
2378
2379 Attach actions to rules, instead of pre-outputting them to
2380 actions_obstack.
2381
2382 * src/gram.h (rule_t): action and action_line are new members.
2383 * src/reader.c (symbol_list): Likewise.
2384 (copy_action): Save the actions within the rule.
2385 (packgram): Save them in rule_table.
2386 * src/output.c (actions_output): New.
2387 (output_parser): Use it on `%%actions'.
2388 (output_rule_data): Don't free rule_table.
2389 (output): Do it.
2390 (prepare): Don't save the `action' muscle.
2391 * src/bison.simple: s/%%action/%%actions/.
2392
51576fb3
AD
23932001-12-15 Akim Demaille <akim@epita.fr>
2394
2395 * src/reader.c (copy_action): When --yacc, don't append a `;'
2396 to the user action: let it fail if lacking.
dee049eb 2397 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 2398
2648a72d
AD
23992001-12-14 Akim Demaille <akim@epita.fr>
2400
2401 * src/lex.c (literalchar): Simply return the char you decoded, non
2402 longer mess around with obstacks and int pointers.
2403 Adjust all callers.
2404
92790e5b
AD
24052001-12-14 Akim Demaille <akim@epita.fr>
2406
2407 * src/lex.c (literalchar): Don't escape the special characters,
2408 just decode them, and keep them as char (before, eol was output as
2409 the 2 char string `\n' etc.).
2410 * src/output.c (output_rule_data): Use quotearg to output the
2411 token strings.
2412
927c1557
PE
24132001-12-13 Paul Eggert <eggert@twinsun.com>
2414
2415 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2416 Do not infringe on the global user namespace when using C++.
2417 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2418 All uses of `fprintf' and `stderr' changed.
2419
2420 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2421
ed8e1f68
AD
24222001-12-13 Akim Demaille <akim@epita.fr>
2423
2424 The computation of nullable is broken: it doesn't handle empty
2425 RHS's properly.
2426
2427 * tests/torture.at (GNU AWK Grammar): New.
2428 * tests/sets.at (Nullable): New.
2429 * src/nullable.c (set_nullable): Instead of blindly looping over
2430 `ritems', loop over the rules, and then over their rhs's.
2431
2432 Work around Autotest bugs.
2433
2434 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2435 frame, because Autotest understand lines starting with a `+' as
2436 traces from the shell. Then, they are not processed properly.
2437 Admittedly an Autotest bug, but we don't have time to wait for
2438 Autotest to catch up.
2439 * tests/regression.at (Broken Closure): Adjust to the new table
2440 frames.
2441 Move to...
2442 * tests/sets.at: here.
2443
cb581495
AD
24442001-12-13 Akim Demaille <akim@epita.fr>
2445
2446 * src/closure.c (closure): Use nrules instead of playing tricks
2447 with BITS_PER_WORD.
2448
2e729273
AD
24492001-12-13 Akim Demaille <akim@epita.fr>
2450
2451 * src/print.c (print_actions): Output the handling of `$' as the
2452 traces do: shifting the token EOF. Before EOF was treated as a
2453 nonterminal.
2454 * tests/regression.at: Adjust some tests.
2455 * src/print_graph.c (print_core): Complete the set of items via
2456 closure. The next-to-final and final states are still unsatisfying,
2457 but that's to be addressed elsewhere.
2458 No longer output the rule numbers, but do output the state number.
2459 A single loop for the shifts + gotos is enough, but picked a
2460 distinct color for each.
2461 (print_graph): Initialize and finalize closure.
2462
107f7dfb
AD
24632001-12-13 Akim Demaille <akim@epita.fr>
2464
2465 * src/reader.c (readgram): Remove dead code, an strip useless
2466 braces.
2467 (get_type): Remove, unused.
2468
9b53a24f
AD
24692001-12-12 Akim Demaille <akim@epita.fr>
2470
2471 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
2472 on that of lib/error.c.
2473
dbfb6dcd
AD
24742001-12-12 Akim Demaille <akim@epita.fr>
2475
2476 Some hosts don't like `/' in includes.
2477
2478 * src/system.h: Include libgettext.h without qualifying the path.
2479 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
2480 $(top_srcdir).
2481
c25fb648
MA
24822001-12-11 Marc Autret <autret_m@epita.fr>
2483
2484 * src/output.c (output_parser): Remove useless muscle.
2485
710ddc4f
MA
24862001-12-11 Marc Autret <autret_m@epita.fr>
2487
2488 * src/bison.simple: Remove #line just before %%epilogue. It
2489 is now handled in ...
2490 * src/reader.c (read_additionnal_code): Add the output of a
2491 #line for the epilogue.
2492
e83d80b8
MA
24932001-12-10 Marc Autret <autret_m@epita.fr>
2494
927c1557 2495 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
2496 replace precedent remove.
2497 * src/bison.simple: Remove #line before %%prologue because
2498 %%input-line is wrong at this time.
2499
971d5158
MA
25002001-12-10 Marc Autret <autret_m@epita.fr>
2501
2502 * src/reader.c (symbols_output): Clean up.
927c1557 2503 * src/output.c (output_gram, output): Clean up.
971d5158 2504
5edafffd
AD
25052001-12-10 Akim Demaille <akim@epita.fr>
2506
2507 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2508 * src/LR0.c (set_state_table): here.
2509 * src/lalr.c (lalr): Call it.
2510
0279f8e9
AD
25112001-12-10 Akim Demaille <akim@epita.fr>
2512
2513 * src/state.h (shifts): Remove the `number' member: shifts are
2514 attached to state, hence no longer need to be labelled with a
2515 state number.
2516
190c4f5f
AD
25172001-12-10 Akim Demaille <akim@epita.fr>
2518
2519 Now that states have a complete set of members, the linked list of
2520 shifts is useless: just fill directly the state's shifts member.
2521
2522 * src/state.h (shifts): Remove the `next' member.
2523 * src/LR0.c (first_state, last_state): Remove.
2524 Adjust the callers.
2525 (augment_automaton): Don't look for the shifts that must be added
2526 a shift on EOF: it is those of the state we looked for! But now,
2527 since shifts are attached, it is no longer needed to looking
2528 merely by its id: its number.
2529
2a73b93d
AD
25302001-12-10 Akim Demaille <akim@epita.fr>
2531
2532 * src/LR0.c (augment_automaton): Better variable locality.
2533 Remove an impossible branch: if there is a state corresponding to
2534 the start symbol being shifted, then there is shift for the start
2535 symbol from the initial state.
2536
74392f6a
AD
25372001-12-10 Akim Demaille <akim@epita.fr>
2538
2539 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2540 only when appropriate: when insert_start_shifting_state' is not
2541 invoked.
2542 * tests/regression.at (Rule Line Numbers): Adjust.
2543
37c82725
AD
25442001-12-10 Akim Demaille <akim@epita.fr>
2545
2546 * src/LR0.c (augment_automaton): Now that all states have shifts,
2547 merge the two cases addition shifts to the initial state.
2548
6a164e0c
AD
25492001-12-10 Akim Demaille <akim@epita.fr>
2550
2551 * src/lalr.c (set_state_table): Move to...
2552 * src/LR0.c: here.
2553 * src/lalr.c (lalr): Don't call it...
2554 * src/LR0.c (generate_states): do it.
2555 * src/LR0.h (first_state): Remove, only the table is used.
2556
7215de24
AD
25572001-12-10 Akim Demaille <akim@epita.fr>
2558
2559 * src/LR0.h (first_shift, first_reduction): Remove.
2560 * src/lalr.c: Don't use first_shift: find shifts through the
2561 states.
2562
80e25d4d
AD
25632001-12-10 Akim Demaille <akim@epita.fr>
2564
2565 * src/LR0.c: Attach shifts to states as soon as they are
2566 computed.
2567 * src/lalr.c (set_state_table): Instead of assigning shifts to
2568 state, just assert that the mapping was properly done.
2569
0ab3728b
AD
25702001-12-10 Akim Demaille <akim@epita.fr>
2571
2572 * src/LR0.c (insert_start_shift): Rename as...
2573 (insert_start_shifting_state): this.
2574 (insert_eof_shifting_state, insert_accepting_state): New.
2575 (augment_automaton): Adjust.
2576 Better locality of the variables.
2577 When looking if the start_symbol is shifted from the initial
2578 state, using `while (... symbol != start_symbol ...)' sounds
2579 better than `while (... symbol < start_symbol ...)': If fail
2580 to see how the order between symbols could be relevant!
2581
78af9bbc
AD
25822001-12-10 Akim Demaille <akim@epita.fr>
2583
2584 * src/getargs.h: Don't declare `spec_name_prefix' and
2585 `spec_file_prefix', declared by src/files.h.
2586 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2587 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2588 * src/output.c (prepare): Adjust.
2589 * src/reader.c (symbols_output): Likewise.
2590 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2591
bdef2a41
AD
25922001-12-10 Akim Demaille <akim@epita.fr>
2593
2594 * src/muscle_tab.c (muscle_init): NULL is a better default than
2595 `"0"'.
2596
3735969c
AD
25972001-12-10 Akim Demaille <akim@epita.fr>
2598
2599 * src/reader.c (reader): Calling symbols_output once is enough.
2600
49701457
AD
26012001-12-10 Akim Demaille <akim@epita.fr>
2602
2603 Now that states have a complete set of members, the linked list of
2604 reductions is useless: just fill directly the state's reductions
2605 member.
2606
2607 * src/state.h (struct reductions): Remove member `number' and
2608 `next'.
2609 * src/LR0.c (first_reduction, last_reduction): Remove.
2610 (save_reductions): Don't link the new reductions, store them in
2611 this_state.
2612 * src/lalr.c (set_state_table): No need to attach reductions to
2613 states, it's already done.
2614 * src/output.c (output_actions): No longer free the shifts, then
2615 the reductions, then the states: free all the states and their
2616 members.
2617
0edad749
AD
26182001-12-10 Akim Demaille <akim@epita.fr>
2619
2620 * src/options.c (OPTN, DRTV, BOTH): New.
2621 (option_table): Use them.
2622
0edad749
AD
2623 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2624 the job of system.h.
2625 * src/options.c: Don't include stdio.h and xalloc.h for the same
2626 reasons.
2627
5449dd0f
AD
26282001-12-10 Akim Demaille <akim@epita.fr>
2629
2630 * src/output.c (output, prepare): Make sure the values of the
2631 muscles `action' and `prologue' are 0-terminated.
2632
a870c567
AD
26332001-12-10 Akim Demaille <akim@epita.fr>
2634
2635 Clean up GCC warnings.
2636
2637 * src/reader.c (copy_action): `buf' is not used.
2638 (parse_skel_decl): Be static.
2639 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2640 * src/options.h (create_long_option_table): Have a real prototype.
2641 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2642 (hash_delete_at): Return const void *.
2643 Adjust casts to preserve the const.
2644
80df8768
AD
26452001-12-10 Akim Demaille <akim@epita.fr>
2646
2647 * configure.in: Require 2.52g.
2648 M4 is not needed, but AUTOM4TE is.
2649 * m4/m4.m4: Remove.
2650 * tests/Makefile.am: Adjust.
2651
f693ad14
AD
26522001-12-10 Akim Demaille <akim@epita.fr>
2653
2654 One structure for states is enough, even though theoretically
2655 there are LR(0) states and LALR(1) states.
2656
2657 * src/lalr.h (state_t): Remove.
2658 (state_table): Be state_t **, not state_t *.
2659 * src/state.h (core, CORE_ALLOC): Rename as...
2660 (state_t, STATE_ALLOC): this.
2661 Add the LALR(1) members: shifts, reductions, errs.
2662 * src/LR0.c (state_table): Rename as...
2663 (state_hash): this, to avoid name clashes with the global
2664 `state_table'.
2665 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2666 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2667
74ffbcb6
AD
26682001-12-10 Akim Demaille <akim@epita.fr>
2669
2670 Bison dumps core on bash.y.
2671 Reported by Pascal Bart.
2672
2673 * src/warshall.c (bitmatrix_print): New.
2674 (TC): Use it.
2675 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2676 j must be the outer loop.
2677 * tests/regression.at (Broken Closure): New.
2678
07708e19
AD
26792001-12-05 Akim Demaille <akim@epita.fr>
2680
2681 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2682 its argument.
2683