lib/Tools/unsymbolize
author wenzelm
Sun, 15 Oct 2000 19:50:35 +0200
changeset 10220 2a726de6e124
parent 10026 dfa85ba2295a
child 10511 efb3428c9879
permissions -rwxr-xr-x
proper symbol markup with \isamath, \isatext; support sub/super scripts:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10026
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     1
#!/bin/bash
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
# License: GPL (GNU GENERAL PUBLIC LICENSE)
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     6
#
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     7
# DESCRIPTION: remove unreadable symbol names from sources
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     8
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
     9
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    10
## diagnostics
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    11
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    12
PRG=$(basename "$0")
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    13
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    14
function usage()
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    15
{
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 "Usage: $PRG [FILES|DIRS...]"
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    18
  echo
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    19
  echo "  Recursively find .thy/.ML files, removing unreadable symbol names."
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    20
  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
    21
  echo "  symbols independently of the inner syntax of a theory!"
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
  echo "  Renames old versions of FILES by appending \"~~\"."
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    24
  echo
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    25
  exit 1
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
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    29
## process command line
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    30
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    31
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    32
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    33
SPECS="$@"; shift "$#"
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    34
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    35
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    36
## main
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    37
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    38
#set by configure
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    39
AUTO_PERL=perl
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    40
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    41
find $SPECS \( -name \*.ML -o -name \*.thy \) -print | \
dfa85ba2295a remove unreadable symbol names from sources;
wenzelm
parents:
diff changeset
    42
  xargs "$AUTO_PERL" -w "$ISABELLE_HOME/lib/scripts/unsymbolize.pl"