Next: , Previous: General Syntax Protocol, Up: Syntax Protocol


18.4.4.2 Incremental Parsing Framework

— Class: drei-syntax:parse-tree

Class precedence list: parse-tree, standard-object, slot-object, t

The base class for all parse trees.

We use the term parse tree in a wider sense than what is common in the parsing literature, in that a lexeme is a (trivial) parse tree. The parser does not distinguish between lexemes and other parse trees, and a grammar rule can produce a lexeme if that should be desired.

— Generic Function: drei-syntax:start-offset state

The offset in the buffer of the first character of a parse tree.

— Generic Function: drei-syntax:end-offset state

The offset in the buffer of the character following the last one of a parse tree.

The length of a parse-tree is thus the difference of its end offset and its start offset.

The start offset and the end offset may be NIL which is typically the case when a parse tree is derived from the empty sequence of lexemes.