Пример #1
0
 internal FunctionDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _body       = new Lazy <Stmt>(() => CursorChildren.Where((cursor) => cursor is Stmt).Cast <Stmt>().SingleOrDefault());
     _decls      = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList());
     _parameters = new Lazy <IReadOnlyList <ParmVarDecl> >(() => Decls.Where((decl) => decl is ParmVarDecl).Cast <ParmVarDecl>().ToList());
     _returnType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.ResultType));
 }
Пример #2
0
 private protected FunctionDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _body       = new Lazy <Stmt>(() => CursorChildren.OfType <Stmt>().SingleOrDefault());
     _decls      = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
     _parameters = new Lazy <IReadOnlyList <ParmVarDecl> >(() => Decls.OfType <ParmVarDecl>().ToList());
     _returnType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.ResultType));
 }
Пример #3
0
        private protected FunctionDecl(CXCursor handle, CXCursorKind expectedCursorKind, CX_DeclKind expectedDeclKind) : base(handle, expectedCursorKind, expectedDeclKind)
        {
            if ((CX_DeclKind.CX_DeclKind_LastFunction < handle.DeclKind) || (handle.DeclKind < CX_DeclKind.CX_DeclKind_FirstFunction))
            {
                throw new ArgumentException(nameof(handle));
            }

            _callResultType     = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.CallResultType));
            _declaredReturnType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.DeclaredReturnType));
            _decls      = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
            _definition = new Lazy <FunctionDecl>(() => TranslationUnit.GetOrCreate <FunctionDecl>(Handle.Definition));
            _instantiatedFromMemberFunction = new Lazy <FunctionDecl>(() => TranslationUnit.GetOrCreate <FunctionDecl>(Handle.InstantiatedFromMember));
            _parameters = new Lazy <IReadOnlyList <ParmVarDecl> >(() => {
                var parameterCount = Handle.NumArguments;
                var parameters     = new List <ParmVarDecl>(parameterCount);

                for (int i = 0; i < parameterCount; i++)
                {
                    var parameter = TranslationUnit.GetOrCreate <ParmVarDecl>(Handle.GetArgument(unchecked ((uint)i)));
                    parameters.Add(parameter);
                }

                return(parameters);
            });
            _primaryTemplate = new Lazy <FunctionTemplateDecl>(() => TranslationUnit.GetOrCreate <FunctionTemplateDecl>(Handle.PrimaryTemplate));
            _returnType      = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.ReturnType));
            _templateInstantiationPattern = new Lazy <FunctionDecl>(() => TranslationUnit.GetOrCreate <FunctionDecl>(Handle.TemplateInstantiationPattern));
        }
Пример #4
0
        internal BlockDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_UnexposedDecl, CX_DeclKind.CX_DeclKind_Block)
        {
            _blockManglingContextDecl = new Lazy <Decl>(() => TranslationUnit.GetOrCreate <Decl>(Handle.BlockManglingContextDecl));
            _captures = new Lazy <IReadOnlyList <Capture> >(() => {
                var captureCount = Handle.NumCaptures;
                var captures     = new List <Capture>(captureCount);

                for (int i = 0; i < captureCount; i++)
                {
                    var capture = new Capture(this, unchecked ((uint)i));
                    captures.Add(capture);
                }

                return(captures);
            });
            _decls      = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
            _parameters = new Lazy <IReadOnlyList <ParmVarDecl> >(() => {
                var parameterCount = Handle.NumArguments;
                var parameters     = new List <ParmVarDecl>(parameterCount);

                for (int i = 0; i < parameterCount; i++)
                {
                    var parameter = TranslationUnit.GetOrCreate <ParmVarDecl>(Handle.GetArgument(unchecked ((uint)i)));
                    parameters.Add(parameter);
                }

                return(parameters);
            });
        }
