-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
113 lines (103 loc) · 3.2 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="MJCompiler" default="compile" basedir=".">
<target name="delete">
<delete>
<fileset dir="src/pp1/">
<exclude name="util/Log4JUtils.java"/>
<exclude name="Yylex.java"/>
<exclude name="SemanticAnalyzer.java"/>
<exclude name="Colors.java"/>
<exclude name="CodeGenerator.java"/>
<exclude name="ErrorLogger.java"/>
<exclude name="Compiler.java"/>
</fileset>
</delete>
<delete>
<fileset dir="spec">
<exclude name="mjlexer.lex"/>
<exclude name="mjparser.cup"/>
</fileset>
</delete>
</target>
<target name="lexerGen" depends="delete">
<java jar="lib/JFlex.jar" fork="true">
<arg value="-d"/>
<arg value="./src/pp1"/>
<arg value="spec/mjlexer.lex"/>
</java>
</target>
<target name="parserGen" depends="delete">
<java jar="lib/cup_v10k.jar" fork="true">
<arg value="-destdir"/>
<arg value="src/pp1"/>
<arg value="-ast"/>
<arg value="src.pp1.ast"/>
<arg value="-parser"/>
<arg value="MJParser"/>
<arg value="-buildtree"/>
<arg value="spec/mjparser.cup"/>
</java>
</target>
<target name="repackage" depends="parserGen">
<replace dir="src" value="pp1.ast" token="src.pp1.ast" summary="true"/>
</target>
<target name="compile" depends="repackage">
<mkdir dir="bin"/>
<javac srcdir="src/pp1" destdir="bin" includeantruntime="false">
<classpath>
<pathelement path="lib/JFlex.jar"/>
<pathelement path="lib/cup_v10k.jar"/>
<pathelement path="lib/log4j-1.2.17.jar"/>
<pathelement path="lib/symboltable-1-1.jar"/>
<pathelement path="lib/mj-runtime-1.1.jar"/>
</classpath>
</javac>
</target>
<target name="run">
<java classname="pp1.Compiler" fork="true">
<classpath>
<pathelement location="bin"/>
<pathelement path="lib/JFlex.jar"/>
<pathelement path="lib/cup_v10k.jar"/>
<pathelement path="lib/log4j-1.2.17.jar"/>
<pathelement path="lib/symboltable-1-1.jar"/>
<pathelement path="lib/mj-runtime-1.1.jar"/>
</classpath>
</java>
</target>
<target name="disasm" depends="run">
<java classname="rs.etf.pp1.mj.runtime.disasm" fork="true">
<arg value="test/program.obj"/>
<classpath>
<pathelement location="lib/mj-runtime-1.1.jar"/>
</classpath>
</java>
</target>
<target name="debug" depends="disasm">
<java classname="rs.etf.pp1.mj.runtime.Run" fork="true">
<arg value="test/program.obj" />
<arg value="-debug" />
<redirector input="input.txt" />
<classpath>
<pathelement location="lib/mj-runtime-1.1.jar" />
</classpath>
</java>
</target>
<target name="runObj" depends="disasm">
<java classname="rs.etf.pp1.mj.runtime.Run" fork="true">
<arg value="test/program.obj"/>
<redirector input="input.txt"/>
<classpath>
<pathelement location="lib/mj-runtime-1.1.jar"/>
</classpath>
</java>
</target>
<!--
alias c='ant compile'
alias cr='ant compile && ant runObj' # kompajluje projekat, prevodi program.mj i pokrece mjvm
alias r='ant runObj' # pokrece mjvm
alias rr='ant run' # pokrece MJParserTest.java
alias cdd='ant compile && ant debug' # kompajluje projekat, debaguje mjvm
alias d='ant debug' # debaguje mjvm
-->
</project>