I'm getting this exception thrown in my java code when trying to run the file.
Exception in thread "main" java.lang.ExceptionInInitializerError
at DemoLexer.<clinit>(GenLexer.java:309)
at LexerDemo.main(GenLexer.java:325)
Caused by: java.lang.RuntimeException: Uncompilable source code - MH_Lexer.VarAcceptor is not abstract and does not override abstract method dead(int) in GenAcceptor
Lexer> at GenAcceptor.<clinit>(GenLexer.java:14)
... 2 more
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
The issue is that my VarAcceptor
class has a clearly defined and implemented dead(int)
method and that file itself doesn't show any errors, which it otherwise does when you don't implement the methods properly so I don't know how to solve this, seeing that the error makes no sense to me with the method in question being implemented correctly. I have also added the @Override
annotation to the method.
static class VarAcceptor extends GenAcceptor implements DFA {
@Override
boolean dead(int state) {
return 0;
}
}
Interface GenAcceptor:
abstract class GenAcceptor {
abstract String lexClass() ;
abstract int numberOfStates() ;
abstract int nextState (int state, char input) ;
abstract boolean accepting (int state) ;
abstract boolean dead (int state) ;
}