X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=parser%2Fgrammar;fp=parser%2Fgrammar;h=694437875fcc62548065bef2d439eeb3a9f41f46;hb=a701255bb701988f09266b1d3bbbbf7a063094a0;hp=33326116c917ec5300f0df9b6ebbf95e44dfa65a;hpb=02dbb2a7f4d0804c56122cc7ca681224fe659abc;p=phdru.name%2Fcgi-bin%2Fblog-ru%2Fsearch-tags.git diff --git a/parser/grammar b/parser/grammar index 3332611..6944378 100644 --- a/parser/grammar +++ b/parser/grammar @@ -9,7 +9,7 @@ # TAG & (TAG | TAG) # !(TAG | TAG) # Allowed operators: conjunction - & && AND and -# disjunction - | || +# disjunction - | || OR or # negation - ! # This is a simple version of the grammar and it allows # rather stupid expressions, like !!TAG or ((TAG)); in the future @@ -32,6 +32,7 @@ expression : NAME | NOT_OP SP0 expression | expression SP0 OR_OP OR_OP SP0 expression | expression SP0 OR_OP SP0 expression + | l_expression or_word r_expression | expression_parens l_expression : expression_parens @@ -49,6 +50,9 @@ expression_sp : expression SP1 and_word : 'A' 'N' 'D' | 'a' 'n' 'd' +or_word : 'O' 'R' + | 'o' 'r' + SP0 : SP1 | empty empty :