1 unstable release
Uses new Rust 2024
| 0.1.0 | Dec 2, 2025 |
|---|
#432 in Programming languages
23KB
378 lines
Vex Compiler
A compiler for the Vex programming language.
Overview
The Vex compiler (vexc) transforms Vex source code into executable programs
through a series of compilation phases.
Modules
lexer- Tokenizes source code into lexical tokens- (Future:
parser- Builds abstract syntax trees) - (Future:
codegen- Generates target code)
Quick Start
use vexc::lexer::{Lexer, Token};
let mut lexer = Lexer::new("let x = 42;");
loop {
match lexer.next_token() {
Ok(Token::Eof) => break,
Ok(token) => println!("{:?}", token),
Err(e) => {
eprintln!("Error: {}", e);
break;
}
}
}
Compilation Pipeline
- Lexical Analysis - Source text → Tokens
- Parsing - Tokens → AST (coming soon)
- Semantic Analysis - Type checking (coming soon)
- Code Generation - AST → Target code (coming soon)
Additional Module Information
This crate is organized into several key modules:
Core Compiler Modules
lexer- Lexical analysis and tokenization
Vex Programming Language
A compiler and toolchain for the Vex programming language.
Project Structure
vexc/- The Vex compiler library and CLI
Building
cargo build --release
Testing
cargo test
Documentation
Generate and view the documentation:
cargo doc --no-deps --open
License
Dependencies
~160–570KB
~13K SLoC