-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextensibella
executable file
·83 lines (67 loc) · 3.28 KB
/
extensibella
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
#!/bin/bash
######################################################################
# Initial Set-Up for Extensibella #
######################################################################
#Find the Extensibella home
EXTENSIBELLA_ROOT=$(dirname $(realpath $0))
EXTENSIBELLA_EXAMPLES=${EXTENSIBELLA_ROOT}/exampleEncoding/
EXTENSIBELLA_GENERATED=${EXTENSIBELLA_ROOT}/generated/
EXTENSIBELLA_LIBRARY=${EXTENSIBELLA_ROOT}/stdLib/
#Add generated dirs and example dir to the directories to search
if [ ! -z "${EXTENSIBELLA_ENCODED}" ]; then #non-empty
EXTENSIBELLA_ENCODED=$EXTENSIBELLA_ENCODED:$EXTENSIBELLA_GENERATED
else
EXTENSIBELLA_ENCODED=$EXTENSIBELLA_GENERATED
fi
EXTENSIBELLA_ENCODED=$EXTENSIBELLA_ENCODED:$EXTENSIBELLA_EXAMPLES
######################################################################
# Add Silver as a Generated Location #
######################################################################
SILVER_SCRIPT_LOCATION="$HOME/bin/silver"
#Check if the Silver script exists to find where Silver is installed
if [ -f $SILVER_SCRIPT_LOCATION ]; then
#These next lines stolen from the Silver script
# ~/bin/silver should be a link to somewhere, find out where!
SILVER_EXECUTABLE=$(readlink -f $SILVER_SCRIPT_LOCATION)
#Set Silver's home
SILVER_HOME=${SILVER_EXECUTABLE/support\/bin\/silver/}
#Set the generated directory where language encodings can be found
SILVER_GENERATED=${SILVER_HOME}generated/extensibella/
#Add it to set of locations to search
EXTENSIBELLA_ENCODED=$EXTENSIBELLA_ENCODED:$SILVER_GENERATED
fi
######################################################################
# Add Sterling as a Generated Location #
######################################################################
STERLING_SCRIPT_LOCATION="$HOME/bin/sterling"
#Check if the Sterling script exists to find where it is installed
if [ -f $STERLING_SCRIPT_LOCATION ]; then
#These next lines modified from the Silver script
# ~/bin/sterling should be a link to somewhere, find out where!
STERLING_EXECUTABLE=$(readlink -f $STERLING_SCRIPT_LOCATION)
#Set Sterling's home
STERLING_HOME=${STERLING_EXECUTABLE%"sterling"}
#Set the generated directory where language encodings can be found
STERLING_GENERATED=${STERLING_HOME}generated/extensibella/
#Add it to set of locations to search
EXTENSIBELLA_ENCODED=$EXTENSIBELLA_ENCODED:$STERLING_GENERATED
fi
######################################################################
# Export Extensibella Environment Variables #
######################################################################
export EXTENSIBELLA_GENERATED
export EXTENSIBELLA_LIBRARY
export EXTENSIBELLA_ENCODED
######################################################################
# Run It #
######################################################################
#Location where the jar should be
EXTENSIBELLA_JAR="$EXTENSIBELLA_ROOT/extensibella.jar"
#Check if the jar exists to run
if [ ! -f "$EXTENSIBELLA_JAR" ]; then
echo "Couldn't find Extensibella jar to execute; aborting."
echo "Go build it."
exit 1
fi
#Run it
java -Xmx8G -Xss1G -jar "$EXTENSIBELLA_JAR" $@