/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) Index Data
* See the file LICENSE for details.
*/
/*
- YACC CQL grammar taken verbatim from the 2.0 draft (June 2010).
+ YACC CQL grammar as of OASIS CQL version1.0 , 30 January 2013
*/
-%term PREFIX_NAME QUOTED_URI_STRING QUOTED_STRING AND OR NOT PROX SORTBY SIMPLE_STRING
+%term PREFIX_NAME SIMPLE_STRING QUOTED_STRING AND OR NOT PROX GE LE NE EXACT SORTBY
%%
cql_query : query | query sort_spec;
-query : prefix_assignment search_clause_group | search_clause_group ;
+query : prefix_assignment query | search_clause_group ;
search_clause_group: search_clause_group boolean_modified subquery | subquery;
search_clause: index relation_modified search_term | search_term;
-search_term : SIMPLE_STRING | QUOTED_STRING;
+search_term : SIMPLE_STRING | QUOTED_STRING | reserved_string;
sort_spec : sort_by index_modified_list;
prefix: SIMPLE_STRING;
-uri : QUOTED_URI_STRING;
+uri : quoted_uri_string;
+
+quoted_uri_string: QUOTED_STRING;
index_modified: index modifier_list | index;
relation_name: simple_name | PREFIX_NAME;
-relation_symbol : '=' | '>' | '<' ;
+relation_symbol : '=' | '>' | '<' | GE | LE | NE | EXACT;
boolean_modified : boolean modifier_list | boolean;
modifier_value : SIMPLE_STRING | QUOTED_STRING;
+reserved_string: boolean | SORTBY;
+
simple_name: SIMPLE_STRING;
%%