本文整理汇总了C#中Boo.Lang.Compiler.Ast.TypeMember类的典型用法代码示例。如果您正苦于以下问题:C# TypeMember类的具体用法?C# TypeMember怎么用?C# TypeMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TypeMember类属于Boo.Lang.Compiler.Ast命名空间,在下文中一共展示了TypeMember类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CheckMember
private void CheckMember(List<TypeMember> list, TypeMember member)
{
switch (member.NodeType)
{
case NodeType.StatementTypeMember:
break;
case NodeType.Constructor:
case NodeType.Method:
{
CheckOverloadableMember(list, member);
CheckLikelyTypoInTypeMemberName(member);
break;
}
case NodeType.Property:
{
CheckOverloadableMember(list, member);
break;
}
default:
{
CheckNonOverloadableMember(list, member);
break;
}
}
}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:27,代码来源:CheckMemberNames.cs
示例2: SetPublicByDefault
public void SetPublicByDefault(TypeMember node)
{
if (!node.get_IsVisibilitySet())
{
node.set_Modifiers(node.get_Modifiers() | 8);
}
}
开发者ID:CarlosHBC,项目名称:UnityDecompiled,代码行数:7,代码来源:ApplyDefaultVisibility.cs
示例3: IsAttributeDefined
public static bool IsAttributeDefined(TypeMember member, IType attributeType)
{
foreach (var attr in member.Attributes)
if (IsOfType(attr, attributeType))
return true;
return false;
}
开发者ID:radiy,项目名称:boo,代码行数:7,代码来源:MetadataUtil.cs
示例4: CheckExplicitTypeForVisibleMember
void CheckExplicitTypeForVisibleMember(TypeMember node)
{
if (node.IsSynthetic || !node.IsVisible)
return;
switch (node.NodeType) //TODO: introduce INodeWithType?
{
case NodeType.Constructor:
CheckExplicitParametersType(node);
return;
case NodeType.Method:
Method method = (Method)node;
if (null != method.ParentNode && method.ParentNode.NodeType == NodeType.Property)
return; //ignore accessors
CheckExplicitParametersType(node);
if (null != method.ReturnType)
return;
if (method.Entity != null
&& ((IMethod)method.Entity).ReturnType == TypeSystemServices.VoidType)
return;
break;
case NodeType.Property:
if (null != ((Property)node).Type)
return;
break;
case NodeType.Event:
if (null != ((Event)node).Type)
return;
break;
default:
return; //fields, nested types etc...
}
Warnings.Add(CompilerWarningFactory.VisibleMemberDoesNotDeclareTypeExplicitely(node));
}
开发者ID:HaKDMoDz,项目名称:GNet,代码行数:35,代码来源:CheckMemberTypes.cs
示例5: ConvModifiers
MemberAttributes ConvModifiers(TypeMember member)
{
bool strict = ConvertVisitor.IsStrictMode(pc);
if (member is Field)
return ConvModifiers(member.Modifiers, strict ? MemberAttributes.Private : MemberAttributes.Family);
else
return ConvModifiers(member.Modifiers, strict ? MemberAttributes.Private : MemberAttributes.Public);
}
开发者ID:kingjiang,项目名称:SharpDevelopLite,代码行数:8,代码来源:CodeDomVisitor.cs
示例6: Reify
public TypeMember Reify(TypeMember node)
{
if (ShouldReify())
{
RunExpansionIterations();
}
return node;
}
开发者ID:boo-lang,项目名称:boo,代码行数:8,代码来源:MacroAndAttributeExpansion.cs
示例7: WarnIfPrivateMemberNeverUsed
protected void WarnIfPrivateMemberNeverUsed(TypeMember node)
{
if (node.IsPrivate && node.ContainsAnnotation("PrivateMemberNeverUsed"))
{
Warnings.Add(
CompilerWarningFactory.PrivateMemberNeverUsed(node) );
}
}
开发者ID:w4x,项目名称:boolangstudio,代码行数:8,代码来源:CheckNeverUsedMembers.cs
示例8: WarnIfPrivateMemberNeverUsed
protected void WarnIfPrivateMemberNeverUsed(TypeMember node)
{
if (NodeType.Constructor == node.NodeType && node.IsStatic) return;
if (!IsVisible(node) && node.ContainsAnnotation("PrivateMemberNeverUsed"))
{
Warnings.Add(
CompilerWarningFactory.PrivateMemberNeverUsed(node) );
}
}
开发者ID:HaKDMoDz,项目名称:GNet,代码行数:10,代码来源:CheckNeverUsedMembers.cs
示例9: CheckExplicitParametersType
void CheckExplicitParametersType(TypeMember node)
{
INodeWithParameters @params = node as INodeWithParameters;
if (null == @params)
return;
foreach (ParameterDeclaration p in @params.Parameters)
{
if (null == p.Type)
Warnings.Add(CompilerWarningFactory.VisibleMemberDoesNotDeclareTypeExplicitely(node, p.Name));
}
}
开发者ID:Bombadil77,项目名称:boo,代码行数:12,代码来源:CheckMemberTypes.cs
示例10: CheckLikelyTypoInTypeMemberName
protected void CheckLikelyTypoInTypeMemberName(TypeMember member)
{
foreach (string name in GetLikelyTypoNames(member))
{
if (name == member.Name)
return;
if (Math.Abs(name.Length - member.Name.Length) > 1)
continue; //>1 distance, skip
if (1 == StringUtilities.GetDistance(name, member.Name))
{
Warnings.Add(
CompilerWarningFactory.LikelyTypoInTypeMemberName(member, name));
break;
}
}
}
开发者ID:radiy,项目名称:boo,代码行数:16,代码来源:CheckMemberNames.cs
示例11: CantBeMarkedPartial
void CantBeMarkedPartial(TypeMember member)
{
if (member.IsPartial)
Error(CompilerErrorFactory.CantBeMarkedPartial(member));
}
开发者ID:scottstephens,项目名称:boo,代码行数:5,代码来源:PreErrorChecking.cs
示例12: CantBeMarkedFinal
void CantBeMarkedFinal(TypeMember member)
{
if (member.IsFinal)
{
Error(CompilerErrorFactory.CantBeMarkedFinal(member));
}
}
开发者ID:scottstephens,项目名称:boo,代码行数:7,代码来源:PreErrorChecking.cs
示例13: EnsureEntityFor
private void EnsureEntityFor(TypeMember member)
{
InternalTypeSystemProvider.EntityFor(member);
}
开发者ID:0xb1dd1e,项目名称:boo,代码行数:4,代码来源:BooCodeBuilder.cs
示例14: EnsureMemberWasVisited
private void EnsureMemberWasVisited(TypeMember node)
{
if (WasVisited(node))
return;
_context.TraceVerbose("Info {0} needs resolving.", node.Entity.Name);
VisitMemberPreservingContext(node);
}
开发者ID:stuman08,项目名称:boo,代码行数:8,代码来源:ProcessMethodBodies.cs
示例15: Reify
public TypeMember Reify(TypeMember member)
{
Visit(member);
var field = member as Field;
if (field != null)
FlushFieldInitializers((ClassDefinition) field.DeclaringType);
return member;
}
开发者ID:stuman08,项目名称:boo,代码行数:10,代码来源:ProcessMethodBodies.cs
示例16: InvalidCombination
void InvalidCombination(TypeMember member, TypeMemberModifiers mod1, TypeMemberModifiers mod2)
{
if (!member.IsModifierSet(mod1) || !member.IsModifierSet(mod2)) return;
Error(
CompilerErrorFactory.InvalidCombinationOfModifiers(
member,
EntityFor(member),
string.Format("{0}, {1}", mod1.ToString().ToLower(), mod2.ToString().ToLower())));
}
开发者ID:scottstephens,项目名称:boo,代码行数:9,代码来源:PreErrorChecking.cs
示例17: CheckModifierCombination
void CheckModifierCombination(TypeMember member)
{
InvalidCombination(member, TypeMemberModifiers.Static, TypeMemberModifiers.Abstract);
InvalidCombination(member, TypeMemberModifiers.Static, TypeMemberModifiers.Virtual);
InvalidCombination(member, TypeMemberModifiers.Static, TypeMemberModifiers.Override);
InvalidCombination(member, TypeMemberModifiers.Abstract, TypeMemberModifiers.Final);
if (member.NodeType != NodeType.Field)
{
InvalidCombination(member, TypeMemberModifiers.Static, TypeMemberModifiers.Final);
}
}
开发者ID:scottstephens,项目名称:boo,代码行数:12,代码来源:PreErrorChecking.cs
示例18: CantBeMarkedStatic
void CantBeMarkedStatic(TypeMember member)
{
if (member.IsStatic)
Error(CompilerErrorFactory.CantBeMarkedStatic(member));
}
开发者ID:scottstephens,项目名称:boo,代码行数:5,代码来源:PreErrorChecking.cs
示例19: CantBeMarkedTransient
void CantBeMarkedTransient(TypeMember member)
{
if (member.HasTransientModifier)
Error(CompilerErrorFactory.CantBeMarkedTransient(member));
}
开发者ID:scottstephens,项目名称:boo,代码行数:5,代码来源:PreErrorChecking.cs
示例20: IsNestedType
bool IsNestedType(TypeMember type)
{
NodeType parent = type.ParentNode.NodeType;
return (NodeType.ClassDefinition == parent) ||
(NodeType.InterfaceDefinition == parent);
}
开发者ID:Bombadil77,项目名称:boo,代码行数:6,代码来源:EmitAssembly.cs
注:本文中的Boo.Lang.Compiler.Ast.TypeMember类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论