#graph #tree #compiler #ast #c

nightly bin+lib recc

A C compiler with graphs

2 unstable releases

new 0.3.0 Mar 6, 2025
0.1.0 Mar 2, 2025

#226 in Programming languages

Download history 192/week @ 2025-03-01

192 downloads per month

AGPL-3.0

185KB
4.5K SLoC

A C compiler with graphs.

Graph

SYNOPSIS

recc [stage_arguments] file_to_compile [display_option]

Options

Stage Command line parameter
Lexing --lex
Parsing --parse
Semantic Analysis --validate
TACTILE IR --tactile
Assembly IR --codegen
Assembly -S
Assembling + Linking --run ǀ nothing
Render -r ǀ --render
Server -s

There are currently 7 stages and a bonus rendering stage.

The rendering step will be run after semantic analysis. The corresponding command line arguments can be used to stop at that stage, and -d or --display can be added at the end to display the state of that stage.

The server will be opened on localhost:7878

Standard cargo project, nothing funny.

Example

int fib(int n) {
    if (n == 0 || n == 1) {
        return n;
    } else {
        return fib(n - 1) + fib(n - 2);
    }
}

int main(void) {
    int n = 6;
    return fib(n);
}

Current Features:

Functions

Integers

Variables

Majority of statements

Graph making

Web UI

To add:

User themeing (probably pretty simple stuff)

Dependencies

~1.5MB
~27K SLoC