PrologParseSession

Stateful, incremental parsing over one input.

The mutable operators table is consulted afresh for every parsed clause or term, allowing a directive processor to update syntax between calls without re-lexing. A failed parse restores currentPosition. Successful results own stable source/token snapshots even if the input uses TokenRetention.RELEASE_COMMITTED. Sessions are single-consumer and not thread-safe.

Properties

Link copied to clipboard

Start position of the next candidate term or clause.

Link copied to clipboard
abstract val input: LexedSource

Lazy token source consumed by this session.

Link copied to clipboard
abstract val isAtEnd: Boolean

Whether EOF has been observed after the last successfully parsed item.

Link copied to clipboard

Session-local operator table used by subsequent parsing calls.

Functions

Link copied to clipboard

Parses and commits the next full-stop-terminated clause, or returns null at EOF.

Link copied to clipboard

Parses and commits the next term, which must end at EOF or a full-stop separator.