public static int parseSExpression (String aString) {
        int length = aString.length();
        int parenLevel = 0;
        boolean isQuotedString = false;
        boolean isLeadingWhitespace = true;
        int charsParsed = 0;
        char ch = ' ';
        int index = 0;
        // Bypass any leading whitespace before first "(".
        while (isLeadingWhitespace) {
            if (index >= length) {
                Log.current.println("parseSExpression, invalid string: " + aString);
                return  0;
            }
            ch = aString.charAt(index);
            if ((ch == ' ') || (ch == '\t') || (ch == '\n') || (ch == '\r') || (ch == '\f'))
                index++;
            else
                isLeadingWhitespace = false;
        }
        if (ch == '(')
            return  parseParenSExpression(aString, index);
        else
            return  parseWordSExpression(aString, index);
    }