| 1 | /* Copyright (c) 1979 Regents of the University of California */ |
| 2 | # |
| 3 | /* |
| 4 | * pxp - Pascal execution profiler |
| 5 | * |
| 6 | * Bill Joy UCB |
| 7 | * Version 1.2 January 1979 |
| 8 | */ |
| 9 | |
| 10 | #include "0.h" |
| 11 | |
| 12 | /* |
| 13 | * Label declaration part |
| 14 | */ |
| 15 | label(r, l) |
| 16 | int *r, l; |
| 17 | { |
| 18 | register *ll; |
| 19 | |
| 20 | if (nodecl) |
| 21 | printoff(); |
| 22 | puthedr(); |
| 23 | setline(l); |
| 24 | ppnl(); |
| 25 | indent(); |
| 26 | ppkw("label"); |
| 27 | ppgoin(DECL); |
| 28 | ppnl(); |
| 29 | indent(); |
| 30 | ppbra(NIL); |
| 31 | ll = r; |
| 32 | if (ll != NIL) |
| 33 | for (;;) { |
| 34 | pplab(ll[1]); |
| 35 | ll = ll[2]; |
| 36 | if (ll == NIL) |
| 37 | break; |
| 38 | ppsep(", "); |
| 39 | } |
| 40 | else |
| 41 | ppid("{label list}"); |
| 42 | ppket(";"); |
| 43 | putcml(); |
| 44 | ppgoout(DECL); |
| 45 | } |
| 46 | |
| 47 | /* |
| 48 | * Goto statement |
| 49 | */ |
| 50 | gotoop(s) |
| 51 | char *s; |
| 52 | { |
| 53 | |
| 54 | gocnt++; |
| 55 | ppkw("goto"); |
| 56 | ppspac(); |
| 57 | pplab(s); |
| 58 | } |
| 59 | |
| 60 | /* |
| 61 | * A label on a statement |
| 62 | */ |
| 63 | labeled(s) |
| 64 | char *s; |
| 65 | { |
| 66 | |
| 67 | linopr(); |
| 68 | indentlab(); |
| 69 | pplab(s); |
| 70 | ppsep(":"); |
| 71 | } |