int _rootCursorVisitor()

in lib/src/header_parser/translation_unit_parser.dart [39:76]


int _rootCursorVisitor(clang_types.CXCursor cursor, clang_types.CXCursor parent,
    Pointer<Void> clientData) {
  try {
    if (shouldIncludeRootCursor(cursor.sourceFileName())) {
      _logger.finest('rootCursorVisitor: ${cursor.completeStringRepr()}');
      switch (clang.clang_getCursorKind(cursor)) {
        case clang_types.CXCursorKind.CXCursor_FunctionDecl:
          addToBindings(parseFunctionDeclaration(cursor));
          break;
        case clang_types.CXCursorKind.CXCursor_StructDecl:
          addToBindings(parseCompoundDeclaration(cursor, CompoundType.struct));
          break;
        case clang_types.CXCursorKind.CXCursor_UnionDecl:
          addToBindings(parseCompoundDeclaration(cursor, CompoundType.union));
          break;
        case clang_types.CXCursorKind.CXCursor_EnumDecl:
          addToBindings(parseEnumDeclaration(cursor));
          break;
        case clang_types.CXCursorKind.CXCursor_MacroDefinition:
          saveMacroDefinition(cursor);
          break;
        case clang_types.CXCursorKind.CXCursor_VarDecl:
          addToBindings(parseVarDeclaration(cursor));
          break;
        default:
          _logger.finer('rootCursorVisitor: CursorKind not implemented');
      }
    } else {
      _logger.finest(
          'rootCursorVisitor:(not included) ${cursor.completeStringRepr()}');
    }
  } catch (e, s) {
    _logger.severe(e);
    _logger.severe(s);
    rethrow;
  }
  return clang_types.CXChildVisitResult.CXChildVisit_Continue;
}