# File lib/net/ldap/filter.rb, line 243
        def Filter::parse_ber ber
                case ber.ber_identifier
                when 0xa0 # context-specific constructed 0, "and"
                        ber.map {|b| Filter::parse_ber(b)}.inject {|memo,obj| memo & obj}
                when 0xa1 # context-specific constructed 1, "or"
                        ber.map {|b| Filter::parse_ber(b)}.inject {|memo,obj| memo | obj}
                when 0xa2 # context-specific constructed 2, "not"
                        ~ Filter::parse_ber( ber.first )
                when 0xa3 # context-specific constructed 3, "equalityMatch"
                        if ber.last == "*"
                        else
                                Filter.eq( ber.first, ber.last )
                        end
                when 0xa4 # context-specific constructed 4, "substring"
                        str = ""
                        final = false
                        ber.last.each {|b|
                                case b.ber_identifier
                                when 0x80 # context-specific primitive 0, SubstringFilter "initial"
                                        raise "unrecognized substring filter, bad initial" if str.length > 0
                                        str += b
                                when 0x81 # context-specific primitive 0, SubstringFilter "any"
                                        str += "*#{b}"
                                when 0x82 # context-specific primitive 0, SubstringFilter "final"
                                        str += "*#{b}"
                                        final = true
                                end
                        }
                        str += "*" unless final
                        Filter.eq( ber.first.to_s, str )
                when 0xa5 # context-specific constructed 5, "greaterOrEqual"
                        Filter.ge( ber.first.to_s, ber.last.to_s )
                when 0xa6 # context-specific constructed 5, "lessOrEqual"
                        Filter.le( ber.first.to_s, ber.last.to_s )
                when 0x87 # context-specific primitive 7, "present"
                        # call to_s to get rid of the BER-identifiedness of the incoming string.
                        Filter.pres( ber.to_s )
                else
                        raise "invalid BER tag-value (#{ber.ber_identifier}) in search filter"
                end
        end