TermReader

interface TermReader

Lazily reads Prolog terms from JVM character or byte streams.

readTerms does not consume its source until the returned Sequence is iterated. The sequence is backed by one stateful parse session and should be consumed once and sequentially. Syntax, I/O, and buffer failures become ParseExceptions at the iteration step that encounters them. The default reader adapter closes its input at EOF; wrapping an InputStream therefore also closes that stream.

See also

Inheritors

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Operators used by overloads without an explicit set.

Link copied to clipboard
abstract val scope: Scope

Scope used to construct parsed terms.

Functions

Link copied to clipboard
open fun readTerm(inputStream: InputStream): Term?
open fun readTerm(reader: Reader): Term?

abstract fun readTerm(inputStream: InputStream, operators: OperatorSet): Term?

Reads the next term from inputStream, or null at EOF, using operators.

abstract fun readTerm(reader: Reader, operators: OperatorSet): Term?

Reads the next term from reader, or null at EOF, using operators.

Link copied to clipboard
open fun readTerms(inputStream: InputStream): Sequence<Term>
open fun readTerms(reader: Reader): Sequence<Term>
open fun readTerms(string: String): Sequence<Term>

abstract fun readTerms(inputStream: InputStream, operators: OperatorSet): Sequence<Term>

Returns terms decoded lazily from inputStream using operators.

abstract fun readTerms(reader: Reader, operators: OperatorSet): Sequence<Term>

Returns terms read lazily from reader using operators.

open fun readTerms(string: String, operators: OperatorSet): Sequence<Term>

Returns terms parsed lazily from string using operators.