some notes
[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 PRE_SCANNER_FILE=$SPEC_COMPILER_HOME/grammer/pre_scanner.jj
10 GRAMMER_FILE=$SPEC_COMPILER_HOME/grammer/spec_compiler.jj
11 UTIL_FILE=$SPEC_COMPILER_HOME/grammer/util.jj
12
13 PRE_SCANNER_OUTPUT_PATH=$SPEC_COMPILER_HOME/src/edu/uci/eecs/specCompiler/grammerParser/preScanner
14 GRAMMER_OUTPUT_PATH=$SPEC_COMPILER_HOME/src/edu/uci/eecs/specCompiler/grammerParser
15 UTIL_OUTPUT_PATH=$SPEC_COMPILER_HOME/src/edu/uci/eecs/specCompiler/grammerParser/utilParser
16
17 echo "Deleting the old generated java files."
18 rm -r $PRE_SCANNER_OUTPUT_PATH/*
19 rm -r $GRAMMER_OUTPUT_PATH/*
20 rm -r $UTIL_OUTPUT_PATH/*
21
22 mkdir -p $PRE_SCANNER_OUTPUT_PATH
23 mkdir -p $GRAMMER_OUTPUT_PATH
24 mkdir -p $UTIL_OUTPUT_PATH
25
26 java -cp $JAVACC_PATH/javacc.jar javacc -OUTPUT_DIRECTORY=$PRE_SCANNER_OUTPUT_PATH $PRE_SCANNER_FILE
27 java -cp $JAVACC_PATH/javacc.jar javacc -OUTPUT_DIRECTORY=$GRAMMER_OUTPUT_PATH $GRAMMER_FILE
28 java -cp $JAVACC_PATH/javacc.jar javacc -OUTPUT_DIRECTORY=$UTIL_OUTPUT_PATH $UTIL_FILE