X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=parser%2Fgrammar;h=14753c88e28544d5252a74dc38a142fc11e20d83;hb=b4b7ad7bdf38bc6cb84d0f29cbae0df6e46a0eda;hp=b88b9eddfa5fcada98134fe649558c167fd93a85;hpb=84b9307263ed23679ffaf7ff2a4ded0a259a8778;p=phdru.name%2Fcgi-bin%2Fblog-ru%2Fsearch-tags.git diff --git a/parser/grammar b/parser/grammar index b88b9ed..14753c8 100644 --- a/parser/grammar +++ b/parser/grammar @@ -10,7 +10,7 @@ # !(TAG | TAG) # Allowed operators: conjunction - & && AND and # disjunction - | || OR or -# negation - ! +# negation - ! NOT not # This is a simple version of the grammar and it allows # rather stupid expressions, like !!TAG or ((TAG)); in the future # it will be fixed by making the grammar more complex and stricter. @@ -33,6 +33,7 @@ expression : NAME | expression SP0 OR_OP SP0 expression | l_expression or_word r_expression | NOT_OP SP0 expression + | not_word r_expression | expression_parens l_expression : expression_parens @@ -53,6 +54,9 @@ and_word : 'A' 'N' 'D' or_word : 'O' 'R' | 'o' 'r' +not_word : 'N' 'O' 'T' + | 'n' 'o' 't' + SP0 : SP1 | empty empty :