<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi,</div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>i'd like to use CLang to parse c++ files to AST. The examples from </span><span>https://github.com/loarabia/Clang-tutorial look nice, but I don't see any parsing to a structure that would hold the whole parsed AST (i.e. comparable to the DOM tree/document generated by DOM-based XML parsers). Instead, what I see is an event-based parsing API (comparable to SAX for XML parsers) where I subclass clang::ASTConsumer and my class gets events and has to store the tree structure itself somehow.<br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style:
 normal;"><span>So before i do that (and probably re-invent the wheel in the process), I thought I'd better ask: is there some default tree structure that would save the whole parsed AST and that i can keep and use after the parsing is done (i.e. the AST equivalent of a </span><span><span>DOM/XML </span>DomDocument) and some easy way to automatically get that structure filled with the whole AST tree instead of getting events?</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style: normal;"><span>Best Regards,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: times new roman,new york,times,serif; background-color: transparent; font-style:
 normal;"><span>Kevin<br></span></div></div></body></html>