Related articles |
---|
Problem with build.xml file (using JCUP and JFlex) Martin.Langwieder@freenet.de (SilencerandLois) (2006-04-03) |
From: | "SilencerandLois" <Martin.Langwieder@freenet.de> |
Newsgroups: | comp.compilers |
Date: | 3 Apr 2006 01:39:35 -0400 |
Organization: | http://groups.google.com |
Keywords: | Java, question |
Posted-Date: | 03 Apr 2006 01:39:35 EDT |
Hallo togehter,
i hope that i am posting in the right forum...
I have written a build.xml file. The use for it is to compile the files
Scanner.flex, Parser.cup and the created java source code files
automatically.
With linux it works; on my own laptop i am using windows xp, and with
this os it doesn't work......
Has someone of you an idea, why there is that problem?? I think it has
to do with JCUP, because i'm getting a error message from it...
Here is the build.xml file:
<?xml version="1.0"?>
<project name="Compiler" default="compile" basedir=".">
<property name="java" location="java"/>
<property name="classes" location="classes"/>
<property name="dist" location="dist"/>
<property name="lib" location="lib"/>
<property name="cup" location="cup"/>
<property name="src" location="src"/>
<property name="flex" location="flex"/>
<path id="binaries">
<pathelement location="${lib}"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
<pathelement path="${java.class.path}"/>
</path>
<taskdef name="jflex" classname="JFlex.anttask.JFlexTask"
classpathref="binaries"/>
<taskdef name="cup" classname="java_cup.anttask.CUPTask"
classpathref="binaries"/>
<path id="libraries">
<pathelement location="${lib}"/>
<fileset dir="${lib}">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
<pathelement path="${java.class.path}"/>
</path>
<target name="init">
<mkdir dir="${classes}"/>
<mkdir dir="${dist}"/>
<mkdir dir="${java}"/>
</target>
<target name="jflex" depends="cup">
<jflex file="${flex}/Scanner.jflex" destdir="${java}"/>
</target>
<target name="cup" depends="init">
<cup srcfile="${cup}/Parser.cup" destdir="${java}"
interface="true"/>
</target>
<target name="copy_src" depends="jflex">
<copy todir="${java}">
<fileset dir="${src}" includes="**/**.java"/>
</copy>
</target>
<target name="compile" depends="copy_src">
<javac srcdir="${java}" destdir="${classes}">
<classpath refid="libraries"/>
</javac>
</target>
<target name="dist" depends="compile">
<jar jarfile="${dist}/compiler.jar" basedir="${classes}">
<manifest>
<attribute name="Main-Class"
value="org.linuxfreck.irg.parser"/>
</manifest>
</jar>
</target>
<target name="run" depends="dist">
<java jar="${dist}/compiler.jar" fork="true">
<classpath refid="binaries" />
</java>
</target>
<target name="clean">
<delete dir="${java}" />
<delete dir="${dist}"/>
<delete dir="${classes}"/>
</target>
</project>
And here is my error message:
Buildfile: F:\Uni\SS_06 (NZ)\Compiler Building\workspace\Compiler
Building\build.xml
init:
cup:
[cup] This is CUP v0.10k TUM Edition 20050516
[cup] Authors : Scott E. Hudson, Frank Flannery, Andrea Flexeder,
Michael Petter and C. Scott Ananian
[cup] Bugreports to petter@cs.tum.edu
[cup] checking, whether this run is necessary
[cup] Either Parserfile or Symbolfile didn't exist
[cup] Parserfile F:\Uni\SS_06 (NZ)\Compiler
Building\workspace\Compiler Building\java\parser.java isn't actual
[cup] Symbolfile F:\Uni\SS_06 (NZ)\Compiler
Building\workspace\Compiler Building\java\sym.java isn't actual
[cup] java.lang.NoClassDefFoundError: java_cup/Main
[cup] Exception in thread "main"
BUILD FAILED
F:\Uni\SS_06 (NZ)\Compiler Building\workspace\Compiler
Building\build.xml:37: Java returned: 1
Would be happy, if someone of you has an idea...
Regards,
Martin
P.S.: One more thing:
if i compile eacht files on my own, it works perfecly on linux AND
Windows XP....
Return to the
comp.compilers page.
Search the
comp.compilers archives again.