docs: protected static DcerpcBinding parseBinding ( String str ) throws DcerpcException {
          int state, mark, si;
          char[] arr = str.toCharArray();
          String proto = null, key = null;
          DcerpcBinding binding = null;
  
          state = mark = si = 0;
          do {
              char ch = arr[ si ];
  
              switch ( state ) {
              case 0:
                  if ( ch == ':' ) {
                      proto = str.substring(mark, si);
                      mark = si + 1;
                      state = 1;
                  }
                  break;
              case 1:
                  if ( ch == '\\' ) {
                      mark = si + 1;
                      break;
                  }
                  state = 2;
              case 2:
                  if ( ch == '[' ) {
                      String server = str.substring(mark, si).trim();
                      if ( server.length() == 0 )
                          server = "127.0.0.1";
                      binding = new DcerpcBinding(proto, str.substring(mark, si));
                      mark = si + 1;
                      state = 5;
                  }
                  break;
              case 5:
                  if ( ch == '=' ) {
                      key = str.substring(mark, si).trim();
                      mark = si + 1;
                  }
                  else if ( ch == ',' || ch == ']' ) {
                      String val = str.substring(mark, si).trim();
                      mark = si + 1;
                      if ( key == null )
                          key = "endpoint";
                      if ( binding != null ) {
                          binding.setOption(key, val);
                      }
                      key = null;
                  }
                  break;
              default:
                  si = arr.length;
              }
  
              si++;
          }
          while ( si < arr.length );
  
          if ( binding == null || binding.getEndpoint() == null )
              throw new DcerpcException("Invalid binding URL: " + str);
  
          return binding;
      }