Source

syntactic / parser / build.xml

Diff from to

File parser/build.xml

   <property name="output.classes"        location="output/ant/classes" />
   <property name="output.classes.parser" location="${output.classes}/parser" />
   <property name="output.classes.test"   location="${output.classes}/test" />
-  <property name="output.junit"          location="output/ant/junit"   />
-  <property name="output.dist"           location="output/ant/dist"   />
+  <property name="output.grammar"        location="${output}/grammar" />
+  <property name="output.junit"          location="${output}/junit"   />
+  <property name="output.dist"           location="${output}/dist"    />
 
   <property name="java.parser.package" value="org/adjective/syntactic/parser" />
 
 
   <target name="javacc" >
     <mkdir dir="${output.java}/${java.parser.package}/jj" />
+    <uptodate 
+      property="javacc.uptodate" 
+      srcfile="${output.grammar}/Parser.jj"
+      targetfile="${output.java}/${java.parser.package}/jj/JavaParser.java"
+    />
+    <antcall target="javacc.internal" />
+  </target>
+
+  <target name="javacc.internal" unless="javacc.uptodate">
     <javacc
-        target="${output}/grammar/Parser.jj" 
+        target="${output.grammar}/Parser.jj" 
         outputdirectory="${output.java}/${java.parser.package}/jj" 
         javacchome="${javacc.home}" />
   </target>