-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun
More file actions
executable file
·82 lines (68 loc) · 1.57 KB
/
Copy pathrun
File metadata and controls
executable file
·82 lines (68 loc) · 1.57 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
#!/bin/bash
#
# run.sh - Driver for the CPSC411 MiniJava Compiler's passes
#
# Author: Norm Hutchinson
# Modified by Ron Garcia, 2016-2017
# Modified by Felipe Banados Schwerter, 2017
PROJECT=.
JARS="$PROJECT/backend/target/backend-1.0-SNAPSHOT.jar:\
$PROJECT/frontend/target/frontend-1.0-SNAPSHOT.jar:\
$PROJECT/ir/target/ir-1.0-SNAPSHOT.jar:\
$PROJECT/opt/target/opt-1.0-SNAPSHOT.jar:\
$PROJECT/x86_64sim/target/x86_64sim-1.0-SNAPSHOT.jar:\
$PROJECT/util/target/util-1.0-SNAPSHOT.jar"
# IntelliJ Build button doesn't create JARs, so use the compiled classes
CLASSPATH="$PROJECT/backend/target/classes:\
$PROJECT/frontend/target/classes:\
$PROJECT/ir/target/classes:\
$PROJECT/opt/target/classes:\
$PROJECT/x86_64sim/target/classes:\
$PROJECT/util/target/classes"
#CLASSPATH="$JARS"
export CLASSPATH
if [ $# -ne 2 ]; then
cat <<EOF ;
Usage:
run <CMD> file
CMDs:
parse, type, ir, gen, sim, flow, live, interf, reg, final,
EOF
exit 1;
fi
echo "Program: $2"
cat $2
echo ""
# Extra argument(s) to drivers
arg=
pass=$1
case $pass in
([Pp]ar*)
pass=Parser ;;
([Ff]low*)
pass=FlowGraph ;;
([Gg]en* | [Cc]ode)
pass=Generate ;;
([Ii]nt*)
pass=Interference ;;
([Rr]eg*)
pass=RegAlloc ;;
([Vv][Rr]eg*)
pass=RegAlloc ; arg=-v;;
([Ff]inal*)
pass=Final ;;
([Tt]ran* | [Ii][Rr]*)
pass=Translate ;;
([Tt]ype* | [Cc]heck*)
pass=TypeChecker ;;
([Ss]im*)
pass=Simulate ;;
([Ll]ive*)
pass=Liveness ;;
# ([Rr]un* | [Ee]xec*)
# pass=Run ;;
(*)
echo "Don't understand $pass";
exit 1;;
esac
java driver.D$pass $2 $arg