DISPLAYEXPR(3)

NAME
displayExpr - displays an expression in a prefixed notation.

SYNOPSYS
#include "logmmm.h"
void displayExpr(expr)
chain_list *expr;

PARAMETER

expr
    Expression to display.

DESCRIPTION
displayExpr() displays on the screen expr in a prefixed notation.

EXAMPLE
#include "mutnnn.h"		/* mbk utilities */
#include "logmmm.h"
chain_list *expr;
expr = createExpr(OR);
addQExpr(expr,createAtom("a"));
addQExpr(expr,createAtom("b"));
displayExpr(expr);
/* it will display
(OR a b)
*/
freeExpr(expr);

PROGRAM
void displayExpr(expr)
chain_list *expr;
if (ATOM(expr))		/* atomic treatement */
   printf(" %s",VALUE_ATOM(expr));
else
   {			/* go through the arguments */
   printf("(%s",operToChar(OPER(expr)));
   while (expr = CDR(expr))
      displayExpr(CAR(expr));
   printf(")");
   }
}

SEE ALSO
log(1), abl(1), displayInfExpr(3), exprToChar(3), charToOper(3), operToChar(3), identExpr(3).