Пример #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 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));
 }
Пример #3
0
 internal CXXRecordDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _bases      = new Lazy <IReadOnlyList <CXXBaseSpecifier> >(() => CursorChildren.Where((cursor) => cursor is CXXBaseSpecifier).Cast <CXXBaseSpecifier>().ToList());
     _ctors      = new Lazy <IReadOnlyList <CXXConstructorDecl> >(() => Methods.Where((method) => method is CXXConstructorDecl).Cast <CXXConstructorDecl>().ToList());
     _destructor = new Lazy <CXXDestructorDecl>(() => Methods.Where((method) => method is CXXDestructorDecl).Cast <CXXDestructorDecl>().Single());
     _friends    = new Lazy <IReadOnlyList <FriendDecl> >(() => Decls.Where((decl) => decl is FriendDecl).Cast <FriendDecl>().ToList());
     _methods    = new Lazy <IReadOnlyList <CXXMethodDecl> >(() => Decls.Where((decl) => decl is CXXMethodDecl).Cast <CXXMethodDecl>().ToList());
     _vbases     = new Lazy <IReadOnlyList <CXXBaseSpecifier> >(() => Bases.Where((@base) => @base.IsVirtual).Cast <CXXBaseSpecifier>().ToList());
 }
Пример #4
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());
        }
Пример #5
0
 internal NamespaceDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_Namespace)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList());
 }
Пример #6
0
 internal TranslationUnitDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_TranslationUnit)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList());
 }
Пример #7
0
 private protected TagDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _decls      = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList());
     _definition = new Lazy <TagDecl>(() => TranslationUnit.GetOrCreate <TagDecl>(Handle.Definition));
 }
Пример #8
0
 private protected ObjCContainerDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList());
 }
Пример #9
0
 private protected Stmt(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _children = new Lazy <IReadOnlyList <Stmt> >(() => CursorChildren.Where((cursor) => cursor is Stmt).Cast <Stmt>().ToList());
 }
 internal ClassTemplatePartialSpecializationDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_ClassTemplatePartialSpecialization, CX_DeclKind.CX_DeclKind_ClassTemplatePartialSpecialization)
 {
     _templateParameters = new Lazy <IReadOnlyList <NamedDecl> >(() => CursorChildren.Where((cursor) => (cursor is TemplateTypeParmDecl) || (cursor is NonTypeTemplateParmDecl) || (cursor is TemplateTemplateParmDecl)).Cast <NamedDecl>().ToList());
 }
Пример #11
0
 private protected TemplateDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _templateParameters = new Lazy <IReadOnlyList <NamedDecl> >(() => CursorChildren.Where((cursor) => (cursor is TemplateTypeParmDecl) || (cursor is NonTypeTemplateParmDecl) || (cursor is TemplateTemplateParmDecl)).Cast <NamedDecl>().ToList());
 }
Пример #12
0
 internal EnumConstantDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_EnumConstantDecl)
 {
     _initExpr = new Lazy <Expr>(() => CursorChildren.Where((cursor) => cursor is Expr).Cast <Expr>().SingleOrDefault());
 }
Пример #13
0
 internal ObjCMethodDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList());
 }
Пример #14
0
 internal LinkageSpecDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_LinkageSpec)
 {
     _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList());
 }