/nearly_cc

Compiler skeleton for "NearlyC", a subset of C

Primary LanguageC++

NearlyCC: compiler skeleton for the "NearlyC" C subset

This project is a compiler framework for the NearlyC C subset front end. It contains the following components (in addition to the code provided by nearly_c):

It omits implementation of the following components:

  • Semantic analysis (type checking, building symbol tables and annotating AST nodes with pointers to symbol table entries, insertion of implicit conversions)
  • Code generation
  • Optimization

API documentation is available. (This is in progress, but should be complete soon.)

This project was developed for the 601.428 Compilers and Interpreters course at Johns Hopkins University. The Fall 2023 course web page has the assignments in which students implement the missing parts. (Note that the code in this repository has been refactored quite a bit, so some minor details have changed.) The Fall 2023 course also has a test repository which is useful for testing code generation. (The assign04 and assign05 subdirectories have the code generation tests.)

This repository is intended to be the official "public" release of NearlyCC. It is in a somewhat preliminary form currently, but is definitely at a point where it is useful. I will be adding documentation and making improvements in the future.

Please send comments to mailto:daveho@cs.jhu.edu.