Files
codeql-cpp-ast/queries/printast.ql
Michael Hohn c93451f34f first version
2021-09-09 18:00:24 -07:00

22 lines
505 B
Plaintext

/**
* @name Print AST
* @description Outputs a representation of the Abstract Syntax Tree.
* @id cpp/print-ast
* @kind graph
*/
import cpp
import semmle.code.cpp.PrintAST
/**
* Temporarily tweak this class or make a copy to control which functions are
* printed.
*/
class Cfg extends PrintASTConfiguration {
/**
* TWEAK THIS PREDICATE AS NEEDED.
* Holds if the AST for `func` should be printed.
*/
override predicate shouldPrintFunction(Function func) { func.getName() = "main" }
}