package parser.grammars

import com.github.h0tk3y.betterParse.combinators.times
import com.github.h0tk3y.betterParse.combinators.unaryMinus
import com.github.h0tk3y.betterParse.combinators.use
import com.github.h0tk3y.betterParse.parser.Parser
import prolog.ast.logic.LogicOperand
import prolog.builtins.Query

class QueryGrammar : TermsGrammar() {
    protected val query: Parser<Query> by (body * -dot) use {
        Query(this as LogicOperand)
    }

    override val rootParser: Parser<Any> by query
}