Package com.google.dart.engine.ast

Examples of com.google.dart.engine.ast.SwitchMember


    try {
      boolean hasDefault = false;
      NodeList<SwitchMember> memberList = node.getMembers();
      SwitchMember[] members = memberList.toArray(new SwitchMember[memberList.size()]);
      for (int i = 0; i < members.length; i++) {
        SwitchMember switchMember = members[i];
        if (switchMember instanceof SwitchDefault) {
          hasDefault = true;
          // If this is the last member and there are no statements, return false
          if (switchMember.getStatements().isEmpty() && i + 1 == members.length) {
            return false;
          }
        }
        // For switch members with no statements, don't visit the children, otherwise, return false if
        // no return is found in the children statements
        if (!switchMember.getStatements().isEmpty() && !switchMember.accept(this)) {
          return false;
        }
      }
      return hasDefault;
    } finally {
View Full Code Here


  private boolean checkForCaseBlocksNotTerminated(SwitchStatement node) {
    boolean foundError = false;
    NodeList<SwitchMember> members = node.getMembers();
    int lastMember = members.size() - 1;
    for (int i = 0; i < lastMember; i++) {
      SwitchMember member = members.get(i);
      if (member instanceof SwitchCase) {
        foundError |= checkForCaseBlockNotTerminated((SwitchCase) member);
      }
    }
    return foundError;
View Full Code Here

      }
    }
    NodeList<SwitchMember> members = statement.getMembers();
    int memberCount = members.size();
    for (int i = 0; i < memberCount; i++) {
      SwitchMember member = members.get(i);
      if (member instanceof SwitchDefault) {
        return false;
      }
      String constantName = getConstantName(((SwitchCase) member).getExpression());
      if (constantName != null) {
View Full Code Here

TOP

Related Classes of com.google.dart.engine.ast.SwitchMember

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.