mathben / python_clang_parser

Python application with clang python wrapper to parse static code c++
GNU General Public License v3.0
7 stars 1 forks source link

python_clang_parser

Python application with Clang python wrapper to parse static code c++

Feature

TODO

Dependency

python2 libclang, the Clang python binding

Ubuntu

This dependence is to generate graph

sudo apt-get install python-pip
sudo python-pip install pygraphviz

Arch Linux

This dependence is to generate graph

sudo pacman -S python2-pip
sudo pip2 install pygraphviz

Clang

I choose to compile the code source of Clang, because you can choose the version you need. I tested this code with branch release_37

https://github.com/llvm-mirror/clang

This is a good guide for installation : http://clang.llvm.org/get_started.html

Personally, I install it in /opt on Linux

HOW TO

I test this code with OpenCV project : https://github.com/Itseez/opencv In this example, we assume you clone in your home directory. "~/" is not supported :-(

ROOT_DIRECTORY=/home/user/opencv
python2 main.py --root_directory ${ROOT_DIRECTORY} -d -I "build" --find_include

For more information

python2 main.py -h

Why not python3?

Officially, libClang is only supported in python2.

License

Project under GPLv3

Contributors

  1. Mathieu Benoit - mathben