1: /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
2:
3: /*
4: $Header: b2nod.h,v 1.4 85/08/22 16:42:43 timo Exp $
5: */
6:
7: /* Units */
8:
9: typedef intlet typenode;
10:
11: #define _Nodetype(len) ((len) & 0377)
12: #define _Nbranches(len) ((len) >> 8)
13: #define Nodetype(v) _Nodetype((v)->len)
14: #define Nbranches(v) _Nbranches((v)->len)
15: #define Branch(v, n) ((Ats(v)+(n)))
16:
17: #define Unit(n) (n>=HOW_TO && n<=REFINEMENT)
18: #define Command(n) (n>=SUITE && n<=EXTENDED_COMMAND)
19: #define Expression(n) ((n>=TAG && n<=TAB_DIS)||(n>=TAGformal && n<=TAGzerprd))
20: #define Comparison(n) (n>=LESS_THAN && n<=UNEQUAL)
21:
22: #define HOW_TO 0
23: #define YIELD 1
24: #define TEST 2
25: #define REFINEMENT 3
26:
27: /* Commands */
28:
29: #define SUITE 4
30: #define PUT 5
31: #define INSERT 6
32: #define REMOVE 7
33: #define CHOOSE 8
34: #define DRAW 9
35: #define SET_RANDOM 10
36: #define DELETE 11
37: #define CHECK 12
38: #define SHARE 13
39:
40: #define WRITE 14
41: #define READ 15
42: #define READ_RAW 16
43:
44: #define IF 17
45: #define WHILE 18
46: #define FOR 19
47:
48: #define SELECT 20
49: #define TEST_SUITE 21
50: #define ELSE 22
51:
52: #define QUIT 23
53: #define RETURN 24
54: #define REPORT 25
55: #define SUCCEED 26
56: #define FAIL 27
57:
58: #define USER_COMMAND 28
59: #define EXTENDED_COMMAND 29
60:
61: /* Expressions, targets, tests */
62:
63: #define TAG 30
64: #define COMPOUND 31
65:
66: /* Expressions, targets */
67:
68: #define COLLATERAL 32
69: #define SELECTION 33
70: #define BEHEAD 34
71: #define CURTAIL 35
72:
73: /* Expressions, tests */
74:
75: #define UNPARSED 36
76:
77: /* Expressions */
78:
79: #define MONF 37
80: #define DYAF 38
81: #define NUMBER 39
82: #define TEXT_DIS 40
83: #define TEXT_LIT 41
84: #define TEXT_CONV 42
85: #define ELT_DIS 43
86: #define LIST_DIS 44
87: #define RANGE_DIS 45
88: #define TAB_DIS 46
89:
90: /* Tests */
91:
92: #define AND 47
93: #define OR 48
94: #define NOT 49
95: #define SOME_IN 50
96: #define EACH_IN 51
97: #define NO_IN 52
98: #define SOME_PARSING 53
99: #define EACH_PARSING 54
100: #define NO_PARSING 55
101: #define MONPRD 56
102: #define DYAPRD 57
103: #define LESS_THAN 58
104: #define AT_MOST 59
105: #define GREATER_THAN 60
106: #define AT_LEAST 61
107: #define EQUAL 62
108: #define UNEQUAL 63
109: #define Nonode 64
110:
111: #define TAGformal 65
112: #define TAGlocal 66
113: #define TAGglobal 67
114: #define TAGmystery 68
115: #define TAGrefinement 69
116: #define TAGzerfun 70
117: #define TAGzerprd 71
118:
119: #define ACTUAL 72
120: #define FORMAL 73
121:
122: value node1();
123: value node2();
124: value node3();
125: value node4();
126: value node5();
127: value node6();
128: value node8();
129: value node9();
130: typenode nodetype();
131: /* Procedure display(); */
132: /* Procedure fix_nodes(); */
133:
134: #define First_fieldnr 0
135:
136: #define UNIT_NAME First_fieldnr
137: #define HOW_FORMALS First_fieldnr + 1 /* HOW'TO */
138: #define First_fieldnr + 2
139: #define HOW_SUITE First_fieldnr + 3
140: #define HOW_REFINEMENT First_fieldnr + 4
141: #define HOW_R_NAMES First_fieldnr + 5
142: #define HOW_NLOCALS First_fieldnr + 6
143: #define FPR_ADICITY First_fieldnr + 1 /* YIELD, TEST */
144: #define FPR_FORMALS First_fieldnr + 2
145: #define First_fieldnr + 3
146: #define FPR_SUITE First_fieldnr + 4
147: #define FPR_REFINEMENT First_fieldnr + 5
148: #define FPR_R_NAMES First_fieldnr + 6
149: #define FPR_NLOCALS First_fieldnr + 7
150:
151: #define FML_KEYW First_fieldnr /* FORMALS HOW'TO */
152: #define FML_TAG First_fieldnr + 1
153: #define FML_NEXT First_fieldnr + 2
154:
155: #define SUI_LINO First_fieldnr /* SUITE */
156: #define SUI_CMD First_fieldnr + 1
157: #define First_fieldnr + 2
158: #define SUI_NEXT First_fieldnr + 3
159: #define REF_NAME First_fieldnr /* REFINEMENT */
160: #define First_fieldnr + 1
161: #define REF_SUITE First_fieldnr + 2
162: #define REF_NEXT First_fieldnr + 3
163: #define REF_START First_fieldnr + 4
164:
165: #define PUT_EXPR First_fieldnr /* PUT */
166: #define PUT_TARGET First_fieldnr + 1
167: #define INS_EXPR First_fieldnr /* INSERT */
168: #define INS_TARGET First_fieldnr + 1
169: #define RMV_EXPR First_fieldnr /* REMOVE */
170: #define RMV_TARGET First_fieldnr + 1
171: #define CHS_TARGET First_fieldnr /* CHOOSE */
172: #define CHS_EXPR First_fieldnr + 1
173: #define DRW_TARGET First_fieldnr /* DRAW */
174: #define SET_EXPR First_fieldnr /* SET'RANDOM */
175: #define DEL_TARGET First_fieldnr /* DELETE */
176: #define CHK_TEST First_fieldnr /* CHECK */
177: #define SHR_TARGET First_fieldnr /* SHARE */
178:
179: #define WRT_L_LINES First_fieldnr /* WRITE */
180: #define WRT_EXPR First_fieldnr + 1
181: #define WRT_R_LINES First_fieldnr + 2
182: #define RD_TARGET First_fieldnr /* READ */
183: #define RD_EXPR First_fieldnr + 1
184: #define RDW_TARGET First_fieldnr /* READ'RAW */
185:
186: #define IF_TEST First_fieldnr /* IF */
187: #define First_fieldnr + 1
188: #define IF_SUITE First_fieldnr + 2
189: #define WHL_TEST First_fieldnr /* WHILE */
190: #define First_fieldnr + 1
191: #define WHL_SUITE First_fieldnr + 2
192: #define FOR_TARGET First_fieldnr /* FOR */
193: #define FOR_EXPR First_fieldnr + 1
194: #define First_fieldnr + 2
195: #define FOR_SUITE First_fieldnr + 3
196:
197: #define First_fieldnr /* SELECT */
198: #define SLT_TSUITE First_fieldnr + 1
199: #define TSUI_LINO First_fieldnr /* TEST SUITE */
200: #define TSUI_TEST First_fieldnr + 1
201: #define First_fieldnr + 2
202: #define TSUI_SUITE First_fieldnr + 3
203: #define TSUI_NEXT First_fieldnr + 4
204: #define ELSE_LINO First_fieldnr /* ELSE */
205: #define First_fieldnr + 1
206: #define ELSE_SUITE First_fieldnr + 2
207:
208: #define RTN_EXPR First_fieldnr /* RETURN */
209: #define RPT_TEST First_fieldnr /* REPORT */
210:
211: #define UCMD_NAME First_fieldnr /* USER COMMAND */
212: #define UCMD_ACTUALS First_fieldnr + 1
213: #define UCMD_DEF First_fieldnr + 2
214: #define ACT_KEYW First_fieldnr /* ACTUALS USER COMMAND */
215: #define ACT_EXPR First_fieldnr + 1
216: #define ACT_NEXT First_fieldnr + 2
217: #define ACT_START First_fieldnr + 3
218:
219: #define ECMD_NAME First_fieldnr /* EXTENDED COMMAND */
220: #define ECMD_ACTUALS First_fieldnr + 1
221:
222: #define COMP_FIELD First_fieldnr /* COMPOUND */
223: #define COLL_SEQ First_fieldnr /* COLLATERAL */
224: #define MON_NAME First_fieldnr /* MONADIC FUNCTION */
225: #define MON_RIGHT First_fieldnr + 1
226: #define MON_FCT First_fieldnr + 2
227: #define DYA_NAME First_fieldnr + 1 /* DYADIC FUNCTION */
228: #define DYA_LEFT First_fieldnr
229: #define DYA_RIGHT First_fieldnr + 2
230: #define DYA_FCT First_fieldnr + 3
231: #define TAG_NAME First_fieldnr /* TAG */
232: #define TAG_ID First_fieldnr + 1
233: #define NUM_VALUE First_fieldnr /* NUMBER */
234: #define NUM_TEXT First_fieldnr + 1
235: #define XDIS_QUOTE First_fieldnr /* TEXT DIS */
236: #define XDIS_NEXT First_fieldnr + 1
237: #define XLIT_TEXT First_fieldnr /* TEXT LIT */
238: #define XLIT_NEXT First_fieldnr + 1
239: #define XCON_EXPR First_fieldnr /* TEXT CONV */
240: #define XCON_NEXT First_fieldnr + 1
241: #define LDIS_SEQ First_fieldnr /* LIST DIS */
242: #define RDIS_LWB First_fieldnr /* RANGE DIS */
243: #define RDIS_UPB First_fieldnr + 1
244: #define TDIS_SEQ First_fieldnr /* TAB_DIS */
245: #define SEL_TABLE First_fieldnr /* SELECTION */
246: #define SEL_KEY First_fieldnr + 1
247: #define TRIM_LEFT First_fieldnr /* BEHEAD, CURTAIL */
248: #define TRIM_RIGHT First_fieldnr + 1
249: #define UNP_SEQ First_fieldnr /* UNPARSED */
250: #define UNP_TEXT First_fieldnr + 1
251:
252: #define AND_LEFT First_fieldnr /* AND */
253: #define AND_RIGHT First_fieldnr + 1
254: #define OR_LEFT First_fieldnr /* OR */
255: #define OR_RIGHT First_fieldnr + 1
256: #define NOT_RIGHT First_fieldnr /* NOT */
257: #define QUA_TARGET First_fieldnr /* QUANTIFICATION */
258: #define QUA_EXPR First_fieldnr + 1
259: #define QUA_TEST First_fieldnr + 2
260: #define REL_LEFT First_fieldnr /* ORDER TEST */
261: #define REL_RIGHT First_fieldnr + 1
Defined macros
AND
defined in line
92; used 2 times
Branch
defined in line
15; used 210 times
- in /usr/src/new/PORT/B/src/bint/b1com.c line
31(2)
- in /usr/src/new/PORT/B/src/bint/b2ana.c line
36,
99-103(3),
132,
141,
148-177(8),
185-190(2)
- in /usr/src/new/PORT/B/src/bint/b2dis.c line
144,
213-215(2),
222,
228,
260-265(4),
272-274(3),
290-292(3),
305-311(3)
- in /usr/src/new/PORT/B/src/bint/b2exp.c line
72,
542
- in /usr/src/new/PORT/B/src/bint/b2fix.c line
32,
203
- in /usr/src/new/PORT/B/src/bint/b2gen.c line
285,
294,
311-315(2),
329-345(5),
354,
367-382(5),
423,
432,
459,
489-493(6),
499-504(2),
512-515(2),
521-532(8),
543-547(3),
576,
591,
614
- in /usr/src/new/PORT/B/src/bint/b2stc.c line
69-93(45),
102-126(45),
325-328(2),
559-563(3),
687-691(2),
761(2)
- in /usr/src/new/PORT/B/src/bint/b2uni.c line
77-80(3),
120-123(3),
150-153(3),
201,
213-217(2),
225-231(3),
327
- in /usr/src/new/PORT/B/src/bint/b3int.c line
42
- in /usr/src/new/PORT/B/src/bint/b3sou.c line
254-259(3)
- in /usr/src/new/PORT/B/src/bint/b3sta.c line
435,
460,
511,
522-531(6)
CHECK
defined in line
37; used 2 times
DRAW
defined in line
34; used 2 times
DYAF
defined in line
80; used 8 times
ELSE
defined in line
50; used 2 times
defined in line
205;
never used
FAIL
defined in line
56; used 2 times
FOR
defined in line
46; used 2 times
defined in line
194;
never used
defined in line
145;
never used
defined in line
138;
never used
IF
defined in line
44; used 2 times
defined in line
187;
never used
MONF
defined in line
79; used 7 times
NOT
defined in line
94; used 2 times
NO_IN
defined in line
97; used 2 times
Nodetype
defined in line
13; used 17 times
- in /usr/src/new/PORT/B/src/bint/b1com.c line
22
- in /usr/src/new/PORT/B/src/bint/b2ana.c line
22,
94,
112
- in /usr/src/new/PORT/B/src/bint/b2gen.c line
176,
264,
330,
460,
539,
580,
595,
618
- in /usr/src/new/PORT/B/src/bint/b3int.c line
113,
122
- in /usr/src/new/PORT/B/src/bint/b3sou.c line
253,
280
- in /usr/src/new/PORT/B/src/bint/b3tra.c line
143
OR
defined in line
93; used 2 times
PUT
defined in line
30; used 2 times
QUIT
defined in line
52; used 2 times
READ
defined in line
41; used 2 times
defined in line
160;
never used
SHARE
defined in line
38; used 2 times
defined in line
197;
never used
SUITE
defined in line
29; used 8 times
defined in line
157;
never used
TAG
defined in line
63; used 16 times
TEST
defined in line
24; used 2 times
defined in line
201;
never used
Unit
defined in line
17; used 2 times
WHILE
defined in line
45; used 2 times
defined in line
190;
never used
WRITE
defined in line
40; used 2 times
YIELD
defined in line
23; used 3 times
Usage of this include