This repository was archived by the owner on Nov 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
166 lines (139 loc) · 5.56 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
160
161
162
163
164
165
166
<?xml version="1.0" encoding="UTF-8"?>
<project name="MJCompiler" default="test.all" basedir=".">
<property name="output.dir" value="${basedir}/out/production/MJCompiler" />
<property name="spec.dir" value="spec" />
<property name="source.dir" value="src" />
<path id="library.cup_v10k.classpath">
<pathelement location="${basedir}/lib/cup_v10k.jar" />
</path>
<path id="library.log4j-1.2.17.classpath">
<pathelement location="${basedir}/lib/log4j-1.2.17.jar" />
</path>
<path id="library.symboltable-1-1.classpath">
<pathelement location="${basedir}/lib/symboltable-1-1.jar" />
</path>
<path id="library.mj-runtime-1.1.classpath">
<pathelement location="${basedir}/lib/mj-runtime-1.1.jar" />
</path>
<path id="sourcepath">
<dirset dir="${basedir}">
<include name="${source.dir}" />
</dirset>
</path>
<path id="classpath">
<pathelement location="${output.dir}" />
<path refid="library.log4j-1.2.17.classpath" />
<path refid="library.cup_v10k.classpath" />
<path refid="library.symboltable-1-1.classpath" />
<path refid="library.mj-runtime-1.1.classpath" />
</path>
<target name="clean.obj">
<delete file="${basedir}/test/program.obj" />
</target>
<target name="clean.logs">
<delete includeemptydirs="true" dir="${basedir}/logs" />
</target>
<target name="clean.build">
<delete includeemptydirs="true" dir="${basedir}/out" />
</target>
<target name="clean.lexer">
<delete file="${source.dir}/rs/ac/bg/etf/pp1/MJLexer.java" />
</target>
<target name="clean.parser">
<delete includeemptydirs="true">
<fileset dir="${source.dir}/rs/ac/bg/etf/pp1/ast" erroronmissingdir="false" />
<filelist dir="${source.dir}/rs/ac/bg/etf/pp1">
<file name="MJParser.java" />
<file name="sym.java" />
</filelist>
<filelist dir="${spec.dir}">
<file name="mjparser_astbuild.cup" />
</filelist>
</delete>
</target>
<target name="clean.all" depends="clean.obj,clean.logs,clean.build,clean.lexer,clean.parser" />
<target name="generate.lexer" depends="clean.lexer">
<java jar="lib/JFlex.jar" fork="true">
<arg value="-d" />
<arg value="${source.dir}/rs/ac/bg/etf/pp1" />
<arg value="${spec.dir}/mjlexer.flex" />
</java>
</target>
<target name="generate.parser" depends="clean.parser">
<java jar="lib/cup_v10k.jar" fork="true">
<arg value="-destdir" />
<arg value="${source.dir}/rs/ac/bg/etf/pp1" />
<arg value="-ast" />
<arg value="src.rs.ac.bg.etf.pp1.ast" />
<arg value="-parser" />
<arg value="MJParser" />
<!-- <arg value="-dump_states" />-->
<arg value="-buildtree" />
<arg value="${spec.dir}/mjparser.cup" />
</java>
<!-- Replaces all of the references to the old package name in files in the "src" directory -->
<replace dir="${source.dir}" value="rs.ac.bg.etf.pp1.ast" token="src.rs.ac.bg.etf.pp1.ast" summary="true" />
</target>
<target name="generate.all" depends="generate.lexer,generate.parser" />
<target name="build">
<mkdir dir="${output.dir}" />
<javac destdir="${output.dir}" includeantruntime="false">
<src refid="sourcepath" />
<classpath refid="classpath" />
</javac>
</target>
<target name="test.lexer">
<java classname="rs.ac.bg.etf.pp1.test.MJTestRunner" fork="true">
<classpath refid="classpath" />
<arg value="lexer" />
</java>
</target>
<target name="test.parser">
<java classname="rs.ac.bg.etf.pp1.test.MJTestRunner" fork="true">
<classpath refid="classpath" />
<arg value="parser" />
</java>
</target>
<target name="test.semantic">
<java classname="rs.ac.bg.etf.pp1.test.MJTestRunner" fork="true">
<classpath refid="classpath" />
<arg value="semantic" />
</java>
</target>
<target name="test.codegen">
<java classname="rs.ac.bg.etf.pp1.test.MJTestRunner" fork="true">
<classpath refid="classpath" />
<arg value="codegen" />
</java>
</target>
<target name="test.all">
<java classname="rs.ac.bg.etf.pp1.test.MJTestRunner" fork="true">
<classpath refid="classpath" />
</java>
</target>
<target name="disassemble">
<java classname="rs.etf.pp1.mj.runtime.disasm">
<arg value="test/program.obj" />
<classpath>
<pathelement location="lib/mj-runtime-1.1.jar" />
</classpath>
</java>
</target>
<target name="run">
<java classname="rs.etf.pp1.mj.runtime.Run">
<arg value="test/program.obj" />
<classpath>
<pathelement location="lib/mj-runtime-1.1.jar" />
</classpath>
</java>
</target>
<target name="debug">
<java classname="rs.etf.pp1.mj.runtime.Run">
<arg value="-debug" />
<arg value="test/program.obj" />
<classpath>
<pathelement location="lib/mj-runtime-1.1.jar" />
</classpath>
</java>
</target>
</project>