1 # Grammar rules for tag searching; BNF.
3 # The grammar defines expressions in the following forms:
4 # TAG - search blog posts that contain the tag;
5 # !TAG - search blog posts that don't contain the tag;
6 # TAG && TAG, TAG & TAG - search blog posts that contain both tags;
7 # TAG || TAG, TAG | TAG - search blog posts that contain any of the tags;
8 # Parentheses are allowed to group expressions:
11 # and so on. This is a simple version of the grammar and it allows
12 # rather stupid expressions, like !!TAG or ((TAG)); in the future
13 # it will be fixed by making the grammar more complex and stricter.
15 NAME : '[a-z][a-z0-9_]+'
26 | expression AND_OP AND_OP expression
27 | expression AND_OP expression
28 | expression OR_OP OR_OP expression
29 | expression OR_OP expression