#! /bin/bash

GRAMMARDIR="Source/grammar"

PARSER=parser
SYM=sym
EXPECT=1

NATIVEDIR=`toNative.bash "$GRAMMARDIR"`
CCUPJAR=`toNative.bash "$LIB330/java_cup.jar"`

rm -f "$GRAMMARDIR"/{"$PARSER.java","$SYM.java","$PARSER.states"} "$PARSER.cup.error"

java -jar "$CCUPJAR" \
-nonterms \
-expect $EXPECT \
-progress \
-source "$NATIVEDIR" \
-parser $PARSER \
-symbols $SYM \
-input "$PARSER.cup" \
&> "$PARSER.cup.error"
#	-dump -dumpto "$PARSER.states" \

cat "$PARSER.cup.error"
