当前位置: 首页>>代码示例>>C#>>正文


C# Ast.TypeReference类代码示例

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


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


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