private static final int scanString (String pat, int index, StringBuffer buffer)
private static int scanString(String pat, int index, StringBuffer buffer)
  private static final int scanString (String pat, int index,				       StringBuffer buffer)  {    int max = pat.length();    buffer.setLength(0);    for (; index < max; ++index)      {	char c = pat.charAt(index);	if (c == '\'' && index + 2 < max && pat.charAt(index + 2) == '\'')	  {	    buffer.append(pat.charAt(index + 1));	    index += 2;	  }	else if (c == '\'' && index + 1 < max		 && pat.charAt(index + 1) == '\'')	  {	    buffer.append(c);	    ++index;	  }	else if (c == '{')	  break;	else if (c == '}')	  throw new IllegalArgumentException("Found '}' without '{'");	else	  buffer.append(c);      }    return index;  }