mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
C++: Add a sample class in PrintAST.ql
I've found myself typing out this class whenever I want to print the AST of one function. I hope it will be useful to others too.
This commit is contained in:
@@ -7,3 +7,12 @@
|
||||
|
||||
import cpp
|
||||
import PrintAST
|
||||
|
||||
/**
|
||||
* Temporarily tweak this class or make a copy to control which functions are
|
||||
* printed.
|
||||
*/
|
||||
class Cfg extends PrintASTConfiguration {
|
||||
/** Holds if the AST for `func` should be printed. */
|
||||
override predicate shouldPrintFunction(Function func) { any() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user