Akim Demaille [Mon, 19 Nov 2001 10:28:29 +0000 (10:28 +0000)]
* src/vcg.c: You do the output, so you are responsible of the
handling of VCG syntax, in particular: use quotearg.
* src/print_graph.c: Don't.
(print_actions): Don't output the actions as part of the nodes,
since that's the job of the edges.
(print_state): Don't output by hand: fill the node description,
and ask for its output.
Akim Demaille [Mon, 19 Nov 2001 10:26:16 +0000 (10:26 +0000)]
* src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
* src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
* src/output.c: Adjust.
Akim Demaille [Mon, 19 Nov 2001 10:08:20 +0000 (10:08 +0000)]
* src/lalr.h (lookaheads): Removed array, which contents is now
member of...
(state_t): this structure.
* src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
Adjust.
Akim Demaille [Mon, 19 Nov 2001 10:08:02 +0000 (10:08 +0000)]
* src/lalr.h (consistent): Removed array, which contents is now
member of...
(state_t): this structure.
* src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
Adjust.
Akim Demaille [Mon, 19 Nov 2001 10:07:44 +0000 (10:07 +0000)]
* src/lalr.h (reduction_table, shift_table): Removed arrays, which
contents is now members of...
(state_t): this structure.
* src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
Adjust.
Akim Demaille [Wed, 14 Nov 2001 15:20:47 +0000 (15:20 +0000)]
* tests/calc.at, tests/output.at, tests/regression.at,
* tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
now the tests are run in private dirs, therefore AC_CLEANUP and
family can be simplified to 0-ary.
* tests/atlocal.in: Now that we run `elsewhere' than in tests/,
use abs. path to find config.h.
* tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
stderr, there can be way too much random noise.
Instead pass -Werror to GCC and rely on the exit status.
Reported by Wolfram Wagner.
Akim Demaille [Wed, 14 Nov 2001 14:57:44 +0000 (14:57 +0000)]
* src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
defined only if yyoverflow is defined, to avoid `warning: unused
variable `yyvs1''.
Reported by The Test Suite.
Akim Demaille [Mon, 12 Nov 2001 09:36:31 +0000 (09:36 +0000)]
* doc/bison.texinfo: Use `$' as shell prompt, not `%'.
Use @kbd to denote user input.
(Language and Grammar): ANSIfy the example.
Adjust its layout for info/notinfo.
(Location Tracking Calc): Output error messages to stderr.
Output locations in a more GNUtically correct way.
Fix a couple of Englishos.
Adjust @group/@end group pairs.
Akim Demaille [Mon, 12 Nov 2001 09:33:38 +0000 (09:33 +0000)]
%expext was not functioning at all.
* src/conflicts.c (expected_conflicts): Set to -1.
(conflict_report): Use ngettext.
(conflicts_print): Check %expect and make its violation an error.
* doc/bison.texinfo (Expect Decl): Adjust.
* configure.in (AM_GNU_GETTEXT): Ask for ngettext.
* tests/regression.at (%expect not enough, %expect right)
(%expect too much): New.
Akim Demaille [Mon, 12 Nov 2001 09:24:14 +0000 (09:24 +0000)]
* src/bison.simple: Define type yystype instead of YYSTYPE, and
define CPP macro, which substitute YYSTYPE by yystype.
* src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
with yyltype/YYLTYPE. This allows inclusion of the generated
header within the parser if the compiler, such as GGC, accepts
multiple equivalent #defines.
From Akim.
Akim Demaille [Mon, 5 Nov 2001 09:09:19 +0000 (09:09 +0000)]
* src/options.h (struct option_table_struct): set_flags is void*.
* src/options.c (longopts): Support `--output' and `%output'.
(usage): Adjust.
* src/lex.h (tok_setopt): Remove, replaced with...
(tok_intopt, tok_stropt): these new guys.
* src/lex.c (getopt.h): Not needed.
(token_buffer, unlexed_token_buffer): Not const.
(percent_table): Promote `-' over `_' in directive names.
Active `%name-prefix', `file-prefix', and `output'.
(parse_percent_token): Accept possible arguments to directives.
Promote `-' over `_' in directive names.
Akim Demaille [Mon, 5 Nov 2001 08:50:46 +0000 (08:50 +0000)]
* doc/bison.texinfo (Decl Summary): Split the list into
`directives for grammars' and `directives for bison'.
Sort'em.
Add description of `%name-prefix', `file-prefix', and `output'.
Promote `-' over `_' in directive names.
(Bison Options): s/%locactions/%locations/. Nice Freudian slip.
Simplify the description of `--name-prefix'.
Promote `-' over `_' in directive names.
Promote `--output' over `--output-file'.
Fix the description of `--defines'.
* tests/output.at: Exercise %file-prefix and %output.
Akim Demaille [Fri, 2 Nov 2001 15:27:11 +0000 (15:27 +0000)]
* src/symtab.h (SUNDEF): New.
* src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
stand for `uninitialized', instead of 0.
* src/reader.c (packsymbols, parse_thong_decl): Adjust.
* src/lex.c (lex): Adjust.
* tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
Number it 0.
Let yylex return it instead of a plain 0.
Reported by Dick Streefland.
Akim Demaille [Thu, 1 Nov 2001 18:05:22 +0000 (18:05 +0000)]
* tests/regression.at (Invalid input: 2): New.
* src/lex.c (unlexed_token_buffer): New.
(lex, unlex): Adjust: when unlexing, be sure to save token_buffer
too.
Reported by Wwp.
* src/output.c (output_master_parser): Don't finish action_obstack.
(output_parser): Don't care about the muscle action, here.
(prepare): Copy the action_obstack in the action muscle.
(output): Free action_obstack.
* src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
will contain `%union' declaration.
(parse_union_decl): Delete #line directive output.
(parse_union_decl): Substitute /attrs_obstack/union_obstack for all
informations about %union.
(parse_union_decl): Copy the union_obstack in the muscle stype.
* src/bison.simple: Add new #line directive.
Add typdef %%stype YYSTYPE.
* src/lex.c (parse_percent_token): Change type of variable `tx', which
is now an option_table_struct*.
(option_strcmp): New function option_strcmp.
(parse_percent_token): Call option_strcmp.
* src/getargs.c (xalloc.h, options.h): Include it.
(getargs): Call create_long_option_table.
(getargs): Free longopts at the end of the function.
(shortopts): Move in options.c.
* src/options.c (create_long_option_table): New function. Convert
information from option_table to option structure.
* src/reader.c (options.h): Include it.
* src/Makefile.am: Adjust.
* src/options.c (option_table): Create from longopts and percent_table.
* src/getargs.c (longopts): Delete.
* src/lex.c (struct percent_table_struct): Delete.
(percent_table): Delete.
(options.h): Include it.
* src/options.c: Create.
* src/options.h: Create.
Declare enum opt_access_e.
Define struct option_table_struct.