X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fcqlstd.y;fp=src%2Fcqlstd.y;h=0d81a5a9dfccb9c39652b3cee837723b76123e9e;hb=5451196efde939261211e1c15e0bc373b527d33c;hp=0000000000000000000000000000000000000000;hpb=b3d4d4df2931f92f42f406f1bb9e6aeddd76a24a;p=yaz-moved-to-github.git diff --git a/src/cqlstd.y b/src/cqlstd.y new file mode 100644 index 0000000..0d81a5a --- /dev/null +++ b/src/cqlstd.y @@ -0,0 +1,49 @@ +/* $Id: cqlstd.y,v 1.1 2005-11-15 12:23:32 adam Exp $ + YACC CQL grammar taken verbatim from the official spec. We don't + use that in YAZ but I don't know of a better place to put it. + */ +%term GE LE NE AND OR NOT PROX CHARSTRING1 CHARSTRING2 + +%% +cqlQuery : prefixAssignment cqlQuery | scopedClause; + +prefixAssignment : '>' prefix '=' uri | '>' uri; + +scopedClause : scopedClause booleanGroup searchClause | searchClause ; + +booleanGroup: boolean | boolean modifierList; + +boolean : AND | OR | NOT | PROX ; + +searchClause : '(' cqlQuery ')' + | index relation searchTerm + | searchTerm + ; + +relation : comparitor | comparitor modifierList; + +comparitor : comparitorSymbol | namedComparitor ; + +comparitorSymbol : '=' | '>' | '<' | GE | LE | NE; + +namedComparitor : identifier; + +modifierList : modifierList modifier | modifier; + +modifier : '/' modifierName + | '/' modifierName comparitorSymbol modifierValue + ; + + +prefix : term; +uri : term; +modifierName: term; +modifierValue: term; +searchTerm: term; +index: term; + +term: identifier | AND | OR | NOT | PROX ; + +identifier: CHARSTRING1 | CHARSTRING2; + +%%