I have dump the AST Tree of a simple C++ codes.
Is it possible to only visit the nodes selected and ignore everything else including the children using libTooling or ASTMatchers?
I have dump the AST Tree of a simple C++ codes.
Is it possible to only visit the nodes selected and ignore everything else including the children using libTooling or ASTMatchers?
stmt
(or a subclass of statements good for you) hasParent
, probably a CompundStmt
based on your example.CompundStmt
hasParent
, which is a FunctionDecl
See the AST matchers reference for details.