Пример #5
0
 private protected Decl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _attrs               = new Lazy <IReadOnlyList <Attr> >(() => CursorChildren.Where((cursor) => cursor is Attr).Cast <Attr>().ToList());
     _canonicalDecl       = new Lazy <Decl>(() => TranslationUnit.GetOrCreate <Decl>(Handle.CanonicalCursor));
     _declContext         = new Lazy <IDeclContext>(() => (IDeclContext)Create(Handle.SemanticParent));
     _lexicalDeclContext  = new Lazy <IDeclContext>(() => (IDeclContext)Create(Handle.LexicalParent));
     _translationUnitDecl = new Lazy <TranslationUnitDecl>(() => TranslationUnit.GetOrCreate <TranslationUnitDecl>(Handle.TranslationUnit.Cursor));
 }
Пример #6
0
 internal EnumDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_EnumDecl, CX_DeclKind.CX_DeclKind_Enum)
 {
     _enumerators = new Lazy <IReadOnlyList <EnumConstantDecl> >(() => CursorChildren.OfType <EnumConstantDecl>().ToList());
     _instantiatedFromMemberEnum = new Lazy <EnumDecl>(() => TranslationUnit.GetOrCreate <EnumDecl>(Handle.InstantiatedFromMember));
     _integerType   = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.EnumDecl_IntegerType));
     _promotionType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.EnumDecl_PromotionType));
     _templateInstantiationPattern = new Lazy <EnumDecl>(() => TranslationUnit.GetOrCreate <EnumDecl>(Handle.TemplateInstantiationPattern));
 }
Пример #7
0
        private protected Stmt(CXCursor handle, CXCursorKind expectedCursorKind, CX_StmtClass expectedStmtClass) : base(handle, expectedCursorKind)
        {
            if ((handle.StmtClass == CX_StmtClass.CX_StmtClass_Invalid) || (handle.StmtClass != expectedStmtClass))
            {
                throw new ArgumentException(nameof(handle));
            }

            _children = new Lazy <IReadOnlyList <Stmt> >(() => CursorChildren.OfType <Stmt>().ToList());
        }
Пример #8
0
        internal LinkageSpecDecl(CXCursor handle) : base(handle, handle.Kind, CX_DeclKind.CX_DeclKind_LinkageSpec)
        {
            if ((handle.Kind != CXCursorKind.CXCursor_LinkageSpec) && (handle.Kind != CXCursorKind.CXCursor_UnexposedDecl))
            {
                throw new ArgumentException(nameof(handle));
            }

            _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
        }
Пример #9
0
        internal ObjCMethodDecl(CXCursor handle) : base(handle, handle.Kind, CX_DeclKind.CX_DeclKind_ObjCMethod)
        {
            if ((handle.Kind != CXCursorKind.CXCursor_ObjCInstanceMethodDecl) && (handle.Kind != CXCursorKind.CXCursor_ObjCClassMethodDecl))
            {
                throw new ArgumentException(nameof(handle));
            }

            _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
        }
Пример #10
0
 internal CXXRecordDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _bases      = new Lazy <IReadOnlyList <CXXBaseSpecifier> >(() => CursorChildren.OfType <CXXBaseSpecifier>().ToList());
     _ctors      = new Lazy <IReadOnlyList <CXXConstructorDecl> >(() => Methods.OfType <CXXConstructorDecl>().ToList());
     _destructor = new Lazy <CXXDestructorDecl>(() => Methods.OfType <CXXDestructorDecl>().SingleOrDefault());
     _friends    = new Lazy <IReadOnlyList <FriendDecl> >(() => Decls.OfType <FriendDecl>().ToList());
     _methods    = new Lazy <IReadOnlyList <CXXMethodDecl> >(() => Decls.OfType <CXXMethodDecl>().ToList());
     _vbases     = new Lazy <IReadOnlyList <CXXBaseSpecifier> >(() => Bases.Where((@base) => @base.IsVirtual).ToList());
 }
