예제 #1
0
 /// <summary>
 ///     Gets the hash code for this object.
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     if (LookaheadElement != null)
     {
         return(getProductionHash() ^ DotIndex ^ LookaheadElement.GetHashCode());
     }
     return(getProductionHash() ^ DotIndex);
 }
예제 #2
0
 /// <summary>
 ///     Returns whether the value(s) contained by the given other LRItem equals this object.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public bool Equals(LRItem <T> other)
 {
     if (LookaheadElement != null &&
         other.LookaheadElement != null)
     {
         return(LeftHandSide.Equals(other.LeftHandSide) && DotIndex == other.DotIndex && ProductionElements.SequenceEqual(other.ProductionElements) && LookaheadElement.Equals(other.LookaheadElement));
     }
     return(LeftHandSide.Equals(other.LeftHandSide) && DotIndex == other.DotIndex && ProductionElements.SequenceEqual(other.ProductionElements));
 }