public static Cons parseMatchString(String matchstring, String casesensitiveP) {
    { Cons result = Stella.NIL;
      int wildcardpos = 0;
      int cursor = 0;
      String wildcard = "*";
      String fragment = null;

      while ((wildcardpos = Native.stringSearch(matchstring, wildcard, cursor)) != Stella.NULL_INTEGER) {
        if (wildcardpos > cursor) {
          fragment = Native.string_subsequence(matchstring, cursor, wildcardpos);
          if (Stella.stringEqlP(casesensitiveP, "FALSE")) {
            fragment = Native.stringDowncase(fragment);
          }
          result = Cons.cons(StringWrapper.wrapString(fragment), result);
        }
        result = Cons.cons(GuiServer.SYM_GUI_SERVER_WILD, result);
        cursor = wildcardpos + 1;
      }
      if (cursor < matchstring.length()) {
        fragment = Native.string_subsequence(matchstring, cursor, matchstring.length());
        result = Cons.cons(StringWrapper.wrapString(fragment), result);
      }
      return (result.reverse());
    }
  }