I’m trying to parse the following file: http://opensource.apple.com/source/IOUSBFamily/IOUSBFamily-630.4.5/IOUSBUserClient/Classes/IOUSBInterfaceUserClientV3.cpp
With the following command:
clang -ferror-limit=1000 -Xclang -ast-dump -I$HOME/Downloads/IOUSBFamily-630.4.5/IOUSBUserClient/Headers ~/Downloads/IOUSBFamily-630.4.5/IOUSBUserClient/Classes/IOUSBInterfaceUserClientV3.cpp
Since so many errors occur though, clang does not emit nearly as much information as I’d like. Specifically I’m trying to get the IOUSBInterfaceUserClientV3::sV3Methods[kIOUSBLibInterfaceUserClientV3NumCommands]
definition but the following error occurs:
IOUSBFamily-630.4.5/IOUSBUserClient/Classes/IOUSBInterfaceUserClientV3.cpp:56:7: error: expected function body after function
declarator
const IOExternalMethodDispatch
^
The OSDefineMetaClassAndStructors
macro seems to throw off parsing (even within Xcode).
You can download the full source at http://opensource.apple.com/tarballs/IOUSBFamily/IOUSBFamily-630.4.5.tar.gz to try reproducing.
I was wondering if there’s any way to use libclang or clang’s -ast-dump
switch to get something resembling the output I desire? Specifically the IOUSBInterfaceUserClientV3::sV3Methods[kIOUSBLibInterfaceUserClientV3NumCommands]
definition (I’m just trying to get info about the elements).