Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use official JavaCC parser plugin #19

Open
asarkar opened this issue Dec 13, 2022 · 0 comments
Open

Use official JavaCC parser plugin #19

asarkar opened this issue Dec 13, 2022 · 0 comments

Comments

@asarkar
Copy link

asarkar commented Dec 13, 2022

ph-javacc-maven-plugin depends on ParserGeneratorCC which says:

This fork is not really actively maintained, except some severe problems arise

OOTB, ph-javacc-maven-plugin generates code differently than JavaCC 7.0.10. For example:

  1. The methods in the parser are generated with the static keyword, but they reference generic parameters from the class definition. This causes hundreds of compilation errors similar to the one below:
non-static type variable POS cannot be referenced from a static context
static final public List<StringPos<POS>> LabelOrRelTypes() throws ParseException {List<StringPos<POS>> labels = new ArrayList<>();

This is fixed by passing STATIC=false during code generation.

  1. Class CypherCharStream implements generated interface CharStream, but some of the methods differ in case. For example, Done is implemented in CypherCharStream as done, so, compilation fails. There are other differences where deprecated (but not removed) methods are not implemented.

CypherCharStream is manually modified to fix these errors.

Why use a plugin that depends on one person and a unmaintained codebase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant