Incremental Parsing of Common Lisp Code
Description
In a text editor for writing Common Lisp source code, it is desirable to have an accurate analysis of the buffer contents, so that the role of the elements of the code can be indicated to the programmer. Furthermore, the buffer contents should preferably be analyzed after each keystroke so that the programmer has up-to-date information resulting from the analysis.
We describe an incremental parser that can be used as a key component of such an analyzer. The parser, itself written in Common Lisp, uses a special-purpose implementation of the Common Lisp read function in combination with a cache that stores existing results of calling the reader.
Since the parser uses the standard Common Lisp reader, the resulting analysis is very accurate. Furthermore, the cache makes the parser very fast in most common cases; re-parsing a buffer in which a single character has been altered takes only a few milliseconds.
Files
incremental-parsing.pdf
Files
(443.0 kB)
Name | Size | Download all |
---|---|---|
md5:84f2920ac0888e3d21d278f8f6382271
|
443.0 kB | Preview Download |