jcc1 Compiler Framework
Design Overview
This section provides an overview of the directory structure under lib/
, which contains the core compiler functionality:
|
AST node definitions |
|
Flex and Bison grammar files, and support classes |
|
Parse tree node definitions and visitor pattern |
|
Compiler pass definitions. The important ones are: |
|
All IR transformation passes |
|
Front-end parsing and AST builder passes |
|
Pass to hold the IR context lifetime |
|
Semantic analysis passes |
|
Semantic analysis passes, checks the semantics of JOOSC code. |
|
Misc checks on AST (i.e., if condition must be bool, etc.) |
|
Builds the control flow graph (CFG) for dataflow analysis |
|
Dataflow analysis |
|
Checks expressions for illegal static/non-static uses |
|
Huge file, resolves names in expressions + misc. checks |
|
Context-free type checks on a single expression |
|
Builds + validates class inheritance hierarchy |
|
Builds import + package resolution trees for each CU |
|
AST node builder + basic semantic checking |
|
Contains CLI11 command arguments parser and backtrace libraries |
|
Support code, like exceptions and macros. |
The joosc compiler as well as a jcc1 compiler are under tools/
. jcc1
is used to test locally as it has more verbose error reporting and a rich command line feature set. joosc
is only for submission.