Thanks to visit codestin.com
Credit goes to lib.haxe.org

linc_libclang

libclang bindings for Haxe
https://github.com/darmie/linc_clang

To install, run:

haxelib install linc_libclang 0.0.2 

See using Haxelib in Haxelib documentation for more information.

README.md

linc/libclang

This is a LINC based Haxe binding for LibClang, a stable high level C interface to clang.

For more information, see the linc homepage

Example

class Test {
        
    static function main() {
        final index = Clang.createIndex(0, 0);
        final unit = Clang.parseTranslationUnit(index, "header.hpp", null, 0, null,0, CXTranslationUnit_None);
        if(unit == null){
            Sys.println("Unable to parse translation unit. Quitting.");
            Sys.exit(-1);
        }
        final cursor = Clang.getTranslationUnitCursor(unit);
        Clang.visitChildren(cursor, Callable.fromStaticFunction(visitor), null);
        Clang.disposeTranslationUnit(unit);
        Clang.disposeIndex(index);
    }

    static function visitor (c1:CXCursor, parent:CXCursor, data:CXClientData):CXChildVisitResult{
        Sys.println('Cursor kind: "${Clang.getCursorSpelling(c1).toString()}" of kind "${Clang.getCursorKindSpelling(Clang.getCursorKind(c1)).toString()}"');
        return CXChildVisit_Recurse;
    }

}
Contributors
darmie
Version
0.0.2
Published
3 years ago
Dependencies
License
Apache

All libraries are free

Every month, more than a thousand developers use Haxelib to find, share, and reuse code — and assemble it in powerful new ways. Enjoy Haxe; It is great!

Explore Haxe

Haxe Manual

Haxe Code Cookbook

Haxe API documentation

You can try Haxe in the browser! try.haxe.org

Join us on GitHub!

Haxe is being developed on GitHub. Feel free to contribute or report issues to our projects.

Haxe on GitHub