<commit_before>/* $Id: cqlstd.y,v 1.2 2006-03-02 09:37:35 adam Exp $ 
  YACC CQL grammar taken verbatim from the official spec. We don't
  use that in YAZ but I don't know of a better place to put it.
 */
%term GE LE NE AND OR NOT PROX CHARSTRING1 CHARSTRING2 SORTBY

%%
sortedQuery : prefixAssignment sortedQuery 
            | scopedClause
            | scopedClause SORTBY sortSpec;

sortSpec : sortSpec singleSpec | singleSpec;
singleSpec : index modifierList | index ;

cqlQuery : prefixAssignment cqlQuery | scopedClause;

prefixAssignment : '>' prefix '=' uri | '>' uri;

scopedClause : scopedClause booleanGroup searchClause | searchClause ;

booleanGroup: boolean | boolean modifierList;

boolean : AND | OR | NOT | PROX ;

searchClause : '(' cqlQuery ')'
             | index relation searchTerm
	     | searchTerm<commit_msg>BNF for nested queries.<commit_after>/* $Id: cqlstd.y,v 1.3 2006-03-02 09:38:41 adam Exp $ 
  YACC CQL grammar taken verbatim from the official spec. We don't
  use that in YAZ but I don't know of a better place to put it.
 */
%term GE LE NE AND OR NOT PROX CHARSTRING1 CHARSTRING2 SORTBY

%%
sortedQuery : prefixAssignment sortedQuery 
            | scopedClause
            | scopedClause SORTBY sortSpec;

sortSpec : sortSpec singleSpec | singleSpec;
singleSpec : index modifierList | index ;

cqlQuery : prefixAssignment cqlQuery | scopedClause;

prefixAssignment : '>' prefix '=' uri | '>' uri;

scopedClause : scopedClause booleanGroup searchClause | searchClause ;

booleanGroup: boolean | boolean modifierList;

boolean : AND | OR | NOT | PROX ;

searchClause : '(' cqlQuery ')'
             | index relation searchClause
	     | searchTerm
{'fraction_non_alphanumeric': 0.08254156769596199, 'fraction_numerical': 0.021377672209026127, 'mean_word_length': 3.493333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6364048', 'n_tokens_mistral': 541, 'n_tokens_neox': 517, 'n_words': 178}