Re: [REQUEST] Infinite recursion warning

2013-12-17 Thread David M. Warme
The problem isn't exactly infinite recursion, at least not as far as Bison is concerned. The error/warning messages are indeed suboptimal. Bison reports a constellation of symbols/rules as being "useless." When most people (myself included) see this message, they usually assume that this means

Re: [REQUEST] Infinite recursion warning

2013-12-15 Thread Ron Burk
In my own parser generator tinkering (where I care greatly about explanations), I would say: 'list' is a nonterminal that never terminates. and link to a longer explanation of that concept. This is probably the most succinct diagnostic, since the problem is not what any of the 'list' rules does

Re: [REQUEST] Infinite recursion warning

2013-12-15 Thread Akim Demaille
Le 15 déc. 2013 à 01:31, Arthur Schwarz a écrit : > exp:NIL >| NIL list > > list:NIL list > > I won't address the issue of messaging (unqualified and this is an issue best > addressed by the development team) but I will explore the grammar. Valentin is well aware of the fact that the gra

Re: [REQUEST] Infinite recursion warning

2013-12-14 Thread Arthur Schwarz
exp:NIL    | NIL list list:NIL list I won't address the issue of messaging (unqualified and this is an issue best addressed by the development team) but I will explore the grammar. In LL (top-down, recursive descent) parser generators, the correct way to represent a list of items is: list : t

Re: [REQUEST] Infinite recursion warning

2013-12-10 Thread Valentin Tolmer
> 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-

Re: [REQUEST] Infinite recursion warning

2013-12-09 Thread Akim Demaille
Le 10 déc. 2013 à 02:01, Valentin Tolmer 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 > recursi

[REQUEST] Infinite recursion warning

2013-12-09 Thread Valentin Tolmer
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. Thanks! -- Valentin Tolmer ___