Examples of JSwitchStatement


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

          if (jstmt != null) {
            block.addStmt(jstmt);
          }
        }
      }
      return new JSwitchStatement(info, expression, block);
    }
View Full Code Here

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

          if (jstmt != null) {
            block.addStmt(jstmt);
          }
        }
      }
      return new JSwitchStatement(info, expression, block);
    }
View Full Code Here

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

    JStatement processStatement(SwitchStatement x) {
      SourceInfo info = makeSourceInfo(x);
      JExpression expression = dispProcessExpression(x.expression);
      JBlock block = new JBlock(program, info);
      block.statements = processStatements(x.statements);
      return new JSwitchStatement(program, info, expression, block);
    }
View Full Code Here

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

        expression = new JMethodCall(program, info, expression,
            program.getIndexedMethod("Enum.ordinal"));
      }
      JBlock block = new JBlock(program, info);
      block.statements = processStatements(x.statements);
      return new JSwitchStatement(program, info, expression, block);
    }
View Full Code Here

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

    assert switchBody.getStatements().size() > 0 : "No case statement emitted "
        + "for supposedly soft-rebind type " + requestType;

    // switch (CollapsedPropertyHolder.getPermutationId()) { ... }
    JSwitchStatement sw =
        new JSwitchStatement(info, new JMethodCall(info, null, permutationIdMethod), switchBody);

    // return new FallbackImpl(); at the very end.
    assert mostUsedExpression != null : "No most-used expression";
    JReturnStatement fallbackReturn = new JReturnStatement(info, mostUsedExpression);
View Full Code Here

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

    @Override
    public boolean visit(JSwitchStatement x, Context ctx) {
      pushNode(new CfgStatementNode<JStatement>(parent, x));
      accept(x.getExpr());

      JSwitchStatement oldSwitchStatement = switchStatement;
      // We don't want to mess with other case exits here
      List<Exit> oldCaseElseExits = removeExits(Exit.Reason.CASE_ELSE);
      List<Exit> oldCaseThenExits = removeExits(Exit.Reason.CASE_THEN);
      List<Exit> oldBreakExits = removeUnlabeledBreaks();
      switchStatement = x;
View Full Code Here

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

        if (x.expression.resolvedType.isEnum()) {
          // synthesize a call to ordinal().
          expression = synthesizeCallToOrdinal(scope, info, expression);
        }
        push(new JSwitchStatement(info, expression, block));
      } catch (Throwable e) {
        throw translateException(x, e);
      }
    }
View Full Code Here

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

          if (jstmt != null) {
            block.addStmt(jstmt);
          }
        }
      }
      return new JSwitchStatement(info, expression, block);
    }
View Full Code Here

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

    assert switchBody.getStatements().size() > 0 : "No case statement emitted "
        + "for supposedly soft-rebind type " + requestType.getName();

    // switch (CollapsedPropertyHolder.getPermutationId()) { ... }
    JSwitchStatement sw = new JSwitchStatement(info, new JMethodCall(info,
        null, permutationIdMethod), switchBody);

    // return new FallbackImpl(); at the very end.
    assert mostUsedExpression != null : "No most-used expression";
    JReturnStatement fallbackReturn = new JReturnStatement(info,
View Full Code Here

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

          // Must be an enum; synthesize a call to ordinal().
          ReferenceBinding javaLangEnum = scope.getJavaLangEnum();
          MethodBinding ordinal = javaLangEnum.getMethods(ORDINAL)[0];
          expression = new JMethodCall(info, expression, typeMap.get(ordinal));
        }
        push(new JSwitchStatement(info, expression, block));
      } catch (Throwable e) {
        throw translateException(x, e);
      }
    }
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.