Пример #11
0
        private protected TemplateDecl(CXCursor handle, CXCursorKind expectedCursorKind, CX_DeclKind expectedDeclKind) : base(handle, expectedCursorKind, expectedDeclKind)
        {
            if ((CX_DeclKind.CX_DeclKind_LastTemplate < handle.DeclKind) || (handle.DeclKind < CX_DeclKind.CX_DeclKind_FirstTemplate))
            {
                throw new ArgumentException(nameof(handle));
            }

            _templateParameters = new Lazy <IReadOnlyList <NamedDecl> >(() => CursorChildren.Where((cursor) => (cursor is TemplateTypeParmDecl) || (cursor is NonTypeTemplateParmDecl) || (cursor is TemplateTemplateParmDecl)).Cast <NamedDecl>().ToList());
        }
Пример #12
0
        private protected ObjCContainerDecl(CXCursor handle, CXCursorKind expectedCursorKind, CX_DeclKind expectedDeclKind) : base(handle, expectedCursorKind, expectedDeclKind)
        {
            if ((CX_DeclKind.CX_DeclKind_LastObjCContainer < handle.DeclKind) || (handle.DeclKind < CX_DeclKind.CX_DeclKind_FirstObjCContainer))
            {
                throw new ArgumentException(nameof(handle));
            }

            _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
        }
Пример #13
0
        private protected TagDecl(CXCursor handle, CXCursorKind expectedCursorKind, CX_DeclKind expectedDeclKind) : base(handle, expectedCursorKind, expectedDeclKind)
        {
            if ((CX_DeclKind.CX_DeclKind_LastTag < handle.DeclKind) || (handle.DeclKind < CX_DeclKind.CX_DeclKind_FirstTag))
            {
                throw new ArgumentException(nameof(handle));
            }

            _decls      = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
            _definition = new Lazy <TagDecl>(() => TranslationUnit.GetOrCreate <TagDecl>(Handle.Definition));
        }
Пример #14
0
        private protected FunctionDecl(CXCursor handle, CXCursorKind expectedCursorKind, CX_DeclKind expectedDeclKind) : base(handle, expectedCursorKind, expectedDeclKind)
        {
            if ((CX_DeclKind.CX_DeclKind_LastFunction < handle.DeclKind) || (handle.DeclKind < CX_DeclKind.CX_DeclKind_FirstFunction))
            {
                throw new ArgumentException(nameof(handle));
            }

            _body       = new Lazy <Stmt>(() => CursorChildren.OfType <Stmt>().SingleOrDefault());
            _decls      = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
            _parameters = new Lazy <IReadOnlyList <ParmVarDecl> >(() => Decls.OfType <ParmVarDecl>().ToList());
            _returnType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.ResultType));
        }
Пример #15
0
        private protected Decl(CXCursor handle, CXCursorKind expectedCursorKind, CX_DeclKind expectedDeclKind) : base(handle, expectedCursorKind)
        {
            if ((handle.DeclKind == CX_DeclKind.CX_DeclKind_Invalid) || (handle.DeclKind != expectedDeclKind))
            {
                throw new ArgumentException(nameof(handle));
            }

            _attrs               = new Lazy <IReadOnlyList <Attr> >(() => CursorChildren.OfType <Attr>().ToList());
            _canonicalDecl       = new Lazy <Decl>(() => TranslationUnit.GetOrCreate <Decl>(Handle.CanonicalCursor));
            _declContext         = new Lazy <IDeclContext>(() => TranslationUnit.GetOrCreate <Decl>(Handle.SemanticParent) as IDeclContext);
            _lexicalDeclContext  = new Lazy <IDeclContext>(() => TranslationUnit.GetOrCreate <Decl>(Handle.LexicalParent) as IDeclContext);
            _translationUnitDecl = new Lazy <TranslationUnitDecl>(() => TranslationUnit.GetOrCreate <TranslationUnitDecl>(Handle.TranslationUnit.Cursor));
        }
