1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353
|
<?xml version='1.0' encoding='ISO-8859-1' ?>
<!--
Copyright © 2002 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
California 95054, U.S.A. All rights reserved. Sun Microsystems, Inc. has
intellectual property rights relating to technology embodied in the product
that is described in this document. In particular, and without limitation,
these intellectual property rights may include one or more of the U.S.
patents listed at http://www.sun.com/patents and one or more additional
patents or pending patent applications in the U.S. and in other countries.
U.S. Government Rights - Commercial software. Government users are subject
to the Sun Microsystems, Inc. standard license agreement and applicable
provisions of the FAR and its supplements. Use is subject to license terms.
Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
trademarks of Sun Microsystems, Inc. in the U.S. and other countries. This
product is covered and controlled by U.S. Export Control laws and may be
subject to the export or import laws in other countries. Nuclear, missile,
chemical biological weapons or nuclear maritime end uses or end users, whether
direct or indirect, are strictly prohibited. Export or reexport to countries
subject to U.S. embargo or to entities identified on U.S. export exclusion
lists, including, but not limited to, the denied persons and specially
designated nationals lists is strictly prohibited.
-->
<project name="javacc" default="jar" basedir=".">
<property name="version"
value="4.0">
</property>
<target name="compile" depends="generated-files,classes,javacc-compile,jjtree-compile,jjdoc-compile">
</target>
<target name="generated-files">
<ant antfile="build.xml" target="parser-files"
dir="src/org/javacc/parser">
</ant>
<ant antfile="build.xml" target="tree-files"
dir="src/org/javacc/jjtree">
</ant>
</target>
<target name="classes">
<mkdir dir="classes"/>
</target>
<target name="javacc-compile">
<ant antfile="build.xml" target="compile-nojar"
dir="src/org/javacc/parser">
</ant>
</target>
<target name="jjdoc-compile">
<ant antfile="build.xml" target="compile-nojar"
dir="src/org/javacc/jjdoc">
</ant>
</target>
<target name="jjtree-compile">
<ant antfile="build.xml" target="compile-nojar"
dir="src/org/javacc/jjtree">
</ant>
</target>
<target name="jar" depends="compile">
<antcall target="jar-nocompile">
</antcall>
</target>
<!-- Be careful not to include the test files in the distribution. -->
<target name="jar-nocompile" depends="jar-check" unless="jar.uptodate">
<mkdir dir="bin/lib"/>
<jar jarfile="bin/lib/javacc.jar"
basedir="classes"
compress="true"
excludes="**/*Test.class">
</jar>
</target>
<target name="jar-check">
<uptodate property="jar.uptodate"
targetfile="bin/lib/javacc.jar">
<srcfiles dir="classes"/>
</uptodate>
</target>
<target name="clean">
<delete dir="classes"/>
<delete dir="bin/lib"/>
<delete file="javacc-${version}.*"/>
</target>
<target name="realclean" depends="clean">
<ant antfile="build.xml" target="realclean"
dir="src/org/javacc/parser">
</ant>
<ant antfile="build.xml" target="realclean"
dir="src/org/javacc/jjtree">
</ant>
</target>
<target name="binary-distribution" depends="realclean,jar,test">
<property name="install-name"
value="javacc-${version}">
</property>
<!-- Some problems with preserving permissions to be fixed. So we exec a shell script
<delete dir="dist"/>
<delete file="${install-name}.tar.gz"/>
<delete file="${install-name}.zip"/>
<mkdir dir="dist"/>
<mkdir dir="dist/${install-name}"/>
<copy todir="dist/${install-name}/bin">
<fileset dir="bin"/>
</copy>
<chmod perm="a+x" type="file">
<fileset dir="dist/${install-name}/bin">
<include name="**/javacc"/>
<include name="**/jjdoc"/>
<include name="**/jjtree"/>
</fileset>
</chmod>
<copy todir="dist/${install-name}/doc">
<fileset dir="doc"/>
</copy>
<copy todir="dist/${install-name}/examples">
<fileset dir="examples"/>
</copy>
<tar destfile="${install-name}.tar.gz"
compression="gzip"
basedir="dist">
<tarfileset dir="dist/${install-name}" mode="755">
<include name="dist/${install-name}/bin/javacc"/>
<include name="dist/${install-name}/bin/jjdoc"/>
<include name="dist/${install-name}/bin/jjtree"/>
</tarfileset>
<tarfileset dir="dist/${install-name}">
<include name="dist/${install-name}/**"/>
<exclude name="dist/${install-name}/bin/javacc"/>
<exclude name="dist/${install-name}/bin/jjdoc"/>
<exclude name="dist/${install-name}/bin/jjtree"/>
</tarfileset>
</tar>
<zip destfile="${install-name}.zip"
basedir="dist">
</zip>
<delete dir="dist"/>
-->
<exec executable="./makedist" dir=".">
<arg line="${version}" />
</exec>
</target>
<!-- This target must be run with JUnit's JAR archive in the classpath. This
can best be done by running the command as:
ant -lib lib/junit3.8.1/junit.jar test
For more information why this is necessary, see
http://ant.apache.org/faq.html#delegating-classloader
The test reports may be found in TEST*.txt -->
<target name="test" depends="realclean,jar"
description="run JUnit test cases">
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<pathelement path="classes" />
</classpath>
<batchtest fork="no" todir=".">
<fileset dir="classes">
<include name="**/*Test.*" />
</fileset>
</batchtest>
</junit>
<!-- Generate code for all examples in the distribution. We explicitly use
java and javac and not Ant's built-in JavaCC tasks to make sure that
we use the newly generated JavaCC processor and not something that may
be found in Ant's classpath. -->
<mkdir dir="test.tmp" />
<echo />
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/CORBA-IDL examples/CORBA-IDL/IDL.jj" />
</java>
<javac srcdir="test.tmp/CORBA-IDL" encoding="ISO-8859-1"/>
<echo />
<copy todir="test.tmp/GUIParsing/ParserVersion">
<fileset dir="examples/GUIParsing/ParserVersion">
<include name="*.java" />
</fileset>
</copy>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/GUIParsing/ParserVersion examples/GUIParsing/ParserVersion/CalcInput.jj" />
</java>
<javac srcdir="test.tmp/GUIParsing/ParserVersion" encoding="ISO-8859-1"/>
<echo />
<copy todir="test.tmp/GUIParsing/TokenMgrVersion">
<fileset dir="examples/GUIParsing/TokenMgrVersion">
<include name="*.java" />
</fileset>
</copy>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/GUIParsing/TokenMgrVersion examples/GUIParsing/TokenMgrVersion/CalcInput.jj" />
</java>
<javac srcdir="test.tmp/GUIParsing/TokenMgrVersion" encoding="ISO-8859-1"/>
<echo />
<copy todir="test.tmp/Interpreter">
<fileset dir="examples/Interpreter">
<include name="*.java" />
</fileset>
</copy>
<java fork="true" classname="jjtree" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/Interpreter examples/Interpreter/SPL.jjt" />
</java>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/Interpreter test.tmp/Interpreter/SPL.jj" />
</java>
<javac srcdir="test.tmp/Interpreter" encoding="ISO-8859-1"/>
<echo />
<copy todir="test.tmp/JJTreeExamples.eg1">
<fileset dir="examples/JJTreeExamples">
<include name="*.java" />
<exclude name="eg4DumpVisitor.java" />
<exclude name="ASTMyOtherID.java" />
</fileset>
</copy>
<java fork="true" classname="jjtree" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/JJTreeExamples.eg1 examples/JJTreeExamples/eg1.jjt" />
</java>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/JJTreeExamples.eg1 test.tmp/JJTreeExamples.eg1/eg1.jj" />
</java>
<javac srcdir="test.tmp/JJTreeExamples.eg1" encoding="ISO-8859-1"/>
<echo />
<copy todir="test.tmp/JJTreeExamples.eg2">
<fileset dir="examples/JJTreeExamples">
<include name="*.java" />
<exclude name="eg4DumpVisitor.java" />
<exclude name="ASTMyOtherID.java" />
</fileset>
</copy>
<java fork="true" classname="jjtree" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/JJTreeExamples.eg2 examples/JJTreeExamples/eg2.jjt" />
</java>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/JJTreeExamples.eg2 test.tmp/JJTreeExamples.eg2/eg2.jj" />
</java>
<javac srcdir="test.tmp/JJTreeExamples.eg2" encoding="ISO-8859-1"/>
<echo />
<copy todir="test.tmp/JJTreeExamples.eg3">
<fileset dir="examples/JJTreeExamples">
<include name="*.java" />
<exclude name="eg4DumpVisitor.java" />
<exclude name="ASTMyOtherID.java" />
</fileset>
</copy>
<java fork="true" classname="jjtree" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/JJTreeExamples.eg3 examples/JJTreeExamples/eg3.jjt" />
</java>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/JJTreeExamples.eg3 test.tmp/JJTreeExamples.eg3/eg3.jj" />
</java>
<javac srcdir="test.tmp/JJTreeExamples.eg3" encoding="ISO-8859-1"/>
<echo />
<copy todir="test.tmp/JJTreeExamples.eg4">
<fileset dir="examples/JJTreeExamples">
<include name="*.java" />
</fileset>
</copy>
<java fork="true" classname="jjtree" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/JJTreeExamples.eg4 examples/JJTreeExamples/eg4.jjt" />
</java>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/JJTreeExamples.eg4 test.tmp/JJTreeExamples.eg4/eg4.jj" />
</java>
<javac srcdir="test.tmp/JJTreeExamples.eg4" encoding="ISO-8859-1"/>
<echo />
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/JavaCCGrammar examples/JavaCCGrammar/JavaCC.jj" />
</java>
<javac srcdir="test.tmp/JavaCCGrammar" encoding="ISO-8859-1"/>
<!-- TODO, test cases for JavaGrammars -->
<!-- TODO, test cases for LookAhead -->
<echo />
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/MailProcessing examples/MailProcessing/Digest.jj" />
</java>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/MailProcessing examples/MailProcessing/Faq.jj" />
</java>
<javac srcdir="test.tmp/MailProcessing" encoding="ISO-8859-1"/>
<echo />
<copy todir="test.tmp/Obfuscator">
<fileset dir="examples/Obfuscator">
<include name="*.java" />
</fileset>
</copy>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/Obfuscator examples/Obfuscator/Java1.1.jj" />
</java>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/Obfuscator examples/Obfuscator/IdsFile.jj" />
</java>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/Obfuscator examples/Obfuscator/MapFile.jj" />
</java>
<javac srcdir="test.tmp/Obfuscator" encoding="ISO-8859-1"/>
<!-- TODO, test cases for SimpleExamples -->
<echo />
<copy todir="test.tmp/Transformer">
<fileset dir="examples/Transformer">
<include name="*.java" />
</fileset>
</copy>
<java fork="true" classname="jjtree" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/Transformer examples/Transformer/ToyJava.jjt" />
</java>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/Transformer test.tmp/Transformer/ToyJava.jj" />
</java>
<javac srcdir="test.tmp/Transformer" encoding="ISO-8859-1"/>
<echo />
<copy todir="test.tmp/VTransformer">
<fileset dir="examples/VTransformer">
<include name="*.java" />
</fileset>
</copy>
<java fork="true" classname="jjtree" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/VTransformer examples/VTransformer/Java1.1.jjt" />
</java>
<java fork="true" classname="javacc" classpath="bin/lib/javacc.jar">
<arg line="-OUTPUT_DIRECTORY=test.tmp/VTransformer test.tmp/VTransformer/Java1.1.jj" />
</java>
<javac srcdir="test.tmp/VTransformer" encoding="ISO-8859-1"/>
</target>
</project>
|