How spydr06/bcause works
Project type and purpose
• BCause is a single-pass compiler for the historic B language, written in C99.
• Its role is to take a .b source file, parse and translate it to x86_64 machine code via GNU binutils, and link it against a minimal B standard library (libb.a).
File structure
Top level:
• Makefile, README.md, LICENSE → build and documentation.
• examples/ → sample B programs.
• src/
• src/compiler/ → the compiler proper, comprising:
– main.c: entry point and CLI driver
– compiler.c/h: orchestration of compilation stages
– list.c/h: internal linked‐list utility for AST or token lists
• src/libb/ → implementation of B’s standard library, built into libb.a.
• tests/ → googletest-based unit and integration tests (CMakeLists.txt plus .cpp files).
README for additional insights
• The README confirms the use of GNU make, binutils (as, ld), and C99.
• It describes supported language features (globals, functions, flow control, expressions).
• It shows that no extra dependencies beyond libc/binutils are used.