-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcheck.sh
47 lines (40 loc) · 1.12 KB
/
check.sh
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
#!/usr/bin/env bash
current=$(cd $(dirname $0) && pwd)
defaultOscFile=$current/examples/cut_out.osc
guiOption=-gui
help() {
echo "USAGE: $0 [-s] [-h] OSC2FilePath"
echo "Examples:"
echo "gui: $0 $PWD/examples/cut_out.osc"
echo "silent(no gui): $0 -s $PWD/examples/cut_out.osc"
echo "help: $0 -h"
}
if [ $# -eq 0 ]; then
help
exit 1;
fi
for arg in "$@"
do
case $arg in
"-s")
guiOption=
;;
"help" | "--help" | "-h"| "-help" | "h")
help
defaultOscFile=
;;
*)
defaultOscFile=$arg
;;
esac
done
AntlrFilePath=$current/ThirdParty/antlr-4.9.1-complete.jar
alias antlr4='java -Xmx500M -cp ".:$AntlrFilePath:$CLASSPATH" org.antlr.v4.Tool'
alias grun='java -Xmx500M -cp ".:$AntlrFilePath:$CLASSPATH" org.antlr.v4.gui.TestRig'
export CLASSPATH=".:$AntlrFilePath:$CLASSPATH"
parserPath=$current/osc2grammar/parser
antlr4 -o $parserPath $current/osc2grammar/OpenSCENARIO2.g4
cd $parserPath
javac OpenSCENARIO2*.java
grun OpenSCENARIO2 osc $guiOption $defaultOscFile
cd $current