code: void scanSet() {
          UnicodeSet uset = null;
          int startPos;
          ParsePosition pos = new ParsePosition(fScanIndex);
          int i;
  
          startPos = fScanIndex;
          try {
              uset = new UnicodeSet(fRB.fRules, pos, fSymbolTable, UnicodeSet.IGNORE_SPACE);
          } catch (Exception e) { // TODO:  catch fewer exception types.
              // Repackage UnicodeSet errors as RBBI rule builder errors, with location info.
              error(RBBIRuleBuilder.U_BRK_MALFORMED_SET);
          }
  
          // Verify that the set contains at least one code point.
          //
          if (uset.isEmpty()) {
              // This set is empty.
              //  Make it an error, because it almost certainly is not what the user wanted.
              //  Also, avoids having to think about corner cases in the tree manipulation code
              //   that occurs later on.
              //  TODO:  this shouldn't be an error; it does happen.
              error(RBBIRuleBuilder.U_BRK_RULE_EMPTY_SET);
          }
  
          // Advance the RBBI parse postion over the UnicodeSet pattern.
          //   Don't just set fScanIndex because the line/char positions maintained
          //   for error reporting would be thrown off.
          i = pos.getIndex();
          for (;;) {
              if (fNextIndex >= i) {
                  break;
              }
              nextCharLL();
          }
  
          RBBINode n;
  
          n = pushNewNode(RBBINode.setRef);
          n.fFirstPos = startPos;
          n.fLastPos = fNextIndex;
          n.fText = fRB.fRules.substring(n.fFirstPos, n.fLastPos);
          //  findSetFor() serves several purposes here:
          //     - Adopts storage for the UnicodeSet, will be responsible for deleting.
          //     - Mantains collection of all sets in use, needed later for establishing
          //          character categories for run time engine.
          //     - Eliminates mulitiple instances of the same set.
          //     - Creates a new uset node if necessary (if this isn't a duplicate.)
          findSetFor(n.fText, n, uset);
      }
docs: ---------------------------------------------------------------------------------