private void computeBinExprType(BinExpr expr, int token, int type1) throws CompileError { // arrayDim should be 0. int type2 = exprType; if (token == LSHIFT || token == RSHIFT || token == ARSHIFT) exprType = type1; else insertCast(expr, type1, type2); if (CodeGen.isP_INT(exprType) && exprType != BOOLEAN) exprType = INT; // type1 may be BYTE, ... }
private void computeBinExprType(BinExpr expr, int token, int type1) throws CompileError { // arrayDim should be 0. int type2 = exprType; if (token == LSHIFT || token == RSHIFT || token == ARSHIFT) exprType = type1; else insertCast(expr, type1, type2); if (CodeGen.isP_INT(exprType) && exprType != BOOLEAN) exprType = INT; // type1 may be BYTE, ... }
private void booleanExpr(ASTree expr) throws CompileError { int op = CodeGen.getCompOperator(expr); if (op == EQ) { // ==, !=, ... BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); int type1 = exprType; int dim1 = arrayDim; bexpr.oprand2().accept(this); if (dim1 == 0 && arrayDim == 0) insertCast(bexpr, type1, exprType); } else if (op == '!') ((Expr)expr).oprand1().accept(this); else if (op == ANDAND || op == OROR) { BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); bexpr.oprand2().accept(this); } else // others expr.accept(this); exprType = BOOLEAN; arrayDim = 0; }
private void booleanExpr(ASTree expr) throws CompileError { int op = CodeGen.getCompOperator(expr); if (op == EQ) { // ==, !=, ... BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); int type1 = exprType; int dim1 = arrayDim; bexpr.oprand2().accept(this); if (dim1 == 0 && arrayDim == 0) insertCast(bexpr, type1, exprType); } else if (op == '!') ((Expr)expr).oprand1().accept(this); else if (op == ANDAND || op == OROR) { BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); bexpr.oprand2().accept(this); } else // others expr.accept(this); exprType = BOOLEAN; arrayDim = 0; }
private void computeBinExprType(BinExpr expr, int token, int type1) throws CompileError { // arrayDim should be 0. int type2 = exprType; if (token == LSHIFT || token == RSHIFT || token == ARSHIFT) exprType = type1; else insertCast(expr, type1, type2); if (CodeGen.isP_INT(exprType)) exprType = INT; // type1 may be BYTE, ... }
private void computeBinExprType(BinExpr expr, int token, int type1) throws CompileError { // arrayDim should be 0. int type2 = exprType; if (token == LSHIFT || token == RSHIFT || token == ARSHIFT) exprType = type1; else insertCast(expr, type1, type2); if (CodeGen.isP_INT(exprType)) exprType = INT; // type1 may be BYTE, ... }
private void computeBinExprType(BinExpr expr, int token, int type1) throws CompileError { // arrayDim should be 0. int type2 = exprType; if (token == LSHIFT || token == RSHIFT || token == ARSHIFT) exprType = type1; else insertCast(expr, type1, type2); if (CodeGen.isP_INT(exprType)) exprType = INT; // type1 may be BYTE, ... }
private void computeBinExprType(BinExpr expr, int token, int type1) throws CompileError { // arrayDim should be 0. int type2 = exprType; if (token == LSHIFT || token == RSHIFT || token == ARSHIFT) exprType = type1; else insertCast(expr, type1, type2); if (CodeGen.isP_INT(exprType)) exprType = INT; // type1 may be BYTE, ... }
private void computeBinExprType(BinExpr expr, int token, int type1) throws CompileError { // arrayDim should be 0. int type2 = exprType; if (token == LSHIFT || token == RSHIFT || token == ARSHIFT) exprType = type1; else insertCast(expr, type1, type2); if (CodeGen.isP_INT(exprType)) exprType = INT; // type1 may be BYTE, ... }
private void booleanExpr(ASTree expr) throws CompileError { int op = CodeGen.getCompOperator(expr); if (op == EQ) { // ==, !=, ... BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); int type1 = exprType; int dim1 = arrayDim; bexpr.oprand2().accept(this); if (dim1 == 0 && arrayDim == 0) insertCast(bexpr, type1, exprType); } else if (op == '!') ((Expr)expr).oprand1().accept(this); else if (op == ANDAND || op == OROR) { BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); bexpr.oprand2().accept(this); } else // others expr.accept(this); exprType = BOOLEAN; arrayDim = 0; }
private void booleanExpr(ASTree expr) throws CompileError { int op = CodeGen.getCompOperator(expr); if (op == EQ) { // ==, !=, ... BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); int type1 = exprType; int dim1 = arrayDim; bexpr.oprand2().accept(this); if (dim1 == 0 && arrayDim == 0) insertCast(bexpr, type1, exprType); } else if (op == '!') ((Expr)expr).oprand1().accept(this); else if (op == ANDAND || op == OROR) { BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); bexpr.oprand2().accept(this); } else // others expr.accept(this); exprType = BOOLEAN; arrayDim = 0; }
private void booleanExpr(ASTree expr) throws CompileError { int op = CodeGen.getCompOperator(expr); if (op == EQ) { // ==, !=, ... BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); int type1 = exprType; int dim1 = arrayDim; bexpr.oprand2().accept(this); if (dim1 == 0 && arrayDim == 0) insertCast(bexpr, type1, exprType); } else if (op == '!') ((Expr)expr).oprand1().accept(this); else if (op == ANDAND || op == OROR) { BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); bexpr.oprand2().accept(this); } else // others expr.accept(this); exprType = BOOLEAN; arrayDim = 0; }
private void booleanExpr(ASTree expr) throws CompileError { int op = CodeGen.getCompOperator(expr); if (op == EQ) { // ==, !=, ... BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); int type1 = exprType; int dim1 = arrayDim; bexpr.oprand2().accept(this); if (dim1 == 0 && arrayDim == 0) insertCast(bexpr, type1, exprType); } else if (op == '!') ((Expr)expr).oprand1().accept(this); else if (op == ANDAND || op == OROR) { BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); bexpr.oprand2().accept(this); } else // others expr.accept(this); exprType = BOOLEAN; arrayDim = 0; }
private void booleanExpr(ASTree expr) throws CompileError { int op = CodeGen.getCompOperator(expr); if (op == EQ) { // ==, !=, ... BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); int type1 = exprType; int dim1 = arrayDim; bexpr.oprand2().accept(this); if (dim1 == 0 && arrayDim == 0) insertCast(bexpr, type1, exprType); } else if (op == '!') ((Expr)expr).oprand1().accept(this); else if (op == ANDAND || op == OROR) { BinExpr bexpr = (BinExpr)expr; bexpr.oprand1().accept(this); bexpr.oprand2().accept(this); } else // others expr.accept(this); exprType = BOOLEAN; arrayDim = 0; }