code: public int getParameters(char[] array, int currentIndex, StringBuffer velocityBlock, char endingChar,
          VelocityParserContext context)
      {
          char beginChar = array[currentIndex];
  
          int i = currentIndex + 1;
  
          int depth = 1;
  
          while (i < array.length) {
              if (array[i] == endingChar) {
                  --depth;
                  if (depth == 0) {
                      ++i;
                      break;
                  }
              } else if (array[i] == beginChar) {
                  ++depth;
              } else if (array[i] == '"' || array[i] == '\'') {
                  i = getEscape(array, i, null, context);
                  continue;
              }
  
              ++i;
          }
  
          if (velocityBlock != null) {
              velocityBlock.append(array, currentIndex, i - currentIndex);
          }
  
          return i;
      }
docs: Get a group of parameters between two characters. Generic version of
  {@link #getTableElement(char[], int, StringBuffer, VelocityParserContext)} and
  {@link #getMethodParameters(char[], int, StringBuffer, VelocityParserContext)}.
  
  @param array the source to parse
  @param currentIndex the current index in the <code>array</code>
  @param velocityBlock the buffer where to append matched velocity block
  @param endingChar the char to end to
  @param context the parser context to put some informations
  @return the index in the <code>array</code> after the matched block