UnicodeSet applyPattern(String pattern,ParsePosition pos,SymbolTable symbols,int options){
  boolean parsePositionWasNull=pos == null;
  if (parsePositionWasNull) {
    pos=new ParsePosition(0);
  }
  StringBuffer rebuiltPat=new StringBuffer();
  RuleCharacterIterator chars=new RuleCharacterIterator(pattern,symbols,pos);
  applyPattern(chars,symbols,rebuiltPat,options);
  if (chars.inVariable()) {
    syntaxError(chars,"Extra chars in variable value");
  }
  pat=rebuiltPat.toString();
  if (parsePositionWasNull) {
    int i=pos.getIndex();
    if ((options & IGNORE_SPACE) != 0) {
      i=Utility.skipWhitespace(pattern,i);
    }
    if (i != pattern.length()) {
      throw new IllegalArgumentException("Parse of \"" + pattern + "\" failed at "+ i);
    }
  }
  return this;
}

UnicodeSet applyPattern ( String pattern , ParsePosition pos , SymbolTable symbols , int options ) { boolean parsePositionWasNull = pos == null ; if ( parsePositionWasNull ) { pos = new ParsePosition ( 0 ) ; } StringBuffer rebuiltPat = new StringBuffer ( ) ; RuleCharacterIterator chars = new RuleCharacterIterator ( pattern , symbols , pos ) ; applyPattern ( chars , symbols , rebuiltPat , options ) ; if ( chars . inVariable ( ) ) { syntaxError ( chars , "Extra chars in variable value" ) ; } pat = rebuiltPat . toString ( ) ; if ( parsePositionWasNull ) { int i = pos . getIndex ( ) ; if ( ( options & IGNORE_SPACE ) != 0 ) { i = Utility . skipWhitespace ( pattern , i ) ; } if ( i != pattern . length ( ) ) { throw new IllegalArgumentException ( "Parse of \"" + pattern + "\" failed at " + i ) ; } } return this ; }
parses the given pattern , starting at the given position . the character at pattern . charat ( pos . getindex ( ) ) must be ' [ ' , or the parse fails . parsing continues until the corresponding closing ' ] ' . if a syntax error is encountered between the opening and closing brace , the parse fails . upon return from a successful parse , the parseposition is updated to point to the character following the closing ' ] ' , and an inversion list for the parsed pattern is returned . this method calls itself recursively to parse embedded subpatterns .
