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