Skip to content
Snippets Groups Projects
Commit 32159b5b authored by lucien.noel's avatar lucien.noel
Browse files

commit init

parents
Branches
No related tags found
No related merge requests found
File added
File added
File added
run.sh 0 → 100755
#!/usr/bin/env bash
CUPLIB=lib/java-cup-11a.jar
CLASSPATH=$CUPLIB:TDS:ArbreAbstrait:Visitors:.
if [ "$1" = "source" ]; then
SOURCECODE=$(java -classpath $CLASSPATH Hepial $2 gensourcecode 2>&1)
echo "$SOURCECODE"
fi
BYTECODE=$(java -classpath $CLASSPATH Hepial $2 genbytecode 2>&1)
if [ "$1" = "bytecode" ]; then
echo "$BYTECODE"
exit 0
fi
if [ "$1" = "run" ]; then
#Check if there is not semantic issue and so if the bytecode have been generated
if [ `echo $BYTECODE | grep -c ".class" ` -gt 0 ]; then
echo -e "$BYTECODE" | java -jar lib/jasmin.jar -d /tmp /dev/stdin > /dev/null
OUTPUT=$(java -classpath /tmp Program)
echo "$OUTPUT"
else
echo "$BYTECODE"
fi
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment