Yikes! Yesterday's "defensive programming" introduced a bug (D'oh!)
[yaz-moved-to-github.git] / src / cqlstd.y
1 /* $Id: cqlstd.y,v 1.1 2005-11-15 12:23:32 adam Exp $ 
2   YACC CQL grammar taken verbatim from the official spec. We don't
3   use that in YAZ but I don't know of a better place to put it.
4  */
5 %term GE LE NE AND OR NOT PROX CHARSTRING1 CHARSTRING2
6
7 %%
8 cqlQuery : prefixAssignment cqlQuery | scopedClause;
9
10 prefixAssignment : '>' prefix '=' uri | '>' uri;
11
12 scopedClause : scopedClause booleanGroup searchClause | searchClause ;
13
14 booleanGroup: boolean | boolean modifierList;
15
16 boolean : AND | OR | NOT | PROX ;
17
18 searchClause : '(' cqlQuery ')'
19              | index relation searchTerm
20              | searchTerm
21              ;
22
23 relation : comparitor | comparitor modifierList;
24
25 comparitor : comparitorSymbol | namedComparitor ;
26
27 comparitorSymbol : '=' | '>' | '<' | GE | LE | NE;
28
29 namedComparitor : identifier;
30
31 modifierList : modifierList modifier  | modifier;
32
33 modifier : '/' modifierName 
34          | '/' modifierName comparitorSymbol modifierValue
35          ;
36      
37
38 prefix : term;
39 uri : term;
40 modifierName: term;
41 modifierValue: term;
42 searchTerm: term;
43 index: term;
44
45 term: identifier | AND | OR | NOT | PROX ;
46
47 identifier: CHARSTRING1 | CHARSTRING2;
48
49 %%