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