💾 Archived View for jb55.com › ward.bay.wiki.org › c-in-4-funs captured on 2021-12-05 at 23:47:19. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-12-04)
-=-=-=-=-=-=-
This self-compiling subset of C is written in one 500 line file containing four functions. Branches add syntactic sugar like struct and switch. github
Inspiration for Another Mini ARM C Compiler (AMaCC) built from scratch, supporting ARM architecture, with three execution modes: interpret, JIT or ELF for ARM. github
next() scans for next token.
expr(int lev) compiles expressions.
stmt() compiles statements.
main(int argc, char **argv) alloc, compile and execute.
Bootstrap the compiler with gcc.
Compile and execute one file.
Compile the compiler which then executes to compile and execute the next argument.
Nest the compiler-compiles which execute recursively.