-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
78 lines (64 loc) · 3.19 KB
/
Copy pathbuild.xml
File metadata and controls
78 lines (64 loc) · 3.19 KB
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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Compilers" default="compile" basedir=".">
<description>Builds, tests, and runs the project Compilers.</description>
<!--<property name="javacc" location="C:\Program Files (x86)\Java\javacc-5.0"/>-->
<property name="javacc" location="/usr/share/java/javacc-5.0"/>
<property name="yapl" location="testFiles/codeGen/test18.yapl"/>
<property name="ca4.test.dir" location="testFiles/typeCheck"/>
<property name="ca5.test.dir" location="testFiles/codeGen"/>
<property name="mars" location="./Mars_4_2.jar"/>
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="outfile" location="out.asm"/>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
<target name="init">
<mkdir dir="${build}"/>
</target>
<target name="compile-javacc" depends="init" description="Compile all JJ Files">
<javacc target="${src}/yapl/parser/Parser.jj" javacchome="${javacc}" outputdirectory="${src}/yapl/parser"/>
</target>
<target name="compile" depends="compile-javacc" description="Compile all java Classes">
<javac srcdir="${src}" destdir="${build}"/>
</target>
<target name="run" description="runs Compiler Assignment 5" depends="compile">
<java classname="yapl.parser.Parser">
<classpath>
<pathelement location="${build}"/>
<pathelement path="${java.class.path}"/>
</classpath>
<arg file="${yapl}"/>
<arg file="${outfile}"/>
</java>
</target>
<target name="run-mips" description="run mars with the generated output file" depends="run">
<java jar="${mars}" fork="true">
<arg file="${outfile}"/>
</java>
</target>
<target name="run-tests" description="runs all testfiles automatically" depends="compile">
<for param="file">
<path>
<fileset dir="${ca5.test.dir}" includes="*.yapl"/>
</path>
<sequential>
<propertyregex override="yes" property="program" input="@{file}" regexp=".*/([^\.]*)\.yapl" replace="\1"/>
<java classname="yapl.parser.Parser">
<classpath>
<pathelement location="${build}"/>
<pathelement path="${java.class.path}"/>
</classpath>
<arg file="@{file}"/>
</java>
</sequential>
</for>
</target>
<target name="clean" description="Schmeiß olls weg wos wir nit brauchn">
<delete dir="${build}"/>
<delete file="${src}/ca4/yapl/parser/Parser.java" />
<delete file="${src}/ca4/yapl/parser/ParserConstants.java" />
<delete file="${src}/ca4/yapl/parser/ParserTokenManager.java" />
<delete file="${src}/yapl/parser/Parser.java" />
<delete file="${src}/yapl/parser/ParserConstants.java" />
<delete file="${src}/yapl/parser/ParserTokenManager.java" />
</target>
</project>