protected Map<String, Object> parseProperties( DataStructure parent ) throws IOException {
 
        // Properties format:
        //
        // properties ::= '(' (key '=' value)* ')'
        //
        // the first ( has already been read by now
    
        Map<String, Object> result = new LinkedHashMap<String, Object>();
        
        in.position(-1).clone();
        
        int c;
        while( (c = in.nextNonWhitespace()) != ')' ) {
            if( c < 0 ) {
                in.error("Unexpected end of file in property values");
            }
 
            if( result.isEmpty() ) {
                // First pass, so push back           
                in.pushBack(c);
            } else if( c != ',' ) {
                in.error("Missing ',' in property values", in.position(-1));
            }
            String key = in.parseIdentifier("property");
            c = in.nextNonWhitespace();
            if( c != '=' ) {
                in.error("Expected '=', found:" + (char)c, in.position(-1));
            }
            
            Object value = parsePropertyValue(parent);
            
            result.put(key, value);   
        }
        
        return result;
    }