]> git.phdru.name Git - phdru.name/cgi-bin/blog-ru/search-tags.git/blobdiff - parser/grammar
HTML-escape expression in the output (to quote &)
[phdru.name/cgi-bin/blog-ru/search-tags.git] / parser / grammar
index 694437875fcc62548065bef2d439eeb3a9f41f46..14753c88e28544d5252a74dc38a142fc11e20d83 100644 (file)
@@ -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.
@@ -29,10 +29,11 @@ expression : NAME
            | expression SP0 AND_OP AND_OP SP0 expression
            | expression SP0 AND_OP SP0 expression
            | l_expression and_word r_expression
-           | NOT_OP SP0 expression
            | expression SP0 OR_OP OR_OP SP0 expression
            | 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 :