Module PrintAst
Provides queries to pretty-print a C# AST as a graph.
By default, this will print the AST for all elements in the database. To change this behavior,
extend PrintAstConfiguration
and override shouldPrint
to hold for only the elements
you wish to view the AST for.
Import path
import semmle.code.csharp.PrintAst
Imports
csharp | The default C# QL library. |
Predicates
edges | Holds if |
graphProperties | Holds if property |
nodes | Holds if |
Classes
AssignmentNode | A node representing an |
AttributeNode | A node representing an |
AttributesNode | A node representing the attributes of an |
BaseTypesNode | A node representing the base types of a |
CallableNode | A node representing a |
CastExprNode | A node representing a |
ControlFlowElementNode | A node representing a |
DeclarationWithAccessorsNode | A node representing a |
ElementNode | A node representing an AST node with an underlying |
FieldNode | A node representing a |
LocalFunctionStmtNode | A node representing a |
NamespaceNode | A node representing a |
ParameterNode | A node representing a |
ParametersNode | A node representing the parameters of a |
PrintAstConfiguration | The query can extend this class to control which elements are printed. |
PrintAstNode | A node in the output tree. |
TopLevelPrintAstNode | A top-level AST node. |
TypeMentionNode | A node representing an AST node with an underlying |
TypeNode | A node representing a |
TypeParameterNode | A node representing a |
TypeParametersNode | A node representing the type parameters of an |