Esempio n. 1
0
 virtual public void Clear()
 {
     _items.Clear();
 }
Esempio n. 2
0
        override public void OnAttribute(Boo.Lang.Compiler.Ast.Attribute attribute)
        {
            if (null != attribute.Entity)
            {
                return;
            }

            _elements.Clear();

            if (!NameResolutionService.ResolveQualifiedName(_elements, BuildAttributeName(attribute.Name)))
            {
                NameResolutionService.ResolveQualifiedName(_elements, attribute.Name);
            }

            if (_elements.Count > 0)
            {
                if (_elements.Count > 1)
                {
                    Error(attribute, CompilerErrorFactory.AmbiguousReference(
                              attribute,
                              attribute.Name,
                              _elements));
                }
                else
                {
                    IEntity tag = (IEntity)_elements[0];
                    if (EntityType.Type != tag.EntityType)
                    {
                        Error(attribute, CompilerErrorFactory.NameNotType(attribute, attribute.Name));
                    }
                    else
                    {
                        IType attributeType = ((ITypedEntity)tag).Type;
                        if (IsAstAttribute(attributeType))
                        {
                            ExternalType externalType = attributeType as ExternalType;
                            if (null == externalType)
                            {
                                Error(attribute, CompilerErrorFactory.AstAttributeMustBeExternal(attribute, attributeType.FullName));
                            }
                            else
                            {
                                ScheduleAttributeApplication(attribute, externalType.ActualType);

                                RemoveCurrentNode();
                            }
                        }
                        else
                        {
                            if (!IsSystemAttribute(attributeType))
                            {
                                Error(attribute, CompilerErrorFactory.TypeNotAttribute(attribute, attributeType.FullName));
                            }
                            else
                            {
                                // remember the attribute's type
                                attribute.Name   = attributeType.FullName;
                                attribute.Entity = attributeType;
                            }
                        }
                    }
                }
            }
            else
            {
                Error(attribute, CompilerErrorFactory.UnknownAttribute(attribute, attribute.Name));
            }
        }
Esempio n. 3
0
 override public void Dispose()
 {
     _parameters.Clear();
     _events.Clear();
     base.Dispose();
 }
Esempio n. 4
0
 private void Reset()
 {
     _parameters.Clear();
     _events.Clear();
 }