Examples of JCastOperation


Examples of com.google.gwt.dev.jjs.ast.JCastOperation

    }

    JExpression processExpression(CastExpression x) {
      SourceInfo info = makeSourceInfo(x);
      JType type = (JType) typeMap.get(x.resolvedType);
      JCastOperation cast = new JCastOperation(program, info, type,
          dispProcessExpression(x.expression));
      return cast;
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JCastOperation

    private JExpression maybeCast(JType expected, JExpression expression) {
      if (expected != expression.getType()) {
        // Must be a generic; insert a cast operation.
        JReferenceType toType = (JReferenceType) expected;
        return new JCastOperation(program, expression.getSourceInfo(), toType,
            expression);
      } else {
        return expression;
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JCastOperation

      /*
       * Insert an implicit cast if the types differ; it might get optimized out
       * later, but in some cases it will force correct math evaluation.
       */
      if (clone.getType() != x.getType()) {
        clone = new JCastOperation(program, clone.getSourceInfo(), x.getType(),
            clone);
      }
      ctx.replaceMe(clone);
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JCastOperation

        if (coerced != null) {
          return coerced;
        }
      }
      // Synthesize a cast to long to force explicit conversion.
      JCastOperation cast = new JCastOperation(program, arg.getSourceInfo(),
          targetType, arg);
      return cast;
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JCastOperation

    }

    if (lhs instanceof JCastOperation) {
      // Assignment-to-cast-operation, e.g.
      // (Foo) x = foo -> x = foo
      JCastOperation cast = (JCastOperation) lhs;
      JBinaryOperation newAsg = new JBinaryOperation(program,
          x.getSourceInfo(), x.getType(), JBinaryOperator.ASG, cast.getExpr(),
          x.getRhs());
      ctx.replaceMe(newAsg);
    }
  }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JCastOperation

    @Override
    public void endVisit(JCastOperation x, Context ctx) {
      JType newType = translate(x.getCastType());
      if (newType != x.getCastType()) {
        ctx.replaceMe(new JCastOperation(program, x.getSourceInfo(), newType,
            x.getExpr()));
      }
    }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JCastOperation

    return false;
  }

  @Override
  public boolean visit(JCastOperation x, Context ctx) {
    expression = new JCastOperation(program, x.getSourceInfo(),
        x.getCastType(), cloneExpression(x.getExpr()));
    return false;
  }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JCastOperation

  }

  @Override
  public boolean visit(JCastOperation x, Context ctx) {
    expression =
        new JCastOperation(x.getSourceInfo(), x.getCastType(), cloneExpression(x.getExpr()));
    return false;
  }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JCastOperation

    // no simplification made
    if (original != null) {
      return original;
    }
    return new JCastOperation(program, exp.getSourceInfo(), type, exp);
  }
View Full Code Here

Examples of com.google.gwt.dev.jjs.ast.JCastOperation

    return false;
  }

  @Override
  public boolean visit(JCastOperation x, Context ctx) {
    expression = new JCastOperation(program, x.getSourceInfo(),
        x.getCastType(), cloneExpression(x.getExpr()));
    return false;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.