-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
86 lines (77 loc) · 2.42 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="MJCompiler" default="compile" basedir="">
<target name="delete">
<delete>
<fileset dir="src/rs/ac/bg/etf/pp1">
<exclude name="sym_old.java"/>
<exclude name="util/Log4JUtils.java"/>
<exclude name="Yylex.java"/>
<exclude name="RuleVisitor.java"/>
<exclude name="SemanticAnalyzer.java"/>
<exclude name="SymbolTable.java"/>
<exclude name="CodeGenerator.java"/>
<exclude name="test/Compiler.java"/>
<exclude name="test/CompilerError.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/rs/ac/bg/etf/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/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/mjparser.cup"/>
</java>
</target>
<target name="repackage" depends="parserGen">
<!-- Replaces all of the references to the old package name in files in the "src" directory -->
<replace dir="src" value="rs.ac.bg.etf.pp1.ast" token="src.rs.ac.bg.etf.pp1.ast" summary="true"/>
</target>
<target name="compile" depends="repackage">
<javac srcdir="src/rs/ac/bg/etf/pp1" 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="disasm">
<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="runObj" depends="disasm" >
<java classname="rs.etf.pp1.mj.runtime.Run">
<arg value="test/program.obj"/>
<!-- <arg value="-debug"/>-->
<redirector input="src/test/program.in"/>
<classpath>
<pathelement location="lib/mj-runtime-1.1.jar"/>
</classpath>
</java>
</target>
</project>