lib/Tools/fixdatatype
author wenzelm
Wed Nov 22 21:41:39 2000 +0100 (2000-11-22)
changeset 10511 efb3428c9879
parent 9788 df671fa2562a
child 10555 2323ec838401
permissions -rwxr-xr-x
tuned;
berghofe@5213
     1
#!/bin/bash
berghofe@5213
     2
#
berghofe@5213
     3
# $Id$
wenzelm@9788
     4
# Author: Markus Wenzel, TU Muenchen
wenzelm@9788
     5
# License: GPL (GNU GENERAL PUBLIC LICENSE)
berghofe@5213
     6
#
berghofe@5213
     7
# DESCRIPTION: adapt theories and proof scripts to new datatype package
berghofe@5213
     8
berghofe@5213
     9
berghofe@5213
    10
## diagnostics
berghofe@5213
    11
wenzelm@10511
    12
PRG="$(basename "$0")"
berghofe@5213
    13
berghofe@5213
    14
function usage()
berghofe@5213
    15
{
berghofe@5213
    16
  echo
berghofe@5213
    17
  echo "Usage: $PRG [FILES|DIRS...]"
berghofe@5213
    18
  echo
berghofe@5213
    19
  echo "  Recursively find .thy/.ML files, adapting them to"
berghofe@5213
    20
  echo "  the new datatype package"
berghofe@5213
    21
  echo
berghofe@5213
    22
  echo "  Renames old versions of FILES by appending \"~~\"."
berghofe@5213
    23
  echo
berghofe@5213
    24
  exit 1
berghofe@5213
    25
}
berghofe@5213
    26
berghofe@5213
    27
berghofe@5213
    28
## process command line
berghofe@5213
    29
wenzelm@9788
    30
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
berghofe@5213
    31
wenzelm@9788
    32
SPECS="$@"; shift "$#"
berghofe@5213
    33
berghofe@5213
    34
berghofe@5213
    35
## main
berghofe@5213
    36
wenzelm@6082
    37
#set by configure
wenzelm@6082
    38
AUTO_PERL=perl
wenzelm@6082
    39
berghofe@5213
    40
find $SPECS \( -name \*.thy -o -name \*.ML \) -print | \
wenzelm@9788
    41
  xargs "$AUTO_PERL" -w "$ISABELLE_HOME/lib/scripts/fixdatatype.pl"