示例#1
0
 public void EmitCustomAttribute(CustomAttributeBuilder /*!*/ builder, CustomAttribute.TargetSelectors selector)
 {
     foreach (GlobalConstantDecl cd in constants)
     {
         cd.EmitCustomAttribute(builder);
     }
 }
示例#2
0
 public void EmitCustomAttribute(CustomAttributeBuilder /*!*/ builder, CustomAttribute.TargetSelectors selector)
 {
     if (selector == CustomAttribute.TargetSelectors.Return)
     {
         function.Builder.ReturnParamBuilder.SetCustomAttribute(builder);
     }
     else
     {
         // custom attributes ignored on functions in evals:
         ReflectionUtils.SetCustomAttribute(function.ArgFullInfo, builder);
     }
 }
示例#3
0
                public int GetAttributeUsageCount(DType /*!*/ type, CustomAttribute.TargetSelectors selector)
                {
                    var attributes = node.Attributes;

                    if (attributes == null || attributes.Attributes == null)
                    {
                        return(0);
                    }
                    else
                    {
                        return(attributes.Count(type, selector));
                    }
                }
示例#4
0
            public int Count(CustomAttributes /*!*/ node, DType /*!*/ attributeType, CustomAttribute.TargetSelectors selector)
            {
                if (node.Attributes == null)
                {
                    return(0);
                }

                int count = 0;

                foreach (CustomAttribute attribute in node.Attributes)
                {
                    if (attribute.TargetSelector == selector && attribute.GetResolvedType().Equals(attributeType))
                    {
                        count++;
                    }
                }

                return(count);
            }
示例#5
0
        public void ApplyCustomAttribute(SpecialAttributes kind, Attribute attribute, CustomAttribute.TargetSelectors selector)
        {
            switch (kind)
            {
            case SpecialAttributes.Export:
                function.Builder.ExportInfo = (ExportAttribute)attribute;
                break;

            default:
                Debug.Fail("N/A");
                throw null;
            }
        }
示例#6
0
 public int GetAttributeUsageCount(DType /*!*/ type, CustomAttribute.TargetSelectors selector)
 {
     return(attributes.Count(type, selector));
 }
示例#7
0
 public void EmitCustomAttribute(CustomAttributeBuilder /*!*/ builder, CustomAttribute.TargetSelectors selector)
 {
     Debug.Assert(selector == CustomAttribute.TargetSelectors.Default);
     routine.Builder.ParameterBuilders[routine.FirstPhpParameterIndex + index].SetCustomAttribute(builder);
 }
示例#8
0
        public void ApplyCustomAttribute(SpecialAttributes kind, Attribute attribute, CustomAttribute.TargetSelectors selector)
        {
            Debug.Assert(selector == CustomAttribute.TargetSelectors.Default);

            switch (kind)
            {
            case SpecialAttributes.Out:
                isOut = true;
                break;

            default:
                Debug.Fail("N/A");
                throw null;
            }
        }
示例#9
0
 public static int Count(this CustomAttributes /*!*/ node, DType /*!*/ attributeType, CustomAttribute.TargetSelectors selector)
 {
     return(node.Compiler().Count(node, attributeType, selector));
 }
示例#10
0
        internal void ApplyCustomAttribute(SpecialAttributes kind, Attribute attribute, CustomAttribute.TargetSelectors selector)
        {
            switch (kind)
            {
            case SpecialAttributes.Export:
                constant.ExportInfo = (ExportAttribute)attribute;
                break;

            default:
                Debug.Fail("N/A");
                throw null;
            }
        }
示例#11
0
 public void ApplyCustomAttribute(SpecialAttributes kind, Attribute attribute, CustomAttribute.TargetSelectors selector)
 {
     foreach (GlobalConstantDecl cd in constants)
     {
         cd.ApplyCustomAttribute(kind, attribute, selector);
     }
 }
示例#12
0
        private List <CustomAttribute> /*!*/ CustomAttributes(List <CustomAttribute> /*!*/ attrs, CustomAttribute.TargetSelectors targetSelector)
        {
            for (int i = 0; i < attrs.Count; i++)
            {
                attrs[i].TargetSelector = targetSelector;
            }

            return(attrs);
        }
示例#13
0
 public void EmitCustomAttribute(CustomAttributeBuilder /*!*/ builder, CustomAttribute.TargetSelectors selector)
 {
     foreach (GlobalConstantDecl cd in node.Constants)
     {
         var cdcompiler = cd.NodeCompiler <IGlobalConstantDeclCompiler>();
         cdcompiler.EmitCustomAttribute(builder);
     }
 }
示例#14
0
 public void ApplyCustomAttribute(SpecialAttributes kind, Attribute attribute, CustomAttribute.TargetSelectors selector)
 {
     foreach (GlobalConstantDecl cd in node.Constants)
     {
         var cdcompiler = cd.NodeCompiler <IGlobalConstantDeclCompiler>();
         cdcompiler.ApplyCustomAttribute(kind, attribute, selector);
     }
 }
示例#15
0
                public void EmitCustomAttribute(CustomAttributeBuilder /*!*/ builder, CustomAttribute.TargetSelectors selector)
                {
                    Debug.Assert(selector == CustomAttribute.TargetSelectors.Default);

                    var nodecompiler = node.NodeCompiler <FormalParamCompiler>();

                    nodecompiler.routine.Builder.ParameterBuilders[nodecompiler.routine.FirstPhpParameterIndex + nodecompiler.index].SetCustomAttribute(builder);
                }