A complete compiler implementation for the Pinky programming language. Built from first principles with full lexical analysis, recursive descent parsing, AST optimization, and LLVM code generation.
Tokenizes source code into a stream of tokens with line tracking.
Builds Abstract Syntax Tree using top-down parsing.
Constant folding and expression simplification.
Direct AST execution for quick testing.
Custom bytecode compiler and virtual machine.
Generates native executables via LLVM IR.
x := 10 + 5 * 2
name := "Hello"
flag := true
if x > 10 then
println("Big")
else
println("Small")
end
for i := 1, 10 do
println(i)
end
while x > 0 do
x := x - 1
end
func add(a, b)
ret a + b
end
result := add(3, 4)