shift/reduce Error with Cup <p>Hi i am writing a Parser for a Programming language my university uses, with jflex and Cup I started with just the first basic structures such as Processes an Variable Declarations.</p> <p>I get the following Errors</p> <pre><code> Warning : *** Shift/Reduce conflict found in state #4 between vardecls ::= (*) and vardecl ::= (*) IDENT COLON vartyp SEMI and vardecl ::= (*) IDENT COLON vartyp EQEQ INT SEMI under symbol IDENT Resolved in favor of shifting. Warning : *** Shift/Reduce conflict found in state #2 between vardecls ::= (*) and vardecl ::= (*) IDENT COLON vartyp SEMI and vardecl ::= (*) IDENT COLON vartyp EQEQ INT SEMI under symbol IDENT Resolved in favor of shifting. </code></pre> <p>My Code in Cup looks like this : </p> <pre><code>non terminal programm; non terminal programmtype; non terminal vardecl; non terminal vardecls; non terminal processdecl; non terminal processdecls; non terminal vartyp; programm ::= programmtype:pt vardecls:vd processdecls:pd {: RESULT = new SolutionNode(pt, vd, pd); :} ; programmtype ::= IDENT:v {: RESULT = ProblemType.KA; :} ; vardecls ::= vardecl:v1 vardecls:v2 {: v2.add(v1); RESULT = v2; :} | {: ArrayList&lt;VarDecl&gt; list = new ArrayList&lt;VarDecl&gt;() ; RESULT = list; :} ; vardecl ::= IDENT:id COLON vartyp:vt SEMI {: RESULT = new VarDecl(id, vt); :} | IDENT:id COLON vartyp:vt EQEQ INT:i1 SEMI {: RESULT = new VarDecl(id, vt, i1); :} ; vartyp ::= INTEGER {: RESULT = VarType.Integer ; :} ; processdecls ::= processdecl:v1 processdecls:v2 {: v2.add(v1); RESULT = v2; :} | {: ArrayList&lt;ProcessDecl&gt; list = new ArrayList&lt;ProcessDecl&gt;() ; RESULT = list; :} ; processdecl ::= IDENT:id COLON PROCESS vardecls:vd BEGIN END SEMI {: RESULT = new ProcessDecl(id, vd); :} ; </code></pre> <p>I Guess i get the Errors because the Process Declaration and the VariableDeclaration both start with Identifiers then a ":" and then either the Terminal PROCESS or a Terminal like INTEGER. If so i'd like to know how i can tell my Parser to look ahead a bit more. Or whatever Solution is possible.</p> <p>Thanks for your answers.</p>