version 1.7, 2001/08/22 04:20:45 |
version 1.8, 2001/08/31 09:17:12 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/print.c,v 1.6 2001/08/22 00:54:29 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/print.c,v 1.7 2001/08/22 04:20:45 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
|
|
break; |
break; |
|
|
/* lists */ |
/* lists */ |
case I_EV: case I_LIST: |
case I_LIST: |
n = (NODE)FA0(f); |
n = (NODE)FA0(f); |
for ( t0 = 0; n; n = NEXT(n) ) { |
for ( t0 = 0; n; n = NEXT(n) ) { |
NEXTNODE(t0,t); |
NEXTNODE(t0,t); |
|
|
} |
} |
if ( t0 ) |
if ( t0 ) |
NEXT(t) = 0; |
NEXT(t) = 0; |
switch ( f->id ) { |
MKSTR(head,"list"); |
case I_LIST: |
|
MKSTR(head,"list"); break; |
|
case I_EV: |
|
MKSTR(head,"exponent_vector"); break; |
|
} |
|
MKNODE(n,head,t0); |
MKNODE(n,head,t0); |
MKLIST(r,n); |
MKLIST(r,n); |
*rp = (Obj)r; |
*rp = (Obj)r; |
break; |
break; |
|
|
/* function */ |
/* function */ |
case I_FUNC: case I_CAR: case I_CDR: |
case I_FUNC: case I_CAR: case I_CDR: case I_EV: |
MKSTR(head,"function"); |
MKSTR(head,"function"); |
switch ( f->id ) { |
switch ( f->id ) { |
case I_FUNC: |
case I_FUNC: |
|
|
MKSTR(op,"cdr"); |
MKSTR(op,"cdr"); |
fnodetotree((FNODE)FA0(f),&arg); |
fnodetotree((FNODE)FA0(f),&arg); |
break; |
break; |
|
case I_EV: |
|
/* exponent vector; should be treated as function call */ |
|
MKSTR(op,"exponent_vector"); |
|
fnodetotree(mkfnode(1,I_LIST,FA0(f)),&arg); |
|
break; |
} |
} |
t0 = NEXT(BDY(arg)); /* XXX : skip the headers */ |
t0 = NEXT(BDY(arg)); /* XXX : skip the headers */ |
MKNODE(t,op,t0); |
MKNODE(t,op,t0); |
|
|
error("fnodetotree : not implemented yet"); |
error("fnodetotree : not implemented yet"); |
} |
} |
} |
} |
|
|
|
char *get_attribute(key,attr) |
|
char *key; |
|
LIST attr; |
|
{} |
|
|
|
void treetofnode(obj,f) |
|
Obj obj; |
|
FNODE *f; |
|
{ |
|
NODE n; |
|
LIST attr; |
|
char *prop; |
|
|
|
if ( obj || OID(obj) != O_LIST ) { |
|
/* internal object */ |
|
*f = mkfnode(1,I_FORMULA,obj); |
|
} else { |
|
/* [attr(list),name(string),args(node)] */ |
|
n = BDY((LIST)obj); |
|
attr = (LIST)BDY(n); n = NEXT(n); |
|
prop = get_attribute("asir",attr); |
|
if ( !strcmp(prop,"u_op") ) { |
|
} else if ( !strcmp(prop,"b_op") ) { |
|
} else if ( !strcmp(prop,"t_op") ) { |
|
} else if ( !strcmp(prop,"function") ) { |
|
} |
|
/* default will be set to P_FUNC */ |
|
} |
|
} |
|
|