YANC
Yet Another Compiler
YANC is the compilation backbone of the SAPHO ecosystem. It transforms high-level CMM processor descriptions into binary executables through a two-stage pipeline: cmmcomp (CMM → Assembly) and asmcomp (Assembly → Machine Code), plus the APP auxiliary pre-processor. Written in C using Flex, Bison, and GCC.
Compilation Pipeline
YANC implements a classical two-stage compiler architecture. Source CMM code enters cmmcomp, where Flex tokenises the input and Bison parses the grammar into an AST. Code generation produces SAPHO assembly, which asmcomp then assembles into a binary hex file ready for FPGA loading or YAWT simulation.
Toolchain Components
#define, #include, and constant-folding before cmmcomp ingests the source.CMM Language Sample
SAPHO Integration
YANC is the compilation engine called by SAPHO when a student clicks Compile. POLARIS bundles YANC binaries natively; AURORA relied on the same pipeline. The entire build is triggered from within the IDE with a single keystroke.
Build Dependencies
YANC is self-contained: Flex generates the lexer C source, Bison generates the parser, and GCC compiles the resulting C files. No external runtime or library dependencies are required. A standard make invocation builds all three tools.
Teaching Use
YANC is taught as part of the Digital Logic Processors (DLP) discipline at UFJF. Students learn compiler theory by reading cmmcomp's Flex and Bison sources, tracing AST construction, and extending the grammar with new operators for course assignments.
Explore YANC on GitHub
The full YANC source — Flex grammars, Bison parser rules, and Makefile — is publicly available. Issues and pull requests are welcome.