javacc / javaccPlugin

A JavaCC plugin for Gradle
MIT License
33 stars 16 forks source link

Add support for JavaCC 8 #53

Closed kpitt closed 1 year ago

kpitt commented 3 years ago

The JavaCC Gradle plugin currently defaults to using JavaCC version 6.1.2, which was released in May 2014, but it allows a different JavaCC version to be selected by setting a dependency for the javacc configuration. This works smoothly up through JavaCC version 7.0.10, at least for Java-only projects:

dependencies {
    javacc 'net.java.dev.javacc:javacc:7.0.10'
}

JavaCC 8 represents a major architectural change, with a "core" front-end and separate "generator" back-ends for each supported target language. JavaCC 8 still needs to be tested to verify if the javacc dependency mechanism for selecting a JavaCC version will work correctly with multiple artifacts. Extensions to the javacc plugin DSL will also be needed to provide full support for target languages other than Java.

zbynek commented 1 year ago

For Java language it seems that it's enough to add the right artifact to the dependencies and pass CODE_GENERATOR to the tool. Implementation: #60 Documentation: https://github.com/javacc/javaccPlugin/commit/1974a55c4c5ea5717a3ea298feca9db3728f5dcf

For other languages: C++ support is a separate issue https://github.com/javacc/javaccPlugin/issues/33, once that's implemented (and if there is demand) we can add more.