public IType FindType(BVEPrimitiveTypeCode typeCode) { IType type = LazyInit.VolatileRead(ref primitive_types[(int)typeCode]); if(type != null) return type; return LazyInit.GetOrSet(ref primitive_types[(int)typeCode], SearchType(typeCode)); }
IType SearchType(BVEPrimitiveTypeCode typeCode) { var type_ref = PrimitiveTypeReference.Get(typeCode); if(type_ref == null) return SpecialType.UnknownType; var type_name = new TopLevelTypeName(type_ref.Namespace, type_ref.Name, 0); foreach(var asm in compilation.Assemblies){ var type_def = asm.GetTypeDefinition(type_name); if(type_def != null) return type_def; } return new UnknownType(type_name); }
public IType FindType(BVEPrimitiveTypeCode typeCode) { return type_cache.FindType(typeCode); }
public static PrimitiveTypeReference Get(BVEPrimitiveTypeCode typeCode) { switch(typeCode){ case BVEPrimitiveTypeCode.None: return Void; case BVEPrimitiveTypeCode.Integer: return Integer; case BVEPrimitiveTypeCode.Float: return Float; case BVEPrimitiveTypeCode.Name: return NameType; case BVEPrimitiveTypeCode.FilePath: return Path; case BVEPrimitiveTypeCode.Time: return Time; case BVEPrimitiveTypeCode.EnumTilt: return EnumTilt; case BVEPrimitiveTypeCode.EnumDirection: return EnumDirection; case BVEPrimitiveTypeCode.EnumForwardDirection: return EnumForward; default: throw new InvalidOperationException(); } }
public PrimitiveTypeReference(BVEPrimitiveTypeCode typeCode, string typeName) { type_code = typeCode; name = typeName; @namespace = "global"; }