Le 10 déc. 2013 à 02:01, Valentin Tolmer <valentin.tol...@gmail.com> a écrit :
> Hello, > > In the following grammar, the only word recognized is NIL, because of > an infinite recursion. > > exp: > NIL > | NIL list > > list: > NIL list > > It would be nice if Bison could raise a warning in case of an infinite > recursion. Hi Valentin, I suppose you mean that the message should be clearer? $ cat foo.yy %% exp: "NIL" | "NIL" list list: "NIL" list $ LC_ALL=C bison foo.yy foo.yy: warning: 1 nonterminal useless in grammar [-Wother] foo.yy: warning: 2 rules useless in grammar [-Wother] foo.yy:2.20-23: warning: nonterminal useless in grammar: list [-Wother] exp: "NIL" | "NIL" list ^^^^ foo.yy:2.14-23: warning: rule useless in grammar [-Wother] exp: "NIL" | "NIL" list ^^^^^^^^^^ foo.yy:3.7-16: warning: rule useless in grammar [-Wother] list: "NIL" list ^^^^^^^^^^ _______________________________________________ help-bison@gnu.org https://lists.gnu.org/mailman/listinfo/help-bison