# 2.11BSD#431 - /usr/src/new/PORT/B/src/bint/b1com.c

##### Functions

    mk_fun            X
    mk_how            X
    mk_per            X
    mk_prd            X
    mk_ptn            X
    mk_ref            X
    mk_simploc        X
    mk_tbseloc        X
    mk_trimloc        X
    node1             X
    node2             X
    node3             X
    node4             X
    node5             X
    node6             X
    node8             X
    node9             X
    nodetype          X

       1: /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
       2:
       3: /*
       4:   $Header: b1com.c,v 1.4 85/08/22 16:48:13 timo Exp $
       5: */
       6:
       7: /************************************************************************/
       8: /* B compounds                                                          */
       9: /* plus Hows Funs and other odd types that don't fit anywhere else      */
      10: /*                                                                      */
      11: /* A compound is modelled as a sequence of len values, its fields.      */
      12: /*                                                                      */
      13: /************************************************************************/
      14:
      15: #include "b.h"
      16: #include "b1obj.h"
      17: #include "b2nod.h"
      18:
      19: /* NODES */
      20:
      21: Visible typenode nodetype(v) parsetree v; {
      22:     return Is_parsetree(v) ? Nodetype(v) : Nonode;
      23: }
      24:
      25: Hidden value
      26: mk_ptn(type, len) /* make parsetree node */
      27:     typenode type;
      28:     intlet len;
      29: {
      30:     parsetree v= (parsetree) grab_ptn((len<<8) | type);
      31:     *Branch(v, len)= *Branch(v, len+1)= NilTree;
      32:     return v;
      33: }
      34:
      35: Visible parsetree
      36: node1(type)
      37:     typenode type;
      38: {
      39:     return mk_ptn(type, 0);
      40: }
      41:
      42: Visible parsetree
      43: node2(type, a1)
      44:     typenode type; value a1;
      45: {
      46:     parsetree v= mk_ptn(type, 1); value *p= Ats(v);
      47:     *p++= a1;
      48:     return v;
      49: }
      50:
      51: Visible parsetree
      52: node3(type, a1, a2)
      53:     typenode type; value a1, a2;
      54: {
      55:     parsetree v= mk_ptn(type, 2); value *p= Ats(v);
      56:     *p++= a1; *p++= a2;
      57:     return v;
      58: }
      59:
      60: Visible parsetree
      61: node4(type, a1, a2, a3)
      62:     typenode type; value a1, a2, a3;
      63: {
      64:     parsetree v= mk_ptn(type, 3); value *p= Ats(v);
      65:     *p++= a1; *p++= a2; *p++= a3;
      66:     return v;
      67: }
      68:
      69: Visible parsetree
      70: node5(type, a1, a2, a3, a4)
      71:     typenode type; value a1, a2, a3, a4;
      72: {
      73:     parsetree v= mk_ptn(type, 4); value *p= Ats(v);
      74:     *p++= a1; *p++= a2; *p++= a3; *p++= a4;
      75:     return v;
      76: }
      77:
      78: Visible parsetree
      79: node6(type, a1, a2, a3, a4,a5)
      80:     typenode type; value a1, a2, a3, a4, a5;
      81: {
      82:     parsetree v= mk_ptn(type, 5); value *p= Ats(v);
      83:     *p++= a1; *p++= a2; *p++= a3; *p++= a4; *p++= a5;
      84:     return v;
      85: }
      86:
      87: Visible parsetree
      88: node8(type, a1, a2, a3, a4, a5, a6, a7)
      89:     typenode type; value a1, a2, a3, a4, a5, a6, a7;
      90: {
      91:     parsetree v= mk_ptn(type, 7); value *p= Ats(v);
      92:     *p++= a1; *p++= a2; *p++= a3; *p++= a4; *p++= a5; *p++= a6; *p++= a7;
      93:     return v;
      94: }
      95:
      96: Visible parsetree
      97: node9(type, a1, a2, a3, a4, a5, a6, a7, a8)
      98:     typenode type; value a1, a2, a3, a4, a5, a6, a7, a8;
      99: {
     100:     parsetree v= mk_ptn(type, 8); value *p= Ats(v);
     101:     *p++= a1; *p++= a2; *p++= a3; *p++= a4; *p++= a5; *p++= a6;
     102:     *p++= a7; *p++= a8;
     103:     return v;
     104: }
     105:
     106: /* OTHER TYPES */
     107:
     108: Visible loc
     109: mk_simploc(id, en)
     110:     basidf id; env en;
     111: {
     112:     loc l= grab_sim();
     113:     (*Ats(l))= copy(id); (*(Ats(l)+1))= (value) en;
     114:     return l;
     115: }
     116:
     117: Visible loc
     118: mk_trimloc(R, B, C)
     119:     loc R; value B, C;
     120: {
     121:     loc l= grab_tri(); trimloc *ll= (trimloc *)Ats(l);
     122:     ll->R= copy(R); ll->B= copy(B); ll->C= copy(C);
     123:     return l;
     124: }
     125:
     126: Visible loc
     127: mk_tbseloc(R, K)
     128:     loc R; value K;
     129: {
     130:     loc l= grab_tse(); tbseloc *ll= (tbseloc *)Ats(l);
     131:     ll->R= copy(R); ll->K= copy(K);
     132:     return l;
     133: }
     134:
     135: Visible fun
     136: mk_fun(adic, pre, unit, filed)
     137:     literal adic; intlet pre; parsetree unit; bool filed;
     138: {
     139:     fun f= grab_fun(); funprd *ff= (funprd *)Ats(f);
     140:     ff->adic= adic; ff->pre= pre; ff->unit= unit;
     141:     ff->unparsed= Yes; ff->filed= filed;
     142:     ff->code= NilTree;
     143:     return f;
     144: }
     145:
     146: Visible prd
     147: mk_prd(adic, pre, unit, filed)
     148:     literal adic; intlet pre; parsetree unit; bool filed;
     149: {
     150:     prd p= grab_prd(); funprd *pp= (funprd *)Ats(p);
     151:     pp->adic= adic; pp->pre= pre; pp->unit= unit;
     152:     pp->unparsed= Yes; pp->filed= filed;
     153:     pp->code= NilTree;
     154:     return p;
     155: }
     156:
     157: Visible value
     158: mk_how(unit, filed)
     159:     parsetree unit; bool filed;
     160: {
     161:     value h= grab_how(); how *hh= (how *)Ats(h);
     162:     hh->unit= unit; hh->unparsed= Yes; hh->filed= filed;
     163:     hh->code= NilTree;
     164:     return h;
     165: }
     166:
     167: Visible value
     168: mk_ref(rp)
     169:     parsetree rp;
     170: {
     171:     value r= grab_ref();
     172:     *Ats(r)= copy(rp);
     173:     return r;
     174: }
     175:
     176: Visible value
     177: mk_per(v)
     178:     value v;
     179: {
     180:     value p= grab_per();
     181:     *Ats(p)= copy(v);
     182:     return p;
     183: }

