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 (Feb 18 2011).
8 %term PREFIX_NAME SIMPLE_STRING QUOTED_STRING AND OR NOT PROX GE LE NE EXACT SORTBY
11 cql_query : query | query sort_spec;
13 query : prefix_assignment query | 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 | reserved_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 quoted_uri_string: QUOTED_STRING;
37 index_modified: index modifier_list | index;
39 index : simple_name | PREFIX_NAME;
41 relation_modified : relation modifier_list | relation;
43 relation : relation_name | relation_symbol;
45 relation_name: simple_name | PREFIX_NAME;
47 relation_symbol : '=' | '>' | '<' | GE | LE | NE | EXACT;
49 boolean_modified : boolean modifier_list | boolean;
51 boolean : AND | OR | NOT | PROX;
53 modifier_list : modifier_list modifier | modifier;
55 modifier : '/' modifier_name modifier_relation | '/' modifier_name;
57 modifier_name: simple_name;
59 modifier_relation : relation_symbol modifier_value;
61 modifier_value : SIMPLE_STRING | QUOTED_STRING;
63 reserved_string: boolean | SORTBY;
65 simple_name: SIMPLE_STRING;