Package-level declarations

Types

Link copied to clipboard
class InvalidTermTypeException(input: Any?, val term: Term, val type: KClass<out Term>, offendingSymbol: String = input as? String ?: term.toString(), line: Int = 1, column: Int = 1, message: String? = "Expected ", throwable: Throwable? = null) : ParseException

Indicates that valid Prolog syntax produced a term of a different type than the caller requested.

Link copied to clipboard
open class ParseException(var input: Any?, var offendingSymbol: String?, var line: Int, var column: Int, message: String?, throwable: Throwable?) : TuPrologException

Reports a failure while turning Prolog source into a tuProlog domain object.

Link copied to clipboard

Converts parser concrete-syntax nodes into tuProlog Terms allocated in scope.

Link copied to clipboard
interface TermParser

Parses one Prolog expression from a String and maps it to the tuProlog term model.

Link copied to clipboard
class TermParserImpl(val scope: Scope, val defaultOperatorSet: OperatorSet, lexerOptions: LexerOptions = LexerOptions(), parserOptions: ParserOptions = ParserOptions()) : TermParser

Configurable default implementation of TermParser.

Link copied to clipboard
interface TermReader

Lazily reads Prolog terms from JVM character or byte streams.

Link copied to clipboard
class TermReaderImpl(val scope: Scope, val defaultOperatorSet: OperatorSet, lexerOptions: LexerOptions = LexerOptions(), parserOptions: ParserOptions = ParserOptions()) : TermReader

Configurable JVM implementation of TermReader.

Functions

Link copied to clipboard

Parses input as an atom.

Parses input as a clause.

Parses input as a constant.

Parses input as a directive.

Parses input as a fact.

Parses input as an integer.

Parses input as a numeric term.

Parses input as a real.

Parses input as a rule.

Parses input as a structure.

Parses input as a term using default operators.

Parses input as a variable.

fun Atom.Companion.parse(input: String, operators: OperatorSet): Atom

Parses input as an atom using operators.

Parses input as a clause using operators.

Parses input as a constant using operators.

Parses input as a directive using operators.

fun Fact.Companion.parse(input: String, operators: OperatorSet): Fact

Parses input as a fact using operators.

Parses input as an integer using operators.

Parses input as a numeric term using operators.

fun Real.Companion.parse(input: String, operators: OperatorSet): Real

Parses input as a real using operators.

fun Rule.Companion.parse(input: String, operators: OperatorSet): Rule

Parses input as a rule using operators.

Parses input as a structure using operators.

fun Term.Companion.parse(input: String, operators: OperatorSet): Term

Parses input as a term using operators.

fun Var.Companion.parse(input: String, operators: OperatorSet): Var

Parses input as a variable using operators.

Link copied to clipboard

Parses this string as an atom.

Parses this string as an atom using operators.

Link copied to clipboard

Parses this string as a clause.

Parses this string as a clause using operators.

Link copied to clipboard

Parses this string as a constant.

Parses this string as a constant using operators.

Link copied to clipboard

Parses this string as a directive.

Parses this string as a directive using operators.

Link copied to clipboard

Parses this string as a fact.

Parses this string as a fact using operators.

Link copied to clipboard

Parses this string as an integer.

Parses this string as an integer using operators.

Link copied to clipboard

Parses this string as a numeric term.

Parses this string as a numeric term using operators.

Link copied to clipboard

Parses this string as a real.

Parses this string as a real using operators.

Link copied to clipboard

Parses this string as a rule.

Parses this string as a rule using operators.

Link copied to clipboard

Parses this string as a structure.

Parses this string as a structure using operators.

Link copied to clipboard

Parses this string as a term using default operators.

Parses this string as a term using operators.

Link copied to clipboard

Parses this string as a variable.

fun String.parseAsVar(operators: OperatorSet): Var

Parses this string as a variable using operators.

Link copied to clipboard

Converts a core Prolog operator specifier to its parser-level equivalent.

Link copied to clipboard
fun Term.toClause(source: Any? = null, line: Int = 0, column: Int = 0): Clause

Converts this term to a clause, promoting a Struct to a fact when necessary.

Link copied to clipboard

Converts a core operator to the representation consumed by parser-impl.

Link copied to clipboard

Converts a parser-level operator definition to its core equivalent.

Link copied to clipboard

Creates an immutable parser-level table containing all operators in this set.

Link copied to clipboard

Converts a parser-level Prolog associativity specifier to its core equivalent.