本文整理汇总了C#中Antlr4.StartsBeforeNonDisjoint方法的典型用法代码示例。如果您正苦于以下问题:C# Antlr4.StartsBeforeNonDisjoint方法的具体用法?C# Antlr4.StartsBeforeNonDisjoint怎么用?C# Antlr4.StartsBeforeNonDisjoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Antlr4
的用法示例。
在下文中一共展示了Antlr4.StartsBeforeNonDisjoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DifferenceNotProperlyContained
/// <summary>
/// Return the interval with elements from
/// <c>this</c>
/// not in
/// <paramref name="other"/>
/// ;
/// <paramref name="other"/>
/// must not be totally enclosed (properly contained)
/// within
/// <c>this</c>
/// , which would result in two disjoint intervals
/// instead of the single one returned by this method.
/// </summary>
public Antlr4.Runtime.Misc.Interval? DifferenceNotProperlyContained(Antlr4.Runtime.Misc.Interval other)
{
Antlr4.Runtime.Misc.Interval? diff = null;
// other.a to left of this.a (or same)
if (other.StartsBeforeNonDisjoint(this))
{
diff = Antlr4.Runtime.Misc.Interval.Of(Math.Max(this.a, other.b + 1), this.b);
}
else
{
// other.a to right of this.a
if (other.StartsAfterNonDisjoint(this))
{
diff = Antlr4.Runtime.Misc.Interval.Of(this.a, other.a - 1);
}
}
return diff;
}