forked from MarkusEble/Compilerbau25
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathASTCaseListNode.java
More file actions
33 lines (27 loc) · 894 Bytes
/
ASTCaseListNode.java
File metadata and controls
33 lines (27 loc) · 894 Bytes
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
package com.compiler.ast;
import com.compiler.CompileEnvIntf;
import java.io.OutputStreamWriter;
import java.util.List;
public class ASTCaseListNode extends ASTStmtNode {
List<ASTCaseNode> m_caseList;
public ASTCaseListNode(List<ASTCaseNode> caseList) {
m_caseList = caseList;
}
@Override
public void execute(OutputStreamWriter out) {
m_caseList.forEach(caseItem->caseItem.execute(out));
}
@Override
public void print(OutputStreamWriter outStream, String indent) throws Exception {
outStream.write(indent);
outStream.write("ASTCaseListNode\n");
m_caseList.forEach(caseItem -> {
try {
caseItem.print(outStream, indent + " ");
outStream.write("\n");
} catch (final Exception e) {
throw new RuntimeException(e);
}
});
}
}