Closed jponge closed 9 years ago
Any update on this issue?
Sorry, I am working on this project on my spare time. With the Easter holiday coming, I should be able to release a new version fixing this issue. I had a look at the maven plugin and will provide similar functionality.
Please feel free to provide an example on your setup. My initial plan is to have the custom AST classes sit right where they should be in the sourceSet and to avoid generating matching classes in compileJavacc task.
Regards,
John
On Apr 2, 2015, at 06:02, Julien Ponge notifications@github.com wrote:
Any update on this issue?
— Reply to this email directly or view it on GitHub https://github.com/johnmartel/javaccPlugin/issues/13#issuecomment-88854752.
No worries :-)
We have a setup like that in golo-lang/golo-lang if you want to have a look, where some of the classes are overridden by us.
I solved this problem by adding
// Copying our node classes prevents JJTree from generating its own implementations // of these classes. // It seems that javaccPlugin 2.1.1 will address this issue. task(copyJjtree, type: Copy) { from compileJjtree.inputDirectory into compileJjtree.outputDirectory include '*/.java' } compileJjtree.dependsOn copyJjtree
to 'build.gradle' as a workaround until it is sovled in 'javaccPlugin'.
Regards, Peter
Still no fix in sight?
Fix is coming in slowly, custom AST classes are now supported when they live directly with the JavaCC source code. I'm working on supporting them in the Java sourcesets as well.
Thanks @johnmartel for fixing it. I will shortly try it on eclipse/golo-lang
This plugin generates all classes for JJTree.
It is desirable to let developers write custom AST classes for some JJTree elements.
This plugin should detect and remove generated duplicates, which is the behaviour of the JavaCC Maven plugin.
Otherwise the generated classes and custom classes are in conflict at compilation time, resulting in duplicate class errors.