docs: public static String delimitExpressions(String s) {
  
          StringBuilder result = new StringBuilder();
          char[] cs = s.toCharArray();
          int brace = 0;
          int sqre = 0;
          int crly = 0;
          char lastNonWhite = ';';
          for ( int i = 0; i < cs.length; i++ ) {
              char c = cs[i];
              switch ( c ) {
                  case '(' :
                      brace++;
                      break;
                  case '{' :
                      crly++;
                      break;
                  case '[' :
                      sqre++;
                      break;
                  case ')' :
                      brace--;
                      break;
                  case '}' :
                      crly--;
                      break;
                  case ']' :
                      sqre--;
                      break;
                  default :
                      break;
              }
              if ( (brace == 0 && sqre == 0 && crly == 0) && (c == '\n' || c == '\r') ) {
                  if ( lastNonWhite != ';' ) {
                      result.append( ';' );
                      lastNonWhite = ';';
                  }
              } else if ( !Character.isWhitespace( c ) ) {
                  lastNonWhite = c;
              }
              result.append( c );
  
          }
          return result.toString();
      }