private Elem[] parseList(String pattern) {
        List<Elem> list = new LinkedList<Elem>();
        StringBuilder s = new StringBuilder(pattern);
        int brackets = 0;
        
        s.append(',');
        
        for (int i = 0; s.length() > 0; i++) {
            char c = s.charAt(i);
            
            if (c == '(') {
                brackets++;
            } else if (c == ')') {
                brackets--;
            } else if (c == ',' && brackets == 0) {
                list.add(parse(s.substring(0, i)));
                s.delete(0, i + 1);
                i = -1;
                continue;
            } // else if
        } // for
        
        return list.toArray(new Elem[list.size()]);
    } // parseList