Пример #1
0
enum CXChildVisitResult parentedDeclAndRefListBuilder(CXCursor cursor,
                                                      CXCursor parent,
                                                      CXClientData clientData)
{
  ParentedCursorListPair* declsAndRefs = (ParentedCursorListPair*) clientData;

  if (clang_isDeclaration(clang_getCursorKind(cursor))) {
    ParentedCursor newEntry = {
      parent,
      cursor
    };

    ParentedCursorList* decls = &declsAndRefs->decls;
    LIST_APPEND(ParentedCursor, decls, newEntry);
  }

  if (clang_isReference(clang_getCursorKind(cursor))) {
    ParentedCursor newEntry = {
      parent,
      cursor
    };

    ParentedCursorList* refs = &declsAndRefs->refs;
    LIST_APPEND(ParentedCursor, refs, newEntry);
  }

  return CXChildVisit_Recurse;
}
Пример #2
0
enum CXChildVisitResult referenceListBuilder(CXCursor cursor, CXCursor parent,
                                              CXClientData clientData)
{
  if (clang_isReference(clang_getCursorKind(cursor))) {
    CursorList* childList = (CursorList*) clientData;
    LIST_APPEND(CXCursor, childList, cursor);
  }
  return CXChildVisit_Recurse;
}
Пример #3
0
enum CXChildVisitResult parentedReferenceListBuilder(CXCursor cursor, CXCursor parent,
                                                      CXClientData clientData)
{
  ParentedCursorList* referenceList = (ParentedCursorList*) clientData;

  if (clang_isReference(clang_getCursorKind(cursor))) {
    ParentedCursor newEntry = {
      parent,
      cursor
    };

    LIST_APPEND(ParentedCursor, referenceList, newEntry);
  }

  return CXChildVisit_Recurse;
}
Пример #4
0
std::string libclang_vim::stringize_cursor_kind_type(CXCursorKind const& kind) {
    if (clang_isAttribute(kind))
        return "Attribute";
    if (clang_isDeclaration(kind))
        return "Declaration";
    if (clang_isExpression(kind))
        return "Expression";
    if (clang_isPreprocessing(kind))
        return "Preprocessing";
    if (clang_isReference(kind))
        return "Reference";
    if (clang_isStatement(kind))
        return "Statement";
    if (clang_isTranslationUnit(kind))
        return "TranslationUnit";
    if (clang_isUnexposed(kind))
        return "Unexposed";
    if (clang_isInvalid(kind))
        return "";
    return "Unknown";
}
Пример #5
0
bool CursorIsReference( CXCursor cursor ) {
  return clang_isReference( clang_getCursorKind( cursor ) );
}
Пример #6
0
bool cursor::isReference() const
{
    return clang_isReference(kind());
}