-
-
Save dsisnero/c80c99700878392a05a49c7a4f957b30 to your computer and use it in GitHub Desktop.
Ruby : ffi-clang のテスト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting LLVM : | |
# http://llvm.org/releases/download.html#3.4 | |
# Usage example : | |
# $ LLVM_CONFIG=~/Downloads/clang+llvm-3.4-x86_64-apple-darwin10.9/bin/llvm-config ruby fficlangtest.rb /usr/include/stdio.h | |
require 'ffi/clang' | |
index = FFI::Clang::Index.new | |
translation_unit = index.parse_translation_unit(ARGV[0]) | |
cursor = translation_unit.cursor | |
cursor.visit_children do |cursor, parent| | |
puts "#{cursor.kind} #{cursor.spelling.inspect}" | |
next :recurse | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment