Exemple #1
0
        public void SetupMetadata(CST.Global global)
        {
            NumWarnings = 0;
            NumErrors   = 0;

            Global = global;

            if (tracerStream != null)
            {
                Tracer = new CST.CSTWriter(global, CST.WriterStyle.Debug, tracerStream);
            }

            Validity = new ValidityContext(this);

            GenericEnumeratorTypeConstructorRef = MkRef(Constants.GenericEnumeratorTypeConstructorName);
            JSContextRef   = MkRef(Constants.JSContextName);
            JSObjectRef    = MkRef(Constants.JSObjectName);
            JSPropertyRef  = MkRef(Constants.JSPropertyName);
            JSExceptionRef = MkRef(Constants.JSExceptionName);

            GlobalMapping   = new GlobalMapping(this);
            AttributeHelper = new AttributeHelper(this);
            InteropManager  = new InteropManager(this);
            JSTHelpers      = new JSTHelpers(this);
            InlinedMethods  = new InlinedMethodCache(this);
            Traces          = new Traces(this);
        }
Exemple #2
0
        public string ResolveTypeRefToSlot(CST.TypeRef typeRef)
        {
            var assemblyDef = default(CST.AssemblyDef);

            if (typeRef.QualifiedTypeName.Assembly.PrimTryResolve(env.Global, out assemblyDef))
            {
                return(AssemblyMappingFor(assemblyDef).ResolveTypeDefinitionToSlot(typeRef.QualifiedTypeName.Type));
            }
            else
            {
                throw new InvalidOperationException("invalid type ref");
            }
        }
 public JST.Expression ResolveType(CST.TypeRef typeRef, TypePhase typePhase)
 {
     return(Env.JSTHelpers.DefaultResolveType(this, typeRef, typePhase));
 }
        public void SetupMetadata(CST.Global global)
        {
            NumWarnings = 0;
            NumErrors = 0;

            Global = global;

            if (tracerStream != null)
                Tracer = new CST.CSTWriter(global, CST.WriterStyle.Debug, tracerStream);

            Validity = new ValidityContext(this);

            GenericEnumeratorTypeConstructorRef = MkRef(Constants.GenericEnumeratorTypeConstructorName);
            JSContextRef = MkRef(Constants.JSContextName);
            JSObjectRef = MkRef(Constants.JSObjectName);
            JSPropertyRef = MkRef(Constants.JSPropertyName);
            JSExceptionRef = MkRef(Constants.JSExceptionName);

            GlobalMapping = new GlobalMapping(this);
            AttributeHelper = new AttributeHelper(this);
            InteropManager = new InteropManager(this);
            JSTHelpers = new JSTHelpers(this);
            InlinedMethods = new InlinedMethodCache(this);
            Traces = new Traces(this);
        }
Exemple #5
0
        public override CST.InvalidInfo ImplementableTypeRef(MessageContext ctxt, CST.RootEnvironment rootEnv, CST.TypeRef typeRef)
        {
            var s = typeRef.Style(rootEnv);

            if (s is CST.UnmanagedPointerTypeStyle)
            {
                Log(new CST.InvalidTypeRef(ctxt, typeRef, "Unmanaged pointers are not supported"));
                return(new CST.InvalidInfo(CST.MessageContextBuilders.Type(Global, typeRef)));
            }
            return(null);
        }
 public CustomAttribute(TypeRef typeRef, ISeq <object> positionalProperties, IMap <string, object> namedProperties)
 {
     Type = typeRef;
     PositionalProperties = positionalProperties ?? new Seq <object>();
     NamedProperties      = namedProperties ?? new Map <string, object>();
 }
Exemple #7
0
 public BoxCell(Expression box, TypeRef valueType)
 {
     Box       = box;
     ValueType = valueType;
 }
Exemple #8
0
 public override MemberRef WithDefiningType(TypeRef typeRef)
 {
     return(new EventRef(typeRef, Name));
 }
Exemple #9
0
 public abstract MemberRef WithDefiningType(TypeRef typeRef);
Exemple #10
0
 public PropertySignature(string name, bool isStatic, IImSeq <TypeRef> parameters, TypeRef result)
     : base(name)
 {
     IsStatic   = isStatic;
     Parameters = parameters ?? Constants.EmptyTypeRefs;
     Result     = result;
 }
Exemple #11
0
 public override MemberRef WithDefiningType(TypeRef typeRef)
 {
     return(new PropertyRef(typeRef, Name, IsStatic, Parameters, Result));
 }
Exemple #12
0
 public override MemberRef WithDefiningType(TypeRef typeRef)
 {
     return(new FieldRef(typeRef, Name, FieldType));
 }
Exemple #13
0
 public FieldSignature(string name, TypeRef fieldType)
     : base(name)
 {
     FieldType = fieldType;
 }
Exemple #14
0
 public override TypeRef ToCodePointer(Global global)
 {
     return(TypeRef.CodePointerFrom(global, Parameters, Result));
 }
Exemple #15
0
 public override MemberRef WithDefiningType(TypeRef typeRef)
 {
     return(new PolymorphicMethodRef(typeRef, Name, IsStatic, TypeArity, Parameters, Result));
 }
Exemple #16
0
 public MethodSignature(string name, bool isStatic, int typeArity, IImSeq <TypeRef> parameters, TypeRef result)
     : base(name)
 {
     IsStatic   = isStatic;
     TypeArity  = typeArity;
     Parameters = parameters ?? Constants.EmptyTypeRefs;
     Result     = result;
 }