GitXplorerGitXplorer
t

node-libclang

public
52 stars
27 forks
11 issues

Commits

List of commits on branch master.
Unverified
80ef1c1b591fa3f97548dfff181b849be2b24199

explicitly set mit license

ttjfontaine committed 11 years ago
Unverified
9c1dfc0bf605428313fe9a2cd4fe7ca4915b8361

License all things

ttjfontaine committed 11 years ago
Unverified
77a48001a6147cf1228b3fc654f4d000a942a469

allow to work with shipped libclang in xcode

ttjfontaine committed 11 years ago
Unverified
75f9f02158f89c1ae167505a0b6414597f5fa781

split ffi generation into its own package

ttjfontaine committed 11 years ago
Unverified
217dfef07f90de491607af0e9de714cd31e4fe27

update to js-beautify

ttjfontaine committed 11 years ago
Unverified
7138f6967676188892df0a82c4762b9c41aad3cd

support grabbing mulitple prefixes

ttjfontaine committed 11 years ago

README

The README file for this repository.

node-libclang

node.js module for libclang and parsing c-style source from javascript

AST Traversal

var libclang = require('libclang');

var index = new libclang.index();
var tu = new libclang.translationunit();

tu.fromSource(idx, 'myLibrary.h', ['-I/path/to/my/project']);

tu.cursor().visitChildren(function (parent) {
  switch (this.kind) {
    case libclang.KINDS.CXCursor_FunctionDecl:
      console.log(this.spelling);
      break;
  }
  return libclang.CXChildVisit_Continue;
});

index.dispose();
tu.dispose();

Generate FFI Bindings

This has been moved to its own library npm install -g ffi-generate

See also https://github.com/tjfontaine/node-ffi-generate

Notes

Not all of libclang is wrapped yet, but there's enough for ffi-generate to regenerate the dynamic clang bindings.

The native wrapper isn't completely fleshed out or free of errors. Enough is wrapped to allow for C modules to be successfully generated by lib/generateffi.js.