I am writing a cup parser for a small language that is supposed to support classes with arrays and matrices as its fields. For example, if there is a class instance:
C c;
the fields are to be accessed with:
c.x;
c.y[];
c.z[][];
I am having trouble writing a production for this last part, because of the shift/reduce conflict I keep getting. This is my production:
Designator ::= IDENT
|
Designator DOT IDENT
|
Designator LSQUARE Expr RSQUARE
|
Designator LSQUARE Expr RSQUARE LSQUARE Expr RSQUARE
;
Warning : * Shift/Reduce conflict found in state #189 between Designator ::= Designator LSQUARE Expr RSQUARE () and Designator ::= Designator LSQUARE Expr RSQUARE () LSQUARE Expr RSQUARE under symbol LSQUARE Resolved in favor of shifting.
Can anyone help me solve this?