Examples of JExpression


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

      }
    }

    JStatement processStatement(SwitchStatement x) {
      SourceInfo info = makeSourceInfo(x);
      JExpression expression = dispProcessExpression(x.expression);
      if (expression.getType() instanceof JClassType) {
        // Must be an enum; synthesize a call to ordinal().
        expression = new JMethodCall(info, expression,
            program.getIndexedMethod("Enum.ordinal"));
      }
      JBlock block = new JBlock(info);
View Full Code Here

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

      return new JSwitchStatement(info, expression, block);
    }

    JStatement processStatement(SynchronizedStatement x) {
      JBlock block = (JBlock) dispProcessStatement(x.block);
      JExpression expr = dispProcessExpression(x.expression);
      block.addStmt(0, expr.makeStatement());
      return block;
    }
View Full Code Here

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

      return block;
    }

    JStatement processStatement(ThrowStatement x) {
      SourceInfo info = makeSourceInfo(x);
      JExpression toThrow = dispProcessExpression(x.exception);
      return new JThrowStatement(info, toThrow);
    }
View Full Code Here

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

      // SEE NOTE ON JDT FORCED OPTIMIZATIONS
      // If the condition is false, don't process the body
      boolean removeBody = isOptimizedFalse(x.condition);

      SourceInfo info = makeSourceInfo(x);
      JExpression loopTest = dispProcessExpression(x.condition);
      JStatement loopBody = removeBody ? null : dispProcessStatement(x.action);
      JWhileStatement stmt = new JWhileStatement(info, loopTest, loopBody);
      return stmt;
    }
View Full Code Here

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

    @SuppressWarnings("unused")
    JMethodCall processSuperConstructorCall(ExplicitConstructorCall x) {
      SourceInfo info = makeSourceInfo(x);
      JMethod ctor = (JMethod) typeMap.get(x.binding);
      JExpression trueQualifier = createThisRef(info, currentClass);
      JMethodCall call = new JMethodCall(info, trueQualifier, ctor);

      addCallArgs(x.arguments, call, x.binding);

      // We have to find and pass through any synthetics our supertype needs
      ReferenceBinding superClass = x.binding.declaringClass;
      if (superClass.isNestedType() && !superClass.isStatic()) {
        ReferenceBinding myBinding = currentClassScope.referenceType().binding;
        ReferenceBinding superBinding = superClass;

        // enclosing types
        if (superBinding.syntheticEnclosingInstanceTypes() != null) {
          JExpression qualifier = dispProcessExpression(x.qualification);
          for (ReferenceBinding arg : superBinding.syntheticEnclosingInstanceTypes()) {
            JClassType classType = (JClassType) typeMap.get(arg);
            if (qualifier == null) {
              /*
               * Got to be one of my params; it would be illegal to use a this
View Full Code Here

Examples of com.sun.codemodel.JExpression

  }
 
  @Override
  public JExpression testExpr(JCodeModel codeModel, JVar sexpVariable,
      JvmMethod.Argument formal) {
    JExpression vectorTest = super.testExpr(codeModel, sexpVariable, formal);
    if(formal.isAnnotatedWith(CoerceLanguageToString.class)) {
      return vectorTest
          .cor(sexpVariable._instanceof(codeModel.ref(FunctionCall.class)))
          .cor(sexpVariable._instanceof(codeModel.ref(Symbol.class)));
    } else {
      return vectorTest;
    }
View Full Code Here

Examples of com.sun.codemodel.JExpression

  public void afterArgIsEvaluated(ApplyMethodContext context, JExpression functionCall, JExpression arguments,
                                  JBlock parent, JExpression argument, int index) {
    if(index == 0) {

      JBlock ifObject = parent._if(fastIsObject(argument))._then();
      JExpression genericResult = ifObject.decl(codeModel.ref(SEXP.class), "genericResult",
              codeModel.ref(S3.class).staticInvoke("tryDispatchFromPrimitive")
              .arg(context.getContext())
              .arg(context.getEnvironment())
              .arg(functionCall)
              .arg(lit(name))
              .arg(argument)
              .arg(arguments));
      ifObject._if(genericResult.ne(_null()))._then()._return(genericResult);

    }
  }
View Full Code Here

Examples of com.sun.codemodel.JExpression

                                                              JExpr._new(f.getRawType()));
                        newVar.javadoc().append(var.javadoc());
                    }
                }

                JExpression dvExpr = null;
                if (null != xmlDefaultValue && null != xmlDefaultValue.value) {
                    dvExpr = getDefaultValueExpression(f, co, outline, xsType, isElement,
                                                       xmlDefaultValue, false);
                }
                
View Full Code Here

Examples of com.sun.codemodel.JExpression

        String defaultValue = xmlDefaultValue == null ? null : xmlDefaultValue.value;
        if (defaultValue == null) {
            return null;
        }

        JExpression dv = null;
       
        if ("java.lang.Boolean".equals(typeName) && isElement) {
            dv = JExpr.direct(Boolean.valueOf(defaultValue) ? "Boolean.TRUE" : "Boolean.FALSE");
        } else if ("java.lang.Byte".equals(typeName) && isElement) {
            dv = JExpr._new(type)
View Full Code Here

Examples of com.sun.codemodel.JExpression

        method = dc.method(mods, mtype, getterName);
        method.javadoc().append(doc);

        JFieldRef fr = JExpr.ref(fieldName);
        if (dvExpr != null) {
            JExpression test = JOp.eq(JExpr._null(), fr);
            JConditional jc =  method.body()._if(test);
            jc._then()._return(dvExpr);
            jc._else()._return(fr);
        } else {
            method.body()._return(fr);
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.