You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Michelle Le <mi...@yahoo.com> on 2006/04/04 07:06:56 UTC

Is there an ant version that supports JavaCC 4.0?

To build my code in Java 5, it's required to upgrade JavaCC to 
version 4.0.  I have downloaded JavaCC source and built the JavaCC.zip file.  
I'm having problem when executing javacc from ant build.xml file. ant 
is looking for "COM.sun.labs..." when the source that I have built 
contains "org.javacc" package name.  "COM.sun.labs" is defined in the 
COM_PACKAGE value in the 
C:\Apache-Ant-1.6.5\apache-ant-1.6.5\docs\manual\api\constant-values.html#org.apache.tools.ant.taskdefs.optional.javacc.JavaCC.COM_PACKAGE.  
There is also an ORG_PACKAGE_3_1 defined as "org.javacc".
  My questions are:
   
  1. How do I change my build environment so ant will resolve to the 
"org.javacc" package? OR
  2. How do I change the COM_PACKAGE Constant Field Value in ant so I 
will resolve with "org.javacc" instead of "COM.sun.labs"?
   
  Thank you,
   
  Michelle


		
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1&cent;/min.

Re: Is there an ant version that supports JavaCC 4.0?

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Apr 4, 2006, at 1:06 AM, Michelle Le wrote:

> To build my code in Java 5, it's required to upgrade JavaCC to
> version 4.0.  I have downloaded JavaCC source and built the  
> JavaCC.zip file.
> I'm having problem when executing javacc from ant build.xml file. ant
> is looking for "COM.sun.labs..." when the source that I have built
> contains "org.javacc" package name.  "COM.sun.labs" is defined in the
> COM_PACKAGE value in the
> C:\Apache-Ant-1.6.5\apache-ant-1.6.5\docs\manual\api\constant- 
> values.html#org.apache.tools.ant.taskdefs.optional.javacc.JavaCC.COM_P 
> ACKAGE.
> There is also an ORG_PACKAGE_3_1 defined as "org.javacc".
>   My questions are:
>
>   1. How do I change my build environment so ant will resolve to the
> "org.javacc" package? OR
>   2. How do I change the COM_PACKAGE Constant Field Value in ant so I
> will resolve with "org.javacc" instead of "COM.sun.labs"?


Are you using the latest version of Ant?   I don't recall the  
specifics, but in Lucene we used to use <java> to launch the JavaCC  
program, but I switched it back to <javacc> and all has been well  
with JavaCC 3.2.  I have not tried 4.0 though.  We define a macro to  
launch JavaCC - see http://svn.apache.org/repos/asf/lucene/java/trunk/ 
common-build.xml - like this:

   <macrodef name="invoke-javacc">
     <attribute name="target"/>
     <attribute name="outputDir"/>
     <sequential>
       <mkdir dir="@{outputDir}"/>
       <javacc
           target="@{target}"
           outputDirectory="@{outputDir}"
           debugTokenManager="${javacc.debug.tokenmgr}"
           debugParser="${javacc.debug.parser}"
           debuglookahead="${javacc.debug.lookahead}"
           javacchome="${javacc.home}"
       />
     </sequential>
   </macrodef>

Maybe <javacc> cannot work with JavaCC 4.0 though - its a bit brittle  
under the covers in this regard, last time I looked.

	Erik



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Is there an ant version that supports JavaCC 4.0?

Posted by Dominique Devienne <dd...@gmail.com>.
> To build my code in Java 5, it's required to upgrade JavaCC to
> version 4.0.  I have downloaded JavaCC source and built the JavaCC.zip file.
> I'm having problem when executing javacc from ant build.xml file. ant
> is looking for "COM.sun.labs..." when the source that I have built
> contains "org.javacc" package name.

Have you check whether JavaCC 4 itself provides an Ant task? More and
more external tools like JavaCC are encouraged to develop (and
support!) their own tasks, since 1) Ant's API is stable, 2) it allows
these tasks to evolve when the tool is released rather than when Ant
is released.

I'd encourage you to ask the JavaCC community about Ant support.
Sorry, not an answer to your question ;-) --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org