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

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

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