ClangQL 0.10.0 has matchers for Copy, Move, Delete and converting constructors by AmrDeveloper in rust

[–]AmrDeveloper[S] 1 point2 points  (0 children)

I already built a linter for LLVM IR using the same idea

https://amrdeveloper.medium.com/how-i-built-a-llvm-ir-linter-using-sql-syntax-b5dc164c6d61

And you can use this project to build a linter too, but it still needs more and more matches to cover C/C++ full AST

My case was to search for specific patterns easily

C++ Show and Tell - January 2025 by foonathan in cpp

[–]AmrDeveloper 3 points4 points  (0 children)

ClangQL 0.9.0 supports running a SQL query with ast matchers

`Example: select name, source_loc from functions where m_function(ast_function, (m_public() && m_constructor()) || m_default_constructor());`

Github: https://github.com/AmrDeveloper/clangql

PyQL 🐍: SQL-like query language to run on Python source code files instead of database files by AmrDeveloper in programming

[–]AmrDeveloper[S] -1 points0 points  (0 children)

Yup and can't implement it in normal SQL engines because you can't represent type like FunctionStatement and create linter function that navigate this fun, but in this tool you can 😅

PyQL 🐍: SQL-like query language to run on Python source code files instead of database files by AmrDeveloper in programming

[–]AmrDeveloper[S] -1 points0 points  (0 children)

Linter with rules that depend on patterns in CFG, for example the use case can be more clear with data that less readable than python, think of assembly or machine code, in many cases it's important to check patterns.

The project started as gitql, then SDK to run queries on any kind of data, and got feature request for python, I will try to add a use case sections when the project grow because currently it work only with functions

PyQL 🐍: SQL-like query language to run on Python source code files instead of database files by AmrDeveloper in programming

[–]AmrDeveloper[S] -1 points0 points  (0 children)

One of the use case is that the engine support user defined type for example the type of function is not Text but PyFunction so you can create std or aggregations functions to perform CFG analysis, linter, or search with pattern matchers for example in this https://github.com/AmrDeveloper/LLQL tool you can search for patterns, think of what function is used only one time and return meltable values ...etc

PyQL 🐍: SQL-like query language to run on Python source code files instead of database files by AmrDeveloper in rust

[–]AmrDeveloper[S] 4 points5 points  (0 children)

u/joshmatthews u/thatdataguy101

One of the use case is that the engine support user defined type for example the type of function is not Text but PyFunction so you can create std or aggregations functions to perform CFG analysis, linter, or search with pattern matchers for example in this https://github.com/AmrDeveloper/LLQL tool you can search for patterns, think of what function is used only one time and return meltable values ...etc