lib/Tools/codegen
author wenzelm
Sat, 14 Jun 2008 23:52:51 +0200
changeset 27221 31328dc30196
parent 27103 d8549f4d900b
child 28142 cf8da9bbc584
permissions -rwxr-xr-x
proper context for tactics derived from res_inst_tac;

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


## diagnostics

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

function usage()
{
  echo
  echo "Usage: $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="CodeTarget.shell_command \"$THY\" \"$CMD\";"

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