objective c - Parse AST from an ObjC header using libClang -



objective c - Parse AST from an ObjC header using libClang -

i'm using libclang lint objective-c codes. stuck in parsing objc header file (.m fine) , can ast standalone ? here's test codes, trying @interfaces , @protocols.

void clangtest(void) { cxindex index = clang_createindex(0, 1); const char *args[] = { // should have 1 ? }; int numargs = sizeof(args) / sizeof(*args); cxtranslationunit tu = clang_parsetranslationunit(index, "/path/to/anobjcclass.h", args, numargs, null, 0, cxtranslationunit_none); clang_visitchildrenwithblock(clang_gettranslationunitcursor(tu), ^(cxcursor cursor, cxcursor parent){ // never reach here if (clang_getcursorkind(cursor) == cxcursor_objcinterfacedecl || clang_getcursorkind(cursor) == cxcursor_objcprotocoldecl) { // neither here, hoped } homecoming cxchildvisit_continue; }); }

objective-c libclang

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -