bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI: Both: Gr. Reduction


From: Marc Autret
Subject: Re: FYI: Both: Gr. Reduction
Date: 29 Nov 2001 18:16:27 -0500
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

Akim Demaille <address@hidden> writes:

Hi Akim,

> | ~/src/bison-1.29 % cd tests/testsuite.dir/17
> | tests/testsuite.dir/17 % cat input.y
> | %verbose
> | %output="input.c"
> | 
> | %nterm useless1
> | %nterm useless2
> | %nterm useless3
> | %nterm useless4
> | %nterm useless5
> | %nterm useless6
> | %nterm useless7
> | %nterm useless8
> | %nterm useless9
> | 
> | %token useful
> | %%
> | exp: useful;
> | tests/testsuite.dir/17 % cat input.output
> | Useless nonterminals:
     ^^^^^^^^^^^^^^^
[...]

> +
> +
> +## ---------------------- ##
> +## Useless Nonterminals.  ##
> +## ---------------------- ##
> +
> +AT_SETUP([Useless Nonterminals])
> +
> +AT_DATA([[input.y]],
> +[[%verbose
> +%output="input.c"
> +
> +%nterm useless1
> +%nterm useless2
> +%nterm useless3
> +%nterm useless4
> +%nterm useless5
> +%nterm useless6
> +%nterm useless7
> +%nterm useless8
> +%nterm useless9
> +
> +%token useful
> +%%
> +exp: useful;
> +]])
> +
> +AT_CHECK([[bison input.y]])
> +
> +AT_CHECK([[sed -n '/^Grammar/q;/^$/!p' input.output]], 0,
> +[[Terminals which are not used:
        ^^^^^^^^^^^^^^^^^^
> +   useless1
> +   useless2
> +   useless3
> +   useless4
> +   useless5
> +   useless6
> +   useless7
> +   useless8
> +   useless9
> +]])
> +

Maybe a mistake here.
Moreover, Bison outputs a message which is
not caught by the testsuite:

address@hidden ~/bison/work/trunk/essai](68)> cat reduce.y
%verbose
%output="reduce.c"

%nterm useless1
%nterm useless2
%nterm useless3
%nterm useless4
%nterm useless5
%nterm useless6
%nterm useless7
%nterm useless8
%nterm useless9

%token useful
%%
exp: useful;


address@hidden ~/bison/work/trunk/essai](59)> ../tests-bison/src/bison -S 
../tests-bison/src/bison.simple reduce.y
reduce.y contains 9 useless nonterminals


## --------------------------- ##
## GNU Bison 1.49a test suite. ##
## --------------------------- ##
17. reduce.at:70: testing Useless Nonterminals...
reduce.at:91: bison input.y
--- /dev/null   Thu Nov 29 23:14:56 2001
+++ 
/home/prog/bison/work/experimentals/tests-bison/tests/testsuite.dir/at-stderr   
    Thu Nov 29 23:14:56 2001
@@ -0,0 +1 @@
+input.y contains 9 useless nonterminals
17. reduce.at:70: FAILED near `reduce.at:91'

-- 
Marc Autret



reply via email to

[Prev in Thread] Current Thread [Next in Thread]