1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2011 Index Data
3 * See the file LICENSE for details.
6 YACC CQL grammar taken verbatim from the 2.0 draft (June 2010).
8 %term PREFIX_NAME QUOTED_URI_STRING QUOTED_STRING AND OR NOT PROX SORTBY SIMPLE_STRING
11 cql_query : query | query sort_spec;
13 query : prefix_assignment search_clause_group | search_clause_group ;
15 search_clause_group: search_clause_group boolean_modified subquery | subquery;
17 subquery : '(' query ')' | search_clause;
19 search_clause: index relation_modified search_term | search_term;
21 search_term : SIMPLE_STRING | QUOTED_STRING;
23 sort_spec : sort_by index_modified_list;
27 index_modified_list: index_modified_list index_modified | index_modified;
29 prefix_assignment: '>' prefix '=' uri | '>' uri;
31 prefix: SIMPLE_STRING;
33 uri : QUOTED_URI_STRING;
35 index_modified: index modifier_list | index;
37 index : simple_name | PREFIX_NAME;
39 relation_modified : relation modifier_list | relation;
41 relation : relation_name | relation_symbol;
43 relation_name: simple_name | PREFIX_NAME;
45 relation_symbol : '=' | '>' | '<' ;
47 boolean_modified : boolean modifier_list | boolean;
49 boolean : AND | OR | NOT | PROX;
51 modifier_list : modifier_list modifier | modifier;
53 modifier : '/' modifier_name modifier_relation | '/' modifier_name;
55 modifier_name: simple_name;
57 modifier_relation : relation_symbol modifier_value;
59 modifier_value : SIMPLE_STRING | QUOTED_STRING;
61 simple_name: SIMPLE_STRING;