From 5451196efde939261211e1c15e0bc373b527d33c Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 15 Nov 2005 12:23:32 +0000 Subject: [PATCH] Added CQL base YACC grammar. --- src/cqlstd.y | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 src/cqlstd.y 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; + +%% -- 1.7.10.4