I am using bison to write a parser to a C-like grammar, but I'm having problem in variable declaration.
My variables can be simples variable, arrays or structs, so I can have a variable like a.b[3].c.
I have the following rule:
var : NAME /* NAME is a string */
| var '[' expr ']'
| var '.' var
;
which are giving me a shift/reduce conflict, but I can't think of a way to solve this.
How can I rewrite the grammar or use Bison precedence to resolve the problem?