Yecc bug (possibly related to mutually recursive rules)

Manolis Papadakis <>
Mon Mar 1 17:16:25 CET 2010

This grammar file:

Nonterminals elem seq.
Terminals 'foo' 'bar' ':'.
Rootsymbol elem.
elem -> 'foo'.
elem -> 'bar'.
elem -> seq.
seq -> elem.
seq -> seq ':' elem.
% or seq -> elem ':' seq.

when fed to yecc (git version) produces this error:

2> yecc:file("bug.yrl").

=ERROR REPORT==== 1-Mar-2010::18:16:06 ===
Error in process <0.36.0> with exit value:

** exception exit: function_clause
     in function  yecc:find_reduce_reduce/2
        called as


     in call from yecc:'-find_action_conflicts/1-fun-0-'/3
     in call from lists:foldl/3
     in call from yecc:'-find_action_conflicts/1-fun-1-'/2
     in call from lists:foldl/3
     in call from yecc:find_action_conflicts/1
     in call from yecc:action_conflicts/1
     in call from yecc:'-generate/1-fun-8-'/3

When I stumbled on this, I figured It's easy to achieve the intended
behavior without using a separate non-terminal, simply by declaring
the separator as a left- (or right-) associative operator - and the
resulting grammar file compiles normally.

More information about the erlang-bugs mailing list