projects
/
repair.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
eada2bd
)
Fixed some bugs...
author
bdemsky
<bdemsky>
Tue, 9 Nov 2004 21:32:38 +0000
(21:32 +0000)
committer
bdemsky
<bdemsky>
Tue, 9 Nov 2004 21:32:38 +0000
(21:32 +0000)
Repair/RepairCompiler/Daikon/Process.java
patch
|
blob
|
history
diff --git
a/Repair/RepairCompiler/Daikon/Process.java
b/Repair/RepairCompiler/Daikon/Process.java
index be8bf00b74a22071989cd6cc6efa9273e4f980a4..23ab79a49de261068882058d101e7ee03ec7b95a 100755
(executable)
--- a/
Repair/RepairCompiler/Daikon/Process.java
+++ b/
Repair/RepairCompiler/Daikon/Process.java
@@
-6,11
+6,13
@@
class Process {
static Hashtable currtable=new Hashtable();
static String declaration;
static Hashtable currtable=new Hashtable();
static String declaration;
+
static void debug(String str) {
System.out.println(str);
}
static public void main(String[] args) {
static void debug(String str) {
System.out.println(str);
}
static public void main(String[] args) {
+ String copy=null;
debug("Opening file:"+args[0]);
BufferedReader br=null;
BufferedWriter bw=null;
debug("Opening file:"+args[0]);
BufferedReader br=null;
BufferedWriter bw=null;
@@
-22,10
+24,10
@@
class Process {
String line=br.readLine();
if (line==null)
break;
String line=br.readLine();
if (line==null)
break;
- String replacewith=line+".elem
[
";
+ String replacewith=line+".elem";
if (replacewith==null)
break;
if (replacewith==null)
break;
- currtable.put(line
+"["
,replacewith);
+ currtable.put(line,replacewith);
}
/* Built table */
}
/* Built table */
@@
-56,12
+58,24
@@
class Process {
for(Iterator it=currtable.keySet().iterator();it.hasNext();) {
String str=(String)it.next();
String replace=(String)currtable.get(str);
for(Iterator it=currtable.keySet().iterator();it.hasNext();) {
String str=(String)it.next();
String replace=(String)currtable.get(str);
+ if (line.endsWith(str))
+ copy=line+"\n";
line=replace(line,str,replace);
}
line=replace(line,str,replace);
}
- }
+ } else
+ if (copy!=null) {
+ if ((count%4)==1)
+ copy+=replace(line,"[","_array[")+"\n";
+ else
+ copy+=line+"\n";
+ }
bw.write(line);
bw.newLine();
count++;
bw.write(line);
bw.newLine();
count++;
+ if (copy!=null&&((count%4)==0)) {
+ bw.write(copy);
+ copy=null;
+ }
} else {
bw.write(line);
bw.newLine();
} else {
bw.write(line);
bw.newLine();
@@
-94,12
+108,19
@@
class Process {
for(Iterator it=currtable.keySet().iterator();it.hasNext();) {
String str=(String)it.next();
String replace=(String)currtable.get(str);
for(Iterator it=currtable.keySet().iterator();it.hasNext();) {
String str=(String)it.next();
String replace=(String)currtable.get(str);
+ if (line.endsWith(str))
+ copy=line+"\n";
line=replace(line,str,replace);
}
line=replace(line,str,replace);
}
- }
+ } else if (copy!=null)
+ copy+=line+"\n";
bw.write(line);
bw.newLine();
count++;
bw.write(line);
bw.newLine();
count++;
+ if (((count%3)==0)&©!=null) {
+ bw.write(copy);
+ copy=null;
+ }
} else {
bw.write(line);
bw.newLine();
} else {
bw.write(line);
bw.newLine();