[BACK]Return to tree.c CVS log [TXT][DIR] Up to [local] / OpenXM / src / kan96xx / Kan / Kclass

Diff for /OpenXM/src/kan96xx/Kan/Kclass/tree.c between version 1.5 and 1.6

version 1.5, 2003/12/05 13:51:32 version 1.6, 2003/12/05 23:14:14
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/kan96xx/Kan/Kclass/tree.c,v 1.4 2003/11/24 08:16:13 takayama Exp $ */  /* $OpenXM: OpenXM/src/kan96xx/Kan/Kclass/tree.c,v 1.5 2003/12/05 13:51:32 takayama Exp $ */
 #include <stdio.h>  #include <stdio.h>
 #include "../datatype.h"  #include "../datatype.h"
 #include "../stackm.h"  #include "../stackm.h"
Line 56  int isTreeAdd(struct object ob) {
Line 56  int isTreeAdd(struct object ob) {
   if (name.tag != Sdollar) {    if (name.tag != Sdollar) {
     errorKan1("%s\n","CLASSNAME_tree is broken. Should be string.");      errorKan1("%s\n","CLASSNAME_tree is broken. Should be string.");
   }    }
   if (strcmp(KopString(name),"add") == 0) {    if (strcmp(KopString(name),"plus") == 0) {
     return(1);      return(1);
   }else{    }else{
     return(0);      return(0);
Line 69  struct object addTree(struct object ob1, struct object
Line 69  struct object addTree(struct object ob1, struct object
   struct object ob3,ob4;    struct object ob3,ob4;
   struct object attr;    struct object attr;
   struct object keyValue;    struct object keyValue;
     struct object to;
   int i;    int i;
     to = ob2; ob2=ob1; ob1=to; /* Exchange ob1 and ob2 */
   if (isTreeAdd(ob1) && !isTreeAdd(ob2)) {    if (isTreeAdd(ob1) && !isTreeAdd(ob2)) {
     ob1 = KopTree(ob1);      ob1 = KopTree(ob1);
     ob3 = getoa(ob1,2);      ob3 = getoa(ob1,2);
Line 105  struct object addTree(struct object ob1, struct object
Line 107  struct object addTree(struct object ob1, struct object
   }    }
   attr = newObjectArray(1);    attr = newObjectArray(1);
   keyValue = newObjectArray(2);    keyValue = newObjectArray(2);
   putoa(keyValue,0,KpoString("arith1"));    putoa(keyValue,0,KpoString("cd"));
   putoa(keyValue,1,KpoString("plus"));    putoa(keyValue,1,KpoString("arith1"));
   putoa(attr,0,keyValue);    putoa(attr,0,keyValue);
   rob = newObjectArray(3);    rob = newObjectArray(3);
   putoa(rob,0,KpoString("add"));    putoa(rob,0,KpoString("plus"));
   putoa(rob,1,attr);    putoa(rob,1,attr);
   putoa(rob,2,aob);    putoa(rob,2,aob);
   return(KpoTree(rob));    return(KpoTree(rob));

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>