lib/Tools/codegen
author wenzelm
Thu, 05 Mar 2009 15:27:07 +0100
changeset 30284 907da436f8a9
parent 30242 aea5d7fa7ef5
child 30494 c150e6fa4e0d
permissions -rwxr-xr-x
eliminated Consts.eq_consts tuning -- this is built into tables and name spaces already;

#!/usr/bin/env bash
#
# 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

THY=$(echo $THY | sed -e 's/\\/\\\\"/g; s/"/\\\"/g')
ISAR="theory Codegen imports \"$THY\" begin export_code $CMD end"

echo "$ISAR" | "$ISABELLE_PROCESS" -I "$IMAGE"
exit ${PIPESTATUS[1]}