Commit Graph

111 Commits

Author SHA1 Message Date
Akim Demaille
4eeb7bc9a2 * tests/output.at (AT_CHECK_OUTPUT): Another test, making sure
bison fails when trying to output a parser and a header under the
same name.
* src/files.c (compute_output_file_names): Refuse when parser and
header have the same name.
2002-03-04 18:06:42 +00:00
Akim Demaille
bae3c8d209 * tests/sets.at (Broken Closure): Add the ending `;'.
* tests/input.at (Invalid $n, Invalid @n): Likewise.
* tests/output.at (AT_CHECK_OUTPUT): Likewise.
* src/reader.at (readgram): Complain if a rule is not ended with a
semi-colon.
2002-03-04 14:57:46 +00:00
Akim Demaille
6f8dd2075e * tests/Makefile.am (check_SCRIPTS): New. 2002-02-28 15:47:55 +00:00
Akim Demaille
e1fe241dc8 * tests/regression.at (else): Adjust to Andreas' change. 2002-02-14 12:37:44 +00:00
Akim Demaille
9cbe3c4878 * tests/regression.at (%nonassoc and eof): Don't include non
portable headers.
2002-02-11 13:31:14 +00:00
Akim Demaille
e89a22bfab * tests/regression.at, tests/torture.at, tests/calc.at: Adjust to
newest Autotest, where `.' is not in the PATH.
2002-02-07 17:30:49 +00:00
Akim Demaille
7307a21a45 * tests/input.at: New. 2002-02-07 17:13:46 +00:00
Akim Demaille
27fb1c24b7 * tests/regression.at (%nonassoc and eof): New.
Suggested by Robert Anisko.
2002-01-25 16:24:21 +00:00
Akim Demaille
281a98c77a 1.32a. 2002-01-25 11:29:31 +00:00
Akim Demaille
83ce390155 Adjust. 2002-01-24 18:57:32 +00:00
Akim Demaille
015af8c168 Bison dumps core when trying to complain about broken input files.
Reported by Cris van Pelt.
* src/lex.c (parse_percent_token): Be sure to set token_buffer.
* tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
into...
(Invalid inputs): Strengthen: exercise parse_percent_token.
2002-01-22 10:29:28 +00:00
Akim Demaille
2842171a4c Regen. 2002-01-21 14:09:53 +00:00
Marc Autret
7700a71572 * tests/output.at: New test.
* src/files.c (compute_base_names): Don't map extensions when
the YACC flag is set, use defaults.
Reported by Evgeny Stambulchik.
2002-01-19 12:50:56 +00:00
Akim Demaille
6fc75bfd3a * tests/regression.at (Invalid CPP headers): Remove. 2002-01-14 10:16:49 +00:00
Akim Demaille
a99566be67 * configure.in (WERROR_CFLAGS): Compute it.
* src/Makefile.am (CFLAGS): Pass it.
* tests/atlocal.in (CFLAGS): Idem.
2002-01-09 15:06:25 +00:00
Akim Demaille
25a46077de * src/conflicts.c (count_rr_conflicts): The previous RR conflicts
patch was improperly applied: fix it.
2002-01-07 08:42:59 +00:00
Akim Demaille
3f2f7848cc * src/reader.c (parse_braces): Don't fetch the next char, the
convention is to fetch on entry.
* tests/torture.at (GNU Cim Grammar): Reintroduce their weird
'switch' without a following semicolon.
* tests/regression.at (braces parsing): New.
2002-01-06 20:59:30 +00:00
Akim Demaille
c4267a3d35 Bison is dead wrong in its RR conflict reports.
* tests/torture.at (GNU Cim Grammar): New.
* src/conflicts.c (count_rr_conflicts): Fix.
2002-01-06 20:59:12 +00:00
Akim Demaille
ae774286e8 Creating package.m4 from configure.ac causes too many problems.
* tests/Makefile.am (package.m4): Create it by hand,
AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
2002-01-06 20:57:20 +00:00
Akim Demaille
dd3c3f3006 * tests/bison.in: Adjust to CVS Autoconf.
* tests/calc.at (exp): We no longer need to special case GCC as
the warning flags are passed by configure.
* tests/atlocal.in: Adjust.
* configure.in: Bump to 1.30j.
2002-01-03 11:10:50 +00:00
Akim Demaille
f1d93aa21c Regen. 2002-01-03 11:09:47 +00:00
Akim Demaille
1214dfb03b Some actions of web2c.y are improperly triggered.
Reported by Mike Castle.
* src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
* tests/regression.at (Web2c): Rename as...
(Web2c Report): this.
(Web2c Actions): New.
2001-12-22 14:44:25 +00:00
Akim Demaille
55b4181996 Reductions in web2c.y are improperly reported.
Reported by Mike Castle.
* src/conflicts.c (print_reductions): Fix.
* tests/regression.at (Web2c): New.
2001-12-22 14:41:15 +00:00
Akim Demaille
f7e7f57941 The computation of nullable is broken: it doesn't handle empty
RHS's properly.
* tests/torture.at (GNU AWK Grammar): New.
* tests/sets.at (Nullable): New.
* src/nullable.c (set_nullable): Instead of blindly looping over
`ritems', loop over the rules, and then over their rhs's.
Work around Autotest bugs.
* src/warshall.c (bitmatrix_print): Don't use `+--+' as table
frame, because Autotest understand lines starting with a `+' as
traces from the shell.  Then, they are not processed properly.
Admittedly an Autotest bug, but we don't have time to wait for
Autotest to catch up.
* tests/regression.at (Broken Closure): Adjust to the new table
frames.
Move to...
* tests/sets.at: here.
2001-12-13 10:59:37 +00:00
Akim Demaille
ed45e93ed8 Bison dumps core on bash.y.
Reported by Pascal Bart.
* src/warshall.c (bitmatrix_print): New.
(TC): Use it.
When performing a transitive closure R(i, j) && R(j, k) => R(i,	k),
j must be the outer loop.
* tests/regression.at (Broken Closure): New.
2001-12-10 08:43:38 +00:00
Akim Demaille
e6970f2ed0 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
its argument.
Reported by Peter Hmorsk.
2001-12-05 10:58:44 +00:00
Akim Demaille
a69f6fa569 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
(CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
Gettext doesn't compile cleanly, and dies with -Werror.
* src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
Include WARNING_CFLAGS here.
* lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
before being defined.
2001-11-30 14:23:47 +00:00
Akim Demaille
d39a6b7ca9 Instead of mapping the LHS of unused rules to -1, keep the LHS
valid, but flag the rules as invalid.
* src/gram.h (rule_t): `useful' is a new member.
* src/print.c (print_grammar): Adjust.
* src/derives.c (set_derives): Likewise.
* src/reader.c (packgram, reduce_output): Likewise.
* src/reduce.c (reduce_grammar_tables): Likewise.
* tests/reduce.at (Underivable Rules, Useless Rules): New.
2001-11-30 10:46:08 +00:00
Akim Demaille
d287d66a69 * src/reduce.c (reduce_output): Formatting changes.
* src/print.c (print_results, print_grammar): Likewise.
* tests/regression.at (Rule Line Numbers)
(Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
2001-11-30 10:45:45 +00:00
Akim Demaille
ea451a17d7 * src/reduce.c (nonterminals_reduce): Instead of throwing away
useless nonterminals, move them at the end of the symbol arrays.
(reduce_output): Adjust.
* tests/reduce.at (Useless Nonterminals): Adjust.
2001-11-30 10:45:28 +00:00
Akim Demaille
0aa2ac9063 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
* src/reduce.c (reduce_grammar_tables): Do not free useless tags,
as all tags are free'ed afterwards.
From Enrico Scholz.
2001-11-28 11:42:56 +00:00
Akim Demaille
dee96b5a07 * tests/torture.at (Exploding the Stack Size with Malloc):
s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
2001-11-27 18:57:02 +00:00
Akim Demaille
af4483a0ab Typo. 2001-11-26 15:25:10 +00:00
Akim Demaille
674fd9acbc * src/reader.c (readgram): Make sure rules for mid-rule actions
have a lineno equal to that of their host rule.
Reported by Hans Aberg.
* tests/regression.at (Rule Line Numbers): New.
2001-11-26 15:24:06 +00:00
Akim Demaille
33285af04d * src/reader.c (read_declarations): Don't abort on tok_illegal,
issue an error message.
* tests/regression.at (Invalid %directive): New.
Reported by Hans Aberg.
2001-11-26 09:49:58 +00:00
Akim Demaille
1b9a8440cd * src/conflicts.c (conflicts_print): Don't complain at all when
there are no reduce/reduce conflicts, and as many shift/reduce
conflicts as expected.
* tests/regression.at (%expect right): Adjust.
2001-11-26 09:18:40 +00:00
Akim Demaille
a9f37dee0c Attaching lineno to buckets is stupid, since only one copy of each
symbol is kept, only the line of the first occurrence is kept too.
* src/symtab.h, src/symtab.c (bucket): Remove the line member.
* src/reader.c (rline_allocated): Remove, unused.
(symbol_list): Have a `line' member.
(symbol_list_new): New.
(readgram): Use it.
* src/print.c (print_grammar): Output the rule line numbers.
* tests/regression.at (Solved SR Conflicts)
(Unresolved SR Conflicts): Adjust.
Reported by Hans Aberg.
2001-11-23 14:03:43 +00:00
Akim Demaille
c555896775 * src/bison.simple (yyparse): When reporting verbosely an error,
no longer issue additional quotes around token names.
* tests/calc.at: Adjust.
2001-11-19 09:13:26 +00:00
Akim Demaille
efcff8cd5c * 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.
2001-11-14 15:16:40 +00:00
Akim Demaille
badfc69c26 %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.
2001-11-12 09:19:48 +00:00
Akim Demaille
fb28699f95 * tests/regression.at (Conflicts): Rename as...
(Unresolved SR Conflicts): this.
(Solved SR Conflicts): New.
2001-11-12 09:16:10 +00:00
Akim Demaille
dad56b10d3 * src/conflicts.c (print_reductions): Accept OUT as argument.
Output to it, not to output_obstack.
* src/print.c (print_actions): Adjust.
2001-11-12 09:15:43 +00:00
Akim Demaille
5f1ff7cd74 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
the result instead of using...
(src_total, rrc_total, src_count, rrc_count): Remove.
(any_conflicts): Remove.
(print_conflicts): Split into...
(conflicts_print, conflicts_output): New.
* src/conflicts.h: Adjust.
* src/main.c (main): Invoke both conflicts_output and conflicts_print.
* src/print.c (print_grammar): Issue `n' between to rule outputs.
* tests/regression.at (Conflicts): New.
Reported by Tom Lane.
2001-11-12 09:15:25 +00:00
Akim Demaille
b6cac93afa * tests/regression.at (Invalid input): Remove, duplicate with
``Invalid input: 1''.
2001-11-12 09:15:03 +00:00
Akim Demaille
86d5a1ed5c * tests/torture.at (AT_DATA_STACK_TORTURE)
(Exploding the Stack Size with Alloca)
(Exploding the Stack Size with Malloc): New.
2001-11-12 09:14:50 +00:00
Akim Demaille
3c5d71ca8b * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
pattern.
2001-11-05 09:18:31 +00:00
Akim Demaille
ea57e0a3c4 * src/getargs.c (longopts): Support `--output'. getopt is now
able to understand that `--out' is OK: the two racing long options
are aliases.
(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.
* 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.
2001-11-04 16:26:59 +00:00
Akim Demaille
239e5c1a9a * 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.
2001-11-02 15:26:33 +00:00
Akim Demaille
ae9b5e5a4f * tests/regression.at (Mixing %token styles): New test. 2001-11-02 14:12:42 +00:00
Akim Demaille
1d708336d4 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
Check that `9foo.y' produces correct cpp guards.
* src/files.c (compute_header_macro): Prepend `BISON_' to CPP
guards.
Reported by Wwp.
2001-11-01 18:29:36 +00:00