Another bug fix for inner class code: when trying to find a field in the surrounding...
[IRC.git] / Robust / src / IR / Tree / SwitchLabelNode.java
1 package IR.Tree;
2
3 public class SwitchLabelNode extends BlockStatementNode {
4   ExpressionNode cond;
5   boolean isdefault;
6
7   public SwitchLabelNode(ExpressionNode cond, boolean isdefault) {
8     this.cond = cond;
9     this.isdefault = isdefault;
10   }
11
12   public ExpressionNode getCondition() {
13     return cond;
14   }
15
16   public boolean isDefault() {
17     return this.isdefault;
18   }
19
20   public String printNode(int indent) {
21     if(this.isdefault) {
22       return "case default: ";
23     }
24     return "case " + cond.printNode(indent) + ": ";
25   }
26
27   public int kind() {
28     return Kind.SwitchLabelNode;
29   }
30 }