Example #1
0
        internal PropertyInstance(ScopeMember factory, GenericInstance instance, PropertyVariable template)
            : base(factory.GetModule())
        {
            this.type  = template.GetVariableType().InstanceGeneric(instance, GetModule());
            this.flags = template.flags;
            this.SetName(template.GetName());
            this.parentScope = (Scope)factory;
            if (template.getAccessor != null)
            {
                this.getAccessor = (Function)template.getAccessor.InstanceMember(factory, instance);
            }
            if (template.setAccessor != null)
            {
                this.setAccessor = (Function)template.setAccessor.InstanceMember(factory, instance);
            }

            // Instance the indexers.
            if (template.indices != null)
            {
                int numindices = template.indices.Length;
                this.indices = new IChelaType[numindices];
                for (int i = 0; i < numindices; ++i)
                {
                    this.indices[i] = template.indices[i].InstanceGeneric(instance, GetModule());
                }
            }
        }
Example #2
0
        public FunctionInstance(Function template, GenericInstance genericInstance, ScopeMember factory)
            : base(factory.GetModule())
        {
            this.factory = factory;
            Initialize(template, genericInstance);

            // Use the factory as a scope.
            this.UpdateParent((Scope)factory);
        }
Example #3
0
        public FunctionInstance(Function template, GenericInstance genericInstance, ScopeMember factory)
            : base(factory.GetModule())
        {
            this.factory = factory;
            Initialize(template, genericInstance);

            // Use the factory as a scope.
            this.UpdateParent((Scope)factory);
        }
Example #4
0
        internal PropertyInstance(ScopeMember factory, GenericInstance instance, PropertyVariable template)
            : base(factory.GetModule())
        {
            this.type = template.GetVariableType().InstanceGeneric(instance, GetModule());
            this.flags = template.flags;
            this.SetName(template.GetName());
            this.parentScope = (Scope)factory;
            if(template.getAccessor != null)
                this.getAccessor = (Function)template.getAccessor.InstanceMember(factory, instance);
            if(template.setAccessor != null)
                this.setAccessor = (Function)template.setAccessor.InstanceMember(factory, instance);

            // Instance the indexers.
            if(template.indices != null)
            {
                int numindices = template.indices.Length;
                this.indices = new IChelaType[numindices];
                for(int i = 0; i < numindices; ++i)
                    this.indices[i] = template.indices[i].InstanceGeneric(instance, GetModule());
            }
        }
Example #5
0
        internal FieldInstance(ScopeMember factory, GenericInstance instance, FieldVariable template)
            : base(factory.GetModule())
        {
            // Store the factory and the template.
            this.factory = factory;
            this.template = template;

            // Use the factory as the parent scope.
            this.parentScope = (Scope)factory;

            // Copy the name and the flags.
            this.SetName(template.GetName());
            this.flags = template.flags;

            // Copy the slot.
            this.slot = template.slot;

            // Instance the type.
            this.type = template.GetVariableType().InstanceGeneric(instance, GetModule());

            // Use the factory as parent scope.
            this.parentScope = (Scope)factory;
        }
Example #6
0
        internal FieldInstance(ScopeMember factory, GenericInstance instance, FieldVariable template)
            : base(factory.GetModule())
        {
            // Store the factory and the template.
            this.factory  = factory;
            this.template = template;

            // Use the factory as the parent scope.
            this.parentScope = (Scope)factory;

            // Copy the name and the flags.
            this.SetName(template.GetName());
            this.flags = template.flags;

            // Copy the slot.
            this.slot = template.slot;

            // Instance the type.
            this.type = template.GetVariableType().InstanceGeneric(instance, GetModule());

            // Use the factory as parent scope.
            this.parentScope = (Scope)factory;
        }