Пример #16
0
        private protected CXXRecordDecl(CXCursor handle, CXCursorKind expectedCursorKind, CX_DeclKind expectedDeclKind) : base(handle, expectedCursorKind, expectedDeclKind)
        {
            if ((CX_DeclKind.CX_DeclKind_LastCXXRecord < handle.DeclKind) || (handle.DeclKind < CX_DeclKind.CX_DeclKind_FirstCXXRecord))
            {
                throw new ArgumentException(nameof(handle));
            }

            _bases      = new Lazy <IReadOnlyList <CXXBaseSpecifier> >(() => CursorChildren.OfType <CXXBaseSpecifier>().ToList());
            _ctors      = new Lazy <IReadOnlyList <CXXConstructorDecl> >(() => Methods.OfType <CXXConstructorDecl>().ToList());
            _destructor = new Lazy <CXXDestructorDecl>(() => Methods.OfType <CXXDestructorDecl>().SingleOrDefault());
            _friends    = new Lazy <IReadOnlyList <FriendDecl> >(() => Decls.OfType <FriendDecl>().ToList());
            _methods    = new Lazy <IReadOnlyList <CXXMethodDecl> >(() => Decls.OfType <CXXMethodDecl>().ToList());
            _vbases     = new Lazy <IReadOnlyList <CXXBaseSpecifier> >(() => Bases.Where((@base) => @base.IsVirtual).ToList());
        }
Пример #17
0
        internal CapturedDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_UnexposedDecl, CX_DeclKind.CX_DeclKind_Captured)
        {
            _contextParam = new Lazy <ImplicitParamDecl>(() => TranslationUnit.GetOrCreate <ImplicitParamDecl>(Handle.ContextParam));
            _decls        = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
            _parameters   = new Lazy <IReadOnlyList <ImplicitParamDecl> >(() => {
                var parameterCount = Handle.NumArguments;
                var parameters     = new List <ImplicitParamDecl>(parameterCount);

                for (int i = 0; i < parameterCount; i++)
                {
                    var parameter = TranslationUnit.GetOrCreate <ImplicitParamDecl>(Handle.GetArgument(unchecked ((uint)i)));
                    parameters.Add(parameter);
                }

                return(parameters);
            });
        }
Пример #18
0
        private protected Stmt(CXCursor handle, CXCursorKind expectedCursorKind, CX_StmtClass expectedStmtClass) : base(handle, expectedCursorKind)
        {
            if ((handle.StmtClass == CX_StmtClass.CX_StmtClass_Invalid) || (handle.StmtClass != expectedStmtClass))
            {
                throw new ArgumentException(nameof(handle));
            }

            _children    = new Lazy <IReadOnlyList <Stmt> >(() => CursorChildren.OfType <Stmt>().ToList());
            _declContext = new Lazy <IDeclContext>(() => {
                var cursorParent = CursorParent;

                while (!(cursorParent is IDeclContext) && (cursorParent != null))
                {
                    cursorParent = cursorParent.CursorParent;
                }

                return((IDeclContext)cursorParent);
            });
        }
Пример #19
0
        private protected VarDecl(CXCursor handle, CXCursorKind expectedCursorKind, CX_DeclKind expectedDeclKind) : base(handle, expectedCursorKind, expectedDeclKind)
        {
            if ((CX_DeclKind.CX_DeclKind_LastVar < handle.DeclKind) || (handle.DeclKind < CX_DeclKind.CX_DeclKind_FirstVar))
            {
                throw new ArgumentException(nameof(handle));
            }

            _init = new Lazy <Expr>(() => {
                var exprs = CursorChildren.OfType <Expr>();

                if (Type is ArrayType)
                {
                    exprs = exprs.Skip(1);
                }

                return(exprs.SingleOrDefault());
            });
            _instantiatedFromStaticDataMember = new Lazy <VarDecl>(() => TranslationUnit.GetOrCreate <VarDecl>(Handle.SpecializedCursorTemplate));
        }
Пример #20
0
        private protected Stmt(CXCursor handle, CXCursorKind expectedCursorKind, CX_StmtClass expectedStmtClass) : base(handle, expectedCursorKind)
        {
            if ((handle.StmtClass == CX_StmtClass.CX_StmtClass_Invalid) || (handle.StmtClass != expectedStmtClass))
            {
                throw new ArgumentException(nameof(handle));
            }

            _children    = new Lazy <IReadOnlyList <Stmt> >(() => CursorChildren.OfType <Stmt>().ToList());
            _declContext = new Lazy <IDeclContext>(() => {
                var semanticParent = TranslationUnit.GetOrCreate <Cursor>(Handle.SemanticParent);

                while (!(semanticParent is IDeclContext) && (semanticParent != null))
                {
                    semanticParent = TranslationUnit.GetOrCreate <Cursor>(semanticParent.Handle.SemanticParent);
                }

                return((IDeclContext)semanticParent);
            });
        }
