Ejemplo n.º 1
0
        protected internal override void Resolve(IResolver resolver, bool canEnterContext)
        {
            base.Resolve(resolver, false);

            if (canEnterContext)
                resolver.Context.Enter(this.name.Identifier, false);

            for (int i = 0; i < this.BaseClasses.Count; i++)
            {
                if (this.BaseClasses[i] is TypeNode &&
                    !(this.BaseClasses[i] is IdentifiedTypeNode))
                {
                    IdentifiedTypeNode node = resolver.IdentifyType((TypeNode)this.BaseClasses[i]);

                    if (node != null)
                        this.BaseClasses[i] = node;
                }
                else
                {
                    throw new NotSupportedException();
                }
            }

            foreach (EnumNode node in this.Enums)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (ClassNode node in this.Classes)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (DelegateNode node in this.Delegates)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (InterfaceNode node in this.Interfaces)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (StructNode node in this.Structs)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (ConstantNode node in this.Constants)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (FieldNode node in this.Fields)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (PropertyNode node in this.Properties)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }


            foreach (ConstructorNode node in this.Constructors)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (DestructorNode node in this.Destructors)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (MethodNode node in this.Methods)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (OperatorNode node in this.Operators)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (IndexerNode node in this.Indexers)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (EventNode node in this.Events)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (FixedBufferNode node in this.FixedBuffers)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            if (canEnterContext)
                resolver.Context.Leave();
        }
Ejemplo n.º 2
0
        protected internal override void Resolve(IResolver resolver, bool canEnterContext)
        {
            base.Resolve(resolver, false);

            if (canEnterContext)
            {
                resolver.Context.Enter(name.Identifier, false);
            }

            for (int i = 0; i < BaseClasses.Count; i++)
            {
                if (BaseClasses[i] is TypeNode &&
                    !(BaseClasses[i] is IdentifiedTypeNode))
                {
                    IdentifiedTypeNode node = resolver.IdentifyType((TypeNode)BaseClasses[i]);

                    if (node != null)
                    {
                        BaseClasses[i] = node;
                    }
                }
                else
                {
                    throw new NotSupportedException();
                }
            }

            foreach (EnumNode node in Enums)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (ClassNode node in Classes)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (DelegateNode node in Delegates)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (InterfaceNode node in Interfaces)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (StructNode node in Structs)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (ConstantNode node in Constants)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (FieldNode node in Fields)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (PropertyNode node in Properties)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }


            foreach (ConstructorNode node in Constructors)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (DestructorNode node in Destructors)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (MethodNode node in Methods)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (OperatorNode node in Operators)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (IndexerNode node in Indexers)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (EventNode node in Events)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            foreach (FixedBufferNode node in FixedBuffers)
            {
                node.Parent = this;
                node.Resolve(resolver);
            }

            if (canEnterContext)
            {
                resolver.Context.Leave();
            }
        }