lib/scripts/fixseq.pl
author wenzelm
Fri, 13 Mar 1998 18:15:14 +0100
changeset 4744 4469d498cd48
parent 4268 90779455c9a7
child 9789 7e5e6c47c0b5
permissions -rw-r--r--
moved addsplits [expand_if] from HOL_basic_ss to HOL_ss;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4268
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     1
#
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     2
# $Id$
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     3
#
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     4
# fixseq.pl - fix references to obsolete Pure/Sequence structure
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     5
#
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     6
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     7
sub fixseq {
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     8
    my ($file) = @_;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
     9
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    10
    open (FILE, $file) || die $!;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    11
    undef $/; $text = <FILE>; $/ = "\n";         # slurp whole file
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    12
    close FILE || die $!;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    13
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    14
    $_ = $text;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    15
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    16
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    17
    s/Sequence\.tl/Seq.tl/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    18
    s/Sequence\.single/Seq.single/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    19
    s/Sequence\.seqof/Seq.make/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    20
    s/Sequence\.seq/Seq.seq/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    21
    s/Sequence\.s_of_list/Seq.of_list/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    22
    s/Sequence\.pull/Seq.pull/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    23
    s/Sequence\.prints/Seq.print/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    24
    s/Sequence\.null/Seq.empty/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    25
    s/Sequence\.maps/Seq.map/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    26
    s/Sequence\.mapp/Seq.mapp/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    27
    s/Sequence\.list_of_s/Seq.list_of/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    28
    s/Sequence\.its_right/Seq.it_right/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    29
    s/Sequence\.interleave/Seq.interleave/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    30
    s/Sequence\.hd/Seq.hd/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    31
    s/Sequence\.flats/Seq.flat/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    32
    s/Sequence\.filters/Seq.filter/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    33
    s/Sequence\.cons/Seq.cons/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    34
    s/Sequence\.chop/Seq.chop/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    35
    s/Sequence\.append/Seq.append/sg;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    36
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    37
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    38
    $result = $_;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    39
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    40
    if ($text ne $result) {
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    41
	print STDERR "fixing $file\n";
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    42
        if (! -f "$file~~") {
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    43
	    rename $file, "$file~~" || die $!;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    44
        }
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    45
	open (FILE, "> $file") || die $!;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    46
	print FILE $result;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    47
	close FILE || die $!;
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    48
    }
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    49
}
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    50
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    51
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    52
## main
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    53
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    54
foreach $file (@ARGV) {
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    55
  eval { &fixseq($file); };
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    56
  if ($@) { print STDERR "*** fixseq $file: ", $@, "\n"; }
90779455c9a7 fix references to obsolete Pure/Sequence structure;
wenzelm
parents:
diff changeset
    57
}