Giter Club home page Giter Club logo

clang_helper's Introduction

clang_helper

Important: As of this writing (Clang 3.3) the Clang bindings on Pypi are missing an important and necessary attribute, Type.spelling. Use the bindings included with this repository or the bindings included with the llvm and clang repositories if this error comes up.

This is a python module for the extraction of interesting features from source files. At the moment, macro definitions and function definitions are supported. This project depends on libclang's python bindings.

Rather than reading about me discussing the functionality of this library, consider instead the following informative example which prints information about the OpenAL headers.

import clang_helper
info = clang_helper.FeatureExtractor(['../camlorn_audio_rewrite/all_open_al.h'])
for i in info.functions_list[5:15]:
	print i
for i in filter(lambda  x: 'AL_' in x.name, info.macros_list)[5:15]:
	print i

For me, this yields:

Function: void alDisable(int capability)
Function: char alIsEnabled(int capability)
Function: const char * alGetString(int param)
Function: void alGetBooleanv(int param,char * values)
Function: void alGetIntegerv(int param,int * values)
Function: void alGetFloatv(int param,float * values)
Function: void alGetDoublev(int param,double * values)
Function: char alGetBoolean(int param)
Function: int alGetInteger(int param)
Function: float alGetFloat(int param)
Macro: 'AL_TRUE' 1
Macro: 'AL_SOURCE_RELATIVE' 514
Macro: 'AL_CONE_INNER_ANGLE' 4097
Macro: 'AL_CONE_OUTER_ANGLE' 4098
Macro: 'AL_PITCH' 4099
Macro: 'AL_POSITION' 4100
Macro: 'AL_DIRECTION' 4101
Macro: 'AL_VELOCITY' 4102
Macro: 'AL_LOOPING' 4103
Macro: 'AL_BUFFER' 4105


Note that the slicing operations and filter operations are not needed in real code. They simply print out an interesting subset. The total list of everything being extracted is easily a few hunred items, much too long to print here.

clang_helper's People

Contributors

ahicks92 avatar

Watchers

 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.