-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
159 lines (143 loc) · 5.66 KB
/
build.xml
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
<project name="MiniT" default="build">
<property name="lib" value="lib" />
<property name="parser.name" value="MiniT" />
<property name="specification.directory" value="specs" />
<property name="icode.specification" value="icodespec" />
<property name="parser.package" value="parser" />
<property name="icode.package" value="icode" />
<property name="parser.directory" value="src/${parser.package}" />
<property name="icode.program" value="test.TestCodeGen" />
<property name="asm.program" value="test.TestIntelGen" />
<property name="dumpTree.program" value="test.TestBuildTree" />
<property name="semantic.program" value="test.TestSemantic" />
<property name="icode.directory" value="src/${icode.package}" />
<taskdef classname="jastadd.JastAddTask"
name="jastadd"
classpath="${lib}/jastadd2.jar" />
<target name="build" depends="icode">
<mkdir dir="${parser.directory}" />
<jastadd package="${parser.package}"
outdir="src"
jjtree="true"
grammar="${parser.name}">
<fileset dir="${specification.directory}">
<include name="*.ast" />
<include name="*.jadd" />
</fileset>
</jastadd>
<jjtree target="${specification.directory}/${parser.name}.jjt"
outputdirectory="${parser.directory}"
javacchome="${lib}"
buildnodefiles="true"
static="false"
multi="true"
nodeprefix='""'
visitor="true"
nodedefaultvoid="true"
nodescopehook="true"
nodepackage="${parser.package}" />
<javacc target="${parser.directory}/${parser.name}.jj"
outputdirectory="${parser.directory}"
javacchome="${lib}"
static="false" />
<antcall target="compile" />
</target>
<target name="icode">
<mkdir dir="${icode.directory}" />
<jastadd package="${icode.package}"
outdir="src">
<fileset dir="${icode.specification}">
<include name="*.ast" />
<include name="*.jadd" />
</fileset>
</jastadd>
</target>
<target name="compile" unless="nocompile">
<javac srcdir="src" destdir="bin" classpath="${lib}/junit.jar" />
</target>
<target name="test_codegen" depends="build" description="Run codegen tests.">
<java classname="org.junit.runner.JUnitCore"
classpath="bin:${lib}/junit.jar">
<arg value="test.TestCodeGen" />
</java>
</target>
<target name="test_intel" depends="build" description="Run intel asm tests.">
<java classname="org.junit.runner.JUnitCore"
classpath="bin:${lib}/junit.jar">
<arg value="test.TestIntelGen" />
</java>
</target>
<target name="test_semantic" depends="build" description="Run semantic tests.">
<java classname="org.junit.runner.JUnitCore"
classpath="bin:${lib}/junit.jar">
<arg value="test.TestSemantic" />
</java>
</target>
<target name="doc"
depends="build"
description="Generate the grammar as html">
<jjdoc target="${parser.directory}/${parser.name}.jj"
javacchome="${lib}" />
</target>
<target name="dump_tree"
depends="build"
description="Creates a dump in the project directory.">
<input message="Target name"
addproperty="target.name"
defaultvalue="example" />
<java classpath="bin"
classname="${dumpTree.program}"
output="${target.name}.tdump">
<arg value="data/${target.name}" />
</java>
<echo>${target.name}.tdump created using ${dumpTree.program}</echo>
</target>
<target name="analyse"
depends="build"
description="Runs semantic anlysis.">
<input message="Target name"
addproperty="target.name"
defaultvalue="example" />
<java classpath="bin"
classname="${semantic.program}"
output="${target.name}.sdump">
<arg value="data/${target.name}" />
</java>
<echo>${target.name}.sdump created using ${semantic.program}</echo>
</target>
<target name="generate_code"
depends="build"
description="Creates iCode.">
<input message="Target name"
addproperty="target.name"
defaultvalue="codeexample" />
<java classpath="bin"
classname="${icode.program}"
output="${target.name}.code">
<arg value="data/${target.name}" />
</java>
<echo>${target.name}.code created using ${icode.program}</echo>
</target>
<target name="generate_asm"
depends="build"
description="Creates intel 32-bit assembler.">
<input message="Target name"
addproperty="target.name"
defaultvalue="example" />
<java classpath="bin"
classname="${asm.program}"
output="${target.name}.s">
<arg value="data/${target.name}" />
</java>
<echo>${target.name}.s created using ${asm.program}</echo>
</target>
<target name="clean" description="Delete generated files.">
<delete dir="${parser.directory}" />
<delete dir="${icode.directory}" />
<delete dir="bin" />
<mkdir dir="bin" />
<delete>
<fileset dir="." includes="*.res" />
</delete>
</target>
</project>