grammar AttrSearchableGrammar rule complex_expression space? (boolean_expression / expression) space? end rule boolean_expression and_expression end rule and_expression or_expression (space? ('AND' / 'and') space? / space !('OR' / 'or')) complex_expression / or_expression end rule or_expression expression space? ('OR' / 'or') space? (or_expression / expression) / expression end rule expression parentheses_expression / not_expression / comparative_expression / anywhere_expression end rule parentheses_expression '(' complex_expression ')' end rule not_expression ('NOT' space / 'not' space / '-') (comparative_expression / anywhere_expression) end rule comparative_expression simple_column space? comparison_operator space? value end rule comparison_operator ':' / '=' / '!=' / '>=' / '>' / '<=' / '<' end rule anywhere_expression ("'" ([^\']* ) "'") / ('"' ([^\"]* ) '"') / [^\s()]+ end rule simple_column [a-zA-Z0-9_.]+ end rule value "'" [^\']* "'" / '"' [^\"]* '"' / [^\s()]+ end rule space [\s]+ end end