Examples of JVariableRef


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

      if (x.getInitializer() != null) {
        accept(x.getInitializer());
      }

      // If the lhs is a field ref, we have to visit its qualifier.
      JVariableRef variableRef = x.getVariableRef();
      if (variableRef instanceof JFieldRef) {
        JFieldRef fieldRef = (JFieldRef) variableRef;
        JExpression instance = fieldRef.getInstance();
        if (instance != null) {
          accept(instance);
View Full Code Here

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

      maybeReplaceMe(x, Simplifier.conditional(x), ctx);
    }

    @Override
    public void endVisit(JDeclarationStatement x, Context ctx) {
      JVariableRef variableRef = x.getVariableRef();
      lvalues.remove(variableRef);
    }
View Full Code Here

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

      return !x.isExternal();
    }

    private void recordAssignment(JExpression lhs) {
      if (lhs instanceof JVariableRef) {
        JVariableRef variableRef = (JVariableRef) lhs;
        isReassigned.add(variableRef.getTarget());
      }
    }
View Full Code Here

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

      JExpression lhs = x.getLhs();
      if (!(lhs instanceof JVariableRef)) {
        return;
      }

      JVariableRef variableRef = (JVariableRef) lhs;
      if (isVariablePruned(variableRef.getTarget())) {
        // TODO: better null tracking; we might be missing some NPEs here.
        JExpression replacement =
            makeReplacementForAssignment(x.getSourceInfo(), variableRef, x.getRhs());
        ctx.replaceMe(replacement);
      }
View Full Code Here

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

          x.getType(), x.getIfTest(), x.getThenExpr(), x.getElseExpr()), ctx);
    }

    @Override
    public void endVisit(JDeclarationStatement x, Context ctx) {
      JVariableRef variableRef = x.getVariableRef();
      lvalues.remove(variableRef);
    }
View Full Code Here

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

        if (x.constructorCall != null) {
          JMethodCall superOrThisCall = (JMethodCall) dispatch(
              "processExpression", x.constructorCall);
          // Enums: wire up synthetic name/ordinal params to the super method.
          if (enclosingType.isEnumOrSubclass() != null) {
            JVariableRef enumNameRef = createVariableRef(
                superOrThisCall.getSourceInfo(), ctor.getParams().get(0));
            superOrThisCall.addArg(0, enumNameRef);
            JVariableRef enumOrdinalRef = createVariableRef(
                superOrThisCall.getSourceInfo(), ctor.getParams().get(1));
            superOrThisCall.addArg(1, enumOrdinalRef);
          }

          superOrThisCall.setStaticDispatchOnly();
View Full Code Here

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

       * return Enum.valueOf(Enum$Map.Map.$MAP, name);
       */
      {
        SourceInfo sourceInfo = currentMethodBody.getSourceInfo();
        JFieldRef mapRef = new JFieldRef(sourceInfo, null, mapField, type);
        JVariableRef nameRef = createVariableRef(sourceInfo,
            currentMethod.getParams().get(0));
        JMethod delegateTo = program.getIndexedMethod("Enum.valueOf");
        JMethodCall call = new JMethodCall(sourceInfo, null, delegateTo);
        call.addArgs(mapRef, nameRef);

View Full Code Here

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

      // The LHS of assignments may have been pruned.
      if (x.getOp() == JBinaryOperator.ASG) {
        lValues.pop();
        JExpression lhs = x.getLhs();
        if (lhs instanceof JVariableRef) {
          JVariableRef variableRef = (JVariableRef) lhs;
          if (isVariablePruned(variableRef.getTarget())) {
            // TODO: better null tracking; we might be missing some NPEs here.
            JExpression replacement = makeReplacementForAssignment(
                x.getSourceInfo(), variableRef, x.getRhs());
            ctx.replaceMe(replacement);
          }
View Full Code Here

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

          }
        }
      }

      // If the lhs is a field ref, we have to visit its qualifier.
      JVariableRef variableRef = x.getVariableRef();
      if (variableRef instanceof JFieldRef) {
        JFieldRef fieldRef = (JFieldRef) variableRef;
        JExpression instance = fieldRef.getInstance();
        if (instance != null) {
          accept(instance);
View Full Code Here

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

      Iterator<JStatement> it = stmts.iterator();
      // look for statements of the form EnumValueField = ...
      while (it.hasNext()) {
        JStatement stmt = it.next();
        if (stmt instanceof JDeclarationStatement) {
          JVariableRef ref = ((JDeclarationStatement) stmt).getVariableRef();
          if (ref instanceof JFieldRef) {
            JFieldRef enumRef = (JFieldRef) ref;
            if (enumRef.getField().getEnclosingType() == method.getEnclosingType()) {
              // see if LHS is a field ref that corresponds to the class of this method
              if (enumRef.getField() instanceof JEnumField) {
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.