I am doing a compiler for the tiger language, I am using java CUP for the parser, the problem is that I need to put the following grammar:
prog := exp
| decs
decs := dec*
As dec can be empty in CUP I put it in the following way:
decs := dec decs
| {: RESULT = new Symbol(0);:}
;
but when executing it with an empty file, which should work, I get the following error:
Exception in thread "main" java.lang.NoSuchMethodError: java_cup.runtime.SymbolFactory.newSymbol(Ljava/lang/String;ILjava_cup/runtime/Symbol;Ljava/lang/Object;)Ljava_cup/runtime/Symbol