End-to-end: Modula-2 source → Coco/R frontend → SymTab checks →
fresh QbeGen → gen_ssa/<Mod>.ssa → qbe → cc → native binary
returning ExitCode. Blaise Phase-1 equivalent (bootstrap pipeline).
MODULE + CONST (signed literal) + VAR .. : INTEGER +
assignment + integer expressions (+ - * DIV MOD, leading sign,
parens, H hex). Errors: 200/201/202/210/211/221 + step-1 230s
(REAL/STRING literals, non-INTEGER VAR type, non-literal CONST,
imported names as values). Grammar is LL(1)-clean
(Compilation completed. No errors detected.); one conflict found
and fixed during the step (trailing ; in StatSeq).
compiler/src/M2.atg (fresh, ~250 lines) — the interactive artefact.compiler/src/QbeGen.def/.mod (fresh) — Test2-compatible signatures
(LoadVar/StoreVar/Op3/NegQ keep isReal params) so step 2 grows
without ATG rewrites. Deterministic %tN counters (fixpoint-safe).FileIO, SymTab (full Test2 copies),
scanner/parser/compiler.frm (230 text retargeted to step 1).compiler/build.sh, compiler/run_tests.sh, 5 tests.3 run (t_minimal→0, t_exit→7, t_arith→25: precedence, DIV
truncation, hex 10H=16, CONST loads) + 2 reject (201 undeclared,
202 name mismatch). Verified TArith.ssa by hand.
DIV/MOD are truncating (C/QBE semantics, not Modula-2 floor).TYPE, no procedures, no composites, no U-literals —
all syntax errors today, 230s where tokens exist (real/string).gen_ssa/ binaries/logs are build outputs (gitignored).Next: step 2 (scalar type system: REAL/BOOLEAN/CHAR/enum, relations,
IF/WHILE) reusing the same harness.