Added ast.c

Pascal J. Bourguignon [2013-01-29 06:20]
Added ast.c
Filename
Makefile
ast.c
c-index-test.lisp
example.c
tests.lisp
diff --git a/Makefile b/Makefile
index c017ed5..37f9459 100644
--- a/Makefile
+++ b/Makefile
@@ -35,5 +35,13 @@ clang.lisp:clang-raw.lisp Makefile lispify-clang
 clean:
 	- rm -f clang-raw.lisp

+
+CC=/opt/llvm/bin/clang
+ast:ast.c Makefile
+	$(CC) -I. -L. -g3 -ggdb3 -o ast ast.c
+
+test-ast:ast
+	./ast example.c
+
 #### THE END ####

diff --git a/ast.c b/ast.c
new file mode 100644
index 0000000..13fc638
--- /dev/null
+++ b/ast.c
@@ -0,0 +1,230 @@
+#include <stdio.h>
+#include <clang-c/Index.h>
+
+
+const char* cursorSymbol(int cursorKind){
+    switch(cursorKind){
+    case CXCursor_UnexposedDecl:                      return ":unexposed-decl";
+    case CXCursor_StructDecl:                         return ":struct-decl";
+    case CXCursor_UnionDecl:                          return ":union-decl";
+    case CXCursor_ClassDecl:                          return ":class-decl";
+    case CXCursor_EnumDecl:                           return ":enum-decl";
+    case CXCursor_FieldDecl:                          return ":field-decl";
+    case CXCursor_EnumConstantDecl:                   return ":enum-constant-decl";
+    case CXCursor_FunctionDecl:                       return ":function-decl";
+    case CXCursor_VarDecl:                            return ":var-decl";
+    case CXCursor_ParmDecl:                           return ":parm-decl";
+    case CXCursor_ObjCInterfaceDecl:                  return ":objc-interface-decl";
+    case CXCursor_ObjCCategoryDecl:                   return ":objc-category-decl";
+    case CXCursor_ObjCProtocolDecl:                   return ":objc-protocol-decl";
+    case CXCursor_ObjCPropertyDecl:                   return ":objc-property-decl";
+    case CXCursor_ObjCIvarDecl:                       return ":objc-ivar-decl";
+    case CXCursor_ObjCInstanceMethodDecl:             return ":objc-instance-method-decl";
+    case CXCursor_ObjCClassMethodDecl:                return ":objc-class-method-decl";
+    case CXCursor_ObjCImplementationDecl:             return ":objc-implementation-decl";
+    case CXCursor_ObjCCategoryImplDecl:               return ":objc-category-impl-decl";
+    case CXCursor_TypedefDecl:                        return ":typedef-decl";
+    case CXCursor_CXXMethod:                          return ":cxx-method";
+    case CXCursor_Namespace:                          return ":namespace";
+    case CXCursor_LinkageSpec:                        return ":linkage-spec";
+    case CXCursor_Constructor:                        return ":constructor";
+    case CXCursor_Destructor:                         return ":destructor";
+    case CXCursor_ConversionFunction:                 return ":conversion-function";
+    case CXCursor_TemplateTypeParameter:              return ":template-type-parameter";
+    case CXCursor_NonTypeTemplateParameter:           return ":non-type-template-parameter";
+    case CXCursor_TemplateTemplateParameter:          return ":template-template-parameter";
+    case CXCursor_FunctionTemplate:                   return ":function-template";
+    case CXCursor_ClassTemplate:                      return ":class-template";
+    case CXCursor_ClassTemplatePartialSpecialization: return ":class-template-partial-specialization";
+    case CXCursor_NamespaceAlias:                     return ":namespace-alias";
+    case CXCursor_UsingDirective:                     return ":using-directive";
+    case CXCursor_UsingDeclaration:                   return ":using-declaration";
+    case CXCursor_TypeAliasDecl:                      return ":type-alias-decl";
+    case CXCursor_ObjCSynthesizeDecl:                 return ":objc-synthesize-decl";
+    case CXCursor_ObjCDynamicDecl:                    return ":objc-dynamic-decl";
+    case CXCursor_CXXAccessSpecifier:                 return ":cxx-access-specifier";
+    case CXCursor_ObjCSuperClassRef:                  return ":objc-super-class-ref";
+    case CXCursor_ObjCProtocolRef:                    return ":objc-protocol-ref";
+    case CXCursor_ObjCClassRef:                       return ":objc-class-ref";
+    case CXCursor_TypeRef:                            return ":type-ref";
+    case CXCursor_CXXBaseSpecifier:                   return ":cxx-base-specifier";
+    case CXCursor_TemplateRef:                        return ":template-ref";
+    case CXCursor_NamespaceRef:                       return ":namespace-ref";
+    case CXCursor_MemberRef:                          return ":member-ref";
+    case CXCursor_LabelRef:                           return ":label-ref";
+    case CXCursor_OverloadedDeclRef:                  return ":overloaded-decl-ref";
+    case CXCursor_VariableRef:                        return ":variable-ref";
+    case CXCursor_InvalidFile:                        return ":invalid-file";
+    case CXCursor_NoDeclFound:                        return ":no-decl-found";
+    case CXCursor_NotImplemented:                     return ":not-implemented";
+    case CXCursor_InvalidCode:                        return ":invalid-code";
+    case CXCursor_UnexposedExpr:                      return ":unexposed-expr";
+    case CXCursor_DeclRefExpr:                        return ":decl-ref-expr";
+    case CXCursor_MemberRefExpr:                      return ":member-ref-expr";
+    case CXCursor_CallExpr:                           return ":call-expr";
+    case CXCursor_ObjCMessageExpr:                    return ":objc-message-expr";
+    case CXCursor_BlockExpr:                          return ":block-expr";
+    case CXCursor_IntegerLiteral:                     return ":integer-literal";
+    case CXCursor_FloatingLiteral:                    return ":floating-literal";
+    case CXCursor_ImaginaryLiteral:                   return ":imaginary-literal";
+    case CXCursor_StringLiteral:                      return ":string-literal";
+    case CXCursor_CharacterLiteral:                   return ":character-literal";
+    case CXCursor_ParenExpr:                          return ":paren-expr";
+    case CXCursor_UnaryOperator:                      return ":unary-operator";
+    case CXCursor_ArraySubscriptExpr:                 return ":array-subscript-expr";
+    case CXCursor_BinaryOperator:                     return ":binary-operator";
+    case CXCursor_CompoundAssignOperator:             return ":compound-assign-operator";
+    case CXCursor_ConditionalOperator:                return ":conditional-operator";
+    case CXCursor_CStyleCastExpr:                     return ":cstyle-cast-expr";
+    case CXCursor_CompoundLiteralExpr:                return ":compound-literal-expr";
+    case CXCursor_InitListExpr:                       return ":init-list-expr";
+    case CXCursor_AddrLabelExpr:                      return ":addr-label-expr";
+    case CXCursor_StmtExpr:                           return ":stmt-expr";
+    case CXCursor_GenericSelectionExpr:               return ":generic-selection-expr";
+    case CXCursor_GNUNullExpr:                        return ":gnunull-expr";
+    case CXCursor_CXXStaticCastExpr:                  return ":cxx-static-cast-expr";
+    case CXCursor_CXXDynamicCastExpr:                 return ":cxx-dynamic-cast-expr";
+    case CXCursor_CXXReinterpretCastExpr:             return ":cxx-reinterpret-cast-expr";
+    case CXCursor_CXXConstCastExpr:                   return ":cxx-const-cast-expr";
+    case CXCursor_CXXFunctionalCastExpr:              return ":cxx-functional-cast-expr";
+    case CXCursor_CXXTypeidExpr:                      return ":cxx-typeid-expr";
+    case CXCursor_CXXBoolLiteralExpr:                 return ":cxx-bool-literal-expr";
+    case CXCursor_CXXNullPtrLiteralExpr:              return ":cxx-null-ptr-literal-expr";
+    case CXCursor_CXXThisExpr:                        return ":cxx-this-expr";
+    case CXCursor_CXXThrowExpr:                       return ":cxx-throw-expr";
+    case CXCursor_CXXNewExpr:                         return ":cxx-new-expr";
+    case CXCursor_CXXDeleteExpr:                      return ":cxx-delete-expr";
+    case CXCursor_UnaryExpr:                          return ":unary-expr";
+    case CXCursor_ObjCStringLiteral:                  return ":objc-string-literal";
+    case CXCursor_ObjCEncodeExpr:                     return ":objc-encode-expr";
+    case CXCursor_ObjCSelectorExpr:                   return ":objc-selector-expr";
+    case CXCursor_ObjCProtocolExpr:                   return ":objc-protocol-expr";
+    case CXCursor_ObjCBridgedCastExpr:                return ":objc-bridged-cast-expr";
+    case CXCursor_PackExpansionExpr:                  return ":pack-expansion-expr";
+    case CXCursor_SizeOfPackExpr:                     return ":size-of-pack-expr";
+    case CXCursor_LambdaExpr:                         return ":lambda-expr";
+    case CXCursor_ObjCBoolLiteralExpr:                return ":objc-bool-literal-expr";
+    case CXCursor_UnexposedStmt:                      return ":unexposed-stmt";
+    case CXCursor_LabelStmt:                          return ":label-stmt";
+    case CXCursor_CompoundStmt:                       return ":compound-stmt";
+    case CXCursor_CaseStmt:                           return ":case-stmt";
+    case CXCursor_DefaultStmt:                        return ":default-stmt";
+    case CXCursor_IfStmt:                             return ":if-stmt";
+    case CXCursor_SwitchStmt:                         return ":switch-stmt";
+    case CXCursor_WhileStmt:                          return ":while-stmt";
+    case CXCursor_DoStmt:                             return ":do-stmt";
+    case CXCursor_ForStmt:                            return ":for-stmt";
+    case CXCursor_GotoStmt:                           return ":goto-stmt";
+    case CXCursor_IndirectGotoStmt:                   return ":indirect-goto-stmt";
+    case CXCursor_ContinueStmt:                       return ":continue-stmt";
+    case CXCursor_BreakStmt:                          return ":break-stmt";
+    case CXCursor_ReturnStmt:                         return ":return-stmt";
+    case CXCursor_GCCAsmStmt:                         return ":gccasm-stmt";
+    case CXCursor_ObjCAtTryStmt:                      return ":objc-at-try-stmt";
+    case CXCursor_ObjCAtCatchStmt:                    return ":objc-at-catch-stmt";
+    case CXCursor_ObjCAtFinallyStmt:                  return ":objc-at-finally-stmt";
+    case CXCursor_ObjCAtThrowStmt:                    return ":objc-at-throw-stmt";
+    case CXCursor_ObjCAtSynchronizedStmt:             return ":objc-at-synchronized-stmt";
+    case CXCursor_ObjCAutoreleasePoolStmt:            return ":objc-autorelease-pool-stmt";
+    case CXCursor_ObjCForCollectionStmt:              return ":objc-for-collection-stmt";
+    case CXCursor_CXXCatchStmt:                       return ":cxx-catch-stmt";
+    case CXCursor_CXXTryStmt:                         return ":cxx-try-stmt";
+    case CXCursor_CXXForRangeStmt:                    return ":cxx-for-range-stmt";
+    case CXCursor_SEHTryStmt:                         return ":seh-try-stmt";
+    case CXCursor_SEHExceptStmt:                      return ":seh-except-stmt";
+    case CXCursor_SEHFinallyStmt:                     return ":seh-finally-stmt";
+    case CXCursor_MSAsmStmt:                          return ":msasm-stmt";
+    case CXCursor_NullStmt:                           return ":null-stmt";
+    case CXCursor_DeclStmt:                           return ":decl-stmt";
+    case CXCursor_TranslationUnit:                    return ":translation-unit";
+    case CXCursor_UnexposedAttr:                      return ":unexposed-attr";
+    case CXCursor_IBActionAttr:                       return ":ibaction-attr";
+    case CXCursor_IBOutletAttr:                       return ":iboutlet-attr";
+    case CXCursor_IBOutletCollectionAttr:             return ":iboutlet-collection-attr";
+    case CXCursor_CXXFinalAttr:                       return ":cxx-final-attr";
+    case CXCursor_CXXOverrideAttr:                    return ":cxx-override-attr";
+    case CXCursor_AnnotateAttr:                       return ":annotate-attr";
+    case CXCursor_AsmLabelAttr:                       return ":asm-label-attr";
+    case CXCursor_PreprocessingDirective:             return ":preprocessing-directive";
+    case CXCursor_MacroDefinition:                    return ":macro-definition";
+    case CXCursor_MacroExpansion:                     return ":macro-expansion";
+    case CXCursor_InclusionDirective:                 return ":inclusion-directive";
+    case CXCursor_ModuleImportDecl:                   return ":module-import-decl";
+    default:                                          return ":invalid";}}
+
+
+const char* cursorLinkage(int linkageKind){
+    switch(linkageKind){
+    case CXLinkage_NoLinkage:      return ":no-linkage";
+    case CXLinkage_Internal:       return ":internal";
+    case CXLinkage_UniqueExternal: return ":unique-external";
+    case CXLinkage_External:       return ":external";
+    default:                       return ":invalid";}}
+
+
+const char* cursorLanguageKind(int languageKind){
+    switch(languageKind){
+    case CXLanguage_Invalid:   return ":invalid";
+    case CXLanguage_C:         return ":c";
+    case CXLanguage_ObjC:      return ":objc";
+    case CXLanguage_CPlusPlus: return ":cxx"
+    default:                   return ":invalid";}}
+
+
+int main(int argc,char** argv){
+    printf("%d argc\n",argc);
+    return(0);
+    if(argc<2){
+        fprintf(stderr,"Missing source file argument.\n");
+        return(1);}
+
+    const char* sourceFile=argv[1];
+    argv+=2;
+    argc-=2;
+
+    CXIndex idx=clang_createIndex(0,1);
+    CXTranslationUnit tu=clang_createTranslationUnitFromSourceFile(idx,sourceFile,argc,argv,0,0);
+    if(0==tu){
+        fprintf(stderr,"Cannot create the translation unit.");
+        return(1);}
+
+    CXCursor cursor=clang_getTranslationUnitCursor(tu);
+    if(clang_Cursor_isNull(cursor)){
+        printf("nil\n");
+    }else{
+        printf("(%s",cursorSymbol(clang_getCursorKind(cursor)));
+        printf("\n :linkage %s",cursorLinkage(clang_getCursorLinkage(cursor)));
+        printf("\n :language-kind %s",cursorLanguageKind(clang_getCursorLanguage(cursor)));
+
+        CXSourceLocation location=clang_getCursorLocation(cursor);
+        CXFile file;
+        unsigned line;
+        unsigned column;
+        unsigned offset;
+
+        clang_getSpellingLocation(location,&file,&line,&column,&offset)
+        CXString fileName=clang_getFileName(file);
+        printf("\n :location (location :file \"%s\" :line %u :column %u :offset %u)",clang_getCString(fileName),line,column,offset);
+        clang_disposeString(fileName);
+
+        CXSourceRange range=clang_getCursorExtent(cursor);
+        CXSourceLocation start=clang_getRangeStart(range);
+        CXSourceLocation end=clang_getRangeEnd(range);
+
+        clang_getSpellingLocation(start,&file,&line,&column,&offset)
+        CXString fileName=clang_getFileName(file);
+        printf("\n :range (range :start (location :file \"%s\" :line %u :column %u :offset %u)",clang_getCString(fileName),line,column,offset);
+        clang_disposeString(fileName);
+
+        clang_getSpellingLocation(end,&file,&line,&column,&offset)
+        CXString fileName=clang_getFileName(file);
+        printf("\n                :end (location :file \"%s\" :line %u :column %u :offset %u))",clang_getCString(fileName),line,column,offset);
+        clang_disposeString(fileName);
+
+
+
+
+        printf(")\n");
+    }
+    clang_disposeTranslationUnit(tu);
+    return(0);}
diff --git a/c-index-test.lisp b/c-index-test.lisp
index e158e31..0e188c6 100644
--- a/c-index-test.lisp
+++ b/c-index-test.lisp
@@ -3277,7 +3277,7 @@ static void printDiagnosticSet(CXDiagnosticSet Diags, unsigned indent) {
   (let (error
         error-string
         (diags 0))
-    (setf diags (clang:load-diagnostics filename ))
+    (setf diags (clang:load-diagnostics filename))
     ))
 #|
 static int read_diagnostics(const char *filename) {
diff --git a/example.c b/example.c
new file mode 100644
index 0000000..c9fee9c
--- /dev/null
+++ b/example.c
@@ -0,0 +1,174 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+
+struct {
+    int type;
+    int valeur;} stack[100];
+int memoire[26]={0};
+int top=0;
+
+void dump(void){
+    int i;
+    printf("--------------------\n");
+    for(i=0;i<top;i++){
+        if(stack[i].type==0){
+            printf("[%3d]: %10d\n",i,stack[i].valeur);}
+        else{
+            printf("[%3d]: %c\n",i,'a'+stack[i].valeur);}}
+    printf("--------------------\n");
+    for(i=0;i<sizeof(memoire)/sizeof(int);i++){
+        printf("[%3c]: %10d\n",'a'+i,memoire[i]);}
+    printf("--------------------\n");}
+
+void push(int n){
+    if(top<100){
+        stack[top].type=0;
+        stack[top++].valeur=n;}
+    else{
+        fprintf(stderr,"La pile est pleine !\n");
+        exit(1);}}
+
+void pushv(int n){
+    if(top<100){
+        stack[top].type=1;
+        stack[top++].valeur=n;}
+    else{
+        fprintf(stderr,"La pile est pleine !\n");
+        exit(1);}}
+
+void store(int d,int x){
+    if((0<=d)&&(d<sizeof(memoire)/sizeof(int))){
+        memoire[d]=x;}
+    else{
+        fprintf(stderr,"Adresse hors memoire %d !\n",d);
+        dump();
+        exit(1);}}
+
+int retrieve(int d){
+    if((0<=d)&&(d<sizeof(memoire)/sizeof(int))){
+        return(memoire[d]);}
+    else{
+        fprintf(stderr,"Adresse hors memoire %d !\n",d);
+        dump();
+        exit(1);}}
+
+int pop(void){
+    if(top>0){
+        --top;
+        if(stack[top].type==0){
+            return(stack[top].valeur);}
+        else{
+            return(retrieve(stack[top].valeur));}}
+    else{
+        fprintf(stderr,"La pile est vide !\n");
+        exit(1);}}
+
+int popv(void){
+    if(top>0){
+        --top;
+        if(stack[top].type==1){
+            return(stack[top].valeur);}
+        else{
+            fprintf(stderr,"Mauvais type sur la pile !\n");
+            dump();
+            exit(1);}}
+    else{
+        fprintf(stderr,"La pile est vide !\n");
+        exit(1);}}
+
+void interprete(void){
+    int c;
+    while((c=getc(stdin))>1){
+        switch(c){
+        case '0':
+        case '1':
+        case '2':
+        case '3':
+        case '4':
+        case '5':
+        case '6':
+        case '7':
+        case '8':
+        case '9':
+            push(c-'0');
+            break;
+        case 'a':
+        case 'b':
+        case 'c':
+        case 'd':
+        case 'e':
+        case 'f':
+        case 'g':
+        case 'h':
+        case 'i':
+        case 'j':
+        case 'k':
+        case 'l':
+        case 'm':
+        case 'n':
+        case 'o':
+        case 'p':
+        case 'q':
+        case 'r':
+        case 's':
+        case 't':
+        case 'u':
+        case 'v':
+        case 'w':
+        case 'x':
+        case 'y':
+        case 'z':
+            pushv(c-'a');
+            break;
+        case '!':
+            {
+                int d=popv();
+                store(d,pop());}
+            break;
+        case '~':
+            push(-pop());
+            break;
+        case '+':
+            push(pop()+pop());
+            break;
+        case '*':
+            push(pop()*pop());
+            break;
+        case '-':
+            {
+                int b=pop();
+                int a=pop();
+                push(a-b);}
+            break;
+        case '/':
+            {
+                int b=pop();
+                int a=pop();
+                if(b==0){
+                    fprintf(stderr,"Division par zero !\n");
+                    exit(1);}
+                push(a/b);}
+            break;
+        case '=':
+            printf("%d\n",pop());
+            break;
+        case '&':
+            dump();
+            break;
+        case '\n':
+        case '\t':
+        case ' ':
+            break;
+        default:
+            fprintf(stderr,"Mauvais caractere : %d '%c'.\n",c,c);
+            break;}}}
+
+
+int main(void){
+    interprete();
+    exit(0);
+    return(0);}
+
+
+//// THE END ////
diff --git a/tests.lisp b/tests.lisp
new file mode 100644
index 0000000..31a28fe
--- /dev/null
+++ b/tests.lisp
@@ -0,0 +1,429 @@
+(MAPCAR (LAMBDA (A B)
+            (FORMAT T "case ~A: return \"~A\";~%" A (SECOND B)))
+        '(CXCursor_UnexposedDecl
+          CXCursor_StructDecl
+          CXCursor_UnionDecl
+          CXCursor_ClassDecl
+          CXCursor_EnumDecl
+          CXCursor_FieldDecl
+          CXCursor_EnumConstantDecl
+          CXCursor_FunctionDecl
+          CXCursor_VarDecl
+          CXCursor_ParmDecl
+          CXCursor_ObjCInterfaceDecl
+          CXCursor_ObjCCategoryDecl
+          CXCursor_ObjCProtocolDecl
+          CXCursor_ObjCPropertyDecl
+          CXCursor_ObjCIvarDecl
+          CXCursor_ObjCInstanceMethodDecl
+          CXCursor_ObjCClassMethodDecl
+          CXCursor_ObjCImplementationDecl
+          CXCursor_ObjCCategoryImplDecl
+          CXCursor_TypedefDecl
+          CXCursor_CXXMethod
+          CXCursor_Namespace
+          CXCursor_LinkageSpec
+          CXCursor_Constructor
+          CXCursor_Destructor
+          CXCursor_ConversionFunction
+          CXCursor_TemplateTypeParameter
+          CXCursor_NonTypeTemplateParameter
+          CXCursor_TemplateTemplateParameter
+          CXCursor_FunctionTemplate
+          CXCursor_ClassTemplate
+          CXCursor_ClassTemplatePartialSpecialization
+          CXCursor_NamespaceAlias
+          CXCursor_UsingDirective
+          CXCursor_UsingDeclaration
+          CXCursor_TypeAliasDecl
+          CXCursor_ObjCSynthesizeDecl
+          CXCursor_ObjCDynamicDecl
+          CXCursor_CXXAccessSpecifier
+          CXCursor_ObjCSuperClassRef
+          CXCursor_ObjCProtocolRef
+          CXCursor_ObjCClassRef
+          CXCursor_TypeRef
+          CXCursor_CXXBaseSpecifier
+          CXCursor_TemplateRef
+          CXCursor_NamespaceRef
+          CXCursor_MemberRef
+          CXCursor_LabelRef
+          CXCursor_OverloadedDeclRef
+          CXCursor_VariableRef
+          CXCursor_InvalidFile
+          CXCursor_NoDeclFound
+          CXCursor_NotImplemented
+          CXCursor_InvalidCode
+          CXCursor_UnexposedExpr
+          CXCursor_DeclRefExpr
+          CXCursor_MemberRefExpr
+          CXCursor_CallExpr
+          CXCursor_ObjCMessageExpr
+          CXCursor_BlockExpr
+          CXCursor_IntegerLiteral
+          CXCursor_FloatingLiteral
+          CXCursor_ImaginaryLiteral
+          CXCursor_StringLiteral
+          CXCursor_CharacterLiteral
+          CXCursor_ParenExpr
+          CXCursor_UnaryOperator
+          CXCursor_ArraySubscriptExpr
+          CXCursor_BinaryOperator
+          CXCursor_CompoundAssignOperator
+          CXCursor_ConditionalOperator
+          CXCursor_CStyleCastExpr
+          CXCursor_CompoundLiteralExpr
+          CXCursor_InitListExpr
+          CXCursor_AddrLabelExpr
+          CXCursor_StmtExpr
+          CXCursor_GenericSelectionExpr
+          CXCursor_GNUNullExpr
+          CXCursor_CXXStaticCastExpr
+          CXCursor_CXXDynamicCastExpr
+          CXCursor_CXXReinterpretCastExpr
+          CXCursor_CXXConstCastExpr
+          CXCursor_CXXFunctionalCastExpr
+          CXCursor_CXXTypeidExpr
+          CXCursor_CXXBoolLiteralExpr
+          CXCursor_CXXNullPtrLiteralExpr
+          CXCursor_CXXThisExpr
+          CXCursor_CXXThrowExpr
+          CXCursor_CXXNewExpr
+          CXCursor_CXXDeleteExpr
+          CXCursor_UnaryExpr
+          CXCursor_ObjCStringLiteral
+          CXCursor_ObjCEncodeExpr
+          CXCursor_ObjCSelectorExpr
+          CXCursor_ObjCProtocolExpr
+          CXCursor_ObjCBridgedCastExpr
+          CXCursor_PackExpansionExpr
+          CXCursor_SizeOfPackExpr
+          CXCursor_LambdaExpr
+          CXCursor_ObjCBoolLiteralExpr
+          CXCursor_UnexposedStmt
+          CXCursor_LabelStmt
+          CXCursor_CompoundStmt
+          CXCursor_CaseStmt
+          CXCursor_DefaultStmt
+          CXCursor_IfStmt
+          CXCursor_SwitchStmt
+          CXCursor_WhileStmt
+          CXCursor_DoStmt
+          CXCursor_ForStmt
+          CXCursor_GotoStmt
+          CXCursor_IndirectGotoStmt
+          CXCursor_ContinueStmt
+          CXCursor_BreakStmt
+          CXCursor_ReturnStmt
+          CXCursor_GCCAsmStmt
+          CXCursor_ObjCAtTryStmt
+          CXCursor_ObjCAtCatchStmt
+          CXCursor_ObjCAtFinallyStmt
+          CXCursor_ObjCAtThrowStmt
+          CXCursor_ObjCAtSynchronizedStmt
+          CXCursor_ObjCAutoreleasePoolStmt
+          CXCursor_ObjCForCollectionStmt
+          CXCursor_CXXCatchStmt
+          CXCursor_CXXTryStmt
+          CXCursor_CXXForRangeStmt
+          CXCursor_SEHTryStmt
+          CXCursor_SEHExceptStmt
+          CXCursor_SEHFinallyStmt
+          CXCursor_MSAsmStmt
+          CXCursor_NullStmt
+          CXCursor_DeclStmt
+          CXCursor_TranslationUnit
+          CXCursor_UnexposedAttr
+          CXCursor_IBActionAttr
+          CXCursor_IBOutletAttr
+          CXCursor_IBOutletCollectionAttr
+          CXCursor_CXXFinalAttr
+          CXCursor_CXXOverrideAttr
+          CXCursor_AnnotateAttr
+          CXCursor_AsmLabelAttr
+          CXCursor_PreprocessingDirective
+          CXCursor_MacroDefinition
+          CXCursor_MacroExpansion
+          CXCursor_InclusionDirective
+          CXCursor_ModuleImportDecl
+          )
+        '(
+          ((1) :cursor-unexposed-decl)
+          ((2) :cursor-struct-decl)
+          ((3) :cursor-union-decl)
+          ((4) :cursor-class-decl)
+          ((5) :cursor-enum-decl)
+          ((6) :cursor-field-decl)
+          ((7) :cursor-enum-constant-decl)
+          ((8) :cursor-function-decl)
+          ((9) :cursor-var-decl)
+          ((10) :cursor-parm-decl)
+          ((11) :cursor-objc-interface-decl)
+          ((12) :cursor-objc-category-decl)
+          ((13) :cursor-objc-protocol-decl)
+          ((14) :cursor-objc-property-decl)
+          ((15) :cursor-objc-ivar-decl)
+          ((16) :cursor-objc-instance-method-decl)
+          ((17) :cursor-objc-class-method-decl)
+          ((18) :cursor-objc-implementation-decl)
+          ((19) :cursor-objc-category-impl-decl)
+          ((20) :cursor-typedef-decl)
+          ((21) :cursor-cxxmethod)
+          ((22) :cursor-namespace)
+          ((23) :cursor-linkage-spec)
+          ((24) :cursor-constructor)
+          ((25) :cursor-destructor)
+          ((26) :cursor-conversion-function)
+          ((27) :cursor-template-type-parameter)
+          ((28) :cursor-non-type-template-parameter)
+          ((29) :cursor-template-template-parameter)
+          ((30) :cursor-function-template)
+          ((31) :cursor-class-template)
+          ((32) :cursor-class-template-partial-specialization)
+          ((33) :cursor-namespace-alias)
+          ((34) :cursor-using-directive)
+          ((35) :cursor-using-declaration)
+          ((36) :cursor-type-alias-decl)
+          ((37) :cursor-objc-synthesize-decl)
+          ((38) :cursor-objc-dynamic-decl)
+          ((39) :cursor-cxxaccess-specifier)
+          ((40) :cursor-objc-super-class-ref)
+          ((41) :cursor-objc-protocol-ref)
+          ((42) :cursor-objc-class-ref)
+          ((43) :cursor-type-ref)
+          ((44) :cursor-cxxbase-specifier)
+          ((45) :cursor-template-ref)
+          ((46) :cursor-namespace-ref)
+          ((47) :cursor-member-ref)
+          ((48) :cursor-label-ref)
+          ((49) :cursor-overloaded-decl-ref)
+          ((50) :cursor-variable-ref)
+          ((70) :cursor-invalid-file)
+          ((71) :cursor-no-decl-found)
+          ((72) :cursor-not-implemented)
+          ((73) :cursor-invalid-code)
+          ((100) :cursor-unexposed-expr)
+          ((101) :cursor-decl-ref-expr)
+          ((102) :cursor-member-ref-expr)
+          ((103) :cursor-call-expr)
+          ((104) :cursor-objc-message-expr)
+          ((105) :cursor-block-expr)
+          ((106) :cursor-integer-literal)
+          ((107) :cursor-floating-literal)
+          ((108) :cursor-imaginary-literal)
+          ((109) :cursor-string-literal)
+          ((110) :cursor-character-literal)
+          ((111) :cursor-paren-expr)
+          ((112) :cursor-unary-operator)
+          ((113) :cursor-array-subscript-expr)
+          ((114) :cursor-binary-operator)
+          ((115) :cursor-compound-assign-operator)
+          ((116) :cursor-conditional-operator)
+          ((117) :cursor-cstyle-cast-expr)
+          ((118) :cursor-compound-literal-expr)
+          ((119) :cursor-init-list-expr)
+          ((120) :cursor-addr-label-expr)
+          ((121) :cursor-stmt-expr)
+          ((122) :cursor-generic-selection-expr)
+          ((123) :cursor-gnunull-expr)
+          ((124) :cursor-cxxstatic-cast-expr)
+          ((125) :cursor-cxxdynamic-cast-expr)
+          ((126) :cursor-cxxreinterpret-cast-expr)
+          ((127) :cursor-cxxconst-cast-expr)
+          ((128) :cursor-cxxfunctional-cast-expr)
+          ((129) :cursor-cxxtypeid-expr)
+          ((130) :cursor-cxxbool-literal-expr)
+          ((131) :cursor-cxxnull-ptr-literal-expr)
+          ((132) :cursor-cxxthis-expr)
+          ((133) :cursor-cxxthrow-expr)
+          ((134) :cursor-cxxnew-expr)
+          ((135) :cursor-cxxdelete-expr)
+          ((136) :cursor-unary-expr)
+          ((137) :cursor-objc-string-literal)
+          ((138) :cursor-objc-encode-expr)
+          ((139) :cursor-objc-selector-expr)
+          ((140) :cursor-objc-protocol-expr)
+          ((141) :cursor-objc-bridged-cast-expr)
+          ((142) :cursor-pack-expansion-expr)
+          ((143) :cursor-size-of-pack-expr)
+          ((144) :cursor-lambda-expr)
+          ((145) :cursor-objc-bool-literal-expr)
+          ((200) :cursor-unexposed-stmt)
+          ((201) :cursor-label-stmt)
+          ((202) :cursor-compound-stmt)
+          ((203) :cursor-case-stmt)
+          ((204) :cursor-default-stmt)
+          ((205) :cursor-if-stmt)
+          ((206) :cursor-switch-stmt)
+          ((207) :cursor-while-stmt)
+          ((208) :cursor-do-stmt)
+          ((209) :cursor-for-stmt)
+          ((210) :cursor-goto-stmt)
+          ((211) :cursor-indirect-goto-stmt)
+          ((212) :cursor-continue-stmt)
+          ((213) :cursor-break-stmt)
+          ((214) :cursor-return-stmt)
+          ((215) :cursor-gccasm-stmt)
+          ((216) :cursor-objc-at-try-stmt)
+          ((217) :cursor-objc-at-catch-stmt)
+          ((218) :cursor-objc-at-finally-stmt)
+          ((219) :cursor-objc-at-throw-stmt)
+          ((220) :cursor-objc-at-synchronized-stmt)
+          ((221) :cursor-objc-autorelease-pool-stmt)
+          ((222) :cursor-objc-for-collection-stmt)
+          ((223) :cursor-cxxcatch-stmt)
+          ((224) :cursor-cxxtry-stmt)
+          ((225) :cursor-cxxfor-range-stmt)
+          ((226) :cursor-sehtry-stmt)
+          ((227) :cursor-sehexcept-stmt)
+          ((228) :cursor-sehfinally-stmt)
+          ((229) :cursor-msasm-stmt)
+          ((230) :cursor-null-stmt)
+          ((231) :cursor-decl-stmt)
+          ((300) :cursor-translation-unit)
+          ((400) :cursor-unexposed-attr)
+          ((401) :cursor-ibaction-attr)
+          ((402) :cursor-iboutlet-attr)
+          ((403) :cursor-iboutlet-collection-attr)
+          ((404) :cursor-cxxfinal-attr)
+          ((405) :cursor-cxxoverride-attr)
+          ((406) :cursor-annotate-attr)
+          ((407) :cursor-asm-label-attr)
+          ((500) :cursor-preprocessing-directive)
+          ((501) :cursor-macro-definition)
+          ((502) :cursor-macro-expansion)
+          ((503) :cursor-inclusion-directive)
+          ((600) :cursor-module-import-decl)
+          ))
+
+
+((cxcursor_unexposeddecl :cursor-unexposed-decl) (cxcursor_structdecl :cursor-struct-decl) (cxcursor_uniondecl :cursor-union-decl) (cxcursor_classdecl :cursor-class-decl) (cxcursor_enumdecl :cursor-enum-decl) (cxcursor_fielddecl :cursor-field-decl) (cxcursor_enumconstantdecl :cursor-enum-constant-decl) (cxcursor_functiondecl :cursor-function-decl) (cxcursor_vardecl :cursor-var-decl) (cxcursor_parmdecl :cursor-parm-decl) (cxcursor_objcinterfacedecl :cursor-objc-interface-decl) (cxcursor_objccategorydecl :cursor-objc-category-decl) (cxcursor_objcprotocoldecl :cursor-objc-protocol-decl) (cxcursor_objcpropertydecl :cursor-objc-property-decl) (cxcursor_objcivardecl :cursor-objc-ivar-decl) (cxcursor_objcinstancemethoddecl :cursor-objc-instance-method-decl) (cxcursor_objcclassmethoddecl :cursor-objc-class-method-decl) (cxcursor_objcimplementationdecl :cursor-objc-implementation-decl) (cxcursor_objccategoryimpldecl :cursor-objc-category-impl-decl) (cxcursor_typedefdecl :cursor-typedef-decl) (cxcursor_cxxmethod :cursor-cxxmethod) (cxcursor_namespace :cursor-namespace) (cxcursor_linkagespec :cursor-linkage-spec) (cxcursor_constructor :cursor-constructor) (cxcursor_destructor :cursor-destructor) (cxcursor_conversionfunction :cursor-conversion-function) (cxcursor_templatetypeparameter :cursor-template-type-parameter) (cxcursor_nontypetemplateparameter :cursor-non-type-template-parameter) (cxcursor_templatetemplateparameter :cursor-template-template-parameter) (cxcursor_functiontemplate :cursor-function-template) (cxcursor_classtemplate :cursor-class-template) (cxcursor_classtemplatepartialspecialization :cursor-class-template-partial-specialization) (cxcursor_namespacealias :cursor-namespace-alias) (cxcursor_usingdirective :cursor-using-directive) (cxcursor_usingdeclaration :cursor-using-declaration) (cxcursor_typealiasdecl :cursor-type-alias-decl) (cxcursor_objcsynthesizedecl :cursor-objc-synthesize-decl) (cxcursor_objcdynamicdecl :cursor-objc-dynamic-decl) (cxcursor_cxxaccessspecifier :cursor-cxxaccess-specifier) (cxcursor_objcsuperclassref :cursor-objc-super-class-ref) (cxcursor_objcprotocolref :cursor-objc-protocol-ref) (cxcursor_objcclassref :cursor-objc-class-ref) (cxcursor_typeref :cursor-type-ref) (cxcursor_cxxbasespecifier :cursor-cxxbase-specifier) (cxcursor_templateref :cursor-template-ref) (cxcursor_namespaceref :cursor-namespace-ref) (cxcursor_memberref :cursor-member-ref) (cxcursor_labelref :cursor-label-ref) (cxcursor_overloadeddeclref :cursor-overloaded-decl-ref) (cxcursor_variableref :cursor-variable-ref) (cxcursor_invalidfile :cursor-invalid-file) (cxcursor_nodeclfound :cursor-no-decl-found) (cxcursor_notimplemented :cursor-not-implemented) (cxcursor_invalidcode :cursor-invalid-code) (cxcursor_unexposedexpr :cursor-unexposed-expr) (cxcursor_declrefexpr :cursor-decl-ref-expr) (cxcursor_memberrefexpr :cursor-member-ref-expr) (cxcursor_callexpr :cursor-call-expr) (cxcursor_objcmessageexpr :cursor-objc-message-expr) (cxcursor_blockexpr :cursor-block-expr) (cxcursor_integerliteral :cursor-integer-literal) (cxcursor_floatingliteral :cursor-floating-literal) (cxcursor_imaginaryliteral :cursor-imaginary-literal) (cxcursor_stringliteral :cursor-string-literal) (cxcursor_characterliteral :cursor-character-literal) (cxcursor_parenexpr :cursor-paren-expr) (cxcursor_unaryoperator :cursor-unary-operator) (cxcursor_arraysubscriptexpr :cursor-array-subscript-expr) (cxcursor_binaryoperator :cursor-binary-operator) (cxcursor_compoundassignoperator :cursor-compound-assign-operator) (cxcursor_conditionaloperator :cursor-conditional-operator) (cxcursor_cstylecastexpr :cursor-cstyle-cast-expr) (cxcursor_compoundliteralexpr :cursor-compound-literal-expr) (cxcursor_initlistexpr :cursor-init-list-expr) (cxcursor_addrlabelexpr :cursor-addr-label-expr) (cxcursor_stmtexpr :cursor-stmt-expr) (cxcursor_genericselectionexpr :cursor-generic-selection-expr) (cxcursor_gnunullexpr :cursor-gnunull-expr) (cxcursor_cxxstaticcastexpr :cursor-cxxstatic-cast-expr) (cxcursor_cxxdynamiccastexpr :cursor-cxxdynamic-cast-expr) (cxcursor_cxxreinterpretcastexpr :cursor-cxxreinterpret-cast-expr) (cxcursor_cxxconstcastexpr :cursor-cxxconst-cast-expr) (cxcursor_cxxfunctionalcastexpr :cursor-cxxfunctional-cast-expr) (cxcursor_cxxtypeidexpr :cursor-cxxtypeid-expr) (cxcursor_cxxboolliteralexpr :cursor-cxxbool-literal-expr) (cxcursor_cxxnullptrliteralexpr :cursor-cxxnull-ptr-literal-expr) (cxcursor_cxxthisexpr :cursor-cxxthis-expr) (cxcursor_cxxthrowexpr :cursor-cxxthrow-expr) (cxcursor_cxxnewexpr :cursor-cxxnew-expr) (cxcursor_cxxdeleteexpr :cursor-cxxdelete-expr) (cxcursor_unaryexpr :cursor-unary-expr) (cxcursor_objcstringliteral :cursor-objc-string-literal) (cxcursor_objcencodeexpr :cursor-objc-encode-expr) (cxcursor_objcselectorexpr :cursor-objc-selector-expr) (cxcursor_objcprotocolexpr :cursor-objc-protocol-expr) (cxcursor_objcbridgedcastexpr :cursor-objc-bridged-cast-expr) (cxcursor_packexpansionexpr :cursor-pack-expansion-expr) (cxcursor_sizeofpackexpr :cursor-size-of-pack-expr) (cxcursor_lambdaexpr :cursor-lambda-expr) (cxcursor_objcboolliteralexpr :cursor-objc-bool-literal-expr) (cxcursor_unexposedstmt :cursor-unexposed-stmt) (cxcursor_labelstmt :cursor-label-stmt) (cxcursor_compoundstmt :cursor-compound-stmt) (cxcursor_casestmt :cursor-case-stmt) (cxcursor_defaultstmt :cursor-default-stmt) (cxcursor_ifstmt :cursor-if-stmt) (cxcursor_switchstmt :cursor-switch-stmt) (cxcursor_whilestmt :cursor-while-stmt) (cxcursor_dostmt :cursor-do-stmt) (cxcursor_forstmt :cursor-for-stmt) (cxcursor_gotostmt :cursor-goto-stmt) (cxcursor_indirectgotostmt :cursor-indirect-goto-stmt) (cxcursor_continuestmt :cursor-continue-stmt) (cxcursor_breakstmt :cursor-break-stmt) (cxcursor_returnstmt :cursor-return-stmt) (cxcursor_gccasmstmt :cursor-gccasm-stmt) (cxcursor_objcattrystmt :cursor-objc-at-try-stmt) (cxcursor_objcatcatchstmt :cursor-objc-at-catch-stmt) (cxcursor_objcatfinallystmt :cursor-objc-at-finally-stmt) (cxcursor_objcatthrowstmt :cursor-objc-at-throw-stmt) (cxcursor_objcatsynchronizedstmt :cursor-objc-at-synchronized-stmt) (cxcursor_objcautoreleasepoolstmt :cursor-objc-autorelease-pool-stmt) (cxcursor_objcforcollectionstmt :cursor-objc-for-collection-stmt) (cxcursor_cxxcatchstmt :cursor-cxxcatch-stmt) (cxcursor_cxxtrystmt :cursor-cxxtry-stmt) (cxcursor_cxxforrangestmt :cursor-cxxfor-range-stmt) (cxcursor_sehtrystmt :cursor-sehtry-stmt) (cxcursor_sehexceptstmt :cursor-sehexcept-stmt) (cxcursor_sehfinallystmt :cursor-sehfinally-stmt) (cxcursor_msasmstmt :cursor-msasm-stmt) (cxcursor_nullstmt :cursor-null-stmt) (cxcursor_declstmt :cursor-decl-stmt) (cxcursor_translationunit :cursor-translation-unit) (cxcursor_unexposedattr :cursor-unexposed-attr) (cxcursor_ibactionattr :cursor-ibaction-attr) (cxcursor_iboutletattr :cursor-iboutlet-attr) (cxcursor_iboutletcollectionattr :cursor-iboutlet-collection-attr) (cxcursor_cxxfinalattr :cursor-cxxfinal-attr) (cxcursor_cxxoverrideattr :cursor-cxxoverride-attr) (cxcursor_annotateattr :cursor-annotate-attr) (cxcursor_asmlabelattr :cursor-asm-label-attr) (cxcursor_preprocessingdirective :cursor-preprocessing-directive) (cxcursor_macrodefinition :cursor-macro-definition) (cxcursor_macroexpansion :cursor-macro-expansion) (cxcursor_inclusiondirective :cursor-inclusion-directive) (cxcursor_moduleimportdecl :cursor-module-import-decl))
+
+
+
+(defun decode-cursor-kind (cursor-kind)
+
+  ((40) :cursor-objc-super-class-ref)
+  ((41) :cursor-objc-protocol-ref)
+  ((42) :cursor-objc-class-ref)
+  ((43) :cursor-type-ref)
+  ((44) :cursor-cxxbase-specifier)
+  ((45) :cursor-template-ref)
+  ((46) :cursor-namespace-ref)
+  ((47) :cursor-member-ref)
+  ((48) :cursor-label-ref)
+  ((49) :cursor-overloaded-decl-ref)
+  ((50) :cursor-variable-ref)
+  ((70) :cursor-invalid-file)
+  ((71) :cursor-no-decl-found)
+  ((72) :cursor-not-implemented)
+  ((73) :cursor-invalid-code)
+  ((100) :cursor-unexposed-expr)
+  ((101) :cursor-decl-ref-expr)
+  ((102) :cursor-member-ref-expr)
+  ((103) :cursor-call-expr)
+  ((104) :cursor-objc-message-expr)
+  ((105) :cursor-block-expr)
+  ((106) :cursor-integer-literal)
+  ((107) :cursor-floating-literal)
+  ((108) :cursor-imaginary-literal)
+  ((109) :cursor-string-literal)
+  ((110) :cursor-character-literal)
+  ((111) :cursor-paren-expr)
+  ((112) :cursor-unary-operator)
+  ((113) :cursor-array-subscript-expr)
+  ((114) :cursor-binary-operator)
+  ((115) :cursor-compound-assign-operator)
+  ((116) :cursor-conditional-operator)
+  ((117) :cursor-cstyle-cast-expr)
+  ((118) :cursor-compound-literal-expr)
+  ((119) :cursor-init-list-expr)
+  ((120) :cursor-addr-label-expr)
+  ((121) :cursor-stmt-expr)
+  ((122) :cursor-generic-selection-expr)
+  ((123) :cursor-gnunull-expr)
+  ((124) :cursor-cxxstatic-cast-expr)
+  ((125) :cursor-cxxdynamic-cast-expr)
+  ((126) :cursor-cxxreinterpret-cast-expr)
+  ((127) :cursor-cxxconst-cast-expr)
+  ((128) :cursor-cxxfunctional-cast-expr)
+  ((129) :cursor-cxxtypeid-expr)
+  ((130) :cursor-cxxbool-literal-expr)
+  ((131) :cursor-cxxnull-ptr-literal-expr)
+  ((132) :cursor-cxxthis-expr)
+  ((133) :cursor-cxxthrow-expr)
+  ((134) :cursor-cxxnew-expr)
+  ((135) :cursor-cxxdelete-expr)
+  ((136) :cursor-unary-expr)
+  ((137) :cursor-objc-string-literal)
+  ((138) :cursor-objc-encode-expr)
+  ((139) :cursor-objc-selector-expr)
+  ((140) :cursor-objc-protocol-expr)
+  ((141) :cursor-objc-bridged-cast-expr)
+  ((142) :cursor-pack-expansion-expr)
+  ((143) :cursor-size-of-pack-expr)
+  ((144) :cursor-lambda-expr)
+  ((145) :cursor-objc-bool-literal-expr)
+  ((200) :cursor-unexposed-stmt)
+  ((201) :cursor-label-stmt)
+  ((202) :cursor-compound-stmt)
+  ((203) :cursor-case-stmt)
+  ((204) :cursor-default-stmt)
+  ((205) :cursor-if-stmt)
+  ((206) :cursor-switch-stmt)
+  ((207) :cursor-while-stmt)
+  ((208) :cursor-do-stmt)
+  ((209) :cursor-for-stmt)
+  ((210) :cursor-goto-stmt)
+  ((211) :cursor-indirect-goto-stmt)
+  ((212) :cursor-continue-stmt)
+  ((213) :cursor-break-stmt)
+  ((214) :cursor-return-stmt)
+  ((215) :cursor-asm-stmt)
+  ((216) :cursor-objc-at-try-stmt)
+  ((217) :cursor-objc-at-catch-stmt)
+  ((218) :cursor-objc-at-finally-stmt)
+  ((219) :cursor-objc-at-throw-stmt)
+  ((220) :cursor-objc-at-synchronized-stmt)
+  ((221) :cursor-objc-autorelease-pool-stmt)
+  ((222) :cursor-objc-for-collection-stmt)
+  ((223) :cursor-cxxcatch-stmt)
+  ((224) :cursor-cxxtry-stmt)
+  ((225) :cursor-cxxfor-range-stmt)
+  ((226) :cursor-sehtry-stmt)
+  ((227) :cursor-sehexcept-stmt)
+  ((228) :cursor-sehfinally-stmt)
+  ((229) :cursor-msasm-stmt)
+  ((230) :cursor-null-stmt)
+  ((231) :cursor-decl-stmt)
+  ((300) :cursor-translation-unit)
+  ((400) :cursor-unexposed-attr)
+  ((401) :cursor-ibaction-attr)
+  ((402) :cursor-iboutlet-attr)
+  ((403) :cursor-iboutlet-collection-attr)
+  ((404) :cursor-cxxfinal-attr)
+  ((405) :cursor-cxxoverride-attr)
+  ((406) :cursor-annotate-attr)
+  ((407) :cursor-asm-label-attr)
+  ((500) :cursor-preprocessing-directive)
+  ((501) :cursor-macro-definition)
+  ((502) :cursor-macro-expansion)
+  ((502) :cursor-macro-instantiation)
+  ((503) :cursor-inclusion-directive)
+  ((600) :cursor-module-import-decl)
+  (otherwise cursor-kind))
+
+
+
+(cffi:use-foreign-library "/opt/llvm/lib/libclang.so")
+(load "clang.lisp")
+(com.informatimago.common-lisp.cesarum.package:add-nickname :com.ogamita.clang :clang)
+(defparameter *null* (cffi:null-pointer))
+
+(defparameter *cindex* (clang:create-index 0 1))
+
+(defparameter *tu* (clang:create-translation-unit-from-source-file
+                    *cindex* "/home/pjb/clang/example.c" 0 *null* 0 *null*))
+
+(clang:get-translation-unit-cursor *tu*)
+
ViewGit