本文整理汇总了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);
}
示例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;
}
}
示例3: CreateRuntimeMethod
public Method CreateRuntimeMethod(string name, TypeReference returnType)
{
Method method = CreateVirtualMethod(name, returnType);
method.ImplementationFlags = MethodImplementationFlags.Runtime;
return method;
}
示例4: CheckParameterType
void CheckParameterType(TypeReference type)
{
if (type.Entity != VoidType()) return;
Error(CompilerErrorFactory.InvalidParameterType(type, VoidType()));
}
示例5: Event
public Event(LexicalInfo lexicalInfo, string name, TypeReference type) : base(lexicalInfo)
{
this.Name = name;
this.Type = type;
}
示例6: Field
public Field(LexicalInfo lexicalInfo, TypeReference type, Expression initializer)
: base(lexicalInfo)
{
this.Type = type;
this.Initializer = initializer;
}
示例7: Declaration
public Declaration(LexicalInfo token, string name, TypeReference type)
: base(token)
{
this.Name = name;
this.Type = type;
}
示例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;
}
示例9: CheckParameterType
void CheckParameterType(TypeReference type)
{
if (type.Entity != TypeSystemServices.VoidType) return;
Error(CompilerErrorFactory.InvalidParameterType(type, type.Entity.ToString()));
}
示例10: CheckDeclarationType
bool CheckDeclarationType(TypeReference type)
{
if (type.Entity != TypeSystemServices.VoidType) return true;
Error(CompilerErrorFactory.InvalidDeclarationType(type, type.Entity.ToString()));
return false;
}
示例11: ParameterDeclaration
public ParameterDeclaration(string name, TypeReference type)
: this(name, type, ParameterModifiers.None)
{
}
示例12: TypeConstraintConflictsWithSpecialConstraint
public static CompilerError TypeConstraintConflictsWithSpecialConstraint(GenericParameterDeclaration gpd, TypeReference type, string constraint)
{
return Instantiate("BCE0161", type, gpd.Name, type, constraint);
}
示例13: MultipleBaseTypeConstraints
public static CompilerError MultipleBaseTypeConstraints(GenericParameterDeclaration gpd, TypeReference type, TypeReference other)
{
return Instantiate("BCE0163", type, gpd.Name, type, other);
}
示例14: InvalidTypeConstraint
public static CompilerError InvalidTypeConstraint(GenericParameterDeclaration gpd, TypeReference type)
{
return Instantiate("BCE0162", type, gpd.Name, type);
}
示例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);
}
}