**** Merged from MCS ****
[mono-project.git] / mcs / class / Mono.C5 / trees / set2bag.pl
blob86de8560b66e7c6d4267c6c68656ba1070640f66
1 #!/usr/bin/perl
3 use strict;
5 open(RBTS,"RedBlackTree.cs") || die "Can't open infile";
7 rename "RedBlackTreeBag.cs", "RedBlackTreeBag.cs.old" || die "Can't backup";
9 open(RBTB,">RedBlackTreeBag.cs") || die "Can't open outfile";
11 my @cond=(1);
12 my $printing = 1;
14 #Assume all conditions on BAG symbol is '#if BAG'
15 while (<RBTS>) {
16 if (/^#define BAG/) {
17 print RBTB "#define BAG\r\n";
18 next;
20 s/TreeSet/TreeBag/g;
21 print RBTB;
24 close(RBTS) || die "Can't close infile";
25 close(RBTB) || die "Can't close outfile";