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)); }
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)); }
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()); }
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()); }
internal NamespaceDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_Namespace) { _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList()); }
internal TranslationUnitDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_TranslationUnit) { _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList()); }
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)); }
private protected ObjCContainerDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind) { _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList()); }
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()); }
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()); }
internal EnumConstantDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_EnumConstantDecl) { _initExpr = new Lazy <Expr>(() => CursorChildren.Where((cursor) => cursor is Expr).Cast <Expr>().SingleOrDefault()); }
internal ObjCMethodDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind) { _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList()); }
internal LinkageSpecDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_LinkageSpec) { _decls = new Lazy <IReadOnlyList <Decl> >(() => CursorChildren.Where((cursor) => cursor is Decl).Cast <Decl>().ToList()); }