jvmMain.it.unibo.tuprolog.theory.parsing.ClausesParserImpl.kt Maven / Gradle / Ivy
Go to download
Parsing facilities for knoledge bases made up of logic clauses, out of Prolog standard syntax
package it.unibo.tuprolog.theory.parsing
import it.unibo.tuprolog.core.Clause
import it.unibo.tuprolog.core.operators.OperatorSet
import it.unibo.tuprolog.core.parsing.PrologExpressionVisitor
import it.unibo.tuprolog.core.parsing.PrologParserFactory
import it.unibo.tuprolog.core.parsing.toClause
internal class ClausesParserImpl(override val defaultOperatorSet: OperatorSet) : ClausesParser {
override fun parseClausesLazily(input: String, operators: OperatorSet): Sequence {
return PrologParserFactory.parseClauses(input, operators)
.asSequence()
.map { it.accept(PrologExpressionVisitor()) }
.map { it.toClause() }
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy