Ejemplo n.º 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));
 }
Ejemplo n.º 2
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());
 }
Ejemplo n.º 3
0
 internal RecordDecl(CXCursor handle, CXCursorKind expectedKind) : base(handle, expectedKind)
 {
     _fields = new Lazy <IReadOnlyList <FieldDecl> >(() => Decls.Where((decl) => decl is FieldDecl).Cast <FieldDecl>().ToList());
 }
Ejemplo n.º 4
0
 internal EnumDecl(CXCursor handle) : base(handle, CXCursorKind.CXCursor_EnumDecl)
 {
     _enumerators = new Lazy <IReadOnlyList <EnumConstantDecl> >(() => Decls.Where((decl) => decl is EnumConstantDecl).Cast <EnumConstantDecl>().ToList());
     _integerType = new Lazy <Type>(() => TranslationUnit.GetOrCreate <Type>(Handle.EnumDecl_IntegerType));
 }