Problem with build.xml file (using JCUP and JFlex)

"SilencerandLois" <>
3 Apr 2006 01:39:35 -0400

          From comp.compilers

Related articles
Problem with build.xml file (using JCUP and JFlex) (SilencerandLois) (2006-04-03)
| List of all articles for this month |

From: "SilencerandLois" <>
Newsgroups: comp.compilers
Date: 3 Apr 2006 01:39:35 -0400
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
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"/>
        <pathelement path="${java.class.path}"/>
    <taskdef name="jflex" classname="JFlex.anttask.JFlexTask"
    <taskdef name="cup" classname="java_cup.anttask.CUPTask"
    <path id="libraries">
        <pathelement location="${lib}"/>
        <fileset dir="${lib}">
            <include name="**/*.jar"/>
            <include name="**/*.zip"/>
        <pathelement path="${java.class.path}"/>
    <target name="init">
        <mkdir dir="${classes}"/>
        <mkdir dir="${dist}"/>
        <mkdir dir="${java}"/>
    <target name="jflex" depends="cup">
        <jflex file="${flex}/Scanner.jflex" destdir="${java}"/>
    <target name="cup" depends="init">
        <cup srcfile="${cup}/Parser.cup" destdir="${java}"
    <target name="copy_src" depends="jflex">
        <copy todir="${java}">
            <fileset dir="${src}" includes="**/**.java"/>
    <target name="compile" depends="copy_src">
        <javac srcdir="${java}" destdir="${classes}">
            <classpath refid="libraries"/>
    <target name="dist" depends="compile">
        <jar jarfile="${dist}/compiler.jar" basedir="${classes}">
                <attribute name="Main-Class"
    <target name="run" depends="dist">
        <java jar="${dist}/compiler.jar" fork="true">
         <classpath refid="binaries" />
    <target name="clean">
        <delete dir="${java}" />
        <delete dir="${dist}"/>
        <delete dir="${classes}"/>

And here is my error message:

Buildfile: F:\Uni\SS_06 (NZ)\Compiler Building\workspace\Compiler
            [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
            [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\ isn't actual
            [cup] Symbolfile F:\Uni\SS_06 (NZ)\Compiler
Building\workspace\Compiler Building\java\ isn't actual
            [cup] java.lang.NoClassDefFoundError: java_cup/Main
            [cup] Exception in thread "main"

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...


P.S.: One more thing:
if i compile eacht files on my own, it works perfecly on linux AND
Windows XP....

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.