Understanding abstract syntax tree generated in front-end phase of g++ compilation
I want to look at the syntax tree that is generated by g++ during compilation. Actually I want to understand the way how high-level C++ statements (especially initialization statements of classes and structure objects) are parsed by the g++ compiler and how the compiler do the semantic analysis of these constructs. My objective is specific for g++ only, and any general information regarding parsing and semantic analysis will not be helpful for me.开发者_如何学运维
Looking at the g++ code, I could find out the data structure used inside and the different type of nodes it creates in files tree.def etc. I am wondering if there are good documentations available somewhere explaining this issue. Any help will be appreciated.
In addition to GCC internals document mentioned above, there is a Mozilla project called Treehydra that is a gcc plugin that will actually let you play with the GIMPLE ASTs using Javascript. IMO this is a great way to learn about the GCC implementation.
精彩评论