Examples of JReturnStatement


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

    public void endVisit(JReturnStatement x, Context ctx) {
      if (x.getExpr() != null) {
        JExpression newExpr = checkAndReplaceJso(x.getExpr(),
            currentMethod.getType());
        if (newExpr != x.getExpr()) {
          JReturnStatement newStmt = new JReturnStatement(program,
              x.getSourceInfo(), newExpr);
          ctx.replaceMe(newStmt);
        }
      }
    }
View Full Code Here

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

      }
      JStatement statement;
      if (oldReturnType == program.getTypeVoid()) {
        statement = newCall.makeStatement();
      } else {
        statement = new JReturnStatement(program, bodyInfo, newCall);
      }
      x.body.statements.add(statement);

      // Add the new method as a static impl of the old method
      program.putStaticImpl(x, newMethod);
View Full Code Here

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

         * their this object, so any embedded return statements have to be fixed
         * up.
         */
        JClassType enclosingType = (JClassType) currentMethod.getEnclosingType();
        assert (x.expression == null);
        return new JReturnStatement(program, info, createThisRef(info,
            enclosingType));
      } else {
        return new JReturnStatement(program, info,
            dispProcessExpression(x.expression));
      }
    }
View Full Code Here

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

        currentMethodScope = null;
        currentMethod = null;

        // synthesize a return statement to emulate returning the new object
        ctor.body.statements.add(new JReturnStatement(program, null, thisRef));
      } catch (Throwable e) {
        throw translateException(ctor, e);
      }
    }
View Full Code Here

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

    }

    JConditional conditional = new JConditional(program, sourceInfo,
        objectMethod.getType(), condition, thenValue, elseValue);

    JReturnStatement returnStatement = new JReturnStatement(program,
        sourceInfo, conditional);
    ((JMethodBody) newMethod.getBody()).getStatements().add(returnStatement);
    return newMethod;
  }
View Full Code Here

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

        currentMethodScope = null;
        currentMethod = null;

        // synthesize a return statement to emulate returning the new object
        statements.add(new JReturnStatement(program, null, thisRef));
      } catch (Throwable e) {
        throw translateException(ctor, e);
      }
    }
View Full Code Here

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

         * their this object, so any embedded return statements have to be fixed
         * up.
         */
        JClassType enclosingType = (JClassType) currentMethod.getEnclosingType();
        assert (x.expression == null);
        return new JReturnStatement(program, info, createThisRef(info,
            enclosingType));
      } else {
        return new JReturnStatement(program, info,
            dispProcessExpression(x.expression));
      }
    }
View Full Code Here

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

      } else {
        info = method.getSourceInfo();
      }

      statements.clear();
      statements.add(new JReturnStatement(program, info, returnValue));
    }
View Full Code Here

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

      JMethod delegateTo = program.getIndexedMethod("Enum.valueOf");
      JMethodCall call = new JMethodCall(program, null, null, delegateTo);
      call.getArgs().add(mapRef);
      call.getArgs().add(nameRef);
      currentMethodBody.getStatements().add(
          new JReturnStatement(program, null, call));
    }
View Full Code Here

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

        initializers.add(fieldRef);
      }
      JNewArray newExpr = JNewArray.createInitializers(program, null,
          program.getTypeArray(type, 1), initializers);
      currentMethodBody.getStatements().add(
          new JReturnStatement(program, null, newExpr));
    }
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.