Next: Earley Parser, Previous: Incremental Parsing Framework, Up: Syntax Protocol
Class precedence list:
lexer, standard-object, slot-object, t
Slots:
buffer
— initargs::buffer
The buffer associated with the lexer.
The base class for all lexers.
Class precedence list:
incremental-lexer, lexer, standard-object, slot-object, t
A subclass of lexer which maintains the buffer in the form of a sequence of lexemes that is updated incrementally.
In the sequence of lexemes maintained by the incremental lexer, the lexemes are indexed by a position starting from zero.
Given a lexer and a position, return the lexeme in that position in the lexer.
Insert a lexeme at the position in the lexer. All lexemes following
pos
are moved to one position higher.
Invalidate all lexemes that could have changed as a result of modifications to the buffer
This generic function is called by the incremental lexer to determine whether a buffer object is an inter-lexeme object, typically whitespace. Client code must supply a method for this generic function.
This generic function is called by the incremental lexer to skip inter-lexeme buffer objects. The default method for this generic function increments the scan mark until the object after the mark is not an inter-lexeme object, or until the end of the buffer has been reached.
This function is called by client code as part of the buffer-update protocol to inform the lexer that it needs to analyze the contents of the buffer at least up to the
end
mark of the buffer.start-pos
is the position in the lexeme sequence at which new lexemes should be inserted.
This generic function is called by the incremental lexer to get a new lexeme from the buffer. Client code must supply a method for this function that specializes on the lexer class. It is guaranteed that scan is not at the end of the buffer, and that the first object after scan is not an inter-lexeme object. Thus, a lexeme should always be returned by this function.