From 6b74708f98852f738fecb8a737a9640edf3d427e Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 14 Feb 1995 14:12:41 +0000 Subject: [PATCH] Ranges for ordered qualfiers implemented (e.g. pd=1980-1990). --- ccl/cclfind.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++------ ccl/cclsh.c | 7 +++++-- 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/ccl/cclfind.c b/ccl/cclfind.c index 148b002..76556a1 100644 --- a/ccl/cclfind.c +++ b/ccl/cclfind.c @@ -2,7 +2,10 @@ * Europagate, 1995 * * $Log: cclfind.c,v $ - * Revision 1.4 1995/02/14 13:16:29 adam + * Revision 1.5 1995/02/14 14:12:41 adam + * Ranges for ordered qualfiers implemented (e.g. pd=1980-1990). + * + * Revision 1.4 1995/02/14 13:16:29 adam * Left and/or right truncation implemented. * * Revision 1.3 1995/02/14 10:25:56 adam @@ -289,11 +292,50 @@ static struct ccl_rpn_node *qualifiers (struct ccl_token *la, { struct ccl_rpn_node *p; - ADVANCE; - p = search_term (ap); - add_attr (p, CCL_BIB1_REL, rel); - free (ap); - return p; + ADVANCE; /* skip relation */ + if (KIND == CCL_TOK_TERM) + { + struct ccl_rpn_node *p1; + p1 = search_term (ap); + if (KIND == CCL_TOK_MINUS) + { + ADVANCE; /* skip '-' */ + if (KIND == CCL_TOK_TERM) /* = term - term ? */ + { + struct ccl_rpn_node *p2; + + p2 = search_term (ap); + p = mk_node (AND); + p->u.p[0] = p1; + add_attr (p1, CCL_BIB1_REL, 4); + p->u.p[1] = p2; + add_attr (p2, CCL_BIB1_REL, 2); + free (ap); + return p; + } + else /* = term - */ + { + add_attr (p1, CCL_BIB1_REL, 4); + free (ap); + return p1; + } + } + else + { + add_attr (p1, CCL_BIB1_REL, rel); + free (ap); + return p1; + } + } + else if (KIND == CCL_TOK_MINUS) /* = - term ? */ + { + ADVANCE; + p = search_term (ap); + add_attr (p, CCL_BIB1_REL, 2); + free (ap); + return p; + } + ccl_error = CCL_ERR_TERM_EXPECTED; } free (ap); return NULL; diff --git a/ccl/cclsh.c b/ccl/cclsh.c index 5c3d290..51754ec 100644 --- a/ccl/cclsh.c +++ b/ccl/cclsh.c @@ -2,7 +2,10 @@ * Europagate 1995 * * $Log: cclsh.c,v $ - * Revision 1.3 1995/02/14 10:25:57 adam + * Revision 1.4 1995/02/14 14:12:42 adam + * Ranges for ordered qualfiers implemented (e.g. pd=1980-1990). + * + * Revision 1.3 1995/02/14 10:25:57 adam * The constructions 'qualifier rel term ...' implemented. * * Revision 1.2 1995/02/13 15:15:07 adam @@ -23,7 +26,7 @@ static int debug = 0; static char *prog; static int ti_attr[] = { - CCL_BIB1_USE, 5, + CCL_BIB1_USE, 4, CCL_BIB1_STR, CCL_BIB1_STR_WP }; -- 1.7.10.4