Пример #21
0
        private protected Decl(CXCursor handle, CXCursorKind expectedCursorKind, CX_DeclKind expectedDeclKind) : base(handle, expectedCursorKind)
        {
            if ((handle.DeclKind == CX_DeclKind.CX_DeclKind_Invalid) || (handle.DeclKind != expectedDeclKind))
            {
                throw new ArgumentException(nameof(handle));
            }

            _asFunction             = new Lazy <FunctionDecl>(() => TranslationUnit.GetOrCreate <FunctionDecl>(Handle.AsFunction));
            _attrs                  = new Lazy <IReadOnlyList <Attr> >(() => CursorChildren.OfType <Attr>().ToList());
            _body                   = new Lazy <Stmt>(() => TranslationUnit.GetOrCreate <Stmt>(Handle.Body));
            _canonicalDecl          = new Lazy <Decl>(() => TranslationUnit.GetOrCreate <Decl>(Handle.CanonicalCursor));
            _declContext            = new Lazy <IDeclContext>(() => TranslationUnit.GetOrCreate <Decl>(Handle.SemanticParent) as IDeclContext);
            _describedTemplate      = new Lazy <TemplateDecl>(() => TranslationUnit.GetOrCreate <TemplateDecl>(Handle.DescribedTemplate));
            _lexicalDeclContext     = new Lazy <IDeclContext>(() => TranslationUnit.GetOrCreate <Decl>(Handle.LexicalParent) as IDeclContext);
            _mostRecentDecl         = new Lazy <Decl>(() => TranslationUnit.GetOrCreate <Decl>(Handle.MostRecentDecl));
            _nextDeclInContext      = new Lazy <Decl>(() => TranslationUnit.GetOrCreate <Decl>(Handle.NextDeclInContext));
            _nonClosureContext      = new Lazy <Decl>(() => TranslationUnit.GetOrCreate <Decl>(Handle.NonClosureContext));
            _parentFunctionOrMethod = new Lazy <IDeclContext>(() => TranslationUnit.GetOrCreate <Decl>(Handle.ParentFunctionOrMethod) as IDeclContext);
            _previousDecl           = new Lazy <Decl>(() => TranslationUnit.GetOrCreate <Decl>(Handle.PreviousDecl));
            _translationUnitDecl    = new Lazy <TranslationUnitDecl>(() => TranslationUnit.GetOrCreate <TranslationUnitDecl>(Handle.TranslationUnit.Cursor));
        }
