override fun visitFind()

in src/main/kotlin/jetbrains/buildServer/server/querylang/parser/MainQueryVisitor.kt [13:36]


    override fun visitFind(ctx: QLangGrammarParser.FindContext?): FullQuery {
        val objectKeywords = ctx!!.multipleObjects().objectKeyword()
        val queries: List<TopLevelQuery<*>> = objectKeywords.map { objKeyword ->
            when (objKeyword.getChild(0)) {
                is QLangGrammarParser.ProjectKewordContext -> {
                    ProjectTopLevelQuery(ctx.conditionInSubproject().accept(ConditionVisitor(ProjectTopLevelQuery::class)))
                }
                is QLangGrammarParser.BuildConfKewordContext -> {
                    BuildConfTopLevelQuery(ctx.conditionInSubproject().accept(ConditionVisitor(BuildConfTopLevelQuery::class)))
                }
                is QLangGrammarParser.TemplateKeywordContext -> {
                    TemplateTopLevelQuery(ctx.conditionInSubproject().accept(ConditionVisitor(TemplateTopLevelQuery::class)))
                }
                is QLangGrammarParser.VcsRootKeywordContext -> {
                    VcsRootTopLevelQuery(ctx.conditionInSubproject().accept(ConditionVisitor(VcsRootTopLevelQuery::class)))
                }
                is QLangGrammarParser.PrivateRecipeKeywordContext -> {
                    PrivateRecipeTopLevelQuery(ctx.conditionInSubproject().accept(ConditionVisitor(PrivateRecipeTopLevelQuery::class)))
                }
                else -> throw IllegalStateException("Unknown keyword in search query")
            }
        }
        return FullQuery(queries)
    }