src/parser/yc - lemplate

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

  19. : ${GRAMMAR:="Parser.yp"}
  20. # : ${OUTPUT:="../lib/Lemplate/Grammar.pm"}
  21. : ${OUTPUT:="Grammar.pm"}
  22. : ${TEMPLATE:="Grammar.pm.skel"}

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

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