#### Defined functions

mk_fun defined in line 135; used 3 times

- in /usr/src/new/PORT/B/src/bint/b1obj.h line 197
- in /usr/src/new/PORT/B/src/bint/b3fpr.c line 110
- in /usr/src/new/PORT/B/src/bint/b3sou.c line 282

mk_how defined in line 157; used 2 times

- in /usr/src/new/PORT/B/src/bint/b1obj.h line 199
- in /usr/src/new/PORT/B/src/bint/b3sou.c line 281

mk_per defined in line 176; used 2 times

- in /usr/src/new/PORT/B/src/bint/b1obj.h line 196
- in /usr/src/new/PORT/B/src/bint/b3sou.c line 618

mk_prd defined in line 146; used 3 times

- in /usr/src/new/PORT/B/src/bint/b1obj.h line 198
- in /usr/src/new/PORT/B/src/bint/b3fpr.c line 124
- in /usr/src/new/PORT/B/src/bint/b3sou.c line 283

mk_ptn defined in line 25; used 8 times

- in line 39, 46, 55, 64, 73, 82, 91, 100

mk_ref defined in line 167; used 2 times

- in /usr/src/new/PORT/B/src/bint/b1obj.h line 200
- in /usr/src/new/PORT/B/src/bint/b2uni.c line 325

mk_simploc defined in line 108; used 3 times

- in /usr/src/new/PORT/B/src/bint/b1obj.h line 192
- in /usr/src/new/PORT/B/src/bint/b3loc.c line 131-133(2)

mk_tbseloc defined in line 126; used 2 times

- in /usr/src/new/PORT/B/src/bint/b1obj.h line 194
- in /usr/src/new/PORT/B/src/bint/b3loc.c line 126

mk_trimloc defined in line 117; used 2 times

