C:/Users/Dennis/src/lang/russell.orig/src/pass1/applinfer/cor_cond.c

Go to the documentation of this file.
00001 # include "parm.h"
00002 # include "stree/ststructs.mh"
00003 
00004 extern NODE * sel_true;     /* syntax tree coresponding to Boolean$True */
00005 
00006 /*
00007  * cor_cond(d1, d2)
00008  *
00009  * input: d1,d2 are syntax trees coresponding to some denotation.
00010  *        They should be lists with a single element.
00011  *
00012  * output: the syntax tree corresponding to (d1 cor d2), i.e.
00013  *         corresponding to  IF d1 ==> Boolean$true[] # ELSE ==> d2 FI.
00014  */
00015 
00016 NODE * cor_cond(d1, d2)
00017 NODE *d1, *d2;
00018 {
00019     NODE * gl, *ge1, *ge2;
00020 
00021     if (is_empty(d1) || is_empty(d2)) {
00022         return(mknode(GUARDEDLIST, emptylist()));
00023     }
00024     ge1 = mknode(GUARDEDELEMENT, first(d1), sel_true);
00025     ge2 = mknode(GUARDEDELEMENT, mknode(WORDELSE), first(d2));
00026     gl = mknode(GUARDEDLIST, mklist(ge1, ge2, -1));
00027     return( gl );
00028 }

Generated on Fri Jan 25 10:39:46 2008 for russell by  doxygen 1.5.4