blob: 2c8502537e0476be6a4795bc15c29af9f9f04505 (
plain)
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 ast.nodes;
import java.util.ArrayList;
import ast.types.*;
/**
* Node for `block` statement of the grammar.
* It extends the `RootNode`.
*/
public class BlockNode extends RootNode {
public BlockNode(ArrayList<Node> childs) {
super(childs);
}
@Override
public Type typeCheck() {
return new VoidType();
}
@Override
public String toPrint(String prefix) {
String str = prefix + "Block\n";
prefix += " ";
for (Node child : childs) {
str += child.toPrint(prefix);
}
return str;
}
}
|