lib/Tools/codegen
author wenzelm
Tue, 21 Oct 2008 20:18:07 +0200
changeset 28650 a7ba12e0d3b7
parent 28502 6b0e3e4e1891
child 28660 54091ba1448f
permissions -rwxr-xr-x
tuned usage line;

#!/usr/bin/env bash
#
# $Id$
# Author: Florian Haftmann, TUM
#
# DESCRIPTION: issue code generation from shell


## diagnostics

PRG="$(basename "$0")"

function usage()
{
  echo
  echo "Usage: isabelle $PRG IMAGE THY CMD"
  echo
  echo "  Issues code generation using image IMAGE,"
  echo "  theory THY,"
  echo "  with Isar command 'export_code CMD'"
  echo
  exit 1
}


## process command line

[ "$#" -lt 2 -o "$1" = "-?" ] && usage

IMAGE="$1"; shift
THY="$1"; shift
CMD="$1"


## main

CMD=$(echo $CMD | sed -e 's/\\/\\\\"/g; s/"/\\\"/g')
FULL_CMD="Code_Target.shell_command \"$THY\" \"$CMD\";"

"$ISABELLE_PROCESS" -q -e "$FULL_CMD" "$IMAGE" || exit 1