本文整理汇总了C#中Boo.Lang.Compiler.Ast.MemberReferenceExpression.ToCodeString方法的典型用法代码示例。如果您正苦于以下问题:C# MemberReferenceExpression.ToCodeString方法的具体用法?C# MemberReferenceExpression.ToCodeString怎么用?C# MemberReferenceExpression.ToCodeString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Boo.Lang.Compiler.Ast.MemberReferenceExpression
的用法示例。
在下文中一共展示了MemberReferenceExpression.ToCodeString方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnMemberReferenceExpression
public override void OnMemberReferenceExpression(MemberReferenceExpression node)
{
if (PhantomDslEngine.IsCleanupMethod(node.ParentNode)) {
ReplaceCurrentNode(new StringLiteralExpression(node.ToCodeString()));
}
}
示例2: MarkRelatedImportAsUsed
private void MarkRelatedImportAsUsed(MemberReferenceExpression node)
{
string ns = null;
foreach (var import in _currentModule.Imports)
{
if (ImportAnnotations.IsUsedImport(import)) continue;
if (null == ns) ns = node.ToCodeString();
if (import.Namespace == ns)
{
ImportAnnotations.MarkAsUsed(import);
break;
}
}
}
示例3: ProcessMemberReferenceExpression
protected virtual void ProcessMemberReferenceExpression(MemberReferenceExpression node)
{
IEntity member = ResolveMember(node);
if (null == member) return;
if (EntityType.Ambiguous == member.EntityType)
{
member = ResolveAmbiguousReference(node, (Ambiguous)member);
}
EnsureRelatedNodeWasVisited(node, member);
if (EntityType.Namespace == member.EntityType)
{
string ns = null;
foreach (Import import in _currentModule.Imports)
{
if (import.NamespaceUsed) continue;
if (null == ns) ns = node.ToCodeString();
if (import.Namespace == ns)
{
import.NamespaceUsed = true;
break;
}
}
}
IMember memberInfo = member as IMember;
if (null != memberInfo)
{
if (!AssertTargetContext(node, memberInfo))
{
Error(node);
return;
}
if (EntityType.Method != memberInfo.EntityType)
{
BindExpressionType(node, GetInferredType(memberInfo));
}
else
{
BindExpressionType(node, memberInfo.Type);
}
}
if (EntityType.Property == member.EntityType)
{
IProperty property = (IProperty)member;
if (IsIndexedProperty(property))
{
if (!AstUtil.IsTargetOfSlicing(node)
&& (!property.IsExtension || property.GetParameters().Length > 1))
{
Error(node, CompilerErrorFactory.PropertyRequiresParameters(
AstUtil.GetMemberAnchor(node),
member.FullName));
return;
}
}
if (IsWriteOnlyProperty(property) && !IsBeingAssignedTo(node))
{
Error(node, CompilerErrorFactory.PropertyIsWriteOnly(
AstUtil.GetMemberAnchor(node),
member.FullName));
}
}
else if (EntityType.Event == member.EntityType)
{
if (!AstUtil.IsTargetOfMethodInvocation(node) &&
!AstUtil.IsLhsOfInPlaceAddSubtract(node))
{
if (CurrentType == memberInfo.DeclaringType)
{
InternalEvent ev = (InternalEvent)member;
node.Name = ev.BackingField.Name;
node.Entity = ev.BackingField;
BindExpressionType(node, ev.BackingField.Type);
return;
}
else
{
Error(node,
CompilerErrorFactory.EventIsNotAnExpression(node,
member.FullName));
}
}
}
Bind(node, member);
PostProcessReferenceExpression(node);
}