Package com.google.gwt.dev.jjs.ast

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


      return myDidChange || super.didChange();
    }

    @Override
    public void endVisit(JCastOperation x, Context ctx) {
      JType argType = x.getExpr().getType();
      if (!(x.getCastType() instanceof JReferenceType)
          || !(argType instanceof JReferenceType)) {
        return;
      }
View Full Code Here


    @Override
    public void endVisit(JGwtCreate x, Context ctx) {
      List<JClassType> typeList = new ArrayList<JClassType>();
      for (JExpression expr : x.getInstantiationExpressions()) {
        JType type = expr.getType();
        typeList.add((JClassType) type);
      }

      JReferenceType resultType = program.generalizeTypes(typeList);
      if (x.getType() != resultType) {
View Full Code Here

      }
    }

    @Override
    public void endVisit(JInstanceOf x, Context ctx) {
      JType argType = x.getExpr().getType();
      if (!(argType instanceof JReferenceType)) {
        // TODO: is this even possible? Replace with assert maybe.
        return;
      }
View Full Code Here

      }
      return null;
    }

    private JArrayType nullifyArrayType(JArrayType arrayType) {
      JType elementType = arrayType.getElementType();
      if (elementType instanceof JReferenceType) {
        JReferenceType refType = (JReferenceType) elementType;
        if (!program.typeOracle.isInstantiatedType(refType)) {
          return program.getTypeArray(JNullType.INSTANCE, 1);
        } else if (elementType instanceof JArrayType) {
View Full Code Here

      }

      Set<JExpression> myAssignments = assignments.get(x);
      if (myAssignments != null) {
        for (JExpression expr : myAssignments) {
          JType type = expr.getType();
          if (!(type instanceof JReferenceType)) {
            return; // something fishy is going on, just abort
          }
          typeList.add((JReferenceType) type);
        }
View Full Code Here

      }
    } else if (binding instanceof ArrayBinding) {
      ArrayBinding arrayBinding = (ArrayBinding) binding;

      // Compute the JType for the leaf type
      JType leafType = (JType) get(arrayBinding.leafComponentType);

      // Don't create a new JArrayType; use TypeMap to get the singleton
      // instance
      JArrayType arrayType = program.getTypeArray(leafType,
          arrayBinding.dimensions);
View Full Code Here

     * Discard casts from byte or short to int, because such casts are always
     * implicit anyway. Cannot coerce char since that would change the semantics
     * of concat.
     */
    if (type == program.getTypePrimitiveInt()) {
      JType expType = exp.getType();
      if ((expType == program.getTypePrimitiveShort())
          || (expType == program.getTypePrimitiveByte())) {
        return exp;
      }
    }
View Full Code Here

    public void endVisit(JBinaryOperation x, Context ctx) {
      // Concats are handled by CastNormalizer.ConcatVisitor.
      if (x.getType() == program.getTypeJavaLangString()) {
        return;
      }
      JType lhsType = x.getLhs().getType();
      JType rhsType = x.getRhs().getType();
      if (lhsType != longType) {
        assert (rhsType != longType);
        return;
      }
View Full Code Here

      ctx.replaceMe(call);
    }

    @Override
    public void endVisit(JPostfixOperation x, Context ctx) {
      JType argType = x.getArg().getType();
      if (argType == longType) {
        throw new InternalCompilerException(
            "Postfix operations on longs should not reach here");
      }
    }
View Full Code Here

      }
    }

    @Override
    public void endVisit(JPrefixOperation x, Context ctx) {
      JType argType = x.getArg().getType();
      if (argType != longType) {
        return;
      }

      String methodName = getEmulationMethod(x.getOp());
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.jjs.ast.JType

Copyright © 2018 www.massapicom. 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.