caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* announce : Yacfe 0.2
@ 2008-10-31 16:20 Yoann Padioleau
  0 siblings, 0 replies; only message in thread
From: Yoann Padioleau @ 2008-10-31 16:20 UTC (permalink / raw)
  To: OCaml


Dear list,

I am pleased to announce the first release of Yacfe, Yet Another C/C++
Front-End, which is an OCaml API to write style-preserving source-to-source
transformations such as refactorings on C or C++ source code.

The goal of Yacfe is to parse the code as-is, and to represent it
internally as-is. Yacfe thus maintain in the abstract syntax tree (AST)
as much information as possible so that one can transform this AST and
unparse it in a new file while preserving the coding style of the
original file. Yacfe preserves the whitespaces, newlines, indentation,
and comments from the original file, as well as the C preprocessor
(cpp) macros and cpp directives. 

Other source-to-source transformation tools such as CIL [1] do not
preserve this coding style as they first call cpp on the original file
and perform the transformation on the preprocessed file. The AST of
Yacfe on the opposite contains explicit constructions representing cpp
directives, macro definitions, or cpp idioms such as macro iterators
as in 'list_for_each(i, x) { printf("%d", x); }'. "What You See In The
Yacfe AST Is What Was Written". The Yacfe abstract syntax tree is thus
in fact more a concrete syntax tree (cf parsing_c/ast_c.ml).


Yacfe is free software under GPL license and is available at

  http://aryx.kicks-ass.org/~pad/software-yacfe.php

A simple example of the code of a style-preserving program transformation 
using the Yacfe API is available here:

  http://aryx.kicks-ass.org/~pad/software/project-yacfe/simple_zero_to_null.ml.html


If you want to do fancy static analysis on C code, use CIL [1], it is
better equiped for that task, more robust, more mature. If you want to
do style-preserving source-to-source transformation, well, you may
find Yacfe useful.

[1] http://manju.cs.berkeley.edu/cil/


PS: Yacfe was extracted from the code of the Coccinelle project 
http://www.emn.fr/x-info/coccinelle/ for Linux device drivers
evolutions. Yacfe was supported mainly by money from l'Ecole des 
Mines de Nantes as well as money from the University of Urbana-Champaign.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-10-31 16:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-31 16:20 announce : Yacfe 0.2 Yoann Padioleau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).