public void Parse(Cursor cursor, CppParserContext context)
        {
            string fieldName = cursor.Spelling;
            var    field     = new FieldDefinition(fieldName, new TypeRefDefinition(cursor.Type));

            ModelNodeDefinition parent = context.GetContainingClassOrNamespace();

            if (parent is NamespaceDefinition)
            {
                field.Header = context.Header;
            }
            parent.AddChild(field);
        }
        public void Parse(Cursor cursor, CppParserContext context)
        {
            string className           = cursor.Spelling;
            ModelNodeDefinition parent = context.GetContainingClassOrNamespace();

            if (HasNameConflict(className, parent))
            {
                return;
            }

            context.Class = new ClassDefinition(className);
            parent.AddChild(context.Class);
            if (parent is NamespaceDefinition)
            {
                context.Header.AddNode(context.Class);
            }

            cursor.VisitChildren(context.NodeVisitor);

            context.Class = parent as ClassDefinition;
        }
        public void Parse(Cursor cursor, CppParserContext context)
        {
            string methodName = cursor.Spelling;

            var parameters = new ParameterDefinition[cursor.NumArguments];

            for (uint i = 0; i < cursor.NumArguments; i++)
            {
                Cursor parameterCursor = cursor.GetArgument(i);
                parameters[i] = ParseParameter(parameterCursor, context);
            }

            context.Method = new MethodDefinition(methodName, parameters)
            {
                IsConstructor = cursor.Kind == CursorKind.Constructor,
                IsStatic      = cursor.IsStaticCxxMethod,
                IsAbstract    = IsCursorAbstract(cursor, context),
                ReturnType    = new TypeRefDefinition(cursor.ResultType)
            };

            ModelNodeDefinition parent = context.GetContainingClassOrNamespace();

            if (parent is NamespaceDefinition)
            {
                if (cursor.SemanticParent.Kind == CursorKind.ClassDecl ||
                    cursor.SemanticParent.Kind == CursorKind.ClassTemplate ||
                    cursor.SemanticParent.Kind == CursorKind.StructDecl)
                {
                    // FIXME: Clang reports a method definition as a method declaration
                    return;
                }
                context.Method.Header = context.Header;
            }
            parent.AddChild(context.Method);

            context.Method = null;
        }