Argon is a custom compiler written in C. It takes .arg source files and translates them into executable programs using the GNU toolchain (gcc + gas + ld).
This project is built as a modular compiler with separate stages for lexing, parsing, and code generation.
- Written in C
- Modular design (lexer, parser, codegen, tokens)
- Uses GNU assembler (gas) via gcc
- Incremental builds with Make
- Automatic header dependency tracking
- Debug mode support
argon/
├── Makefile
├── src/
│ ├── main.c
│ ├── lexer.c / lexer.h
│ ├── parser.c / parser.h
│ ├── token.c / token.h
│ ├── codegen.c / codegen.h
│ └── ...
├── build/ (generated)
├── tests/
│ └── test.arg
└── README.md
The complete specification of the Argon programming language is documented in:
LANGUAGE.md
This file describes:
- Syntax and grammar (EBNF)
- Supported features
- Data types
- Compilation model
- Limitations and roadmap
You need:
- GCC
- GNU Make
sudo pacman -S gcc makesudo apt install gcc makemakeCreates:
./argon
make runOr manually:
./argon tests/test.argAfter Argon generates the output executable (out), you can run it and check its exit status using:
./out
echo $?echo $? prints the return value of the last executed program.
make debugmake clean- Source files are auto-detected
- Headers are tracked automatically
- Incremental builds enabled
- Object files stored in
build/
make
./argon program.arg
./out
echo $?MIT License