1 15 16 package javassist.compiler.ast; 17 18 import javassist.compiler.CompileError; 19 20 23 public class CondExpr extends ASTList { 24 public CondExpr(ASTree cond, ASTree thenp, ASTree elsep) { 25 super(cond, new ASTList(thenp, new ASTList(elsep))); 26 } 27 28 public ASTree condExpr() { return head(); } 29 30 public void setCond(ASTree t) { setHead(t); } 31 32 public ASTree thenExpr() { return tail().head(); } 33 34 public void setThen(ASTree t) { tail().setHead(t); } 35 36 public ASTree elseExpr() { return tail().tail().head(); } 37 38 public void setElse(ASTree t) { tail().tail().setHead(t); } 39 40 public String getTag() { return "?:"; } 41 42 public void accept(Visitor v) throws CompileError { v.atCondExpr(this); } 43 } 44 | Popular Tags |