package IR.Tree;
-class LoopNode extends BlockStatementNode {
+public class LoopNode extends BlockStatementNode {
BlockNode initializer;
ExpressionNode condition;
BlockNode update;
this.type=type;
}
+ public BlockNode getInitializer() {
+ return initializer;
+ }
+
+ public ExpressionNode getCondition() {
+ return condition;
+ }
+
+ public BlockNode getUpdate() {
+ return update;
+ }
+
+ public BlockNode getBody() {
+ return body;
+ }
+
public String printNode(int indent) {
if (type==FORLOOP) {
return "for("+initializer.printNode(0)+";"+condition.printNode(0)+
} else throw new Error();
}
+ public int getType() {
+ return type;
+ }
+
+ public int kind() {
+ return Kind.LoopNode;
+ }
}