protected static String parseFilePattern(Lexer lexer) throws ParsingException {
    StringBuilder pattern = new StringBuilder();
    boolean wasIdentifier = false;
    while (true) {
      if (lexer.getTokenType() == ScopeTokenTypes.DIV) {
        wasIdentifier = false;
        pattern.append("/");
      }
      else if (lexer.getTokenType() == ScopeTokenTypes.IDENTIFIER || lexer.getTokenType() == ScopeTokenTypes.INTEGER_LITERAL) {
        if (wasIdentifier) error(lexer, CodeInsightBundle.message("error.package.set.token.expectations", getTokenText(lexer)));
        wasIdentifier = lexer.getTokenType() == ScopeTokenTypes.IDENTIFIER;
        pattern.append(getTokenText(lexer));
      }
      else if (lexer.getTokenType() == ScopeTokenTypes.ASTERISK) {
        wasIdentifier = false;
        pattern.append("*");
      }
      else if (lexer.getTokenType() == ScopeTokenTypes.DOT) {
        wasIdentifier = false;
        pattern.append(".");
      }
      else if (lexer.getTokenType() == TokenType.WHITE_SPACE) {
        wasIdentifier = false;
        pattern.append(" ");
      }
      else if (lexer.getTokenType() == ScopeTokenTypes.MINUS) {
        wasIdentifier = false;
        pattern.append("-");
      }
      else if (lexer.getTokenType() == ScopeTokenTypes.TILDE) {
        wasIdentifier = false;
        pattern.append("~");
      }
      else if (lexer.getTokenType() == ScopeTokenTypes.SHARP) {
        wasIdentifier = false;
        pattern.append("#");
      }
      else {
        break;
      }
      lexer.advance();
    }

    if (pattern.length() == 0) {
      error(lexer, CodeInsightBundle.message("error.package.set.pattern.expectations"));
    }

    return pattern.toString();
  }
protected static String parseFilePattern(Lexer lexer)