xref: /original-bsd/usr.bin/pascal/pxp/call.c (revision 2301fdfb)
1 /*
2  * Copyright (c) 1980 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  */
6 
7 #ifndef lint
8 static char sccsid[] = "@(#)call.c	5.1 (Berkeley) 06/05/85";
9 #endif not lint
10 
11 #
12 /*
13  * pxp - Pascal execution profiler
14  *
15  * Bill Joy UCB
16  * Version 1.2 January 1979
17  */
18 
19 #include "0.h"
20 #include "tree.h"
21 
22 /*
23  * Procedure or function call
24  */
25 call(p, argv)
26 	register int *argv;
27 {
28 	register *al;
29 
30 	ppid(p);
31 	if (argv != NIL) {
32 		ppbra("(("+1);	/* xaproposstrange
33  */
34 		for (;;) {
35 			al = argv[1];
36 			if (al[0] == T_WEXP) {
37 				rvalue(al[1], NIL);
38 				if (al[2] != NIL) {
39 					ppsep(": ");
40 					rvalue(al[2], NIL);
41 				}
42 				if (al[3] == OCT || al[3] == HEX) {
43 					ppspac();
44 					ppkw(al[3] == OCT ? "oct" : "hex");
45 				} else if (al[3] != NIL) {
46 					ppsep(": ");
47 					rvalue(al[3], NIL);
48 				}
49 			} else
50 				rvalue(argv[1], NIL);
51 			argv = argv[2];
52 			if (argv == NIL)
53 				break;
54 			ppsep(", ");
55 		}
56 		ppket(")");
57 	}
58 }
59