bug-bison
[Top][All Lists]
Advanced

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

Re: Useless rule?


From: Paul Eggert
Subject: Re: Useless rule?
Date: Sat, 11 Jan 2003 00:26:25 -0800 (PST)

> From: "Jon Watte" <address@hidden>
> Date: Fri, 10 Jan 2003 23:46:45 -0800
> 
> pieces.y:232.3-233.50: warning: useless rule: edge_height_list: '{' INTEGER
> ',' INTEGER '}' edge_height_list ',' '{' INTEGER ',' INTEGER '}'

It does seem to me that Bison's error message is less than useful.

The problem is in this rule:

        edge_height_list:
          '{' INTEGER ',' INTEGER '}'
          edge_height_list ',' '{' INTEGER ',' INTEGER '}'
          ;

You forgot a '|' before the 3rd line.  This rule is useless because
it cannot possibly generate a finite string.  Bison is within its rights
to call it a useless rule, but its diagnostic is pretty cryptic.

On the same example, Yacc generates the slightly-more-useful message
"nonterminal edge_height_list never derives any token string".  This
is still too cryptic, but it's better.




reply via email to

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