]> git.saurik.com Git - bison.git/blame - ChangeLog
Fix small formatting glitch.
[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.
b5480d74
PH
120
1212002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
122
123 * src/options.h, src/options.c: Remove.
124 * src/getargs.c (short_options, long_options): New.
125
60491a94
AD
1262002-06-27 Akim Demaille <akim@epita.fr>
127
128 * data/bison.simple, data/bison.c++: Rename as...
129 * data/yacc.c, data/lalr1.cc: these.
130 * doc/bison.texinfo (Environment Variables): Remove.
131
9be0c25b
AD
1322002-06-25 Raja R Harinath <harinath@cs.umn.edu>
133
134 * src/getargs.c (report_argmatch): Initialize strtok().
135
1ae72863
AD
1362002-06-20 Akim Demaille <akim@epita.fr>
137
138 * data/bison.simple (b4_symbol_actions): New, replaces...
139 (b4_symbol_destructor, b4_symbol_printer): these.
140 (yysymprint): Be sure to call YYPRINT only for tokens, and using
141 user token numbers.
142
87542d29
AD
1432002-06-20 Akim Demaille <akim@epita.fr>
144
145 * data/bison.simple (yydestructor): Rename as...
146 (yydestruct): this.
147
1a31ed21
AD
1482002-06-20 Akim Demaille <akim@epita.fr>
149
150 * src/symtab.h, src/symtab.c (symbol_type_set)
151 (symbol_destructor_set, symbol_precedence_set): The location is
152 the last argument.
153 Adjust all callers.
154
e776192e
AD
1552002-06-20 Akim Demaille <akim@epita.fr>
156
157 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
158 internals.
159 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
160 Takes a location.
161 * src/symtab.h, src/symtab.c (symbol_class_set)
162 (symbol_user_token_number_set): Likewise.
163 Adjust all callers.
164 Promote complain_at.
165 * tests/input.at (Type Clashes): Adjust.
166
5c1180b3
AD
1672002-06-20 Akim Demaille <akim@epita.fr>
168
169 * data/bison.simple (YYLEX): Fix the declaration when
170 %pure-parser.
171
e3170060
AD
1722002-06-20 Akim Demaille <akim@epita.fr>
173
174 * data/bison.simple (yysymprint): Don't print the token number,
175 just its name.
176 * tests/actions.at (Destructors): Rename as...
177 (Printers and Destructors): this.
178 Also exercise %printer.
179
253862fd
AD
1802002-06-20 Akim Demaille <akim@epita.fr>
181
182 * data/bison.simple (YYDSYMPRINT): New.
183 Use it to remove many of the #if YYDEBUG/if (yydebug).
184
366eea36
AD
1852002-06-20 Akim Demaille <akim@epita.fr>
186
187 * src/symtab.h, src/symtab.c (symbol_t): printer and
188 printer_location are new members.
189 (symbol_printer_set): New.
190 * src/parse-gram.y (PERCENT_PRINTER): New token.
191 Handle its associated rule.
192 * src/scan-gram.l: Adjust.
193 (handle_destructor_at, handle_destructor_dollar): Rename as...
194 (handle_symbol_code_at, handle_symbol_code_dollar): these.
195 * src/output.c (symbol_printers_output): New.
196 (output_skeleton): Call it.
197 * data/bison.simple (yysymprint): New. Cannot be named yyprint
198 since there are already many grammar files with a user `yyprint'.
199 Replace the calls to YYPRINT to calls to yysymprint.
200 * tests/calc.at: Adjust.
201 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
202 taking advantage of parser very internal details (stack size!).
203
4f25ebb0
AD
2042002-06-20 Akim Demaille <akim@epita.fr>
205
206 * src/scan-gram.l: Complete the scanner with the missing patterns
207 to pacify Flex.
208 Use `quote' and `symbol_tag_get' where appropriate.
209
93b68a0e
AD
2102002-06-19 Akim Demaille <akim@epita.fr>
211
212 * tests/actions.at (Destructors): Augment to test locations.
213 * data/bison.simple (yydestructor): Pass it the current location
214 if locations are enabled.
215 Prototype only when __STDC__ or C++.
216 Change the argument names to move into the yy name space: there is
217 user code here.
218
58612f1d
AD
2192002-06-19 Akim Demaille <akim@epita.fr>
220
74310291
AD
221 * data/bison.simple (b4_pure_if): New.
222 Use it instead of #ifdef YYPURE.
223
2242002-06-19 Akim Demaille <akim@epita.fr>
225
226 * data/bison.simple (b4_location_if): New.
58612f1d
AD
227 Use it instead of #ifdef YYLSP_NEEDED.
228
f25bfb75
AD
2292002-06-19 Akim Demaille <akim@epita.fr>
230
231 Prepare @$ in %destructor, but currently don't bind it in the
232 skeleton, as %location use is not cleaned up yet.
233
234 * src/scan-gram.l (handle_dollar, handle_destructor_at)
235 (handle_action_at): New.
236 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
237 a braced_code_t and a location as additional arguments.
238 (handle_destructor_dollar): Instead of requiring `b4_eval', just
239 unquote one when outputting `b4_dollar_dollar'.
240 Adjust callers.
241 * data/bison.simple (b4_eval): Remove.
242 (b4_symbol_destructor): Adjust.
243 * tests/input.at (Invalid @n): Adjust.
244
c732d2c6
AD
2452002-06-19 Zack Weinberg <zack@codesourcery.com>
246
247 * doc/bison.texinfo: Document ability to have multiple
248 prologue sections.
249
8c165d89
AD
2502002-06-18 Akim Demaille <akim@epita.fr>
251
252 * src/files.c (compute_base_names): When computing the output file
253 names from the input file name, strip the directory part.
254
ca98bf57
AD
2552002-06-18 Akim Demaille <akim@epita.fr>
256
257 * data/bison.simple.new: Comment changes.
258 Reported by Andreas Schwab.
259
0bfb02ff
AD
2602002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
261
262 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
263 there are no `label `yyoverflowlab' defined but not used' warnings
264 when yyoverflow is defined.
265
24c0aad7
AD
2662002-06-18 Akim Demaille <akim@epita.fr>
267
268 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
269 new member.
270 (symbol_destructor_set): Adjust.
271 * src/output.c (symbol_destructors_output): Output the destructor
272 locations.
273 Output the symbol name.
274 * data/bison.simple (b4_symbol_destructor): Adjust.
275
5719c109
AD
2762002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
277 and Akim Demaille <akim@epita.fr>
278
279 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
280 what's left on the stack when the error recovery hits EOF.
281 * tests/actions.at (Destructors): Complete to exercise this case.
282
9280d3ef
AD
2832002-06-17 Akim Demaille <akim@epita.fr>
284
285 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
286 arguments is really empty, not only equal to `[]'.
287 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
288 member.
289 (symbol_destructor_set): New.
290 * src/output.c (symbol_destructors_output): New.
291 * src/reader.h (brace_code_t, current_braced_code): New.
292 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
293 (handle_dollar): Rename as...
294 (handle_action_dollar): this.
295 (handle_destructor_dollar): New.
296 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
297 (grammar_declaration): Use it.
298 * data/bison.simple (yystos): Is always defined.
299 (yydestructor): New.
300 * tests/actions.at (Destructors): New.
301 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
302
dafdc66f
AD
3032002-06-17 Akim Demaille <akim@epita.fr>
304
305 * src/symlist.h, src/symlist.c (symbol_list_length): New.
306 * src/scan-gram.l (handle_dollar, handle_at): Compute the
307 rule_length only when needed.
308 * src/output.c (actions_output, token_definitions_output): Output
309 the full M4 block.
310 * src/symtab.c: Don't access directly to the symbol tag, use
311 symbol_tag_get.
312 * src/parse-gram.y: Use symbol_list_free.
313
56c47203
AD
3142002-06-17 Akim Demaille <akim@epita.fr>
315
316 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
317 (symbol_list_prepend, get_type_name): Move to...
318 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
319 (symbol_list_prepend, symbol_list_n_type_name_get): here.
320 Adjust all callers.
321 (symbol_list_free): New.
322 * src/scan-gram.l (handle_dollar): Takes a location.
323 * tests/input.at (Invalid $n): Adjust.
324
1e0bab92
AD
3252002-06-17 Akim Demaille <akim@epita.fr>
326
327 * src/reader.h, src/reader.c (symbol_list_new): Export it.
328 (symbol_list_prepend): New.
329 * src/parse-gram.y (%union): `list' is a new member.
330 (symbols.1): New, replaces...
331 (terms_to_prec.1, nterms_to_type.1): these.
332 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
333 Take a location as additional argument.
334 Adjust all callers.
335
04e60654
AD
3362002-06-15 Akim Demaille <akim@epita.fr>
337
338 * src/parse-gram.y: Move %token in the declaration section so that
339 we don't depend upon CVS Bison.
340
10e5b8bd
AD
3412002-06-15 Akim Demaille <akim@epita.fr>
342
343 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
344 * src/print.c (print_core): Use it.
345
9801d40c
AD
3462002-06-15 Akim Demaille <akim@epita.fr>
347
348 * src/conflicts.c (log_resolution): Accept the rule involved in
349 the sr conflicts instead of the lookahead number that points to
350 that rule.
351 (flush_reduce): Accept the current lookahead vector as argument,
352 instead of the index in LA.
353 (resolve_sr_conflict): Accept the current number of lookahead
354 bitset to consider for the STATE, instead of the index in LA.
355 (set_conflicts): Adjust.
356 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
357
c0263492
AD
3582002-06-15 Akim Demaille <akim@epita.fr>
359
360 * src/state.h (state_t): Replace the `lookaheadsp' member, a
361 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
362 Adjust all dependencies.
363 * src/lalr.c (initialize_lookaheads): Split into...
364 (states_lookaheads_count, states_lookaheads_initialize): these.
365 (lalr): Adjust.
366
9757c359
AD
3672002-06-15 Akim Demaille <akim@epita.fr>
368
369 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
370 out of...
371 (grammar_rules_print): here.
372 * src/reduce.c (reduce_output): Use it.
373 * tests/reduce.at (Useless Rules, Reduced Automaton)
374 (Underivable Rules): Adjust.
375
6b98e4b5
AD
3762002-06-15 Akim Demaille <akim@epita.fr>
377
378 Copy BYacc's nice way to report the grammar.
379
380 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
381 New.
382 Don't print the rules' location, it is confusing and useless.
383 (rule_print): Use grammar_rhs_print.
384 * src/print.c (print_grammar): Use grammar_rules_print.
385
6b98e4b5
AD
3862002-06-15 Akim Demaille <akim@epita.fr>
387
388 Complete and rationalize `useless thing' warnings.
389
390 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
391 (symbol_tag_print): New.
392 Use them everywhere in place of accessing directly the tag member.
393 * src/gram.h, src/gram.c (rule_print): New.
394 Use it where a rule used to be printed `by hand'.
395 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
396 (reduce_grammar_tables): Report the useless rules.
397 (reduce_print): Useless things are a warning, not an error.
398 Report it as such.
399 * tests/reduce.at (Useless Nonterminals, Useless Rules):
400 (Reduced Automaton, Underivable Rules): Adjust.
401 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
402 * tests/conflicts.at (Unresolved SR Conflicts)
403 (Solved SR Conflicts): Adjust.
404
ee000ba4
AD
4052002-06-15 Akim Demaille <akim@epita.fr>
406
407 Let symbols have a location.
408
409 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
410 (getsym): Adjust.
411 Adjust all callers.
412 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
413 Use location_t, not int.
414 * src/symtab.c (symbol_check_defined): Take advantage of the
415 location.
416 * tests/regression.at (Invalid inputs): Adjust.
417
8efe435c
AD
4182002-06-15 Akim Demaille <akim@epita.fr>
419
420 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
421 (input): Don't try to initialize yylloc here, do it in the
422 scanner.
423 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
424 * src/gram.h (rule_t): Change line and action_line into location
425 and action_location, of location_t type.
426 Adjust all dependencies.
427 * src/location.h, src/location.c (empty_location): New.
428 * src/reader.h, src/reader.c (grammar_start_symbol_set)
429 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
430 (grammar_current_rule_symbol_append)
431 (grammar_current_rule_action_append): Expect a location as argument.
432 * src/reader.c (grammar_midrule_action): Adjust to attach an
433 action's location as dummy symbol location.
434 * src/symtab.h, src/symtab.c (startsymbol_location): New.
435 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
436 the line numbers.
437
1921f1d7
AD
4382002-06-14 Akim Demaille <akim@epita.fr>
439
440 Grammar declarations may be found in the grammar section.
441
442 * src/parse-gram.y (rules_or_grammar_declaration): New.
443 (declarations): Each declaration may end with a semicolon, not
444 just...
445 (grammar_declaration): `"%union"'.
446 (grammar): Branch to rules_or_grammar_declaration.
447
4515534c
AD
4482002-06-14 Akim Demaille <akim@epita.fr>
449
450 * src/main.c (main): Invoke scanner_free.
451
f958596b
AD
4522002-06-14 Akim Demaille <akim@epita.fr>
453
454 * src/output.c (m4_invoke): Extracted from...
455 (output_skeleton): here.
456 Free tempfile.
457
2c569025
AD
4582002-06-14 Akim Demaille <akim@epita.fr>
459
460 * src/parse-gram.y (directives, directive, gram)
461 (grammar_directives, precedence_directives, precedence_directive):
462 Rename as...
463 (declarations, declaration, grammar, grammar_declaration)
464 (precedence_declaration, precedence_declarator): these.
465 (symbol_declaration): New.
466
592e8d4d
AD
4672002-06-14 Akim Demaille <akim@epita.fr>
468
469 * src/files.c (action_obstack): Remove, unused.
470 (output_obstack): Remove it, and all its dependencies, as it is no
471 longer needed.
472 * src/reader.c (epilogue_set): Build the epilogue in the
473 muscle_obstack.
474 * src/output.h, src/output.c (muscle_obstack): Move to...
475 * src/muscle_tab.h, src/muscle_tab.h: here.
476 (muscle_init): Initialize muscle_obstack.
477 (muscle_free): New.
478 * src/main.c (main): Call it.
479
0c15323d
AD
4802002-06-14 Akim Demaille <akim@epita.fr>
481
482 * src/location.h: New, extracted from...
483 * src/reader.h: here.
484 * src/Makefile.am (noinst_HEADERS): Merge into
485 (bison_SOURCES): this.
486 Add location.h.
487 * src/parse-gram.y: Use location_t instead of Bison's.
488 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
489 Use location_t instead of ints.
490
e96c9728
AD
4912002-06-14 Akim Demaille <akim@epita.fr>
492
493 * data/bison.simple, data/bison.c++: Be sure to restore the
494 current #line when returning to the skeleton contents after having
495 exposed the input file's #line.
496
75d1fe16
AD
4972002-06-12 Akim Demaille <akim@epita.fr>
498
499 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
500 eager.
501 * tests/actions.at (Exotic Dollars): New.
502
6c35d22c
AD
5032002-06-12 Akim Demaille <akim@epita.fr>
504
505 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
506 ['"/] too eagerly.
507 * tests/input.at (Torturing the Scanner): New.
508
1d6412ad
AD
5092002-06-11 Akim Demaille <akim@epita.fr>
510
511 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
512 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
513 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
514 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
515 * src/reader.c (reader): Use it.
516
4cdb01db
AD
5172002-06-11 Akim Demaille <akim@epita.fr>
518
519 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
520 Adjust all callers.
521 (scanner_last_string_free): New.
522
44995b2e
AD
5232002-06-11 Akim Demaille <akim@epita.fr>
524
525 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
526 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
527 (last_string, YY_OBS_FREE): New.
528 Use them when returning an ID.
529
e9955c83
AD
5302002-06-11 Akim Demaille <akim@epita.fr>
531
532 Have Bison grammars parsed by a Bison grammar.
533
534 * src/reader.c, src/reader.h (prologue_augment): New.
535 * src/reader.c (copy_definition): Remove.
536
537 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
538 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
539 (grammar_current_rule_prec_set, grammar_current_rule_check)
540 (grammar_current_rule_symbol_append)
541 (grammar_current_rule_action_append): Export.
542 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
543 (symbol_list_action_append): Remove.
544 Hook the routines from reader.
545 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
546 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
547
548 * src/reader.c (read_declarations): Remove, unused.
549
550 * src/parse-gram.y: Handle the epilogue.
551 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
552 (grammar_start_symbol_set): this.
553 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
554 * src/reader.c (readgram): Remove, unused.
555 (reader): Adjust to insert eoftoken and axiom where appropriate.
556
557 * src/reader.c (copy_dollar): Replace with...
558 * src/scan-gram.h (handle_dollar): this.
559 * src/parse-gram.y: Remove `%thong'.
560
561 * src/reader.c (copy_at): Replace with...
562 * src/scan-gram.h (handle_at): this.
563
564 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
565 New.
566
567 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
568 time being.
569
570 * src/reader.h, src/reader.c (grammar_rule_end): New.
571
572 * src/parse.y (current_type, current_class): New.
573 Implement `%nterm', `%token' support.
574 Merge `%term' into `%token'.
575 (string_as_id): New.
576 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
577 type name.
578
579 * src/parse-gram.y: Be sure to handle properly the beginning of
580 rules.
581
582 * src/parse-gram.y: Handle %type.
583 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
584
585 * src/parse-gram.y: More directives support.
586 * src/options.c: No longer handle source directives.
587
588 * src/parse-gram.y: Fix %output.
589
590 * src/parse-gram.y: Handle %union.
591 Use the prologue locations.
592 * src/reader.c (parse_union_decl): Remove.
593
594 * src/reader.h, src/reader.c (epilogue_set): New.
595 * src/parse-gram.y: Use it.
596
597 * data/bison.simple, data/bison.c++: b4_stype is now either not
598 defined, then default to int, or to the contents of %union,
599 without `union' itself.
600 Adjust.
601 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
602
603 * src/output.c (actions_output): Don't output braces, as they are
604 already handled by the scanner.
605
606 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
607 characters to themselves.
608
609 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
610 that the epilogue has a proper #line.
611
612 * src/parse-gram.y: Handle precedence/associativity.
613
614 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
615 a terminal.
616 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
617 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
618 at all to define terminals that cannot be emitted.
619
620 * src/scan-gram.l: Escape M4 characters.
621
622 * src/scan-gram.l: Working properly with escapes in user
623 strings/characters.
624
625 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
626 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
627 grammar.
628 Use more modest sizes, as for the time being the parser does not
629 release memory, and therefore the process swallows a huge amount
630 of memory.
631
632 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
633 stricter %token grammar.
634
635 * src/symtab.h (associativity): Add `undef_assoc'.
636 (symbol_precedence_set): Do nothing when passed an undef_assoc.
637 * src/symtab.c (symbol_check_alias_consistence): Adjust.
638
639 * tests/regression.at (Invalid %directive): Remove, as it is now
640 meaningless.
641 (Invalid inputs): Adjust to the new error messages.
642 (Token definitions): The new grammar doesn't allow too many
643 eccentricities.
644
645 * src/lex.h, src/lex.c: Remove.
646 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
647 (copy_character, copy_string2, copy_string, copy_identifier)
648 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
649 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
650 (parse_action): Remove.
651 * po/POTFILES.in: Adjust.
652
2e047461
AD
6532002-06-11 Akim Demaille <akim@epita.fr>
654
655 * src/reader.c (parse_action): Don't store directly into the
656 rule's action member: return the action as a string.
657 Don't require `rule_length' as an argument: compute it.
658 (grammar_current_rule_symbol_append)
659 (grammar_current_rule_action_append): New, eved out from
660 (readgram): here.
661 Remove `action_flag', `rulelength', unused now.
662
9af3fbce
AD
6632002-06-11 Akim Demaille <akim@epita.fr>
664
665 * src/reader.c (grammar_current_rule_prec_set).
666 (grammar_current_rule_check): New, eved out from...
667 (readgram): here.
668 Remove `xaction', `first_rhs': useless.
669 * tests/input.at (Type clashes): New.
670 * tests/existing.at (GNU Cim Grammar): Adjust.
671
1485e106
AD
6722002-06-11 Akim Demaille <akim@epita.fr>
673
674 * src/reader.c (grammar_midrule_action): New, Eved out from
675 (readgram): here.
676
da4160c3
AD
6772002-06-11 Akim Demaille <akim@epita.fr>
678
679 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
680 New.
681 (readgram): Use them as replacement of inlined code, crule and
682 crule1.
683
f6d0f937
AD
6842002-06-11 Akim Demaille <akim@epita.fr>
685
686 * src/reader.c (grammar_end, grammar_symbol_append): New.
687 (readgram): Use them.
688 Make the use of `p' as local as possible.
689
69078d4b
AD
6902002-06-10 Akim Demaille <akim@epita.fr>
691
692 GCJ's parser requires the tokens to be defined before the prologue.
693
694 * data/bison.simple: Output the token definition before the user's
695 prologue.
696 * tests/regression.at (Braces parsing, Duplicate string)
697 (Mixing %token styles): Check the output from bison.
698 (Early token definitions): New.
699
5e424082
AD
7002002-06-10 Akim Demaille <akim@epita.fr>
701
702 * src/symtab.c (symbol_user_token_number_set): Don't complain when
703 assigning twice the same user number to a token, so that we can
704 use it in...
705 * src/lex.c (lex): here.
706 Also use `symbol_class_set' instead of hand written code.
707 * src/reader.c (parse_assoc_decl): Likewise.
708
44536b35
AD
7092002-06-10 Akim Demaille <akim@epita.fr>
710
711 * src/symtab.c, src/symtab.c (symbol_class_set)
712 (symbol_user_token_number_set): New.
713 * src/reader.c (parse_token_decl): Use them.
714 Use a switch instead of ifs.
715 Use a single argument.
716
8b9f2372
AD
7172002-06-10 Akim Demaille <akim@epita.fr>
718
719 Remove `%thong' support as it is undocumented, unused, duplicates
720 `%token's job, and creates useless e-mail traffic with people who
721 want to know what it is, why it is undocumented, unused, and
722 duplicates `%token's job.
723
724 * src/reader.c (parse_thong_decl): Remove.
725 * src/options.c (option_table): Remove "thong".
726 * src/lex.h (tok_thong): Remove.
727
3ae2b51f
AD
7282002-06-10 Akim Demaille <akim@epita.fr>
729
730 * src/symtab.c, src/symtab.c (symbol_type_set)
731 (symbol_precedence_set): New.
732 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
733 (value_components_used): Remove, unused.
734
2f1afb73
AD
7352002-06-09 Akim Demaille <akim@epita.fr>
736
737 Move symbols handling code out of the reader.
738
739 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
740 (axiom): Move to...
741 * src/symtab.h, src/symtab.c: here.
742
743 * src/gram.c (start_symbol): Remove: use startsymbol->number.
744 * src/reader.c (startval): Rename as...
745 * src/symtab.h, src/symtab.c (startsymbol): this.
746 * src/reader.c: Adjust.
747
748 * src/reader.c (symbol_check_defined, symbol_make_alias)
749 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
750 (token_translations_init)
751 Move to...
752 * src/symtab.c: here.
753 * src/reader.c (packsymbols): Move to...
754 * src/symtab.h, src/symtab.c (symbols_pack): here.
755 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
756 argument.
757
e9bca3ad
AD
7582002-06-03 Akim Demaille <akim@epita.fr>
759
760 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
761 then statements.
762
86eff183
AD
7632002-06-03 Akim Demaille <akim@epita.fr>
764
765 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
766 structs with non literals.
767 * src/scan-skel.l: never-interactive.
768 * src/conflicts.c (enum conflict_resolution_e): No trailing
769 comma.
770 * src/getargs.c (usage): Split long literal strings.
771 Reported by Hans Aberg.
772
717be197
AD
7732002-05-28 Akim Demaille <akim@epita.fr>
774
775 * data/bison.c++: Use C++ ostreams.
776 (cdebug_): New member.
777
670ddffd
AD
7782002-05-28 Akim Demaille <akim@epita.fr>
779
780 * src/output.c (output_skeleton): Be sure to allocate enough room
781 for `/' _and_ for `\0' in full_skeleton.
782
769b430f
AD
7832002-05-28 Akim Demaille <akim@epita.fr>
784
785 * data/bison.c++: Catch up with bison.simple:
786 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
787 and Paul Eggert <eggert@twinsun.com>: `error' handing.
788 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
789 and popping traces.
790
7067cb36
PH
7912002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
792
793 * src/output.c (output_skeleton): Put an explicit path in front of
794 the skeleton file name, rather than relying on the -I directory,
795 to partially alleviate effects of having a skeleton file lying around
796 in the current directory.
769b430f 797
4a713ec2
PH
7982002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
799
769b430f 800 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
801 obstack_printf should be obstack_fgrow1.
802
b408954b
AD
8032002-05-26 Akim Demaille <akim@epita.fr>
804
805 * src/state.h (state_t): `solved_conflicts' is a new member.
806 * src/LR0.c (new_state): Set it to 0.
807 * src/conflicts.h, src/conflicts.c (print_conflicts)
808 (free_conflicts, solve_conflicts): Rename as...
809 (conflicts_print, conflicts_free, conflicts_solve): these.
810 Adjust callers.
811 * src/conflicts.c (enum conflict_resolution_e)
812 (solved_conflicts_obstack): New, used by...
813 (log_resolution): this.
814 Adjust to attach the conflict resolution to each state.
815 Complete the description with the precedence/associativity
816 information.
817 (resolve_sr_conflict): Adjust.
818 * src/print.c (print_state): Output its solved_conflicts.
819 * tests/conflicts.at (Unresolved SR Conflicts)
820 (Solved SR Conflicts): Exercise --report=all.
821
a49aecd5
AD
8222002-05-26 Akim Demaille <akim@epita.fr>
823
824 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
825 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
826 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
827 (token_number_t, item_number_as_token_number)
828 (token_number_as_item_number, muscle_insert_token_number_table):
829 Rename as...
830 (symbol_number_t, item_number_as_symbol_number)
831 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
832 these, since it is more appropriate.
833
5504898e
AD
8342002-05-26 Akim Demaille <akim@epita.fr>
835
836 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
837 `Error:' lines.
838 * data/bison.simple (yystos) [YYDEBUG]: New.
839 (yyparse) [YYDEBUG]: Display the symbols which are popped during
840 error recovery.
841 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
842
ec3bc396
AD
8432002-05-25 Akim Demaille <akim@epita.fr>
844
845 * doc/bison.texinfo (Debugging): Split into...
846 (Tracing): this new section, its former contents, and...
847 (Understanding): this new section.
848 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
849 by...
850 (report_flag): this.
851 Adjust all dependencies.
852 (report_args, report_types, report_argmatch): New.
853 (usage, getargs): Report/support -r, --report.
854 * src/options.h
855 (struct option_table_struct): Rename as..,
856 (struct option_table_s): this.
857 Rename the `set_flag' member to `flag' to match with getopt_long's
858 struct.
859 * src/options.c (option_table): Split verbose into an entry for
860 %verbose, and another for --verbose.
861 Support --report/-r, so remove -r from the obsolete --raw.
862 * src/print.c: Attach full item sets and lookaheads reports to
863 report_flag instead of trace_flag.
864 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
865
78df8250
PE
8662002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
867 and Paul Eggert <eggert@twinsun.com>
769b430f 868
78df8250
PE
869 * data/bison.simple (yyparse): Correct error handling to conform to
870 POSIX and yacc. Specifically, after syntax error is discovered,
871 do not reduce further before shifting the error token.
872 Clean up the code a bit by removing the labels yyerrdefault,
873 yyerrhandle, yyerrpop.
874 * NEWS: Document the above.
875
c0c9ea05
PH
8762002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
877
878 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
879 type; it isn't always big enough, since it doesn't necessarily
880 include non-terminals.
769b430f 881 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
882 the latter can be removed.
883 (yy_token_number_type): Remove, only one use.
884 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
885 don't use TokenNumberType as element type.
769b430f 886
c0c9ea05
PH
887 * tests/regression.at: Modify expected output to agree with change
888 to yyr1 and yytranslate.
769b430f 889
6390a83f
FK
8902002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
891
892 * src/reader.c (parse_action): Use copy_character instead of
893 obstack_1grow.
894
db7c8e9a
AD
8952002-05-13 Akim Demaille <akim@epita.fr>
896
897 * tests/regression.at (Token definitions): Prototype yylex and
898 yyerror.
899
fcc61800
PH
9002002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
901
158c687b 902 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
903 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
904 32-bit arithmetic.
905 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
906
5683e9b2
AD
9072002-05-07 Akim Demaille <akim@epita.fr>
908
909 * tests/synclines.at: Be sure to prototype yylex and yyerror to
910 avoid GCC warnings.
911
0c2d3f4c
AD
9122002-05-07 Akim Demaille <akim@epita.fr>
913
914 Kill GCC warnings.
915
916 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
917 over the RHS of each rule.
918 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
919 * src/state.h (state_t): Member `nitems' is unsigned short.
920 * src/LR0.c (get_state): Adjust.
921 * src/reader.c (packgram): Likewise.
922 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
923 `Type'.
924 (muscle_insert_int_table): Remove, unused.
925 (prepare_rules): Remove `max'.
926
1565b720
AD
9272002-05-06 Akim Demaille <akim@epita.fr>
928
929 * src/closure.c (print_firsts): Display of the symbol tags.
930 (bitmatrix_print): Move to...
931 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
932 here.
933 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
934
cfaee611
AD
9352002-05-06 Akim Demaille <akim@epita.fr>
936
937 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
938 hash_do_for_each.
939
458be8e0
AD
9402002-05-06 Akim Demaille <akim@epita.fr>
941
942 * src/LR0.c (new_state, get_state): Instead of using the global
943 `kernel_size' and `kernel_base', have two new arguments:
944 `core_size' and `core'.
945 Adjust callers.
946
a900a624
AD
9472002-05-06 Akim Demaille <akim@epita.fr>
948
949 * src/reader.c (packgram): No longer end `ritem' with a 0
950 sentinel: it is not used.
951
d4e7d3a1
AD
9522002-05-05 Akim Demaille <akim@epita.fr>
953
954 New experimental feature: display the lookaheads in the report and
955 graph.
956
957 * src/print (print_core): When --trace-flag, display the rules
958 lookaheads.
959 * src/print_graph.c (print_core): Likewise.
960 Swap the arguments.
961 Adjust caller.
962
39ceb25b
AD
9632002-05-05 Akim Demaille <akim@epita.fr>
964
965 * tests/torture.at (Many lookaheads): New test.
966
5372019f
AD
9672002-05-05 Akim Demaille <akim@epita.fr>
968
969 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
970 (GENERATE_MUSCLE_INSERT_TABLE): this.
971 (output_int_table, output_unsigned_int_table, output_short_table)
972 (output_token_number_table, output_item_number_table): Replace with...
973 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
974 (muscle_insert_short_table, muscle_insert_token_number_table)
975 (muscle_insert_item_number_table): these.
976 Adjust all callers.
977 (prepare_tokens): Don't free `translations', since...
978 * src/reader.h, src/reader.c (grammar_free): do it.
979 Move to...
980 * src/gram.h, src/gram.c (grammar_free): here.
981 * data/bison.simple, data/bison.c++: b4_token_number_max is now
982 b4_translate_max.
983
5df5f6d5
AD
9842002-05-05 Akim Demaille <akim@epita.fr>
985
986 * src/output.c (output_unsigned_int_table): New.
987 (prepare_rules): `i' is unsigned.
988 `prhs', `rline', `r2' are unsigned int.
989 Rename muscle `rhs_number_max' as `rhs_max'.
990 Output muscles `prhs_max', `rline_max', and `r2_max'.
991 Free rline and r1.
992 * data/bison.simple, data/bison.c++: Adjust to use these muscles
993 to compute types instead of constant types.
994 * tests/regression.at (Web2c Actions): Adjust.
995
b87f8b21
AD
9962002-05-04 Akim Demaille <akim@epita.fr>
997
998 * src/symtab.h (SALIAS, SUNDEF): Rename as...
999 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
1000 Adjust dependencies.
1001 * src/output.c (token_definitions_output): Be sure not to output a
1002 `#define 'a'' when fed with `%token 'a' "a"'.
1003 * tests/regression.at (Token definitions): New.
1004
8bb936e4
PE
10052002-05-03 Paul Eggert <eggert@twinsun.com>
1006
1007 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
1008 for K&R C.
1009
10102002-05-03 gettextize <bug-gnu-gettext@gnu.org>
1011
1012 * Makefile.am (SUBDIRS): Remove intl.
1013 (EXTRA_DIST): Add config/config.rpath.
1014
53c71a12
AD
10152002-05-03 Akim Demaille <akim@epita.fr>
1016
1017 * data/bison.simple (m4_if): Don't output empty enums.
1018 And actually, output valid enum definitions :(.
1019
289dd0cf
AD
10202002-05-03 Akim Demaille <akim@epita.fr>
1021
1022 * configure.bat: Remove, completely obsolete.
1023 * Makefile.am (EXTRA_DIST): Adjust.
1024 Don't distribute config.rpath...
1025 * config/Makefile.am (EXTRA_DIST): Do it.
1026
db85e524
AD
10272002-05-03 Akim Demaille <akim@epita.fr>
1028
1029 * configure.in (GETTEXT_VERSION): New.
1030 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
1031
83ccf991
AD
10322002-05-03 Akim Demaille <akim@epita.fr>
1033
1034 * data/bison.simple (b4_token_enum): New.
1035 (b4_token_defines): Use it to output tokens both as #define and
1036 enums.
1037 Suggested by Paul Eggert.
1038 * src/output.c (token_definitions_output): Don't output spurious
1039 white spaces.
1040
1f418995
AD
10412002-05-03 Akim Demaille <akim@epita.fr>
1042
1043 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1044
45119f04
RA
10452002-05-02 Robert Anisko <robert@lrde.epita.fr>
1046
1047 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
1048 Update the stack class, give a try to deque as the default container.
1049
b2d52318
AD
10502002-05-02 Akim Demaille <akim@epita.fr>
1051
1052 * data/bison.simple (yyparse): Do not implement @$ = @1.
1053 (YYLLOC_DEFAULT): Adjust to do it.
1054 * doc/bison.texinfo (Location Default Action): Fix.
1055
3a8b4109
AD
10562002-05-02 Akim Demaille <akim@epita.fr>
1057
1058 * src/reader.c (parse_braces): Merge into...
1059 (parse_action): this.
1060
84614e13
AD
10612002-05-02 Akim Demaille <akim@epita.fr>
1062
1063 * configure.in (ALL_LINGUAS): Remove.
1064 * po/LINGUAS, hr.po: New.
1065
fdbcd8e2
AD
10662002-05-02 Akim Demaille <akim@epita.fr>
1067
1068 Remove the so called hairy (semantic) parsers.
1069
1070 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
1071 * src/gram.h, src/gram.c (semantic_parser): Remove.
1072 (rule_t): Remove the guard and guard_line members.
1073 * src/lex.h (token_t): remove tok_guard.
1074 * src/options.c (option_table): Remove %guard and %semantic_parser
1075 support.
1076 * src/output.c, src/output.h (guards_output): Remove.
1077 (prepare): Adjust.
1078 (token_definitions_output): Don't output the `T'
1079 tokens (???).
1080 (output_skeleton): Don't output the guards.
1081 * src/files.c, src/files.c (attrsfile): Remove.
1082 * src/reader.c (symbol_list): Remove the guard and guard_line
1083 members.
1084 Adjust dependencies.
1085 (parse_guard): Remove.
1086 * data/bison.hairy: Remove.
1087 * doc/bison.texinfo (Environment Variables): Remove occurrences of
1088 BISON_HAIRY.
1089
82b6cb3f
AD
10902002-05-02 Akim Demaille <akim@epita.fr>
1091
1092 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
1093 (parse_guard): Rename the formal argument `stack_offset' as
1094 `rule_length', which is more readable.
1095 Adjust callers.
1096 (copy_at, copy_dollar): Instead of outputting the hard coded
1097 values of $$, $n and so forth, output invocation to b4_lhs_value,
1098 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
1099 Note: this patch partially drops `semantic-parser' support: it
1100 always does `rule_length - n', where semantic parsers ought to
1101 always use `-n'.
82b6cb3f
AD
1102 * data/bison.simple, data/bison.c++ (b4_lhs_value)
1103 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
1104
6cbfbcc5
AD
11052002-05-02 Akim Demaille <akim@epita.fr>
1106
1107 * configure.in (AC_INIT): Bump to 1.49b.
1108 (AM_INIT_AUTOMAKE): Short invocation.
1109
b8548114
AD
11102002-05-02 Akim Demaille <akim@epita.fr>
1111
1112 Version 1.49a.
1113
c20cd1fa
AD
11142002-05-01 Akim Demaille <akim@epita.fr>
1115
1116 * src/skeleton.h: Remove.
1117
8a9566d4
AD
11182002-05-01 Akim Demaille <akim@epita.fr>
1119
1120 * src/skeleton.h: Fix the #endif.
1121 Reported by Magnus Fromreide.
1122
8c6d399a
PE
11232002-04-26 Paul Eggert <eggert@twinsun.com>
1124
1125 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
1126 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 1127 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 1128
2b7ed18a
RA
11292002-04-25 Robert Anisko <robert@lrde.epita.fr>
1130
1131 * src/scan-skel.l: Postprocess quadrigraphs.
1132
1133 * src/reader.c (copy_character): New function, used to output
1134 single characters while replacing `[' and `]' with quadrigraphs, to
1135 avoid troubles with M4 quotes.
1136 (copy_comment): Output characters with copy_character.
1137 (read_additionnal_code): Likewise.
1138 (copy_string2): Likewise.
1139 (copy_definition): Likewise.
1140
1141 * tests/calc.at: Exercise M4 quoting.
1142
34a89c50
AD
11432002-04-25 Akim Demaille <akim@epita.fr>
1144
1145 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
1146 between `!' and the command.
1147 Reported by Paul Eggert.
1148
0dd1580a
RA
11492002-04-24 Robert Anisko <robert@lrde.epita.fr>
1150
1151 * tests/calc.at: Exercise prologue splitting.
1152
1153 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
1154 `b4_post_prologue' instead of `b4_prologue'.
1155
1156 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
1157 muscles.
1158 (output): Free pre_prologue_obstack and post_prologue_obstack.
1159 * src/files.h, src/files.c (attrs_obstack): Remove.
1160 (pre_prologue_obstack, post_prologue_obstack): New.
1161 * src/reader.c (copy_definition): Add a parameter to specify the
1162 obstack to fill, instead of using attrs_obstack unconditionally.
1163 (read_declarations): Pass pre_prologue_obstack to copy_definition if
1164 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
1165
83c1796f
PE
11662002-04-23 Paul Eggert <eggert@twinsun.com>
1167
1168 * data/bison.simple: Remove unnecessary commentary and white
1169 space differences from 1_29-branch.
1170 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
1171
1172 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
1173 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
1174 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
1175 constructors or destructors.
1176
1177 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
1178
1207eeac
AD
11792002-04-23 Akim Demaille <akim@epita.fr>
1180
1181 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
1182 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
1183 location with columns.
1184 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
1185 All reported by Paul Eggert.
1186
78ab8f67
AD
11872002-04-22 Akim Demaille <akim@epita.fr>
1188
1189 * src/reduce.c (dump_grammar): Move to...
1190 * src/gram.h, src/gram.c (grammar_dump): here.
1191 Be sure to separate long item numbers.
1192 Don't read the members of a rule's prec if its nil.
1193
133c20e2
AD
11942002-04-22 Akim Demaille <akim@epita.fr>
1195
1196 * src/output.c (table_size, table_grow): New.
1197 (MAXTABLE): Remove, replace uses with table_size.
1198 (pack_vector): Instead of dying when the table is too big, grow it.
1199
9515e8a7
AD
12002002-04-22 Akim Demaille <akim@epita.fr>
1201
1202 * data/bison.simple (yyr1): Its type is that of a token number.
1203 * data/bison.c++ (r1_): Likewise.
1204 * tests/regression.at (Web2c Actions): Adjust.
1205
23c5a174
AD
12062002-04-22 Akim Demaille <akim@epita.fr>
1207
1208 * src/reader.c (token_translations_init): 256 is now the default
1209 value for the error token, i.e., it will be assigned another
1210 number if the user assigned 256 to one of her tokens.
1211 (reader): Don't force 256 to error.
1212 * doc/bison.texinfo (Symbols): Adjust.
1213 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
1214 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
1215 etc. instead of 10, 20, 30 (which was used to `jump' over error
1216 (256) and undefined (2)).
1217
5fbb0954
AD
12182002-04-22 Akim Demaille <akim@epita.fr>
1219
1220 Propagate more token_number_t.
1221
1222 * src/gram.h (token_number_as_item_number)
1223 (item_number_as_token_number): New.
1224 * src/output.c (GENERATE_OUTPUT_TABLE): New.
1225 Use it to create output_item_number_table and
1226 output_token_number_table.
1227 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
1228 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
1229 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
1230 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
1231
4f940944
AD
12322002-04-22 Akim Demaille <akim@epita.fr>
1233
1234 * src/output.h, src/output.c (get_lines_number): Remove.
1235
3ded9a63
AD
12362002-04-19 Akim Demaille <akim@epita.fr>
1237
1238 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
1239 as Lex/Flex'.
1240 (Debugging): More details about enabling the debugging features.
1241 (Table of Symbols): Describe $$, $n, @$, and @n.
1242 Suggested by Tim Josling.
1243
e0c471a9
AD
12442002-04-19 Akim Demaille <akim@epita.fr>
1245
1246 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
1247
fecc10cd
AD
12482002-04-10 Akim Demaille <akim@epita.fr>
1249
1250 * src/system.h: Rely on HAVE_LIMITS_H.
1251 Suggested by Paul Eggert.
1252
51dec47b
AD
12532002-04-09 Akim Demaille <akim@epita.fr>
1254
1255 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
1256 full stderr, and strip it according to the bison options, instead
1257 of composing the error message from different bits.
1258 This makes it easier to check for several error messages.
1259 Adjust all the invocations.
1260 Add an invocation exercising the error token.
1261 Add an invocation demonstrating a stupid error message.
1262 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
1263 Adjust the tests.
1264 Error message are for stderr, not stdout.
1265
007a50a4
AD
12662002-04-09 Akim Demaille <akim@epita.fr>
1267
1268 * src/gram.h, src/gram.c (error_token_number): Remove, use
1269 errtoken->number.
1270 * src/reader.c (reader): Don't specify the user token number (2)
1271 for $undefined, as it uselessly prevents using it.
1272 * src/gram.h (token_number_t): Move to...
1273 * src/symtab.h: here.
1274 (state_t.number): Is a token_number_t.
1275 * src/print.c, src/reader.c: Use undeftoken->number instead of
1276 hard coded 2.
1277 (Even though this 2 is not the same as above: the number of the
1278 undeftoken remains being 2, it is its user token number which
1279 might not be 2).
1280 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
1281 `user_token_number_max'.
1282 Output `undef_token_number'.
1283 * data/bison.simple, data/bison.c++: Use them.
1284 Be sure to map invalid yylex return values to
1285 `undef_token_number'. This saves us from gratuitous SEGV.
1286
1287 * tests/conflicts.at (Solved SR Conflicts)
1288 (Unresolved SR Conflicts): Adjust.
1289 * tests/regression.at (Web2c Actions): Adjust.
1290
06446ccf
AD
12912002-04-08 Akim Demaille <akim@epita.fr>
1292
1293 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
1294 Adding #line.
1295 Remove the duplicate `typedefs'.
1296 (RhsNumberType): Fix the declaration and various other typos.
1297 Use __ofile__.
1298 * data/bison.simple: Use __ofile__.
1299 * src/scan-skel.l: Handle __ofile__.
1300
62a3e4f0
AD
13012002-04-08 Akim Demaille <akim@epita.fr>
1302
1303 * src/gram.h (item_number_t): New, the type of item numbers in
1304 RITEM. Note that it must be able to code symbol numbers as
1305 positive number, and the negation of rule numbers as negative
1306 numbers.
1307 Adjust all dependencies (pretty many).
1308 * src/reduce.c (rule): Remove this `short *' pointer: use
1309 item_number_t.
1310 * src/system.h (MINSHORT, MAXSHORT): Remove.
1311 Include `limits.h'.
1312 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
1313 (shortcpy): Remove.
1314 (MAXTABLE): Move to...
1315 * src/output.c (MAXTABLE): here.
1316 (prepare_rules): Use output_int_table to output rhs.
1317 * data/bison.simple, data/bison.c++: Adjust.
1318 * tests/torture.at (Big triangle): Move the limit from 254 to
1319 500.
1320 * tests/regression.at (Web2c Actions): Ajust.
1321
1322 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
1323 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
1324 passes, but produces negative #line number, once fixed, GCC is
1325 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
1326 C), it passes.
1327 * src/state.h (state_h): Code input lines on ints, not shorts.
1328
bb88b0fc
AD
13292002-04-08 Akim Demaille <akim@epita.fr>
1330
1331 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
1332 and then the grammar.
1333
9a636f47
AD
13342002-04-08 Akim Demaille <akim@epita.fr>
1335
1336 * src/system.h: No longer using strndup.
1337
680e8701
AD
13382002-04-07 Akim Demaille <akim@epita.fr>
1339
1340 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
1341 * src/output.c (output_table_data): Return the longest number.
1342 (prepare_tokens): Output `token_number_max').
1343 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
1344 New.
1345 Use them to define yy_token_number_type/TokenNumberType.
1346 Use this type for yytranslate.
1347 * tests/torture.at (Big triangle): Push the limit from 124 to
1348 253.
1349 * tests/regression.at (Web2c Actions): Adjust.
1350
817e9f41
AD
13512002-04-07 Akim Demaille <akim@epita.fr>
1352
1353 * tests/torture.at (Big triangle): New.
1354 (GNU AWK Grammar, GNU Cim Grammar): Move to...
1355 * tests/existing.at: here.
1356
5123689b
AD
13572002-04-07 Akim Demaille <akim@epita.fr>
1358
1359 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
1360 nritems.
1361 Adjust dependencies.
1362
f3849179
AD
13632002-04-07 Akim Demaille <akim@epita.fr>
1364
1365 * src/reader.c: Normalize increments to prefix form.
1366
bd02036a
AD
13672002-04-07 Akim Demaille <akim@epita.fr>
1368
1369 * src/reader.c, symtab.c: Remove debugging code.
1370
db8837cb
AD
13712002-04-07 Akim Demaille <akim@epita.fr>
1372
1373 Rename all the `bucket's as `symbol_t'.
1374
1375 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
1376 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
1377 * src/symtab.c, src/symtab.h (bucket): Rename as...
1378 (symbol_t): this.
1379 (symbol_list_new, bucket_check_defined, bucket_make_alias)
1380 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
1381 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1382 (buckets_new, buckets_free, buckets_do): Rename as...
1383 (symbol_list_new, symbol_check_defined, symbol_make_alias)
1384 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
1385 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
1386 (symbols_new, symbols_free, symbols_do): these.
1387
72a23c97
AD
13882002-04-07 Akim Demaille <akim@epita.fr>
1389
1390 Use lib/hash for the symbol table.
1391
1392 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
1393 EOF.
1394 * src/lex.c (lex): Set the `number' member of new terminals.
1395 * src/reader.c (bucket_check_defined, bucket_make_alias)
1396 (bucket_check_alias_consistence, bucket_translation): New.
1397 (reader, grammar_free, readgram, token_translations_init)
1398 (packsymbols): Adjust.
1399 (reader): Number the predefined tokens.
1400 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
1401 for predefined tokens.
1402 * src/symtab.h (bucket): Remove all the hash table related
1403 members.
1404 * src/symtab.c (symtab): Replace by...
1405 (bucket_table): this.
1406 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
1407 (buckets_new, buckets_do): New.
1408
280a38c3
AD
14092002-04-07 Akim Demaille <akim@epita.fr>
1410
1411 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
1412 (start_symbol, max_user_token_number, semantic_parser)
1413 (error_token_number): Initialize.
1414 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
1415 Initialize.
1416 (reader): Don't.
1417 (errtoken, eoftoken, undeftoken, axiom): Extern.
1418
03b31c0c
AD
14192002-04-07 Akim Demaille <akim@epita.fr>
1420
1421 * src/gram.h (rule_s): prec and precsym are now pointers
1422 to the bucket giving the priority/associativity.
1423 Member `associativity' removed: useless.
1424 * src/reduce.c, src/conflicts.c: Adjust.
1425
8b3df748
AD
14262002-04-07 Akim Demaille <akim@epita.fr>
1427
1428 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
1429 Properly escape the symbols' TAG when outputting them.
1430
e601aa1d
AD
14312002-04-07 Akim Demaille <akim@epita.fr>
1432
1433 * src/lalr.h (LA): Is a bitsetv, not bitset*.
1434
b0299a2e
AD
14352002-04-07 Akim Demaille <akim@epita.fr>
1436
1437 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
1438 (LArule): this, which is an array to rule_t*.
1439 * src/print.c, src/conflicts.c: Adjust.
1440
d7e1f00c
AD
14412002-04-07 Akim Demaille <akim@epita.fr>
1442
1443 * src/gram.h (rule_t): Rename `number' as `user_number'.
1444 `number' is a new member.
1445 Adjust dependencies.
1446 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
1447
cc9305dd
AD
14482002-04-07 Akim Demaille <akim@epita.fr>
1449
1450 As a result of the previous patch, it is no longer needed
1451 to reorder ritem itself.
1452
1453 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
1454
b0940840
AD
14552002-04-07 Akim Demaille <akim@epita.fr>
1456
1457 Be sure never to walk through RITEMS, but use only data related to
1458 the rules themselves. RITEMS should be banished.
1459
1460 * src/output.c (output_token_translations): Rename as...
1461 (prepare_tokens): this.
1462 In addition to `translate', prepare the muscles `tname' and
1463 `toknum', which were handled by...
1464 (output_rule_data): this.
1465 Remove, and move the remainder of its outputs into...
1466 (prepare_rules): this new routines, which also merges content from
1467 (output_gram): this.
1468 (prepare_rules): Be sure never to walk through RITEMS.
1469 (output_stos): Rename as...
1470 (prepare_stos): this.
1471 (output): Always invoke prepare_states, after all, just don't use it
1472 in the output if you don't need it.
1473
643a5994
AD
14742002-04-07 Akim Demaille <akim@epita.fr>
1475
1476 * src/LR0.c (new_state): Display `nstates' as the name of the
1477 newly created state.
1478 Adjust to initialize first_state and last_state if needed.
1479 Be sure to distinguish the initial from the final state.
1480 (new_states): Create the itemset of the initial state, and use
1481 new_state.
1482 * src/closure.c (closure): Now that the initial state has its
1483 items properly set, there is no need for a special case when
1484 creating `ruleset'.
1485
1486 As a result, now the rule 0, reducing to $axiom, is visible in the
1487 outputs. Adjust the test suite.
1488
1489 * tests/conflicts.at (Solved SR Conflicts)
1490 (Unresolved SR Conflicts): Adjust.
1491 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
1492 * tests/conflicts.at (S/R in initial): New.
1493
b4c4ccc2
AD
14942002-04-07 Akim Demaille <akim@epita.fr>
1495
1496 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
1497 the RHS of the rules.
1498 * src/output.c (output_gram): Likewise.
1499
bba97eb2
AD
15002002-04-07 Akim Demaille <akim@epita.fr>
1501
1502 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
1503 bucket.
1504 Adjust all dependencies.
1505 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
1506 `number' of the buckets too.
1507 * src/gram.h: Include `symtab.h'.
1508 (associativity): Move to...
1509 * src/symtab.h: here.
1510 No longer include `gram.h'.
1511
c3b407f4
AD
15122002-04-07 Akim Demaille <akim@epita.fr>
1513
1514 * src/gram.h, src/gram.c (rules_rhs_length): New.
1515 (ritem_longest_rhs): Use it.
1516 * src/gram.h (rule_t): `number' is a new member.
1517 * src/reader.c (packgram): Set it.
1518 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
1519 the end of `rules', and count them out of `nrules'.
1520 (reduce_output, dump_grammar): Adjust.
1521 * src/print.c (print_grammar): It is no longer needed to check for
1522 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
1523 * tests/reduce.at (Reduced Automaton): New test.
1524
11652ab3
AD
15252002-04-07 Akim Demaille <akim@epita.fr>
1526
1527 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
1528 lacking `+ 1' to nrules, Bison reported as useless a token if it
1529 was used solely to set the precedence of the last rule...
1530
26b23c1a
AD
15312002-04-07 Akim Demaille <akim@epita.fr>
1532
1533 * data/bison.c++, data/bison.simple: Don't output the current file
1534 name in #line, to avoid useless diffs between two identical
1535 outputs under different names.
1536
18bcecb0
AD
15372002-04-07 Akim Demaille <akim@epita.fr>
1538
1539 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
1540 Normalize loops to using `< nrules + 1', not `<= nrules'.
1541
fa770c86
AD
15422002-04-07 Akim Demaille <akim@epita.fr>
1543
1544 * TODO: Update.
1545
d9b739c3
AD
15462002-04-07 Akim Demaille <akim@epita.fr>
1547
1548 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
1549 bucket.value as bucket.number.
1550
99013900
AD
15512002-04-07 Akim Demaille <akim@epita.fr>
1552
1553 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
1554 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
1555 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
1556 RHS, instead of being an index in RITEMS.
1557
e966383b
PE
15582002-04-04 Paul Eggert <eggert@twinsun.com>
1559
1560 * doc/bison.texinfo: Update copyright date.
1561 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
1562 (Symbols): Warn about running Bison in one character set,
1563 but compiling and/or running in an incompatible one.
1564 Warn about character code 256, too.
1565
15662002-04-03 Paul Eggert <eggert@twinsun.com>
1567
1568 * src/bison.data (YYSTACK_ALLOC): Depend on whether
1569 YYERROR_VERBOSE is nonzero, not whether it is defined.
1570
1571 Merge changes from bison-1_29-branch.
c307773e 1572
8d6c48b9
PE
15732002-03-20 Paul Eggert <eggert@twinsun.com>
1574
1575 Merge fixes from Debian bison_1.34-1.diff.
1576
1577 * configure.in (AC_PREREQ): 2.53.
1578
e53c6322
AD
15792002-03-20 Akim Demaille <akim@epita.fr>
1580
1581 * src/conflicts.c (log_resolution): Argument `resolution' is const.
1582
9ffbeca7
PE
15832002-03-19 Paul Eggert <eggert@twinsun.com>
1584
21db0b2a
PE
1585 * src/bison.simple (YYCOPY): New macro.
1586 (YYSTACK_RELOCATE): Use it.
1587 Remove Type arg; no longer needed. All callers changed.
1588 (yymemcpy): Remove; no longer needed.
1589
9ffbeca7
PE
1590 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
1591 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
1592
642cb8f8
AD
15932002-03-19 Akim Demaille <akim@epita.fr>
1594
1595 Test and fix the #line outputs.
1596
1597 * tests/atlocal.at (GCC): New.
1598 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
1599 (Prologue synch line, ,%union synch line, Postprologue synch line)
1600 (Action synch line, Epilogue synch line): New tests.
1601 * src/reader.c (parse_union_decl): Define the muscle stype_line.
1602 * data/bison.simple, data/bison.c++: Use it.
1603
3c31a486
AD
16042002-03-19 Akim Demaille <akim@epita.fr>
1605
1606 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
1607 (Solved SR Conflicts, %expect not enough, %expect right)
1608 (%expect too much): Move to...
1609 * tests/conflicts.at: this new file.
1610
0d8bed56
AD
16112002-03-19 Akim Demaille <akim@epita.fr>
1612
1613 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
1614 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
1615 that we can move to enums for instance.
1616 * src/output.c (token_definitions_output): Output a list of
1617 `token-name, token-number' instead of the #define.
1618 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
1619
9208d17f
AD
16202002-03-14 Akim Demaille <akim@epita.fr>
1621
1622 Use Gettext 0.11.1.
1623
af27eacb
RA
16242002-03-09 Robert Anisko <robert@lrde.epita.fr>
1625
1626 * data/bison.c++: Make the user able to add members to the generated
1627 parser by subclassing.
1628
9101a310
RA
16292002-03-05 Robert Anisko <robert@lrde.epita.fr>
1630
1631 * src/reader.c (read_additionnal_code): `c' should be an integer, not
1632 a character.
1633 Reported by Nicolas Tisserand and Nicolas Burrus.
1634
fff9bf0b
RA
16352002-03-04 Robert Anisko <robert@lrde.epita.fr>
1636
1637 * src/reader.c: Warn about lacking semi-colons, do not complain.
1638
64dba31e
RA
16392002-03-04 Robert Anisko <robert@lrde.epita.fr>
1640
1641 * data/bison.c++: Remove a debug line.
1642
374f5a14
RA
16432002-03-04 Robert Anisko <robert@lrde.epita.fr>
1644
1645 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
1646 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
1647 provide a default implementation.
1648
bfcf1f3a
AD
16492002-03-04 Akim Demaille <akim@epita.fr>
1650
1651 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
1652 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
1653 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
1654 * tests/semantic.at (Parsing Guards): Similarly.
1655 * src/reader.at (readgram): Complain if the last rule is not ended
1656 with a semi-colon.
1657
65ccf9fc
AD
16582002-03-04 Akim Demaille <akim@epita.fr>
1659
1660 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
1661 * src/closure.c: here.
1662 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
1663 RTC.
1664 * src/warshall.h, src/warshall.c: Remove.
1665 * tests/sets.at (Broken Closure): Adjust.
1666
d0039cbc
AD
16672002-03-04 Akim Demaille <akim@epita.fr>
1668
1669 * src/output.c (output_skeleton): tempdir is const.
1670 bytes_read is unused.
1671
345cea78
AD
16722002-03-04 Akim Demaille <akim@epita.fr>
1673
1674 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1675 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
1676 Update.
1677 From Michael Hayes.
1678
564801f7
AD
16792002-03-04 Akim Demaille <akim@epita.fr>
1680
1681 * src/closure.c (closure): `r' is unused.
1682
e5352bc7
AD
16832002-03-04 Akim Demaille <akim@epita.fr>
1684
1685 * tests/sets.at (Broken Closure): Add the ending `;'.
1686 * src/reader.at (readgram): Complain if a rule is not ended with a
1687 semi-colon.
1688
914feea9
AD
16892002-03-04 Akim Demaille <akim@epita.fr>
1690
1691 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
1692 (count_sr_conflicts): Use bitset_count.
1693 * src/reduce.c (inaccessable_symbols): Ditto.
1694 (bits_size): Remove.
1695 * src/warshall.h, src/warshall.c: Convert to bitsetv.
1696
f0250de6
AD
16972002-03-04 Akim Demaille <akim@epita.fr>
1698
1699 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
1700 * src/reduce.c: Remove the `bitset_zero's following the
1701 `bitset_create's, as now it is performed by the latter.
1702
ef017502
AD
17032002-03-04 Akim Demaille <akim@epita.fr>
1704
1705 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
1706 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
1707 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
1708 latest sources from Michael.
1709
76514394
AD
17102002-03-04 Akim Demaille <akim@epita.fr>
1711
1712 * src/output.c (output): Don't free the grammar.
1713 * src/reader.c (grammar_free): New.
1714 * src/main.c (main): Call it and don't free symtab here.
1715
55024580
AD
17162002-03-04 Akim Demaille <akim@epita.fr>
1717
1718 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
1719 before returning.
1720 Reported by Benoit Perrot.
1721
f9abaa2c
AD
17222002-03-04 Akim Demaille <akim@epita.fr>
1723
1724 Use bitset operations when possible, not loops over bits.
1725
1726 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
1727 bitset_or.
1728 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
1729 * src/reduce.c (useless_nonterminals): Formatting changes.
1730 * src/warshall.c (TC): Use bitset_or.
1731
0e721e75
AD
17322002-03-04 Akim Demaille <akim@epita.fr>
1733
1734 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
1735 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
1736 Ditto.
1737
0fb1ffb1
AD
17382002-03-04 Akim Demaille <akim@epita.fr>
1739
1740 * src/lalr.c (F): Now a bitset*.
1741 Adjust all dependencies.
1742
b86796bf
AD
17432002-03-04 Akim Demaille <akim@epita.fr>
1744
1745 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
1746 Adjust all dependencies.
1747
602bbf31
AD
17482002-03-04 Akim Demaille <akim@epita.fr>
1749
1750 * src/L0.c, src/LR0.h (nstates): Be size_t.
1751 Adjust comparisons (signed vs unsigned).
1752 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
1753 bitset*.
1754 Adjust all dependencies.
1755
d8a0245c
AD
17562002-03-04 Akim Demaille <akim@epita.fr>
1757
1758 * src/closure.c (firsts): Now, also a bitset.
1759 Adjust all dependencies.
1760 (varsetsize): Remove, now unused.
1761 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
1762
34ba9743
AD
17632002-03-04 Akim Demaille <akim@epita.fr>
1764
1765 * src/print.c: Convert to use bitset.h, not hand coded iterations
1766 over ints.
1767
ed86e78c
AD
17682002-03-04 Akim Demaille <akim@epita.fr>
1769
1770 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
1771
dfdb1797
AD
17722002-03-04 Akim Demaille <akim@epita.fr>
1773
1774 * src/closure.c (ruleset): Be a bitset.
1775 (rulesetsize): Remove.
1776
7086e707
AD
17772002-03-04 Akim Demaille <akim@epita.fr>
1778
1779 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
1780 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
1781 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
1782 * src/closure.c (fderives): Be an array of bitsets.
1783
98254360
RA
17842002-02-28 Robert Anisko <robert@lrde.epita.fr>
1785
1786 * data/bison.c++: Merge the two generated headers. Insert a copyright
1787 notice in each output file.
1788
a75c057f
AD
17892002-02-28 Akim Demaille <akim@epita.fr>
1790
1791 * data/bison.c++: Copy the prologue of bison.simple to fetch
1792 useful M4 definitions, such as b4_header_guard.
1793
06b00abc
AD
17942002-02-25 Akim Demaille <akim@epita.fr>
1795
1796 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
1797 translator friendly scheme for the bgr
1798 copyright notice.
06b00abc 1799
70e7d534
AD
18002002-02-25 Akim Demaille <akim@epita.fr>
1801
1802 * src/output.c (header_output): Remove, now handled completely via
1803 M4.
1804
abe017f6
AD
18052002-02-25 Akim Demaille <akim@epita.fr>
1806
1807 * m4/m4.m4: New, from CVS Autoconf.
1808 * configure.in: Invoke it.
1809 * src/output.c (output_skeleton): Use its result instead of the
1810 hard coded name.
1811
381fb12e
AD
18122002-02-25 Akim Demaille <akim@epita.fr>
1813
1814 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
1815 Fileutils 4.1.5.
1816 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
1817 * src/output.c (output_skeleton): Use mkstemp to create a real
1818 temporary file.
1819 Move the filling of `skeleton' and its muscle to...
1820 (prepare): here.
1821 (output): Move the definition of the prologue muscle to...
1822 (prepare): here.
1823 * src/system.h (DEFAULT_TMPDIR): New.
1824
6f38107f
PE
18252002-02-14 Paul Eggert <eggert@twinsun.com>
1826
1827 Remove the support for C++ namespace cleanliness; it was
1828 causing more problems than it was curing, since it didn't work
1829 properly on some nonstandard C++ compilers. This can wait
1830 for a proper C++ parser.
1831
1832 * NEWS: Document this.
1833 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
1834 of C++, as it's treated like C now.
1835 * src/bison.simple (YYSTD): Remove.
1836 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
1837 Treat C++ just like Standard C instead of trying to support
1838 namespace cleanliness.
1839
80cce3da
AD
18402002-02-14 Akim Demaille <akim@epita.fr>
1841
1842 * tests/regression.at (else): Adjust to Andreas' change.
1843
842e8679
AD
18442002-02-14 Akim Demaille <akim@epita.fr>
1845
1846 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
1847
4bda3f10
AD
18482002-02-13 Andreas Schwab <schwab@suse.de>
1849
1850 * src/output.c (output_rule_data): Don't output NULL, it might
1851 not be defined yet.
1852
4162fa07 18532002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 1854
4162fa07
RA
1855 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
1856 (Copyright notice): Update.
b418ecd8 1857
bd16a5dc
AD
18582002-02-11 Akim Demaille <akim@epita.fr>
1859
1860 * tests/regression.at (%nonassoc and eof): Don't include
1861 nonportable headers.
1862
8d69a1a3
RA
18632002-02-08 Robert Anisko <robert@lrde.epita.fr>
1864
1865 * data/bison.c++: Correct error recovery. Make the user able to
1866 initialize the starting location.
1867
9b2d0677
AD
18682002-02-07 Akim Demaille <akim@epita.fr>
1869
1870 * tests/input.at: New.
1871
69e2658b
RA
18722002-02-07 Robert Anisko <robert@lrde.epita.fr>
1873
1874 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 1875 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
1876 directives around tables only needed for debugging.
1877
4aacc3a7
RA
18782002-02-07 Robert Anisko <robert@lrde.epita.fr>
1879
1880 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
1881 C++ parsers.
1882 (yy::b4_name::parse): Use print_.
1883
762a801e
RA
18842002-02-07 Robert Anisko <robert@lrde.epita.fr>
1885
1886 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
1887
4bb2bc3f
RA
18882002-02-07 Robert Anisko <robert@lrde.epita.fr>
1889
1890 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
1891 C++ parsers.
1892 (yy::b4_name::parse): Build verbose error messages, and use error_.
1893
6b45a3ca
RA
18942002-02-06 Robert Anisko <robert@lrde.epita.fr>
1895
1896 * data/bison.c++: Fix m4 quoting in comments.
1897
50997c6e
RA
18982002-02-06 Robert Anisko <robert@lrde.epita.fr>
1899
1900 * data/bison.c++: Adjust the parser code. Fix some muscles that were
1901 not expanded by m4.
1902
3f3eed27
AD
19032002-02-05 Akim Demaille <akim@epita.fr>
1904
1905 * data/bison.c++: Adjust to the M4 back end.
1906 More is certainly needed.
1907
be2a1a68
AD
19082002-02-05 Akim Demaille <akim@epita.fr>
1909
1910 Give a try to M4 as a back end.
1911
1912 * lib/readpipe.c: New, from wdiff.
1913 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
1914 BISON_HAIRY.
1915 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
1916 specific values. Now it is m4 that performs the lookup.
1917 * src/parse-skel.y: Remove.
1918 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
1919 * src/output.c (actions_output, guards_output)
1920 (token_definitions_output): No longer keeps track of the output
1921 line number, hence remove the second argument.
1922 (guards_output): Check against the guard member of a rule, not the
1923 action member.
1924 Adjust callers.
1925 (output_skeleton): Don't look for the skeleton location, let m4 do
1926 that.
1927 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
1928 file will be used.
1929 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
1930 (prepare): Given that for the time being changesyntax is not
1931 usable in M4, rename the muscles using `-' to `_'.
1932 Define `defines_flag', `output_parser_name' and `output_header_name'.
1933 * src/output.h (actions_output, guards_output)
1934 (token_definitions_output): Adjust prototypes.
1935 * src/scan-skel.l: Instead of scanning the skeletons, it now
1936 processes the output of m4: `__oline__' and `#output'.
1937 * data/bison.simple: Adjust to be used by M4(sugar).
1938 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
1939 to date.
1940 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
1941 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
1942 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
1943 shamelessly stolen from CVS Autoconf.
1944
beda758b
AD
19452002-02-05 Akim Demaille <akim@epita.fr>
1946
1947 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
1948 * configure.in: Check for the declarations of free and malloc.
1949 * src/muscle_tab.c: Adjust.
1950
5ece6d43
AD
19512002-02-05 Akim Demaille <akim@epita.fr>
1952
1953 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
1954 which have no values.
1955
5bb18f9a
AD
19562002-02-05 Akim Demaille <akim@epita.fr>
1957
1958 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
1959 * data/: here.
1960
894dd62e
PE
19612002-01-29 Paul Eggert <eggert@twinsun.com>
1962
1963 * src/bison.simple (YYSIZE_T): Do not define merely because
1964 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
1965 On some platforms, <alloca.h> does not declare YYSTD (size_t).
1966
82841af7
AD
19672002-01-27 Akim Demaille <akim@epita.fr>
1968
1969 Fix `%nonassoc and eof'.
1970
1971 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
1972 which were not properly copied! Replace
1973 memcpy (res->errs, src->errs, src->nerrs);
1974 with
1975 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
1976 !!!
1977 * tests/regression.at (%nonassoc and eof): Adjust to newest
1978 Autotest: `.' is not in the PATH.
1979
318b76e9
AD
19802002-01-27 Akim Demaille <akim@epita.fr>
1981
1982 * tests/sets.at (AT_EXTRACT_SETS): New.
1983 (Nullable): Use it.
1984 (Firsts): New.
1985
30d2f3d5
AD
19862002-01-26 Akim Demaille <akim@epita.fr>
1987
1988 * tests/actions.at, tests/calc.at, tests/headers.at,
1989 * tests/torture.at: Adjust to the newest Autotest which no longer
1990 forces `.' in the PATH.
1991
30f8c395
AD
19922002-01-25 Akim Demaille <akim@epita.fr>
1993
1994 * tests/regression.at (%nonassoc and eof): New.
1995 Suggested by Robert Anisko.
1996
29ae55f1
AD
19972002-01-24 Akim Demaille <akim@epita.fr>
1998
1999 Bison dumps core when trying to complain about broken input files.
2000 Reported by Cris van Pelt.
2001
2002 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
2003 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
2004 into...
2005 (Invalid inputs): Strengthen: exercise parse_percent_token.
2006
2b548aa6
RA
20072002-01-24 Robert Anisko <robert.anisko@epita.fr>
2008
2009 * src/Makefile.am: Add bison.c++.
2010 * src/bison.c++: New skeleton.
2011
bb0146c2
AD
20122002-01-21 Paolo Bonzini <bonzini@gnu.org>
2013
2014 * po/it.po: New.
2015
bec30531
AD
20162002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
2017
2018 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
2019
fc6edc45
MA
20202002-01-20 Marc Autret <marc@gnu.org>
2021
2022 * src/files.c (compute_output_file_names): Fix
2023
5e5d5415
MA
20242002-01-20 Marc Autret <marc@gnu.org>
2025
2026 * tests/output.at: New test.
2027 * src/files.c (compute_base_names): Don't map extensions when
2028 the YACC flag is set, use defaults.
2029 Reported by Evgeny Stambulchik.
2030
44ea3fbd
MA
20312002-01-20 Marc Autret <marc@gnu.org>
2032
bb0146c2 2033 * src/system.h: Need to define __attribute__ away for non-GCC
44ea3fbd
MA
2034 compilers as well (i.e. the vendor C compiler).
2035 Suggested by Albert Chin-A-Young.
2036
338963d1
TVH
20372002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
2038
2039 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
2040 canonical definition.
2041 * src/system.h: Use the canonical definition for PARAMS (avoids
2042 a conflict with the macro from lib/hash.h).
2043
c57b2479
AD
20442002-01-11 Akim Demaille <akim@epita.fr>
2045
2046 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 2047 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 2048
b85810ae
AD
20492002-01-09 Akim Demaille <akim@epita.fr>
2050
2051 * src/files.c, src/files.h (output_infix): New.
2052 (tab_extension): Remove.
2053 (compute_base_names): Compute the former, drop the latter.
2054 * src/output.c (prepare): Insert the muscles `output-infix', and
2055 `output-suffix'.
2056 * src/parse-skel.y (string, string.1): New.
2057 (section.header): Use it.
2058 (section.yacc): Remove.
2059 (prefix): Remove too.
2060 * src/scan-skel.l: Adjust.
2061 * src/bison.simple, src/bison.hairy: Adjust.
2062
cae60122
AD
20632002-01-09 Akim Demaille <akim@epita.fr>
2064
2065 * configure.in (WERROR_CFLAGS): Compute it.
2066 * src/Makefile.am (CFLAGS): Pass it.
2067 * tests/atlocal.in (CFLAGS): Idem.
2068 * src/files.c: Fix a few warnings.
2069 (get_extension_index): Remove, unused.
2070
ae404801
AD
20712002-01-08 Akim Demaille <akim@epita.fr>
2072
2073 * src/getargs.c (AS_FILE_NAME): New.
2074 (getargs): Use it to convert DOSish file names.
2075 * src/files.c (base_name): Rename as full_base_name to avoid
2076 clashes with `base_name ()'.
2077 (filename_split): New.
2078 (compute_base_names): N-th rewrite, using filename_split.
2079
22312b71
AD
20802002-01-08 Akim Demaille <akim@epita.fr>
2081
2082 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
2083 New, stolen from the Fileutils 4.1.
2084 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
2085 * configure.in: Check for the presence of memrchr, and of its
2086 prototype.
2087
a67cef01
TVH
20882002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
2089
2090 * lib/hash.h (__P): Added definition for this macro.
2091 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
2092 BUILT_SOURCES, to ensure they are generated first.
2093 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
2094 %error-verbose to allow bootstrapping with bison 1.30x.
2095
2b25d624
AD
20962002-01-06 Akim Demaille <akim@epita.fr>
2097
2098 * src/reader.c (parse_braces): Don't fetch the next char, the
2099 convention is to fetch on entry.
2100 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
2101 'switch' without a following semicolon.
2102 * tests/regression.at (braces parsing): New.
2103
3460813b
AD
21042002-01-06 Akim Demaille <akim@epita.fr>
2105
2106 Bison is dead wrong in its RR conflict reports.
2107
2108 * tests/torture.at (GNU Cim Grammar): New.
2109 * src/conflicts.c (count_rr_conflicts): Fix.
2110
73784c64
AD
21112002-01-06 Akim Demaille <akim@epita.fr>
2112
2113 Creating package.m4 from configure.ac causes too many problems.
2114
2115 * tests/Makefile.am (package.m4): Create it by hand,
2116 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2117
25d81090
AD
21182002-01-06 Akim Demaille <akim@epita.fr>
2119
2120 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
2121 skeleton.h.
2122
a9b8959e
PE
21232002-01-04 Paul Eggert <eggert@twinsun.com>
2124
2125 * doc/bison.texinfo (Debugging):
2126 Remove YYSTDERR; it's no longer defined or used.
2127 Also, s/cstdio.h/cstdio/.
2128
25d81090
AD
21292002-01-03 Akim Demaille <akim@epita.fr>
2130
2131 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
2132
1109455c
AD
21332002-01-03 Akim Demaille <akim@epita.fr>
2134
2135 * src/parse-skel.y (process_skeleton): Don't bind the parser's
2136 tracing code to --trace, wait for a better --trace option, with
2137 args.
2138
7ea5e977
AD
21392002-01-03 Akim Demaille <akim@epita.fr>
2140
2141 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
2142 The ISO C++ standard is extremely clear about it: stderr is
2143 considered a macro, not a regular symbol (see table 94 `Header
2144 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
2145 Therefore std:: does not apply to it. It still does with fprintf.
2146 Also, s/cstdio.h/cstdio/.
2147
fab5b110
AD
21482002-01-03 Akim Demaille <akim@epita.fr>
2149
2150 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
2151 for non system headers.
2152
aed7fd9b
AD
21532002-01-02 Akim Demaille <akim@epita.fr>
2154
2155 Equip the skeleton chain with location tracking, runtime trace,
2156 pure parser and scanner.
2157
2158 * src/parse-skel.y: Request a pure parser, locations, and prefix
2159 renaming.
2160 (%union): Having several members with the same type does not help
2161 type mismatches, simplify.
2162 (YYPRINT, yyprint): New.
2163 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
2164 (skel_error): this.
2165 Handle locations.
2166 * src/scan-skel.l: Adjust to these changes.
2167 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
2168 (LOCATION_PRINT, skel_control_t): New.
2169
24fad99e
AD
21702001-12-30 Akim Demaille <akim@epita.fr>
2171
2172 * src/parse-skel.y: Get rid of the shift/reduce conflict:
2173 replace `gb' with BLANKS.
2174 * src/scan-skel.l: Adjust.
2175
a4b36db4
AD
21762001-12-30 Akim Demaille <akim@epita.fr>
2177
2178 * src/system.h: We don't need nor want bcopy.
2179 Throw away MS-DOS crap: we don't need getpid.
2180 * configure.in: We don't need strndup. It was even causing
2181 problems: because Flex includes the headers *before* us,
2182 _GNU_SOURCE is not defined by config.h, and therefore strndup was
2183 not visible.
2184 * lib/xstrndup.c: New.
2185 * src/scan-skel.l: Use it.
2186 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
2187 * src/parse-skel.y: Use %directives instead of #defines.
2188
1239777d
AD
21892001-12-30 Akim Demaille <akim@epita.fr>
2190
2191 * src/skeleton.h: New.
2192 * src/output.c (output_parser, output_master_parser): Remove, dead
2193 code.
2194 * src/output.h (get_lines_number, actions_output, guards_output)
2195 (token_definitions_output): Prototype them.
2196 * src/parse-skel.y: Add the license notice.
2197 Include output.h and skeleton.h.
2198 (process_skeleton): Returns void, and takes a single parameter.
2199 * src/scan-skel.l: Add the license notice.
2200 Include skeleton.h.
2201 Don't use %option yylineno: it seems that then Flex imagines
2202 REJECT has been used, and therefore it won't reallocate its
2203 buffers (which makes no other sense to me than a bug). It results
2204 in warnings for `unused: yy_flex_realloc'.
2205
9b3add5b
RA
22062001-12-30 Robert Anisko <robert.anisko@epita.fr>
2207
2208 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2209 (MUSCLE_INSERT_PREFIX): ...to there.
2210 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
2211 (MUSCLE_INSERT_PREFIX): Move from here...
2212
2213 * src/bison.hairy: Add a section directive. Put braces around muscle
2214 names. This parser skeleton is still broken, but Bison should not
2215 choke on a bad muscle 'syntax'.
2216 * src/bison.simple: Add a section directive. Put braces around muscle
2217 names.
2218
2219 * src/files.h (strsuffix, stringappend): Add declarations.
2220 (tab_extension): Add declaration.
2221 (short_base_name): Add declaration.
2222
2223 * src/files.c (strsuffix, stringappend): No longer static. These
2224 functions are used in the skeleton parser.
2225 (tab_extension): New.
2226 (compute_base_names): Use the computations done in this function
fab5b110 2227 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
2228 names.
2229 (short_base_name): No longer static.
2230
2231 * src/output.c (output_skeleton): New.
2232 (output): Disable call to output_master_parser, and give a try to
2233 a new skeleton handling system.
2234 (guards_output, actions_output): No longer static.
2235 (token_definitions_output, get_lines_number): No longer static.
2236
2237 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
2238
fab5b110 2239 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
2240 parse-skel.y.
2241
2242 * src/parse-skel.y: New file.
2243 * src/scan-skel.l: New file.
2244
b5b61c61
AD
22452001-12-29 Akim Demaille <akim@epita.fr>
2246
2247 %name-prefix is broken.
2248
2249 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
2250 Adjust all dependencies.
2251 * tests/headers.at (export YYLTYPE): Strengthen this test: use
2252 %name-prefix.
2253
2254 Renaming yylval but not yylloc is not consistent. Now we do.
2255
2256 * src/bison.simple: Prefix yylloc if used.
2257 * doc/bison.texinfo (Decl Summary): Document that.
2258
8c9a50be
AD
22592001-12-29 Akim Demaille <akim@epita.fr>
2260
2261 * doc/bison.texinfo: Promote `%long-directive' over
2262 `%long_directive'.
2263 Remove all references to fixed-output-files, yacc is enough.
2264
d99361e6
AD
22652001-12-29 Akim Demaille <akim@epita.fr>
2266
2267 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
2268 user prologue. These are defaults.
2269 * tests/actions.at (Mid-rule actions): Make sure the user can
2270 define YYDEBUG and YYERROR_VERBOSE.
2271
b9cecb91
AD
22722001-12-29 Akim Demaille <akim@epita.fr>
2273
2274 * src/output.c (header_output): Don't forget to export YYLTYPE and
2275 yylloc.
2276 * tests/headers.at (export YYLTYPE): New, make sure it does.
2277 * tests/regression.at (%union and --defines, Invalid CPP headers):
2278 Move to...
2279 * tests/headers.at: here.
2280
aea13e97
AD
22812001-12-29 Akim Demaille <akim@epita.fr>
2282
2283 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
2284
931394cb
AD
22852001-12-29 Akim Demaille <akim@epita.fr>
2286
2287 * tests/actions.at (Mid-rule actions): Output on a single line
2288 instead of several.
2289
704a47c4
AD
22902001-12-29 Akim Demaille <akim@epita.fr>
2291
2292 * doc/bison.texinfo: Formatting changes.
2293
091e20bb
AD
22942001-12-29 Akim Demaille <akim@epita.fr>
2295
2296 Don't store the token defs in a muscle, just be ready to output it
2297 on command. Now possible via `symbols'. Fixes a memory leak.
2298
2299 * src/output.c (token_definitions_output): New.
2300 (output_parser, header_output): Use it.
2301 * src/reader.c (symbols_save): Remove.
2302
cce71710
AD
23032001-12-29 Akim Demaille <akim@epita.fr>
2304
2305 * src/bison.simple: Do not provide a default for YYSTYPE and
2306 YYLTYPE before the user's prologue. Otherwise it's hardly... a
2307 default.
2308
82c035a8
AD
23092001-12-29 Akim Demaille <akim@epita.fr>
2310
2311 Mid-rule actions are simply... ignored!
2312
2313 * src/reader.c (readgram): Be sure to attach mid-rule actions to
2314 the empty-rule associated to the dummy symbol, not to the host
2315 rule.
2316 * tests/actions.at (Mid-rule actions): New.
2317
8419d367
AD
23182001-12-29 Akim Demaille <akim@epita.fr>
2319
2320 Memory leak.
2321
2322 * src/reader.c (reader): Free grammar.
2323
375d5806
AD
23242001-12-29 Akim Demaille <akim@epita.fr>
2325
2326 Memory leak.
2327
2328 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
2329 since it allocates it for each state, although only one is needed.
2330 (allocate_storage): Do it here.
2331
f51cb8ff
AD
23322001-12-29 Akim Demaille <akim@epita.fr>
2333
2334 * src/options.h, src/options.c (create_long_option_table): Rename
2335 as...
2336 (long_option_table_new): this, with a clearer prototype.
2337 (percent_table): Remove, unused,
2338 * src/getargs.c (getargs): Adjust.
2339
29e88316
AD
23402001-12-29 Akim Demaille <akim@epita.fr>
2341
2342 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
2343 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
2344 as states.
2345
b9f71f19
AD
23462001-12-29 Akim Demaille <akim@epita.fr>
2347
2348 * src/lalr.c (build_relations): Rename `states' as `states1'.
2349 Sorry, I don't understand exactly what it is, no better name...
2350
1a2b5d37
AD
23512001-12-29 Akim Demaille <akim@epita.fr>
2352
2353 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
2354 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
2355 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
2356 as rules.
2357
1cca533e
AD
23582001-12-29 Akim Demaille <akim@epita.fr>
2359
2360 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
2361 ago.
2362
c03ae966
AD
23632001-12-29 Akim Demaille <akim@epita.fr>
2364
2365 * src/reader.c, src/reader.h (user_toknums): Remove.
2366 Adjust all users to use symbols[i]->user_token_number.
2367
5a670b1e
AD
23682001-12-29 Akim Demaille <akim@epita.fr>
2369
2370 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
2371 Adjust all users to use symbols[i]->prec or ->assoc.
2372
ad949da9
AD
23732001-12-29 Akim Demaille <akim@epita.fr>
2374
2375 * src/reader.c, src/reader.h (tags): Remove.
2376 Adjust all users to use symbols[i]->tag.
2377
0e78e603
AD
23782001-12-29 Akim Demaille <akim@epita.fr>
2379
2380 * src/gram.h, src/gram.c (symbols): New, similar to state_table
2381 and rule_table.
2382 * src/reader.c (packsymbols): Fill this table.
2383 Drop sprec.
2384 * src/conflicts.c (resolve_sr_conflict): Adjust.
2385 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
2386 single table.
2387 Use symbols[i]->tag instead of tags[i].
2388
213e640e
AD
23892001-12-29 Akim Demaille <akim@epita.fr>
2390
2391 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
2392 In addition, put a comment in there, to replace...
2393 * tests/regression.at (%union and C comments): Remove.
2394
e7b8bef1
AD
23952001-12-29 Akim Demaille <akim@epita.fr>
2396
2397 * tests/regression.at (Web2c Actions): Blindly move the actual
2398 output as expected output. The contents *seem* right to me, but I
2399 can't pretend reading perfectly parser tables... Nonetheless, all
2400 the other tests pass correctly, the table look OK, even though the
2401 presence of `$axiom' is to be noted: AFAICS it is useless (but
2402 harmless).
2403
b68e7744
AD
24042001-12-29 Akim Demaille <akim@epita.fr>
2405
2406 * src/reader.c (readgram): Don't add the rule 0 if there were no
2407 rules read. In other words, add it _after_ having performed
2408 grammar sanity checks.
2409 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
2410
78d5bae9
AD
24112001-12-29 Akim Demaille <akim@epita.fr>
2412
2413 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
2414 visible, and some states have now a different number.
2415
ff442794
AD
24162001-12-29 Akim Demaille <akim@epita.fr>
2417
2418 * src/reader.c (readgram): Bind the initial rule's lineno to that
2419 of the first rule.
2420 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
2421 (Solved SR Conflicts): Adjust rule 0's line number.
2422
610ab194
AD
24232001-12-29 Akim Demaille <akim@epita.fr>
2424
2425 Fix the `GAWK Grammar' failure.
2426
2427 * src/LR0.c (final_state): Initialize to -1 so that we do compute
2428 the reductions of the first state which was mistakenly confused
2429 with the final state because precisely final_state was initialized
2430 to 0.
2431 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
2432 now noticed by Bison.
2433 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
2434 have a reduction on $default.
2435
29d29c8f
AD
24362001-12-29 Akim Demaille <akim@epita.fr>
2437
2438 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
2439 rule line numbers.
2440 * src/closure.c (print_closure): Likewise.
2441 * src/derives.c (print_derives): Likewise.
2442 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
2443 now.
2444
7c6b64d0
AD
24452001-12-29 Akim Demaille <akim@epita.fr>
2446
2447 * src/lalr.c (lookaheads_print): New.
2448 (lalr): Call it when --trace-flag.
2449 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
2450 are dumped.
2451
3d4daee3
AD
24522001-12-29 Akim Demaille <akim@epita.fr>
2453
2454 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
2455 when walking through ritem, even via rule->rhs.
2456 * src/reduce.c (dump_grammar, useful_production, reduce_output)
2457 (useful_production, useless_nonterminals): Likewise.
2458 (reduce_grammar_tables): Likewise, plus update nritems.
2459 * src/nullable.c (set_nullable): Likewise.
2460 * src/lalr.c (build_relations): Likewise.
2461 * tests/sets.at (Nullable): Adjust.
2462 Fortunately, now, the $axiom is no longer nullable.
2463
9e7f6bbd
AD
24642001-12-29 Akim Demaille <akim@epita.fr>
2465
2466 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
2467 the 0-sentinel.
2468 * src/gram.c (ritem_longest_rhs): Likewise.
2469 * src/reduce.c (nonterminals_reduce): Likewise.
2470 * src/print_graph.c (print_graph): Likewise.
2471 * src/output.c (output_rule_data): Likewise.
2472 * src/nullable.c (set_nullable): Likewise.
2473
255ef638
AD
24742001-12-29 Akim Demaille <akim@epita.fr>
2475
2476 * src/output.c: Comment changes.
2477
0d8a7363
AD
24782001-12-27 Paul Eggert <eggert@twinsun.com>
2479
2480 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
2481 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
2482 Sparc, as they were causing more porting problems than the
2483 (minor) performance improvement was worth.
2484
2485 Also, catch up with 1.31's YYSTD.
2486
3db472b9
AD
24872001-12-27 Akim Demaille <akim@epita.fr>
2488
2489 * src/output.c (output_gram): Rely on nritems, not the
2490 0-sentinel. See below.
2491 Use -1 as separator, not 0.
2492 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
2493 Rely on -1 as separator in yyrhs, instead of 0.
2494 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
2495 twice `Now at end of input', therefore there are two lines less to
2496 expect.
2497
b365aa05
AD
24982001-12-27 Akim Demaille <akim@epita.fr>
2499
2500 * tests/regression.at (Unresolved SR Conflicts):
2501 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
2502 below.
2503
30171f79
AD
25042001-12-27 Akim Demaille <akim@epita.fr>
2505
2506 * src/LR0.c (new_state): Recognize the final state by the fact it
2507 is reached by eoftoken.
2508 (insert_start_shifting_state, insert_eof_shifting_state)
2509 (insert_accepting_state, augment_automaton): Remove, since now
2510 these states are automatically computed from the initial state.
2511 (generate_states): Adjust.
2512 * src/print.c: When reporting a rule number to the user, substract
2513 1, so that the axiom rule is rule 0, and the first user rule is 1.
2514 * src/reduce.c: Likewise.
2515 * src/print_graph.c (print_core): For the time being, just as for
2516 the report, depend upon --trace-flags to dump the full set of
2517 items.
2518 * src/reader.c (readgram): Once the grammar read, insert the rule
2519 0: `$axiom: START-SYMBOL $'.
2520 * tests/set.at: Adjust: rule 0 is now displayed, and since the
2521 number of the states has changed (the final state is no longer
2522 necessarily the last), catch up.
2523
75142d45
AD
25242001-12-27 Akim Demaille <akim@epita.fr>
2525
2526 Try to make the use of the eoftoken valid. Given that its value
2527 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
2528 is used instead of > 0 where appropriate, (ii), depend upon nritems
2529 instead of the 0-sentinel.
2530
2531 * src/gram.h, src/gram.c (nritems): New.
2532 Expected to be duplication of nitems, but for the time being...
2533 * src/reader.c (packgram): Assert nritems and nitems are equal.
2534 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
2535 * src/closure.c (print_closure, print_fderives): Likewise.
2536 * src/gram.c (ritem_print): Likewise.
2537 * src/print.c (print_core, print_grammar): Likewise.
2538 * src/print_graph.c: Likewise.
2539
b7c49edf
AD
25402001-12-27 Akim Demaille <akim@epita.fr>
2541
2542 * src/main.c (main): If there are complains after grammar
2543 reductions, then output the report anyway if requested, then die.
2544 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
2545 * src/reader.c (eoftoken): New.
2546 (parse_token_decl): If the token being defined has value `0', it
2547 is the eoftoken.
2548 (packsymbols): No longer hack `tags' to insert `$' by hand.
2549 Be sure to preserve the value of the eoftoken.
2550 (reader): Make sure eoftoken is defined.
2551 Initialize nsyms to 0: now eoftoken is created just like the others.
2552 * src/print.c (print_grammar): Don't special case the eof token.
2553 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
2554 lie anyway, albeit pleasant.
2555 * tests/calc.at: Exercise error messages with eoftoken.
2556 Change the grammar so that empty input is invalid.
2557 Adjust expectations.
2558 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
2559
ec2da99f
AD
25602001-12-27 Akim Demaille <akim@epita.fr>
2561
2562 * configure.in: Check the protos of strchr ans strspn.
2563 Replace strchr if needed.
2564 * src/system.h: Provide the protos of strchr, strspn and memchr if
2565 missing.
2566 * lib/strchr.c: New.
2567 * src/reader.c (symbols_save): Use strchr.
2568
8adfa272
AD
25692001-12-27 Akim Demaille <akim@epita.fr>
2570
2571 * src/print.c, src/print_graph.c (escape): New.
2572 Use it to quote the TAGS outputs.
2573 * src/print_graph.c (print_state): Now errors are in red, and
2574 reductions in green.
2575 Prefer high to wide: output the state number on a line of its own.
2576
80dac38c
AD
25772001-12-27 Akim Demaille <akim@epita.fr>
2578
2579 * src/state.h, src/state.c (reductions_new): New.
2580 * src/LR0.c (set_state_table): Let all the states have a
2581 `reductions', even if reduced to 0.
2582 (save_reductions): Adjust.
2583 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
2584 * src/print.c (print_reductions, print_actions): Adjust.
2585 * src/output.c (action_row): Adjust.
2586
2cec70b9
AD
25872001-12-27 Akim Demaille <akim@epita.fr>
2588
2589 * src/state.h, src/state.c (errs_new, errs_dup): New.
2590 * src/LR0.c (set_state_table): Let all the states have an errs,
2591 even if reduced to 0.
2592 * src/print.c (print_errs, print_reductions): Adjust.
2593 * src/output.c (output_actions, action_row): Adjust.
2594 * src/conflicts.c (resolve_sr_conflict): Adjust.
2595
13ca549a
AD
25962001-12-27 Akim Demaille <akim@epita.fr>
2597
2598 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
2599
5092aba5
AD
26002001-12-27 Akim Demaille <akim@epita.fr>
2601
2602 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
2603 * src/print.c: here.
2604 (lookaheadset, shiftset): New, used as additional storage by
2605 print_reductions.
2606 (print_results): Adjust.
2607 (print_shifts, print_gotos, print_errs): New, extracted from...
2608 (print_actions): here.
2609 * src/print_graph.c (print_actions): Remove dead code.
2610
11e2beca
AD
26112001-12-27 Akim Demaille <akim@epita.fr>
2612
2613 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
2614 `$n' and `@n'.
2615
dac3c910
AD
26162001-12-27 Akim Demaille <akim@epita.fr>
2617
2618 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
2619 (build_relations): Adjust.
2620
d0b0fefa
AD
26212001-12-27 Akim Demaille <akim@epita.fr>
2622
2623 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
2624 duplication.
2625
adc8c848
AD
26262001-12-27 Akim Demaille <akim@epita.fr>
2627
2628 * src/reader.c (packgram): Catch nitems overflows.
2629
14d293ac
AD
26302001-12-27 Akim Demaille <akim@epita.fr>
2631
2632 * src/files.c, src/files.h (guard_obstack): Remove.
2633 * src/output.c (output): Adjust.
2634 * src/reader.c (parse_braces): New, factoring...
2635 (copy_action, copy_guard): these two which are renamed as...
2636 (parse_action, parse_guard): these.
2637 As a voluntary consequence, using braces around guards is now
2638 mandatory.
2639
f499b062
AD
26402001-12-27 Akim Demaille <akim@epita.fr>
2641
2642 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
2643 * src/reader.c (symbol_list): `guard' and `guard_line' are new
2644 members.
2645 (symbol_list_new): Adjust.
2646 (copy_action): action_line is the first line, not the last.
2647 (copy_guard): Just as for actions, store the `action' only, not
2648 the switch/case/break flesh.
2649 Don't parse the user action that might follow the guard, let...
2650 (readgram): do it, i.e., now, there can be an action after a
2651 guard.
2652 In other words the guard is just explicitly optional.
2653 (packgram): Adjust.
2654 * src/output.c (guards_output): New.
2655 (output_parser): Call it when needed.
2656 (output): Also free the guard and attrs obstacks.
2657 * src/files.c, src/files.h (obstack_save): Remove.
2658 (output_files): Remove.
2659 As a result, if one needs the former `.act' file, using an
2660 appropriate skeleton which requires actions and guards is now
2661 required.
2662 * src/main.c (main): Adjust.
2663 * tests/semantic.at: New.
2664 * tests/regression.at: Use `input.y' as input file name.
2665 Avoid 8+3 problems by requiring input.c when the test needs the
2666 parser.
2667
d945f5cd
AD
26682001-12-27 Akim Demaille <akim@epita.fr>
2669
2670 * src/reader.c (symbol_list_new): Be sure to initialize all the
2671 fields.
2672
d200e455
AD
26732001-12-27 Akim Demaille <akim@epita.fr>
2674
2675 All the hacks using a final pseudo state are now useless.
2676
2677 * src/LR0.c (set_state_table): state_table holds exactly nstates.
2678 * src/lalr.c (nLA): New.
2679 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
2680 instead of lookaheadsp from the pseudo state (nstate + 1).
2681
f9507c28
AD
26822001-12-27 Akim Demaille <akim@epita.fr>
2683
2684 * src/output.c (action_row, token_actions): Use a state_t instead
2685 of a integer, and nlookaheads instead of the following state's
2686 lookaheadsp.
2687
065fbd27
AD
26882001-12-27 Akim Demaille <akim@epita.fr>
2689
2690 * src/conflicts.c (log_resolution, flush_shift)
2691 (resolve_sr_conflict, set_conflicts, solve_conflicts)
2692 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
2693 (conflicts_print, print_reductions): Use a state_t instead of an
2694 integer when referring to a state.
2695 As much as possible, depend upon nlookaheads, instead of the
2696 `lookaheadsp' member of the following state (since lookaheads of
2697 successive states are successive, the difference between state n + 1
2698 and n served as the number of lookaheads for state n).
2699 * src/lalr.c (add_lookback_edge): Likewise.
2700 * src/print.c (print_core, print_actions, print_state)
2701 (print_results): Likewise.
2702 * src/print_graph.c (print_core, print_actions, print_state)
2703 (print_graph): Likewise.
2704 * src/conflicts.h: Adjust.
2705
1b177bd7
AD
27062001-12-27 Akim Demaille <akim@epita.fr>
2707
2708 * src/bison.hairy: Formatting/comment changes.
2709 ANSIfy.
2710 Remove `register' indications.
2711 Add plenty of `static'.
2712
7742ddeb
AD
27132001-12-27 Akim Demaille <akim@epita.fr>
2714
2715 * src/output.c (prepare): Drop the muscle `ntbase' which
2716 duplicates ntokens.
2717 * src/bison.simple: Formatting/comment changes.
2718 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
2719 is an undocumented synonym.
2720
1fa14068
AD
27212001-12-22 Akim Demaille <akim@epita.fr>
2722
2723 * src/output.c (output_table_data): Change the prototype to use
2724 `int' for array ranges: some invocations do pass an int, not a
2725 short.
2726 Reported by Wayne Green.
2727
b9752825
AD
27282001-12-22 Akim Demaille <akim@epita.fr>
2729
2730 Some actions of web2c.y are improperly triggered.
2731 Reported by Mike Castle.
2732
2733 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
2734 * tests/regression.at (Web2c): Rename as...
2735 (Web2c Report): this.
2736 (Web2c Actions): New.
2737
776209d6
AD
27382001-12-22 Akim Demaille <akim@epita.fr>
2739
2740 Reductions in web2c.y are improperly reported.
2741 Reported by Mike Castle.
2742
2743 * src/conflicts.c (print_reductions): Fix.
2744 * tests/regression.at (Web2c): New.
2745
275fc3ad
AD
27462001-12-18 Akim Demaille <akim@epita.fr>
2747
2748 Some host fail on `assert (!"foo")', which expands to
2749 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
2750 Reported by Nelson Beebee.
2751
2752 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
2753 `#define it_succeeded 0' and `assert (it_succeeded)'.
2754
897668ee
MA
27552001-12-17 Marc Autret <autret_m@epita.fr>
2756
2757 * src/bison.simple: Don't hard code the skeleton line and filename.
2758 * src/output.c (output_parser): Rename 'line' as 'output_line'.
2759 New line counter 'skeleton_line' (skeleton-line muscle).
2760
ab3399e0
PE
27612001-12-17 Paul Eggert <eggert@twinsun.com>
2762
2763 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
2764 YYDEBUG must be defined to a nonzero value.
2765
2766 * src/bison.simple (yytname): Do not assume that the user defines
2767 YYDEBUG to a properly parenthesized expression.
2768
3877f72b
AD
27692001-12-17 Akim Demaille <akim@epita.fr>
2770
2771 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
2772 nlookaheads is a new member.
2773 Adjust all users.
2774 * src/lalr.h (nlookaheads): Remove this orphan declaration.
2775 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
2776 state.
776209d6 2777
331dbc1b
AD
27782001-12-17 Akim Demaille <akim@epita.fr>
2779
2780 * src/files.h, src/files.c (open_files, close_files): Remove.
2781 * src/main.c (main): Don't open/close files, nor invoke lex_free,
2782 let...
2783 * src/reader.c (reader): Do it.
776209d6 2784
be750e4c
AD
27852001-12-17 Akim Demaille <akim@epita.fr>
2786
2787 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 2788
709ae8c6
AD
27892001-12-17 Akim Demaille <akim@epita.fr>
2790
2791 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
2792 (flush_reduce): New.
2793 (resolve_sr_conflict): Adjust.
776209d6 2794
f87685c3
AD
27952001-12-17 Akim Demaille <akim@epita.fr>
2796
2797 * src/output.c (output_obstack): Be static and rename as...
2798 (format_obstack): this, to avoid any confusion with files.c's
2799 output_obstack.
2800 * src/reader.h (muscle_obstack): Move to...
2801 * src/output.h: here, since it's defined in output.c.
2802
837491d8
AD
28032001-12-17 Akim Demaille <akim@epita.fr>
2804
2805 * src/output.c (action_row, save_column, default_goto)
2806 (sort_actions, matching_state, pack_vector): Better variable
2807 locality.
2808
796d61fb
AD
28092001-12-17 Akim Demaille <akim@epita.fr>
2810
2811 * src/output.c: Various formatting changes.
776209d6 2812
64d15509
AD
28132001-12-17 Akim Demaille <akim@epita.fr>
2814
2815 * src/files.c (output_files): Free the output_obstack.
2816 * src/main.c (main): Call print and print_graph conditionally.
2817 * src/print.c (print): Work unconditionally.
2818 * src/print_graph.c (print_graph): Work unconditionally.
2819 * src/conflicts.c (log_resolution): Output only if verbose_flag.
2820
fbc8ecb7
MA
28212001-12-16 Marc Autret <autret_m@epita.fr>
2822
2823 * src/output.c (actions_output): Fix. When we use %no-lines,
2824 there is one less line per action.
2825
f0440388
MA
28262001-12-16 Marc Autret <autret_m@epita.fr>
2827
2828 * src/bison.simple: Remove a useless #line directive.
2829 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
2830 * src/output.c (get_lines_number): New.
776209d6 2831 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
2832 output muscles.
2833 Fix line numbering.
2834 (actions_output): Computes the number of lines taken by actions.
2835 (output_master_parser): Insert new skeleton which is the name of
2836 the output parser file name.
2837
a79986b8
MA
28382001-12-15 Marc Autret <autret_m@epita.fr>
2839
2840 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
2841
4ec8e00f
MA
28422001-12-15 Marc Autret <autret_m@epita.fr>
2843
2844 * src/output.c (output_gram): Keep track of the hairy one.
2845
1a4648ff
AD
28462001-12-15 Akim Demaille <akim@epita.fr>
2847
2848 Make `make distcheck' work.
2849
2850 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
2851 system.h which uses libgettext.h.
2852
9c2c67e6
AD
28532001-12-15 Akim Demaille <akim@epita.fr>
2854
2855 * src/nullable.c (set_nullable): Useless rules must be skipped,
2856 otherwise, since we range over their symbols, we might look at a
2857 nonterminal which no longer ``exists'', i.e., it is not counted in
2858 `nvars', hence we overflow our arrays.
2859
93ede233
AD
28602001-12-15 Akim Demaille <akim@epita.fr>
2861
2862 The header can also be produced directly, without any obstack!
2863 Yahoo!
2864
2865 * src/files.c, src/files.h (defines_obstack): Remove.
2866 (compute_header_macro): Global.
2867 (defines_obstack_save): Remove.
2868 * src/reader.c (parse_union_decl): No longer output to
2869 defines_obstack: its content can be found in the `stype' muscle
2870 anyway.
2871 (output_token_translations): Merge into...
2872 (symbols_output): this.
2873 Rename as...
2874 (symbols_save): this.
2875 (reader): Adjust.
2876 * src/output.c (header_output): New.
2877 (output): Call it.
2878
2666f928
AD
28792001-12-15 Akim Demaille <akim@epita.fr>
2880
2881 * src/reader.c (parse_union_decl): Instead of handling two obstack
2882 simultaneously, use one to define the `stype' muscle, and use the
2883 value of the latter to fill defines_obstack.
2884 (copy_comment): Remove.
2885 (copy_comment2): Work for a single obstack.
2886 Rename as...
2887 (copy_comment): this.
2888
428046f8
AD
28892001-12-15 Akim Demaille <akim@epita.fr>
2890
2891 * src/lex.c, src/lex.h (xgetc): No longer static.
2892 * src/reader.c (parse_union_decl): Revamp.
2893
ea52d706
AD
28942001-12-15 Akim Demaille <akim@epita.fr>
2895
2896 Still making progress in separating Bison into (i) input, (ii)
2897 process, (iii) output: now we can directly output the parser file
2898 without using table_obstack at all.
2899
2900 * src/files.c, src/files.h (table_obstack): Bye bye.
2901 (parser_file_name): New.
2902 * src/files.c (compute_output_file_names): Compute it.
2903 * src/output.c (actions_output, output_parser)
2904 (output_master_parser): To a file instead of an obstack.
2905
3f96f4dc
AD
29062001-12-15 Akim Demaille <akim@epita.fr>
2907
2908 Attach actions to rules, instead of pre-outputting them to
2909 actions_obstack.
2910
2911 * src/gram.h (rule_t): action and action_line are new members.
2912 * src/reader.c (symbol_list): Likewise.
2913 (copy_action): Save the actions within the rule.
2914 (packgram): Save them in rule_table.
2915 * src/output.c (actions_output): New.
2916 (output_parser): Use it on `%%actions'.
2917 (output_rule_data): Don't free rule_table.
2918 (output): Do it.
2919 (prepare): Don't save the `action' muscle.
2920 * src/bison.simple: s/%%action/%%actions/.
2921
51576fb3
AD
29222001-12-15 Akim Demaille <akim@epita.fr>
2923
2924 * src/reader.c (copy_action): When --yacc, don't append a `;'
2925 to the user action: let it fail if lacking.
dee049eb 2926 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 2927
2648a72d
AD
29282001-12-14 Akim Demaille <akim@epita.fr>
2929
2930 * src/lex.c (literalchar): Simply return the char you decoded, non
2931 longer mess around with obstacks and int pointers.
2932 Adjust all callers.
2933
92790e5b
AD
29342001-12-14 Akim Demaille <akim@epita.fr>
2935
2936 * src/lex.c (literalchar): Don't escape the special characters,
2937 just decode them, and keep them as char (before, eol was output as
2938 the 2 char string `\n' etc.).
2939 * src/output.c (output_rule_data): Use quotearg to output the
2940 token strings.
2941
927c1557
PE
29422001-12-13 Paul Eggert <eggert@twinsun.com>
2943
2944 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
2945 Do not infringe on the global user namespace when using C++.
2946 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
2947 All uses of `fprintf' and `stderr' changed.
2948
2949 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
2950
ed8e1f68
AD
29512001-12-13 Akim Demaille <akim@epita.fr>
2952
2953 The computation of nullable is broken: it doesn't handle empty
2954 RHS's properly.
2955
2956 * tests/torture.at (GNU AWK Grammar): New.
2957 * tests/sets.at (Nullable): New.
2958 * src/nullable.c (set_nullable): Instead of blindly looping over
2959 `ritems', loop over the rules, and then over their rhs's.
2960
2961 Work around Autotest bugs.
2962
2963 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
2964 frame, because Autotest understand lines starting with a `+' as
2965 traces from the shell. Then, they are not processed properly.
2966 Admittedly an Autotest bug, but we don't have time to wait for
2967 Autotest to catch up.
2968 * tests/regression.at (Broken Closure): Adjust to the new table
2969 frames.
2970 Move to...
2971 * tests/sets.at: here.
2972
cb581495
AD
29732001-12-13 Akim Demaille <akim@epita.fr>
2974
2975 * src/closure.c (closure): Use nrules instead of playing tricks
2976 with BITS_PER_WORD.
2977
2e729273
AD
29782001-12-13 Akim Demaille <akim@epita.fr>
2979
2980 * src/print.c (print_actions): Output the handling of `$' as the
2981 traces do: shifting the token EOF. Before EOF was treated as a
2982 nonterminal.
2983 * tests/regression.at: Adjust some tests.
2984 * src/print_graph.c (print_core): Complete the set of items via
2985 closure. The next-to-final and final states are still unsatisfying,
2986 but that's to be addressed elsewhere.
2987 No longer output the rule numbers, but do output the state number.
2988 A single loop for the shifts + gotos is enough, but picked a
2989 distinct color for each.
2990 (print_graph): Initialize and finalize closure.
2991
107f7dfb
AD
29922001-12-13 Akim Demaille <akim@epita.fr>
2993
2994 * src/reader.c (readgram): Remove dead code, an strip useless
2995 braces.
2996 (get_type): Remove, unused.
2997
9b53a24f
AD
29982001-12-12 Akim Demaille <akim@epita.fr>
2999
3000 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
3001 on that of lib/error.c.
3002
dbfb6dcd
AD
30032001-12-12 Akim Demaille <akim@epita.fr>
3004
3005 Some hosts don't like `/' in includes.
3006
3007 * src/system.h: Include libgettext.h without qualifying the path.
3008 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
3009 $(top_srcdir).
3010
c25fb648
MA
30112001-12-11 Marc Autret <autret_m@epita.fr>
3012
3013 * src/output.c (output_parser): Remove useless muscle.
3014
710ddc4f
MA
30152001-12-11 Marc Autret <autret_m@epita.fr>
3016
3017 * src/bison.simple: Remove #line just before %%epilogue. It
3018 is now handled in ...
3019 * src/reader.c (read_additionnal_code): Add the output of a
3020 #line for the epilogue.
3021
e83d80b8
MA
30222001-12-10 Marc Autret <autret_m@epita.fr>
3023
927c1557 3024 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
3025 replace precedent remove.
3026 * src/bison.simple: Remove #line before %%prologue because
3027 %%input-line is wrong at this time.
3028
971d5158
MA
30292001-12-10 Marc Autret <autret_m@epita.fr>
3030
3031 * src/reader.c (symbols_output): Clean up.
927c1557 3032 * src/output.c (output_gram, output): Clean up.
971d5158 3033
5edafffd
AD
30342001-12-10 Akim Demaille <akim@epita.fr>
3035
3036 * src/lalr.c (initialize_lookaheads): New. Extracted from...
3037 * src/LR0.c (set_state_table): here.
3038 * src/lalr.c (lalr): Call it.
3039
0279f8e9
AD
30402001-12-10 Akim Demaille <akim@epita.fr>
3041
3042 * src/state.h (shifts): Remove the `number' member: shifts are
3043 attached to state, hence no longer need to be labelled with a
3044 state number.
3045
190c4f5f
AD
30462001-12-10 Akim Demaille <akim@epita.fr>
3047
3048 Now that states have a complete set of members, the linked list of
3049 shifts is useless: just fill directly the state's shifts member.
3050
3051 * src/state.h (shifts): Remove the `next' member.
3052 * src/LR0.c (first_state, last_state): Remove.
3053 Adjust the callers.
3054 (augment_automaton): Don't look for the shifts that must be added
3055 a shift on EOF: it is those of the state we looked for! But now,
3056 since shifts are attached, it is no longer needed to looking
3057 merely by its id: its number.
3058
2a73b93d
AD
30592001-12-10 Akim Demaille <akim@epita.fr>
3060
3061 * src/LR0.c (augment_automaton): Better variable locality.
3062 Remove an impossible branch: if there is a state corresponding to
3063 the start symbol being shifted, then there is shift for the start
3064 symbol from the initial state.
3065
74392f6a
AD
30662001-12-10 Akim Demaille <akim@epita.fr>
3067
3068 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
3069 only when appropriate: when insert_start_shifting_state' is not
3070 invoked.
3071 * tests/regression.at (Rule Line Numbers): Adjust.
3072
37c82725
AD
30732001-12-10 Akim Demaille <akim@epita.fr>
3074
3075 * src/LR0.c (augment_automaton): Now that all states have shifts,
3076 merge the two cases addition shifts to the initial state.
3077
6a164e0c
AD
30782001-12-10 Akim Demaille <akim@epita.fr>
3079
3080 * src/lalr.c (set_state_table): Move to...
3081 * src/LR0.c: here.
3082 * src/lalr.c (lalr): Don't call it...
3083 * src/LR0.c (generate_states): do it.
3084 * src/LR0.h (first_state): Remove, only the table is used.
3085
7215de24
AD
30862001-12-10 Akim Demaille <akim@epita.fr>
3087
3088 * src/LR0.h (first_shift, first_reduction): Remove.
3089 * src/lalr.c: Don't use first_shift: find shifts through the
3090 states.
3091
80e25d4d
AD
30922001-12-10 Akim Demaille <akim@epita.fr>
3093
3094 * src/LR0.c: Attach shifts to states as soon as they are
3095 computed.
3096 * src/lalr.c (set_state_table): Instead of assigning shifts to
3097 state, just assert that the mapping was properly done.
3098
0ab3728b
AD
30992001-12-10 Akim Demaille <akim@epita.fr>
3100
3101 * src/LR0.c (insert_start_shift): Rename as...
3102 (insert_start_shifting_state): this.
3103 (insert_eof_shifting_state, insert_accepting_state): New.
3104 (augment_automaton): Adjust.
3105 Better locality of the variables.
3106 When looking if the start_symbol is shifted from the initial
3107 state, using `while (... symbol != start_symbol ...)' sounds
3108 better than `while (... symbol < start_symbol ...)': If fail
3109 to see how the order between symbols could be relevant!
3110
78af9bbc
AD
31112001-12-10 Akim Demaille <akim@epita.fr>
3112
3113 * src/getargs.h: Don't declare `spec_name_prefix' and
3114 `spec_file_prefix', declared by src/files.h.
3115 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
3116 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
3117 * src/output.c (prepare): Adjust.
3118 * src/reader.c (symbols_output): Likewise.
3119 * src/vmsgetargs.c: Vaguely adjust, but who cares?
3120
bdef2a41
AD
31212001-12-10 Akim Demaille <akim@epita.fr>
3122
3123 * src/muscle_tab.c (muscle_init): NULL is a better default than
3124 `"0"'.
3125
3735969c
AD
31262001-12-10 Akim Demaille <akim@epita.fr>
3127
3128 * src/reader.c (reader): Calling symbols_output once is enough.
3129
49701457
AD
31302001-12-10 Akim Demaille <akim@epita.fr>
3131
3132 Now that states have a complete set of members, the linked list of
3133 reductions is useless: just fill directly the state's reductions
3134 member.
3135
3136 * src/state.h (struct reductions): Remove member `number' and
3137 `next'.
3138 * src/LR0.c (first_reduction, last_reduction): Remove.
3139 (save_reductions): Don't link the new reductions, store them in
3140 this_state.
3141 * src/lalr.c (set_state_table): No need to attach reductions to
3142 states, it's already done.
3143 * src/output.c (output_actions): No longer free the shifts, then
3144 the reductions, then the states: free all the states and their
3145 members.
3146
0edad749
AD
31472001-12-10 Akim Demaille <akim@epita.fr>
3148
3149 * src/options.c (OPTN, DRTV, BOTH): New.
3150 (option_table): Use them.
3151
0edad749
AD
3152 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
3153 the job of system.h.
3154 * src/options.c: Don't include stdio.h and xalloc.h for the same
3155 reasons.
3156
5449dd0f
AD
31572001-12-10 Akim Demaille <akim@epita.fr>
3158
3159 * src/output.c (output, prepare): Make sure the values of the
3160 muscles `action' and `prologue' are 0-terminated.
3161
a870c567
AD
31622001-12-10 Akim Demaille <akim@epita.fr>
3163
3164 Clean up GCC warnings.
3165
3166 * src/reader.c (copy_action): `buf' is not used.
3167 (parse_skel_decl): Be static.
3168 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
3169 * src/options.h (create_long_option_table): Have a real prototype.
3170 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
3171 (hash_delete_at): Return const void *.
3172 Adjust casts to preserve the const.
3173
80df8768
AD
31742001-12-10 Akim Demaille <akim@epita.fr>
3175
3176 * configure.in: Require 2.52g.
3177 M4 is not needed, but AUTOM4TE is.
3178 * m4/m4.m4: Remove.
3179 * tests/Makefile.am: Adjust.
3180
f693ad14
AD
31812001-12-10 Akim Demaille <akim@epita.fr>
3182
3183 One structure for states is enough, even though theoretically
3184 there are LR(0) states and LALR(1) states.
3185
3186 * src/lalr.h (state_t): Remove.
3187 (state_table): Be state_t **, not state_t *.
3188 * src/state.h (core, CORE_ALLOC): Rename as...
3189 (state_t, STATE_ALLOC): this.
3190 Add the LALR(1) members: shifts, reductions, errs.
3191 * src/LR0.c (state_table): Rename as...
3192 (state_hash): this, to avoid name clashes with the global
3193 `state_table'.
3194 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
3195 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
3196
74ffbcb6
AD
31972001-12-10 Akim Demaille <akim@epita.fr>
3198
3199 Bison dumps core on bash.y.
3200 Reported by Pascal Bart.
3201
3202 * src/warshall.c (bitmatrix_print): New.
3203 (TC): Use it.
3204 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
3205 j must be the outer loop.
3206 * tests/regression.at (Broken Closure): New.
3207
07708e19
AD
32082001-12-05 Akim Demaille <akim@epita.fr>
3209
3210 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
3211 its argument.
3212