date and time created 81/03/02 21:28:17 by peter
authorPeter B. Kessler <peter@ucbvax.Berkeley.EDU>
Tue, 3 Mar 1981 13:28:17 +0000 (05:28 -0800)
committerPeter B. Kessler <peter@ucbvax.Berkeley.EDU>
Tue, 3 Mar 1981 13:28:17 +0000 (05:28 -0800)
SCCS-vsn: usr.bin/pascal/pxp/lab.c 1.1

usr/src/usr.bin/pascal/pxp/lab.c [new file with mode: 0644]

diff --git a/usr/src/usr.bin/pascal/pxp/lab.c b/usr/src/usr.bin/pascal/pxp/lab.c
new file mode 100644 (file)
index 0000000..6f8bf99
--- /dev/null
@@ -0,0 +1,72 @@
+static char *sccsid = "@(#)lab.c       1.1 (Berkeley) %G%";
+/* Copyright (c) 1979 Regents of the University of California */
+#
+/*
+ * pxp - Pascal execution profiler
+ *
+ * Bill Joy UCB
+ * Version 1.2 January 1979
+ */
+
+#include "0.h"
+
+/*
+ * Label declaration part
+ */
+label(r, l)
+       int *r, l;
+{
+       register *ll;
+
+       if (nodecl)
+               printoff();
+       puthedr();
+       setline(l);
+       ppnl();
+       indent();
+       ppkw("label");
+       ppgoin(DECL);
+       ppnl();
+       indent();
+       ppbra(NIL);
+       ll = r;
+       if (ll != NIL)
+               for (;;) {
+                       pplab(ll[1]);
+                       ll = ll[2];
+                       if (ll == NIL)
+                               break;
+                       ppsep(", ");
+               }
+       else
+               ppid("{label list}");
+       ppket(";");
+       putcml();
+       ppgoout(DECL);
+}
+
+/*
+ * Goto statement
+ */
+gotoop(s)
+       char *s;
+{
+
+       gocnt++;
+       ppkw("goto");
+       ppspac();
+       pplab(s);
+}
+
+/*
+ * A label on a statement
+ */
+labeled(s)
+       char *s;
+{
+
+       linopr();
+       indentlab();
+       pplab(s);
+       ppsep(":");
+}