lib/Tools/unsymbolize
author wenzelm
Tue, 24 Jul 2007 19:44:32 +0200
changeset 23961 9e7e1e309ebd
parent 15847 c05c7670f166
child 26576 fc76b7b79ba9
permissions -rwxr-xr-x
Multithreading in Poly/ML (version 5.1).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10555
2323ec838401 /usr/bin/env bash;
wenzelm
parents: 10511
diff changeset
     1
#!/usr/bin/env bash
10026
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     2
#
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     3
# $Id$
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     4
# Author: Markus Wenzel, TU Muenchen
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     5
#
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     6
# DESCRIPTION: remove unreadable symbol names from sources
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     7
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     8
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     9
## diagnostics
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    10
10511
wenzelm
parents: 10026
diff changeset
    11
PRG="$(basename "$0")"
10026
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    12
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    13
function usage()
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    14
{
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    15
  echo
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    16
  echo "Usage: $PRG [FILES|DIRS...]"
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    17
  echo
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    18
  echo "  Recursively find .thy/.ML files, removing unreadable symbol names."
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    19
  echo "  Note: this is an ad-hoc script; there is no systematic way to replace"
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    20
  echo "  symbols independently of the inner syntax of a theory!"
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    21
  echo
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    22
  echo "  Renames old versions of FILES by appending \"~~\"."
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    23
  echo
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    24
  exit 1
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    25
}
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    26
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    27
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    28
## process command line
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    29
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    30
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    31
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    32
SPECS="$@"; shift "$#"
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    33
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    34
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    35
## main
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    36
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    37
#set by configure
15847
c05c7670f166 restored AUTO_BASH/PERL -- beware of ./configure!
wenzelm
parents: 15574
diff changeset
    38
AUTO_PERL=perl
10026
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    39
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    40
find $SPECS \( -name \*.ML -o -name \*.thy \) -print | \
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    41
  xargs "$AUTO_PERL" -w "$ISABELLE_HOME/lib/scripts/unsymbolize.pl"