]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/conflicts.c (log_resolution): Accept the rule involved in
[bison.git] / ChangeLog
CommitLineData
9801d40c
AD
12002-06-15 Akim Demaille <akim@epita.fr>
2
3 * src/conflicts.c (log_resolution): Accept the rule involved in
4 the sr conflicts instead of the lookahead number that points to
5 that rule.
6 (flush_reduce): Accept the current lookahead vector as argument,
7 instead of the index in LA.
8 (resolve_sr_conflict): Accept the current number of lookahead
9 bitset to consider for the STATE, instead of the index in LA.
10 (set_conflicts): Adjust.
11 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12
13
c0263492
AD
142002-06-15 Akim Demaille <akim@epita.fr>
15
16 * src/state.h (state_t): Replace the `lookaheadsp' member, a
17 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
18 Adjust all dependencies.
19 * src/lalr.c (initialize_lookaheads): Split into...
20 (states_lookaheads_count, states_lookaheads_initialize): these.
21 (lalr): Adjust.
22
23
9757c359
AD
242002-06-15 Akim Demaille <akim@epita.fr>
25
26 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
27 out of...
28 (grammar_rules_print): here.
29 * src/reduce.c (reduce_output): Use it.
30 * tests/reduce.at (Useless Rules, Reduced Automaton)
31 (Underivable Rules): Adjust.
32
33
6b98e4b5
AD
342002-06-15 Akim Demaille <akim@epita.fr>
35
36 Copy BYacc's nice way to report the grammar.
37
38 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
39 New.
40 Don't print the rules' location, it is confusing and useless.
41 (rule_print): Use grammar_rhs_print.
42 * src/print.c (print_grammar): Use grammar_rules_print.
43
44
452002-06-15 Akim Demaille <akim@epita.fr>
46
47 Complete and rationalize `useless thing' warnings.
48
49 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
50 (symbol_tag_print): New.
51 Use them everywhere in place of accessing directly the tag member.
52 * src/gram.h, src/gram.c (rule_print): New.
53 Use it where a rule used to be printed `by hand'.
54 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
55 (reduce_grammar_tables): Report the useless rules.
56 (reduce_print): Useless things are a warning, not an error.
57 Report it as such.
58 * tests/reduce.at (Useless Nonterminals, Useless Rules):
59 (Reduced Automaton, Underivable Rules): Adjust.
60 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
61 * tests/conflicts.at (Unresolved SR Conflicts)
62 (Solved SR Conflicts): Adjust.
63
64
ee000ba4
AD
652002-06-15 Akim Demaille <akim@epita.fr>
66
67 Let symbols have a location.
68
69 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
70 (getsym): Adjust.
71 Adjust all callers.
72 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
73 Use location_t, not int.
74 * src/symtab.c (symbol_check_defined): Take advantage of the
75 location.
76 * tests/regression.at (Invalid inputs): Adjust.
77
8efe435c
AD
782002-06-15 Akim Demaille <akim@epita.fr>
79
80 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
81 (input): Don't try to initialize yylloc here, do it in the
82 scanner.
83 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
84 * src/gram.h (rule_t): Change line and action_line into location
85 and action_location, of location_t type.
86 Adjust all dependencies.
87 * src/location.h, src/location.c (empty_location): New.
88 * src/reader.h, src/reader.c (grammar_start_symbol_set)
89 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
90 (grammar_current_rule_symbol_append)
91 (grammar_current_rule_action_append): Expect a location as argument.
92 * src/reader.c (grammar_midrule_action): Adjust to attach an
93 action's location as dummy symbol location.
94 * src/symtab.h, src/symtab.c (startsymbol_location): New.
95 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
96 the line numbers.
97
98
1921f1d7
AD
992002-06-14 Akim Demaille <akim@epita.fr>
100
101 Grammar declarations may be found in the grammar section.
102
103 * src/parse-gram.y (rules_or_grammar_declaration): New.
104 (declarations): Each declaration may end with a semicolon, not
105 just...
106 (grammar_declaration): `"%union"'.
107 (grammar): Branch to rules_or_grammar_declaration.
108
4515534c
AD
1092002-06-14 Akim Demaille <akim@epita.fr>
110
111 * src/main.c (main): Invoke scanner_free.
112
f958596b
AD
1132002-06-14 Akim Demaille <akim@epita.fr>
114
115 * src/output.c (m4_invoke): Extracted from...
116 (output_skeleton): here.
117 Free tempfile.
118
2c569025
AD
1192002-06-14 Akim Demaille <akim@epita.fr>
120
121 * src/parse-gram.y (directives, directive, gram)
122 (grammar_directives, precedence_directives, precedence_directive):
123 Rename as...
124 (declarations, declaration, grammar, grammar_declaration)
125 (precedence_declaration, precedence_declarator): these.
126 (symbol_declaration): New.
127
592e8d4d
AD
1282002-06-14 Akim Demaille <akim@epita.fr>
129
130 * src/files.c (action_obstack): Remove, unused.
131 (output_obstack): Remove it, and all its dependencies, as it is no
132 longer needed.
133 * src/reader.c (epilogue_set): Build the epilogue in the
134 muscle_obstack.
135 * src/output.h, src/output.c (muscle_obstack): Move to...
136 * src/muscle_tab.h, src/muscle_tab.h: here.
137 (muscle_init): Initialize muscle_obstack.
138 (muscle_free): New.
139 * src/main.c (main): Call it.
140
0c15323d
AD
1412002-06-14 Akim Demaille <akim@epita.fr>
142
143 * src/location.h: New, extracted from...
144 * src/reader.h: here.
145 * src/Makefile.am (noinst_HEADERS): Merge into
146 (bison_SOURCES): this.
147 Add location.h.
148 * src/parse-gram.y: Use location_t instead of Bison's.
149 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
150 Use location_t instead of ints.
151
e96c9728
AD
1522002-06-14 Akim Demaille <akim@epita.fr>
153
154 * data/bison.simple, data/bison.c++: Be sure to restore the
155 current #line when returning to the skeleton contents after having
156 exposed the input file's #line.
157
75d1fe16
AD
1582002-06-12 Akim Demaille <akim@epita.fr>
159
160 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
161 eager.
162 * tests/actions.at (Exotic Dollars): New.
163
6c35d22c
AD
1642002-06-12 Akim Demaille <akim@epita.fr>
165
166 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
167 ['"/] too eagerly.
168 * tests/input.at (Torturing the Scanner): New.
169
1d6412ad
AD
1702002-06-11 Akim Demaille <akim@epita.fr>
171
172 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
173 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
174 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
175 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
176 * src/reader.c (reader): Use it.
177
4cdb01db
AD
1782002-06-11 Akim Demaille <akim@epita.fr>
179
180 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
181 Adjust all callers.
182 (scanner_last_string_free): New.
183
44995b2e
AD
1842002-06-11 Akim Demaille <akim@epita.fr>
185
186 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
187 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
188 (last_string, YY_OBS_FREE): New.
189 Use them when returning an ID.
190
e9955c83
AD
1912002-06-11 Akim Demaille <akim@epita.fr>
192
193 Have Bison grammars parsed by a Bison grammar.
194
195 * src/reader.c, src/reader.h (prologue_augment): New.
196 * src/reader.c (copy_definition): Remove.
197
198 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
199 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
200 (grammar_current_rule_prec_set, grammar_current_rule_check)
201 (grammar_current_rule_symbol_append)
202 (grammar_current_rule_action_append): Export.
203 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
204 (symbol_list_action_append): Remove.
205 Hook the routines from reader.
206 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
207 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
208
209 * src/reader.c (read_declarations): Remove, unused.
210
211 * src/parse-gram.y: Handle the epilogue.
212 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
213 (grammar_start_symbol_set): this.
214 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
215 * src/reader.c (readgram): Remove, unused.
216 (reader): Adjust to insert eoftoken and axiom where appropriate.
217
218 * src/reader.c (copy_dollar): Replace with...
219 * src/scan-gram.h (handle_dollar): this.
220 * src/parse-gram.y: Remove `%thong'.
221
222 * src/reader.c (copy_at): Replace with...
223 * src/scan-gram.h (handle_at): this.
224
225 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
226 New.
227
228 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
229 time being.
230
231 * src/reader.h, src/reader.c (grammar_rule_end): New.
232
233 * src/parse.y (current_type, current_class): New.
234 Implement `%nterm', `%token' support.
235 Merge `%term' into `%token'.
236 (string_as_id): New.
237 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
238 type name.
239
240 * src/parse-gram.y: Be sure to handle properly the beginning of
241 rules.
242
243 * src/parse-gram.y: Handle %type.
244 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
245
246 * src/parse-gram.y: More directives support.
247 * src/options.c: No longer handle source directives.
248
249 * src/parse-gram.y: Fix %output.
250
251 * src/parse-gram.y: Handle %union.
252 Use the prologue locations.
253 * src/reader.c (parse_union_decl): Remove.
254
255 * src/reader.h, src/reader.c (epilogue_set): New.
256 * src/parse-gram.y: Use it.
257
258 * data/bison.simple, data/bison.c++: b4_stype is now either not
259 defined, then default to int, or to the contents of %union,
260 without `union' itself.
261 Adjust.
262 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
263
264 * src/output.c (actions_output): Don't output braces, as they are
265 already handled by the scanner.
266
267 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
268 characters to themselves.
269
270 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
271 that the epilogue has a proper #line.
272
273 * src/parse-gram.y: Handle precedence/associativity.
274
275 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
276 a terminal.
277 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
278 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
279 at all to define terminals that cannot be emitted.
280
281 * src/scan-gram.l: Escape M4 characters.
282
283 * src/scan-gram.l: Working properly with escapes in user
284 strings/characters.
285
286 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
287 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
288 grammar.
289 Use more modest sizes, as for the time being the parser does not
290 release memory, and therefore the process swallows a huge amount
291 of memory.
292
293 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
294 stricter %token grammar.
295
296 * src/symtab.h (associativity): Add `undef_assoc'.
297 (symbol_precedence_set): Do nothing when passed an undef_assoc.
298 * src/symtab.c (symbol_check_alias_consistence): Adjust.
299
300 * tests/regression.at (Invalid %directive): Remove, as it is now
301 meaningless.
302 (Invalid inputs): Adjust to the new error messages.
303 (Token definitions): The new grammar doesn't allow too many
304 eccentricities.
305
306 * src/lex.h, src/lex.c: Remove.
307 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
308 (copy_character, copy_string2, copy_string, copy_identifier)
309 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
310 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
311 (parse_action): Remove.
312 * po/POTFILES.in: Adjust.
313
2e047461
AD
3142002-06-11 Akim Demaille <akim@epita.fr>
315
316 * src/reader.c (parse_action): Don't store directly into the
317 rule's action member: return the action as a string.
318 Don't require `rule_length' as an argument: compute it.
319 (grammar_current_rule_symbol_append)
320 (grammar_current_rule_action_append): New, eved out from
321 (readgram): here.
322 Remove `action_flag', `rulelength', unused now.
323
9af3fbce
AD
3242002-06-11 Akim Demaille <akim@epita.fr>
325
326 * src/reader.c (grammar_current_rule_prec_set).
327 (grammar_current_rule_check): New, eved out from...
328 (readgram): here.
329 Remove `xaction', `first_rhs': useless.
330 * tests/input.at (Type clashes): New.
331 * tests/existing.at (GNU Cim Grammar): Adjust.
332
1485e106
AD
3332002-06-11 Akim Demaille <akim@epita.fr>
334
335 * src/reader.c (grammar_midrule_action): New, Eved out from
336 (readgram): here.
337
da4160c3
AD
3382002-06-11 Akim Demaille <akim@epita.fr>
339
340 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
341 New.
342 (readgram): Use them as replacement of inlined code, crule and
343 crule1.
344
f6d0f937
AD
3452002-06-11 Akim Demaille <akim@epita.fr>
346
347 * src/reader.c (grammar_end, grammar_symbol_append): New.
348 (readgram): Use them.
349 Make the use of `p' as local as possible.
350
69078d4b
AD
3512002-06-10 Akim Demaille <akim@epita.fr>
352
353 GCJ's parser requires the tokens to be defined before the prologue.
354
355 * data/bison.simple: Output the token definition before the user's
356 prologue.
357 * tests/regression.at (Braces parsing, Duplicate string)
358 (Mixing %token styles): Check the output from bison.
359 (Early token definitions): New.
360
5e424082
AD
3612002-06-10 Akim Demaille <akim@epita.fr>
362
363 * src/symtab.c (symbol_user_token_number_set): Don't complain when
364 assigning twice the same user number to a token, so that we can
365 use it in...
366 * src/lex.c (lex): here.
367 Also use `symbol_class_set' instead of hand written code.
368 * src/reader.c (parse_assoc_decl): Likewise.
369
44536b35
AD
3702002-06-10 Akim Demaille <akim@epita.fr>
371
372 * src/symtab.c, src/symtab.c (symbol_class_set)
373 (symbol_user_token_number_set): New.
374 * src/reader.c (parse_token_decl): Use them.
375 Use a switch instead of ifs.
376 Use a single argument.
377
8b9f2372
AD
3782002-06-10 Akim Demaille <akim@epita.fr>
379
380 Remove `%thong' support as it is undocumented, unused, duplicates
381 `%token's job, and creates useless e-mail traffic with people who
382 want to know what it is, why it is undocumented, unused, and
383 duplicates `%token's job.
384
385 * src/reader.c (parse_thong_decl): Remove.
386 * src/options.c (option_table): Remove "thong".
387 * src/lex.h (tok_thong): Remove.
388
3ae2b51f
AD
3892002-06-10 Akim Demaille <akim@epita.fr>
390
391 * src/symtab.c, src/symtab.c (symbol_type_set)
392 (symbol_precedence_set): New.
393 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
394 (value_components_used): Remove, unused.
395
2f1afb73
AD
3962002-06-09 Akim Demaille <akim@epita.fr>
397
398 Move symbols handling code out of the reader.
399
400 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
401 (axiom): Move to...
402 * src/symtab.h, src/symtab.c: here.
403
404 * src/gram.c (start_symbol): Remove: use startsymbol->number.
405 * src/reader.c (startval): Rename as...
406 * src/symtab.h, src/symtab.c (startsymbol): this.
407 * src/reader.c: Adjust.
408
409 * src/reader.c (symbol_check_defined, symbol_make_alias)
410 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
411 (token_translations_init)
412 Move to...
413 * src/symtab.c: here.
414 * src/reader.c (packsymbols): Move to...
415 * src/symtab.h, src/symtab.c (symbols_pack): here.
416 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
417 argument.
418
e9bca3ad
AD
4192002-06-03 Akim Demaille <akim@epita.fr>
420
421 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
422 then statements.
423
86eff183
AD
4242002-06-03 Akim Demaille <akim@epita.fr>
425
426 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
427 structs with non literals.
428 * src/scan-skel.l: never-interactive.
429 * src/conflicts.c (enum conflict_resolution_e): No trailing
430 comma.
431 * src/getargs.c (usage): Split long literal strings.
432 Reported by Hans Aberg.
433
717be197
AD
4342002-05-28 Akim Demaille <akim@epita.fr>
435
436 * data/bison.c++: Use C++ ostreams.
437 (cdebug_): New member.
438
670ddffd
AD
4392002-05-28 Akim Demaille <akim@epita.fr>
440
441 * src/output.c (output_skeleton): Be sure to allocate enough room
442 for `/' _and_ for `\0' in full_skeleton.
443
769b430f
AD
4442002-05-28 Akim Demaille <akim@epita.fr>
445
446 * data/bison.c++: Catch up with bison.simple:
447 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
448 and Paul Eggert <eggert@twinsun.com>: `error' handing.
449 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
450 and popping traces.
451
7067cb36
PH
4522002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
453
454 * src/output.c (output_skeleton): Put an explicit path in front of
455 the skeleton file name, rather than relying on the -I directory,
456 to partially alleviate effects of having a skeleton file lying around
457 in the current directory.
769b430f 458
4a713ec2
PH
4592002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
460
769b430f 461 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
462 obstack_printf should be obstack_fgrow1.
463
b408954b
AD
4642002-05-26 Akim Demaille <akim@epita.fr>
465
466 * src/state.h (state_t): `solved_conflicts' is a new member.
467 * src/LR0.c (new_state): Set it to 0.
468 * src/conflicts.h, src/conflicts.c (print_conflicts)
469 (free_conflicts, solve_conflicts): Rename as...
470 (conflicts_print, conflicts_free, conflicts_solve): these.
471 Adjust callers.
472 * src/conflicts.c (enum conflict_resolution_e)
473 (solved_conflicts_obstack): New, used by...
474 (log_resolution): this.
475 Adjust to attach the conflict resolution to each state.
476 Complete the description with the precedence/associativity
477 information.
478 (resolve_sr_conflict): Adjust.
479 * src/print.c (print_state): Output its solved_conflicts.
480 * tests/conflicts.at (Unresolved SR Conflicts)
481 (Solved SR Conflicts): Exercise --report=all.
482
a49aecd5
AD
4832002-05-26 Akim Demaille <akim@epita.fr>
484
485 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
486 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
487 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
488 (token_number_t, item_number_as_token_number)
489 (token_number_as_item_number, muscle_insert_token_number_table):
490 Rename as...
491 (symbol_number_t, item_number_as_symbol_number)
492 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
493 these, since it is more appropriate.
494
5504898e
AD
4952002-05-26 Akim Demaille <akim@epita.fr>
496
497 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
498 `Error:' lines.
499 * data/bison.simple (yystos) [YYDEBUG]: New.
500 (yyparse) [YYDEBUG]: Display the symbols which are popped during
501 error recovery.
502 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
503
ec3bc396
AD
5042002-05-25 Akim Demaille <akim@epita.fr>
505
506 * doc/bison.texinfo (Debugging): Split into...
507 (Tracing): this new section, its former contents, and...
508 (Understanding): this new section.
509 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
510 by...
511 (report_flag): this.
512 Adjust all dependencies.
513 (report_args, report_types, report_argmatch): New.
514 (usage, getargs): Report/support -r, --report.
515 * src/options.h
516 (struct option_table_struct): Rename as..,
517 (struct option_table_s): this.
518 Rename the `set_flag' member to `flag' to match with getopt_long's
519 struct.
520 * src/options.c (option_table): Split verbose into an entry for
521 %verbose, and another for --verbose.
522 Support --report/-r, so remove -r from the obsolete --raw.
523 * src/print.c: Attach full item sets and lookaheads reports to
524 report_flag instead of trace_flag.
525 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
526
78df8250
PE
5272002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
528 and Paul Eggert <eggert@twinsun.com>
769b430f 529
78df8250
PE
530 * data/bison.simple (yyparse): Correct error handling to conform to
531 POSIX and yacc. Specifically, after syntax error is discovered,
532 do not reduce further before shifting the error token.
533 Clean up the code a bit by removing the labels yyerrdefault,
534 yyerrhandle, yyerrpop.
535 * NEWS: Document the above.
536
c0c9ea05
PH
5372002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
538
539 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
540 type; it isn't always big enough, since it doesn't necessarily
541 include non-terminals.
769b430f 542 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
543 the latter can be removed.
544 (yy_token_number_type): Remove, only one use.
545 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
546 don't use TokenNumberType as element type.
769b430f 547
c0c9ea05
PH
548 * tests/regression.at: Modify expected output to agree with change
549 to yyr1 and yytranslate.
769b430f 550
6390a83f
FK
5512002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
552
553 * src/reader.c (parse_action): Use copy_character instead of
554 obstack_1grow.
555
db7c8e9a
AD
5562002-05-13 Akim Demaille <akim@epita.fr>
557
558 * tests/regression.at (Token definitions): Prototype yylex and
559 yyerror.
560
fcc61800
PH
5612002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
562
158c687b 563 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
564 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
565 32-bit arithmetic.
566 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
567
5683e9b2
AD
5682002-05-07 Akim Demaille <akim@epita.fr>
569
570 * tests/synclines.at: Be sure to prototype yylex and yyerror to
571 avoid GCC warnings.
572
0c2d3f4c
AD
5732002-05-07 Akim Demaille <akim@epita.fr>
574
575 Kill GCC warnings.
576
577 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
578 over the RHS of each rule.
579 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
580 * src/state.h (state_t): Member `nitems' is unsigned short.
581 * src/LR0.c (get_state): Adjust.
582 * src/reader.c (packgram): Likewise.
583 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
584 `Type'.
585 (muscle_insert_int_table): Remove, unused.
586 (prepare_rules): Remove `max'.
587
1565b720
AD
5882002-05-06 Akim Demaille <akim@epita.fr>
589
590 * src/closure.c (print_firsts): Display of the symbol tags.
591 (bitmatrix_print): Move to...
592 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
593 here.
594 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
595
cfaee611
AD
5962002-05-06 Akim Demaille <akim@epita.fr>
597
598 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
599 hash_do_for_each.
600
458be8e0
AD
6012002-05-06 Akim Demaille <akim@epita.fr>
602
603 * src/LR0.c (new_state, get_state): Instead of using the global
604 `kernel_size' and `kernel_base', have two new arguments:
605 `core_size' and `core'.
606 Adjust callers.
607
a900a624
AD
6082002-05-06 Akim Demaille <akim@epita.fr>
609
610 * src/reader.c (packgram): No longer end `ritem' with a 0
611 sentinel: it is not used.
612
d4e7d3a1
AD
6132002-05-05 Akim Demaille <akim@epita.fr>
614
615 New experimental feature: display the lookaheads in the report and
616 graph.
617
618 * src/print (print_core): When --trace-flag, display the rules
619 lookaheads.
620 * src/print_graph.c (print_core): Likewise.
621 Swap the arguments.
622 Adjust caller.
623
39ceb25b
AD
6242002-05-05 Akim Demaille <akim@epita.fr>
625
626 * tests/torture.at (Many lookaheads): New test.
627
5372019f
AD
6282002-05-05 Akim Demaille <akim@epita.fr>
629
630 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
631 (GENERATE_MUSCLE_INSERT_TABLE): this.
632 (output_int_table, output_unsigned_int_table, output_short_table)
633 (output_token_number_table, output_item_number_table): Replace with...
634 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
635 (muscle_insert_short_table, muscle_insert_token_number_table)
636 (muscle_insert_item_number_table): these.
637 Adjust all callers.
638 (prepare_tokens): Don't free `translations', since...
639 * src/reader.h, src/reader.c (grammar_free): do it.
640 Move to...
641 * src/gram.h, src/gram.c (grammar_free): here.
642 * data/bison.simple, data/bison.c++: b4_token_number_max is now
643 b4_translate_max.
644
5df5f6d5
AD
6452002-05-05 Akim Demaille <akim@epita.fr>
646
647 * src/output.c (output_unsigned_int_table): New.
648 (prepare_rules): `i' is unsigned.
649 `prhs', `rline', `r2' are unsigned int.
650 Rename muscle `rhs_number_max' as `rhs_max'.
651 Output muscles `prhs_max', `rline_max', and `r2_max'.
652 Free rline and r1.
653 * data/bison.simple, data/bison.c++: Adjust to use these muscles
654 to compute types instead of constant types.
655 * tests/regression.at (Web2c Actions): Adjust.
656
b87f8b21
AD
6572002-05-04 Akim Demaille <akim@epita.fr>
658
659 * src/symtab.h (SALIAS, SUNDEF): Rename as...
660 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
661 Adjust dependencies.
662 * src/output.c (token_definitions_output): Be sure not to output a
663 `#define 'a'' when fed with `%token 'a' "a"'.
664 * tests/regression.at (Token definitions): New.
665
8bb936e4
PE
6662002-05-03 Paul Eggert <eggert@twinsun.com>
667
668 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
669 for K&R C.
670
6712002-05-03 gettextize <bug-gnu-gettext@gnu.org>
672
673 * Makefile.am (SUBDIRS): Remove intl.
674 (EXTRA_DIST): Add config/config.rpath.
675
53c71a12
AD
6762002-05-03 Akim Demaille <akim@epita.fr>
677
678 * data/bison.simple (m4_if): Don't output empty enums.
679 And actually, output valid enum definitions :(.
680
289dd0cf
AD
6812002-05-03 Akim Demaille <akim@epita.fr>
682
683 * configure.bat: Remove, completely obsolete.
684 * Makefile.am (EXTRA_DIST): Adjust.
685 Don't distribute config.rpath...
686 * config/Makefile.am (EXTRA_DIST): Do it.
687
db85e524
AD
6882002-05-03 Akim Demaille <akim@epita.fr>
689
690 * configure.in (GETTEXT_VERSION): New.
691 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
692
83ccf991
AD
6932002-05-03 Akim Demaille <akim@epita.fr>
694
695 * data/bison.simple (b4_token_enum): New.
696 (b4_token_defines): Use it to output tokens both as #define and
697 enums.
698 Suggested by Paul Eggert.
699 * src/output.c (token_definitions_output): Don't output spurious
700 white spaces.
701
1f418995
AD
7022002-05-03 Akim Demaille <akim@epita.fr>
703
704 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
705
45119f04
RA
7062002-05-02 Robert Anisko <robert@lrde.epita.fr>
707
708 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
709 Update the stack class, give a try to deque as the default container.
710
b2d52318
AD
7112002-05-02 Akim Demaille <akim@epita.fr>
712
713 * data/bison.simple (yyparse): Do not implement @$ = @1.
714 (YYLLOC_DEFAULT): Adjust to do it.
715 * doc/bison.texinfo (Location Default Action): Fix.
716
3a8b4109
AD
7172002-05-02 Akim Demaille <akim@epita.fr>
718
719 * src/reader.c (parse_braces): Merge into...
720 (parse_action): this.
721
84614e13
AD
7222002-05-02 Akim Demaille <akim@epita.fr>
723
724 * configure.in (ALL_LINGUAS): Remove.
725 * po/LINGUAS, hr.po: New.
726
fdbcd8e2
AD
7272002-05-02 Akim Demaille <akim@epita.fr>
728
729 Remove the so called hairy (semantic) parsers.
730
731 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
732 * src/gram.h, src/gram.c (semantic_parser): Remove.
733 (rule_t): Remove the guard and guard_line members.
734 * src/lex.h (token_t): remove tok_guard.
735 * src/options.c (option_table): Remove %guard and %semantic_parser
736 support.
737 * src/output.c, src/output.h (guards_output): Remove.
738 (prepare): Adjust.
739 (token_definitions_output): Don't output the `T'
740 tokens (???).
741 (output_skeleton): Don't output the guards.
742 * src/files.c, src/files.c (attrsfile): Remove.
743 * src/reader.c (symbol_list): Remove the guard and guard_line
744 members.
745 Adjust dependencies.
746 (parse_guard): Remove.
747 * data/bison.hairy: Remove.
748 * doc/bison.texinfo (Environment Variables): Remove occurrences of
749 BISON_HAIRY.
750
82b6cb3f
AD
7512002-05-02 Akim Demaille <akim@epita.fr>
752
753 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
754 (parse_guard): Rename the formal argument `stack_offset' as
755 `rule_length', which is more readable.
756 Adjust callers.
757 (copy_at, copy_dollar): Instead of outputting the hard coded
758 values of $$, $n and so forth, output invocation to b4_lhs_value,
759 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
760 Note: this patch partially drops `semantic-parser' support: it
761 always does `rule_length - n', where semantic parsers ought to
762 always use `-n'.
82b6cb3f
AD
763 * data/bison.simple, data/bison.c++ (b4_lhs_value)
764 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
765
6cbfbcc5
AD
7662002-05-02 Akim Demaille <akim@epita.fr>
767
768 * configure.in (AC_INIT): Bump to 1.49b.
769 (AM_INIT_AUTOMAKE): Short invocation.
770
b8548114
AD
7712002-05-02 Akim Demaille <akim@epita.fr>
772
773 Version 1.49a.
774
c20cd1fa
AD
7752002-05-01 Akim Demaille <akim@epita.fr>
776
777 * src/skeleton.h: Remove.
778
8a9566d4
AD
7792002-05-01 Akim Demaille <akim@epita.fr>
780
781 * src/skeleton.h: Fix the #endif.
782 Reported by Magnus Fromreide.
783
8c6d399a
PE
7842002-04-26 Paul Eggert <eggert@twinsun.com>
785
786 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
787 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 788 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 789
2b7ed18a
RA
7902002-04-25 Robert Anisko <robert@lrde.epita.fr>
791
792 * src/scan-skel.l: Postprocess quadrigraphs.
793
794 * src/reader.c (copy_character): New function, used to output
795 single characters while replacing `[' and `]' with quadrigraphs, to
796 avoid troubles with M4 quotes.
797 (copy_comment): Output characters with copy_character.
798 (read_additionnal_code): Likewise.
799 (copy_string2): Likewise.
800 (copy_definition): Likewise.
801
802 * tests/calc.at: Exercise M4 quoting.
803
34a89c50
AD
8042002-04-25 Akim Demaille <akim@epita.fr>
805
806 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
807 between `!' and the command.
808 Reported by Paul Eggert.
809
0dd1580a
RA
8102002-04-24 Robert Anisko <robert@lrde.epita.fr>
811
812 * tests/calc.at: Exercise prologue splitting.
813
814 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
815 `b4_post_prologue' instead of `b4_prologue'.
816
817 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
818 muscles.
819 (output): Free pre_prologue_obstack and post_prologue_obstack.
820 * src/files.h, src/files.c (attrs_obstack): Remove.
821 (pre_prologue_obstack, post_prologue_obstack): New.
822 * src/reader.c (copy_definition): Add a parameter to specify the
823 obstack to fill, instead of using attrs_obstack unconditionally.
824 (read_declarations): Pass pre_prologue_obstack to copy_definition if
825 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
826
83c1796f
PE
8272002-04-23 Paul Eggert <eggert@twinsun.com>
828
829 * data/bison.simple: Remove unnecessary commentary and white
830 space differences from 1_29-branch.
831 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
832
833 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
834 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
835 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
836 constructors or destructors.
837
838 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
839
1207eeac
AD
8402002-04-23 Akim Demaille <akim@epita.fr>
841
842 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
843 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
844 location with columns.
845 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
846 All reported by Paul Eggert.
847
78ab8f67
AD
8482002-04-22 Akim Demaille <akim@epita.fr>
849
850 * src/reduce.c (dump_grammar): Move to...
851 * src/gram.h, src/gram.c (grammar_dump): here.
852 Be sure to separate long item numbers.
853 Don't read the members of a rule's prec if its nil.
854
133c20e2
AD
8552002-04-22 Akim Demaille <akim@epita.fr>
856
857 * src/output.c (table_size, table_grow): New.
858 (MAXTABLE): Remove, replace uses with table_size.
859 (pack_vector): Instead of dying when the table is too big, grow it.
860
9515e8a7
AD
8612002-04-22 Akim Demaille <akim@epita.fr>
862
863 * data/bison.simple (yyr1): Its type is that of a token number.
864 * data/bison.c++ (r1_): Likewise.
865 * tests/regression.at (Web2c Actions): Adjust.
866
23c5a174
AD
8672002-04-22 Akim Demaille <akim@epita.fr>
868
869 * src/reader.c (token_translations_init): 256 is now the default
870 value for the error token, i.e., it will be assigned another
871 number if the user assigned 256 to one of her tokens.
872 (reader): Don't force 256 to error.
873 * doc/bison.texinfo (Symbols): Adjust.
874 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
875 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
876 etc. instead of 10, 20, 30 (which was used to `jump' over error
877 (256) and undefined (2)).
878
5fbb0954
AD
8792002-04-22 Akim Demaille <akim@epita.fr>
880
881 Propagate more token_number_t.
882
883 * src/gram.h (token_number_as_item_number)
884 (item_number_as_token_number): New.
885 * src/output.c (GENERATE_OUTPUT_TABLE): New.
886 Use it to create output_item_number_table and
887 output_token_number_table.
888 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
889 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
890 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
891 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
892
4f940944
AD
8932002-04-22 Akim Demaille <akim@epita.fr>
894
895 * src/output.h, src/output.c (get_lines_number): Remove.
896
3ded9a63
AD
8972002-04-19 Akim Demaille <akim@epita.fr>
898
899 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
900 as Lex/Flex'.
901 (Debugging): More details about enabling the debugging features.
902 (Table of Symbols): Describe $$, $n, @$, and @n.
903 Suggested by Tim Josling.
904
e0c471a9
AD
9052002-04-19 Akim Demaille <akim@epita.fr>
906
907 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
908
fecc10cd
AD
9092002-04-10 Akim Demaille <akim@epita.fr>
910
911 * src/system.h: Rely on HAVE_LIMITS_H.
912 Suggested by Paul Eggert.
913
51dec47b
AD
9142002-04-09 Akim Demaille <akim@epita.fr>
915
916 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
917 full stderr, and strip it according to the bison options, instead
918 of composing the error message from different bits.
919 This makes it easier to check for several error messages.
920 Adjust all the invocations.
921 Add an invocation exercising the error token.
922 Add an invocation demonstrating a stupid error message.
923 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
924 Adjust the tests.
925 Error message are for stderr, not stdout.
926
007a50a4
AD
9272002-04-09 Akim Demaille <akim@epita.fr>
928
929 * src/gram.h, src/gram.c (error_token_number): Remove, use
930 errtoken->number.
931 * src/reader.c (reader): Don't specify the user token number (2)
932 for $undefined, as it uselessly prevents using it.
933 * src/gram.h (token_number_t): Move to...
934 * src/symtab.h: here.
935 (state_t.number): Is a token_number_t.
936 * src/print.c, src/reader.c: Use undeftoken->number instead of
937 hard coded 2.
938 (Even though this 2 is not the same as above: the number of the
939 undeftoken remains being 2, it is its user token number which
940 might not be 2).
941 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
942 `user_token_number_max'.
943 Output `undef_token_number'.
944 * data/bison.simple, data/bison.c++: Use them.
945 Be sure to map invalid yylex return values to
946 `undef_token_number'. This saves us from gratuitous SEGV.
947
948 * tests/conflicts.at (Solved SR Conflicts)
949 (Unresolved SR Conflicts): Adjust.
950 * tests/regression.at (Web2c Actions): Adjust.
951
06446ccf
AD
9522002-04-08 Akim Demaille <akim@epita.fr>
953
954 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
955 Adding #line.
956 Remove the duplicate `typedefs'.
957 (RhsNumberType): Fix the declaration and various other typos.
958 Use __ofile__.
959 * data/bison.simple: Use __ofile__.
960 * src/scan-skel.l: Handle __ofile__.
961
62a3e4f0
AD
9622002-04-08 Akim Demaille <akim@epita.fr>
963
964 * src/gram.h (item_number_t): New, the type of item numbers in
965 RITEM. Note that it must be able to code symbol numbers as
966 positive number, and the negation of rule numbers as negative
967 numbers.
968 Adjust all dependencies (pretty many).
969 * src/reduce.c (rule): Remove this `short *' pointer: use
970 item_number_t.
971 * src/system.h (MINSHORT, MAXSHORT): Remove.
972 Include `limits.h'.
973 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
974 (shortcpy): Remove.
975 (MAXTABLE): Move to...
976 * src/output.c (MAXTABLE): here.
977 (prepare_rules): Use output_int_table to output rhs.
978 * data/bison.simple, data/bison.c++: Adjust.
979 * tests/torture.at (Big triangle): Move the limit from 254 to
980 500.
981 * tests/regression.at (Web2c Actions): Ajust.
982
983 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
984 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
985 passes, but produces negative #line number, once fixed, GCC is
986 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
987 C), it passes.
988 * src/state.h (state_h): Code input lines on ints, not shorts.
989
bb88b0fc
AD
9902002-04-08 Akim Demaille <akim@epita.fr>
991
992 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
993 and then the grammar.
994
9a636f47
AD
9952002-04-08 Akim Demaille <akim@epita.fr>
996
997 * src/system.h: No longer using strndup.
998
680e8701
AD
9992002-04-07 Akim Demaille <akim@epita.fr>
1000
1001 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1002 * src/output.c (output_table_data): Return the longest number.
1003 (prepare_tokens): Output `token_number_max').
1004 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1005 New.
1006 Use them to define yy_token_number_type/TokenNumberType.
1007 Use this type for yytranslate.
1008 * tests/torture.at (Big triangle): Push the limit from 124 to
1009 253.
1010 * tests/regression.at (Web2c Actions): Adjust.
1011
817e9f41
AD
10122002-04-07 Akim Demaille <akim@epita.fr>
1013
1014 * tests/torture.at (Big triangle): New.
1015 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1016 * tests/existing.at: here.
1017
5123689b
AD
10182002-04-07 Akim Demaille <akim@epita.fr>
1019
1020 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1021 nritems.
1022 Adjust dependencies.
1023
f3849179
AD
10242002-04-07 Akim Demaille <akim@epita.fr>
1025
1026 * src/reader.c: Normalize increments to prefix form.
1027
bd02036a
AD
10282002-04-07 Akim Demaille <akim@epita.fr>
1029
1030 * src/reader.c, symtab.c: Remove debugging code.
1031
db8837cb
AD
10322002-04-07 Akim Demaille <akim@epita.fr>
1033
1034 Rename all the `bucket's as `symbol_t'.
1035
1036 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1037 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1038 * src/symtab.c, src/symtab.h (bucket): Rename as...
1039 (symbol_t): this.
1040 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1041 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1042 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1043 (buckets_new, buckets_free, buckets_do): Rename as...
1044 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1045 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1046 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1047 (symbols_new, symbols_free, symbols_do): these.
1048
72a23c97
AD
10492002-04-07 Akim Demaille <akim@epita.fr>
1050
1051 Use lib/hash for the symbol table.
1052
1053 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1054 EOF.
1055 * src/lex.c (lex): Set the `number' member of new terminals.
1056 * src/reader.c (bucket_check_defined, bucket_make_alias)
1057 (bucket_check_alias_consistence, bucket_translation): New.
1058 (reader, grammar_free, readgram, token_translations_init)
1059 (packsymbols): Adjust.
1060 (reader): Number the predefined tokens.
1061 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1062 for predefined tokens.
1063 * src/symtab.h (bucket): Remove all the hash table related
1064 members.
1065 * src/symtab.c (symtab): Replace by...
1066 (bucket_table): this.
1067 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1068 (buckets_new, buckets_do): New.
1069
280a38c3
AD
10702002-04-07 Akim Demaille <akim@epita.fr>
1071
1072 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1073 (start_symbol, max_user_token_number, semantic_parser)
1074 (error_token_number): Initialize.
1075 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1076 Initialize.
1077 (reader): Don't.
1078 (errtoken, eoftoken, undeftoken, axiom): Extern.
1079
03b31c0c
AD
10802002-04-07 Akim Demaille <akim@epita.fr>
1081
1082 * src/gram.h (rule_s): prec and precsym are now pointers
1083 to the bucket giving the priority/associativity.
1084 Member `associativity' removed: useless.
1085 * src/reduce.c, src/conflicts.c: Adjust.
1086
8b3df748
AD
10872002-04-07 Akim Demaille <akim@epita.fr>
1088
1089 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1090 Properly escape the symbols' TAG when outputting them.
1091
e601aa1d
AD
10922002-04-07 Akim Demaille <akim@epita.fr>
1093
1094 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1095
b0299a2e
AD
10962002-04-07 Akim Demaille <akim@epita.fr>
1097
1098 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1099 (LArule): this, which is an array to rule_t*.
1100 * src/print.c, src/conflicts.c: Adjust.
1101
d7e1f00c
AD
11022002-04-07 Akim Demaille <akim@epita.fr>
1103
1104 * src/gram.h (rule_t): Rename `number' as `user_number'.
1105 `number' is a new member.
1106 Adjust dependencies.
1107 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1108
cc9305dd
AD
11092002-04-07 Akim Demaille <akim@epita.fr>
1110
1111 As a result of the previous patch, it is no longer needed
1112 to reorder ritem itself.
1113
1114 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1115
b0940840
AD
11162002-04-07 Akim Demaille <akim@epita.fr>
1117
1118 Be sure never to walk through RITEMS, but use only data related to
1119 the rules themselves. RITEMS should be banished.
1120
1121 * src/output.c (output_token_translations): Rename as...
1122 (prepare_tokens): this.
1123 In addition to `translate', prepare the muscles `tname' and
1124 `toknum', which were handled by...
1125 (output_rule_data): this.
1126 Remove, and move the remainder of its outputs into...
1127 (prepare_rules): this new routines, which also merges content from
1128 (output_gram): this.
1129 (prepare_rules): Be sure never to walk through RITEMS.
1130 (output_stos): Rename as...
1131 (prepare_stos): this.
1132 (output): Always invoke prepare_states, after all, just don't use it
1133 in the output if you don't need it.
1134
643a5994
AD
11352002-04-07 Akim Demaille <akim@epita.fr>
1136
1137 * src/LR0.c (new_state): Display `nstates' as the name of the
1138 newly created state.
1139 Adjust to initialize first_state and last_state if needed.
1140 Be sure to distinguish the initial from the final state.
1141 (new_states): Create the itemset of the initial state, and use
1142 new_state.
1143 * src/closure.c (closure): Now that the initial state has its
1144 items properly set, there is no need for a special case when
1145 creating `ruleset'.
1146
1147 As a result, now the rule 0, reducing to $axiom, is visible in the
1148 outputs. Adjust the test suite.
1149
1150 * tests/conflicts.at (Solved SR Conflicts)
1151 (Unresolved SR Conflicts): Adjust.
1152 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1153 * tests/conflicts.at (S/R in initial): New.
1154
b4c4ccc2
AD
11552002-04-07 Akim Demaille <akim@epita.fr>
1156
1157 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1158 the RHS of the rules.
1159 * src/output.c (output_gram): Likewise.
1160
bba97eb2
AD
11612002-04-07 Akim Demaille <akim@epita.fr>
1162
1163 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1164 bucket.
1165 Adjust all dependencies.
1166 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1167 `number' of the buckets too.
1168 * src/gram.h: Include `symtab.h'.
1169 (associativity): Move to...
1170 * src/symtab.h: here.
1171 No longer include `gram.h'.
1172
c3b407f4
AD
11732002-04-07 Akim Demaille <akim@epita.fr>
1174
1175 * src/gram.h, src/gram.c (rules_rhs_length): New.
1176 (ritem_longest_rhs): Use it.
1177 * src/gram.h (rule_t): `number' is a new member.
1178 * src/reader.c (packgram): Set it.
1179 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1180 the end of `rules', and count them out of `nrules'.
1181 (reduce_output, dump_grammar): Adjust.
1182 * src/print.c (print_grammar): It is no longer needed to check for
1183 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1184 * tests/reduce.at (Reduced Automaton): New test.
1185
11652ab3
AD
11862002-04-07 Akim Demaille <akim@epita.fr>
1187
1188 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1189 lacking `+ 1' to nrules, Bison reported as useless a token if it
1190 was used solely to set the precedence of the last rule...
1191
26b23c1a
AD
11922002-04-07 Akim Demaille <akim@epita.fr>
1193
1194 * data/bison.c++, data/bison.simple: Don't output the current file
1195 name in #line, to avoid useless diffs between two identical
1196 outputs under different names.
1197
18bcecb0
AD
11982002-04-07 Akim Demaille <akim@epita.fr>
1199
1200 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1201 Normalize loops to using `< nrules + 1', not `<= nrules'.
1202
fa770c86
AD
12032002-04-07 Akim Demaille <akim@epita.fr>
1204
1205 * TODO: Update.
1206
d9b739c3
AD
12072002-04-07 Akim Demaille <akim@epita.fr>
1208
1209 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1210 bucket.value as bucket.number.
1211
99013900
AD
12122002-04-07 Akim Demaille <akim@epita.fr>
1213
1214 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1215 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1216 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1217 RHS, instead of being an index in RITEMS.
1218
e966383b
PE
12192002-04-04 Paul Eggert <eggert@twinsun.com>
1220
1221 * doc/bison.texinfo: Update copyright date.
1222 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1223 (Symbols): Warn about running Bison in one character set,
1224 but compiling and/or running in an incompatible one.
1225 Warn about character code 256, too.
1226
12272002-04-03 Paul Eggert <eggert@twinsun.com>
1228
1229 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1230 YYERROR_VERBOSE is nonzero, not whether it is defined.
1231
1232 Merge changes from bison-1_29-branch.
c307773e 1233
8d6c48b9
PE
12342002-03-20 Paul Eggert <eggert@twinsun.com>
1235
1236 Merge fixes from Debian bison_1.34-1.diff.
1237
1238 * configure.in (AC_PREREQ): 2.53.
1239
e53c6322
AD
12402002-03-20 Akim Demaille <akim@epita.fr>
1241
1242 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1243
9ffbeca7
PE
12442002-03-19 Paul Eggert <eggert@twinsun.com>
1245
21db0b2a
PE
1246 * src/bison.simple (YYCOPY): New macro.
1247 (YYSTACK_RELOCATE): Use it.
1248 Remove Type arg; no longer needed. All callers changed.
1249 (yymemcpy): Remove; no longer needed.
1250
9ffbeca7
PE
1251 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1252 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1253
642cb8f8
AD
12542002-03-19 Akim Demaille <akim@epita.fr>
1255
1256 Test and fix the #line outputs.
1257
1258 * tests/atlocal.at (GCC): New.
1259 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1260 (Prologue synch line, ,%union synch line, Postprologue synch line)
1261 (Action synch line, Epilogue synch line): New tests.
1262 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1263 * data/bison.simple, data/bison.c++: Use it.
1264
3c31a486
AD
12652002-03-19 Akim Demaille <akim@epita.fr>
1266
1267 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1268 (Solved SR Conflicts, %expect not enough, %expect right)
1269 (%expect too much): Move to...
1270 * tests/conflicts.at: this new file.
1271
0d8bed56
AD
12722002-03-19 Akim Demaille <akim@epita.fr>
1273
1274 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1275 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1276 that we can move to enums for instance.
1277 * src/output.c (token_definitions_output): Output a list of
1278 `token-name, token-number' instead of the #define.
1279 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1280
9208d17f
AD
12812002-03-14 Akim Demaille <akim@epita.fr>
1282
1283 Use Gettext 0.11.1.
1284
af27eacb
RA
12852002-03-09 Robert Anisko <robert@lrde.epita.fr>
1286
1287 * data/bison.c++: Make the user able to add members to the generated
1288 parser by subclassing.
1289
9101a310
RA
12902002-03-05 Robert Anisko <robert@lrde.epita.fr>
1291
1292 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1293 a character.
1294 Reported by Nicolas Tisserand and Nicolas Burrus.
1295
fff9bf0b
RA
12962002-03-04 Robert Anisko <robert@lrde.epita.fr>
1297
1298 * src/reader.c: Warn about lacking semi-colons, do not complain.
1299
64dba31e
RA
13002002-03-04 Robert Anisko <robert@lrde.epita.fr>
1301
1302 * data/bison.c++: Remove a debug line.
1303
374f5a14
RA
13042002-03-04 Robert Anisko <robert@lrde.epita.fr>
1305
1306 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1307 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1308 provide a default implementation.
1309
bfcf1f3a
AD
13102002-03-04 Akim Demaille <akim@epita.fr>
1311
1312 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1313 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1314 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1315 * tests/semantic.at (Parsing Guards): Similarly.
1316 * src/reader.at (readgram): Complain if the last rule is not ended
1317 with a semi-colon.
1318
65ccf9fc
AD
13192002-03-04 Akim Demaille <akim@epita.fr>
1320
1321 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1322 * src/closure.c: here.
1323 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1324 RTC.
1325 * src/warshall.h, src/warshall.c: Remove.
1326 * tests/sets.at (Broken Closure): Adjust.
1327
d0039cbc
AD
13282002-03-04 Akim Demaille <akim@epita.fr>
1329
1330 * src/output.c (output_skeleton): tempdir is const.
1331 bytes_read is unused.
1332
345cea78
AD
13332002-03-04 Akim Demaille <akim@epita.fr>
1334
1335 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1336 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1337 Update.
1338 From Michael Hayes.
1339
564801f7
AD
13402002-03-04 Akim Demaille <akim@epita.fr>
1341
1342 * src/closure.c (closure): `r' is unused.
1343
e5352bc7
AD
13442002-03-04 Akim Demaille <akim@epita.fr>
1345
1346 * tests/sets.at (Broken Closure): Add the ending `;'.
1347 * src/reader.at (readgram): Complain if a rule is not ended with a
1348 semi-colon.
1349
914feea9
AD
13502002-03-04 Akim Demaille <akim@epita.fr>
1351
1352 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1353 (count_sr_conflicts): Use bitset_count.
1354 * src/reduce.c (inaccessable_symbols): Ditto.
1355 (bits_size): Remove.
1356 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1357
f0250de6
AD
13582002-03-04 Akim Demaille <akim@epita.fr>
1359
1360 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1361 * src/reduce.c: Remove the `bitset_zero's following the
1362 `bitset_create's, as now it is performed by the latter.
1363
ef017502
AD
13642002-03-04 Akim Demaille <akim@epita.fr>
1365
1366 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1367 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1368 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1369 latest sources from Michael.
1370
76514394
AD
13712002-03-04 Akim Demaille <akim@epita.fr>
1372
1373 * src/output.c (output): Don't free the grammar.
1374 * src/reader.c (grammar_free): New.
1375 * src/main.c (main): Call it and don't free symtab here.
1376
55024580
AD
13772002-03-04 Akim Demaille <akim@epita.fr>
1378
1379 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1380 before returning.
1381 Reported by Benoit Perrot.
1382
f9abaa2c
AD
13832002-03-04 Akim Demaille <akim@epita.fr>
1384
1385 Use bitset operations when possible, not loops over bits.
1386
1387 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1388 bitset_or.
1389 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1390 * src/reduce.c (useless_nonterminals): Formatting changes.
1391 * src/warshall.c (TC): Use bitset_or.
1392
0e721e75
AD
13932002-03-04 Akim Demaille <akim@epita.fr>
1394
1395 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1396 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1397 Ditto.
1398
0fb1ffb1
AD
13992002-03-04 Akim Demaille <akim@epita.fr>
1400
1401 * src/lalr.c (F): Now a bitset*.
1402 Adjust all dependencies.
1403
b86796bf
AD
14042002-03-04 Akim Demaille <akim@epita.fr>
1405
1406 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1407 Adjust all dependencies.
1408
602bbf31
AD
14092002-03-04 Akim Demaille <akim@epita.fr>
1410
1411 * src/L0.c, src/LR0.h (nstates): Be size_t.
1412 Adjust comparisons (signed vs unsigned).
1413 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1414 bitset*.
1415 Adjust all dependencies.
1416
d8a0245c
AD
14172002-03-04 Akim Demaille <akim@epita.fr>
1418
1419 * src/closure.c (firsts): Now, also a bitset.
1420 Adjust all dependencies.
1421 (varsetsize): Remove, now unused.
1422 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1423
34ba9743
AD
14242002-03-04 Akim Demaille <akim@epita.fr>
1425
1426 * src/print.c: Convert to use bitset.h, not hand coded iterations
1427 over ints.
1428
ed86e78c
AD
14292002-03-04 Akim Demaille <akim@epita.fr>
1430
1431 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1432
dfdb1797
AD
14332002-03-04 Akim Demaille <akim@epita.fr>
1434
1435 * src/closure.c (ruleset): Be a bitset.
1436 (rulesetsize): Remove.
1437
7086e707
AD
14382002-03-04 Akim Demaille <akim@epita.fr>
1439
1440 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1441 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1442 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1443 * src/closure.c (fderives): Be an array of bitsets.
1444
98254360
RA
14452002-02-28 Robert Anisko <robert@lrde.epita.fr>
1446
1447 * data/bison.c++: Merge the two generated headers. Insert a copyright
1448 notice in each output file.
1449
a75c057f
AD
14502002-02-28 Akim Demaille <akim@epita.fr>
1451
1452 * data/bison.c++: Copy the prologue of bison.simple to fetch
1453 useful M4 definitions, such as b4_header_guard.
1454
06b00abc
AD
14552002-02-25 Akim Demaille <akim@epita.fr>
1456
1457 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1458 translator friendly scheme for the bgr
1459 copyright notice.
06b00abc 1460
70e7d534
AD
14612002-02-25 Akim Demaille <akim@epita.fr>
1462
1463 * src/output.c (header_output): Remove, now handled completely via
1464 M4.
1465
abe017f6
AD
14662002-02-25 Akim Demaille <akim@epita.fr>
1467
1468 * m4/m4.m4: New, from CVS Autoconf.
1469 * configure.in: Invoke it.
1470 * src/output.c (output_skeleton): Use its result instead of the
1471 hard coded name.
1472
381fb12e
AD
14732002-02-25 Akim Demaille <akim@epita.fr>
1474
1475 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1476 Fileutils 4.1.5.
1477 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1478 * src/output.c (output_skeleton): Use mkstemp to create a real
1479 temporary file.
1480 Move the filling of `skeleton' and its muscle to...
1481 (prepare): here.
1482 (output): Move the definition of the prologue muscle to...
1483 (prepare): here.
1484 * src/system.h (DEFAULT_TMPDIR): New.
1485
6f38107f
PE
14862002-02-14 Paul Eggert <eggert@twinsun.com>
1487
1488 Remove the support for C++ namespace cleanliness; it was
1489 causing more problems than it was curing, since it didn't work
1490 properly on some nonstandard C++ compilers. This can wait
1491 for a proper C++ parser.
1492
1493 * NEWS: Document this.
1494 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1495 of C++, as it's treated like C now.
1496 * src/bison.simple (YYSTD): Remove.
1497 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1498 Treat C++ just like Standard C instead of trying to support
1499 namespace cleanliness.
1500
80cce3da
AD
15012002-02-14 Akim Demaille <akim@epita.fr>
1502
1503 * tests/regression.at (else): Adjust to Andreas' change.
1504
842e8679
AD
15052002-02-14 Akim Demaille <akim@epita.fr>
1506
1507 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1508
4bda3f10
AD
15092002-02-13 Andreas Schwab <schwab@suse.de>
1510
1511 * src/output.c (output_rule_data): Don't output NULL, it might
1512 not be defined yet.
1513
4162fa07 15142002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 1515
4162fa07
RA
1516 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1517 (Copyright notice): Update.
b418ecd8 1518
bd16a5dc
AD
15192002-02-11 Akim Demaille <akim@epita.fr>
1520
1521 * tests/regression.at (%nonassoc and eof): Don't include
1522 nonportable headers.
1523
8d69a1a3
RA
15242002-02-08 Robert Anisko <robert@lrde.epita.fr>
1525
1526 * data/bison.c++: Correct error recovery. Make the user able to
1527 initialize the starting location.
1528
9b2d0677
AD
15292002-02-07 Akim Demaille <akim@epita.fr>
1530
1531 * tests/input.at: New.
1532
69e2658b
RA
15332002-02-07 Robert Anisko <robert@lrde.epita.fr>
1534
1535 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 1536 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
1537 directives around tables only needed for debugging.
1538
4aacc3a7
RA
15392002-02-07 Robert Anisko <robert@lrde.epita.fr>
1540
1541 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1542 C++ parsers.
1543 (yy::b4_name::parse): Use print_.
1544
762a801e
RA
15452002-02-07 Robert Anisko <robert@lrde.epita.fr>
1546
1547 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1548
4bb2bc3f
RA
15492002-02-07 Robert Anisko <robert@lrde.epita.fr>
1550
1551 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1552 C++ parsers.
1553 (yy::b4_name::parse): Build verbose error messages, and use error_.
1554
6b45a3ca
RA
15552002-02-06 Robert Anisko <robert@lrde.epita.fr>
1556
1557 * data/bison.c++: Fix m4 quoting in comments.
1558
50997c6e
RA
15592002-02-06 Robert Anisko <robert@lrde.epita.fr>
1560
1561 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1562 not expanded by m4.
1563
3f3eed27
AD
15642002-02-05 Akim Demaille <akim@epita.fr>
1565
1566 * data/bison.c++: Adjust to the M4 back end.
1567 More is certainly needed.
1568
be2a1a68
AD
15692002-02-05 Akim Demaille <akim@epita.fr>
1570
1571 Give a try to M4 as a back end.
1572
1573 * lib/readpipe.c: New, from wdiff.
1574 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1575 BISON_HAIRY.
1576 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1577 specific values. Now it is m4 that performs the lookup.
1578 * src/parse-skel.y: Remove.
1579 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1580 * src/output.c (actions_output, guards_output)
1581 (token_definitions_output): No longer keeps track of the output
1582 line number, hence remove the second argument.
1583 (guards_output): Check against the guard member of a rule, not the
1584 action member.
1585 Adjust callers.
1586 (output_skeleton): Don't look for the skeleton location, let m4 do
1587 that.
1588 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1589 file will be used.
1590 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1591 (prepare): Given that for the time being changesyntax is not
1592 usable in M4, rename the muscles using `-' to `_'.
1593 Define `defines_flag', `output_parser_name' and `output_header_name'.
1594 * src/output.h (actions_output, guards_output)
1595 (token_definitions_output): Adjust prototypes.
1596 * src/scan-skel.l: Instead of scanning the skeletons, it now
1597 processes the output of m4: `__oline__' and `#output'.
1598 * data/bison.simple: Adjust to be used by M4(sugar).
1599 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1600 to date.
1601 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1602 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1603 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1604 shamelessly stolen from CVS Autoconf.
1605
beda758b
AD
16062002-02-05 Akim Demaille <akim@epita.fr>
1607
1608 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1609 * configure.in: Check for the declarations of free and malloc.
1610 * src/muscle_tab.c: Adjust.
1611
5ece6d43
AD
16122002-02-05 Akim Demaille <akim@epita.fr>
1613
1614 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1615 which have no values.
1616
5bb18f9a
AD
16172002-02-05 Akim Demaille <akim@epita.fr>
1618
1619 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1620 * data/: here.
1621
894dd62e
PE
16222002-01-29 Paul Eggert <eggert@twinsun.com>
1623
1624 * src/bison.simple (YYSIZE_T): Do not define merely because
1625 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1626 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1627
82841af7
AD
16282002-01-27 Akim Demaille <akim@epita.fr>
1629
1630 Fix `%nonassoc and eof'.
1631
1632 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1633 which were not properly copied! Replace
1634 memcpy (res->errs, src->errs, src->nerrs);
1635 with
1636 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1637 !!!
1638 * tests/regression.at (%nonassoc and eof): Adjust to newest
1639 Autotest: `.' is not in the PATH.
1640
318b76e9
AD
16412002-01-27 Akim Demaille <akim@epita.fr>
1642
1643 * tests/sets.at (AT_EXTRACT_SETS): New.
1644 (Nullable): Use it.
1645 (Firsts): New.
1646
30d2f3d5
AD
16472002-01-26 Akim Demaille <akim@epita.fr>
1648
1649 * tests/actions.at, tests/calc.at, tests/headers.at,
1650 * tests/torture.at: Adjust to the newest Autotest which no longer
1651 forces `.' in the PATH.
1652
30f8c395
AD
16532002-01-25 Akim Demaille <akim@epita.fr>
1654
1655 * tests/regression.at (%nonassoc and eof): New.
1656 Suggested by Robert Anisko.
1657
29ae55f1
AD
16582002-01-24 Akim Demaille <akim@epita.fr>
1659
1660 Bison dumps core when trying to complain about broken input files.
1661 Reported by Cris van Pelt.
1662
1663 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
1664 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
1665 into...
1666 (Invalid inputs): Strengthen: exercise parse_percent_token.
1667
2b548aa6
RA
16682002-01-24 Robert Anisko <robert.anisko@epita.fr>
1669
1670 * src/Makefile.am: Add bison.c++.
1671 * src/bison.c++: New skeleton.
1672
bb0146c2
AD
16732002-01-21 Paolo Bonzini <bonzini@gnu.org>
1674
1675 * po/it.po: New.
1676
bec30531
AD
16772002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
1678
1679 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
1680
fc6edc45
MA
16812002-01-20 Marc Autret <marc@gnu.org>
1682
1683 * src/files.c (compute_output_file_names): Fix
1684
5e5d5415
MA
16852002-01-20 Marc Autret <marc@gnu.org>
1686
1687 * tests/output.at: New test.
1688 * src/files.c (compute_base_names): Don't map extensions when
1689 the YACC flag is set, use defaults.
1690 Reported by Evgeny Stambulchik.
1691
44ea3fbd
MA
16922002-01-20 Marc Autret <marc@gnu.org>
1693
bb0146c2 1694 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
1695 compilers as well (i.e. the vendor C compiler).
1696 Suggested by Albert Chin-A-Young.
1697
338963d1
TVH
16982002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
1699
1700 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
1701 canonical definition.
1702 * src/system.h: Use the canonical definition for PARAMS (avoids
1703 a conflict with the macro from lib/hash.h).
1704
c57b2479
AD
17052002-01-11 Akim Demaille <akim@epita.fr>
1706
1707 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 1708 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 1709
b85810ae
AD
17102002-01-09 Akim Demaille <akim@epita.fr>
1711
1712 * src/files.c, src/files.h (output_infix): New.
1713 (tab_extension): Remove.
1714 (compute_base_names): Compute the former, drop the latter.
1715 * src/output.c (prepare): Insert the muscles `output-infix', and
1716 `output-suffix'.
1717 * src/parse-skel.y (string, string.1): New.
1718 (section.header): Use it.
1719 (section.yacc): Remove.
1720 (prefix): Remove too.
1721 * src/scan-skel.l: Adjust.
1722 * src/bison.simple, src/bison.hairy: Adjust.
1723
cae60122
AD
17242002-01-09 Akim Demaille <akim@epita.fr>
1725
1726 * configure.in (WERROR_CFLAGS): Compute it.
1727 * src/Makefile.am (CFLAGS): Pass it.
1728 * tests/atlocal.in (CFLAGS): Idem.
1729 * src/files.c: Fix a few warnings.
1730 (get_extension_index): Remove, unused.
1731
ae404801
AD
17322002-01-08 Akim Demaille <akim@epita.fr>
1733
1734 * src/getargs.c (AS_FILE_NAME): New.
1735 (getargs): Use it to convert DOSish file names.
1736 * src/files.c (base_name): Rename as full_base_name to avoid
1737 clashes with `base_name ()'.
1738 (filename_split): New.
1739 (compute_base_names): N-th rewrite, using filename_split.
1740
22312b71
AD
17412002-01-08 Akim Demaille <akim@epita.fr>
1742
1743 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
1744 New, stolen from the Fileutils 4.1.
1745 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
1746 * configure.in: Check for the presence of memrchr, and of its
1747 prototype.
1748
a67cef01
TVH
17492002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
1750
1751 * lib/hash.h (__P): Added definition for this macro.
1752 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
1753 BUILT_SOURCES, to ensure they are generated first.
1754 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
1755 %error-verbose to allow bootstrapping with bison 1.30x.
1756
2b25d624
AD
17572002-01-06 Akim Demaille <akim@epita.fr>
1758
1759 * src/reader.c (parse_braces): Don't fetch the next char, the
1760 convention is to fetch on entry.
1761 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
1762 'switch' without a following semicolon.
1763 * tests/regression.at (braces parsing): New.
1764
3460813b
AD
17652002-01-06 Akim Demaille <akim@epita.fr>
1766
1767 Bison is dead wrong in its RR conflict reports.
1768
1769 * tests/torture.at (GNU Cim Grammar): New.
1770 * src/conflicts.c (count_rr_conflicts): Fix.
1771
73784c64
AD
17722002-01-06 Akim Demaille <akim@epita.fr>
1773
1774 Creating package.m4 from configure.ac causes too many problems.
1775
1776 * tests/Makefile.am (package.m4): Create it by hand,
1777 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
1778
25d81090
AD
17792002-01-06 Akim Demaille <akim@epita.fr>
1780
1781 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
1782 skeleton.h.
1783
a9b8959e
PE
17842002-01-04 Paul Eggert <eggert@twinsun.com>
1785
1786 * doc/bison.texinfo (Debugging):
1787 Remove YYSTDERR; it's no longer defined or used.
1788 Also, s/cstdio.h/cstdio/.
1789
25d81090
AD
17902002-01-03 Akim Demaille <akim@epita.fr>
1791
1792 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
1793
1109455c
AD
17942002-01-03 Akim Demaille <akim@epita.fr>
1795
1796 * src/parse-skel.y (process_skeleton): Don't bind the parser's
1797 tracing code to --trace, wait for a better --trace option, with
1798 args.
1799
7ea5e977
AD
18002002-01-03 Akim Demaille <akim@epita.fr>
1801
1802 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
1803 The ISO C++ standard is extremely clear about it: stderr is
1804 considered a macro, not a regular symbol (see table 94 `Header
1805 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
1806 Therefore std:: does not apply to it. It still does with fprintf.
1807 Also, s/cstdio.h/cstdio/.
1808
fab5b110
AD
18092002-01-03 Akim Demaille <akim@epita.fr>
1810
1811 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
1812 for non system headers.
1813
aed7fd9b
AD
18142002-01-02 Akim Demaille <akim@epita.fr>
1815
1816 Equip the skeleton chain with location tracking, runtime trace,
1817 pure parser and scanner.
1818
1819 * src/parse-skel.y: Request a pure parser, locations, and prefix
1820 renaming.
1821 (%union): Having several members with the same type does not help
1822 type mismatches, simplify.
1823 (YYPRINT, yyprint): New.
1824 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
1825 (skel_error): this.
1826 Handle locations.
1827 * src/scan-skel.l: Adjust to these changes.
1828 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
1829 (LOCATION_PRINT, skel_control_t): New.
1830
24fad99e
AD
18312001-12-30 Akim Demaille <akim@epita.fr>
1832
1833 * src/parse-skel.y: Get rid of the shift/reduce conflict:
1834 replace `gb' with BLANKS.
1835 * src/scan-skel.l: Adjust.
1836
a4b36db4
AD
18372001-12-30 Akim Demaille <akim@epita.fr>
1838
1839 * src/system.h: We don't need nor want bcopy.
1840 Throw away MS-DOS crap: we don't need getpid.
1841 * configure.in: We don't need strndup. It was even causing
1842 problems: because Flex includes the headers *before* us,
1843 _GNU_SOURCE is not defined by config.h, and therefore strndup was
1844 not visible.
1845 * lib/xstrndup.c: New.
1846 * src/scan-skel.l: Use it.
1847 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
1848 * src/parse-skel.y: Use %directives instead of #defines.
1849
1239777d
AD
18502001-12-30 Akim Demaille <akim@epita.fr>
1851
1852 * src/skeleton.h: New.
1853 * src/output.c (output_parser, output_master_parser): Remove, dead
1854 code.
1855 * src/output.h (get_lines_number, actions_output, guards_output)
1856 (token_definitions_output): Prototype them.
1857 * src/parse-skel.y: Add the license notice.
1858 Include output.h and skeleton.h.
1859 (process_skeleton): Returns void, and takes a single parameter.
1860 * src/scan-skel.l: Add the license notice.
1861 Include skeleton.h.
1862 Don't use %option yylineno: it seems that then Flex imagines
1863 REJECT has been used, and therefore it won't reallocate its
1864 buffers (which makes no other sense to me than a bug). It results
1865 in warnings for `unused: yy_flex_realloc'.
1866
9b3add5b
RA
18672001-12-30 Robert Anisko <robert.anisko@epita.fr>
1868
1869 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1870 (MUSCLE_INSERT_PREFIX): ...to there.
1871 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
1872 (MUSCLE_INSERT_PREFIX): Move from here...
1873
1874 * src/bison.hairy: Add a section directive. Put braces around muscle
1875 names. This parser skeleton is still broken, but Bison should not
1876 choke on a bad muscle 'syntax'.
1877 * src/bison.simple: Add a section directive. Put braces around muscle
1878 names.
1879
1880 * src/files.h (strsuffix, stringappend): Add declarations.
1881 (tab_extension): Add declaration.
1882 (short_base_name): Add declaration.
1883
1884 * src/files.c (strsuffix, stringappend): No longer static. These
1885 functions are used in the skeleton parser.
1886 (tab_extension): New.
1887 (compute_base_names): Use the computations done in this function
fab5b110 1888 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
1889 names.
1890 (short_base_name): No longer static.
1891
1892 * src/output.c (output_skeleton): New.
1893 (output): Disable call to output_master_parser, and give a try to
1894 a new skeleton handling system.
1895 (guards_output, actions_output): No longer static.
1896 (token_definitions_output, get_lines_number): No longer static.
1897
1898 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
1899
fab5b110 1900 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
1901 parse-skel.y.
1902
1903 * src/parse-skel.y: New file.
1904 * src/scan-skel.l: New file.
1905
b5b61c61
AD
19062001-12-29 Akim Demaille <akim@epita.fr>
1907
1908 %name-prefix is broken.
1909
1910 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
1911 Adjust all dependencies.
1912 * tests/headers.at (export YYLTYPE): Strengthen this test: use
1913 %name-prefix.
1914
1915 Renaming yylval but not yylloc is not consistent. Now we do.
1916
1917 * src/bison.simple: Prefix yylloc if used.
1918 * doc/bison.texinfo (Decl Summary): Document that.
1919
8c9a50be
AD
19202001-12-29 Akim Demaille <akim@epita.fr>
1921
1922 * doc/bison.texinfo: Promote `%long-directive' over
1923 `%long_directive'.
1924 Remove all references to fixed-output-files, yacc is enough.
1925
d99361e6
AD
19262001-12-29 Akim Demaille <akim@epita.fr>
1927
1928 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
1929 user prologue. These are defaults.
1930 * tests/actions.at (Mid-rule actions): Make sure the user can
1931 define YYDEBUG and YYERROR_VERBOSE.
1932
b9cecb91
AD
19332001-12-29 Akim Demaille <akim@epita.fr>
1934
1935 * src/output.c (header_output): Don't forget to export YYLTYPE and
1936 yylloc.
1937 * tests/headers.at (export YYLTYPE): New, make sure it does.
1938 * tests/regression.at (%union and --defines, Invalid CPP headers):
1939 Move to...
1940 * tests/headers.at: here.
1941
aea13e97
AD
19422001-12-29 Akim Demaille <akim@epita.fr>
1943
1944 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
1945
931394cb
AD
19462001-12-29 Akim Demaille <akim@epita.fr>
1947
1948 * tests/actions.at (Mid-rule actions): Output on a single line
1949 instead of several.
1950
704a47c4
AD
19512001-12-29 Akim Demaille <akim@epita.fr>
1952
1953 * doc/bison.texinfo: Formatting changes.
1954
091e20bb
AD
19552001-12-29 Akim Demaille <akim@epita.fr>
1956
1957 Don't store the token defs in a muscle, just be ready to output it
1958 on command. Now possible via `symbols'. Fixes a memory leak.
1959
1960 * src/output.c (token_definitions_output): New.
1961 (output_parser, header_output): Use it.
1962 * src/reader.c (symbols_save): Remove.
1963
cce71710
AD
19642001-12-29 Akim Demaille <akim@epita.fr>
1965
1966 * src/bison.simple: Do not provide a default for YYSTYPE and
1967 YYLTYPE before the user's prologue. Otherwise it's hardly... a
1968 default.
1969
82c035a8
AD
19702001-12-29 Akim Demaille <akim@epita.fr>
1971
1972 Mid-rule actions are simply... ignored!
1973
1974 * src/reader.c (readgram): Be sure to attach mid-rule actions to
1975 the empty-rule associated to the dummy symbol, not to the host
1976 rule.
1977 * tests/actions.at (Mid-rule actions): New.
1978
8419d367
AD
19792001-12-29 Akim Demaille <akim@epita.fr>
1980
1981 Memory leak.
1982
1983 * src/reader.c (reader): Free grammar.
1984
375d5806
AD
19852001-12-29 Akim Demaille <akim@epita.fr>
1986
1987 Memory leak.
1988
1989 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
1990 since it allocates it for each state, although only one is needed.
1991 (allocate_storage): Do it here.
1992
f51cb8ff
AD
19932001-12-29 Akim Demaille <akim@epita.fr>
1994
1995 * src/options.h, src/options.c (create_long_option_table): Rename
1996 as...
1997 (long_option_table_new): this, with a clearer prototype.
1998 (percent_table): Remove, unused,
1999 * src/getargs.c (getargs): Adjust.
2000
29e88316
AD
20012001-12-29 Akim Demaille <akim@epita.fr>
2002
2003 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2004 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2005 as states.
2006
b9f71f19
AD
20072001-12-29 Akim Demaille <akim@epita.fr>
2008
2009 * src/lalr.c (build_relations): Rename `states' as `states1'.
2010 Sorry, I don't understand exactly what it is, no better name...
2011
1a2b5d37
AD
20122001-12-29 Akim Demaille <akim@epita.fr>
2013
2014 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2015 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2016 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2017 as rules.
2018
1cca533e
AD
20192001-12-29 Akim Demaille <akim@epita.fr>
2020
2021 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2022 ago.
2023
c03ae966
AD
20242001-12-29 Akim Demaille <akim@epita.fr>
2025
2026 * src/reader.c, src/reader.h (user_toknums): Remove.
2027 Adjust all users to use symbols[i]->user_token_number.
2028
5a670b1e
AD
20292001-12-29 Akim Demaille <akim@epita.fr>
2030
2031 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2032 Adjust all users to use symbols[i]->prec or ->assoc.
2033
ad949da9
AD
20342001-12-29 Akim Demaille <akim@epita.fr>
2035
2036 * src/reader.c, src/reader.h (tags): Remove.
2037 Adjust all users to use symbols[i]->tag.
2038
0e78e603
AD
20392001-12-29 Akim Demaille <akim@epita.fr>
2040
2041 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2042 and rule_table.
2043 * src/reader.c (packsymbols): Fill this table.
2044 Drop sprec.
2045 * src/conflicts.c (resolve_sr_conflict): Adjust.
2046 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2047 single table.
2048 Use symbols[i]->tag instead of tags[i].
2049
213e640e
AD
20502001-12-29 Akim Demaille <akim@epita.fr>
2051
2052 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2053 In addition, put a comment in there, to replace...
2054 * tests/regression.at (%union and C comments): Remove.
2055
e7b8bef1
AD
20562001-12-29 Akim Demaille <akim@epita.fr>
2057
2058 * tests/regression.at (Web2c Actions): Blindly move the actual
2059 output as expected output. The contents *seem* right to me, but I
2060 can't pretend reading perfectly parser tables... Nonetheless, all
2061 the other tests pass correctly, the table look OK, even though the
2062 presence of `$axiom' is to be noted: AFAICS it is useless (but
2063 harmless).
2064
b68e7744
AD
20652001-12-29 Akim Demaille <akim@epita.fr>
2066
2067 * src/reader.c (readgram): Don't add the rule 0 if there were no
2068 rules read. In other words, add it _after_ having performed
2069 grammar sanity checks.
2070 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2071
78d5bae9
AD
20722001-12-29 Akim Demaille <akim@epita.fr>
2073
2074 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2075 visible, and some states have now a different number.
2076
ff442794
AD
20772001-12-29 Akim Demaille <akim@epita.fr>
2078
2079 * src/reader.c (readgram): Bind the initial rule's lineno to that
2080 of the first rule.
2081 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2082 (Solved SR Conflicts): Adjust rule 0's line number.
2083
610ab194
AD
20842001-12-29 Akim Demaille <akim@epita.fr>
2085
2086 Fix the `GAWK Grammar' failure.
2087
2088 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2089 the reductions of the first state which was mistakenly confused
2090 with the final state because precisely final_state was initialized
2091 to 0.
2092 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2093 now noticed by Bison.
2094 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2095 have a reduction on $default.
2096
29d29c8f
AD
20972001-12-29 Akim Demaille <akim@epita.fr>
2098
2099 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2100 rule line numbers.
2101 * src/closure.c (print_closure): Likewise.
2102 * src/derives.c (print_derives): Likewise.
2103 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2104 now.
2105
7c6b64d0
AD
21062001-12-29 Akim Demaille <akim@epita.fr>
2107
2108 * src/lalr.c (lookaheads_print): New.
2109 (lalr): Call it when --trace-flag.
2110 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2111 are dumped.
2112
3d4daee3
AD
21132001-12-29 Akim Demaille <akim@epita.fr>
2114
2115 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2116 when walking through ritem, even via rule->rhs.
2117 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2118 (useful_production, useless_nonterminals): Likewise.
2119 (reduce_grammar_tables): Likewise, plus update nritems.
2120 * src/nullable.c (set_nullable): Likewise.
2121 * src/lalr.c (build_relations): Likewise.
2122 * tests/sets.at (Nullable): Adjust.
2123 Fortunately, now, the $axiom is no longer nullable.
2124
9e7f6bbd
AD
21252001-12-29 Akim Demaille <akim@epita.fr>
2126
2127 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2128 the 0-sentinel.
2129 * src/gram.c (ritem_longest_rhs): Likewise.
2130 * src/reduce.c (nonterminals_reduce): Likewise.
2131 * src/print_graph.c (print_graph): Likewise.
2132 * src/output.c (output_rule_data): Likewise.
2133 * src/nullable.c (set_nullable): Likewise.
2134
255ef638
AD
21352001-12-29 Akim Demaille <akim@epita.fr>
2136
2137 * src/output.c: Comment changes.
2138
0d8a7363
AD
21392001-12-27 Paul Eggert <eggert@twinsun.com>
2140
2141 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2142 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2143 Sparc, as they were causing more porting problems than the
2144 (minor) performance improvement was worth.
2145
2146 Also, catch up with 1.31's YYSTD.
2147
3db472b9
AD
21482001-12-27 Akim Demaille <akim@epita.fr>
2149
2150 * src/output.c (output_gram): Rely on nritems, not the
2151 0-sentinel. See below.
2152 Use -1 as separator, not 0.
2153 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2154 Rely on -1 as separator in yyrhs, instead of 0.
2155 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2156 twice `Now at end of input', therefore there are two lines less to
2157 expect.
2158
b365aa05
AD
21592001-12-27 Akim Demaille <akim@epita.fr>
2160
2161 * tests/regression.at (Unresolved SR Conflicts):
2162 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2163 below.
2164
30171f79
AD
21652001-12-27 Akim Demaille <akim@epita.fr>
2166
2167 * src/LR0.c (new_state): Recognize the final state by the fact it
2168 is reached by eoftoken.
2169 (insert_start_shifting_state, insert_eof_shifting_state)
2170 (insert_accepting_state, augment_automaton): Remove, since now
2171 these states are automatically computed from the initial state.
2172 (generate_states): Adjust.
2173 * src/print.c: When reporting a rule number to the user, substract
2174 1, so that the axiom rule is rule 0, and the first user rule is 1.
2175 * src/reduce.c: Likewise.
2176 * src/print_graph.c (print_core): For the time being, just as for
2177 the report, depend upon --trace-flags to dump the full set of
2178 items.
2179 * src/reader.c (readgram): Once the grammar read, insert the rule
2180 0: `$axiom: START-SYMBOL $'.
2181 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2182 number of the states has changed (the final state is no longer
2183 necessarily the last), catch up.
2184
75142d45
AD
21852001-12-27 Akim Demaille <akim@epita.fr>
2186
2187 Try to make the use of the eoftoken valid. Given that its value
2188 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2189 is used instead of > 0 where appropriate, (ii), depend upon nritems
2190 instead of the 0-sentinel.
2191
2192 * src/gram.h, src/gram.c (nritems): New.
2193 Expected to be duplication of nitems, but for the time being...
2194 * src/reader.c (packgram): Assert nritems and nitems are equal.
2195 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2196 * src/closure.c (print_closure, print_fderives): Likewise.
2197 * src/gram.c (ritem_print): Likewise.
2198 * src/print.c (print_core, print_grammar): Likewise.
2199 * src/print_graph.c: Likewise.
2200
b7c49edf
AD
22012001-12-27 Akim Demaille <akim@epita.fr>
2202
2203 * src/main.c (main): If there are complains after grammar
2204 reductions, then output the report anyway if requested, then die.
2205 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2206 * src/reader.c (eoftoken): New.
2207 (parse_token_decl): If the token being defined has value `0', it
2208 is the eoftoken.
2209 (packsymbols): No longer hack `tags' to insert `$' by hand.
2210 Be sure to preserve the value of the eoftoken.
2211 (reader): Make sure eoftoken is defined.
2212 Initialize nsyms to 0: now eoftoken is created just like the others.
2213 * src/print.c (print_grammar): Don't special case the eof token.
2214 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2215 lie anyway, albeit pleasant.
2216 * tests/calc.at: Exercise error messages with eoftoken.
2217 Change the grammar so that empty input is invalid.
2218 Adjust expectations.
2219 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2220
ec2da99f
AD
22212001-12-27 Akim Demaille <akim@epita.fr>
2222
2223 * configure.in: Check the protos of strchr ans strspn.
2224 Replace strchr if needed.
2225 * src/system.h: Provide the protos of strchr, strspn and memchr if
2226 missing.
2227 * lib/strchr.c: New.
2228 * src/reader.c (symbols_save): Use strchr.
2229
8adfa272
AD
22302001-12-27 Akim Demaille <akim@epita.fr>
2231
2232 * src/print.c, src/print_graph.c (escape): New.
2233 Use it to quote the TAGS outputs.
2234 * src/print_graph.c (print_state): Now errors are in red, and
2235 reductions in green.
2236 Prefer high to wide: output the state number on a line of its own.
2237
80dac38c
AD
22382001-12-27 Akim Demaille <akim@epita.fr>
2239
2240 * src/state.h, src/state.c (reductions_new): New.
2241 * src/LR0.c (set_state_table): Let all the states have a
2242 `reductions', even if reduced to 0.
2243 (save_reductions): Adjust.
2244 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2245 * src/print.c (print_reductions, print_actions): Adjust.
2246 * src/output.c (action_row): Adjust.
2247
2cec70b9
AD
22482001-12-27 Akim Demaille <akim@epita.fr>
2249
2250 * src/state.h, src/state.c (errs_new, errs_dup): New.
2251 * src/LR0.c (set_state_table): Let all the states have an errs,
2252 even if reduced to 0.
2253 * src/print.c (print_errs, print_reductions): Adjust.
2254 * src/output.c (output_actions, action_row): Adjust.
2255 * src/conflicts.c (resolve_sr_conflict): Adjust.
2256
13ca549a
AD
22572001-12-27 Akim Demaille <akim@epita.fr>
2258
2259 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2260
5092aba5
AD
22612001-12-27 Akim Demaille <akim@epita.fr>
2262
2263 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2264 * src/print.c: here.
2265 (lookaheadset, shiftset): New, used as additional storage by
2266 print_reductions.
2267 (print_results): Adjust.
2268 (print_shifts, print_gotos, print_errs): New, extracted from...
2269 (print_actions): here.
2270 * src/print_graph.c (print_actions): Remove dead code.
2271
11e2beca
AD
22722001-12-27 Akim Demaille <akim@epita.fr>
2273
2274 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2275 `$n' and `@n'.
2276
dac3c910
AD
22772001-12-27 Akim Demaille <akim@epita.fr>
2278
2279 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2280 (build_relations): Adjust.
2281
d0b0fefa
AD
22822001-12-27 Akim Demaille <akim@epita.fr>
2283
2284 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2285 duplication.
2286
adc8c848
AD
22872001-12-27 Akim Demaille <akim@epita.fr>
2288
2289 * src/reader.c (packgram): Catch nitems overflows.
2290
14d293ac
AD
22912001-12-27 Akim Demaille <akim@epita.fr>
2292
2293 * src/files.c, src/files.h (guard_obstack): Remove.
2294 * src/output.c (output): Adjust.
2295 * src/reader.c (parse_braces): New, factoring...
2296 (copy_action, copy_guard): these two which are renamed as...
2297 (parse_action, parse_guard): these.
2298 As a voluntary consequence, using braces around guards is now
2299 mandatory.
2300
f499b062
AD
23012001-12-27 Akim Demaille <akim@epita.fr>
2302
2303 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2304 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2305 members.
2306 (symbol_list_new): Adjust.
2307 (copy_action): action_line is the first line, not the last.
2308 (copy_guard): Just as for actions, store the `action' only, not
2309 the switch/case/break flesh.
2310 Don't parse the user action that might follow the guard, let...
2311 (readgram): do it, i.e., now, there can be an action after a
2312 guard.
2313 In other words the guard is just explicitly optional.
2314 (packgram): Adjust.
2315 * src/output.c (guards_output): New.
2316 (output_parser): Call it when needed.
2317 (output): Also free the guard and attrs obstacks.
2318 * src/files.c, src/files.h (obstack_save): Remove.
2319 (output_files): Remove.
2320 As a result, if one needs the former `.act' file, using an
2321 appropriate skeleton which requires actions and guards is now
2322 required.
2323 * src/main.c (main): Adjust.
2324 * tests/semantic.at: New.
2325 * tests/regression.at: Use `input.y' as input file name.
2326 Avoid 8+3 problems by requiring input.c when the test needs the
2327 parser.
2328
d945f5cd
AD
23292001-12-27 Akim Demaille <akim@epita.fr>
2330
2331 * src/reader.c (symbol_list_new): Be sure to initialize all the
2332 fields.
2333
d200e455
AD
23342001-12-27 Akim Demaille <akim@epita.fr>
2335
2336 All the hacks using a final pseudo state are now useless.
2337
2338 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2339 * src/lalr.c (nLA): New.
2340 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2341 instead of lookaheadsp from the pseudo state (nstate + 1).
2342
f9507c28
AD
23432001-12-27 Akim Demaille <akim@epita.fr>
2344
2345 * src/output.c (action_row, token_actions): Use a state_t instead
2346 of a integer, and nlookaheads instead of the following state's
2347 lookaheadsp.
2348
065fbd27
AD
23492001-12-27 Akim Demaille <akim@epita.fr>
2350
2351 * src/conflicts.c (log_resolution, flush_shift)
2352 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2353 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2354 (conflicts_print, print_reductions): Use a state_t instead of an
2355 integer when referring to a state.
2356 As much as possible, depend upon nlookaheads, instead of the
2357 `lookaheadsp' member of the following state (since lookaheads of
2358 successive states are successive, the difference between state n + 1
2359 and n served as the number of lookaheads for state n).
2360 * src/lalr.c (add_lookback_edge): Likewise.
2361 * src/print.c (print_core, print_actions, print_state)
2362 (print_results): Likewise.
2363 * src/print_graph.c (print_core, print_actions, print_state)
2364 (print_graph): Likewise.
2365 * src/conflicts.h: Adjust.
2366
1b177bd7
AD
23672001-12-27 Akim Demaille <akim@epita.fr>
2368
2369 * src/bison.hairy: Formatting/comment changes.
2370 ANSIfy.
2371 Remove `register' indications.
2372 Add plenty of `static'.
2373
7742ddeb
AD
23742001-12-27 Akim Demaille <akim@epita.fr>
2375
2376 * src/output.c (prepare): Drop the muscle `ntbase' which
2377 duplicates ntokens.
2378 * src/bison.simple: Formatting/comment changes.
2379 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2380 is an undocumented synonym.
2381
1fa14068
AD
23822001-12-22 Akim Demaille <akim@epita.fr>
2383
2384 * src/output.c (output_table_data): Change the prototype to use
2385 `int' for array ranges: some invocations do pass an int, not a
2386 short.
2387 Reported by Wayne Green.
2388
b9752825
AD
23892001-12-22 Akim Demaille <akim@epita.fr>
2390
2391 Some actions of web2c.y are improperly triggered.
2392 Reported by Mike Castle.
2393
2394 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2395 * tests/regression.at (Web2c): Rename as...
2396 (Web2c Report): this.
2397 (Web2c Actions): New.
2398
776209d6
AD
23992001-12-22 Akim Demaille <akim@epita.fr>
2400
2401 Reductions in web2c.y are improperly reported.
2402 Reported by Mike Castle.
2403
2404 * src/conflicts.c (print_reductions): Fix.
2405 * tests/regression.at (Web2c): New.
2406
275fc3ad
AD
24072001-12-18 Akim Demaille <akim@epita.fr>
2408
2409 Some host fail on `assert (!"foo")', which expands to
2410 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2411 Reported by Nelson Beebee.
2412
2413 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2414 `#define it_succeeded 0' and `assert (it_succeeded)'.
2415
897668ee
MA
24162001-12-17 Marc Autret <autret_m@epita.fr>
2417
2418 * src/bison.simple: Don't hard code the skeleton line and filename.
2419 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2420 New line counter 'skeleton_line' (skeleton-line muscle).
2421
ab3399e0
PE
24222001-12-17 Paul Eggert <eggert@twinsun.com>
2423
2424 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2425 YYDEBUG must be defined to a nonzero value.
2426
2427 * src/bison.simple (yytname): Do not assume that the user defines
2428 YYDEBUG to a properly parenthesized expression.
2429
3877f72b
AD
24302001-12-17 Akim Demaille <akim@epita.fr>
2431
2432 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2433 nlookaheads is a new member.
2434 Adjust all users.
2435 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2436 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2437 state.
776209d6 2438
331dbc1b
AD
24392001-12-17 Akim Demaille <akim@epita.fr>
2440
2441 * src/files.h, src/files.c (open_files, close_files): Remove.
2442 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2443 let...
2444 * src/reader.c (reader): Do it.
776209d6 2445
be750e4c
AD
24462001-12-17 Akim Demaille <akim@epita.fr>
2447
2448 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2449
709ae8c6
AD
24502001-12-17 Akim Demaille <akim@epita.fr>
2451
2452 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2453 (flush_reduce): New.
2454 (resolve_sr_conflict): Adjust.
776209d6 2455
f87685c3
AD
24562001-12-17 Akim Demaille <akim@epita.fr>
2457
2458 * src/output.c (output_obstack): Be static and rename as...
2459 (format_obstack): this, to avoid any confusion with files.c's
2460 output_obstack.
2461 * src/reader.h (muscle_obstack): Move to...
2462 * src/output.h: here, since it's defined in output.c.
2463
837491d8
AD
24642001-12-17 Akim Demaille <akim@epita.fr>
2465
2466 * src/output.c (action_row, save_column, default_goto)
2467 (sort_actions, matching_state, pack_vector): Better variable
2468 locality.
2469
796d61fb
AD
24702001-12-17 Akim Demaille <akim@epita.fr>
2471
2472 * src/output.c: Various formatting changes.
776209d6 2473
64d15509
AD
24742001-12-17 Akim Demaille <akim@epita.fr>
2475
2476 * src/files.c (output_files): Free the output_obstack.
2477 * src/main.c (main): Call print and print_graph conditionally.
2478 * src/print.c (print): Work unconditionally.
2479 * src/print_graph.c (print_graph): Work unconditionally.
2480 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2481
fbc8ecb7
MA
24822001-12-16 Marc Autret <autret_m@epita.fr>
2483
2484 * src/output.c (actions_output): Fix. When we use %no-lines,
2485 there is one less line per action.
2486
f0440388
MA
24872001-12-16 Marc Autret <autret_m@epita.fr>
2488
2489 * src/bison.simple: Remove a useless #line directive.
2490 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2491 * src/output.c (get_lines_number): New.
776209d6 2492 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2493 output muscles.
2494 Fix line numbering.
2495 (actions_output): Computes the number of lines taken by actions.
2496 (output_master_parser): Insert new skeleton which is the name of
2497 the output parser file name.
2498
a79986b8
MA
24992001-12-15 Marc Autret <autret_m@epita.fr>
2500
2501 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2502
4ec8e00f
MA
25032001-12-15 Marc Autret <autret_m@epita.fr>
2504
2505 * src/output.c (output_gram): Keep track of the hairy one.
2506
1a4648ff
AD
25072001-12-15 Akim Demaille <akim@epita.fr>
2508
2509 Make `make distcheck' work.
2510
2511 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2512 system.h which uses libgettext.h.
2513
9c2c67e6
AD
25142001-12-15 Akim Demaille <akim@epita.fr>
2515
2516 * src/nullable.c (set_nullable): Useless rules must be skipped,
2517 otherwise, since we range over their symbols, we might look at a
2518 nonterminal which no longer ``exists'', i.e., it is not counted in
2519 `nvars', hence we overflow our arrays.
2520
93ede233
AD
25212001-12-15 Akim Demaille <akim@epita.fr>
2522
2523 The header can also be produced directly, without any obstack!
2524 Yahoo!
2525
2526 * src/files.c, src/files.h (defines_obstack): Remove.
2527 (compute_header_macro): Global.
2528 (defines_obstack_save): Remove.
2529 * src/reader.c (parse_union_decl): No longer output to
2530 defines_obstack: its content can be found in the `stype' muscle
2531 anyway.
2532 (output_token_translations): Merge into...
2533 (symbols_output): this.
2534 Rename as...
2535 (symbols_save): this.
2536 (reader): Adjust.
2537 * src/output.c (header_output): New.
2538 (output): Call it.
2539
2666f928
AD
25402001-12-15 Akim Demaille <akim@epita.fr>
2541
2542 * src/reader.c (parse_union_decl): Instead of handling two obstack
2543 simultaneously, use one to define the `stype' muscle, and use the
2544 value of the latter to fill defines_obstack.
2545 (copy_comment): Remove.
2546 (copy_comment2): Work for a single obstack.
2547 Rename as...
2548 (copy_comment): this.
2549
428046f8
AD
25502001-12-15 Akim Demaille <akim@epita.fr>
2551
2552 * src/lex.c, src/lex.h (xgetc): No longer static.
2553 * src/reader.c (parse_union_decl): Revamp.
2554
ea52d706
AD
25552001-12-15 Akim Demaille <akim@epita.fr>
2556
2557 Still making progress in separating Bison into (i) input, (ii)
2558 process, (iii) output: now we can directly output the parser file
2559 without using table_obstack at all.
2560
2561 * src/files.c, src/files.h (table_obstack): Bye bye.
2562 (parser_file_name): New.
2563 * src/files.c (compute_output_file_names): Compute it.
2564 * src/output.c (actions_output, output_parser)
2565 (output_master_parser): To a file instead of an obstack.
2566
3f96f4dc
AD
25672001-12-15 Akim Demaille <akim@epita.fr>
2568
2569 Attach actions to rules, instead of pre-outputting them to
2570 actions_obstack.
2571
2572 * src/gram.h (rule_t): action and action_line are new members.
2573 * src/reader.c (symbol_list): Likewise.
2574 (copy_action): Save the actions within the rule.
2575 (packgram): Save them in rule_table.
2576 * src/output.c (actions_output): New.
2577 (output_parser): Use it on `%%actions'.
2578 (output_rule_data): Don't free rule_table.
2579 (output): Do it.
2580 (prepare): Don't save the `action' muscle.
2581 * src/bison.simple: s/%%action/%%actions/.
2582
51576fb3
AD
25832001-12-15 Akim Demaille <akim@epita.fr>
2584
2585 * src/reader.c (copy_action): When --yacc, don't append a `;'
2586 to the user action: let it fail if lacking.
dee049eb 2587 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 2588
2648a72d
AD
25892001-12-14 Akim Demaille <akim@epita.fr>
2590
2591 * src/lex.c (literalchar): Simply return the char you decoded, non
2592 longer mess around with obstacks and int pointers.
2593 Adjust all callers.
2594
92790e5b
AD
25952001-12-14 Akim Demaille <akim@epita.fr>
2596
2597 * src/lex.c (literalchar): Don't escape the special characters,
2598 just decode them, and keep them as char (before, eol was output as
2599 the 2 char string `\n' etc.).
2600 * src/output.c (output_rule_data): Use quotearg to output the
2601 token strings.
2602
927c1557
PE
26032001-12-13 Paul Eggert <eggert@twinsun.com>
2604
2605 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2606 Do not infringe on the global user namespace when using C++.
2607 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2608 All uses of `fprintf' and `stderr' changed.
2609
2610 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2611
ed8e1f68
AD
26122001-12-13 Akim Demaille <akim@epita.fr>
2613
2614 The computation of nullable is broken: it doesn't handle empty
2615 RHS's properly.
2616
2617 * tests/torture.at (GNU AWK Grammar): New.
2618 * tests/sets.at (Nullable): New.
2619 * src/nullable.c (set_nullable): Instead of blindly looping over
2620 `ritems', loop over the rules, and then over their rhs's.
2621
2622 Work around Autotest bugs.
2623
2624 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2625 frame, because Autotest understand lines starting with a `+' as
2626 traces from the shell. Then, they are not processed properly.
2627 Admittedly an Autotest bug, but we don't have time to wait for
2628 Autotest to catch up.
2629 * tests/regression.at (Broken Closure): Adjust to the new table
2630 frames.
2631 Move to...
2632 * tests/sets.at: here.
2633
cb581495
AD
26342001-12-13 Akim Demaille <akim@epita.fr>
2635
2636 * src/closure.c (closure): Use nrules instead of playing tricks
2637 with BITS_PER_WORD.
2638
2e729273
AD
26392001-12-13 Akim Demaille <akim@epita.fr>
2640
2641 * src/print.c (print_actions): Output the handling of `$' as the
2642 traces do: shifting the token EOF. Before EOF was treated as a
2643 nonterminal.
2644 * tests/regression.at: Adjust some tests.
2645 * src/print_graph.c (print_core): Complete the set of items via
2646 closure. The next-to-final and final states are still unsatisfying,
2647 but that's to be addressed elsewhere.
2648 No longer output the rule numbers, but do output the state number.
2649 A single loop for the shifts + gotos is enough, but picked a
2650 distinct color for each.
2651 (print_graph): Initialize and finalize closure.
2652
107f7dfb
AD
26532001-12-13 Akim Demaille <akim@epita.fr>
2654
2655 * src/reader.c (readgram): Remove dead code, an strip useless
2656 braces.
2657 (get_type): Remove, unused.
2658
9b53a24f
AD
26592001-12-12 Akim Demaille <akim@epita.fr>
2660
2661 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
2662 on that of lib/error.c.
2663
dbfb6dcd
AD
26642001-12-12 Akim Demaille <akim@epita.fr>
2665
2666 Some hosts don't like `/' in includes.
2667
2668 * src/system.h: Include libgettext.h without qualifying the path.
2669 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
2670 $(top_srcdir).
2671
c25fb648
MA
26722001-12-11 Marc Autret <autret_m@epita.fr>
2673
2674 * src/output.c (output_parser): Remove useless muscle.
2675
710ddc4f
MA
26762001-12-11 Marc Autret <autret_m@epita.fr>
2677
2678 * src/bison.simple: Remove #line just before %%epilogue. It
2679 is now handled in ...
2680 * src/reader.c (read_additionnal_code): Add the output of a
2681 #line for the epilogue.
2682
e83d80b8
MA
26832001-12-10 Marc Autret <autret_m@epita.fr>
2684
927c1557 2685 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
2686 replace precedent remove.
2687 * src/bison.simple: Remove #line before %%prologue because
2688 %%input-line is wrong at this time.
2689
971d5158
MA
26902001-12-10 Marc Autret <autret_m@epita.fr>
2691
2692 * src/reader.c (symbols_output): Clean up.
927c1557 2693 * src/output.c (output_gram, output): Clean up.
971d5158 2694
5edafffd
AD
26952001-12-10 Akim Demaille <akim@epita.fr>
2696
2697 * src/lalr.c (initialize_lookaheads): New. Extracted from...
2698 * src/LR0.c (set_state_table): here.
2699 * src/lalr.c (lalr): Call it.
2700
0279f8e9
AD
27012001-12-10 Akim Demaille <akim@epita.fr>
2702
2703 * src/state.h (shifts): Remove the `number' member: shifts are
2704 attached to state, hence no longer need to be labelled with a
2705 state number.
2706
190c4f5f
AD
27072001-12-10 Akim Demaille <akim@epita.fr>
2708
2709 Now that states have a complete set of members, the linked list of
2710 shifts is useless: just fill directly the state's shifts member.
2711
2712 * src/state.h (shifts): Remove the `next' member.
2713 * src/LR0.c (first_state, last_state): Remove.
2714 Adjust the callers.
2715 (augment_automaton): Don't look for the shifts that must be added
2716 a shift on EOF: it is those of the state we looked for! But now,
2717 since shifts are attached, it is no longer needed to looking
2718 merely by its id: its number.
2719
2a73b93d
AD
27202001-12-10 Akim Demaille <akim@epita.fr>
2721
2722 * src/LR0.c (augment_automaton): Better variable locality.
2723 Remove an impossible branch: if there is a state corresponding to
2724 the start symbol being shifted, then there is shift for the start
2725 symbol from the initial state.
2726
74392f6a
AD
27272001-12-10 Akim Demaille <akim@epita.fr>
2728
2729 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
2730 only when appropriate: when insert_start_shifting_state' is not
2731 invoked.
2732 * tests/regression.at (Rule Line Numbers): Adjust.
2733
37c82725
AD
27342001-12-10 Akim Demaille <akim@epita.fr>
2735
2736 * src/LR0.c (augment_automaton): Now that all states have shifts,
2737 merge the two cases addition shifts to the initial state.
2738
6a164e0c
AD
27392001-12-10 Akim Demaille <akim@epita.fr>
2740
2741 * src/lalr.c (set_state_table): Move to...
2742 * src/LR0.c: here.
2743 * src/lalr.c (lalr): Don't call it...
2744 * src/LR0.c (generate_states): do it.
2745 * src/LR0.h (first_state): Remove, only the table is used.
2746
7215de24
AD
27472001-12-10 Akim Demaille <akim@epita.fr>
2748
2749 * src/LR0.h (first_shift, first_reduction): Remove.
2750 * src/lalr.c: Don't use first_shift: find shifts through the
2751 states.
2752
80e25d4d
AD
27532001-12-10 Akim Demaille <akim@epita.fr>
2754
2755 * src/LR0.c: Attach shifts to states as soon as they are
2756 computed.
2757 * src/lalr.c (set_state_table): Instead of assigning shifts to
2758 state, just assert that the mapping was properly done.
2759
0ab3728b
AD
27602001-12-10 Akim Demaille <akim@epita.fr>
2761
2762 * src/LR0.c (insert_start_shift): Rename as...
2763 (insert_start_shifting_state): this.
2764 (insert_eof_shifting_state, insert_accepting_state): New.
2765 (augment_automaton): Adjust.
2766 Better locality of the variables.
2767 When looking if the start_symbol is shifted from the initial
2768 state, using `while (... symbol != start_symbol ...)' sounds
2769 better than `while (... symbol < start_symbol ...)': If fail
2770 to see how the order between symbols could be relevant!
2771
78af9bbc
AD
27722001-12-10 Akim Demaille <akim@epita.fr>
2773
2774 * src/getargs.h: Don't declare `spec_name_prefix' and
2775 `spec_file_prefix', declared by src/files.h.
2776 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
2777 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
2778 * src/output.c (prepare): Adjust.
2779 * src/reader.c (symbols_output): Likewise.
2780 * src/vmsgetargs.c: Vaguely adjust, but who cares?
2781
bdef2a41
AD
27822001-12-10 Akim Demaille <akim@epita.fr>
2783
2784 * src/muscle_tab.c (muscle_init): NULL is a better default than
2785 `"0"'.
2786
3735969c
AD
27872001-12-10 Akim Demaille <akim@epita.fr>
2788
2789 * src/reader.c (reader): Calling symbols_output once is enough.
2790
49701457
AD
27912001-12-10 Akim Demaille <akim@epita.fr>
2792
2793 Now that states have a complete set of members, the linked list of
2794 reductions is useless: just fill directly the state's reductions
2795 member.
2796
2797 * src/state.h (struct reductions): Remove member `number' and
2798 `next'.
2799 * src/LR0.c (first_reduction, last_reduction): Remove.
2800 (save_reductions): Don't link the new reductions, store them in
2801 this_state.
2802 * src/lalr.c (set_state_table): No need to attach reductions to
2803 states, it's already done.
2804 * src/output.c (output_actions): No longer free the shifts, then
2805 the reductions, then the states: free all the states and their
2806 members.
2807
0edad749
AD
28082001-12-10 Akim Demaille <akim@epita.fr>
2809
2810 * src/options.c (OPTN, DRTV, BOTH): New.
2811 (option_table): Use them.
2812
0edad749
AD
2813 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
2814 the job of system.h.
2815 * src/options.c: Don't include stdio.h and xalloc.h for the same
2816 reasons.
2817
5449dd0f
AD
28182001-12-10 Akim Demaille <akim@epita.fr>
2819
2820 * src/output.c (output, prepare): Make sure the values of the
2821 muscles `action' and `prologue' are 0-terminated.
2822
a870c567
AD
28232001-12-10 Akim Demaille <akim@epita.fr>
2824
2825 Clean up GCC warnings.
2826
2827 * src/reader.c (copy_action): `buf' is not used.
2828 (parse_skel_decl): Be static.
2829 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
2830 * src/options.h (create_long_option_table): Have a real prototype.
2831 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
2832 (hash_delete_at): Return const void *.
2833 Adjust casts to preserve the const.
2834
80df8768
AD
28352001-12-10 Akim Demaille <akim@epita.fr>
2836
2837 * configure.in: Require 2.52g.
2838 M4 is not needed, but AUTOM4TE is.
2839 * m4/m4.m4: Remove.
2840 * tests/Makefile.am: Adjust.
2841
f693ad14
AD
28422001-12-10 Akim Demaille <akim@epita.fr>
2843
2844 One structure for states is enough, even though theoretically
2845 there are LR(0) states and LALR(1) states.
2846
2847 * src/lalr.h (state_t): Remove.
2848 (state_table): Be state_t **, not state_t *.
2849 * src/state.h (core, CORE_ALLOC): Rename as...
2850 (state_t, STATE_ALLOC): this.
2851 Add the LALR(1) members: shifts, reductions, errs.
2852 * src/LR0.c (state_table): Rename as...
2853 (state_hash): this, to avoid name clashes with the global
2854 `state_table'.
2855 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
2856 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
2857
74ffbcb6
AD
28582001-12-10 Akim Demaille <akim@epita.fr>
2859
2860 Bison dumps core on bash.y.
2861 Reported by Pascal Bart.
2862
2863 * src/warshall.c (bitmatrix_print): New.
2864 (TC): Use it.
2865 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
2866 j must be the outer loop.
2867 * tests/regression.at (Broken Closure): New.
2868
07708e19
AD
28692001-12-05 Akim Demaille <akim@epita.fr>
2870
2871 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
2872 its argument.
2873