* Europagate, 1995
*
* $Log: cclptree.c,v $
- * Revision 1.2 1995/02/14 19:55:11 adam
+ * Revision 1.3 1995/02/15 17:42:16 adam
+ * Minor changes of the api of this module. FILE* argument added
+ * to ccl_pr_tree.
+ *
+ * Revision 1.2 1995/02/14 19:55:11 adam
* Header files ccl.h/cclp.h are gone! They have been merged an
* moved to ../include/ccl.h.
* Node kind(s) in ccl_rpn_node have changed names.
#include <ccl.h>
-void ccl_pr_tree (struct ccl_rpn_node *rpn)
+void ccl_pr_tree (struct ccl_rpn_node *rpn, FILE *fd_out)
{
switch (rpn->kind)
{
case CCL_RPN_TERM:
- printf ("\"%s\"", rpn->u.t.term);
+ fprintf (fd_out, "\"%s\"", rpn->u.t.term);
if (rpn->u.t.attr_list)
{
struct ccl_rpn_attr *attr;
for (attr = rpn->u.t.attr_list; attr; attr = attr->next)
- printf (" %d=%d", attr->type, attr->value);
+ fprintf (fd_out, " %d=%d", attr->type, attr->value);
}
break;
case CCL_RPN_AND:
- printf ("(");
- ccl_pr_tree (rpn->u.p[0]);
- printf (") and (");
- ccl_pr_tree (rpn->u.p[1]);
- printf (")");
+ fprintf (fd_out, "(");
+ ccl_pr_tree (rpn->u.p[0], fd_out);
+ fprintf (fd_out, ") and (");
+ ccl_pr_tree (rpn->u.p[1], fd_out);
+ fprintf (fd_out, ")");
break;
case CCL_RPN_OR:
- printf ("(");
- ccl_pr_tree (rpn->u.p[0]);
- printf (") or (");
- ccl_pr_tree (rpn->u.p[1]);
- printf (")");
+ fprintf (fd_out, "(");
+ ccl_pr_tree (rpn->u.p[0], fd_out);
+ fprintf (fd_out, ") or (");
+ ccl_pr_tree (rpn->u.p[1], fd_out);
+ fprintf (fd_out, ")");
break;
case CCL_RPN_NOT:
- printf ("(");
- ccl_pr_tree (rpn->u.p[0]);
- printf (") not (");
- ccl_pr_tree (rpn->u.p[1]);
- printf (")");
+ fprintf (fd_out, "(");
+ ccl_pr_tree (rpn->u.p[0], fd_out);
+ fprintf (fd_out, ") not (");
+ ccl_pr_tree (rpn->u.p[1], fd_out);
+ fprintf (fd_out, ")");
break;
case CCL_RPN_SET:
- printf ("set=%s", rpn->u.setname);
+ fprintf (fd_out, "set=%s", rpn->u.setname);
break;
case CCL_RPN_PROX:
- printf ("(");
- ccl_pr_tree (rpn->u.p[0]);
- printf (") prox (");
- ccl_pr_tree (rpn->u.p[1]);
- printf (")");
+ fprintf (fd_out, "(");
+ ccl_pr_tree (rpn->u.p[0], fd_out);
+ fprintf (fd_out, ") prox (");
+ ccl_pr_tree (rpn->u.p[1], fd_out);
+ fprintf (fd_out, ")");
break;
default:
assert (0);
* Europagate 1995
*
* $Log: cclsh.c,v $
- * Revision 1.6 1995/02/14 19:55:13 adam
+ * Revision 1.7 1995/02/15 17:42:16 adam
+ * Minor changes of the api of this module. FILE* argument added
+ * to ccl_pr_tree.
+ *
+ * Revision 1.6 1995/02/14 19:55:13 adam
* Header files ccl.h/cclp.h are gone! They have been merged an
* moved to ../include/ccl.h.
* Node kind(s) in ccl_rpn_node have changed names.
else
{
assert (rpn);
- ccl_pr_tree (rpn);
+ ccl_pr_tree (rpn, stdout);
putchar ('\n');
}
}
* Europagate, 1995
*
* $Log: ccltoken.c,v $
- * Revision 1.2 1995/02/14 19:55:13 adam
+ * Revision 1.3 1995/02/15 17:42:16 adam
+ * Minor changes of the api of this module. FILE* argument added
+ * to ccl_pr_tree.
+ *
+ * Revision 1.2 1995/02/14 19:55:13 adam
* Header files ccl.h/cclp.h are gone! They have been merged an
* moved to ../include/ccl.h.
* Node kind(s) in ccl_rpn_node have changed names.
return 0;
}
-char *ccl_token_and = "and";
-char *ccl_token_or = "or";
-char *ccl_token_not = "not";
-char *ccl_token_set = "set";
+const char *ccl_token_and = "and";
+const char *ccl_token_or = "or";
+const char *ccl_token_not = "not";
+const char *ccl_token_set = "set";
struct ccl_token *ccl_tokenize (const char *command)
{