edits
[cdsspec-compiler.git] / run-javacc.sh
index 308dee7..8965426 100755 (executable)
@@ -1,19 +1,18 @@
 #!/bin/bash
 
-JAVACC_PATH=/home/peizhaoo/spec-checker-compiler/javacc-6.0/bin/lib
+SPEC_COMPILER_HOME=$(pwd)
 
-SRC_PATH=/home/peizhaoo/spec-checker-compiler/src
-OUTPUT_PATH=$SRC_PATH/edu/uci/eecs/specCompiler/grammerParser
-mkdir -p $OUTPUT_PATH
+echo "CDSSpec Compiler home: " $SPEC_COMPILER_HOME
 
-GRAMMER_FILE=$SRC_PATH/../grammer/spec-compiler.jj
+JAVACC_PATH=$SPEC_COMPILER_HOME/lib
 
-if [ -z $1 ]; then
-       echo "Using the default grammer file: $GRAMMER_FILE."
-else
-       GRAMMER_FILE=$1
-fi
+UTIL_FILE=$SPEC_COMPILER_HOME/grammer/util.jj
+
+UTIL_OUTPUT_PATH=$SPEC_COMPILER_HOME/src/edu/uci/eecs/utilParser
 
 echo "Deleting the old generated java files."
-rm $OUTPUT_PATH/*.java
-java -cp $JAVACC_PATH/javacc.jar javacc -OUTPUT_DIRECTORY=$OUTPUT_PATH $GRAMMER_FILE
+rm -rf $UTIL_OUTPUT_PATH/*
+
+mkdir -p $UTIL_OUTPUT_PATH
+
+java -cp $JAVACC_PATH/javacc.jar javacc -OUTPUT_DIRECTORY=$UTIL_OUTPUT_PATH $UTIL_FILE