#!/bin/sh

SRC="Sample"

java -classpath ---your path to---/JFlex/jflex-1.4.3/lib/JFlex.jar JFlex.Main *.flex
if [ $? = 0 ];then
  java -classpath ---your path to---/java-cup-11a.jar java_cup.Main -parser mjavac -interface *.cup
  if [ $? = 0 ];then
    javac -classpath .:---your path to---/java-cup-11a-runtime.jar Scanner.java sym.java mjavac.java JavaSymbol.java ./symtab/*.java ./type/*.java 
    if [ $? = 0 ]; then
      java -classpath .:---your path to---/java-cup-11a.jar mjavac ./source/$SRC/*.mjava
      if [ $? = 0 ]; then
        cd ./source/$SRC
        llvm.spt
      fi
    fi
  fi
fi
