lib/Tools/unsymbolize
author wenzelm
Sat Jul 25 10:31:27 2009 +0200 (2009-07-25)
changeset 32187 cca43ca13f4f
parent 29143 72c960b2b83e
child 35022 c844b93dd147
permissions -rwxr-xr-x
renamed structure Display_Goal to Goal_Display;
wenzelm@10555
     1
#!/usr/bin/env bash
wenzelm@10026
     2
#
wenzelm@10026
     3
# Author: Markus Wenzel, TU Muenchen
wenzelm@10026
     4
#
wenzelm@10026
     5
# DESCRIPTION: remove unreadable symbol names from sources
wenzelm@10026
     6
wenzelm@10026
     7
wenzelm@10026
     8
## diagnostics
wenzelm@10026
     9
wenzelm@10511
    10
PRG="$(basename "$0")"
wenzelm@10026
    11
wenzelm@10026
    12
function usage()
wenzelm@10026
    13
{
wenzelm@10026
    14
  echo
wenzelm@28650
    15
  echo "Usage: isabelle $PRG [FILES|DIRS...]"
wenzelm@10026
    16
  echo
wenzelm@10026
    17
  echo "  Recursively find .thy/.ML files, removing unreadable symbol names."
wenzelm@10026
    18
  echo "  Note: this is an ad-hoc script; there is no systematic way to replace"
wenzelm@10026
    19
  echo "  symbols independently of the inner syntax of a theory!"
wenzelm@10026
    20
  echo
wenzelm@10026
    21
  echo "  Renames old versions of FILES by appending \"~~\"."
wenzelm@10026
    22
  echo
wenzelm@10026
    23
  exit 1
wenzelm@10026
    24
}
wenzelm@10026
    25
wenzelm@10026
    26
wenzelm@10026
    27
## process command line
wenzelm@10026
    28
wenzelm@10026
    29
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
wenzelm@10026
    30
wenzelm@10026
    31
SPECS="$@"; shift "$#"
wenzelm@10026
    32
wenzelm@10026
    33
wenzelm@10026
    34
## main
wenzelm@10026
    35
wenzelm@10026
    36
find $SPECS \( -name \*.ML -o -name \*.thy \) -print | \
wenzelm@26576
    37
  xargs perl -w "$ISABELLE_HOME/lib/scripts/unsymbolize.pl"