mirror of
https://github.com/hohn/codeql-cpp-ast.git
synced 2025-12-16 22:33:05 +01:00
first version
This commit is contained in:
21
queries/printast.ql
Normal file
21
queries/printast.ql
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @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" }
|
||||
}
|
||||
3
queries/qlpack.yml
Normal file
3
queries/qlpack.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
name: ast-queries-cpp
|
||||
version: 0.0.0
|
||||
libraryPathDependencies: codeql-cpp
|
||||
1
queries/queries.xml
Normal file
1
queries/queries.xml
Normal file
@@ -0,0 +1 @@
|
||||
<queries language="cpp"/>
|
||||
Reference in New Issue
Block a user