add more to spec-compiler.jj
[cdsspec-compiler.git] / run-javacc.sh
1 #!/bin/bash
2
3 if [ -z $SPEC_COMPILER_HOME ]; then
4         SPEC_COMPILER_HOME=~/spec-checker-compiler
5 fi
6
7 JAVACC_PATH=$SPEC_COMPILER_HOME/lib
8
9 OUTPUT_PATH=$SPEC_COMPILER_HOME/src/edu/uci/eecs/specCompiler/grammerParser
10 mkdir -p $OUTPUT_PATH
11
12 GRAMMER_FILE=$SPEC_COMPILER_HOME/grammer/spec-compiler.jj
13
14 if [ -z $1 ]; then
15         echo "Using the default grammer file: $GRAMMER_FILE."
16 else
17         GRAMMER_FILE=$1
18 fi
19
20 echo "Deleting the old generated java files."
21 rm $OUTPUT_PATH/*.java
22 java -cp $JAVACC_PATH/javacc.jar javacc -OUTPUT_DIRECTORY=$OUTPUT_PATH $GRAMMER_FILE