private boolean parseSinglePattern() {
    final PsiBuilder.Marker marker = myBuilder.mark();
    if (matches(ATTR_OR_ELEMENT)) {
      if (!myNameClassParsing.parseNameClass()) {
        error(RelaxngBundle.message("relaxng.parse.error.name-class-expected"));
        marker.drop();
        return false;
      }
      parseBracedPattern();
      marker.done(RncElementTypes.PATTERN);
    } else if (matches(KEYWORD_LIST)) {
      parseBracedPattern();
      marker.done(RncElementTypes.LIST_PATTERN);
    } else if (matches(KEYWORD_MIXED)) {
      parseBracedPattern();
      marker.done(RncElementTypes.MIXED_PATTERN);
    } else if (matches(KEYWORD_EXTERNAL)) {
      parseAnyUriLiteral();
      parseInherit();
      marker.done(RncElementTypes.EXTERNAL_REF);
    } else if (matches(KEYWORD_NOT_ALLOWED)) {
      marker.done(RncElementTypes.NOT_ALLOWED_PATTERN);
    } else if (matches(KEYWORD_TEXT)) {
      marker.done(RncElementTypes.TEXT_PATTERN);
    } else if (matches(KEYWORD_EMPTY)) {
      marker.done(RncElementTypes.EMPTY_PATTERN);
    } else if (matches(KEYWORD_PARENT)) {
      match(IDENTIFIERS, RelaxngBundle.message("relaxng.parse.error.identifier-expected"));
      marker.done(RncElementTypes.PARENT_REF);
    } else if (matches(KEYWORD_GRAMMAR)) {
      parseBracedGrammarContents();
      marker.done(RncElementTypes.GRAMMAR_PATTERN);
    } else if (matches(LPAREN)) {
      if (!parsePattern()) {
        error(RelaxngBundle.message("relaxng.parse.error.pattern-expected"));
      }
      match(RPAREN, RelaxngBundle.message("relaxng.parse.error.rparen-expected"));
      marker.done(RncElementTypes.GROUP_PATTERN);
    } else if (matches(IDENTIFIERS)) {
      marker.done(RncElementTypes.REF_PATTERN);
    } else if (matches(LA_DATATYPE)) {
      parseDatatype();
      marker.done(RncElementTypes.DATATYPE_PATTERN);
    } else if (currentToken() == PREFIXED_NAME) {
      makeName();
      parseDatatype();
      marker.done(RncElementTypes.DATATYPE_PATTERN);
    } else if (matches(LITERAL)) {
      marker.done(RncElementTypes.DATATYPE_PATTERN);
    } else {
      marker.drop();
      return false;
    }
    return true;
  }
private boolean parseSinglePattern()