public void doNumCast(CtClass type) throws CompileError { if (arrayDim == 0 && !isRefType(exprType)) if (type instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)type; atNumCastExpr(exprType, MemberResolver.descToType(pt.getDescriptor())); } else throw new CompileError("type mismatch"); } }
public void doNumCast(CtClass type) throws CompileError { if (arrayDim == 0 && !isRefType(exprType)) if (type instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)type; atNumCastExpr(exprType, MemberResolver.descToType(pt.getDescriptor())); } else throw new CompileError("type mismatch"); } }
/** * Inserts a cast operator to the return type. * If the return type is void, this does nothing. */ protected void atCastToRtype(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (exprType == VOID || isRefType(exprType) || arrayDim > 0) compileUnwrapValue(returnType, bytecode); else if (returnType instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)returnType; int destType = MemberResolver.descToType(pt.getDescriptor()); atNumCastExpr(exprType, destType); exprType = destType; arrayDim = 0; className = null; } else throw new CompileError("invalid cast"); }
/** * Inserts a cast operator to the return type. * If the return type is void, this does nothing. */ protected void atCastToRtype(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (exprType == VOID || isRefType(exprType) || arrayDim > 0) compileUnwrapValue(returnType, bytecode); else if (returnType instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)returnType; int destType = MemberResolver.descToType(pt.getDescriptor()); atNumCastExpr(exprType, destType); exprType = destType; arrayDim = 0; className = null; } else throw new CompileError("invalid cast"); }
protected void atCastToWrapper(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (isRefType(exprType) || arrayDim > 0) return; // Object type. do nothing. CtClass clazz = resolver.lookupClass(exprType, arrayDim, className); if (clazz instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)clazz; String wrapper = pt.getWrapperName(); bytecode.addNew(wrapper); // new <wrapper> bytecode.addOpcode(DUP); // dup if (pt.getDataSize() > 1) bytecode.addOpcode(DUP2_X2); // dup2_x2 else bytecode.addOpcode(DUP2_X1); // dup2_x1 bytecode.addOpcode(POP2); // pop2 bytecode.addInvokespecial(wrapper, "<init>", "(" + pt.getDescriptor() + ")V"); // invokespecial exprType = CLASS; arrayDim = 0; className = jvmJavaLangObject; } }
protected void atCastToWrapper(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (isRefType(exprType) || arrayDim > 0) return; // Object type. do nothing. CtClass clazz = resolver.lookupClass(exprType, arrayDim, className); if (clazz instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)clazz; String wrapper = pt.getWrapperName(); bytecode.addNew(wrapper); // new <wrapper> bytecode.addOpcode(DUP); // dup if (pt.getDataSize() > 1) bytecode.addOpcode(DUP2_X2); // dup2_x2 else bytecode.addOpcode(DUP2_X1); // dup2_x1 bytecode.addOpcode(POP2); // pop2 bytecode.addInvokespecial(wrapper, "<init>", "(" + pt.getDescriptor() + ")V"); // invokespecial exprType = CLASS; arrayDim = 0; className = jvmJavaLangObject; } }
public void doNumCast(CtClass type) throws CompileError { if (arrayDim == 0 && !isRefType(exprType)) if (type instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)type; atNumCastExpr(exprType, MemberResolver.descToType(pt.getDescriptor())); } else throw new CompileError("type mismatch"); } }
public void doNumCast(CtClass type) throws CompileError { if (arrayDim == 0 && !isRefType(exprType)) if (type instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)type; atNumCastExpr(exprType, MemberResolver.descToType(pt.getDescriptor())); } else throw new CompileError("type mismatch"); } }
public void doNumCast(CtClass type) throws CompileError { if (arrayDim == 0 && !isRefType(exprType)) if (type instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)type; atNumCastExpr(exprType, MemberResolver.descToType(pt.getDescriptor())); } else throw new CompileError("type mismatch"); } }
public void doNumCast(CtClass type) throws CompileError { if (arrayDim == 0 && !isRefType(exprType)) if (type instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)type; atNumCastExpr(exprType, MemberResolver.descToType(pt.getDescriptor())); } else throw new CompileError("type mismatch"); } }
public void doNumCast(CtClass type) throws CompileError { if (arrayDim == 0 && !isRefType(exprType)) if (type instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)type; atNumCastExpr(exprType, MemberResolver.descToType(pt.getDescriptor())); } else throw new CompileError("type mismatch"); } }
/** * Inserts a cast operator to the return type. * If the return type is void, this does nothing. */ protected void atCastToRtype(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (exprType == VOID || isRefType(exprType) || arrayDim > 0) compileUnwrapValue(returnType, bytecode); else if (returnType instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)returnType; int destType = MemberResolver.descToType(pt.getDescriptor()); atNumCastExpr(exprType, destType); exprType = destType; arrayDim = 0; className = null; } else throw new CompileError("invalid cast"); }
/** * Inserts a cast operator to the return type. * If the return type is void, this does nothing. */ protected void atCastToRtype(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (exprType == VOID || isRefType(exprType) || arrayDim > 0) compileUnwrapValue(returnType, bytecode); else if (returnType instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)returnType; int destType = MemberResolver.descToType(pt.getDescriptor()); atNumCastExpr(exprType, destType); exprType = destType; arrayDim = 0; className = null; } else throw new CompileError("invalid cast"); }
/** * Inserts a cast operator to the return type. * If the return type is void, this does nothing. */ protected void atCastToRtype(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (exprType == VOID || isRefType(exprType) || arrayDim > 0) compileUnwrapValue(returnType, bytecode); else if (returnType instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)returnType; int destType = MemberResolver.descToType(pt.getDescriptor()); atNumCastExpr(exprType, destType); exprType = destType; arrayDim = 0; className = null; } else throw new CompileError("invalid cast"); }
/** * Inserts a cast operator to the return type. * If the return type is void, this does nothing. */ protected void atCastToRtype(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (exprType == VOID || isRefType(exprType) || arrayDim > 0) compileUnwrapValue(returnType, bytecode); else if (returnType instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)returnType; int destType = MemberResolver.descToType(pt.getDescriptor()); atNumCastExpr(exprType, destType); exprType = destType; arrayDim = 0; className = null; } else throw new CompileError("invalid cast"); }
/** * Inserts a cast operator to the return type. * If the return type is void, this does nothing. */ protected void atCastToRtype(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (exprType == VOID || isRefType(exprType) || arrayDim > 0) compileUnwrapValue(returnType, bytecode); else if (returnType instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)returnType; int destType = MemberResolver.descToType(pt.getDescriptor()); atNumCastExpr(exprType, destType); exprType = destType; arrayDim = 0; className = null; } else throw new CompileError("invalid cast"); }
protected void atCastToWrapper(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (isRefType(exprType) || arrayDim > 0) return; // Object type. do nothing. CtClass clazz = resolver.lookupClass(exprType, arrayDim, className); if (clazz instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)clazz; String wrapper = pt.getWrapperName(); bytecode.addNew(wrapper); // new <wrapper> bytecode.addOpcode(DUP); // dup if (pt.getDataSize() > 1) bytecode.addOpcode(DUP2_X2); // dup2_x2 else bytecode.addOpcode(DUP2_X1); // dup2_x1 bytecode.addOpcode(POP2); // pop2 bytecode.addInvokespecial(wrapper, "<init>", "(" + pt.getDescriptor() + ")V"); // invokespecial exprType = CLASS; arrayDim = 0; className = jvmJavaLangObject; } }
protected void atCastToWrapper(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (isRefType(exprType) || arrayDim > 0) return; // Object type. do nothing. CtClass clazz = resolver.lookupClass(exprType, arrayDim, className); if (clazz instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)clazz; String wrapper = pt.getWrapperName(); bytecode.addNew(wrapper); // new <wrapper> bytecode.addOpcode(DUP); // dup if (pt.getDataSize() > 1) bytecode.addOpcode(DUP2_X2); // dup2_x2 else bytecode.addOpcode(DUP2_X1); // dup2_x1 bytecode.addOpcode(POP2); // pop2 bytecode.addInvokespecial(wrapper, "<init>", "(" + pt.getDescriptor() + ")V"); // invokespecial exprType = CLASS; arrayDim = 0; className = jvmJavaLangObject; } }
protected void atCastToWrapper(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (isRefType(exprType) || arrayDim > 0) return; // Object type. do nothing. CtClass clazz = resolver.lookupClass(exprType, arrayDim, className); if (clazz instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)clazz; String wrapper = pt.getWrapperName(); bytecode.addNew(wrapper); // new <wrapper> bytecode.addOpcode(DUP); // dup if (pt.getDataSize() > 1) bytecode.addOpcode(DUP2_X2); // dup2_x2 else bytecode.addOpcode(DUP2_X1); // dup2_x1 bytecode.addOpcode(POP2); // pop2 bytecode.addInvokespecial(wrapper, "<init>", "(" + pt.getDescriptor() + ")V"); // invokespecial exprType = CLASS; arrayDim = 0; className = jvmJavaLangObject; } }
protected void atCastToWrapper(CastExpr expr) throws CompileError { expr.getOprand().accept(this); if (isRefType(exprType) || arrayDim > 0) return; // Object type. do nothing. CtClass clazz = resolver.lookupClass(exprType, arrayDim, className); if (clazz instanceof CtPrimitiveType) { CtPrimitiveType pt = (CtPrimitiveType)clazz; String wrapper = pt.getWrapperName(); bytecode.addNew(wrapper); // new <wrapper> bytecode.addOpcode(DUP); // dup if (pt.getDataSize() > 1) bytecode.addOpcode(DUP2_X2); // dup2_x2 else bytecode.addOpcode(DUP2_X1); // dup2_x1 bytecode.addOpcode(POP2); // pop2 bytecode.addInvokespecial(wrapper, "<init>", "(" + pt.getDescriptor() + ")V"); // invokespecial exprType = CLASS; arrayDim = 0; className = jvmJavaLangObject; } }