Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
test
Batch.cpp
Batch.h
Grapher.cpp
Grapher.h
IConnection.cpp
IConnection.h
IncParser.cpp
IncParser.h
Keyword.cpp
Keyword.h
List.cpp
List.h
ListenerTable.h
Makefile.am
Meta.cpp
Meta.h
ObjectPool.h
Opt.cpp
Opt.h
Or.cpp
Or.h
OrderList.cpp
OrderList.h
OutputFunc.cpp
OutputFunc.h
ParseAction.h
ParseFunc.h
README.md
Regexp.cpp
Regexp.h
Root.cpp
Root.h
Rule.cpp
Rule.h
SError.h
SLog.cpp
SLog.h
STree.cpp
STree.h
Seq.cpp
Seq.h
Star.cpp
Star.h
State.cpp
State.h
notes.txt
reorg.txt

README.md

statik

http://statik.rocks

statik is a C++ library for incremental compilation. You give it a grammar, and it gives you an incremental parser. "Incremental" means that the input are changes to the characters of the input source code, and the output are changes to the resulting compiled bytecode.

Statik allows you to write a compiler as a sequence of "phases" of parsing. Each phase incrementally translates an input list to an output list. For example, your compiler might be constructed as the pipeline: lexer -> parser -> code-generator. The lexer incrementally translates source-code characters to tokens. The parser translates incremental changes to the token list, to an incrementally-updating parse tree. The code-generator responds to the changing parse tree by generating the bytecode for those changes, and emits the bytecode changes incrementally.

The parser author can provide as many phases as they want; for example, you could toss in an incremental pre-processor, or other phases of compilation.

status

Statik still has some major bugs in some of its rules, especially when grammars are more than a few layers deep. So it's not yet practical for usage, but it's getting pretty close. It can also output graphs (in GraphViz format) to help understand how it runs an incremental parse.

code

Statik is embedded within the codebase for shok; they will be separated soon.

There are three pieces:

  • statik/ The library itself, compile it down to libstatik.a
    • statik/test/ Test suite
  • exstatik/ Example parsers
  • istatik/ An interactive ncurses GUI for running/visualizing statik

Publications

You can’t perform that action at this time.