More experiments with libclang

Tags: programming, howtos, projects

Published on
« Previous post: A brief analysis of U.S. Presidential … — Next post: Using tf–idf to analyse U.S. … »

In late 2015, I started fiddling with libclang in order to analyse abstract syntax trees. After multiple queries reached me via e-mail, I decided to create a public repository of my experiments.

The repository is called libclang-experiments and resides on my GitHub account. It contains the code for the first blog post about libclang, which presented some basic routines for walking an abstract syntax tree, as well as code for the second blog post, which dealt with counting the extents of a function.

Note that since libclang is somewhat fiddly to use, the repository also provides a CMake module for actually finding the library on your computer. Please refer to the CMakeLists.txt of the repository for usage information—and do not hesitate to contact me, either via e-mail or by opening an issue on GitHub if you have any questions.