Include sys/socket.h, arpa/inet.h
[yaz-moved-to-github.git] / src / cql.y
index 8daf2cb..c6151a2 100644 (file)
--- a/src/cql.y
+++ b/src/cql.y
@@ -1,13 +1,8 @@
-/* $Id: cql.y,v 1.16 2008-01-06 13:08:09 adam Exp $
-   Copyright (C) 2002-2006
-   Index Data ApS
-
-This file is part of the YAZ toolkit.
-
-See the file LICENSE.
-
- bison parser for CQL grammar.
-*/
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2008 Index Data
+ * See the file LICENSE for details.
+ */ 
+/* bison parser for CQL grammar. */
 %{
 /** 
  * \file cql.c
@@ -121,8 +116,9 @@ searchClause:
       $$.cql = $3.cql;
   }
 |
-  searchTerm {
-      struct cql_node *st = cql_node_dup (((CQL_parser) parm)->nmem, $0.rel);
+searchTerm extraTerms {
+      struct cql_node *st = cql_node_dup(((CQL_parser) parm)->nmem, $0.rel);
+      st->u.st.extra_terms = $2.cql;
       st->u.st.term = nmem_strdup(((CQL_parser)parm)->nmem, $1.buf);
       $$.cql = st;
   }
@@ -136,6 +132,18 @@ searchClause:
   }
 ;
 
+extraTerms:
+extraTerms TERM {
+    struct cql_node *st = cql_node_mk_sc(((CQL_parser) parm)->nmem, 
+                                        /* index */ 0, /* rel */ 0, $2.buf);
+    st->u.st.extra_terms = $1.cql;
+    $$.cql = st;
+}
+| 
+{ $$.cql = 0; }
+;
+
+
 /* unary NOT search TERM here .. */
 
 boolean: 
@@ -164,11 +172,6 @@ modifiers '/' searchTerm mrelation searchTerm
 }
 ;
 
-/*
-extraTerms:
-   extraTerms TERM | ;
-*/
-
 mrelation:
   '=' 
 | '>'