We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0bbbfe5 commit 782759dCopy full SHA for 782759d
cpp/ql/src/printAst.ql
@@ -0,0 +1,27 @@
1
+/**
2
+ * @name Print AST
3
+ * @description Outputs a representation of a file's Abstract Syntax Tree. This
4
+ * query is used by the VS Code extension.
5
+ * @id cpp/print-ast
6
+ * @kind graph
7
+ * @tags ide-contextual-queries/print-ast
8
+ */
9
+
10
+import cpp
11
+import semmle.code.cpp.PrintAST
12
+import definitions
13
14
15
+ * The source file to generate an AST from.
16
17
+external string selectedSourceFile();
18
19
+class Cfg extends PrintASTConfiguration {
20
+ /**
21
+ * Holds if the AST for `func` should be printed.
22
+ * Print All functions from the selected file.
23
24
+ override predicate shouldPrintFunction(Function func) {
25
+ func.getFile() = getEncodedFile(selectedSourceFile())
26
+ }
27
+}
0 commit comments