Java CUP: Difference between revisions
No edit summary |
mNo edit summary |
||
| Line 33: | Line 33: | ||
Since the code doesn't require 1.5, it might be nice to compile it in a 1.4 compatible format. | Since the code doesn't require 1.5, it might be nice to compile it in a 1.4 compatible format. | ||
[[Category:Java]] | |||
Revision as of 02:35, 1 October 2007
I had to make a few changes to CUP in order for it to work in my environment. I submitted the patches to Michael Petter, but I don't know if they will be included in his next build. So, here's the patches here in case you have to patch this yourself:
java_cup.anttask.CUPTask.java
111,112c111,117
< if (!(new File(srcfile)).exists()) throw new BuildException("Input file not found: srcfile=\""+srcfile+"\" ");
< createArg().setValue(srcfile);
---
> File file = new File(srcfile);
> if (!file.exists()) throw new BuildException("Input file not found: srcfile=\""+srcfile+"\" ");
> try {
> createArg().setValue(file.getCanonicalPath());
> } catch (java.io.IOException e) {
> throw new BuildException("Input file path not found: srcfile=\""+srcfile+"\" ");
> }
166a172
> if (path.startsWith("file:/")) path=path.substring(6);
I changed the compile task to build 1.4 class files:
<target name="compile" depends="jflex">
<copy todir="${java}"><fileset dir="${src}"></fileset></copy>
<javac srcdir="${java}" destdir="${classes}" verbose="off" listfiles="off" debug="on" target="1.4" source="1.4">
<!--compilerarg value="-Xlint:unchecked" /-->
<classpath refid="libraries"/>
</javac>
</target>
Since the code doesn't require 1.5, it might be nice to compile it in a 1.4 compatible format.