To my eyes (and how I've done it before), this would be two projects. One 
project to create the Parser and jar it. Then the second project would use that 
jar as a dependency and execute the appropriate class during the 
generate-sources phase.

Or you could get a little fancy and have the first project actually generate a 
Maven plugin with the Parser and then bind that plugin appropriately in the 
second project.

Hope that helps.

Chris

> -----Original Message-----
> From: Julien HENRY [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, 16 November, 2006 10:01
> To: [email protected]
> Subject: Generate source code with a JavaCC parser.
> 
> Hi all,
> 
> I want to generate Java code for my project with JavaCC. 
> Actually, it's not JavaCC that generate final source code, 
> but JavaCC will generate a parser that will parse one of the 
> file of my project and generate the expected file.
> 
> To be clearer, I have a Java file named WebTester.java and I 
> want to generate WebTestCase.java. I wrote a JavaCC file 
> (parser.jj) that generate a Parser.java. Once compiled, 
> Parser.class will take WebTester.java and output WebTestCase.java.
> 
> How can I integrate this in my build? I know the 
> maven-javacc-plugin, but it's not exactly what I want. 
> Indeed, the plugin create Parser.java from parser.jj and add 
> it to the Maven build directory, but it doesn't provide a way 
> to run the parser before compile phase.
> I'm considering using ant to compile/run Parser.java before 
> the compile phase, but it's ugly. Do you know a better way?
> 
> Thanks
> 
> Julien
> 
> 
> 
> 
>       
> 
>       
>               
> ______________________________________________________________
> _____________
> Découvrez une nouvelle façon d'obtenir des réponses à toutes 
> vos questions ! 
> Profitez des connaissances, des opinions et des expériences 
> des internautes sur Yahoo! Questions/Réponses 
> http://fr.answers.yahoo.com
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to