/// <summary> /// Resets the matcher so that its search starts over /// </summary> public void Reset() { findIterator = null; findCurrent = null; namesToNodes.Clear(); variableStrings.Reset(); }
/// <summary> /// Resets the matcher so that its search starts over /// </summary> public void Reset() { findIterator = null; findCurrent = null; namesToNodes.Clear(); variableStrings.Reset(); }
/// <summary> /// Find the next match of the pattern on the tree /// </summary> /// <returns>whether there is a match somewhere in the tree</returns> public bool Find() { if (findIterator == null) { findIterator = root.Iterator(); } if (findCurrent != null && Matches()) { return(true); } while (findIterator.MoveNext()) { findCurrent = findIterator.Current; ResetChildIter(findCurrent); if (Matches()) { return(true); } } return(false); }
/// <summary> /// Find the next match of the pattern on the tree /// </summary> /// <returns>whether there is a match somewhere in the tree</returns> public bool Find() { if (findIterator == null) { findIterator = root.Iterator(); } if (findCurrent != null && Matches()) { return true; } while (findIterator.MoveNext()) { findCurrent = findIterator.Current; ResetChildIter(findCurrent); if (Matches()) { return true; } } return false; }