TermParser
interface TermParser
Parses one Prolog expression from a String and maps it to the tuProlog term model.
Parsing is performed with a lossless concrete-syntax parser and then converted using scope. Low-level lexical and syntactic exceptions are wrapped in ParseException. The typed entry points additionally verify the resulting runtime type and throw InvalidTermTypeException on a mismatch.
val parser = TermParser.withStandardOperators()
val clause = parser.parseClause("ancestor(X, Y) :- parent(X, Y)")
val custom = parser.parseTerm("a ++ b", OperatorSet(Operator("++", Specifier.YFX, 500)))Content copied to clipboard