Understanding the abstract syntax tree generated in the front-end g ++ compilation phase

I want to see the syntax tree that g ++ generates at compile time. Actually, I want to understand how high-level C ++ operators (especially initialization instructions of classes and structural objects) are analyzed by the g ++ compiler and how the compiler performs semantic analysis of these constructions. My goal is specific to g ++ only, and any general information regarding analysis and semantic analysis will not be useful to me.

Looking at g ++ code, I could find the data structure used internally and the various types of nodes it creates in tree.def files, etc. I am wondering if there is somewhere good documentation explaining this problem. Any help would be appreciated.

+4
source share
1 answer

In addition to the GCC internal document document mentioned above, there is a Mozilla project called Treehydra , which is a gcc plugin that will actually allow you to play with GIMPLE AST using Javascript. IMO is a great way to learn about GCC implementation.

+1
source

Source: https://habr.com/ru/post/1341406/


All Articles