Well, it's generating code that won't compile because there is no jjtSetValue
method in the generated ENUM_DECL.java
class. One solution would be to inject such a method into your grammar, something like:
INJECT ENUM_DECL :
{
public void jjtSetValue(String[] values) {....}
}
Also, by the way, name.image
and extending.image
would be a problem, since there is no image
field now. You would just use name.toString()
and extending.toString()
respectively.
But, all that said, I think the real solution to your problem, the real issue here is that in CongoCC, you don't need this jjtSetValue
method anyway. The preferred solution would be to just inject getters for getting the name
and the extending
. You probably want something like:
INJECT ENUM_DECL :
{
public String getName() {
return firstChildOfType(E_ALPHANUM).toString();
}
public String getExtending() {
Node n = firstChildOfType(E_EXTENDS);
return n==null ? null : n.nextSibling().toString();
}
}