code: static void compileRules(String rules, OutputStream os) throws IOException
      {
          //
          // Read the input rules, generate a parse tree, symbol table,
          // and list of all Unicode Sets referenced by the rules.
          //
          RBBIRuleBuilder builder = new RBBIRuleBuilder(rules);
          builder.fScanner.parse();
  
          //
          // UnicodeSet processing.
          //    Munge the Unicode Sets to create a set of character categories.
          //    Generate the mapping tables (TRIE) from input 32-bit characters to
          //    the character categories.
          //
          builder.fSetBuilder.build();
  
          //
          //   Generate the DFA state transition table.
          //
          builder.fForwardTables = new RBBITableBuilder(builder, fForwardTree);
          builder.fReverseTables = new RBBITableBuilder(builder, fReverseTree);
          builder.fSafeFwdTables = new RBBITableBuilder(builder, fSafeFwdTree);
          builder.fSafeRevTables = new RBBITableBuilder(builder, fSafeRevTree);
          builder.fForwardTables.build();
          builder.fReverseTables.build();
          builder.fSafeFwdTables.build();
          builder.fSafeRevTables.build();
          if (builder.fDebugEnv != null
                  && builder.fDebugEnv.indexOf("states") >= 0) {
              builder.fForwardTables.printRuleStatusTable();
          }
  
          //
          //   Package up the compiled data, writing it to an output stream
          //      in the serialization format.  This is the same as the ICU4C runtime format.
          //
          builder.flattenData(os);
      }
docs: ----------------------------------------------------------------------------------------