A toolkit for compilers and interpreters

Tools for Writing Compilers and Interpreters

Compilers and interpreters require a wide range of algorithms and data structures. The CITkit library provides Java versions of these data structures and their supporting algorithms that I've found boring. You can thank me later.

Tree Intermediate Representation

A tree intermediate representation (TIR) is an intermediate representation for a compiler or interpreter. Many parser generators (like ANTLR and JavaCC) produce an abstract syntax tree that tends to be terribly procedural.

The Hobbes TIR provided by CITkit is implemented as several inheritance hierarchies for common language structures. The hierarchies implement the visitor pattern to make implementing algorithms over the language structures object oriented and easy.

Read more...

Symbol Tables

Any compiler or interpreter will need to bind the variables and identifiers of a language to various values. These values are usually stored in symbol tables.

CITkit provides "environments" which uses multiple symbol tables to help manage different scopes for your variables.

Read more...