Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

small haskell libClang example?

Tags:

haskell

clang

can anybody show me a small libClang example in haskell?

i have the documentation, but dont know where to start with.

a small example would be nice

like image 561
develhevel Avatar asked May 14 '11 22:05

develhevel


1 Answers

The simplest example would be to follow the tests in the package. There are three tests in C along with their haskell counterparts. For example, here's a C test:

https://github.com/chetant/LibClang/blob/master/test/Test_Diagnostics.c

and its haskell counterpart:

https://github.com/chetant/LibClang/blob/master/test/Test_Diagnostics.hs

The library is mostly a verbatim copy of the original libclang with most of the callbacks and data structures "haskellized". Hackage won't build the documents (no libclang in sandbox), but you can download the latest libclang locally and build the documentation with haddock.

For info on libclang itself, check out the latest presentation on llvm from one of the developers:

http://devimages.apple.com/llvm/videos/Libclang.mov

like image 54
Chetan Avatar answered Oct 22 '22 09:10

Chetan