So LibClang has been ditched, and I've got my own little library going that I named JClang (and ASTFilter, which is separate but necessary).
JClang basically just imitates the functionality of LibClang, but just directly operates over the json AST, so it doesn't hide any part of the AST.
Right now basically all JClang does is track scope and provide utilities for interacting with the AST. It is built for a traversal model, but I think that I could implement some other cool features -
Linking different parts of the AST to each other
Each node has an ID hash, and some nodes have references to other (for example, a typedef node holds the id of the definition of the existing type)
LibClang has the ability to follow these links (but it doesn't always work, especially around class templates). I think that I could implement this as well.
I think it would involve indexing the entire AST and keeping something like a hashmap<id, json&> lookup structure
I've got everything working through free functions and argument passing right now, I'd probably want it to be object oriented if I do this though. I should make this change sooner rather than later.
AST system header filtering
I got a system header filter mechanism working in ASTFilter. It has occurred to me that I don't really need to do this separately.
Currently, I generate an AST, filter it, and then traverse it, but I can just filter branches during traversal.
I have the ability to determine whether a file is a system header, so I can just use that during traversal like the LibClang version of this did.
The ASTFilter is really useful as a standalone utility too. I think I should pull the SourceManager functionality into JClang and leave a front end ASTFilter tool to dump filtered ASTs easily.
Build a better traversal model
traversal is super manual right now. Maybe make it not be like that? Maybe something with callbacks?
Overall, JClang can barely be called a library right now because the Traversal functions are tightly coupled to the intermediate representation that I built for ICG. I think it would take a visitor/callback model to fix that
So LibClang has been ditched, and I've got my own little library going that I named JClang (and ASTFilter, which is separate but necessary).
JClang basically just imitates the functionality of LibClang, but just directly operates over the json AST, so it doesn't hide any part of the AST.
Right now basically all JClang does is track scope and provide utilities for interacting with the AST. It is built for a traversal model, but I think that I could implement some other cool features -
hashmap<id, json&>
lookup structure