<div>I’m trying to parse the following file: http://opensource.apple.com/source/IOUSBFamily/IOUSBFamily-630.4.5/IOUSBUserClient/Classes/IOUSBInterfaceUserClientV3.cpp</div><div><br></div><div>With the following command:</div><div><br></div><div>    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</div><div><br></div><div>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:</div><div><br></div><div><div>IOUSBFamily-630.4.5/IOUSBUserClient/Classes/IOUSBInterfaceUserClientV3.cpp:56:7: error: expected function body after function</div><div>      declarator</div><div>const IOExternalMethodDispatch</div><div>      ^</div></div><div><br></div><div>The `OSDefineMetaClassAndStructors` macro seems to throw off parsing (even within Xcode).</div><div><br></div><div>You can download the full source at http://opensource.apple.com/tarballs/IOUSBFamily/IOUSBFamily-630.4.5.tar.gz to try reproducing.</div><div><br></div>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).