Пример #1
0
 public override int GetHashCode()
 {
     return(HashCodeCombiner.Combine(ChildPattern.GetHashCode(), MinOccurrences.GetHashCode(), MaxOccurrences.GetHashCode(),
                                     IsGreedy.GetHashCode()));
 }
Пример #2
0
 /// <summary>
 /// Asserts quantifier is in one of the forms: {n,n}, {0,m}, or {0,} (where n > 0, m > 0)
 /// </summary>
 public void AssertCanonicalForm()
 {
     if (isAssertEnabled &&
         !((MinOccurrences == 0 && MaxOccurrences != 0) ||
           (MinOccurrences > 0 && MinOccurrences == MaxOccurrences)))
     {
         throw new ApplicationException(string.Format("Quantifier pattern NOT in canonical form: {{{0},{1}}}.",
                                                      MinOccurrences,
                                                      MaxOccurrences != null ? MaxOccurrences.ToString() : ""));
     }
 }