[antlr-interest] Help with simple Logic or Query Syntax.

Mark R. Diggory mdiggory at latte.harvard.edu
Fri Feb 3 13:34:52 PST 2006


Hello,

I'm attempting to create a parser for some simple query syntax our 
project maintains, its similar but simpler to that of Lucene. The basic 
syntax is

term op value BOOL term op value with parentheses and double quotes 
allowed around values. So for instance as an example:

(title="Something cool" AND author=foo AND date>=2001) OR "Something 
Completely Different"

I'm challenged in that while I grok BNF, I can't read write it yet: At 
least I know the basics of our syntax as a starting point, I'm unsure if 
this is correct.

query ::= term (bool term)*

term ::= (index op value) | value

term ::= word

value ::= word and quoted words

op ::= < > = <> != <= =>

bool ::= AND OR NOT

thanks for any tips,
Mark


More information about the antlr-interest mailing list