can anybody show me a small libClang example in haskell?
i have the documentation, but dont know where to start with.
a 开发者_JS百科small example would be nice
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
精彩评论