Module PrintAST
Provides queries to pretty-print a C++ AST as a graph.
By default, this will print the AST for all functions and global and namespace variables in
the database. To change this behavior, extend PrintASTConfiguration and override
shouldPrintDeclaration to hold for only the declarations you wish to view the AST for.
Import path
import semmle.code.cpp.PrintASTImports
| cpp | Provides classes and predicates for working with C/C++ code. |
Predicates
| edges | Holds if |
| graphProperties | Holds if property |
| nodes | Holds if |
Classes
| AstNode | A node representing an AST node other than a |
| BaseAstNode | A node representing an AST node. |
| C11GenericNode | A node representing a |
| CastNode | A node representing a |
| ChildStmtNode | A node representing a child of a |
| ConceptIdExprArgumentsNode | A node representing the arguments of a |
| ConceptIdExprNode | A node representing a |
| ConceptIdExprTypeArgumentNode | A node representing a type argument of a |
| ConstructorInitializersNode | A node representing the initializer list of a |
| ConversionNode | A node representing a |
| DeclStmtNode | A node representing a |
| DeclarationEntryNode | A node representing a |
| DestructorDestructionsNode | A node representing the destruction list of a |
| ExprNode | A node representing an |
| FunctionNode | A node representing a |
| FunctionParametersNode | A node representing the parameters of a |
| GlobalOrNamespaceVariableNode | A node representing a |
| HandlerNode | A node representing a |
| InitializerNode | A node representing an |
| ParameterNode | A node representing a |
| PrintAstConfiguration | The query can extend this class to control which declarations are printed. |
| PrintAstNode | A node in the output tree. |
| RequiresExprNode | A node representing a |
| RequiresExprParametersNode | A node representing the parameters of a |
| StmtExprNode | A node representing a |
| StmtNode | A node representing a |
| StringLiteralNode | A node representing a |
| VariableDeclarationEntryNode | A node representing a |