-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.xml
More file actions
90 lines (81 loc) · 3.41 KB
/
Copy pathbuild.xml
File metadata and controls
90 lines (81 loc) · 3.41 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
79
80
81
82
83
84
85
86
87
88
89
90
<?xml version="1.0" encoding="UTF-8"?>
<project name="MJCompiler" basedir=".">
<target name="clean">
<delete>
<fileset dir="spec">
<exclude name="mjlexer.flex"/>
<exclude name="mjparser.cup"/>
</fileset>
</delete>
<delete>
<fileset dir="src/rs/ac/bg/etf/pp1/">
<exclude name="util/logging/Log4JUtils.java"/>
<exclude name="util/symboltable/SymbolTable.java"/>
<exclude name="util/symboltable/SymbolTableUtils.java"/>
<exclude name="util/symboltable/DumpSymbolTableVisitorWithBool.java"/>
<exclude name="MJLexer.java"/>
<exclude name="sym.java"/>
<exclude name="SemanticAnalyzer.java"/>
<exclude name="CodeGenerator.java"/>
<exclude name="CounterVisitor.java"/>
</fileset>
</delete>
</target>
<target name="make-lexer">
<java jar="lib/JFlex.jar" fork="true">
<arg value="-d"/>
<arg value="src/rs/ac/bg/etf/pp1/"/>
<arg value="spec/mjlexer.flex"/>
</java>
</target>
<target name="make-parser" depends="clean">
<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="-buildtree"/>
<arg value="spec/mjparser.cup"/>
</java>
</target>
<target name="repackage" depends="make-parser">
<!-- 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="disasm">
<java classname="rs.etf.pp1.mj.runtime.disasm">
<arg value="test/04_code_generation_tests/built_in_functions.obj"/>
<classpath>
<pathelement location="lib/mj-runtime-1.1.jar"/>
</classpath>
</java>
</target>
<!-- HOW TO RUN run-obj TARGET: Run main method in Compiler, that will produce .obj file in folder where the input test file is.
After that, CHANGE NAME AND PATH OF OBJ FILE HERE AND IN disasm TARGET and play run-obj,
it will first disassemble the program and then it will show the result of program execution.
Edit: It's better to run disasm.jar and Run.jar from IntelliJ.
-->
<target name="run-obj" depends="disasm">
<java classname="rs.etf.pp1.mj.runtime.Run">
<arg value="test/04_code_generation_tests/built_in_functions.obj"/>
<classpath>
<pathelement location="lib/mj-runtime-1.1.jar"/>
</classpath>
</java>
</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>
-->
</project>