X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fcql.y;h=c6151a23a05c0ccd8f3b9f76fd98128bc21d55d5;hb=5a1156a0d8d50aa07af3eec75e939ed2065d3880;hp=8daf2cb8181a39756b8b34f655b96b100237e7f8;hpb=783114bd4cf6e26e1743ce131d3e7f00af63ec50;p=yaz-moved-to-github.git diff --git a/src/cql.y b/src/cql.y index 8daf2cb..c6151a2 100644 --- 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: '=' | '>'