任何人都可以在Haskell中向我展示一个小的libClang例子吗?
我有文件,但不知道从哪里开始。
一个小例子会很好
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
最满意答案
最简单的例子就是遵循软件包中的测试。 C中有三个测试与他们的haskell相对应。 例如,这是一个C测试:
https://github.com/chetant/LibClang/blob/master/test/Test_Diagnostics.c
和其对应的哈斯克尔:
https://github.com/chetant/LibClang/blob/master/test/Test_Diagnostics.hs
该库大部分是原始libclang的逐字拷贝,大部分回调函数和数据结构都是“haskellized”的。 Hackage不会构建文档(沙盒中没有libclang),但您可以在本地下载最新的libclang并使用haddock构建文档。
有关libclang本身的信息,请查看来自其中一位开发人员的关于llvm的最新演示文稿:
http://devimages.apple.com/llvm/videos/Libclang.mov
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
更多推荐
发布评论