]> git.saurik.com Git - bison.git/blame - ChangeLog
Initial check-in introducing experimental GLR parsing. See entry in
[bison.git] / ChangeLog
CommitLineData
676385e2
PH
12002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
2
3 Accumulated changelog for new GLR parsing features.
4
5 * src/conflicts.c (count_total_conflicts): Change name to
6 conflicts_total_count.
7 * src/conflicts.h: Ditto.
8 * src/output.c (token_actions): Use the new name.
9 (output_conflicts): Change conflp => conflict_list_heads, and
10 confl => conflict_list for better readability.
11 * data/glr.c: Use the new names.
12 * NEWS: Add self to GLR announcement.
13
14 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
15
16 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
17 Akim Demaille.
18
19 * data/bison.glr: Change name to glr.c
20 * data/glr.c: Renamed from bison.glr.
21 * data/Makefile.am: Add glr.c
22
23 * src/getargs.c:
24
25 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
26 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
27
28 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
29
30 * data/bison.glr: Be sure to restore the
31 current #line when returning to the skeleton contents after having
32 exposed the input file's #line.
33
34 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
35
36 * data/bison.glr: Bring up to date with changes to bison.simple.
37
38 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
39
40 * data/bison.glr: Correct definitions that use b4_prefix.
41 Various reformatting.
42 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
43 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
44 yytokenp argument; now part of stack.
45 (yychar): Define to behave as documented.
46 (yyclearin): Ditto.
47
48 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
49
50 * src/reader.h: Add declaration for free_merger_functions.
51
52 * src/reader.c (merge_functions): New variable.
53 (get_merge_function): New function.
54 (free_merger_functions): New function.
55 (readgram): Check for %prec that is not followed by a symbol.
56 Handle %dprec and %merge declarations.
57 (packgram): Initialize dprec and merger fields in rules array.
58
59 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
60 conflict_list_cnt, conflict_list_free): New variables.
61 (table_grow): Also grow conflict_table.
62 (prepare_rules): Output dprec and merger tables.
63 (conflict_row): New function.
64 (action_row): Output conflict lists for GLR parser. Don't use
65 default reduction in conflicted states for GLR parser so that there
66 are spaces for the conflict lists.
67 (save_row): Also save conflict information.
68 (token_actions): Allocate conflict list.
69 (merger_output): New function.
70 (pack_vector): Pack conflict table, too.
71 (output_conflicts): New function to output yyconflp and yyconfl.
72 (output_check): Allocate conflict_tos.
73 (output_actions): Output conflict tables, also.
74 (output_skeleton): Output b4_mergers definition.
75 (prepare): Output b4_max_rhs_length definition.
76 Use 'bison.glr' as default skeleton for GLR parsers.
77
78 * src/gram.c (glr_parser): New flag.
79 (grammar_free): Call free_merger_functions.
80
81 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
82 all pairs of conflicting reductions, rather than just all tokens
83 causing conflicts. Needed to size conflict tables.
84 (conflicts_output): Modify call to count_rr_conflicts for new
85 interface.
86 (conflicts_print): Ditto.
87 (count_total_conflicts): New function.
88
89 * src/reader.h (merger_list): New type.
90 (merge_functions): New variable.
91
92 * src/lex.h (tok_dprec, tok_merge): New token types.
93
94 * src/gram.h (rule_s): Add dprec and merger fields.
95 (glr_parser): New flag.
96
97 * src/conflicts.h (count_total_conflicts): New function.
98
99 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
100
101 * doc/bison.texinfo (Generalized LR Parsing): New section.
102 (GLR Parsers): New section.
103 (Language and Grammar): Mention GLR parsing.
104 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
105 Correct typo ("tge" -> "the").
106
107 * data/bison.glr: New skeleton for GLR parsing.
108
109 * tests/cxx-gram.at: New tests for GLR parsing.
110
111 * tests/testsuite.at: Include cxx-gram.at.
112
113 * tests/Makefile.am: Add cxx-gram.at.
114
115 * src/parse-gram.y:
116
117 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
118
119 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
120 2002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
121
122 * src/options.h, src/options.c: Remove.
123 * src/getargs.c (short_options, long_options): New.
124
60491a94
AD
1252002-06-27 Akim Demaille <akim@epita.fr>
126
127 * data/bison.simple, data/bison.c++: Rename as...
128 * data/yacc.c, data/lalr1.cc: these.
129 * doc/bison.texinfo (Environment Variables): Remove.
130
9be0c25b
AD
1312002-06-25 Raja R Harinath <harinath@cs.umn.edu>
132
133 * src/getargs.c (report_argmatch): Initialize strtok().
134
1ae72863
AD
1352002-06-20 Akim Demaille <akim@epita.fr>
136
137 * data/bison.simple (b4_symbol_actions): New, replaces...
138 (b4_symbol_destructor, b4_symbol_printer): these.
139 (yysymprint): Be sure to call YYPRINT only for tokens, and using
140 user token numbers.
141
87542d29
AD
1422002-06-20 Akim Demaille <akim@epita.fr>
143
144 * data/bison.simple (yydestructor): Rename as...
145 (yydestruct): this.
146
1a31ed21
AD
1472002-06-20 Akim Demaille <akim@epita.fr>
148
149 * src/symtab.h, src/symtab.c (symbol_type_set)
150 (symbol_destructor_set, symbol_precedence_set): The location is
151 the last argument.
152 Adjust all callers.
153
e776192e
AD
1542002-06-20 Akim Demaille <akim@epita.fr>
155
156 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
157 internals.
158 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
159 Takes a location.
160 * src/symtab.h, src/symtab.c (symbol_class_set)
161 (symbol_user_token_number_set): Likewise.
162 Adjust all callers.
163 Promote complain_at.
164 * tests/input.at (Type Clashes): Adjust.
165
5c1180b3
AD
1662002-06-20 Akim Demaille <akim@epita.fr>
167
168 * data/bison.simple (YYLEX): Fix the declaration when
169 %pure-parser.
170
e3170060
AD
1712002-06-20 Akim Demaille <akim@epita.fr>
172
173 * data/bison.simple (yysymprint): Don't print the token number,
174 just its name.
175 * tests/actions.at (Destructors): Rename as...
176 (Printers and Destructors): this.
177 Also exercise %printer.
178
253862fd
AD
1792002-06-20 Akim Demaille <akim@epita.fr>
180
181 * data/bison.simple (YYDSYMPRINT): New.
182 Use it to remove many of the #if YYDEBUG/if (yydebug).
183
366eea36
AD
1842002-06-20 Akim Demaille <akim@epita.fr>
185
186 * src/symtab.h, src/symtab.c (symbol_t): printer and
187 printer_location are new members.
188 (symbol_printer_set): New.
189 * src/parse-gram.y (PERCENT_PRINTER): New token.
190 Handle its associated rule.
191 * src/scan-gram.l: Adjust.
192 (handle_destructor_at, handle_destructor_dollar): Rename as...
193 (handle_symbol_code_at, handle_symbol_code_dollar): these.
194 * src/output.c (symbol_printers_output): New.
195 (output_skeleton): Call it.
196 * data/bison.simple (yysymprint): New. Cannot be named yyprint
197 since there are already many grammar files with a user `yyprint'.
198 Replace the calls to YYPRINT to calls to yysymprint.
199 * tests/calc.at: Adjust.
200 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
201 taking advantage of parser very internal details (stack size!).
202
4f25ebb0
AD
2032002-06-20 Akim Demaille <akim@epita.fr>
204
205 * src/scan-gram.l: Complete the scanner with the missing patterns
206 to pacify Flex.
207 Use `quote' and `symbol_tag_get' where appropriate.
208
93b68a0e
AD
2092002-06-19 Akim Demaille <akim@epita.fr>
210
211 * tests/actions.at (Destructors): Augment to test locations.
212 * data/bison.simple (yydestructor): Pass it the current location
213 if locations are enabled.
214 Prototype only when __STDC__ or C++.
215 Change the argument names to move into the yy name space: there is
216 user code here.
217
58612f1d
AD
2182002-06-19 Akim Demaille <akim@epita.fr>
219
74310291
AD
220 * data/bison.simple (b4_pure_if): New.
221 Use it instead of #ifdef YYPURE.
222
2232002-06-19 Akim Demaille <akim@epita.fr>
224
225 * data/bison.simple (b4_location_if): New.
58612f1d
AD
226 Use it instead of #ifdef YYLSP_NEEDED.
227
f25bfb75
AD
2282002-06-19 Akim Demaille <akim@epita.fr>
229
230 Prepare @$ in %destructor, but currently don't bind it in the
231 skeleton, as %location use is not cleaned up yet.
232
233 * src/scan-gram.l (handle_dollar, handle_destructor_at)
234 (handle_action_at): New.
235 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
236 a braced_code_t and a location as additional arguments.
237 (handle_destructor_dollar): Instead of requiring `b4_eval', just
238 unquote one when outputting `b4_dollar_dollar'.
239 Adjust callers.
240 * data/bison.simple (b4_eval): Remove.
241 (b4_symbol_destructor): Adjust.
242 * tests/input.at (Invalid @n): Adjust.
243
c732d2c6
AD
2442002-06-19 Zack Weinberg <zack@codesourcery.com>
245
246 * doc/bison.texinfo: Document ability to have multiple
247 prologue sections.
248
8c165d89
AD
2492002-06-18 Akim Demaille <akim@epita.fr>
250
251 * src/files.c (compute_base_names): When computing the output file
252 names from the input file name, strip the directory part.
253
ca98bf57
AD
2542002-06-18 Akim Demaille <akim@epita.fr>
255
256 * data/bison.simple.new: Comment changes.
257 Reported by Andreas Schwab.
258
0bfb02ff
AD
2592002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
260
261 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
262 there are no `label `yyoverflowlab' defined but not used' warnings
263 when yyoverflow is defined.
264
24c0aad7
AD
2652002-06-18 Akim Demaille <akim@epita.fr>
266
267 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
268 new member.
269 (symbol_destructor_set): Adjust.
270 * src/output.c (symbol_destructors_output): Output the destructor
271 locations.
272 Output the symbol name.
273 * data/bison.simple (b4_symbol_destructor): Adjust.
274
5719c109
AD
2752002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
276 and Akim Demaille <akim@epita.fr>
277
278 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
279 what's left on the stack when the error recovery hits EOF.
280 * tests/actions.at (Destructors): Complete to exercise this case.
281
9280d3ef
AD
2822002-06-17 Akim Demaille <akim@epita.fr>
283
284 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
285 arguments is really empty, not only equal to `[]'.
286 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
287 member.
288 (symbol_destructor_set): New.
289 * src/output.c (symbol_destructors_output): New.
290 * src/reader.h (brace_code_t, current_braced_code): New.
291 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
292 (handle_dollar): Rename as...
293 (handle_action_dollar): this.
294 (handle_destructor_dollar): New.
295 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
296 (grammar_declaration): Use it.
297 * data/bison.simple (yystos): Is always defined.
298 (yydestructor): New.
299 * tests/actions.at (Destructors): New.
300 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
301
dafdc66f
AD
3022002-06-17 Akim Demaille <akim@epita.fr>
303
304 * src/symlist.h, src/symlist.c (symbol_list_length): New.
305 * src/scan-gram.l (handle_dollar, handle_at): Compute the
306 rule_length only when needed.
307 * src/output.c (actions_output, token_definitions_output): Output
308 the full M4 block.
309 * src/symtab.c: Don't access directly to the symbol tag, use
310 symbol_tag_get.
311 * src/parse-gram.y: Use symbol_list_free.
312
56c47203
AD
3132002-06-17 Akim Demaille <akim@epita.fr>
314
315 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
316 (symbol_list_prepend, get_type_name): Move to...
317 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
318 (symbol_list_prepend, symbol_list_n_type_name_get): here.
319 Adjust all callers.
320 (symbol_list_free): New.
321 * src/scan-gram.l (handle_dollar): Takes a location.
322 * tests/input.at (Invalid $n): Adjust.
323
1e0bab92
AD
3242002-06-17 Akim Demaille <akim@epita.fr>
325
326 * src/reader.h, src/reader.c (symbol_list_new): Export it.
327 (symbol_list_prepend): New.
328 * src/parse-gram.y (%union): `list' is a new member.
329 (symbols.1): New, replaces...
330 (terms_to_prec.1, nterms_to_type.1): these.
331 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
332 Take a location as additional argument.
333 Adjust all callers.
334
04e60654
AD
3352002-06-15 Akim Demaille <akim@epita.fr>
336
337 * src/parse-gram.y: Move %token in the declaration section so that
338 we don't depend upon CVS Bison.
339
10e5b8bd
AD
3402002-06-15 Akim Demaille <akim@epita.fr>
341
342 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
343 * src/print.c (print_core): Use it.
344
9801d40c
AD
3452002-06-15 Akim Demaille <akim@epita.fr>
346
347 * src/conflicts.c (log_resolution): Accept the rule involved in
348 the sr conflicts instead of the lookahead number that points to
349 that rule.
350 (flush_reduce): Accept the current lookahead vector as argument,
351 instead of the index in LA.
352 (resolve_sr_conflict): Accept the current number of lookahead
353 bitset to consider for the STATE, instead of the index in LA.
354 (set_conflicts): Adjust.
355 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
356
c0263492
AD
3572002-06-15 Akim Demaille <akim@epita.fr>
358
359 * src/state.h (state_t): Replace the `lookaheadsp' member, a
360 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
361 Adjust all dependencies.
362 * src/lalr.c (initialize_lookaheads): Split into...
363 (states_lookaheads_count, states_lookaheads_initialize): these.
364 (lalr): Adjust.
365
9757c359
AD
3662002-06-15 Akim Demaille <akim@epita.fr>
367
368 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
369 out of...
370 (grammar_rules_print): here.
371 * src/reduce.c (reduce_output): Use it.
372 * tests/reduce.at (Useless Rules, Reduced Automaton)
373 (Underivable Rules): Adjust.
374
6b98e4b5
AD
3752002-06-15 Akim Demaille <akim@epita.fr>
376
377 Copy BYacc's nice way to report the grammar.
378
379 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
380 New.
381 Don't print the rules' location, it is confusing and useless.
382 (rule_print): Use grammar_rhs_print.
383 * src/print.c (print_grammar): Use grammar_rules_print.
384
6b98e4b5
AD
3852002-06-15 Akim Demaille <akim@epita.fr>
386
387 Complete and rationalize `useless thing' warnings.
388
389 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
390 (symbol_tag_print): New.
391 Use them everywhere in place of accessing directly the tag member.
392 * src/gram.h, src/gram.c (rule_print): New.
393 Use it where a rule used to be printed `by hand'.
394 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
395 (reduce_grammar_tables): Report the useless rules.
396 (reduce_print): Useless things are a warning, not an error.
397 Report it as such.
398 * tests/reduce.at (Useless Nonterminals, Useless Rules):
399 (Reduced Automaton, Underivable Rules): Adjust.
400 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
401 * tests/conflicts.at (Unresolved SR Conflicts)
402 (Solved SR Conflicts): Adjust.
403
ee000ba4
AD
4042002-06-15 Akim Demaille <akim@epita.fr>
405
406 Let symbols have a location.
407
408 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
409 (getsym): Adjust.
410 Adjust all callers.
411 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
412 Use location_t, not int.
413 * src/symtab.c (symbol_check_defined): Take advantage of the
414 location.
415 * tests/regression.at (Invalid inputs): Adjust.
416
8efe435c
AD
4172002-06-15 Akim Demaille <akim@epita.fr>
418
419 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
420 (input): Don't try to initialize yylloc here, do it in the
421 scanner.
422 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
423 * src/gram.h (rule_t): Change line and action_line into location
424 and action_location, of location_t type.
425 Adjust all dependencies.
426 * src/location.h, src/location.c (empty_location): New.
427 * src/reader.h, src/reader.c (grammar_start_symbol_set)
428 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
429 (grammar_current_rule_symbol_append)
430 (grammar_current_rule_action_append): Expect a location as argument.
431 * src/reader.c (grammar_midrule_action): Adjust to attach an
432 action's location as dummy symbol location.
433 * src/symtab.h, src/symtab.c (startsymbol_location): New.
434 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
435 the line numbers.
436
1921f1d7
AD
4372002-06-14 Akim Demaille <akim@epita.fr>
438
439 Grammar declarations may be found in the grammar section.
440
441 * src/parse-gram.y (rules_or_grammar_declaration): New.
442 (declarations): Each declaration may end with a semicolon, not
443 just...
444 (grammar_declaration): `"%union"'.
445 (grammar): Branch to rules_or_grammar_declaration.
446
4515534c
AD
4472002-06-14 Akim Demaille <akim@epita.fr>
448
449 * src/main.c (main): Invoke scanner_free.
450
f958596b
AD
4512002-06-14 Akim Demaille <akim@epita.fr>
452
453 * src/output.c (m4_invoke): Extracted from...
454 (output_skeleton): here.
455 Free tempfile.
456
2c569025
AD
4572002-06-14 Akim Demaille <akim@epita.fr>
458
459 * src/parse-gram.y (directives, directive, gram)
460 (grammar_directives, precedence_directives, precedence_directive):
461 Rename as...
462 (declarations, declaration, grammar, grammar_declaration)
463 (precedence_declaration, precedence_declarator): these.
464 (symbol_declaration): New.
465
592e8d4d
AD
4662002-06-14 Akim Demaille <akim@epita.fr>
467
468 * src/files.c (action_obstack): Remove, unused.
469 (output_obstack): Remove it, and all its dependencies, as it is no
470 longer needed.
471 * src/reader.c (epilogue_set): Build the epilogue in the
472 muscle_obstack.
473 * src/output.h, src/output.c (muscle_obstack): Move to...
474 * src/muscle_tab.h, src/muscle_tab.h: here.
475 (muscle_init): Initialize muscle_obstack.
476 (muscle_free): New.
477 * src/main.c (main): Call it.
478
0c15323d
AD
4792002-06-14 Akim Demaille <akim@epita.fr>
480
481 * src/location.h: New, extracted from...
482 * src/reader.h: here.
483 * src/Makefile.am (noinst_HEADERS): Merge into
484 (bison_SOURCES): this.
485 Add location.h.
486 * src/parse-gram.y: Use location_t instead of Bison's.
487 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
488 Use location_t instead of ints.
489
e96c9728
AD
4902002-06-14 Akim Demaille <akim@epita.fr>
491
492 * data/bison.simple, data/bison.c++: Be sure to restore the
493 current #line when returning to the skeleton contents after having
494 exposed the input file's #line.
495
75d1fe16
AD
4962002-06-12 Akim Demaille <akim@epita.fr>
497
498 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
499 eager.
500 * tests/actions.at (Exotic Dollars): New.
501
6c35d22c
AD
5022002-06-12 Akim Demaille <akim@epita.fr>
503
504 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
505 ['"/] too eagerly.
506 * tests/input.at (Torturing the Scanner): New.
507
1d6412ad
AD
5082002-06-11 Akim Demaille <akim@epita.fr>
509
510 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
511 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
512 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
513 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
514 * src/reader.c (reader): Use it.
515
4cdb01db
AD
5162002-06-11 Akim Demaille <akim@epita.fr>
517
518 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
519 Adjust all callers.
520 (scanner_last_string_free): New.
521
44995b2e
AD
5222002-06-11 Akim Demaille <akim@epita.fr>
523
524 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
525 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
526 (last_string, YY_OBS_FREE): New.
527 Use them when returning an ID.
528
e9955c83
AD
5292002-06-11 Akim Demaille <akim@epita.fr>
530
531 Have Bison grammars parsed by a Bison grammar.
532
533 * src/reader.c, src/reader.h (prologue_augment): New.
534 * src/reader.c (copy_definition): Remove.
535
536 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
537 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
538 (grammar_current_rule_prec_set, grammar_current_rule_check)
539 (grammar_current_rule_symbol_append)
540 (grammar_current_rule_action_append): Export.
541 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
542 (symbol_list_action_append): Remove.
543 Hook the routines from reader.
544 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
545 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
546
547 * src/reader.c (read_declarations): Remove, unused.
548
549 * src/parse-gram.y: Handle the epilogue.
550 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
551 (grammar_start_symbol_set): this.
552 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
553 * src/reader.c (readgram): Remove, unused.
554 (reader): Adjust to insert eoftoken and axiom where appropriate.
555
556 * src/reader.c (copy_dollar): Replace with...
557 * src/scan-gram.h (handle_dollar): this.
558 * src/parse-gram.y: Remove `%thong'.
559
560 * src/reader.c (copy_at): Replace with...
561 * src/scan-gram.h (handle_at): this.
562
563 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
564 New.
565
566 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
567 time being.
568
569 * src/reader.h, src/reader.c (grammar_rule_end): New.
570
571 * src/parse.y (current_type, current_class): New.
572 Implement `%nterm', `%token' support.
573 Merge `%term' into `%token'.
574 (string_as_id): New.
575 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
576 type name.
577
578 * src/parse-gram.y: Be sure to handle properly the beginning of
579 rules.
580
581 * src/parse-gram.y: Handle %type.
582 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
583
584 * src/parse-gram.y: More directives support.
585 * src/options.c: No longer handle source directives.
586
587 * src/parse-gram.y: Fix %output.
588
589 * src/parse-gram.y: Handle %union.
590 Use the prologue locations.
591 * src/reader.c (parse_union_decl): Remove.
592
593 * src/reader.h, src/reader.c (epilogue_set): New.
594 * src/parse-gram.y: Use it.
595
596 * data/bison.simple, data/bison.c++: b4_stype is now either not
597 defined, then default to int, or to the contents of %union,
598 without `union' itself.
599 Adjust.
600 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
601
602 * src/output.c (actions_output): Don't output braces, as they are
603 already handled by the scanner.
604
605 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
606 characters to themselves.
607
608 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
609 that the epilogue has a proper #line.
610
611 * src/parse-gram.y: Handle precedence/associativity.
612
613 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
614 a terminal.
615 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
616 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
617 at all to define terminals that cannot be emitted.
618
619 * src/scan-gram.l: Escape M4 characters.
620
621 * src/scan-gram.l: Working properly with escapes in user
622 strings/characters.
623
624 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
625 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
626 grammar.
627 Use more modest sizes, as for the time being the parser does not
628 release memory, and therefore the process swallows a huge amount
629 of memory.
630
631 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
632 stricter %token grammar.
633
634 * src/symtab.h (associativity): Add `undef_assoc'.
635 (symbol_precedence_set): Do nothing when passed an undef_assoc.
636 * src/symtab.c (symbol_check_alias_consistence): Adjust.
637
638 * tests/regression.at (Invalid %directive): Remove, as it is now
639 meaningless.
640 (Invalid inputs): Adjust to the new error messages.
641 (Token definitions): The new grammar doesn't allow too many
642 eccentricities.
643
644 * src/lex.h, src/lex.c: Remove.
645 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
646 (copy_character, copy_string2, copy_string, copy_identifier)
647 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
648 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
649 (parse_action): Remove.
650 * po/POTFILES.in: Adjust.
651
2e047461
AD
6522002-06-11 Akim Demaille <akim@epita.fr>
653
654 * src/reader.c (parse_action): Don't store directly into the
655 rule's action member: return the action as a string.
656 Don't require `rule_length' as an argument: compute it.
657 (grammar_current_rule_symbol_append)
658 (grammar_current_rule_action_append): New, eved out from
659 (readgram): here.
660 Remove `action_flag', `rulelength', unused now.
661
9af3fbce
AD
6622002-06-11 Akim Demaille <akim@epita.fr>
663
664 * src/reader.c (grammar_current_rule_prec_set).
665 (grammar_current_rule_check): New, eved out from...
666 (readgram): here.
667 Remove `xaction', `first_rhs': useless.
668 * tests/input.at (Type clashes): New.
669 * tests/existing.at (GNU Cim Grammar): Adjust.
670
1485e106
AD
6712002-06-11 Akim Demaille <akim@epita.fr>
672
673 * src/reader.c (grammar_midrule_action): New, Eved out from
674 (readgram): here.
675
da4160c3
AD
6762002-06-11 Akim Demaille <akim@epita.fr>
677
678 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
679 New.
680 (readgram): Use them as replacement of inlined code, crule and
681 crule1.
682
f6d0f937
AD
6832002-06-11 Akim Demaille <akim@epita.fr>
684
685 * src/reader.c (grammar_end, grammar_symbol_append): New.
686 (readgram): Use them.
687 Make the use of `p' as local as possible.
688
69078d4b
AD
6892002-06-10 Akim Demaille <akim@epita.fr>
690
691 GCJ's parser requires the tokens to be defined before the prologue.
692
693 * data/bison.simple: Output the token definition before the user's
694 prologue.
695 * tests/regression.at (Braces parsing, Duplicate string)
696 (Mixing %token styles): Check the output from bison.
697 (Early token definitions): New.
698
5e424082
AD
6992002-06-10 Akim Demaille <akim@epita.fr>
700
701 * src/symtab.c (symbol_user_token_number_set): Don't complain when
702 assigning twice the same user number to a token, so that we can
703 use it in...
704 * src/lex.c (lex): here.
705 Also use `symbol_class_set' instead of hand written code.
706 * src/reader.c (parse_assoc_decl): Likewise.
707
44536b35
AD
7082002-06-10 Akim Demaille <akim@epita.fr>
709
710 * src/symtab.c, src/symtab.c (symbol_class_set)
711 (symbol_user_token_number_set): New.
712 * src/reader.c (parse_token_decl): Use them.
713 Use a switch instead of ifs.
714 Use a single argument.
715
8b9f2372
AD
7162002-06-10 Akim Demaille <akim@epita.fr>
717
718 Remove `%thong' support as it is undocumented, unused, duplicates
719 `%token's job, and creates useless e-mail traffic with people who
720 want to know what it is, why it is undocumented, unused, and
721 duplicates `%token's job.
722
723 * src/reader.c (parse_thong_decl): Remove.
724 * src/options.c (option_table): Remove "thong".
725 * src/lex.h (tok_thong): Remove.
726
3ae2b51f
AD
7272002-06-10 Akim Demaille <akim@epita.fr>
728
729 * src/symtab.c, src/symtab.c (symbol_type_set)
730 (symbol_precedence_set): New.
731 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
732 (value_components_used): Remove, unused.
733
2f1afb73
AD
7342002-06-09 Akim Demaille <akim@epita.fr>
735
736 Move symbols handling code out of the reader.
737
738 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
739 (axiom): Move to...
740 * src/symtab.h, src/symtab.c: here.
741
742 * src/gram.c (start_symbol): Remove: use startsymbol->number.
743 * src/reader.c (startval): Rename as...
744 * src/symtab.h, src/symtab.c (startsymbol): this.
745 * src/reader.c: Adjust.
746
747 * src/reader.c (symbol_check_defined, symbol_make_alias)
748 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
749 (token_translations_init)
750 Move to...
751 * src/symtab.c: here.
752 * src/reader.c (packsymbols): Move to...
753 * src/symtab.h, src/symtab.c (symbols_pack): here.
754 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
755 argument.
756
e9bca3ad
AD
7572002-06-03 Akim Demaille <akim@epita.fr>
758
759 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
760 then statements.
761
86eff183
AD
7622002-06-03 Akim Demaille <akim@epita.fr>
763
764 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
765 structs with non literals.
766 * src/scan-skel.l: never-interactive.
767 * src/conflicts.c (enum conflict_resolution_e): No trailing
768 comma.
769 * src/getargs.c (usage): Split long literal strings.
770 Reported by Hans Aberg.
771
717be197
AD
7722002-05-28 Akim Demaille <akim@epita.fr>
773
774 * data/bison.c++: Use C++ ostreams.
775 (cdebug_): New member.
776
670ddffd
AD
7772002-05-28 Akim Demaille <akim@epita.fr>
778
779 * src/output.c (output_skeleton): Be sure to allocate enough room
780 for `/' _and_ for `\0' in full_skeleton.
781
769b430f
AD
7822002-05-28 Akim Demaille <akim@epita.fr>
783
784 * data/bison.c++: Catch up with bison.simple:
785 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
786 and Paul Eggert <eggert@twinsun.com>: `error' handing.
787 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
788 and popping traces.
789
7067cb36
PH
7902002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
791
792 * src/output.c (output_skeleton): Put an explicit path in front of
793 the skeleton file name, rather than relying on the -I directory,
794 to partially alleviate effects of having a skeleton file lying around
795 in the current directory.
769b430f 796
4a713ec2
PH
7972002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
798
769b430f 799 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
800 obstack_printf should be obstack_fgrow1.
801
b408954b
AD
8022002-05-26 Akim Demaille <akim@epita.fr>
803
804 * src/state.h (state_t): `solved_conflicts' is a new member.
805 * src/LR0.c (new_state): Set it to 0.
806 * src/conflicts.h, src/conflicts.c (print_conflicts)
807 (free_conflicts, solve_conflicts): Rename as...
808 (conflicts_print, conflicts_free, conflicts_solve): these.
809 Adjust callers.
810 * src/conflicts.c (enum conflict_resolution_e)
811 (solved_conflicts_obstack): New, used by...
812 (log_resolution): this.
813 Adjust to attach the conflict resolution to each state.
814 Complete the description with the precedence/associativity
815 information.
816 (resolve_sr_conflict): Adjust.
817 * src/print.c (print_state): Output its solved_conflicts.
818 * tests/conflicts.at (Unresolved SR Conflicts)
819 (Solved SR Conflicts): Exercise --report=all.
820
a49aecd5
AD
8212002-05-26 Akim Demaille <akim@epita.fr>
822
823 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
824 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
825 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
826 (token_number_t, item_number_as_token_number)
827 (token_number_as_item_number, muscle_insert_token_number_table):
828 Rename as...
829 (symbol_number_t, item_number_as_symbol_number)
830 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
831 these, since it is more appropriate.
832
5504898e
AD
8332002-05-26 Akim Demaille <akim@epita.fr>
834
835 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
836 `Error:' lines.
837 * data/bison.simple (yystos) [YYDEBUG]: New.
838 (yyparse) [YYDEBUG]: Display the symbols which are popped during
839 error recovery.
840 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
841
ec3bc396
AD
8422002-05-25 Akim Demaille <akim@epita.fr>
843
844 * doc/bison.texinfo (Debugging): Split into...
845 (Tracing): this new section, its former contents, and...
846 (Understanding): this new section.
847 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
848 by...
849 (report_flag): this.
850 Adjust all dependencies.
851 (report_args, report_types, report_argmatch): New.
852 (usage, getargs): Report/support -r, --report.
853 * src/options.h
854 (struct option_table_struct): Rename as..,
855 (struct option_table_s): this.
856 Rename the `set_flag' member to `flag' to match with getopt_long's
857 struct.
858 * src/options.c (option_table): Split verbose into an entry for
859 %verbose, and another for --verbose.
860 Support --report/-r, so remove -r from the obsolete --raw.
861 * src/print.c: Attach full item sets and lookaheads reports to
862 report_flag instead of trace_flag.
863 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
864
78df8250
PE
8652002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
866 and Paul Eggert <eggert@twinsun.com>
769b430f 867
78df8250
PE
868 * data/bison.simple (yyparse): Correct error handling to conform to
869 POSIX and yacc. Specifically, after syntax error is discovered,
870 do not reduce further before shifting the error token.
871 Clean up the code a bit by removing the labels yyerrdefault,
872 yyerrhandle, yyerrpop.
873 * NEWS: Document the above.
874
c0c9ea05
PH
8752002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
876
877 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
878 type; it isn't always big enough, since it doesn't necessarily
879 include non-terminals.
769b430f 880 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
881 the latter can be removed.
882 (yy_token_number_type): Remove, only one use.
883 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
884 don't use TokenNumberType as element type.
769b430f 885
c0c9ea05
PH
886 * tests/regression.at: Modify expected output to agree with change
887 to yyr1 and yytranslate.
769b430f 888
6390a83f
FK
8892002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
890
891 * src/reader.c (parse_action): Use copy_character instead of
892 obstack_1grow.
893
db7c8e9a
AD
8942002-05-13 Akim Demaille <akim@epita.fr>
895
896 * tests/regression.at (Token definitions): Prototype yylex and
897 yyerror.
898
fcc61800
PH
8992002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
900
158c687b 901 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
902 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
903 32-bit arithmetic.
904 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
905
5683e9b2
AD
9062002-05-07 Akim Demaille <akim@epita.fr>
907
908 * tests/synclines.at: Be sure to prototype yylex and yyerror to
909 avoid GCC warnings.
910
0c2d3f4c
AD
9112002-05-07 Akim Demaille <akim@epita.fr>
912
913 Kill GCC warnings.
914
915 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
916 over the RHS of each rule.
917 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
918 * src/state.h (state_t): Member `nitems' is unsigned short.
919 * src/LR0.c (get_state): Adjust.
920 * src/reader.c (packgram): Likewise.
921 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
922 `Type'.
923 (muscle_insert_int_table): Remove, unused.
924 (prepare_rules): Remove `max'.
925
1565b720
AD
9262002-05-06 Akim Demaille <akim@epita.fr>
927
928 * src/closure.c (print_firsts): Display of the symbol tags.
929 (bitmatrix_print): Move to...
930 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
931 here.
932 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
933
cfaee611
AD
9342002-05-06 Akim Demaille <akim@epita.fr>
935
936 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
937 hash_do_for_each.
938
458be8e0
AD
9392002-05-06 Akim Demaille <akim@epita.fr>
940
941 * src/LR0.c (new_state, get_state): Instead of using the global
942 `kernel_size' and `kernel_base', have two new arguments:
943 `core_size' and `core'.
944 Adjust callers.
945
a900a624
AD
9462002-05-06 Akim Demaille <akim@epita.fr>
947
948 * src/reader.c (packgram): No longer end `ritem' with a 0
949 sentinel: it is not used.
950
d4e7d3a1
AD
9512002-05-05 Akim Demaille <akim@epita.fr>
952
953 New experimental feature: display the lookaheads in the report and
954 graph.
955
956 * src/print (print_core): When --trace-flag, display the rules
957 lookaheads.
958 * src/print_graph.c (print_core): Likewise.
959 Swap the arguments.
960 Adjust caller.
961
39ceb25b
AD
9622002-05-05 Akim Demaille <akim@epita.fr>
963
964 * tests/torture.at (Many lookaheads): New test.
965
5372019f
AD
9662002-05-05 Akim Demaille <akim@epita.fr>
967
968 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
969 (GENERATE_MUSCLE_INSERT_TABLE): this.
970 (output_int_table, output_unsigned_int_table, output_short_table)
971 (output_token_number_table, output_item_number_table): Replace with...
972 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
973 (muscle_insert_short_table, muscle_insert_token_number_table)
974 (muscle_insert_item_number_table): these.
975 Adjust all callers.
976 (prepare_tokens): Don't free `translations', since...
977 * src/reader.h, src/reader.c (grammar_free): do it.
978 Move to...
979 * src/gram.h, src/gram.c (grammar_free): here.
980 * data/bison.simple, data/bison.c++: b4_token_number_max is now
981 b4_translate_max.
982
5df5f6d5
AD
9832002-05-05 Akim Demaille <akim@epita.fr>
984
985 * src/output.c (output_unsigned_int_table): New.
986 (prepare_rules): `i' is unsigned.
987 `prhs', `rline', `r2' are unsigned int.
988 Rename muscle `rhs_number_max' as `rhs_max'.
989 Output muscles `prhs_max', `rline_max', and `r2_max'.
990 Free rline and r1.
991 * data/bison.simple, data/bison.c++: Adjust to use these muscles
992 to compute types instead of constant types.
993 * tests/regression.at (Web2c Actions): Adjust.
994
b87f8b21
AD
9952002-05-04 Akim Demaille <akim@epita.fr>
996
997 * src/symtab.h (SALIAS, SUNDEF): Rename as...
998 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
999 Adjust dependencies.
1000 * src/output.c (token_definitions_output): Be sure not to output a
1001 `#define 'a'' when fed with `%token 'a' "a"'.
1002 * tests/regression.at (Token definitions): New.
1003
8bb936e4
PE
10042002-05-03 Paul Eggert <eggert@twinsun.com>
1005
1006 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1007 for K&R C.
1008
10092002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1010
1011 * Makefile.am (SUBDIRS): Remove intl.
1012 (EXTRA_DIST): Add config/config.rpath.
1013
53c71a12
AD
10142002-05-03 Akim Demaille <akim@epita.fr>
1015
1016 * data/bison.simple (m4_if): Don't output empty enums.
1017 And actually, output valid enum definitions :(.
1018
289dd0cf
AD
10192002-05-03 Akim Demaille <akim@epita.fr>
1020
1021 * configure.bat: Remove, completely obsolete.
1022 * Makefile.am (EXTRA_DIST): Adjust.
1023 Don't distribute config.rpath...
1024 * config/Makefile.am (EXTRA_DIST): Do it.
1025
db85e524
AD
10262002-05-03 Akim Demaille <akim@epita.fr>
1027
1028 * configure.in (GETTEXT_VERSION): New.
1029 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1030
83ccf991
AD
10312002-05-03 Akim Demaille <akim@epita.fr>
1032
1033 * data/bison.simple (b4_token_enum): New.
1034 (b4_token_defines): Use it to output tokens both as #define and
1035 enums.
1036 Suggested by Paul Eggert.
1037 * src/output.c (token_definitions_output): Don't output spurious
1038 white spaces.
1039
1f418995
AD
10402002-05-03 Akim Demaille <akim@epita.fr>
1041
1042 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1043
45119f04
RA
10442002-05-02 Robert Anisko <robert@lrde.epita.fr>
1045
1046 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1047 Update the stack class, give a try to deque as the default container.
1048
b2d52318
AD
10492002-05-02 Akim Demaille <akim@epita.fr>
1050
1051 * data/bison.simple (yyparse): Do not implement @$ = @1.
1052 (YYLLOC_DEFAULT): Adjust to do it.
1053 * doc/bison.texinfo (Location Default Action): Fix.
1054
3a8b4109
AD
10552002-05-02 Akim Demaille <akim@epita.fr>
1056
1057 * src/reader.c (parse_braces): Merge into...
1058 (parse_action): this.
1059
84614e13
AD
10602002-05-02 Akim Demaille <akim@epita.fr>
1061
1062 * configure.in (ALL_LINGUAS): Remove.
1063 * po/LINGUAS, hr.po: New.
1064
fdbcd8e2
AD
10652002-05-02 Akim Demaille <akim@epita.fr>
1066
1067 Remove the so called hairy (semantic) parsers.
1068
1069 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1070 * src/gram.h, src/gram.c (semantic_parser): Remove.
1071 (rule_t): Remove the guard and guard_line members.
1072 * src/lex.h (token_t): remove tok_guard.
1073 * src/options.c (option_table): Remove %guard and %semantic_parser
1074 support.
1075 * src/output.c, src/output.h (guards_output): Remove.
1076 (prepare): Adjust.
1077 (token_definitions_output): Don't output the `T'
1078 tokens (???).
1079 (output_skeleton): Don't output the guards.
1080 * src/files.c, src/files.c (attrsfile): Remove.
1081 * src/reader.c (symbol_list): Remove the guard and guard_line
1082 members.
1083 Adjust dependencies.
1084 (parse_guard): Remove.
1085 * data/bison.hairy: Remove.
1086 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1087 BISON_HAIRY.
1088
82b6cb3f
AD
10892002-05-02 Akim Demaille <akim@epita.fr>
1090
1091 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1092 (parse_guard): Rename the formal argument `stack_offset' as
1093 `rule_length', which is more readable.
1094 Adjust callers.
1095 (copy_at, copy_dollar): Instead of outputting the hard coded
1096 values of $$, $n and so forth, output invocation to b4_lhs_value,
1097 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1098 Note: this patch partially drops `semantic-parser' support: it
1099 always does `rule_length - n', where semantic parsers ought to
1100 always use `-n'.
82b6cb3f
AD
1101 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1102 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1103
6cbfbcc5
AD
11042002-05-02 Akim Demaille <akim@epita.fr>
1105
1106 * configure.in (AC_INIT): Bump to 1.49b.
1107 (AM_INIT_AUTOMAKE): Short invocation.
1108
b8548114
AD
11092002-05-02 Akim Demaille <akim@epita.fr>
1110
1111 Version 1.49a.
1112
c20cd1fa
AD
11132002-05-01 Akim Demaille <akim@epita.fr>
1114
1115 * src/skeleton.h: Remove.
1116
8a9566d4
AD
11172002-05-01 Akim Demaille <akim@epita.fr>
1118
1119 * src/skeleton.h: Fix the #endif.
1120 Reported by Magnus Fromreide.
1121
8c6d399a
PE
11222002-04-26 Paul Eggert <eggert@twinsun.com>
1123
1124 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1125 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 1126 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 1127
2b7ed18a
RA
11282002-04-25 Robert Anisko <robert@lrde.epita.fr>
1129
1130 * src/scan-skel.l: Postprocess quadrigraphs.
1131
1132 * src/reader.c (copy_character): New function, used to output
1133 single characters while replacing `[' and `]' with quadrigraphs, to
1134 avoid troubles with M4 quotes.
1135 (copy_comment): Output characters with copy_character.
1136 (read_additionnal_code): Likewise.
1137 (copy_string2): Likewise.
1138 (copy_definition): Likewise.
1139
1140 * tests/calc.at: Exercise M4 quoting.
1141
34a89c50
AD
11422002-04-25 Akim Demaille <akim@epita.fr>
1143
1144 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1145 between `!' and the command.
1146 Reported by Paul Eggert.
1147
0dd1580a
RA
11482002-04-24 Robert Anisko <robert@lrde.epita.fr>
1149
1150 * tests/calc.at: Exercise prologue splitting.
1151
1152 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1153 `b4_post_prologue' instead of `b4_prologue'.
1154
1155 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1156 muscles.
1157 (output): Free pre_prologue_obstack and post_prologue_obstack.
1158 * src/files.h, src/files.c (attrs_obstack): Remove.
1159 (pre_prologue_obstack, post_prologue_obstack): New.
1160 * src/reader.c (copy_definition): Add a parameter to specify the
1161 obstack to fill, instead of using attrs_obstack unconditionally.
1162 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1163 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1164
83c1796f
PE
11652002-04-23 Paul Eggert <eggert@twinsun.com>
1166
1167 * data/bison.simple: Remove unnecessary commentary and white
1168 space differences from 1_29-branch.
1169 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1170
1171 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1172 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1173 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1174 constructors or destructors.
1175
1176 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1177
1207eeac
AD
11782002-04-23 Akim Demaille <akim@epita.fr>
1179
1180 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1181 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1182 location with columns.
1183 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1184 All reported by Paul Eggert.
1185
78ab8f67
AD
11862002-04-22 Akim Demaille <akim@epita.fr>
1187
1188 * src/reduce.c (dump_grammar): Move to...
1189 * src/gram.h, src/gram.c (grammar_dump): here.
1190 Be sure to separate long item numbers.
1191 Don't read the members of a rule's prec if its nil.
1192
133c20e2
AD
11932002-04-22 Akim Demaille <akim@epita.fr>
1194
1195 * src/output.c (table_size, table_grow): New.
1196 (MAXTABLE): Remove, replace uses with table_size.
1197 (pack_vector): Instead of dying when the table is too big, grow it.
1198
9515e8a7
AD
11992002-04-22 Akim Demaille <akim@epita.fr>
1200
1201 * data/bison.simple (yyr1): Its type is that of a token number.
1202 * data/bison.c++ (r1_): Likewise.
1203 * tests/regression.at (Web2c Actions): Adjust.
1204
23c5a174
AD
12052002-04-22 Akim Demaille <akim@epita.fr>
1206
1207 * src/reader.c (token_translations_init): 256 is now the default
1208 value for the error token, i.e., it will be assigned another
1209 number if the user assigned 256 to one of her tokens.
1210 (reader): Don't force 256 to error.
1211 * doc/bison.texinfo (Symbols): Adjust.
1212 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1213 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1214 etc. instead of 10, 20, 30 (which was used to `jump' over error
1215 (256) and undefined (2)).
1216
5fbb0954
AD
12172002-04-22 Akim Demaille <akim@epita.fr>
1218
1219 Propagate more token_number_t.
1220
1221 * src/gram.h (token_number_as_item_number)
1222 (item_number_as_token_number): New.
1223 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1224 Use it to create output_item_number_table and
1225 output_token_number_table.
1226 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1227 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1228 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1229 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1230
4f940944
AD
12312002-04-22 Akim Demaille <akim@epita.fr>
1232
1233 * src/output.h, src/output.c (get_lines_number): Remove.
1234
3ded9a63
AD
12352002-04-19 Akim Demaille <akim@epita.fr>
1236
1237 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1238 as Lex/Flex'.
1239 (Debugging): More details about enabling the debugging features.
1240 (Table of Symbols): Describe $$, $n, @$, and @n.
1241 Suggested by Tim Josling.
1242
e0c471a9
AD
12432002-04-19 Akim Demaille <akim@epita.fr>
1244
1245 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1246
fecc10cd
AD
12472002-04-10 Akim Demaille <akim@epita.fr>
1248
1249 * src/system.h: Rely on HAVE_LIMITS_H.
1250 Suggested by Paul Eggert.
1251
51dec47b
AD
12522002-04-09 Akim Demaille <akim@epita.fr>
1253
1254 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1255 full stderr, and strip it according to the bison options, instead
1256 of composing the error message from different bits.
1257 This makes it easier to check for several error messages.
1258 Adjust all the invocations.
1259 Add an invocation exercising the error token.
1260 Add an invocation demonstrating a stupid error message.
1261 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1262 Adjust the tests.
1263 Error message are for stderr, not stdout.
1264
007a50a4
AD
12652002-04-09 Akim Demaille <akim@epita.fr>
1266
1267 * src/gram.h, src/gram.c (error_token_number): Remove, use
1268 errtoken->number.
1269 * src/reader.c (reader): Don't specify the user token number (2)
1270 for $undefined, as it uselessly prevents using it.
1271 * src/gram.h (token_number_t): Move to...
1272 * src/symtab.h: here.
1273 (state_t.number): Is a token_number_t.
1274 * src/print.c, src/reader.c: Use undeftoken->number instead of
1275 hard coded 2.
1276 (Even though this 2 is not the same as above: the number of the
1277 undeftoken remains being 2, it is its user token number which
1278 might not be 2).
1279 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1280 `user_token_number_max'.
1281 Output `undef_token_number'.
1282 * data/bison.simple, data/bison.c++: Use them.
1283 Be sure to map invalid yylex return values to
1284 `undef_token_number'. This saves us from gratuitous SEGV.
1285
1286 * tests/conflicts.at (Solved SR Conflicts)
1287 (Unresolved SR Conflicts): Adjust.
1288 * tests/regression.at (Web2c Actions): Adjust.
1289
06446ccf
AD
12902002-04-08 Akim Demaille <akim@epita.fr>
1291
1292 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1293 Adding #line.
1294 Remove the duplicate `typedefs'.
1295 (RhsNumberType): Fix the declaration and various other typos.
1296 Use __ofile__.
1297 * data/bison.simple: Use __ofile__.
1298 * src/scan-skel.l: Handle __ofile__.
1299
62a3e4f0
AD
13002002-04-08 Akim Demaille <akim@epita.fr>
1301
1302 * src/gram.h (item_number_t): New, the type of item numbers in
1303 RITEM. Note that it must be able to code symbol numbers as
1304 positive number, and the negation of rule numbers as negative
1305 numbers.
1306 Adjust all dependencies (pretty many).
1307 * src/reduce.c (rule): Remove this `short *' pointer: use
1308 item_number_t.
1309 * src/system.h (MINSHORT, MAXSHORT): Remove.
1310 Include `limits.h'.
1311 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1312 (shortcpy): Remove.
1313 (MAXTABLE): Move to...
1314 * src/output.c (MAXTABLE): here.
1315 (prepare_rules): Use output_int_table to output rhs.
1316 * data/bison.simple, data/bison.c++: Adjust.
1317 * tests/torture.at (Big triangle): Move the limit from 254 to
1318 500.
1319 * tests/regression.at (Web2c Actions): Ajust.
1320
1321 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1322 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1323 passes, but produces negative #line number, once fixed, GCC is
1324 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1325 C), it passes.
1326 * src/state.h (state_h): Code input lines on ints, not shorts.
1327
bb88b0fc
AD
13282002-04-08 Akim Demaille <akim@epita.fr>
1329
1330 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1331 and then the grammar.
1332
9a636f47
AD
13332002-04-08 Akim Demaille <akim@epita.fr>
1334
1335 * src/system.h: No longer using strndup.
1336
680e8701
AD
13372002-04-07 Akim Demaille <akim@epita.fr>
1338
1339 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1340 * src/output.c (output_table_data): Return the longest number.
1341 (prepare_tokens): Output `token_number_max').
1342 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1343 New.
1344 Use them to define yy_token_number_type/TokenNumberType.
1345 Use this type for yytranslate.
1346 * tests/torture.at (Big triangle): Push the limit from 124 to
1347 253.
1348 * tests/regression.at (Web2c Actions): Adjust.
1349
817e9f41
AD
13502002-04-07 Akim Demaille <akim@epita.fr>
1351
1352 * tests/torture.at (Big triangle): New.
1353 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1354 * tests/existing.at: here.
1355
5123689b
AD
13562002-04-07 Akim Demaille <akim@epita.fr>
1357
1358 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1359 nritems.
1360 Adjust dependencies.
1361
f3849179
AD
13622002-04-07 Akim Demaille <akim@epita.fr>
1363
1364 * src/reader.c: Normalize increments to prefix form.
1365
bd02036a
AD
13662002-04-07 Akim Demaille <akim@epita.fr>
1367
1368 * src/reader.c, symtab.c: Remove debugging code.
1369
db8837cb
AD
13702002-04-07 Akim Demaille <akim@epita.fr>
1371
1372 Rename all the `bucket's as `symbol_t'.
1373
1374 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1375 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1376 * src/symtab.c, src/symtab.h (bucket): Rename as...
1377 (symbol_t): this.
1378 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1379 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1380 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1381 (buckets_new, buckets_free, buckets_do): Rename as...
1382 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1383 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1384 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1385 (symbols_new, symbols_free, symbols_do): these.
1386
72a23c97
AD
13872002-04-07 Akim Demaille <akim@epita.fr>
1388
1389 Use lib/hash for the symbol table.
1390
1391 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1392 EOF.
1393 * src/lex.c (lex): Set the `number' member of new terminals.
1394 * src/reader.c (bucket_check_defined, bucket_make_alias)
1395 (bucket_check_alias_consistence, bucket_translation): New.
1396 (reader, grammar_free, readgram, token_translations_init)
1397 (packsymbols): Adjust.
1398 (reader): Number the predefined tokens.
1399 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1400 for predefined tokens.
1401 * src/symtab.h (bucket): Remove all the hash table related
1402 members.
1403 * src/symtab.c (symtab): Replace by...
1404 (bucket_table): this.
1405 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1406 (buckets_new, buckets_do): New.
1407
280a38c3
AD
14082002-04-07 Akim Demaille <akim@epita.fr>
1409
1410 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1411 (start_symbol, max_user_token_number, semantic_parser)
1412 (error_token_number): Initialize.
1413 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1414 Initialize.
1415 (reader): Don't.
1416 (errtoken, eoftoken, undeftoken, axiom): Extern.
1417
03b31c0c
AD
14182002-04-07 Akim Demaille <akim@epita.fr>
1419
1420 * src/gram.h (rule_s): prec and precsym are now pointers
1421 to the bucket giving the priority/associativity.
1422 Member `associativity' removed: useless.
1423 * src/reduce.c, src/conflicts.c: Adjust.
1424
8b3df748
AD
14252002-04-07 Akim Demaille <akim@epita.fr>
1426
1427 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1428 Properly escape the symbols' TAG when outputting them.
1429
e601aa1d
AD
14302002-04-07 Akim Demaille <akim@epita.fr>
1431
1432 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1433
b0299a2e
AD
14342002-04-07 Akim Demaille <akim@epita.fr>
1435
1436 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1437 (LArule): this, which is an array to rule_t*.
1438 * src/print.c, src/conflicts.c: Adjust.
1439
d7e1f00c
AD
14402002-04-07 Akim Demaille <akim@epita.fr>
1441
1442 * src/gram.h (rule_t): Rename `number' as `user_number'.
1443 `number' is a new member.
1444 Adjust dependencies.
1445 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1446
cc9305dd
AD
14472002-04-07 Akim Demaille <akim@epita.fr>
1448
1449 As a result of the previous patch, it is no longer needed
1450 to reorder ritem itself.
1451
1452 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1453
b0940840
AD
14542002-04-07 Akim Demaille <akim@epita.fr>
1455
1456 Be sure never to walk through RITEMS, but use only data related to
1457 the rules themselves. RITEMS should be banished.
1458
1459 * src/output.c (output_token_translations): Rename as...
1460 (prepare_tokens): this.
1461 In addition to `translate', prepare the muscles `tname' and
1462 `toknum', which were handled by...
1463 (output_rule_data): this.
1464 Remove, and move the remainder of its outputs into...
1465 (prepare_rules): this new routines, which also merges content from
1466 (output_gram): this.
1467 (prepare_rules): Be sure never to walk through RITEMS.
1468 (output_stos): Rename as...
1469 (prepare_stos): this.
1470 (output): Always invoke prepare_states, after all, just don't use it
1471 in the output if you don't need it.
1472
643a5994
AD
14732002-04-07 Akim Demaille <akim@epita.fr>
1474
1475 * src/LR0.c (new_state): Display `nstates' as the name of the
1476 newly created state.
1477 Adjust to initialize first_state and last_state if needed.
1478 Be sure to distinguish the initial from the final state.
1479 (new_states): Create the itemset of the initial state, and use
1480 new_state.
1481 * src/closure.c (closure): Now that the initial state has its
1482 items properly set, there is no need for a special case when
1483 creating `ruleset'.
1484
1485 As a result, now the rule 0, reducing to $axiom, is visible in the
1486 outputs. Adjust the test suite.
1487
1488 * tests/conflicts.at (Solved SR Conflicts)
1489 (Unresolved SR Conflicts): Adjust.
1490 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1491 * tests/conflicts.at (S/R in initial): New.
1492
b4c4ccc2
AD
14932002-04-07 Akim Demaille <akim@epita.fr>
1494
1495 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1496 the RHS of the rules.
1497 * src/output.c (output_gram): Likewise.
1498
bba97eb2
AD
14992002-04-07 Akim Demaille <akim@epita.fr>
1500
1501 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1502 bucket.
1503 Adjust all dependencies.
1504 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1505 `number' of the buckets too.
1506 * src/gram.h: Include `symtab.h'.
1507 (associativity): Move to...
1508 * src/symtab.h: here.
1509 No longer include `gram.h'.
1510
c3b407f4
AD
15112002-04-07 Akim Demaille <akim@epita.fr>
1512
1513 * src/gram.h, src/gram.c (rules_rhs_length): New.
1514 (ritem_longest_rhs): Use it.
1515 * src/gram.h (rule_t): `number' is a new member.
1516 * src/reader.c (packgram): Set it.
1517 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1518 the end of `rules', and count them out of `nrules'.
1519 (reduce_output, dump_grammar): Adjust.
1520 * src/print.c (print_grammar): It is no longer needed to check for
1521 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1522 * tests/reduce.at (Reduced Automaton): New test.
1523
11652ab3
AD
15242002-04-07 Akim Demaille <akim@epita.fr>
1525
1526 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1527 lacking `+ 1' to nrules, Bison reported as useless a token if it
1528 was used solely to set the precedence of the last rule...
1529
26b23c1a
AD
15302002-04-07 Akim Demaille <akim@epita.fr>
1531
1532 * data/bison.c++, data/bison.simple: Don't output the current file
1533 name in #line, to avoid useless diffs between two identical
1534 outputs under different names.
1535
18bcecb0
AD
15362002-04-07 Akim Demaille <akim@epita.fr>
1537
1538 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1539 Normalize loops to using `< nrules + 1', not `<= nrules'.
1540
fa770c86
AD
15412002-04-07 Akim Demaille <akim@epita.fr>
1542
1543 * TODO: Update.
1544
d9b739c3
AD
15452002-04-07 Akim Demaille <akim@epita.fr>
1546
1547 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1548 bucket.value as bucket.number.
1549
99013900
AD
15502002-04-07 Akim Demaille <akim@epita.fr>
1551
1552 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1553 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1554 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1555 RHS, instead of being an index in RITEMS.
1556
e966383b
PE
15572002-04-04 Paul Eggert <eggert@twinsun.com>
1558
1559 * doc/bison.texinfo: Update copyright date.
1560 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1561 (Symbols): Warn about running Bison in one character set,
1562 but compiling and/or running in an incompatible one.
1563 Warn about character code 256, too.
1564
15652002-04-03 Paul Eggert <eggert@twinsun.com>
1566
1567 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1568 YYERROR_VERBOSE is nonzero, not whether it is defined.
1569
1570 Merge changes from bison-1_29-branch.
c307773e 1571
8d6c48b9
PE
15722002-03-20 Paul Eggert <eggert@twinsun.com>
1573
1574 Merge fixes from Debian bison_1.34-1.diff.
1575
1576 * configure.in (AC_PREREQ): 2.53.
1577
e53c6322
AD
15782002-03-20 Akim Demaille <akim@epita.fr>
1579
1580 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1581
9ffbeca7
PE
15822002-03-19 Paul Eggert <eggert@twinsun.com>
1583
21db0b2a
PE
1584 * src/bison.simple (YYCOPY): New macro.
1585 (YYSTACK_RELOCATE): Use it.
1586 Remove Type arg; no longer needed. All callers changed.
1587 (yymemcpy): Remove; no longer needed.
1588
9ffbeca7
PE
1589 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1590 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1591
642cb8f8
AD
15922002-03-19 Akim Demaille <akim@epita.fr>
1593
1594 Test and fix the #line outputs.
1595
1596 * tests/atlocal.at (GCC): New.
1597 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1598 (Prologue synch line, ,%union synch line, Postprologue synch line)
1599 (Action synch line, Epilogue synch line): New tests.
1600 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1601 * data/bison.simple, data/bison.c++: Use it.
1602
3c31a486
AD
16032002-03-19 Akim Demaille <akim@epita.fr>
1604
1605 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1606 (Solved SR Conflicts, %expect not enough, %expect right)
1607 (%expect too much): Move to...
1608 * tests/conflicts.at: this new file.
1609
0d8bed56
AD
16102002-03-19 Akim Demaille <akim@epita.fr>
1611
1612 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1613 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1614 that we can move to enums for instance.
1615 * src/output.c (token_definitions_output): Output a list of
1616 `token-name, token-number' instead of the #define.
1617 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1618
9208d17f
AD
16192002-03-14 Akim Demaille <akim@epita.fr>
1620
1621 Use Gettext 0.11.1.
1622
af27eacb
RA
16232002-03-09 Robert Anisko <robert@lrde.epita.fr>
1624
1625 * data/bison.c++: Make the user able to add members to the generated
1626 parser by subclassing.
1627
9101a310
RA
16282002-03-05 Robert Anisko <robert@lrde.epita.fr>
1629
1630 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1631 a character.
1632 Reported by Nicolas Tisserand and Nicolas Burrus.
1633
fff9bf0b
RA
16342002-03-04 Robert Anisko <robert@lrde.epita.fr>
1635
1636 * src/reader.c: Warn about lacking semi-colons, do not complain.
1637
64dba31e
RA
16382002-03-04 Robert Anisko <robert@lrde.epita.fr>
1639
1640 * data/bison.c++: Remove a debug line.
1641
374f5a14
RA
16422002-03-04 Robert Anisko <robert@lrde.epita.fr>
1643
1644 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1645 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1646 provide a default implementation.
1647
bfcf1f3a
AD
16482002-03-04 Akim Demaille <akim@epita.fr>
1649
1650 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1651 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1652 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1653 * tests/semantic.at (Parsing Guards): Similarly.
1654 * src/reader.at (readgram): Complain if the last rule is not ended
1655 with a semi-colon.
1656
65ccf9fc
AD
16572002-03-04 Akim Demaille <akim@epita.fr>
1658
1659 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1660 * src/closure.c: here.
1661 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1662 RTC.
1663 * src/warshall.h, src/warshall.c: Remove.
1664 * tests/sets.at (Broken Closure): Adjust.
1665
d0039cbc
AD
16662002-03-04 Akim Demaille <akim@epita.fr>
1667
1668 * src/output.c (output_skeleton): tempdir is const.
1669 bytes_read is unused.
1670
345cea78
AD
16712002-03-04 Akim Demaille <akim@epita.fr>
1672
1673 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1674 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1675 Update.
1676 From Michael Hayes.
1677
564801f7
AD
16782002-03-04 Akim Demaille <akim@epita.fr>
1679
1680 * src/closure.c (closure): `r' is unused.
1681
e5352bc7
AD
16822002-03-04 Akim Demaille <akim@epita.fr>
1683
1684 * tests/sets.at (Broken Closure): Add the ending `;'.
1685 * src/reader.at (readgram): Complain if a rule is not ended with a
1686 semi-colon.
1687
914feea9
AD
16882002-03-04 Akim Demaille <akim@epita.fr>
1689
1690 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1691 (count_sr_conflicts): Use bitset_count.
1692 * src/reduce.c (inaccessable_symbols): Ditto.
1693 (bits_size): Remove.
1694 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1695
f0250de6
AD
16962002-03-04 Akim Demaille <akim@epita.fr>
1697
1698 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1699 * src/reduce.c: Remove the `bitset_zero's following the
1700 `bitset_create's, as now it is performed by the latter.
1701
ef017502
AD
17022002-03-04 Akim Demaille <akim@epita.fr>
1703
1704 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1705 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1706 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1707 latest sources from Michael.
1708
76514394
AD
17092002-03-04 Akim Demaille <akim@epita.fr>
1710
1711 * src/output.c (output): Don't free the grammar.
1712 * src/reader.c (grammar_free): New.
1713 * src/main.c (main): Call it and don't free symtab here.
1714
55024580
AD
17152002-03-04 Akim Demaille <akim@epita.fr>
1716
1717 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1718 before returning.
1719 Reported by Benoit Perrot.
1720
f9abaa2c
AD
17212002-03-04 Akim Demaille <akim@epita.fr>
1722
1723 Use bitset operations when possible, not loops over bits.
1724
1725 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1726 bitset_or.
1727 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1728 * src/reduce.c (useless_nonterminals): Formatting changes.
1729 * src/warshall.c (TC): Use bitset_or.
1730
0e721e75
AD
17312002-03-04 Akim Demaille <akim@epita.fr>
1732
1733 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1734 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1735 Ditto.
1736
0fb1ffb1
AD
17372002-03-04 Akim Demaille <akim@epita.fr>
1738
1739 * src/lalr.c (F): Now a bitset*.
1740 Adjust all dependencies.
1741
b86796bf
AD
17422002-03-04 Akim Demaille <akim@epita.fr>
1743
1744 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1745 Adjust all dependencies.
1746
602bbf31
AD
17472002-03-04 Akim Demaille <akim@epita.fr>
1748
1749 * src/L0.c, src/LR0.h (nstates): Be size_t.
1750 Adjust comparisons (signed vs unsigned).
1751 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1752 bitset*.
1753 Adjust all dependencies.
1754
d8a0245c
AD
17552002-03-04 Akim Demaille <akim@epita.fr>
1756
1757 * src/closure.c (firsts): Now, also a bitset.
1758 Adjust all dependencies.
1759 (varsetsize): Remove, now unused.
1760 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1761
34ba9743
AD
17622002-03-04 Akim Demaille <akim@epita.fr>
1763
1764 * src/print.c: Convert to use bitset.h, not hand coded iterations
1765 over ints.
1766
ed86e78c
AD
17672002-03-04 Akim Demaille <akim@epita.fr>
1768
1769 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1770
dfdb1797
AD
17712002-03-04 Akim Demaille <akim@epita.fr>
1772
1773 * src/closure.c (ruleset): Be a bitset.
1774 (rulesetsize): Remove.
1775
7086e707
AD
17762002-03-04 Akim Demaille <akim@epita.fr>
1777
1778 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1779 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1780 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1781 * src/closure.c (fderives): Be an array of bitsets.
1782
98254360
RA
17832002-02-28 Robert Anisko <robert@lrde.epita.fr>
1784
1785 * data/bison.c++: Merge the two generated headers. Insert a copyright
1786 notice in each output file.
1787
a75c057f
AD
17882002-02-28 Akim Demaille <akim@epita.fr>
1789
1790 * data/bison.c++: Copy the prologue of bison.simple to fetch
1791 useful M4 definitions, such as b4_header_guard.
1792
06b00abc
AD
17932002-02-25 Akim Demaille <akim@epita.fr>
1794
1795 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1796 translator friendly scheme for the bgr
1797 copyright notice.
06b00abc 1798
70e7d534
AD
17992002-02-25 Akim Demaille <akim@epita.fr>
1800
1801 * src/output.c (header_output): Remove, now handled completely via
1802 M4.
1803
abe017f6
AD
18042002-02-25 Akim Demaille <akim@epita.fr>
1805
1806 * m4/m4.m4: New, from CVS Autoconf.
1807 * configure.in: Invoke it.
1808 * src/output.c (output_skeleton): Use its result instead of the
1809 hard coded name.
1810
381fb12e
AD
18112002-02-25 Akim Demaille <akim@epita.fr>
1812
1813 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1814 Fileutils 4.1.5.
1815 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1816 * src/output.c (output_skeleton): Use mkstemp to create a real
1817 temporary file.
1818 Move the filling of `skeleton' and its muscle to...
1819 (prepare): here.
1820 (output): Move the definition of the prologue muscle to...
1821 (prepare): here.
1822 * src/system.h (DEFAULT_TMPDIR): New.
1823
6f38107f
PE
18242002-02-14 Paul Eggert <eggert@twinsun.com>
1825
1826 Remove the support for C++ namespace cleanliness; it was
1827 causing more problems than it was curing, since it didn't work
1828 properly on some nonstandard C++ compilers. This can wait
1829 for a proper C++ parser.
1830
1831 * NEWS: Document this.
1832 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1833 of C++, as it's treated like C now.
1834 * src/bison.simple (YYSTD): Remove.
1835 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1836 Treat C++ just like Standard C instead of trying to support
1837 namespace cleanliness.
1838
80cce3da
AD
18392002-02-14 Akim Demaille <akim@epita.fr>
1840
1841 * tests/regression.at (else): Adjust to Andreas' change.
1842
842e8679
AD
18432002-02-14 Akim Demaille <akim@epita.fr>
1844
1845 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1846
4bda3f10
AD
18472002-02-13 Andreas Schwab <schwab@suse.de>
1848
1849 * src/output.c (output_rule_data): Don't output NULL, it might
1850 not be defined yet.
1851
4162fa07 18522002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 1853
4162fa07
RA
1854 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1855 (Copyright notice): Update.
b418ecd8 1856
bd16a5dc
AD
18572002-02-11 Akim Demaille <akim@epita.fr>
1858
1859 * tests/regression.at (%nonassoc and eof): Don't include
1860 nonportable headers.
1861
8d69a1a3
RA
18622002-02-08 Robert Anisko <robert@lrde.epita.fr>
1863
1864 * data/bison.c++: Correct error recovery. Make the user able to
1865 initialize the starting location.
1866
9b2d0677
AD
18672002-02-07 Akim Demaille <akim@epita.fr>
1868
1869 * tests/input.at: New.
1870
69e2658b
RA
18712002-02-07 Robert Anisko <robert@lrde.epita.fr>
1872
1873 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 1874 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
1875 directives around tables only needed for debugging.
1876
4aacc3a7
RA
18772002-02-07 Robert Anisko <robert@lrde.epita.fr>
1878
1879 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1880 C++ parsers.
1881 (yy::b4_name::parse): Use print_.
1882
762a801e
RA
18832002-02-07 Robert Anisko <robert@lrde.epita.fr>
1884
1885 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1886
4bb2bc3f
RA
18872002-02-07 Robert Anisko <robert@lrde.epita.fr>
1888
1889 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1890 C++ parsers.
1891 (yy::b4_name::parse): Build verbose error messages, and use error_.
1892
6b45a3ca
RA
18932002-02-06 Robert Anisko <robert@lrde.epita.fr>
1894
1895 * data/bison.c++: Fix m4 quoting in comments.
1896
50997c6e
RA
18972002-02-06 Robert Anisko <robert@lrde.epita.fr>
1898
1899 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1900 not expanded by m4.
1901
3f3eed27
AD
19022002-02-05 Akim Demaille <akim@epita.fr>
1903
1904 * data/bison.c++: Adjust to the M4 back end.
1905 More is certainly needed.
1906
be2a1a68
AD
19072002-02-05 Akim Demaille <akim@epita.fr>
1908
1909 Give a try to M4 as a back end.
1910
1911 * lib/readpipe.c: New, from wdiff.
1912 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1913 BISON_HAIRY.
1914 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1915 specific values. Now it is m4 that performs the lookup.
1916 * src/parse-skel.y: Remove.
1917 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1918 * src/output.c (actions_output, guards_output)
1919 (token_definitions_output): No longer keeps track of the output
1920 line number, hence remove the second argument.
1921 (guards_output): Check against the guard member of a rule, not the
1922 action member.
1923 Adjust callers.
1924 (output_skeleton): Don't look for the skeleton location, let m4 do
1925 that.
1926 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1927 file will be used.
1928 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1929 (prepare): Given that for the time being changesyntax is not
1930 usable in M4, rename the muscles using `-' to `_'.
1931 Define `defines_flag', `output_parser_name' and `output_header_name'.
1932 * src/output.h (actions_output, guards_output)
1933 (token_definitions_output): Adjust prototypes.
1934 * src/scan-skel.l: Instead of scanning the skeletons, it now
1935 processes the output of m4: `__oline__' and `#output'.
1936 * data/bison.simple: Adjust to be used by M4(sugar).
1937 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1938 to date.
1939 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1940 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1941 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1942 shamelessly stolen from CVS Autoconf.
1943
beda758b
AD
19442002-02-05 Akim Demaille <akim@epita.fr>
1945
1946 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1947 * configure.in: Check for the declarations of free and malloc.
1948 * src/muscle_tab.c: Adjust.
1949
5ece6d43
AD
19502002-02-05 Akim Demaille <akim@epita.fr>
1951
1952 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1953 which have no values.
1954
5bb18f9a
AD
19552002-02-05 Akim Demaille <akim@epita.fr>
1956
1957 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1958 * data/: here.
1959
894dd62e
PE
19602002-01-29 Paul Eggert <eggert@twinsun.com>
1961
1962 * src/bison.simple (YYSIZE_T): Do not define merely because
1963 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1964 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1965
82841af7
AD
19662002-01-27 Akim Demaille <akim@epita.fr>
1967
1968 Fix `%nonassoc and eof'.
1969
1970 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1971 which were not properly copied! Replace
1972 memcpy (res->errs, src->errs, src->nerrs);
1973 with
1974 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1975 !!!
1976 * tests/regression.at (%nonassoc and eof): Adjust to newest
1977 Autotest: `.' is not in the PATH.
1978
318b76e9
AD
19792002-01-27 Akim Demaille <akim@epita.fr>
1980
1981 * tests/sets.at (AT_EXTRACT_SETS): New.
1982 (Nullable): Use it.
1983 (Firsts): New.
1984
30d2f3d5
AD
19852002-01-26 Akim Demaille <akim@epita.fr>
1986
1987 * tests/actions.at, tests/calc.at, tests/headers.at,
1988 * tests/torture.at: Adjust to the newest Autotest which no longer
1989 forces `.' in the PATH.
1990
30f8c395
AD
19912002-01-25 Akim Demaille <akim@epita.fr>
1992
1993 * tests/regression.at (%nonassoc and eof): New.
1994 Suggested by Robert Anisko.
1995
29ae55f1
AD
19962002-01-24 Akim Demaille <akim@epita.fr>
1997
1998 Bison dumps core when trying to complain about broken input files.
1999 Reported by Cris van Pelt.
2000
2001 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2002 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2003 into...
2004 (Invalid inputs): Strengthen: exercise parse_percent_token.
2005
2b548aa6
RA
20062002-01-24 Robert Anisko <robert.anisko@epita.fr>
2007
2008 * src/Makefile.am: Add bison.c++.
2009 * src/bison.c++: New skeleton.
2010
bb0146c2
AD
20112002-01-21 Paolo Bonzini <bonzini@gnu.org>
2012
2013 * po/it.po: New.
2014
bec30531
AD
20152002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2016
2017 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2018
fc6edc45
MA
20192002-01-20 Marc Autret <marc@gnu.org>
2020
2021 * src/files.c (compute_output_file_names): Fix
2022
5e5d5415
MA
20232002-01-20 Marc Autret <marc@gnu.org>
2024
2025 * tests/output.at: New test.
2026 * src/files.c (compute_base_names): Don't map extensions when
2027 the YACC flag is set, use defaults.
2028 Reported by Evgeny Stambulchik.
2029
44ea3fbd
MA
20302002-01-20 Marc Autret <marc@gnu.org>
2031
bb0146c2 2032 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2033 compilers as well (i.e. the vendor C compiler).
2034 Suggested by Albert Chin-A-Young.
2035
338963d1
TVH
20362002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2037
2038 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2039 canonical definition.
2040 * src/system.h: Use the canonical definition for PARAMS (avoids
2041 a conflict with the macro from lib/hash.h).
2042
c57b2479
AD
20432002-01-11 Akim Demaille <akim@epita.fr>
2044
2045 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2046 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2047
b85810ae
AD
20482002-01-09 Akim Demaille <akim@epita.fr>
2049
2050 * src/files.c, src/files.h (output_infix): New.
2051 (tab_extension): Remove.
2052 (compute_base_names): Compute the former, drop the latter.
2053 * src/output.c (prepare): Insert the muscles `output-infix', and
2054 `output-suffix'.
2055 * src/parse-skel.y (string, string.1): New.
2056 (section.header): Use it.
2057 (section.yacc): Remove.
2058 (prefix): Remove too.
2059 * src/scan-skel.l: Adjust.
2060 * src/bison.simple, src/bison.hairy: Adjust.
2061
cae60122
AD
20622002-01-09 Akim Demaille <akim@epita.fr>
2063
2064 * configure.in (WERROR_CFLAGS): Compute it.
2065 * src/Makefile.am (CFLAGS): Pass it.
2066 * tests/atlocal.in (CFLAGS): Idem.
2067 * src/files.c: Fix a few warnings.
2068 (get_extension_index): Remove, unused.
2069
ae404801
AD
20702002-01-08 Akim Demaille <akim@epita.fr>
2071
2072 * src/getargs.c (AS_FILE_NAME): New.
2073 (getargs): Use it to convert DOSish file names.
2074 * src/files.c (base_name): Rename as full_base_name to avoid
2075 clashes with `base_name ()'.
2076 (filename_split): New.
2077 (compute_base_names): N-th rewrite, using filename_split.
2078
22312b71
AD
20792002-01-08 Akim Demaille <akim@epita.fr>
2080
2081 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2082 New, stolen from the Fileutils 4.1.
2083 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2084 * configure.in: Check for the presence of memrchr, and of its
2085 prototype.
2086
a67cef01
TVH
20872002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2088
2089 * lib/hash.h (__P): Added definition for this macro.
2090 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2091 BUILT_SOURCES, to ensure they are generated first.
2092 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2093 %error-verbose to allow bootstrapping with bison 1.30x.
2094
2b25d624
AD
20952002-01-06 Akim Demaille <akim@epita.fr>
2096
2097 * src/reader.c (parse_braces): Don't fetch the next char, the
2098 convention is to fetch on entry.
2099 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2100 'switch' without a following semicolon.
2101 * tests/regression.at (braces parsing): New.
2102
3460813b
AD
21032002-01-06 Akim Demaille <akim@epita.fr>
2104
2105 Bison is dead wrong in its RR conflict reports.
2106
2107 * tests/torture.at (GNU Cim Grammar): New.
2108 * src/conflicts.c (count_rr_conflicts): Fix.
2109
73784c64
AD
21102002-01-06 Akim Demaille <akim@epita.fr>
2111
2112 Creating package.m4 from configure.ac causes too many problems.
2113
2114 * tests/Makefile.am (package.m4): Create it by hand,
2115 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2116
25d81090
AD
21172002-01-06 Akim Demaille <akim@epita.fr>
2118
2119 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2120 skeleton.h.
2121
a9b8959e
PE
21222002-01-04 Paul Eggert <eggert@twinsun.com>
2123
2124 * doc/bison.texinfo (Debugging):
2125 Remove YYSTDERR; it's no longer defined or used.
2126 Also, s/cstdio.h/cstdio/.
2127
25d81090
AD
21282002-01-03 Akim Demaille <akim@epita.fr>
2129
2130 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2131
1109455c
AD
21322002-01-03 Akim Demaille <akim@epita.fr>
2133
2134 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2135 tracing code to --trace, wait for a better --trace option, with
2136 args.
2137
7ea5e977
AD
21382002-01-03 Akim Demaille <akim@epita.fr>
2139
2140 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2141 The ISO C++ standard is extremely clear about it: stderr is
2142 considered a macro, not a regular symbol (see table 94 `Header
2143 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2144 Therefore std:: does not apply to it. It still does with fprintf.
2145 Also, s/cstdio.h/cstdio/.
2146
fab5b110
AD
21472002-01-03 Akim Demaille <akim@epita.fr>
2148
2149 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2150 for non system headers.
2151
aed7fd9b
AD
21522002-01-02 Akim Demaille <akim@epita.fr>
2153
2154 Equip the skeleton chain with location tracking, runtime trace,
2155 pure parser and scanner.
2156
2157 * src/parse-skel.y: Request a pure parser, locations, and prefix
2158 renaming.
2159 (%union): Having several members with the same type does not help
2160 type mismatches, simplify.
2161 (YYPRINT, yyprint): New.
2162 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2163 (skel_error): this.
2164 Handle locations.
2165 * src/scan-skel.l: Adjust to these changes.
2166 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2167 (LOCATION_PRINT, skel_control_t): New.
2168
24fad99e
AD
21692001-12-30 Akim Demaille <akim@epita.fr>
2170
2171 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2172 replace `gb' with BLANKS.
2173 * src/scan-skel.l: Adjust.
2174
a4b36db4
AD
21752001-12-30 Akim Demaille <akim@epita.fr>
2176
2177 * src/system.h: We don't need nor want bcopy.
2178 Throw away MS-DOS crap: we don't need getpid.
2179 * configure.in: We don't need strndup. It was even causing
2180 problems: because Flex includes the headers *before* us,
2181 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2182 not visible.
2183 * lib/xstrndup.c: New.
2184 * src/scan-skel.l: Use it.
2185 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2186 * src/parse-skel.y: Use %directives instead of #defines.
2187
1239777d
AD
21882001-12-30 Akim Demaille <akim@epita.fr>
2189
2190 * src/skeleton.h: New.
2191 * src/output.c (output_parser, output_master_parser): Remove, dead
2192 code.
2193 * src/output.h (get_lines_number, actions_output, guards_output)
2194 (token_definitions_output): Prototype them.
2195 * src/parse-skel.y: Add the license notice.
2196 Include output.h and skeleton.h.
2197 (process_skeleton): Returns void, and takes a single parameter.
2198 * src/scan-skel.l: Add the license notice.
2199 Include skeleton.h.
2200 Don't use %option yylineno: it seems that then Flex imagines
2201 REJECT has been used, and therefore it won't reallocate its
2202 buffers (which makes no other sense to me than a bug). It results
2203 in warnings for `unused: yy_flex_realloc'.
2204
9b3add5b
RA
22052001-12-30 Robert Anisko <robert.anisko@epita.fr>
2206
2207 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2208 (MUSCLE_INSERT_PREFIX): ...to there.
2209 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2210 (MUSCLE_INSERT_PREFIX): Move from here...
2211
2212 * src/bison.hairy: Add a section directive. Put braces around muscle
2213 names. This parser skeleton is still broken, but Bison should not
2214 choke on a bad muscle 'syntax'.
2215 * src/bison.simple: Add a section directive. Put braces around muscle
2216 names.
2217
2218 * src/files.h (strsuffix, stringappend): Add declarations.
2219 (tab_extension): Add declaration.
2220 (short_base_name): Add declaration.
2221
2222 * src/files.c (strsuffix, stringappend): No longer static. These
2223 functions are used in the skeleton parser.
2224 (tab_extension): New.
2225 (compute_base_names): Use the computations done in this function
fab5b110 2226 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
2227 names.
2228 (short_base_name): No longer static.
2229
2230 * src/output.c (output_skeleton): New.
2231 (output): Disable call to output_master_parser, and give a try to
2232 a new skeleton handling system.
2233 (guards_output, actions_output): No longer static.
2234 (token_definitions_output, get_lines_number): No longer static.
2235
2236 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2237
fab5b110 2238 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
2239 parse-skel.y.
2240
2241 * src/parse-skel.y: New file.
2242 * src/scan-skel.l: New file.
2243
b5b61c61
AD
22442001-12-29 Akim Demaille <akim@epita.fr>
2245
2246 %name-prefix is broken.
2247
2248 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2249 Adjust all dependencies.
2250 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2251 %name-prefix.
2252
2253 Renaming yylval but not yylloc is not consistent. Now we do.
2254
2255 * src/bison.simple: Prefix yylloc if used.
2256 * doc/bison.texinfo (Decl Summary): Document that.
2257
8c9a50be
AD
22582001-12-29 Akim Demaille <akim@epita.fr>
2259
2260 * doc/bison.texinfo: Promote `%long-directive' over
2261 `%long_directive'.
2262 Remove all references to fixed-output-files, yacc is enough.
2263
d99361e6
AD
22642001-12-29 Akim Demaille <akim@epita.fr>
2265
2266 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2267 user prologue. These are defaults.
2268 * tests/actions.at (Mid-rule actions): Make sure the user can
2269 define YYDEBUG and YYERROR_VERBOSE.
2270
b9cecb91
AD
22712001-12-29 Akim Demaille <akim@epita.fr>
2272
2273 * src/output.c (header_output): Don't forget to export YYLTYPE and
2274 yylloc.
2275 * tests/headers.at (export YYLTYPE): New, make sure it does.
2276 * tests/regression.at (%union and --defines, Invalid CPP headers):
2277 Move to...
2278 * tests/headers.at: here.
2279
aea13e97
AD
22802001-12-29 Akim Demaille <akim@epita.fr>
2281
2282 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2283
931394cb
AD
22842001-12-29 Akim Demaille <akim@epita.fr>
2285
2286 * tests/actions.at (Mid-rule actions): Output on a single line
2287 instead of several.
2288
704a47c4
AD
22892001-12-29 Akim Demaille <akim@epita.fr>
2290
2291 * doc/bison.texinfo: Formatting changes.
2292
091e20bb
AD
22932001-12-29 Akim Demaille <akim@epita.fr>
2294
2295 Don't store the token defs in a muscle, just be ready to output it
2296 on command. Now possible via `symbols'. Fixes a memory leak.
2297
2298 * src/output.c (token_definitions_output): New.
2299 (output_parser, header_output): Use it.
2300 * src/reader.c (symbols_save): Remove.
2301
cce71710
AD
23022001-12-29 Akim Demaille <akim@epita.fr>
2303
2304 * src/bison.simple: Do not provide a default for YYSTYPE and
2305 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2306 default.
2307
82c035a8
AD
23082001-12-29 Akim Demaille <akim@epita.fr>
2309
2310 Mid-rule actions are simply... ignored!
2311
2312 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2313 the empty-rule associated to the dummy symbol, not to the host
2314 rule.
2315 * tests/actions.at (Mid-rule actions): New.
2316
8419d367
AD
23172001-12-29 Akim Demaille <akim@epita.fr>
2318
2319 Memory leak.
2320
2321 * src/reader.c (reader): Free grammar.
2322
375d5806
AD
23232001-12-29 Akim Demaille <akim@epita.fr>
2324
2325 Memory leak.
2326
2327 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2328 since it allocates it for each state, although only one is needed.
2329 (allocate_storage): Do it here.
2330
f51cb8ff
AD
23312001-12-29 Akim Demaille <akim@epita.fr>
2332
2333 * src/options.h, src/options.c (create_long_option_table): Rename
2334 as...
2335 (long_option_table_new): this, with a clearer prototype.
2336 (percent_table): Remove, unused,
2337 * src/getargs.c (getargs): Adjust.
2338
29e88316
AD
23392001-12-29 Akim Demaille <akim@epita.fr>
2340
2341 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2342 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2343 as states.
2344
b9f71f19
AD
23452001-12-29 Akim Demaille <akim@epita.fr>
2346
2347 * src/lalr.c (build_relations): Rename `states' as `states1'.
2348 Sorry, I don't understand exactly what it is, no better name...
2349
1a2b5d37
AD
23502001-12-29 Akim Demaille <akim@epita.fr>
2351
2352 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2353 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2354 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2355 as rules.
2356
1cca533e
AD
23572001-12-29 Akim Demaille <akim@epita.fr>
2358
2359 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2360 ago.
2361
c03ae966
AD
23622001-12-29 Akim Demaille <akim@epita.fr>
2363
2364 * src/reader.c, src/reader.h (user_toknums): Remove.
2365 Adjust all users to use symbols[i]->user_token_number.
2366
5a670b1e
AD
23672001-12-29 Akim Demaille <akim@epita.fr>
2368
2369 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2370 Adjust all users to use symbols[i]->prec or ->assoc.
2371
ad949da9
AD
23722001-12-29 Akim Demaille <akim@epita.fr>
2373
2374 * src/reader.c, src/reader.h (tags): Remove.
2375 Adjust all users to use symbols[i]->tag.
2376
0e78e603
AD
23772001-12-29 Akim Demaille <akim@epita.fr>
2378
2379 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2380 and rule_table.
2381 * src/reader.c (packsymbols): Fill this table.
2382 Drop sprec.
2383 * src/conflicts.c (resolve_sr_conflict): Adjust.
2384 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2385 single table.
2386 Use symbols[i]->tag instead of tags[i].
2387
213e640e
AD
23882001-12-29 Akim Demaille <akim@epita.fr>
2389
2390 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2391 In addition, put a comment in there, to replace...
2392 * tests/regression.at (%union and C comments): Remove.
2393
e7b8bef1
AD
23942001-12-29 Akim Demaille <akim@epita.fr>
2395
2396 * tests/regression.at (Web2c Actions): Blindly move the actual
2397 output as expected output. The contents *seem* right to me, but I
2398 can't pretend reading perfectly parser tables... Nonetheless, all
2399 the other tests pass correctly, the table look OK, even though the
2400 presence of `$axiom' is to be noted: AFAICS it is useless (but
2401 harmless).
2402
b68e7744
AD
24032001-12-29 Akim Demaille <akim@epita.fr>
2404
2405 * src/reader.c (readgram): Don't add the rule 0 if there were no
2406 rules read. In other words, add it _after_ having performed
2407 grammar sanity checks.
2408 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2409
78d5bae9
AD
24102001-12-29 Akim Demaille <akim@epita.fr>
2411
2412 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2413 visible, and some states have now a different number.
2414
ff442794
AD
24152001-12-29 Akim Demaille <akim@epita.fr>
2416
2417 * src/reader.c (readgram): Bind the initial rule's lineno to that
2418 of the first rule.
2419 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2420 (Solved SR Conflicts): Adjust rule 0's line number.
2421
610ab194
AD
24222001-12-29 Akim Demaille <akim@epita.fr>
2423
2424 Fix the `GAWK Grammar' failure.
2425
2426 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2427 the reductions of the first state which was mistakenly confused
2428 with the final state because precisely final_state was initialized
2429 to 0.
2430 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2431 now noticed by Bison.
2432 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2433 have a reduction on $default.
2434
29d29c8f
AD
24352001-12-29 Akim Demaille <akim@epita.fr>
2436
2437 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2438 rule line numbers.
2439 * src/closure.c (print_closure): Likewise.
2440 * src/derives.c (print_derives): Likewise.
2441 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2442 now.
2443
7c6b64d0
AD
24442001-12-29 Akim Demaille <akim@epita.fr>
2445
2446 * src/lalr.c (lookaheads_print): New.
2447 (lalr): Call it when --trace-flag.
2448 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2449 are dumped.
2450
3d4daee3
AD
24512001-12-29 Akim Demaille <akim@epita.fr>
2452
2453 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2454 when walking through ritem, even via rule->rhs.
2455 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2456 (useful_production, useless_nonterminals): Likewise.
2457 (reduce_grammar_tables): Likewise, plus update nritems.
2458 * src/nullable.c (set_nullable): Likewise.
2459 * src/lalr.c (build_relations): Likewise.
2460 * tests/sets.at (Nullable): Adjust.
2461 Fortunately, now, the $axiom is no longer nullable.
2462
9e7f6bbd
AD
24632001-12-29 Akim Demaille <akim@epita.fr>
2464
2465 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2466 the 0-sentinel.
2467 * src/gram.c (ritem_longest_rhs): Likewise.
2468 * src/reduce.c (nonterminals_reduce): Likewise.
2469 * src/print_graph.c (print_graph): Likewise.
2470 * src/output.c (output_rule_data): Likewise.
2471 * src/nullable.c (set_nullable): Likewise.
2472
255ef638
AD
24732001-12-29 Akim Demaille <akim@epita.fr>
2474
2475 * src/output.c: Comment changes.
2476
0d8a7363
AD
24772001-12-27 Paul Eggert <eggert@twinsun.com>
2478
2479 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2480 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2481 Sparc, as they were causing more porting problems than the
2482 (minor) performance improvement was worth.
2483
2484 Also, catch up with 1.31's YYSTD.
2485
3db472b9
AD
24862001-12-27 Akim Demaille <akim@epita.fr>
2487
2488 * src/output.c (output_gram): Rely on nritems, not the
2489 0-sentinel. See below.
2490 Use -1 as separator, not 0.
2491 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2492 Rely on -1 as separator in yyrhs, instead of 0.
2493 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2494 twice `Now at end of input', therefore there are two lines less to
2495 expect.
2496
b365aa05
AD
24972001-12-27 Akim Demaille <akim@epita.fr>
2498
2499 * tests/regression.at (Unresolved SR Conflicts):
2500 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2501 below.
2502
30171f79
AD
25032001-12-27 Akim Demaille <akim@epita.fr>
2504
2505 * src/LR0.c (new_state): Recognize the final state by the fact it
2506 is reached by eoftoken.
2507 (insert_start_shifting_state, insert_eof_shifting_state)
2508 (insert_accepting_state, augment_automaton): Remove, since now
2509 these states are automatically computed from the initial state.
2510 (generate_states): Adjust.
2511 * src/print.c: When reporting a rule number to the user, substract
2512 1, so that the axiom rule is rule 0, and the first user rule is 1.
2513 * src/reduce.c: Likewise.
2514 * src/print_graph.c (print_core): For the time being, just as for
2515 the report, depend upon --trace-flags to dump the full set of
2516 items.
2517 * src/reader.c (readgram): Once the grammar read, insert the rule
2518 0: `$axiom: START-SYMBOL $'.
2519 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2520 number of the states has changed (the final state is no longer
2521 necessarily the last), catch up.
2522
75142d45
AD
25232001-12-27 Akim Demaille <akim@epita.fr>
2524
2525 Try to make the use of the eoftoken valid. Given that its value
2526 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2527 is used instead of > 0 where appropriate, (ii), depend upon nritems
2528 instead of the 0-sentinel.
2529
2530 * src/gram.h, src/gram.c (nritems): New.
2531 Expected to be duplication of nitems, but for the time being...
2532 * src/reader.c (packgram): Assert nritems and nitems are equal.
2533 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2534 * src/closure.c (print_closure, print_fderives): Likewise.
2535 * src/gram.c (ritem_print): Likewise.
2536 * src/print.c (print_core, print_grammar): Likewise.
2537 * src/print_graph.c: Likewise.
2538
b7c49edf
AD
25392001-12-27 Akim Demaille <akim@epita.fr>
2540
2541 * src/main.c (main): If there are complains after grammar
2542 reductions, then output the report anyway if requested, then die.
2543 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2544 * src/reader.c (eoftoken): New.
2545 (parse_token_decl): If the token being defined has value `0', it
2546 is the eoftoken.
2547 (packsymbols): No longer hack `tags' to insert `$' by hand.
2548 Be sure to preserve the value of the eoftoken.
2549 (reader): Make sure eoftoken is defined.
2550 Initialize nsyms to 0: now eoftoken is created just like the others.
2551 * src/print.c (print_grammar): Don't special case the eof token.
2552 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2553 lie anyway, albeit pleasant.
2554 * tests/calc.at: Exercise error messages with eoftoken.
2555 Change the grammar so that empty input is invalid.
2556 Adjust expectations.
2557 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2558
ec2da99f
AD
25592001-12-27 Akim Demaille <akim@epita.fr>
2560
2561 * configure.in: Check the protos of strchr ans strspn.
2562 Replace strchr if needed.
2563 * src/system.h: Provide the protos of strchr, strspn and memchr if
2564 missing.
2565 * lib/strchr.c: New.
2566 * src/reader.c (symbols_save): Use strchr.
2567
8adfa272
AD
25682001-12-27 Akim Demaille <akim@epita.fr>
2569
2570 * src/print.c, src/print_graph.c (escape): New.
2571 Use it to quote the TAGS outputs.
2572 * src/print_graph.c (print_state): Now errors are in red, and
2573 reductions in green.
2574 Prefer high to wide: output the state number on a line of its own.
2575
80dac38c
AD
25762001-12-27 Akim Demaille <akim@epita.fr>
2577
2578 * src/state.h, src/state.c (reductions_new): New.
2579 * src/LR0.c (set_state_table): Let all the states have a
2580 `reductions', even if reduced to 0.
2581 (save_reductions): Adjust.
2582 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2583 * src/print.c (print_reductions, print_actions): Adjust.
2584 * src/output.c (action_row): Adjust.
2585
2cec70b9
AD
25862001-12-27 Akim Demaille <akim@epita.fr>
2587
2588 * src/state.h, src/state.c (errs_new, errs_dup): New.
2589 * src/LR0.c (set_state_table): Let all the states have an errs,
2590 even if reduced to 0.
2591 * src/print.c (print_errs, print_reductions): Adjust.
2592 * src/output.c (output_actions, action_row): Adjust.
2593 * src/conflicts.c (resolve_sr_conflict): Adjust.
2594
13ca549a
AD
25952001-12-27 Akim Demaille <akim@epita.fr>
2596
2597 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2598
5092aba5
AD
25992001-12-27 Akim Demaille <akim@epita.fr>
2600
2601 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2602 * src/print.c: here.
2603 (lookaheadset, shiftset): New, used as additional storage by
2604 print_reductions.
2605 (print_results): Adjust.
2606 (print_shifts, print_gotos, print_errs): New, extracted from...
2607 (print_actions): here.
2608 * src/print_graph.c (print_actions): Remove dead code.
2609
11e2beca
AD
26102001-12-27 Akim Demaille <akim@epita.fr>
2611
2612 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2613 `$n' and `@n'.
2614
dac3c910
AD
26152001-12-27 Akim Demaille <akim@epita.fr>
2616
2617 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2618 (build_relations): Adjust.
2619
d0b0fefa
AD
26202001-12-27 Akim Demaille <akim@epita.fr>
2621
2622 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2623 duplication.
2624
adc8c848
AD
26252001-12-27 Akim Demaille <akim@epita.fr>
2626
2627 * src/reader.c (packgram): Catch nitems overflows.
2628
14d293ac
AD
26292001-12-27 Akim Demaille <akim@epita.fr>
2630
2631 * src/files.c, src/files.h (guard_obstack): Remove.
2632 * src/output.c (output): Adjust.
2633 * src/reader.c (parse_braces): New, factoring...
2634 (copy_action, copy_guard): these two which are renamed as...
2635 (parse_action, parse_guard): these.
2636 As a voluntary consequence, using braces around guards is now
2637 mandatory.
2638
f499b062
AD
26392001-12-27 Akim Demaille <akim@epita.fr>
2640
2641 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2642 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2643 members.
2644 (symbol_list_new): Adjust.
2645 (copy_action): action_line is the first line, not the last.
2646 (copy_guard): Just as for actions, store the `action' only, not
2647 the switch/case/break flesh.
2648 Don't parse the user action that might follow the guard, let...
2649 (readgram): do it, i.e., now, there can be an action after a
2650 guard.
2651 In other words the guard is just explicitly optional.
2652 (packgram): Adjust.
2653 * src/output.c (guards_output): New.
2654 (output_parser): Call it when needed.
2655 (output): Also free the guard and attrs obstacks.
2656 * src/files.c, src/files.h (obstack_save): Remove.
2657 (output_files): Remove.
2658 As a result, if one needs the former `.act' file, using an
2659 appropriate skeleton which requires actions and guards is now
2660 required.
2661 * src/main.c (main): Adjust.
2662 * tests/semantic.at: New.
2663 * tests/regression.at: Use `input.y' as input file name.
2664 Avoid 8+3 problems by requiring input.c when the test needs the
2665 parser.
2666
d945f5cd
AD
26672001-12-27 Akim Demaille <akim@epita.fr>
2668
2669 * src/reader.c (symbol_list_new): Be sure to initialize all the
2670 fields.
2671
d200e455
AD
26722001-12-27 Akim Demaille <akim@epita.fr>
2673
2674 All the hacks using a final pseudo state are now useless.
2675
2676 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2677 * src/lalr.c (nLA): New.
2678 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2679 instead of lookaheadsp from the pseudo state (nstate + 1).
2680
f9507c28
AD
26812001-12-27 Akim Demaille <akim@epita.fr>
2682
2683 * src/output.c (action_row, token_actions): Use a state_t instead
2684 of a integer, and nlookaheads instead of the following state's
2685 lookaheadsp.
2686
065fbd27
AD
26872001-12-27 Akim Demaille <akim@epita.fr>
2688
2689 * src/conflicts.c (log_resolution, flush_shift)
2690 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2691 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2692 (conflicts_print, print_reductions): Use a state_t instead of an
2693 integer when referring to a state.
2694 As much as possible, depend upon nlookaheads, instead of the
2695 `lookaheadsp' member of the following state (since lookaheads of
2696 successive states are successive, the difference between state n + 1
2697 and n served as the number of lookaheads for state n).
2698 * src/lalr.c (add_lookback_edge): Likewise.
2699 * src/print.c (print_core, print_actions, print_state)
2700 (print_results): Likewise.
2701 * src/print_graph.c (print_core, print_actions, print_state)
2702 (print_graph): Likewise.
2703 * src/conflicts.h: Adjust.
2704
1b177bd7
AD
27052001-12-27 Akim Demaille <akim@epita.fr>
2706
2707 * src/bison.hairy: Formatting/comment changes.
2708 ANSIfy.
2709 Remove `register' indications.
2710 Add plenty of `static'.
2711
7742ddeb
AD
27122001-12-27 Akim Demaille <akim@epita.fr>
2713
2714 * src/output.c (prepare): Drop the muscle `ntbase' which
2715 duplicates ntokens.
2716 * src/bison.simple: Formatting/comment changes.
2717 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2718 is an undocumented synonym.
2719
1fa14068
AD
27202001-12-22 Akim Demaille <akim@epita.fr>
2721
2722 * src/output.c (output_table_data): Change the prototype to use
2723 `int' for array ranges: some invocations do pass an int, not a
2724 short.
2725 Reported by Wayne Green.
2726
b9752825
AD
27272001-12-22 Akim Demaille <akim@epita.fr>
2728
2729 Some actions of web2c.y are improperly triggered.
2730 Reported by Mike Castle.
2731
2732 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2733 * tests/regression.at (Web2c): Rename as...
2734 (Web2c Report): this.
2735 (Web2c Actions): New.
2736
776209d6
AD
27372001-12-22 Akim Demaille <akim@epita.fr>
2738
2739 Reductions in web2c.y are improperly reported.
2740 Reported by Mike Castle.
2741
2742 * src/conflicts.c (print_reductions): Fix.
2743 * tests/regression.at (Web2c): New.
2744
275fc3ad
AD
27452001-12-18 Akim Demaille <akim@epita.fr>
2746
2747 Some host fail on `assert (!"foo")', which expands to
2748 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2749 Reported by Nelson Beebee.
2750
2751 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2752 `#define it_succeeded 0' and `assert (it_succeeded)'.
2753
897668ee
MA
27542001-12-17 Marc Autret <autret_m@epita.fr>
2755
2756 * src/bison.simple: Don't hard code the skeleton line and filename.
2757 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2758 New line counter 'skeleton_line' (skeleton-line muscle).
2759
ab3399e0
PE
27602001-12-17 Paul Eggert <eggert@twinsun.com>
2761
2762 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2763 YYDEBUG must be defined to a nonzero value.
2764
2765 * src/bison.simple (yytname): Do not assume that the user defines
2766 YYDEBUG to a properly parenthesized expression.
2767
3877f72b
AD
27682001-12-17 Akim Demaille <akim@epita.fr>
2769
2770 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2771 nlookaheads is a new member.
2772 Adjust all users.
2773 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2774 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2775 state.
776209d6 2776
331dbc1b
AD
27772001-12-17 Akim Demaille <akim@epita.fr>
2778
2779 * src/files.h, src/files.c (open_files, close_files): Remove.
2780 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2781 let...
2782 * src/reader.c (reader): Do it.
776209d6 2783
be750e4c
AD
27842001-12-17 Akim Demaille <akim@epita.fr>
2785
2786 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2787
709ae8c6
AD
27882001-12-17 Akim Demaille <akim@epita.fr>
2789
2790 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2791 (flush_reduce): New.
2792 (resolve_sr_conflict): Adjust.
776209d6 2793
f87685c3
AD
27942001-12-17 Akim Demaille <akim@epita.fr>
2795
2796 * src/output.c (output_obstack): Be static and rename as...
2797 (format_obstack): this, to avoid any confusion with files.c's
2798 output_obstack.
2799 * src/reader.h (muscle_obstack): Move to...
2800 * src/output.h: here, since it's defined in output.c.
2801
837491d8
AD
28022001-12-17 Akim Demaille <akim@epita.fr>
2803
2804 * src/output.c (action_row, save_column, default_goto)
2805 (sort_actions, matching_state, pack_vector): Better variable
2806 locality.
2807
796d61fb
AD
28082001-12-17 Akim Demaille <akim@epita.fr>
2809
2810 * src/output.c: Various formatting changes.
776209d6 2811
64d15509
AD
28122001-12-17 Akim Demaille <akim@epita.fr>
2813
2814 * src/files.c (output_files): Free the output_obstack.
2815 * src/main.c (main): Call print and print_graph conditionally.
2816 * src/print.c (print): Work unconditionally.
2817 * src/print_graph.c (print_graph): Work unconditionally.
2818 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2819
fbc8ecb7
MA
28202001-12-16 Marc Autret <autret_m@epita.fr>
2821
2822 * src/output.c (actions_output): Fix. When we use %no-lines,
2823 there is one less line per action.
2824
f0440388
MA
28252001-12-16 Marc Autret <autret_m@epita.fr>
2826
2827 * src/bison.simple: Remove a useless #line directive.
2828 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2829 * src/output.c (get_lines_number): New.
776209d6 2830 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2831 output muscles.
2832 Fix line numbering.
2833 (actions_output): Computes the number of lines taken by actions.
2834 (output_master_parser): Insert new skeleton which is the name of
2835 the output parser file name.
2836
a79986b8
MA
28372001-12-15 Marc Autret <autret_m@epita.fr>
2838
2839 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2840
4ec8e00f
MA
28412001-12-15 Marc Autret <autret_m@epita.fr>
2842
2843 * src/output.c (output_gram): Keep track of the hairy one.
2844
1a4648ff
AD
28452001-12-15 Akim Demaille <akim@epita.fr>
2846
2847 Make `make distcheck' work.
2848
2849 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2850 system.h which uses libgettext.h.
2851
9c2c67e6
AD
28522001-12-15 Akim Demaille <akim@epita.fr>
2853
2854 * src/nullable.c (set_nullable): Useless rules must be skipped,
2855 otherwise, since we range over their symbols, we might look at a
2856 nonterminal which no longer ``exists'', i.e., it is not counted in
2857 `nvars', hence we overflow our arrays.
2858
93ede233
AD
28592001-12-15 Akim Demaille <akim@epita.fr>
2860
2861 The header can also be produced directly, without any obstack!
2862 Yahoo!
2863
2864 * src/files.c, src/files.h (defines_obstack): Remove.
2865 (compute_header_macro): Global.
2866 (defines_obstack_save): Remove.
2867 * src/reader.c (parse_union_decl): No longer output to
2868 defines_obstack: its content can be found in the `stype' muscle
2869 anyway.
2870 (output_token_translations): Merge into...
2871 (symbols_output): this.
2872 Rename as...
2873 (symbols_save): this.
2874 (reader): Adjust.
2875 * src/output.c (header_output): New.
2876 (output): Call it.
2877
2666f928
AD
28782001-12-15 Akim Demaille <akim@epita.fr>
2879
2880 * src/reader.c (parse_union_decl): Instead of handling two obstack
2881 simultaneously, use one to define the `stype' muscle, and use the
2882 value of the latter to fill defines_obstack.
2883 (copy_comment): Remove.
2884 (copy_comment2): Work for a single obstack.
2885 Rename as...
2886 (copy_comment): this.
2887
428046f8
AD
28882001-12-15 Akim Demaille <akim@epita.fr>
2889
2890 * src/lex.c, src/lex.h (xgetc): No longer static.
2891 * src/reader.c (parse_union_decl): Revamp.
2892
ea52d706
AD
28932001-12-15 Akim Demaille <akim@epita.fr>
2894
2895 Still making progress in separating Bison into (i) input, (ii)
2896 process, (iii) output: now we can directly output the parser file
2897 without using table_obstack at all.
2898
2899 * src/files.c, src/files.h (table_obstack): Bye bye.
2900 (parser_file_name): New.
2901 * src/files.c (compute_output_file_names): Compute it.
2902 * src/output.c (actions_output, output_parser)
2903 (output_master_parser): To a file instead of an obstack.
2904
3f96f4dc
AD
29052001-12-15 Akim Demaille <akim@epita.fr>
2906
2907 Attach actions to rules, instead of pre-outputting them to
2908 actions_obstack.
2909
2910 * src/gram.h (rule_t): action and action_line are new members.
2911 * src/reader.c (symbol_list): Likewise.
2912 (copy_action): Save the actions within the rule.
2913 (packgram): Save them in rule_table.
2914 * src/output.c (actions_output): New.
2915 (output_parser): Use it on `%%actions'.
2916 (output_rule_data): Don't free rule_table.
2917 (output): Do it.
2918 (prepare): Don't save the `action' muscle.
2919 * src/bison.simple: s/%%action/%%actions/.
2920
51576fb3
AD
29212001-12-15 Akim Demaille <akim@epita.fr>
2922
2923 * src/reader.c (copy_action): When --yacc, don't append a `;'
2924 to the user action: let it fail if lacking.
dee049eb 2925 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 2926
2648a72d
AD
29272001-12-14 Akim Demaille <akim@epita.fr>
2928
2929 * src/lex.c (literalchar): Simply return the char you decoded, non
2930 longer mess around with obstacks and int pointers.
2931 Adjust all callers.
2932
92790e5b
AD
29332001-12-14 Akim Demaille <akim@epita.fr>
2934
2935 * src/lex.c (literalchar): Don't escape the special characters,
2936 just decode them, and keep them as char (before, eol was output as
2937 the 2 char string `\n' etc.).
2938 * src/output.c (output_rule_data): Use quotearg to output the
2939 token strings.
2940
927c1557
PE
29412001-12-13 Paul Eggert <eggert@twinsun.com>
2942
2943 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2944 Do not infringe on the global user namespace when using C++.
2945 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2946 All uses of `fprintf' and `stderr' changed.
2947
2948 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2949
ed8e1f68
AD
29502001-12-13 Akim Demaille <akim@epita.fr>
2951
2952 The computation of nullable is broken: it doesn't handle empty
2953 RHS's properly.
2954
2955 * tests/torture.at (GNU AWK Grammar): New.
2956 * tests/sets.at (Nullable): New.
2957 * src/nullable.c (set_nullable): Instead of blindly looping over
2958 `ritems', loop over the rules, and then over their rhs's.
2959
2960 Work around Autotest bugs.
2961
2962 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2963 frame, because Autotest understand lines starting with a `+' as
2964 traces from the shell. Then, they are not processed properly.
2965 Admittedly an Autotest bug, but we don't have time to wait for
2966 Autotest to catch up.
2967 * tests/regression.at (Broken Closure): Adjust to the new table
2968 frames.
2969 Move to...
2970 * tests/sets.at: here.
2971
cb581495
AD
29722001-12-13 Akim Demaille <akim@epita.fr>
2973
2974 * src/closure.c (closure): Use nrules instead of playing tricks
2975 with BITS_PER_WORD.
2976
2e729273
AD
29772001-12-13 Akim Demaille <akim@epita.fr>
2978
2979 * src/print.c (print_actions): Output the handling of `$' as the
2980 traces do: shifting the token EOF. Before EOF was treated as a
2981 nonterminal.
2982 * tests/regression.at: Adjust some tests.
2983 * src/print_graph.c (print_core): Complete the set of items via
2984 closure. The next-to-final and final states are still unsatisfying,
2985 but that's to be addressed elsewhere.
2986 No longer output the rule numbers, but do output the state number.
2987 A single loop for the shifts + gotos is enough, but picked a
2988 distinct color for each.
2989 (print_graph): Initialize and finalize closure.
2990
107f7dfb
AD
29912001-12-13 Akim Demaille <akim@epita.fr>
2992
2993 * src/reader.c (readgram): Remove dead code, an strip useless
2994 braces.
2995 (get_type): Remove, unused.
2996
9b53a24f
AD
29972001-12-12 Akim Demaille <akim@epita.fr>
2998
2999 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3000 on that of lib/error.c.
3001
dbfb6dcd
AD
30022001-12-12 Akim Demaille <akim@epita.fr>
3003
3004 Some hosts don't like `/' in includes.
3005
3006 * src/system.h: Include libgettext.h without qualifying the path.
3007 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3008 $(top_srcdir).
3009
c25fb648
MA
30102001-12-11 Marc Autret <autret_m@epita.fr>
3011
3012 * src/output.c (output_parser): Remove useless muscle.
3013
710ddc4f
MA
30142001-12-11 Marc Autret <autret_m@epita.fr>
3015
3016 * src/bison.simple: Remove #line just before %%epilogue. It
3017 is now handled in ...
3018 * src/reader.c (read_additionnal_code): Add the output of a
3019 #line for the epilogue.
3020
e83d80b8
MA
30212001-12-10 Marc Autret <autret_m@epita.fr>
3022
927c1557 3023 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3024 replace precedent remove.
3025 * src/bison.simple: Remove #line before %%prologue because
3026 %%input-line is wrong at this time.
3027
971d5158
MA
30282001-12-10 Marc Autret <autret_m@epita.fr>
3029
3030 * src/reader.c (symbols_output): Clean up.
927c1557 3031 * src/output.c (output_gram, output): Clean up.
971d5158 3032
5edafffd
AD
30332001-12-10 Akim Demaille <akim@epita.fr>
3034
3035 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3036 * src/LR0.c (set_state_table): here.
3037 * src/lalr.c (lalr): Call it.
3038
0279f8e9
AD
30392001-12-10 Akim Demaille <akim@epita.fr>
3040
3041 * src/state.h (shifts): Remove the `number' member: shifts are
3042 attached to state, hence no longer need to be labelled with a
3043 state number.
3044
190c4f5f
AD
30452001-12-10 Akim Demaille <akim@epita.fr>
3046
3047 Now that states have a complete set of members, the linked list of
3048 shifts is useless: just fill directly the state's shifts member.
3049
3050 * src/state.h (shifts): Remove the `next' member.
3051 * src/LR0.c (first_state, last_state): Remove.
3052 Adjust the callers.
3053 (augment_automaton): Don't look for the shifts that must be added
3054 a shift on EOF: it is those of the state we looked for! But now,
3055 since shifts are attached, it is no longer needed to looking
3056 merely by its id: its number.
3057
2a73b93d
AD
30582001-12-10 Akim Demaille <akim@epita.fr>
3059
3060 * src/LR0.c (augment_automaton): Better variable locality.
3061 Remove an impossible branch: if there is a state corresponding to
3062 the start symbol being shifted, then there is shift for the start
3063 symbol from the initial state.
3064
74392f6a
AD
30652001-12-10 Akim Demaille <akim@epita.fr>
3066
3067 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3068 only when appropriate: when insert_start_shifting_state' is not
3069 invoked.
3070 * tests/regression.at (Rule Line Numbers): Adjust.
3071
37c82725
AD
30722001-12-10 Akim Demaille <akim@epita.fr>
3073
3074 * src/LR0.c (augment_automaton): Now that all states have shifts,
3075 merge the two cases addition shifts to the initial state.
3076
6a164e0c
AD
30772001-12-10 Akim Demaille <akim@epita.fr>
3078
3079 * src/lalr.c (set_state_table): Move to...
3080 * src/LR0.c: here.
3081 * src/lalr.c (lalr): Don't call it...
3082 * src/LR0.c (generate_states): do it.
3083 * src/LR0.h (first_state): Remove, only the table is used.
3084
7215de24
AD
30852001-12-10 Akim Demaille <akim@epita.fr>
3086
3087 * src/LR0.h (first_shift, first_reduction): Remove.
3088 * src/lalr.c: Don't use first_shift: find shifts through the
3089 states.
3090
80e25d4d
AD
30912001-12-10 Akim Demaille <akim@epita.fr>
3092
3093 * src/LR0.c: Attach shifts to states as soon as they are
3094 computed.
3095 * src/lalr.c (set_state_table): Instead of assigning shifts to
3096 state, just assert that the mapping was properly done.
3097
0ab3728b
AD
30982001-12-10 Akim Demaille <akim@epita.fr>
3099
3100 * src/LR0.c (insert_start_shift): Rename as...
3101 (insert_start_shifting_state): this.
3102 (insert_eof_shifting_state, insert_accepting_state): New.
3103 (augment_automaton): Adjust.
3104 Better locality of the variables.
3105 When looking if the start_symbol is shifted from the initial
3106 state, using `while (... symbol != start_symbol ...)' sounds
3107 better than `while (... symbol < start_symbol ...)': If fail
3108 to see how the order between symbols could be relevant!
3109
78af9bbc
AD
31102001-12-10 Akim Demaille <akim@epita.fr>
3111
3112 * src/getargs.h: Don't declare `spec_name_prefix' and
3113 `spec_file_prefix', declared by src/files.h.
3114 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3115 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3116 * src/output.c (prepare): Adjust.
3117 * src/reader.c (symbols_output): Likewise.
3118 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3119
bdef2a41
AD
31202001-12-10 Akim Demaille <akim@epita.fr>
3121
3122 * src/muscle_tab.c (muscle_init): NULL is a better default than
3123 `"0"'.
3124
3735969c
AD
31252001-12-10 Akim Demaille <akim@epita.fr>
3126
3127 * src/reader.c (reader): Calling symbols_output once is enough.
3128
49701457
AD
31292001-12-10 Akim Demaille <akim@epita.fr>
3130
3131 Now that states have a complete set of members, the linked list of
3132 reductions is useless: just fill directly the state's reductions
3133 member.
3134
3135 * src/state.h (struct reductions): Remove member `number' and
3136 `next'.
3137 * src/LR0.c (first_reduction, last_reduction): Remove.
3138 (save_reductions): Don't link the new reductions, store them in
3139 this_state.
3140 * src/lalr.c (set_state_table): No need to attach reductions to
3141 states, it's already done.
3142 * src/output.c (output_actions): No longer free the shifts, then
3143 the reductions, then the states: free all the states and their
3144 members.
3145
0edad749
AD
31462001-12-10 Akim Demaille <akim@epita.fr>
3147
3148 * src/options.c (OPTN, DRTV, BOTH): New.
3149 (option_table): Use them.
3150
0edad749
AD
3151 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3152 the job of system.h.
3153 * src/options.c: Don't include stdio.h and xalloc.h for the same
3154 reasons.
3155
5449dd0f
AD
31562001-12-10 Akim Demaille <akim@epita.fr>
3157
3158 * src/output.c (output, prepare): Make sure the values of the
3159 muscles `action' and `prologue' are 0-terminated.
3160
a870c567
AD
31612001-12-10 Akim Demaille <akim@epita.fr>
3162
3163 Clean up GCC warnings.
3164
3165 * src/reader.c (copy_action): `buf' is not used.
3166 (parse_skel_decl): Be static.
3167 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3168 * src/options.h (create_long_option_table): Have a real prototype.
3169 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3170 (hash_delete_at): Return const void *.
3171 Adjust casts to preserve the const.
3172
80df8768
AD
31732001-12-10 Akim Demaille <akim@epita.fr>
3174
3175 * configure.in: Require 2.52g.
3176 M4 is not needed, but AUTOM4TE is.
3177 * m4/m4.m4: Remove.
3178 * tests/Makefile.am: Adjust.
3179
f693ad14
AD
31802001-12-10 Akim Demaille <akim@epita.fr>
3181
3182 One structure for states is enough, even though theoretically
3183 there are LR(0) states and LALR(1) states.
3184
3185 * src/lalr.h (state_t): Remove.
3186 (state_table): Be state_t **, not state_t *.
3187 * src/state.h (core, CORE_ALLOC): Rename as...
3188 (state_t, STATE_ALLOC): this.
3189 Add the LALR(1) members: shifts, reductions, errs.
3190 * src/LR0.c (state_table): Rename as...
3191 (state_hash): this, to avoid name clashes with the global
3192 `state_table'.
3193 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3194 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3195
74ffbcb6
AD
31962001-12-10 Akim Demaille <akim@epita.fr>
3197
3198 Bison dumps core on bash.y.
3199 Reported by Pascal Bart.
3200
3201 * src/warshall.c (bitmatrix_print): New.
3202 (TC): Use it.
3203 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3204 j must be the outer loop.
3205 * tests/regression.at (Broken Closure): New.
3206
07708e19
AD
32072001-12-05 Akim Demaille <akim@epita.fr>
3208
3209 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3210 its argument.
3211