chpatrick / clang-pure

Easy C++ code analysis with pure Haskell
Apache License 2.0
35 stars 20 forks source link

AST matcher combinators? #22

Open deliciouslytyped opened 4 years ago

deliciouslytyped commented 4 years ago

Have you considered implementing https://clang.llvm.org/docs/LibASTMatchersReference.html ? They are very good at the least for prototyping with clang-check, and it would be nice if one could just transfer that over directly.

Are there any worries of scope creep? I don't know how much of clang is implemented here, but I imagine only a subset is? (I'm still learning my way around the clang project, and I'm not sure how various pieces fit together.)

chpatrick commented 4 years ago

This type of stuff is very easy with the existing API + lens, take a look at this example.