Objective-C header parsing -


i need parsing of objective-c headers.

  • i've tried using doxygen , parsing xml output, doesn't support objective c headers without comments (it chokes on macros defined in properties, check doxygen not recognizing properties)
  • i've tried using appledoc, xml output not complete enough (for example, there no information of inheritance classes) , has same problem macros on properties.
  • i've tried parsing output of library objective c metadata (using otool), noticed metadata doesn't keep types on methods (so method:(id)param:(id))

does know tool want? i'm suspecting clang me, far -ast-dump , similar options tries generate ast source don't have (only headers).

you may able use libclang. libclang programmatic interface designed implementing tools syntax highlighting , code completion.

clang -ast-dump works me. (note -ast-dump not supported driver, have work pass flags driver handles. can use clang -### ... see driver doing.)

% clang -cc1 -ast-dump -fblocks -x objective-c /system/library/frameworks/foundation.framework/headers/foundation.h [...] |-objcinterfacedecl 0x1023727c0 <line:50:1, line:96:2> nsobject | |-objcprotocol 0x102371350 'nsobject' [...] 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -