ERPlag Compiler Build
ERPlag Compiler Build
The ERPlag-Compiler is a full compiler in C for a custom language. It covers lexing, parsing, semantic checks and code gen.
It shares the arena allocator from Cache-Engine-Deep-Dive and the search thinking behind BRKGA-Orienteering.
Pipeline
Source -> lexer (regex to tokens) -> parser (recursive descent) -> AST -> semantic pass -> IR -> code gen.
Errors are reported with line and column, not just fail.
Symbol Table
Hash table with scope stack. Enter scope on {, exit on }. Lookup walks stack. Similar sharding as Cache-Engine-Deep-Dive but for scopes.
Testing
We test with hand written programs plus a fuzzer that generates random valid programs and compares output with a reference interpreter. See Tetris-BRKG-AI for fuzz like evolution.
Project: ERPlag Custom Compiler Related: PR-Review-Agent uses AST chunking which is essentially parsing for embeddings.