forked from redmouth/java2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatementTypes.java
More file actions
81 lines (55 loc) · 1.95 KB
/
Copy pathStatementTypes.java
File metadata and controls
81 lines (55 loc) · 1.95 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
package co.deepblue.java2cpp.statement;
import com.github.javaparser.ast.stmt.*;
import java.io.BufferedWriter;
import java.util.HashSet;
import java.util.Set;
/**
* Created by levin on 17-5-10.
*/
public class StatementTypes {
public static Class[] types = {
SynchronizedStmt.class,
ExpressionStmt.class,
IfStmt.class,
ForStmt.class,
ForeachStmt.class,
WhileStmt.class,
SwitchStmt.class,
TryStmt.class,
ThrowStmt.class,
LabeledStmt.class,
ReturnStmt.class
};
public static Set<Class> blockStmtTypes;
public static void registerStatementTypes(Statement statement) {
if (blockStmtTypes == null)
blockStmtTypes = new HashSet<>();
blockStmtTypes.add(statement.getClass());
}
public static void printRegisteredTypes() {
for (Class cls : blockStmtTypes) {
System.out.print(cls + ".class");
System.out.print(", ");
}
}
public static void translateStatement(SynchronizedStmt stmt, BufferedWriter imWriter) {
}
public static void translateStatement(ExpressionStmt stmt, BufferedWriter imWriter) {
}
public static void translateStatement(IfStmt stmt, BufferedWriter imWriter) {
}
public static void translateStatement(ForStmt stmt, BufferedWriter imWriter) {
}
public static void translateStatement(ForeachStmt stmt, BufferedWriter imWriter) {
}
public static void translateStatement(WhileStmt stmt, BufferedWriter imWriter) {
}
public static void translateStatement(SwitchStmt stmt, BufferedWriter imWriter) {
}
public static void translateStatement(TryStmt stmt, BufferedWriter imWriter) {
}
public static void translateStatement(LabeledStmt stmt, BufferedWriter imWriter) {
}
public static void translateStatement(ReturnStmt stmt, BufferedWriter imWriter) {
}
}