Skip to content
IndicKangarooPublic

About

my lang

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

47 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Argon — A Simple Compiler Toolchain

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.


Features

  • 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

Project Structure

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

Language Specification

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

Requirements

You need:

  • GCC
  • GNU Make

Arch Linux

sudo pacman -S gcc make

Debian/Ubuntu

sudo apt install gcc make

Building

make

Creates:

./argon

Running

make run

Or manually:

./argon tests/test.arg

Getting the Return Value

After 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.


Debug Build

make debug

Cleaning

make clean

Development Notes

  • Source files are auto-detected
  • Headers are tracked automatically
  • Incremental builds enabled
  • Object files stored in build/

Usage Example

make
./argon program.arg
./out
echo $?

License

MIT License

About

my lang

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages