🦩

NV Compiler

A complete programming language implementation from source code to machine code.

📊 Visualization Panel

Architecture

📝
Source Code
🔤
Lexer
Tokenization
🌳
Parser
AST Generation
Optimizer
Constant Folding
🎯
Interpreter
💻
VM
🔧
LLVM

Features

🔤

Lexical Analysis

Tokenizes source code into a stream of tokens with line tracking.

🌳

Recursive Descent Parser

Builds Abstract Syntax Tree using top-down parsing.

AST Optimization

Constant folding and expression simplification.

🎯

Tree-Walk Interpreter

Direct AST execution for quick testing.

💻

Stack-Based VM

Custom bytecode compiler and virtual machine.

🔧

LLVM Backend

Generates native executables via LLVM IR.

Language Syntax

Variables & Expressions
x := 10 + 5 * 2
name := "Hello"
flag := true
Control Flow
if x > 10 then
    println("Big")
else
    println("Small")
end
Loops
for i := 1, 10 do
    println(i)
end

while x > 0 do
    x := x - 1
end
Functions
func add(a, b)
    ret a + b
end

result := add(3, 4)
📊 Visualization Panel View Source Code