1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2013 Index Data
3 * See the file LICENSE for details.
6 YACC CQL grammar taken verbatim from the official 1.2 spec
8 %term GE LE NE AND OR NOT PROX CHARSTRING1 CHARSTRING2 SORTBY
11 sortedQuery : prefixAssignment sortedQuery
13 | scopedClause SORTBY sortSpec;
15 sortSpec : sortSpec singleSpec | singleSpec;
16 singleSpec : index modifierList | index ;
18 cqlQuery : prefixAssignment cqlQuery | scopedClause;
20 prefixAssignment : '>' prefix '=' uri | '>' uri;
22 scopedClause : scopedClause booleanGroup searchClause | searchClause ;
24 booleanGroup: boolean | boolean modifierList;
26 boolean : AND | OR | NOT | PROX ;
28 searchClause : '(' cqlQuery ')'
29 | index relation searchTerm
33 relation : comparitor | comparitor modifierList;
35 comparitor : comparitorSymbol | namedComparitor ;
37 comparitorSymbol : '=' | '>' | '<' | GE | LE | NE;
39 namedComparitor : identifier;
41 modifierList : modifierList modifier | modifier;
43 modifier : '/' modifierName
44 | '/' modifierName comparitorSymbol modifierValue
55 term: identifier | AND | OR | NOT | PROX | SORTBY ;
57 identifier: CHARSTRING1 | CHARSTRING2;