Пример #22
0
        private protected CXXRecordDecl(CXCursor handle, CXCursorKind expectedCursorKind, CX_DeclKind expectedDeclKind) : base(handle, expectedCursorKind, expectedDeclKind)
        {
            if ((CX_DeclKind.CX_DeclKind_LastCXXRecord < handle.DeclKind) || (handle.DeclKind < CX_DeclKind.CX_DeclKind_FirstCXXRecord))
            {
                throw new ArgumentException(nameof(handle));
            }

            _bases = new Lazy <IReadOnlyList <CXXBaseSpecifier> >(() => CursorChildren.OfType <CXXBaseSpecifier>().ToList());
            _ctors = new Lazy <IReadOnlyList <CXXConstructorDecl> >(() => Methods.OfType <CXXConstructorDecl>().ToList());
            _dependentLambdaCallOperator = new Lazy <FunctionTemplateDecl>(() => TranslationUnit.GetOrCreate <FunctionTemplateDecl>(Handle.DependentLambdaCallOperator));
            _describedClassTemplate      = new Lazy <ClassTemplateDecl>(() => TranslationUnit.GetOrCreate <ClassTemplateDecl>(Handle.DescribedClassTemplate));
            _destructor = new Lazy <CXXDestructorDecl>(() => TranslationUnit.GetOrCreate <CXXDestructorDecl>(Handle.Destructor));
            _friends    = new Lazy <IReadOnlyList <FriendDecl> >(() => Decls.OfType <FriendDecl>().ToList());
            _instantiatedFromMemberClass = new Lazy <CXXRecordDecl>(() => TranslationUnit.GetOrCreate <CXXRecordDecl>(Handle.InstantiatedFromMember));
            _lambdaCallOperator          = new Lazy <CXXMethodDecl>(() => TranslationUnit.GetOrCreate <CXXMethodDecl>(Handle.LambdaCallOperator));
            _lambdaContextDecl           = new Lazy <Decl>(() => TranslationUnit.GetOrCreate <Decl>(Handle.LambdaContextDecl));
            _lambdaStaticInvoker         = new Lazy <CXXMethodDecl>(() => TranslationUnit.GetOrCreate <CXXMethodDecl>(Handle.LambdaStaticInvoker));
            _methods = new Lazy <IReadOnlyList <CXXMethodDecl> >(() => Decls.OfType <CXXMethodDecl>().ToList());
            _mostRecentNonInjectedDecl    = new Lazy <CXXRecordDecl>(() => TranslationUnit.GetOrCreate <CXXRecordDecl>(Handle.MostRecentNonInjectedDecl));
            _templateInstantiationPattern = new Lazy <CXXRecordDecl>(() => TranslationUnit.GetOrCreate <CXXRecordDecl>(Handle.TemplateInstantiationPattern));
            _vbases = new Lazy <IReadOnlyList <CXXBaseSpecifier> >(() => Bases.Where((@base) => @base.IsVirtual).ToList());
        }
Пример #23
0
        internal UnaryExprOrTypeTraitExpr(CXCursor handle) : base(handle, CXCursorKind.CXCursor_UnaryExpr, CX_StmtClass.CX_StmtClass_UnaryExprOrTypeTraitExpr)
        {
            _argumentExpr = new Lazy <Expr>(() => CursorChildren.OfType <Expr>().SingleOrDefault());
            _argumentType = new Lazy <Ref>(() => CursorChildren.OfType <Ref>().SingleOrDefault());
            _kind         = new Lazy <CX_UnaryExprOrTypeTrait>(() => {
                var translationUnitHandle = TranslationUnit.Handle;

                var tokens             = translationUnitHandle.Tokenize(Handle.RawExtent);
                var firstTokenSpelling = (tokens.Length > 0) ? tokens[0].GetSpelling(translationUnitHandle).CString : string.Empty;

                switch (firstTokenSpelling)
                {
                case "sizeof":
                    {
                        return(CX_UnaryExprOrTypeTrait.CX_UETT_SizeOf);
                    }

                default:
                    {
                        return(CX_UnaryExprOrTypeTrait.CX_UETT_Invalid);
                    }
                }
            });
        }
Пример #24
0
 internal CapturedDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_UnexposedDecl, CX_DeclKind.CX_DeclKind_Captured)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
 }
Пример #25
0
 internal TranslationUnitDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_TranslationUnit, CX_DeclKind.CX_DeclKind_TranslationUnit)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
 }
Пример #26
0
 internal NamespaceDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_Namespace)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList());
 }
Пример #27
0
 internal TranslationUnitDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_TranslationUnit)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList());
 }
Пример #28
0
 internal NamespaceDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_Namespace, CX_DeclKind.CX_DeclKind_Namespace)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
 }
Пример #29
0
 private protected Stmt(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _children = new Lazy <IReadOnlyList <Stmt> >(() => CursorChildren.OfType <Stmt>().ToList());
 }
Пример #30
0
 internal DeclStmt(CXCursor handle) : base(handle, CXCursorKind.CXCursor_DeclStmt, CX_StmtClass.CX_StmtClass_DeclStmt)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.OfType <Decl>().ToList());
 }