3 ms·
To make this applicable to other APIs, wouldn't it be better to use the Clang API to parse the C/C++ code and get a list of functions? Writing your own parser s
by unfamiliar 13y ago
To make this applicable to other APIs, wouldn't it be better to use the Clang API to parse the C/C++ code and get a list of functions? Writing your own parser seems prone to failure given the difficulty of C/C++ parsing.
- girvo 13y agoYeah. Has GCC built that feature in as well yet, or is the "plugin" side still pretty crippled? If one went about writing a nice generic tool like this, you'd want it to be able to handle both, I guess.
- stingraycharles 13y agoOfficially, GCC has it built-in, but I don't know of many projects using it. As far as I understand, Clang's API is more pleasant to use.
- dradtke 13y agoYeah, my approach is definitely one of "get it done as quickly as possible for my specific use case", and since Allegro made its headers easy to parse, I decided to just take advantage of that. Maybe in the future I'll rewrite it to use libclang.