From: Adam Dickmeiss Date: Tue, 10 May 2011 09:25:22 +0000 (+0200) Subject: Update to CQL 2.0 as of Feb 2011 X-Git-Tag: v4.2.0~27 X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=commitdiff_plain;h=b80bf43768c7e00315720abde4cbd644fafa2bd1 Update to CQL 2.0 as of Feb 2011 Add all remaining relation symbols. Get rid of QUOTED_URI_STRING and make it a terminal instead based on QUITED_STRING. If not, the grammar is seriously broken, ie, search terms like "http://www.indexdata.com/" would be forbidden. Note that the search_term now (as for CQL 1.X) allows terms like 'and', 'or', 'sortby' . --- diff --git a/src/cql2.0.y b/src/cql2.0.y index 6122ed6..5f8c051 100644 --- a/src/cql2.0.y +++ b/src/cql2.0.y @@ -3,9 +3,9 @@ * See the file LICENSE for details. */ /* - YACC CQL grammar taken verbatim from the 2.0 draft (June 2010). + YACC CQL grammar taken verbatim from the 2.0 draft (Feb 18 2011). */ -%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; @@ -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; %%