This is the next entry in the series on program transformation systems. This article describes C-Breeze, a compiler system for C source code.
C-Breeze is a compiler project for C programs. The purpose of the project is to provide access to the compiler data structures through an API in C++. Two data structures are provided: the AST, via a tree walker class and node editing class; the machine independent control flow graph (MIR). Additional components include a code generator
Several projects have been based on C-Breeze. Leow, Ng, and Wong (2006) used C-Breeze to compile OpenMP C programs and generate code for FPGAs. Jacobs and Lewis (2006) extended C-Breeze to provide “smart macros”, which are source-to-source translations for checking user code after parsing. Using these type-aware patterns, the system can add checks for null pointer dereferences, debugging output statements, etc.
Observations and notes
- C-Breeze is a compiler infrastructure and does provide for some program transformation features, such as an AST visitor API, and AST rewriter. But, there is no pattern matching/rewrite language for ASTs.
- Due to other infrastructures available (LLVM, SUIF), it hasn’t been used since, outside of computer science course work.
- The source and/or executables aren’t available, but the documentation is. For example, all the AST node types are described here. The Walker class is used to visit AST nodes in a
partcularorder. The Changer class is used to alter the AST.
Jacobs, M. and Lewis, E.C., 2006, September. SMART C: A semantic macro replacement translator for C. In 2006 Sixth IEEE International Workshop on Source Code Analysis and Manipulation (pp. 95-106). IEEE. (DOI, pdf)
Brown, A., Guyer, S.Z., Jiménez, D.A. and Lin, C., 2004. The C-Breeze compiler infrastructure. Department of Computer Sciences, The University of Texas, Austin, TX,” Technical report. (ps)
Streiff, B., 2008. Bullseye: A System for Targeted Test Generation. (pdf)