-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSubProgram.java
More file actions
43 lines (38 loc) · 1.17 KB
/
SubProgram.java
File metadata and controls
43 lines (38 loc) · 1.17 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
import java.util.*;
public enum SubProgram {
PAS, CG, FO, SD, SC;
public static SubProgram parse(String in) {
if (in.equals("Program Address Space")) return PAS;
else if (in.equals("Call Graph")) return CG;
else if (in.equals("File Operations")) return FO;
else if (in.equals("Sensitive Data")) return SD;
else if (in.equals("Source Code")) return SC;
else {
System.err.println("ERROR: Illegal SubProgram type " + in);
System.exit(1);
return PAS;
}
}
public static String toString(SubProgram in) {
switch (in) {
case PAS: return "Program Address Space";
case CG: return "Call Graph";
case FO: return "File Operations";
case SD: return "Sensitive Data";
case SC: return "Source Code";
default:
System.err.println("ERROR: Illegal SubProgram type " + in);
System.exit(1);
return "Unreachable";
}
}
public static List<String> allSubPrograms() {
List<String> all = new ArrayList<>();
all.add("Program Address Space");
all.add("Call Graph");
all.add("File Operations");
all.add("Sensitive Data");
all.add("Source Code");
return all;
}
}