blob: 86de8560b66e7c6d4267c6c68656ba1070640f66 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/usr/bin/perl
use strict;
open(RBTS,"RedBlackTree.cs") || die "Can't open infile";
rename "RedBlackTreeBag.cs", "RedBlackTreeBag.cs.old" || die "Can't backup";
open(RBTB,">RedBlackTreeBag.cs") || die "Can't open outfile";
my @cond=(1);
my $printing = 1;
#Assume all conditions on BAG symbol is '#if BAG'
while (<RBTS>) {
if (/^#define BAG/) {
print RBTB "#define BAG\r\n";
next;
}
s/TreeSet/TreeBag/g;
print RBTB;
}
close(RBTS) || die "Can't close infile";
close(RBTB) || die "Can't close outfile";
|