PBXA32 ALPHA
V0.2 — C11 Scaffold
A complete x86-32 compiler pipeline written in ISO C11. From PowerBASIC source through preprocessor, lexer, parser, semantic analysis, IR, x86 code generation, COFF assembly, and PE32 linking — all in one toolchain. No C++ dependencies. No GNU extensions. Just pure standard C11 producing native Windows PE32 executables.
Written in ISO C11 (no C++, no GNU)
Target: x86-32 / PE32
7 smoke tests passing
Why PBXA32 Matters
Pure C11 Implementation
The entire compiler — lexer, parser, preprocessor, code generator, assembler, linker, runtime — is written in standard ISO C11. No C++. No GNU extensions. Builds with any C11-compliant compiler including MinGW-w64, MSVC, and Clang.
Complete x86-32 Pipeline
All seven compiler stages are implemented and tested. Tokenize PowerBASIC syntax, build an AST, lower to IR, generate x86 machine code, emit COFF objects, and link to PE32 — a full end-to-end compiler in C.
PowerBASIC Compatible
Supports directives (#COMPILE, #INCLUDE, #DIM), procedures (FUNCTION, SUB, CALLBACK), control flow (IF, SELECT, FOR, DO, WHILE), jumps (GOTO, GOSUB), aggregates (TYPE, UNION, ENUM), and classic type suffixes (% & && ! # $ @).
Per-Subsystem Smoke Tests
Every stage has its own dedicated smoke test. Test the lexer independently. Test the parser. Test the assembler. Test the linker. Isolate bugs to their layer without compiling full programs.
Quick Example
Completed Subsystems
| Stage | Status | Description |
|---|---|---|
| Preprocessor | Complete | Macro expansion, conditional compilation (#IF/#ENDIF), file includes |
| Lexer | Complete | PowerBASIC-aware tokenizer with full numeric literal support |
| Parser | Complete | Recursive-descent parser building full AST |
| Semantic | Complete | Type system, symbols, analyzer |
| IR | Complete | IR module and lowering |
| CodeGen | Complete | IR-to-x86 machine code generator |
| Assembler | Complete | x86/COFF assembler and object writer |
| Linker | Complete | PE32/i386 linker with import support |
| Runtime | Complete | Runtime library for compiled programs |
| Optimizer | 4 Stubs | Optimization pipeline scaffolded, ready for passes |
Architecture — From Source to PE32
Alpha Preview
PBXA32 is in active alpha development. The complete compiler, smoke tests, and documentation will be available for download with the first public alpha release.