Failed to create parched parser

I created a parser class for the fixed framework according to this simple example :

package my.package;

import org.parboiled.BaseParser;
import org.parboiled.annotations.BuildParseTree;

@BuildParseTree
public class QueryParser extends BaseParser<Object> {
    //some rules
}

      

If I try to create a parser as shown in the example

QueryParser parser = Parboiled.createParser(QueryParser.class);

      

I am getting an exception on this line:

java.lang.ClassCastException: my.package.QueryParser$$parboiled cannot be cast to org.parboiled.BaseParser
    at org.parboiled.Parboiled.createParser(Parboiled.java:56)
    ...

      

I really am not doing anything special that is not in this example. The only difference is that the parser and the class calling it are in different projects, but I can't imagine why this matters. Dependencies between projects (which are Eclipse plugin projects) should be fine.

Can anyone tell me what I am doing wrong or where the error might be?

+3


source to share


1 answer


In fact, it looks like it has something to do with the launch configurations. I moved all the password-processed matching code into one project and it works. I think I'll keep this, because encapsulation is better anyway.



+1


source







All Articles