Statik: an incremental compiler generator
Michael Biggs · 2015
This paper introduces “statik”, a C++ software library for automatically generating fully-incremental compilers. Given a grammar for any phase of a compilation process (e.g. lexer, parser, code-generator), the library provides a top-down chart parser that accepts incremental changes to a linked-list of input for that compilation phase, and emits the corresponding changes as a linked-list of output. The output of one phase can be chained as input to another, so that a whole compiler can be constructed as a pipeline of an arbitrary number of compilation phases. This can be used as an incremental mapping between character-by-character edits anywhere in an input source file through to the resulting changes in the compiled object code, with minimal recomputation of intermediary state. Statik is released as Free software, and is available under the GPLv3+ license at http://statik.rocks.