nl_tokens: / --- Internal Parsers / * A filter looks like this coming in : Filter :: = CHOICE { and [ 0 ] SET OF Filter or [ 1 ] SET OF Filter not [ 2 ] Filter equalityMatch [ 3 ] AttributeValueAssertion substrings [ 4 ] SubstringFilter greaterOrEqual [ 5 ] AttributeValueAssertion lessOrEqual [ 6 ] AttributeValueAssertion present [ 7 ] AttributeType approxMatch [ 8 ] AttributeValueAssertion extensibleMatch [ 9 ] MatchingRuleAssertion -- v3 only }
pl_tokens: function _parse ( ber ) { assert . ok ( ber ) ; function parseSet ( f ) { var end = ber . offset + ber . length ; while ( ber . offset < end ) f . addFilter ( _parse ( ber ) ) ; } var f ; var type = ber . readSequence ( ) ; <mask> ( type ) { case Protocol . FILTER_AND : f = new AndFilter ( ) ; parseSet ( f ) ; break ; case Protocol . FILTER_APPROX : f = new ApproximateFilter ( ) ; f . parse ( ber ) ; break ; case Protocol . FILTER_EQUALITY : f = new EqualityFilter ( ) ; f . parse ( ber ) ; return f ; case Protocol . FILTER_EXT : f = new ExtensibleFilter ( ) ; f . parse ( ber ) ; return f ; case Protocol . FILTER_GE : f = new GreaterThanEqualsFilter ( ) ; f . parse ( ber ) ; return f ; case Protocol . FILTER_LE : f = new LessThanEqualsFilter ( ) ; f . parse ( ber ) ; return f ; case Protocol . FILTER_NOT : var _f = _parse ( ber ) ; f = new NotFilter ( { filter : _f } ) ; break ; case Protocol . FILTER_OR : f = new OrFilter ( ) ; parseSet ( f ) ; break ; case Protocol . FILTER_PRESENT : f = new PresenceFilter ( ) ; f . parse ( ber ) ; break ; case Protocol . FILTER_SUBSTRINGS : f = new SubstringFilter ( ) ; f . parse ( ber ) ; break ; default : throw new Error ( 'Invalid search filter type: 0x' + type . toString ( 16 ) ) ; } assert . ok ( f ) ; return f ; }