public RQIndexer( RQUnconstructedType containingType, RQMethodPropertyOrEventName memberName, int typeParameterCount, IList<RQParameter> parameters) : base(containingType, memberName, typeParameterCount, parameters) { }
public RQMethodOrProperty( RQUnconstructedType containingType, RQMethodPropertyOrEventName memberName, int typeParameterCount, IList<RQParameter> parameters) : base(containingType, memberName) { this.TypeParameterCount = typeParameterCount; this.Parameters = new ReadOnlyCollection<RQParameter>(parameters); }
public RQEvent(RQUnconstructedType containingType, RQMethodPropertyOrEventName memberName) : base(containingType, memberName) { }
private static RQType BuildType(ITypeSymbol symbol, bool buildForPublicAPIs) { if (symbol.IsAnonymousType) { return null; } if (symbol.SpecialType == SpecialType.System_Void) { return RQVoidType.Singleton; } else if (symbol.TypeKind == TypeKind.Pointer) { return new RQPointerType(BuildType((symbol as IPointerTypeSymbol).PointedAtType, buildForPublicAPIs)); } else if (symbol.TypeKind == TypeKind.Array) { return new RQArrayType((symbol as IArrayTypeSymbol).Rank, BuildType((symbol as IArrayTypeSymbol).ElementType, buildForPublicAPIs)); } else if (symbol.TypeKind == TypeKind.TypeParameter) { return new RQTypeVariableType(symbol.Name); } else if (symbol.TypeKind == TypeKind.Unknown) { return new RQErrorType(symbol.Name); } else if (symbol.TypeKind == TypeKind.Dynamic) { if (buildForPublicAPIs) { var objectType = new RQUnconstructedType(new[] { "System" }, new[] { new RQUnconstructedTypeInfo("Object", 0) }); return new RQConstructedType(objectType, new RQType[] { }); } else { return RQDynamicType.Singleton; } } else if (symbol.Kind == SymbolKind.NamedType || symbol.Kind == SymbolKind.ErrorType) { var namedTypeSymbol = symbol as INamedTypeSymbol; var definingType = namedTypeSymbol.ConstructedFrom != null ? namedTypeSymbol.ConstructedFrom : namedTypeSymbol; var typeChain = new List<INamedTypeSymbol>(); var type = namedTypeSymbol; typeChain.Add(namedTypeSymbol); while (type.ContainingType != null) { type = type.ContainingType; typeChain.Add(type); } typeChain.Reverse(); var typeArgumentList = new List<RQType>(); foreach (var entry in typeChain) { foreach (var typeArgument in entry.TypeArguments) { typeArgumentList.Add(BuildType(typeArgument, buildForPublicAPIs)); } } var containingType = BuildNamedType(definingType); if (containingType == null) { return null; } return new RQConstructedType(containingType, typeArgumentList); } else { return null; } }
public RQMethodPropertyOrEvent(RQUnconstructedType containingType, RQMethodPropertyOrEventName memberName) : base(containingType) { this.RqMemberName = memberName; }
private static RQType BuildType(ITypeSymbol symbol, bool buildForPublicAPIs) { if (symbol.IsAnonymousType) { return(null); } if (symbol.SpecialType == SpecialType.System_Void) { return(RQVoidType.Singleton); } else if (symbol.TypeKind == TypeKind.Pointer) { return(new RQPointerType(BuildType((symbol as IPointerTypeSymbol).PointedAtType, buildForPublicAPIs))); } else if (symbol.TypeKind == TypeKind.Array) { return(new RQArrayType((symbol as IArrayTypeSymbol).Rank, BuildType((symbol as IArrayTypeSymbol).ElementType, buildForPublicAPIs))); } else if (symbol.TypeKind == TypeKind.TypeParameter) { return(new RQTypeVariableType(symbol.Name)); } else if (symbol.TypeKind == TypeKind.Unknown) { return(new RQErrorType(symbol.Name)); } else if (symbol.TypeKind == TypeKind.Dynamic) { if (buildForPublicAPIs) { var objectType = new RQUnconstructedType(new[] { "System" }, new[] { new RQUnconstructedTypeInfo("Object", 0) }); return(new RQConstructedType(objectType, Array.Empty <RQType>())); } else { return(RQDynamicType.Singleton); } } else if (symbol.Kind == SymbolKind.NamedType || symbol.Kind == SymbolKind.ErrorType) { var namedTypeSymbol = symbol as INamedTypeSymbol; var definingType = namedTypeSymbol.ConstructedFrom != null ? namedTypeSymbol.ConstructedFrom : namedTypeSymbol; var typeChain = new List <INamedTypeSymbol>(); var type = namedTypeSymbol; typeChain.Add(namedTypeSymbol); while (type.ContainingType != null) { type = type.ContainingType; typeChain.Add(type); } typeChain.Reverse(); var typeArgumentList = new List <RQType>(); foreach (var entry in typeChain) { foreach (var typeArgument in entry.TypeArguments) { typeArgumentList.Add(BuildType(typeArgument, buildForPublicAPIs)); } } var containingType = BuildNamedType(definingType); if (containingType == null) { return(null); } return(new RQConstructedType(containingType, typeArgumentList)); } else { return(null); } }
static string ClrName(this RQUnconstructedType type) { return(string.Concat(type.NamespaceNames.Select(n => n + ".")) + string.Join(".", type.TypeInfos.Select(ClrName))); }
public RQMemberVariable(RQUnconstructedType containingType, string name) : base(containingType) { this.Name = name; }
public RQConstructedType(RQUnconstructedType definingType, IList<RQType> typeArguments) { this.DefiningType = definingType; this.TypeArguments = new ReadOnlyCollection<RQType>(typeArguments); }