code: protected void processElement(List<PatternToken> patternTokens) {
      int counter = 0;
      for (PatternToken pToken : patternTokens) {
          if (pToken.getPhraseName() != null && counter > 0 && pToken.isReferenceElement()) {
              int tokRef = pToken.getMatch().getTokenRef();
              pToken.getMatch().setTokenRef(tokRef + counter - 1);
              String offsetToken = pToken.getString().replace("\\" + tokRef,
                      "\\" + (tokRef + counter - 1));
              pToken.setStringElement(offsetToken);
          }
        counter++;
      }
    }
docs: Calculates the offset of the match reference (if any) in case the match
  element has been used in the group.
  
  @param patternTokens token list where the match element was used. It is directly changed.