void (PsiBuilder builder, @Nullable BraceMode braceMode) { while (builder.getTokenType() != null) { PsiBuilder.Marker statement = parseStatement(builder); if (statement != null) continue; IElementType tokenType = builder.getTokenType(); if (tokenType == JavaTokenType.RBRACE && (braceMode == BraceMode.TILL_FIRST || braceMode == BraceMode.TILL_LAST && builder.lookAhead(1) == null)) { break; } PsiBuilder.Marker error = builder.mark(); builder.advanceLexer(); if (tokenType == JavaTokenType.ELSE_KEYWORD) { error.error(JavaPsiBundle.message("else.without.if")); } else if (tokenType == JavaTokenType.CATCH_KEYWORD) { error.error(JavaPsiBundle.message("catch.without.try")); } else if (tokenType == JavaTokenType.FINALLY_KEYWORD) { error.error(JavaPsiBundle.message("finally.without.try")); } else { error.error(JavaPsiBundle.message("unexpected.token")); } } }