#!/bin/sh
#========================================================================
#
# yc - yapp compile
#
# This calls 'yapp', distributed with the Parse::Yapp module, to 
# compile the parser grammar and construct the ../Template/Grammar.pm 
# file.  The grammar is defined in ./Parser.yp.  The skeleton file 
# Grammar.pm.skel is used as a template for creating the grammar file.
# An output file 'Parser.output' is generated containing a summary of 
# the rule and state tables.
#
# You only need to run this script if you have changed the grammar and 
# wish to recompile it.
#
# Andy Wardley <abw@kfs.org>
#
#========================================================================

: ${GRAMMAR:="Parser.yp"}
# : ${OUTPUT:="../lib/Jemplate/Grammar.pm"}
: ${OUTPUT:="Grammar.pm"}
: ${TEMPLATE:="Grammar.pm.skel"}

echo "Compiling parser grammar (${GRAMMAR} -> ${OUTPUT})"

yapp -v -s -o ${OUTPUT} -t ${TEMPLATE} ${GRAMMAR}

