dimanche 25 janvier 2015

Production never reduced - java cup warning


I'm facing this error:



Production "mulop ::= MUL " never reduced


I'm using java cup, and I'm still new to the whole thing.


Grammar looks like this:



Addop = "+" | "‐".
Mulop = "*" | "/" | "%".


and my .cup file looks like this:



terminal PLUS, MINUS, MUL, DIV, MOD ;
non terminal addop, mulop ;

addop ::= PLUS | MINUS ;
mulop ::= MUL | DIV | MOD ;


When I run the file, I get this warning:



Warning : *** Production "mulop ::= MOD " never reduced
Warning : *** Production "mulop ::= DIV " never reduced
Warning : *** Production "mulop ::= MUL " never reduced


Can anyone help with this?





Aucun commentaire:

Enregistrer un commentaire