Update header about CQL grammar
[yaz-moved-to-github.git] / src / cql2.0.y
index 377fabe..6e5853e 100644 (file)
@@ -1,16 +1,16 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2011 Index Data
+ * Copyright (C) 1995-2013 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;
 
@@ -18,7 +18,7 @@ subquery : '(' query ')' | search_clause;
 
 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;
 
@@ -30,7 +30,9 @@ prefix_assignment: '>' prefix '=' uri | '>' uri;
 
 prefix: SIMPLE_STRING;
 
-uri : QUOTED_URI_STRING;
+uri : quoted_uri_string;
+
+quoted_uri_string: QUOTED_STRING;
 
 index_modified: index modifier_list | index;
 
@@ -42,7 +44,7 @@ relation : relation_name | relation_symbol;
 
 relation_name: simple_name | PREFIX_NAME;
 
-relation_symbol : '=' | '>' | '<' ;
+relation_symbol : '=' | '>' | '<' | GE | LE | NE | EXACT;
 
 boolean_modified : boolean modifier_list | boolean;
 
@@ -58,6 +60,8 @@ modifier_relation : relation_symbol modifier_value;
 
 modifier_value : SIMPLE_STRING | QUOTED_STRING;
 
+reserved_string: boolean | SORTBY;
+
 simple_name: SIMPLE_STRING;
 
 %%