javacc / javaccPlugin

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

Add a new option astDir for the compileJjtree task #35

Closed zosrothko closed 7 years ago

zosrothko commented 7 years ago

Hi John

When building a c++ parser with the javaccPlugin, the compilejJtree does not take into account the user's defined AST node that can be used by the generated grammar. IMO, this is because the c++ source code organization does not follow the implicit rules that exists on the Java side. thus adding a new option as below would help the compileJjtree task to not override/generate the user's defined AST.

compileJjtree {
      astDir someDir
}

There is a user's case here https://github.com/jtb-javacc/EGC. The EG1 generation is ok, while the EG2, EG3, EG4 are not ok.