from libtooling import *
def fn_finder_cb(nodes):
if nodes.getFunctionDecl("0"):
print("print function found")
def int_finder_cb(nodes):
if nodes.getVarDecl("int"):
print("integer found")
fn_finder1 = functionDecl(hasName("print")).bind("0")
int_finder = varDecl(hasType(isInteger())).bind("int")
tooling = Tooling("../tests/simple.cc")
tooling.add(fn_finder1, fn_finder_cb)
tooling.add(int_finder, int_finder_cb)
tooling.run()
-
Notifications
You must be signed in to change notification settings - Fork 3
Python bindings for writing clang-based tools based on libtooling (e.g. for refactoring, auto-completion, etc.)
License
firolino/python-clang-tooling
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Python bindings for writing clang-based tools based on libtooling (e.g. for refactoring, auto-completion, etc.)
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published