date and time created 80/08/27 19:57:34 by peter
authorPeter B. Kessler <peter@ucbvax.Berkeley.EDU>
Thu, 28 Aug 1980 10:57:34 +0000 (02:57 -0800)
committerPeter B. Kessler <peter@ucbvax.Berkeley.EDU>
Thu, 28 Aug 1980 10:57:34 +0000 (02:57 -0800)
SCCS-vsn: usr.bin/pascal/src/yyseman.c 1.1

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

diff --git a/usr/src/usr.bin/pascal/src/yyseman.c b/usr/src/usr.bin/pascal/src/yyseman.c
new file mode 100644 (file)
index 0000000..92e9cd7
--- /dev/null
@@ -0,0 +1,36 @@
+/* Copyright (c) 1979 Regents of the University of California */
+
+static char sccsid[] = "@(#)yyseman.c 1.1 %G%";
+
+#include "whoami.h"
+#include "0.h"
+#include "yy.h"
+
+/*
+ * Assign semantics to a generated token
+ *
+ * Most terminals have a semantic value the current
+ * input line.  If they are generated they are flagged
+ * by having this number negated.
+ *
+ * The terminals which have true semantics such
+ * as identifiers and strings are instead given
+ * semantic value NIL here - we do not attempt
+ * to do repair, e.g. by giving generated integers
+ * the value 1, etc.
+ */
+nullsem(ch)
+       int ch;
+{
+
+       switch (ch) {
+               case YID:
+               case YINT:
+               case YNUMB:
+               case YBINT:
+               case YSTRING:
+                       return (NIL);
+               default:
+                       return (-yyeline);
+       }
+}