PrologLexer

interface PrologLexer

Produces a lossless, lazy Prolog token stream independently of operator declarations.

Word and graphic spellings are classified lexically; whether an occurrence is an atom, functor, or operator is decided later by PrologParser. Trivia is retained, token spans are end-exclusive, and source offsets count UTF-16 code units. Construction performs no input reads, so lexical and source failures are deferred until the relevant token is requested.

See also

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun lex(source: SourceText, options: LexerOptions = LexerOptions()): LexedSource

Creates a lazy token source without consulting an operator table.

abstract fun lex(source: TextChunkSource, sourceId: String? = null, options: LexerOptions = LexerOptions()): LexedSource

Creates a lazy token source backed by synchronous text chunks.