1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2008 Index Data
3 * See the file LICENSE for details.
6 YACC CQL grammar taken verbatim from the official spec. We don't
7 use that in YAZ but I don't know of a better place to put it.
9 %term GE LE NE AND OR NOT PROX CHARSTRING1 CHARSTRING2 SORTBY
12 sortedQuery : prefixAssignment sortedQuery
14 | scopedClause SORTBY sortSpec;
16 sortSpec : sortSpec singleSpec | singleSpec;
17 singleSpec : index modifierList | index ;
19 cqlQuery : prefixAssignment cqlQuery | scopedClause;
21 prefixAssignment : '>' prefix '=' uri | '>' uri;
23 scopedClause : scopedClause booleanGroup searchClause | searchClause ;
25 booleanGroup: boolean | boolean modifierList;
27 boolean : AND | OR | NOT | PROX ;
29 searchClause : '(' cqlQuery ')'
30 | index relation searchClause
34 relation : comparitor | comparitor modifierList;
36 comparitor : comparitorSymbol | namedComparitor ;
38 comparitorSymbol : '=' | '>' | '<' | GE | LE | NE;
40 namedComparitor : identifier;
42 modifierList : modifierList modifier | modifier;
44 modifier : '/' modifierName
45 | '/' modifierName comparitorSymbol modifierValue
56 term: identifier | AND | OR | NOT | PROX | SORTBY ;
58 identifier: CHARSTRING1 | CHARSTRING2;