lib/Tools/unsymbolize
author paulson
Tue, 02 Feb 2010 09:48:20 +0000
changeset 35503 7bba12c3b7b6
parent 29143 72c960b2b83e
child 35022 c844b93dd147
permissions -rwxr-xr-x
Correction of a tiny error
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
# Author: Markus Wenzel, TU Muenchen
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     4
#
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     5
# DESCRIPTION: remove unreadable symbol names from sources
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     6
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     7
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     8
## diagnostics
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     9
10511
wenzelm
parents: 10026
diff changeset
    10
PRG="$(basename "$0")"
10026
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    11
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    12
function usage()
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    13
{
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    14
  echo
28650
a7ba12e0d3b7 tuned usage line;
wenzelm
parents: 26576
diff changeset
    15
  echo "Usage: isabelle $PRG [FILES|DIRS...]"
10026
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    16
  echo
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    17
  echo "  Recursively find .thy/.ML files, removing unreadable symbol names."
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    18
  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
    19
  echo "  symbols independently of the inner syntax of a theory!"
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    20
  echo
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    21
  echo "  Renames old versions of FILES by appending \"~~\"."
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    22
  echo
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    23
  exit 1
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    24
}
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
## process command line
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    28
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    29
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    30
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    31
SPECS="$@"; shift "$#"
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    32
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    33
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    34
## main
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    35
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    36
find $SPECS \( -name \*.ML -o -name \*.thy \) -print | \
26576
fc76b7b79ba9 removed obsolete AUTO_PERL feature;
wenzelm
parents: 15847
diff changeset
    37
  xargs perl -w "$ISABELLE_HOME/lib/scripts/unsymbolize.pl"