Skip to content

Use official JavaCC parser plugin #19

Open

Description

@asarkar

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?

Activity

  1. added a commit that references this issue on May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions