5 releases (1 stable)
Uses new Rust 2024
new 1.0.3 | Apr 24, 2025 |
---|---|
0.6.0 | Apr 21, 2025 |
0.5.0 | Mar 13, 2025 |
0.4.0 |
|
0.1.0 | Mar 2, 2025 |
#212 in Programming languages
118 downloads per month
310KB
4.5K
SLoC
A C compiler with graphs.
SYNOPSIS
recc [stage_arguments] file_to_compile [display_option]
REQUIREMENTS
If you are using the graph renderer and/or frontend, you need to have dot, from graphviz.
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 |
HELP ME |
-h |
Any string containing "-h" can be used to ask for help.
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. Additionally, to change to light mode for the frontend, add -l
or --light
You can also use some environment variables to customize the output.
RECC_FRONTEND_CSS=<file-name>
This changes the CSS file used throughout the program. An example is given at the pastebin at the end, and the code itself contains 2 css examples (DARKSTYLE, LIGHTSTYLE) [You do have to remove the html tags around them though to use them in a custom file]
This changes the foreground value of the generated graph. Use .
RECC_FOREGROUND_COLOR=white
This changes the background value of the generated graph.
RECC_BACKGROUND_COLOR=black
Use the environment RECC_LISTEN_ADDR_AND_PORT
to specify the listening address and port.
RECC_LISTEN_ADDR_AND_PORT=127.0.0.1:7878
The server will be opened on localhost:7878 by default.
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
Customizable listen and port location
User theming
Example CSS: https://pastebin.com/13xWTgf5
Dependencies
~1.5MB
~25K SLoC