[cfe-dev] Introducing "Deobjectivizer"

Charles Davis cdavis at mymail.mines.edu
Sun Apr 10 18:24:24 PDT 2011


Hi,

I've been working on a secret Clang-based project for a while, and now
I'm ready to share it with the world.

Introducing the "Deobjectivizer".

This is a program that scans framework bundle headers for Objective-C
constructs, and generates procedural C wrappers around them, so you can
call them from C. It uses Clang's libraries to parse, analyze, and
rewrite Objective-C headers into pure C headers, and then generate
corresponding source files containing the wrapper implementations. The
implementation of this tool is a little hackish at the moment, but it
suffices to generate a wrapper around the entire Foundation framework
(at least).

Using this program, developers no longer have to use Objective-C to
develop for Cocoa*. Projects like Wine that don't allow Objective-C can
use Cocoa anyway. iOS developers can write their programs in a language
other than Objective-C.

I've attached the source so you can play with my newest creation. At the
moment, it can only be built on Mac OS X (only one of two platforms, the
other being iOS, where a program like this makes sense anyway). Feel
free to make changes; the sources are licensed under the same license as
Clang itself.

Comments welcome. What do you think?

Chip
-------------- next part --------------
A non-text attachment was scrubbed...
Name: deobjectivizer.tar.gz
Type: application/x-gzip
Size: 27540 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110410/4b52c22a/attachment.bin>


More information about the cfe-dev mailing list