{"id":1857,"date":"2019-03-10T06:01:26","date_gmt":"2019-03-10T10:01:26","guid":{"rendered":"http:\/\/codinggorilla.com\/?p=1857"},"modified":"2019-03-11T06:37:00","modified_gmt":"2019-03-11T10:37:00","slug":"c-breeze","status":"publish","type":"post","link":"http:\/\/165.227.223.229\/index.php\/2019\/03\/10\/c-breeze\/","title":{"rendered":"Series on program transformation systems: C-Breeze (2004)"},"content":{"rendered":"\n<p>This is the next entry in the series on program transformation systems. This article describes <a href=\"http:\/\/www.cs.utexas.edu\/users\/c-breeze\/\">C-Breeze<\/a>, a compiler system for C source code. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p>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 <g class=\"gr_ gr_8 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-del replaceWithoutSep\" id=\"8\" data-gr-id=\"8\">backend,<\/g> and a C source generator. Program transformations are possible using the tree walker and node editor, but it is only accessible using a C++ API.<\/p>\n\n\n\n<p><img class=\"wp-image-1860\" width=\"100%\" src=\"http:\/\/codinggorilla.com\/wordpress\/wp-content\/uploads\/2019\/03\/img1.png\" alt=\"\"><\/p>\n\n\n\n<p>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 &#8220;smart macros&#8221;, 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.<\/p>\n\n\n\n<h2>Observations and notes<\/h2>\n\n\n\n<ul><li>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.<\/li><li>Due to other infrastructures available (<a href=\"http:\/\/llvm.org\/\">LLVM<\/a>, <a href=\"https:\/\/suif.stanford.edu\/suif\/\">SUIF<\/a>), it hasn&#8217;t been used since, outside of computer science course work.<\/li><li>The source and\/or executables aren&#8217;t available, but the documentation is. For example, all the AST node types are described <a href=\"http:\/\/www.cs.utexas.edu\/users\/c-breeze\/html\/group__AST.html\">here<\/a>. The <a href=\"http:\/\/www.cs.utexas.edu\/users\/c-breeze\/html\/classWalker.html\">Walker<\/a> class is used to visit AST nodes in a <g class=\"gr_ gr_187 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace\" id=\"187\" data-gr-id=\"187\">partcular<\/g> order. The <a href=\"http:\/\/www.cs.utexas.edu\/users\/c-breeze\/html\/classChanger.html\">Changer<\/a> class is used to alter the AST.<\/li><\/ul>\n\n\n\n<h2>References<\/h2>\n\n\n\n<p>Leow, Y.Y., Ng, C.Y. and Wong, W.F., 2006, December. Generating hardware from OpenMP programs. In <em>2006 IEEE International Conference on Field Programmable Technology<\/em>(pp. 73-80). Ieee. (<a href=\"https:\/\/ieeexplore.ieee.org\/abstract\/document\/4042418\">DOI<\/a>, <a href=\"https:\/\/www.comp.nus.edu.sg\/~wongwf\/papers\/fpt06.pdf\">pdf<\/a>) <\/p>\n\n\n\n<p>Jacobs, M. and Lewis, E.C., 2006, September. SMART C: A semantic macro replacement translator for C. In <em>2006 Sixth IEEE International Workshop on Source Code Analysis and Manipulation<\/em> (pp. 95-106). IEEE. (<a href=\"https:\/\/ieeexplore.ieee.org\/abstract\/document\/4026859\">DOI<\/a>, <a href=\"https:\/\/repository.upenn.edu\/cgi\/viewcontent.cgi?article=1474&amp;context=cis_papers\">pdf<\/a>)<\/p>\n\n\n\n<h2>Additional Reading<\/h2>\n\n\n\n<p>Brown, A., Guyer, S.Z., Jim\u00c3\u00a9nez, D.A. and Lin, C., 2004. The C-Breeze compiler infrastructure.&nbsp;<em>Department of Computer Sciences, The University of Texas, Austin, TX,\u00e2\u20ac\u009d Technical report<\/em>.  (<a href=\"http:\/\/www.cs.utexas.edu\/users\/c-breeze\/tr\/c_breeze.ps\">ps<\/a>)<\/p>\n\n\n\n<p>Guyer, S.Z. and Lin, C., 2005. Broadway: A compiler for exploiting the domain-specific semantics of software libraries. <em>Proceedings of the IEEE<\/em>,&nbsp;<em>93<\/em>(2), pp.342-357. (<a href=\"https:\/\/ieeexplore.ieee.org\/abstract\/document\/1386656\">DOI<\/a>, <a href=\"https:\/\/www.researchgate.net\/profile\/Samuel_Guyer\/publication\/260686692_Broadway_A_Compiler_for_Exploiting_the_Domain-Specific_Semantics_of_Software_Libraries\/links\/00b7d51842199c1a2b000000.pdf\">pdf<\/a>)<\/p>\n\n\n\n<p>Streiff, B., 2008. Bullseye: A System for Targeted Test Generation. (<a href=\"http:\/\/www.cs.utexas.edu\/ftp\/techreports\/honor_theses\/cs-08-10-streiff.pdf\">pdf<\/a>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the next entry in the series on program transformation systems. This article describes C-Breeze, a compiler system for C source code.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts\/1857"}],"collection":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/comments?post=1857"}],"version-history":[{"count":0,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/posts\/1857\/revisions"}],"wp:attachment":[{"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/media?parent=1857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/categories?post=1857"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/165.227.223.229\/index.php\/wp-json\/wp\/v2\/tags?post=1857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}