X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=ccl%2Fcclsh.c;h=51754ec455ef50043340e200b8aacb4b3dccc014;hb=6b74708f98852f738fecb8a737a9640edf3d427e;hp=f6dd2363282d471b9957c6355b3e37f6830f3977;hpb=98a49f6636e01e87e867688f4fb8a3b696a847ff;p=egate.git diff --git a/ccl/cclsh.c b/ccl/cclsh.c index f6dd236..51754ec 100644 --- a/ccl/cclsh.c +++ b/ccl/cclsh.c @@ -2,7 +2,13 @@ * Europagate 1995 * * $Log: cclsh.c,v $ - * Revision 1.2 1995/02/13 15:15:07 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 * Added handling of qualifiers. Not finished yet. * * Revision 1.1 1995/02/13 12:35:21 adam @@ -12,16 +18,31 @@ #include #include +#include #include "ccl.h" static int debug = 0; static char *prog; +static int ti_attr[] = { + CCL_BIB1_USE, 4, + CCL_BIB1_STR, CCL_BIB1_STR_WP +}; + +static int au_attr[] = { + CCL_BIB1_USE, 1, + CCL_BIB1_STR, CCL_BIB1_STR_WP +}; + +static int pd_attr[] = { + CCL_BIB1_USE, 31, + CCL_BIB1_REL, CCL_BIB1_REL_ORDER +}; + int main (int argc, char **argv) { CCL_bibset bibset; - static int uses[10]; prog = *argv; bibset = ccl_qual_mk (); @@ -47,28 +68,32 @@ int main (int argc, char **argv) exit (1); } } - uses[0] = 5; - ccl_qual_add (bibset, "ti", 1, uses, -1, -1, - 0, -1, -1); - uses[0] = 1; - ccl_qual_add (bibset, "au", 1, uses, -1, -1, - 0, -1, -1); + ccl_qual_add (bibset, "ti", sizeof(ti_attr)/(2*sizeof(int)), ti_attr); + ccl_qual_add (bibset, "au", sizeof(au_attr)/(2*sizeof(int)), au_attr); + ccl_qual_add (bibset, "pd", sizeof(pd_attr)/(2*sizeof(int)), pd_attr); while (1) { char buf[80]; - int error; - int pos; + int error, pos; + struct ccl_rpn_node *rpn; + printf ("CCLSH>"); fflush (stdout); if (!fgets (buf, 79, stdin)) break; - ccl_find_str (bibset, buf, &error, &pos); + rpn = ccl_find_str (bibset, buf, &error, &pos); if (error) { printf ("%*s^ - ", 6+pos, " "); printf ("%s\n", ccl_err_msg (error)); - + } + else + { + assert (rpn); + ccl_pr_tree (rpn); + putchar ('\n'); } } + putchar ('\n'); return 0; }