You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Andreas Gruenhagen <an...@informatik.tu-muenchen.de> on 2001/05/10 18:56:57 UTC

Ant and java_cup

Hello,
I tried to use the parser-generator in my ant-build-File.
But it does not work:
The target looks like:

 <target name="parser"  depends="init">
	<java classname="java_cup.Main" dir="de/TUM/RTS/Parser">
      <arg value=" &lt; functionParser.cup" />
   </java> 
  </target>

But when I run ant I get:

parser:
 
Unrecognized option " < functionParser.cup"
 
Usage: java_cup [options]
  and expects a specification file on standard input.
  Legal options include:
    -package name  specify package generated classes go in [default none]   
......

I think, the problem in this case is: '<' is some kind of a shell command and 
ant does not run whith in a shell. Therefor: How can I echo a file  into stdin
while running ant ?

Thanks

andreas

Re: Ant and java_cup

Posted by Stefan Bodewig <bo...@apache.org>.
Andreas Gruenhagen <an...@informatik.tu-muenchen.de>
wrote:

> The target looks like:
> 
>  <target name="parser"  depends="init">
> 	<java classname="java_cup.Main" dir="de/TUM/RTS/Parser">
>       <arg value=" &lt; functionParser.cup" />
>    </java> 
>  </target>

Redirecting the input is the job of the shell (at least on Unix), you
need to invoke the shell as executable, not java, something like

<exec executable="sh" dir="de/TUM/RTS/Parser">
  <arg value="-c" />
  <arg value="java java_cup.Main &lt; functionParser.cup" />
</exec>

Stefan