start of new file
[IRC.git] / Robust / src / IR / Tree / LoopNode.java
index f387d6c0fdca624e32b04b4eae7d9abc7a8ff96c..d604b1aae6565093e1a34079ece10499ebd46aba 100644 (file)
@@ -1,6 +1,6 @@
 package IR.Tree;
 
-class LoopNode extends BlockStatementNode {
+public class LoopNode extends BlockStatementNode {
     BlockNode initializer;
     ExpressionNode condition;
     BlockNode update;
@@ -26,6 +26,22 @@ class LoopNode extends BlockStatementNode {
        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)+
@@ -38,6 +54,10 @@ class LoopNode extends BlockStatementNode {
        } else throw new Error();
     }
 
+    public int getType() {
+       return type;
+    }
+
     public int kind() {
        return Kind.LoopNode;
     }