/** * Checks if some token sequence is present in both this set * and a specified one. * * @param set the look-ahead set to compare with * * @return true if the look-ahead sets intersect, or * false otherwise */ public bool Intersects(LookAheadSet set) { for (int i = 0; i < elements.Count; i++) { if (set.Contains((Sequence)elements[i])) { return(true); } } return(false); }
/// <summary> /// Checks if some token sequence is present in both this set /// and a specified one. /// </summary> /// <param name="set">The look-ahead set to compare with</param> /// <returns> /// True if the look-ahead sets intersect, or false otherwise /// </returns> public bool Intersects(LookAheadSet set) { foreach (var elem in this.elements) { if (set.Contains(elem)) { return(true); } } return(false); }
/** * Checks if some token sequence is present in both this set * and a specified one. * * @param set the look-ahead set to compare with * * @return true if the look-ahead sets intersect, or * false otherwise */ public bool Intersects(LookAheadSet set) { for (int i = 0; i < elements.Count; i++) { if (set.Contains((Sequence) elements[i])) { return true; } } return false; }