Another rookie question.

I'm getting a shift reduce conflict in my Erlang grammar, similar to the dangling else problem in the Bison manual and I don't seem to be able to solve it using the semantic precedence declarations.

In erlang a macro is written as ?atom or ?atom([arguments])

In my grammar this translates to the rule:
macro
  : WHY ATOM PAREN_BLOCK
  | WHY ATOM
  ;

I've tried solving this by changing this to (using %nonassoc because I couldn't find any evidence of the %precedence declaration existing in semantic):
%nonassoc PARAMETERIZED-MACRO
%nonassoc MACRO
...
%%
macro
  : WHY ATOM PAREN_BLOCK %prec PARAMETERIZED-MACRO
  | WHY ATOM %prec MACRO
  ;

But I still get a warning for a shift/reduce conflict when compiling the grammar. What is the correct way of solving this issue?

Thanks,
Thomas



2013/10/29 David Engster <deng@randomsample.de>
Thomas Järvstrand writes:
> A true rookie mistake :-/

I'm afraid you've left rookie-land quite some time ago when you delved
into the grammar stuff. :-) I had to look this stuff up in the sources
myself, because the Bovine parser appends the location information
automatically...

-David