On Sat, Nov 27, 2010 at 10:22 AM, Jani Monoses <[email protected]> wrote:
> Hi Yoann,
>
>> It lives in pfff now:
>> https://github.com/facebook/pfff/wiki/Main
>>
>> in this directory:
>> https://github.com/facebook/pfff/tree/master/lang_cpp/parsing/
>>
>> It's even more hacky than the C parser ...
>
> how usable is it? I see C++ support is said to be preliminary, what does it
> mean in practice for simple refactorings?

As said here: https://github.com/facebook/pfff/wiki/Matrix
there is only very basic parsing support for now. No unparser so no
source-to-source transformation
so no refactoring.

Here is what needs to be done:
 - complete the actions in the grammar (parser_cpp.mly) to actually
generate AST constructs (ast_cpp.ml) for all the rules
   (there are lots of TODO in the file)
 - possibly cleanup ast_cpp.ml to use julia's wrap technique (in
ast_cocci.ml) instead of mine (in ast_c.ml) which
 - write an unpaser (could be easier with a cleaner ast_cpp.ml)
 - backport the preprocessor parsing improvements in coccinelle
parsing_c/   to parsing_cpp/

Then to get refactoring support a la coccinelle one can either try to
fit c++ in coccinelle:
 - generate from a ast_cpp.ml AST a CFG that is compatible with the
one in coccinelle so we can reuse most of
   the infrastructure in coccinelle. That's quite long to do because
there are lots of boilerplate code to write.
   Also one need to decide how to convert C++ constructs like  new A()
into C/coccinelle constructs.

or try to fit coccinelle in c++
 - generate a CFG specific to C++
 - port parsing_cocci/ to C++
 - port the matcher/transformer to C++
 - design new metavariables specific to C++

>
> Jani
>
> _______________________________________________
> Cocci mailing list
> [email protected]
> http://lists.diku.dk/mailman/listinfo/cocci
> (Web access from inside DIKUs LAN only)
>
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to