1

I am developing a static analyzer for objective-c and I need details about the external methods that are called in the code (the declaring class, the return type and the arguments). Is there a way or a tool that allows me to have this information ?

EDIT: how can I use CLang (or GCC) to access the header files and get this information programmatically?

  • Yes; read the class/method declarations from the header file. – trojanfoe Apr 05 '16 at 09:03
  • and how to access the header files programmatically? – Sarah Habchi Apr 05 '16 at 09:06
  • Implement the preprocessor. You'll probably want to implement it completely (i.e. `#ifdef` and not just `#import`/`#include`). – trojanfoe Apr 05 '16 at 09:08
  • Implementing a preprocessor may be very complicated. How can I use the available preprocessors programmatically to get the information? – Sarah Habchi Apr 05 '16 at 11:56
  • Creating a static analyser is very complicated but luckily Xcode already provides one. What will your one do differently? – trojanfoe Apr 05 '16 at 11:59
  • We have an anti-patterns identifier that works on Android and we want to adapt it to iOS, so we need a simple analyser that identifies entities (classes, methods, external methods, arguments and variables) and their dependencies. Eveything is working except the external stuff. Our application is written in Java, that's why we couldn't use a Clang Lib and we had to write our own parser. – Sarah Habchi Apr 05 '16 at 12:04

0 Answers0