code: private static int getYIndex(PatternFinderUser def, int y,
              Segment<PrimitiveParameter> lastMatch) {
          int skipEnd = def.getSkipEnd();
          if (lastMatch != null && skipEnd > 0) {
              return Math.max(y, lastMatch.getLastIndex() + skipEnd);
          } else if (lastMatch != null && def.getSkip() > 0) {
              return Math.max(y, lastMatch.getLastIndex() + def.getSkip());
          } else {
              return y;
          }
      }
docs: Return the last value of the next segment to be searched.
  
  @param y
  the last value of the most recently searched segment.
  @param lastMatch
  the most recent segment to match this rule.
  @return the last value of the next segment to search.