Beispiel #1
0
        static AbstractType HandleClassLikeMatch(DClassLike dc, ResolutionContext ctxt, object typeBase, bool canResolveBase)
        {
            AbstractType    ret;
            UserDefinedType udt = null;
            var             invisibleTypeParams = GetInvisibleTypeParameters(dc, ctxt);

            switch (dc.ClassType)
            {
            case DTokens.Struct:
                ret = new StructType(dc, typeBase as ISyntaxRegion, invisibleTypeParams);
                break;

            case DTokens.Union:
                ret = new UnionType(dc, typeBase as ISyntaxRegion, invisibleTypeParams);
                break;

            case DTokens.Class:
                udt = new ClassType(dc, typeBase as ISyntaxRegion, null, null, invisibleTypeParams);
                ret = null;
                break;

            case DTokens.Interface:
                udt = new InterfaceType(dc, typeBase as ISyntaxRegion, null, invisibleTypeParams);
                ret = null;
                break;

            case DTokens.Template:
                if (dc.ContainsAttribute(DTokens.Mixin))
                {
                    ret = new MixinTemplateType(dc, typeBase as ISyntaxRegion, invisibleTypeParams);
                }
                else
                {
                    ret = new TemplateType(dc, typeBase as ISyntaxRegion, invisibleTypeParams);
                }
                break;

            default:
                ret = null;
                ctxt.LogError(new ResolutionError(dc, "Unknown type (" + DTokens.GetTokenString(dc.ClassType) + ")"));
                break;
            }
            if (dc.ClassType == DTokens.Class || dc.ClassType == DTokens.Interface)
            {
                ret = canResolveBase ? DResolver.ResolveBaseClasses(udt, ctxt) : udt;
            }
            return(ret);
        }
		static AbstractType HandleClassLikeMatch (DClassLike dc, ResolutionContext ctxt, object typeBase, bool canResolveBase)
		{
			AbstractType ret;
			UserDefinedType udt = null;
			var invisibleTypeParams = GetInvisibleTypeParameters (dc, ctxt);

			switch (dc.ClassType) {
				case DTokens.Struct:
					ret = new StructType (dc, typeBase as ISyntaxRegion, invisibleTypeParams);
					break;
				case DTokens.Union:
					ret = new UnionType (dc, typeBase as ISyntaxRegion, invisibleTypeParams);
					break;
				case DTokens.Class:
					udt = new ClassType (dc, typeBase as ISyntaxRegion, null, null, invisibleTypeParams);
					ret = null;
					break;
				case DTokens.Interface:
					udt = new InterfaceType (dc, typeBase as ISyntaxRegion, null, invisibleTypeParams);
					ret = null;
					break;
				case DTokens.Template:
					if (dc.ContainsAttribute (DTokens.Mixin))
						ret = new MixinTemplateType (dc, typeBase as ISyntaxRegion, invisibleTypeParams);
					else
						ret = new TemplateType (dc, typeBase as ISyntaxRegion, invisibleTypeParams);
					break;
				default:
					ret = null;
					ctxt.LogError (new ResolutionError (dc, "Unknown type (" + DTokens.GetTokenString (dc.ClassType) + ")"));
					break;
			}
			if (dc.ClassType == DTokens.Class || dc.ClassType == DTokens.Interface)
				ret = canResolveBase ? DResolver.ResolveBaseClasses (udt, ctxt) : udt;
			return ret;
		}
 public void VisitMixinTemplateType(MixinTemplateType t)
 {
     VisitTemplateType(t);
 }
 public ulong VisitMixinTemplateType(MixinTemplateType t)
 {
     return(1001831);
 }
Beispiel #5
0
 public ISymbolValue VisitMixinTemplateType(MixinTemplateType t)
 {
     throw new NotImplementedException();
 }
Beispiel #6
0
 public ISymbolValue VisitMixinTemplateType(MixinTemplateType t)
 {
     return(new TypeValue(t));
 }