1 15 16 package javassist.compiler.ast; 17 18 import javassist.compiler.TokenId; 19 import javassist.compiler.CompileError; 20 21 24 public class CastExpr extends ASTList implements TokenId { 25 protected int castType; 26 protected int arrayDim; 27 28 public CastExpr(ASTList className, int dim, ASTree expr) { 29 super(className, new ASTList(expr)); 30 castType = CLASS; 31 arrayDim = dim; 32 } 33 34 public CastExpr(int type, int dim, ASTree expr) { 35 super(null, new ASTList(expr)); 36 castType = type; 37 arrayDim = dim; 38 } 39 40 42 public int getType() { return castType; } 43 44 public int getArrayDim() { return arrayDim; } 45 46 public ASTList getClassName() { return (ASTList)getLeft(); } 47 48 public ASTree getOprand() { return getRight().getLeft(); } 49 50 public void setOprand(ASTree t) { getRight().setLeft(t); } 51 52 public String getTag() { return "cast:" + castType + ":" + arrayDim; } 53 54 public void accept(Visitor v) throws CompileError { v.atCastExpr(this); } 55 } 56 | Popular Tags |