fork download
  1. grammar LdapFilter
  2.  
  3. rule filter
  4. '(' item:( or_filter / and_filter / item )+ ')' <Filter> {
  5. def blah
  6. pp item
  7. end
  8. }
  9. end
  10.  
  11. rule and_filter
  12. '&' filter:( filter )+
  13. end
  14.  
  15. rule or_filter
  16. '|' filter:( filter )+
  17. end
  18.  
  19. rule regular_item
  20. eq_simple / ge_simple / le_simple
  21. end
  22.  
  23. rule not_item
  24. '!' regular_item
  25. end
  26.  
  27. rule item
  28. regular_item / not_item
  29. end
  30.  
  31. rule eq_simple
  32. ( identifier '=' value )
  33. end
  34.  
  35. rule ge_simple
  36. ( identifier '>=' value )
  37. end
  38.  
  39. rule le_simple
  40. ( identifier '<=' value )
  41. end
  42.  
  43. rule identifier
  44. [[:alnum:]]+
  45. end
  46.  
  47. rule value
  48. [^\p{Z}\p{C}^()]+
  49. end
  50. end
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty