IO Operators
This commit is contained in:
parent
b9f419a59d
commit
82a8fccf87
22 changed files with 450 additions and 199 deletions
16
src/parser/grammars/QueryGrammar.kt
Normal file
16
src/parser/grammars/QueryGrammar.kt
Normal file
|
@ -0,0 +1,16 @@
|
|||
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
|
||||
}
|
Reference in a new issue