2dbf459e18b28ac51b005eb03a1aed2207e1f28c
[IRC.git] / Robust / src / IR / Tree / IfStatementNode.java
1 package IR.Tree;
2
3 class IfStatementNode extends BlockStatementNode {
4     ExpressionNode cond;
5     BlockNode true_st;
6     BlockNode else_st;
7     
8     public IfStatementNode(ExpressionNode cond, BlockNode true_st, BlockNode else_st) {
9         this.cond=cond;
10         this.true_st=true_st;
11         this.else_st=else_st;
12     }
13     
14     public String printNode(int indent) {
15         if (else_st==null)
16             return "if("+cond.printNode(indent)+") "+true_st.printNode(indent);
17         else 
18             return "if("+cond.printNode(indent)+") "+true_st.printNode(indent)+" else "+        else_st.printNode(indent);
19     }
20 }