public static int getQualifiedSymbolSeparatorPositionInternal(char[] buffer, int tokenstart, int tokenend, int size, Keyword escapemode) {
    { int cursor = tokenend - 1;
      int separatorposition = 0;
      int nofescapes = 0;
      boolean fullyescapedP = escapemode == Stella.KWD_FULLY_ESCAPED;
      char targetchar = (fullyescapedP ? '|' : Stella.MODULE_SEPARATOR_CHARACTER);

      for (;;) {
        while (cursor >= 0) {
          if (((char) (0x00ff & buffer[cursor])) == targetchar) {
            separatorposition = cursor;
            cursor = cursor - 1;
            if (cursor < 0) {
              cursor = size - 1;
            }
            nofescapes = 0;
            loop002 : for (;;) {
              while ((cursor >= 0) &&
                  (((char) (0x00ff & buffer[cursor])) == '\\')) {
                nofescapes = nofescapes + 1;
                cursor = cursor - 1;
              }
              if ((cursor < 0) &&
                  (((char) (0x00ff & buffer[0])) == '\\')) {
                cursor = size - 1;
              }
              else {
                break loop002;
              }
            }
            if (((nofescapes % 2) == 0)) {
              if (fullyescapedP) {
                separatorposition = separatorposition - 1;
                if (separatorposition < 0) {
                  separatorposition = separatorposition + size;
                }
                if (!(((char) (0x00ff & buffer[separatorposition])) == Stella.MODULE_SEPARATOR_CHARACTER)) {
                  separatorposition = separatorposition - 1;
                }
              }
              separatorposition = separatorposition - tokenstart;
              if (separatorposition < 0) {
                return (separatorposition + size);
              }
              else {
                return (separatorposition);
              }
            }
          }
          else {
            cursor = cursor - 1;
          }
        }
        cursor = size - 1;
      }
    }
  }