From: Adam Dickmeiss Date: Tue, 15 Nov 2005 12:23:32 +0000 (+0000) Subject: Added CQL base YACC grammar. X-Git-Tag: YAZ.2.1.10~8 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=5451196efde939261211e1c15e0bc373b527d33c;p=yaz-moved-to-github.git Added CQL base YACC grammar. --- 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; + +%%