anttisalonen / cgen

cgen generates C interfaces from C++ headers
http://anttisalonen.github.com/cgen/
BSD 3-Clause "New" or "Revised" License
22 stars 6 forks source link

Using cgen on Objective-C headers causes it to return nothing. #2

Open ashgti opened 13 years ago

ashgti commented 13 years ago

If your header has any objective-c definitions in it, cgen fails to parse anything following the objective-c definition.

Eg: $ cat tester.h

    @interface Foobar
    {
      int *instance_data;
    }
    - (void) callMe;
    @end
    // Class starts here.
    class foo {
     public:
       foo();
       void bar(int);
    };

$ cgen --dump tester.h [[]]

If there is any valid C++ definitions before the objective-c definitions then it will parse those correctly.

If you want a bigger/real example, I was trying to build hogre for OS X and this is the biggest hurdle I have encountered so far. Some of the ogre headers on OS X contain objective-c code which is obviously causing problems with cgen. This is just a smaller example of the same problem.

anttisalonen commented 13 years ago

Thanks for the info. No support for Objective C is implemented in cgen. As I have no experience with Objective C I don't think I will be able to add support in the near future. If you want, you can try implementing it yourself, though.

ashgti commented 13 years ago

I may try to modify it to just skip over obj-c for now.

Its would be pretty easy to make an interface though because all of obj-c is callable from c (see http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ObjCRuntimeRef/Reference/reference.html if your interested).