/// <summary> /// Returns stringIndex+shift, the next position to match /// </summary> /// public override int Matches(int stringIndex, String testString, MatchResultImpl matchResult) { int size = children.Count; int leftBound = (matchResult.HasTransparentBounds()) ? 0 : matchResult .GetLeftBound(); int shift = next.Matches(stringIndex, testString, matchResult); if (shift >= 0) { //fSet will take this index to check if we at the right bound // and return true if the current index equal to this one matchResult.SetConsumed(groupIndex, stringIndex); for (int i = 0; i < size; i++) { AbstractSet e = (AbstractSet)children[i]; // find limits could be calculated though e.getCharCount() // fSet will return true only if string index at fSet equal // to stringIndex if (e.FindBack(leftBound, stringIndex, testString, matchResult) >= 0) { matchResult.SetConsumed(groupIndex, -1); return(shift); } } } return(-1); }
public override int FindBack(int stringIndex, int lastIndex, String testString, MatchResultImpl matchResult) { int res = kid.FindBack(stringIndex, lastIndex, testString, matchResult); if (res >= 0) { matchResult.SetStart(groupIndex, res); } return(res); }