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