1: /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1984. */
   2: /* $Header: b1com.c,v 1.1 84/06/28 00:49:03 timo Exp $ */
   3: 
   4: /************************************************************************/
   5: /* B compounds                                                          */
   6: /* plus Hows Funs and other odd types that don't fit anywhere else      */
   7: /*                                                                      */
   8: /* A compound is modelled as a sequence of len values, its fields.      */
   9: /*                                                                      */
  10: /************************************************************************/
  11: 
  12: #include "b.h"
  13: #include "b1obj.h"
  14: 
  15: Visible value* field(v, k) value v; intlet k; { /* k in {0..size-1}; no copy */
  16:     return (value *) Field(v, k);
  17: }
  18: 
  19: Visible Procedure put_in_field(v, c, i) value v, *c; intlet i; {
  20:     /*Note that no copy of v is made: the caller must do this*/
  21:     *(Ats(*c)+i)= v;
  22: }
  23: 
  24: /* Other types */
  25: Visible loc mk_simploc(id, en) basidf id; env en; {
  26:     loc l= grab_sim();
  27:     (*Ats(l))= copy(id); (*(Ats(l)+1))= (value) en;
  28:     return l;
  29: }
  30: 
  31: Visible loc mk_trimloc(R, B, C) loc R; intlet B, C; {
  32:     loc l= grab_tri(); trimloc *ll= (trimloc *)Ats(l);
  33:     ll->R= copy(R); ll->B= B; ll->C= C;
  34:     return l;
  35: }
  36: 
  37: Visible loc mk_tbseloc(R, K) loc R; value K; {
  38:     loc l= grab_tse(); tbseloc *ll= (tbseloc *)Ats(l);
  39:     ll->R= copy(R); ll->K= copy(K);
  40:     return l;
  41: }
  42: 
  43: Visible fun mk_fun(L, H, adic, def, fux, lux, reftab, filed)
  44:  intlet L, H; literal adic, def; txptr fux, lux; value reftab; bool filed; {
  45:     fun f= grab_fun(); funprd *ff= (funprd *)Ats(f);
  46:     ff->L= L; ff->H= H; ff->adic= adic; ff->def= def; ff->fux= fux;
  47:     ff->lux= lux; ff->reftab= reftab; ff->filed= filed;
  48:     return f;
  49: }
  50: 
  51: Visible prd mk_prd(adic, def, fux, lux, reftab, filed)
  52:  literal adic, def; txptr fux, lux; value reftab; bool filed; {
  53:     prd p= grab_prd(); funprd *pp= (funprd *)Ats(p);
  54:     pp->adic= adic; pp->def= def; pp->fux= fux;
  55:     pp->lux= lux; pp->reftab= reftab; pp->filed= filed;
  56:     return p;
  57: }
  58: 
  59: Visible value mk_how(fux, lux, reftab, filed)
  60:  txptr fux, lux; value reftab; bool filed; {
  61:     value h= grab_how(); how *hh= (how *)Ats(h);
  62:     hh->fux= fux; hh->lux= lux; hh->reftab= reftab; hh->filed= filed;
  63:     return h;
  64: }
  65: 
  66: Visible value mk_ref(rp, rlino) txptr rp; intlet rlino; {
  67:     value r= grab_ref();
  68:     ((ref *)Ats(r))->rp= rp;
  69:     ((ref *)Ats(r))->rlino= rlino;
  70:     return r;
  71: }
  72: 
  73: Visible value mk_per(v) value v; {
  74:     value p= grab_per();
  75:     *Ats(p)= copy(v);
  76:     return p;
  77: }

Defined functions

Last modified: 1985-08-27
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 829
Valid CSS Valid XHTML 1.0 Strict