Giter Club home page Giter Club logo

python_clang_parser's Introduction

python_clang_parser

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

Feature

  • Analyse static c++ code only with source file and emplacement of header file.
  • Create csv with statistic analyse
  • Parallelism execution
  • Create CFG, support only example directory
    • Create dominant, post-dominant graph
    • Reach definition
    • Alive variable

TODO

  • Load config file to start execution. Contain application argument
  • Add test
  • Serialize/Deserialize python AST

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

python_clang_parser's People

Contributors

mathben avatar

Watchers

Hello Chen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.