static boolean rightIsStrong(int type1, int type2) { int type1_p = typePrecedence(type1); int type2_p = typePrecedence(type2); return type1_p >= 0 && type2_p >= 0 && type1_p > type2_p; }
static boolean isP_INT(int type) { return typePrecedence(type) == P_INT; }
static boolean rightIsStrong(int type1, int type2) { int type1_p = typePrecedence(type1); int type2_p = typePrecedence(type2); return type1_p >= 0 && type2_p >= 0 && type1_p > type2_p; }
static boolean isP_INT(int type) { return typePrecedence(type) == P_INT; }
int stype = typePrecedence(srcType); int dtype = typePrecedence(destType); if (0 <= stype && stype < 3) op = castOp[stype * 4 + dtype];
int stype = typePrecedence(srcType); int dtype = typePrecedence(destType); if (0 <= stype && stype < 3) op = castOp[stype * 4 + dtype];
protected void arrayAccess(ASTree array, ASTree index) throws CompileError { array.accept(this); int type = exprType; int dim = arrayDim; if (dim == 0) throw new CompileError("bad array access"); String cname = className; index.accept(this); if (typePrecedence(exprType) != P_INT || arrayDim > 0) throw new CompileError("bad array index"); exprType = type; arrayDim = dim - 1; className = cname; }
protected void arrayAccess(ASTree array, ASTree index) throws CompileError { array.accept(this); int type = exprType; int dim = arrayDim; if (dim == 0) throw new CompileError("bad array access"); String cname = className; index.accept(this); if (typePrecedence(exprType) != P_INT || arrayDim > 0) throw new CompileError("bad array index"); exprType = type; arrayDim = dim - 1; className = cname; }
private void atArithBinExpr(Expr expr, int token, int index, int type1) throws CompileError { if (arrayDim != 0) badTypes(expr); int type2 = exprType; if (token == LSHIFT || token == RSHIFT || token == ARSHIFT) if (type2 == INT || type2 == SHORT || type2 == CHAR || type2 == BYTE) exprType = type1; else badTypes(expr); else convertOprandTypes(type1, type2, expr); int p = typePrecedence(exprType); if (p >= 0) { int op = binOp[index + p + 1]; if (op != NOP) { if (p == P_INT && exprType != BOOLEAN) exprType = INT; // type1 may be BYTE, ... bytecode.addOpcode(op); return; } } badTypes(expr); }
private void atArithBinExpr(Expr expr, int token, int index, int type1) throws CompileError { if (arrayDim != 0) badTypes(expr); int type2 = exprType; if (token == LSHIFT || token == RSHIFT || token == ARSHIFT) if (type2 == INT || type2 == SHORT || type2 == CHAR || type2 == BYTE) exprType = type1; else badTypes(expr); else convertOprandTypes(type1, type2, expr); int p = typePrecedence(exprType); if (p >= 0) { int op = binOp[index + p + 1]; if (op != NOP) { if (p == P_INT && exprType != BOOLEAN) exprType = INT; // type1 may be BYTE, ... bytecode.addOpcode(op); return; } } badTypes(expr); }
int type1_p = typePrecedence(type1); int type2_p = typePrecedence(type2);
int type1_p = typePrecedence(type1); int type2_p = typePrecedence(type2);
convertOprandTypes(type1, exprType, expr); int p = typePrecedence(exprType); if (p == P_OTHER || arrayDim > 0) if (token == EQ)
convertOprandTypes(type1, exprType, expr); int p = typePrecedence(exprType); if (p == P_OTHER || arrayDim > 0) if (token == EQ)
else { expr.oprand1().accept(this); int type = typePrecedence(exprType); if (arrayDim > 0) badType(expr);
else { expr.oprand1().accept(this); int type = typePrecedence(exprType); if (arrayDim > 0) badType(expr);
static boolean rightIsStrong(int type1, int type2) { int type1_p = typePrecedence(type1); int type2_p = typePrecedence(type2); return type1_p >= 0 && type2_p >= 0 && type1_p > type2_p; }
static boolean rightIsStrong(int type1, int type2) { int type1_p = typePrecedence(type1); int type2_p = typePrecedence(type2); return type1_p >= 0 && type2_p >= 0 && type1_p > type2_p; }
static boolean rightIsStrong(int type1, int type2) { int type1_p = typePrecedence(type1); int type2_p = typePrecedence(type2); return type1_p >= 0 && type2_p >= 0 && type1_p > type2_p; }
static boolean rightIsStrong(int type1, int type2) { int type1_p = typePrecedence(type1); int type2_p = typePrecedence(type2); return type1_p >= 0 && type2_p >= 0 && type1_p > type2_p; }