-
Notifications
You must be signed in to change notification settings - Fork 0
/
run
79 lines (73 loc) · 1.54 KB
/
run
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
#!/bin/bash
#
# run.sh - Driver for the CPSC411 Expression Language 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"
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:\
$JARS"
if [ $# -ne 2 ]; then
cat <<EOF ;
Usage:
run <CMD> file
CMDs:
parse, type, ir, gen, flow, interf, reg, final,
EOF
exit 1;
fi
arg=
pass=$1
shift
export CLASSPATH
while [ 1 -le $# ] ; do
echo "Program: "
cat $1
echo ""
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[Ff]*)
pass=SimFinal ;;
([Ss]im*)
pass=Simulate ;;
([Ll]ive*)
pass=Liveness ;;
([Rr]un* | [Ee]xec*)
pass=Run ;;
(*)
echo "Don't understand $pass";
exit 1;;
esac
echo "$CLASSPATH"
java -cp "$CLASSPATH" driver.D$pass $1 $arg
shift
done