• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Ast.TypeReference类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Boo.Lang.Compiler.Ast.TypeReference的典型用法代码示例。如果您正苦于以下问题:C# TypeReference类的具体用法?C# TypeReference怎么用?C# TypeReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TypeReference类属于Boo.Lang.Compiler.Ast命名空间,在下文中一共展示了TypeReference类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ConvTypeRef

		CodeTypeReference ConvTypeRef(TypeReference tr)
		{
			if (tr == null) return null;
			string name = tr.ToString();
			if (BooAmbience.ReverseTypeConversionTable.ContainsKey(name))
				name = BooAmbience.ReverseTypeConversionTable[name];
			return new CodeTypeReference(name);
		}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:8,代码来源:CodeDomVisitor.cs


示例2: IsSameType

		static bool IsSameType(TypeReference a, TypeReference b, StringComparer nameComparer)
		{
			ArrayTypeReference arr1 = a as ArrayTypeReference;
			ArrayTypeReference arr2 = b as ArrayTypeReference;
			SimpleTypeReference s1 = a as SimpleTypeReference;
			SimpleTypeReference s2 = b as SimpleTypeReference;
			if (arr1 != null && arr2 != null) {
				if (arr1.Rank.Value != arr2.Rank.Value)
					return false;
				return IsSameType(arr1.ElementType, arr2.ElementType, nameComparer);
			} else if (s1 != null && s2 != null) {
				return nameComparer.Equals(s1.Name, s2.Name);
			} else {
				return false;
			}
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:16,代码来源:RenameLocalsVisitor.cs


示例3: CreateRuntimeMethod

 public Method CreateRuntimeMethod(string name, TypeReference returnType)
 {
     Method method = CreateVirtualMethod(name, returnType);
     method.ImplementationFlags = MethodImplementationFlags.Runtime;
     return method;
 }
开发者ID:0xb1dd1e,项目名称:boo,代码行数:6,代码来源:BooCodeBuilder.cs


示例4: CheckParameterType

 void CheckParameterType(TypeReference type)
 {
     if (type.Entity != VoidType()) return;
     Error(CompilerErrorFactory.InvalidParameterType(type, VoidType()));
 }
开发者ID:stuman08,项目名称:boo,代码行数:5,代码来源:ProcessMethodBodies.cs


示例5: Event

		public Event(LexicalInfo lexicalInfo, string name, TypeReference type) : base(lexicalInfo)
		{
			this.Name = name;
			this.Type = type;
		}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:5,代码来源:Event.cs


示例6: Field

 public Field(LexicalInfo lexicalInfo, TypeReference type, Expression initializer)
     : base(lexicalInfo)
 {
     this.Type = type;
     this.Initializer = initializer;
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:6,代码来源:Field.cs


示例7: Declaration

 public Declaration(LexicalInfo token, string name, TypeReference type)
     : base(token)
 {
     this.Name = name;
     this.Type = type;
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:6,代码来源:Declaration.cs


示例8: Replace

 public override bool Replace(Node existing, Node newNode)
 {
     if (base.Replace(existing, newNode))
     {
         return true;
     }
     if (_type == existing)
     {
         this.Type = (TypeReference)newNode;
         return true;
     }
     return false;
 }
开发者ID:stuman08,项目名称:boo,代码行数:13,代码来源:DeclarationImpl.cs


示例9: CheckParameterType

 void CheckParameterType(TypeReference type)
 {
     if (type.Entity != TypeSystemServices.VoidType) return;
     Error(CompilerErrorFactory.InvalidParameterType(type, type.Entity.ToString()));
 }
开发者ID:Bombadil77,项目名称:boo,代码行数:5,代码来源:ProcessMethodBodies.cs


示例10: CheckDeclarationType

 bool CheckDeclarationType(TypeReference type)
 {
     if (type.Entity != TypeSystemServices.VoidType) return true;
     Error(CompilerErrorFactory.InvalidDeclarationType(type, type.Entity.ToString()));
     return false;
 }
开发者ID:Bombadil77,项目名称:boo,代码行数:6,代码来源:ProcessMethodBodies.cs


示例11: ParameterDeclaration

 public ParameterDeclaration(string name, TypeReference type)
     : this(name, type, ParameterModifiers.None)
 {
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:4,代码来源:ParameterDeclaration.cs


示例12: TypeConstraintConflictsWithSpecialConstraint

 public static CompilerError TypeConstraintConflictsWithSpecialConstraint(GenericParameterDeclaration gpd, TypeReference type, string constraint)
 {
     return Instantiate("BCE0161", type, gpd.Name, type, constraint);
 }
开发者ID:neonux,项目名称:boo,代码行数:4,代码来源:CompilerErrorFactory.cs


示例13: MultipleBaseTypeConstraints

 public static CompilerError MultipleBaseTypeConstraints(GenericParameterDeclaration gpd, TypeReference type, TypeReference other)
 {
     return Instantiate("BCE0163", type, gpd.Name, type, other);
 }
开发者ID:neonux,项目名称:boo,代码行数:4,代码来源:CompilerErrorFactory.cs


示例14: InvalidTypeConstraint

 public static CompilerError InvalidTypeConstraint(GenericParameterDeclaration gpd, TypeReference type)
 {
     return Instantiate("BCE0162", type, gpd.Name, type);
 }
开发者ID:neonux,项目名称:boo,代码行数:4,代码来源:CompilerErrorFactory.cs


示例15: ResolveClassAbstractProperty

        void ResolveClassAbstractProperty(ClassDefinition node,
			TypeReference baseTypeRef,
			IProperty entity)
        {
            bool resolved = false;

            foreach (TypeMember member in node.Members)
            {
                if (entity.Name != member.Name
                    || NodeType.Property != member.NodeType
                    || !IsCorrectExplicitMemberImplOrNoExplicitMemberAtAll(member, entity)
                    || !TypeSystemServices.CheckOverrideSignature(entity.GetParameters(), GetPropertyEntity(member).GetParameters()))
                    continue;

                Property p = (Property) member;
                ProcessPropertyAccessor(p, p.Getter, entity.GetGetMethod());
                ProcessPropertyAccessor(p, p.Setter, entity.GetSetMethod());
                if (null == p.Type)
                {
                    p.Type = CodeBuilder.CreateTypeReference(entity.Type);
                }
                else
                {
                    if (entity.Type != p.Type.Entity)
                        Error(CompilerErrorFactory.ConflictWithInheritedMember(p, p.FullName, entity.FullName));
                }
                resolved = true;
            }

            if (resolved)
                return;

            foreach(SimpleTypeReference parent in node.BaseTypes)
            {
                if(_classDefinitionList.Contains(parent.Name))
                {
                    depth++;
                    ResolveClassAbstractProperty(_classDefinitionList[parent.Name] as ClassDefinition, baseTypeRef, entity);
                    depth--;
                }
            }

            if(CheckInheritsInterfaceImplementation(node, entity))
                return;

            if(depth == 0)
            {
                node.Members.Add(CreateAbstractProperty(baseTypeRef, entity));
                AbstractMemberNotImplemented(node, baseTypeRef, entity);
            }
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:51,代码来源:ProcessInheritedAbstractMembers.cs


示例16: ResolveInterfaceMembers

        void ResolveInterfaceMembers(ClassDefinition node,
			TypeReference baseTypeRef,
			IType baseType)
        {
            foreach (IType entity in baseType.GetInterfaces())
            {
                ResolveInterfaceMembers(node, baseTypeRef, entity);
            }

            foreach (IMember entity in baseType.GetMembers())
            {
                ResolveAbstractMember(node, baseTypeRef, entity);
            }
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:14,代码来源:ProcessInheritedAbstractMembers.cs


示例17: IsUnknown

 private static bool IsUnknown(TypeReference typeRef)
 {
     return Unknown.Default == typeRef.Entity;
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:4,代码来源:ProcessInheritedAbstractMembers.cs


示例18: AbstractMemberNotImplemented

 //returns true if a stub has been created, false otherwise.
 //TODO: add entity argument to the method to not need return type?
 bool AbstractMemberNotImplemented(ClassDefinition node, TypeReference baseTypeRef, IMember member)
 {
     if (IsValueType(node))
     {
         Error(CompilerErrorFactory.ValueTypeCantHaveAbstractMember(baseTypeRef, node.FullName, GetAbstractMemberSignature(member)));
         return false;
     }
     if (!node.IsAbstract)
     {
         //BEHAVIOR >= 0.7.7:	(see BOO-789 for details)
         //create a stub for this not implemented member
         //it will raise a NotImplementedException if called at runtime
         TypeMember m = CodeBuilder.CreateStub(member);
         CompilerWarning warning = null;
         if (null != m)
         {
             warning = CompilerWarningFactory.AbstractMemberNotImplementedStubCreated(baseTypeRef,
                                 node.FullName, GetAbstractMemberSignature(member));
             node.Members.Add(m);
         }
         else
         {
             warning = CompilerWarningFactory.AbstractMemberNotImplemented(baseTypeRef,
                                 node.FullName, GetAbstractMemberSignature(member));
             _newAbstractClasses.AddUnique(node);
         }
         Warnings.Add(warning);
         return (null != m);
     }
     return false;
 }
开发者ID:w4x,项目名称:boolangstudio,代码行数:33,代码来源:ProcessInheritedAbstractMembers.cs


示例19: CreateAbstractProperty

        Property CreateAbstractProperty(TypeReference reference, IProperty property)
        {
            Debug.Assert(0 == property.GetParameters().Length);
            Property p = CodeBuilder.CreateProperty(property.Name, property.Type);
            p.Modifiers |= TypeMemberModifiers.Abstract;

            IMethod getter = property.GetGetMethod();
            if (getter != null)
            {
                p.Getter = CodeBuilder.CreateAbstractMethod(reference.LexicalInfo, getter);
            }

            IMethod setter = property.GetSetMethod();
            if (setter != null)
            {
                p.Setter = CodeBuilder.CreateAbstractMethod(reference.LexicalInfo, setter);
            }
            return p;
        }
开发者ID:w4x,项目名称:boolangstudio,代码行数:19,代码来源:ProcessInheritedAbstractMembers.cs


示例20: CheckForCycles

		private void CheckForCycles(TypeReference baseTypeRef, AbstractInternalType baseType, List<TypeDefinition> visited)
		{
			if (visited.Contains(baseType.TypeDefinition))
			{
				BaseTypeError(CompilerErrorFactory.InheritanceCycle(baseTypeRef, baseType.FullName));
				return;
			}
			
			new BaseTypeResolution(Context, baseType.TypeDefinition, visited);
		}
开发者ID:HaKDMoDz,项目名称:GNet,代码行数:10,代码来源:BaseTypeResolution.cs



注:本文中的Boo.Lang.Compiler.Ast.TypeReference类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Ast.UnaryExpression类代码示例发布时间:2022-05-24
下一篇:
C# Ast.TypeMemberCollection类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap