X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=Robust%2Fsrc%2FIR%2FTree%2FLoopNode.java;h=d604b1aae6565093e1a34079ece10499ebd46aba;hb=4cb63e913202459da4fe9d01feb7c02f1b98dd6f;hp=f387d6c0fdca624e32b04b4eae7d9abc7a8ff96c;hpb=9b07221c820f886e2698c606a64238d0a9f44438;p=IRC.git diff --git a/Robust/src/IR/Tree/LoopNode.java b/Robust/src/IR/Tree/LoopNode.java index f387d6c0..d604b1aa 100644 --- a/Robust/src/IR/Tree/LoopNode.java +++ b/Robust/src/IR/Tree/LoopNode.java @@ -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; }