grammar LdapFilter
rule filter
'(' item:( or_filter / and_filter / item )+ ')' <Filter> {
def blah
pp item
end
}
end
rule and_filter
'&' filter:( filter )+
end
rule or_filter
'|' filter:( filter )+
end
rule regular_item
eq_simple / ge_simple / le_simple
end
rule not_item
'!' regular_item
end
rule item
regular_item / not_item
end
rule eq_simple
( identifier '=' value )
end
rule ge_simple
( identifier '>=' value )
end
rule le_simple
( identifier '<=' value )
end
rule identifier
[[:alnum:]]+
end
rule value
[^\p{Z}\p{C}^()]+
end
end
Z3JhbW1hciBMZGFwRmlsdGVyCiAgICAKCXJ1bGUgZmlsdGVyCgkJJygnIGl0ZW06KCBvcl9maWx0ZXIgLyBhbmRfZmlsdGVyIC8gaXRlbSApKyAnKScgPEZpbHRlcj4gewoJCQlkZWYgYmxhaCAKCQkJCXBwIGl0ZW0KCQkJZW5kCgkJfQoJZW5kCgkKCXJ1bGUgYW5kX2ZpbHRlcgoJCScmJyBmaWx0ZXI6KCBmaWx0ZXIgKSsgCgllbmQKCQoJcnVsZSBvcl9maWx0ZXIKCQknfCcgZmlsdGVyOiggZmlsdGVyICkrIAoJZW5kCgkKCXJ1bGUgcmVndWxhcl9pdGVtCgkJZXFfc2ltcGxlIC8gZ2Vfc2ltcGxlIC8gbGVfc2ltcGxlCgllbmQKCQoJcnVsZSBub3RfaXRlbQoJCSchJyByZWd1bGFyX2l0ZW0KCWVuZAoJCglydWxlIGl0ZW0KCQlyZWd1bGFyX2l0ZW0gLyBub3RfaXRlbQoJZW5kCgkKCXJ1bGUgZXFfc2ltcGxlCgkJKCBpZGVudGlmaWVyICc9JyB2YWx1ZSApCgllbmQKCQoJcnVsZSBnZV9zaW1wbGUKCQkoIGlkZW50aWZpZXIgJz49JyB2YWx1ZSApCgllbmQKCQoJcnVsZSBsZV9zaW1wbGUKCQkoIGlkZW50aWZpZXIgJzw9JyB2YWx1ZSApIAoJZW5kCgoJcnVsZSBpZGVudGlmaWVyCgkJW1s6YWxudW06XV0rIAoJZW5kCgoJcnVsZSB2YWx1ZQoJCVteXHB7Wn1ccHtDfV4oKV0rIAoJZW5kCmVuZA==