#!/bin/bash

task="$1"
input="$2"
output="$3"

# recolic: I edited class FuncDef so place target/assignment.jar before chocopy-ref.jar!
classPath="target/assignment.jar:chocopy-ref.jar"

if [[ "$task" = parse ]]; then
    java -cp "$classPath" chocopy.ChocoPy --pass=r --out "$output" "$input"
elif [[ "$task" = type ]]; then
    java -cp "$classPath" chocopy.ChocoPy --pass=.s --out "$output" "$input"
elif [[ "$task" = ass ]]; then
    java -cp "$classPath" chocopy.ChocoPy --pass=.s --dir src/test/data/pa2/sample --test
fi

exit $?


