/// <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); }
/// <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)); }