當前位置: 首頁>>代碼示例>>C#>>正文


C# Antlr4.StartsAfterNonDisjoint方法代碼示例

本文整理匯總了C#中Antlr4.StartsAfterNonDisjoint方法的典型用法代碼示例。如果您正苦於以下問題:C# Antlr4.StartsAfterNonDisjoint方法的具體用法?C# Antlr4.StartsAfterNonDisjoint怎麽用?C# Antlr4.StartsAfterNonDisjoint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Antlr4的用法示例。


在下文中一共展示了Antlr4.StartsAfterNonDisjoint方法的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;
 }
開發者ID:RainerBosch,項目名稱:antlr4,代碼行數:31,代碼來源:Interval.cs


注:本文中的Antlr4.StartsAfterNonDisjoint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。