- in /usr/src/new/PORT/B/src/bint/b1obj.h line 193
- in /usr/src/new/PORT/B/src/bint/b3loc.c line 116

node1 defined in line 35; used 5 times

- in /usr/src/new/PORT/B/src/bint/b2cmd.c line 168-171(2), 178
- in /usr/src/new/PORT/B/src/bint/b2exp.c line 377
- in /usr/src/new/PORT/B/src/bint/b2nod.h line 122

node2 defined in line 42; used 22 times

- in /usr/src/new/PORT/B/src/bint/b2cmd.c line 101, 107-109(2), 120, 132, 173-175(2)
- in /usr/src/new/PORT/B/src/bint/b2exp.c line 178, 261, 399, 431
- in /usr/src/new/PORT/B/src/bint/b2gen.c line 562
- in /usr/src/new/PORT/B/src/bint/b2nod.h line 123
- in /usr/src/new/PORT/B/src/bint/b2tar.c line 25
- in /usr/src/new/PORT/B/src/bint/b2tes.c line 61, 175-179(2)
- in /usr/src/new/PORT/B/src/bint/b2uni.c line 239, 288, 351, 362, 378

node3 defined in line 51; used 30 times

- in /usr/src/new/PORT/B/src/bint/b2cmd.c line 105, 113-117(2), 125-130(2), 261, 285
- in /usr/src/new/PORT/B/src/bint/b2exp.c line 87, 300, 322-323(2), 341-346(2), 353, 389, 473, 534
- in /usr/src/new/PORT/B/src/bint/b2fix.c line 84, 128-130(2)
- in /usr/src/new/PORT/B/src/bint/b2gen.c line 558-570(6)
- in /usr/src/new/PORT/B/src/bint/b2nod.h line 124
- in /usr/src/new/PORT/B/src/bint/b2tes.c line 41, 53, 146

node4 defined in line 60; used 14 times

- in /usr/src/new/PORT/B/src/bint/b2cmd.c line 147, 200, 281, 290, 341
- in /usr/src/new/PORT/B/src/bint/b2exp.c line 178
- in /usr/src/new/PORT/B/src/bint/b2fix.c line 132, 231-235(2)
- in /usr/src/new/PORT/B/src/bint/b2nod.h line 125
- in /usr/src/new/PORT/B/src/bint/b2tes.c line 95, 179
- in /usr/src/new/PORT/B/src/bint/b2uni.c line 96, 218

node5 defined in line 69; used 14 times

- in /usr/src/new/PORT/B/src/bint/b2cmd.c line 30, 38, 44, 216, 302
- in /usr/src/new/PORT/B/src/bint/b2exp.c line 89
- in /usr/src/new/PORT/B/src/bint/b2fix.c line 85, 142
- in /usr/src/new/PORT/B/src/bint/b2nod.h line 126
- in /usr/src/new/PORT/B/src/bint/b2tes.c line 201
- in /usr/src/new/PORT/B/src/bint/b2uni.c line 232, 262, 270, 276

node6 defined in line 78; used 4 times

- in /usr/src/new/PORT/B/src/bint/b2cmd.c line 327, 346
- in /usr/src/new/PORT/B/src/bint/b2nod.h line 127
- in /usr/src/new/PORT/B/src/bint/b2uni.c line 324

node8 defined in line 87; used 2 times

- in /usr/src/new/PORT/B/src/bint/b2nod.h line 128
- in /usr/src/new/PORT/B/src/bint/b2uni.c line 74

node9 defined in line 96; used 3 times

- in /usr/src/new/PORT/B/src/bint/b2nod.h line 129
- in /usr/src/new/PORT/B/src/bint/b2uni.c line 116, 146

nodetype defined in line 21; used 21 times

- in /usr/src/new/PORT/B/src/bint/b2dis.c line 149, 294, 309
- in /usr/src/new/PORT/B/src/bint/b2exp.c line 54-59(2), 68, 200
- in /usr/src/new/PORT/B/src/bint/b2fix.c line 106
- in /usr/src/new/PORT/B/src/bint/b2nod.h line 130
- in /usr/src/new/PORT/B/src/bint/b2stc.c line 43, 66, 99, 557, 760
- in /usr/src/new/PORT/B/src/bint/b2tes.c line 85
- in /usr/src/new/PORT/B/src/bint/b2uni.c line 200, 212-217(2), 224, 230-231(2)

Last modified: 1985-08-27 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 878 |