[Zope-CVS] CVS: Products/ZCTextIndex - QueryParser.py:1.1.2.2

Guido van Rossum guido@python.org
Tue, 30 Apr 2002 16:30:37 -0400


Update of /cvs-repository/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv19665

Modified Files:
      Tag: TextIndexDS9-branch
	QueryParser.py 
Log Message:
Add a comment showing the syntax supported by the query parser.


=== Products/ZCTextIndex/QueryParser.py 1.1.2.1 => 1.1.2.2 ===
 ##############################################################################
 
-"""Query Parser."""
+"""Query Parser.
+
+This particular parser recognizes the following syntax:
+
+Start = OrExpr
+OrExpr = AndExpr ('OR' AndExpr)*
+AndExpr = NotExpr ('AND' NotExpr)*
+NotExpr = ['NOT'] Term
+Term = '(' OrExpr ')' | ATOM
+
+An ATOM is a string not containing whitespace or parentheses, and not
+equal to one of the key words 'AND', 'OR', 'NOT'.  The key words are
+only recognized in all upper case.
+
+"""
 
 import re