-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPass2.java
More file actions
83 lines (51 loc) · 1.78 KB
/
Copy pathPass2.java
File metadata and controls
83 lines (51 loc) · 1.78 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
public class Pass2 extends MacroProcessor {
private String newFileContent = "";
private String finalFileContent = "";
private int mdtp;
public void start() {
updateFileContent();
String[] lineContent = newFileContent.split("\\r?\\n");
for(String currentLine : lineContent) {
String[] line = currentLine.split("\\s+");
if(macroNameFoundAt(line)) {
//System.out.println("macro name found " + line[0]);
mdtp = getIndexFromMnt(line[0]);
mdtp++;
prepareALA(line);
String mdtLine = getLineFromMdt(mdtp);
while(!mdtLine.equals("MEND")) {
String[] mdtspace = mdtLine.split("\\s+");
finalFileContent = finalFileContent + mdtspace[0] + " ";
for(int i=1; i<mdtspace.length; i++) {
//System.out.println(mdtspace[i]);
mdtspace[i] = getLineFromAla(Integer.parseInt(mdtspace[i]));
finalFileContent = finalFileContent + mdtspace[i] + " ";
}
//mdtLine = mdtspace.toString();
finalFileContent = finalFileContent + "\n";
mdtLine = getLineFromMdt(++mdtp);
}
initAla();
continue;
}
finalFileContent = finalFileContent + currentLine + "\n";
}
System.out.println("\n\nFinal content of file after processing : \n\n"+finalFileContent);
}
private boolean macroNameFoundAt(String[] line) {
String macroName = "";
macroName = line[0];
if(mntContains(macroName))
return true;
return false;
}
private void updateFileContent() {
String[] temp = getFileContent().split("\\r?\\n");
int i = 0;
while(!temp[i].contains("START"))
i++;
for(;i<temp.length;i++) {
newFileContent = newFileContent + temp[i] + "\n";
}
}
}