summaryrefslogtreecommitdiff
path: root/dviware/quicspool/libqmsquery/qmspfp.y
diff options
context:
space:
mode:
Diffstat (limited to 'dviware/quicspool/libqmsquery/qmspfp.y')
-rw-r--r--dviware/quicspool/libqmsquery/qmspfp.y75
1 files changed, 75 insertions, 0 deletions
diff --git a/dviware/quicspool/libqmsquery/qmspfp.y b/dviware/quicspool/libqmsquery/qmspfp.y
new file mode 100644
index 0000000000..7deba078e2
--- /dev/null
+++ b/dviware/quicspool/libqmsquery/qmspfp.y
@@ -0,0 +1,75 @@
+%{
+#ifndef lint
+static char *rcs = "$Header: qmspfp.y,v 1.1 88/01/15 12:19:26 simpson Rel $";
+#endif
+/*
+$Log: qmspfp.y,v $
+ * Revision 1.1 88/01/15 12:19:26 simpson
+ * initial release
+ *
+ * Revision 0.1 87/12/11 17:12:09 simpson
+ * beta test
+ *
+*/
+#include <stdio.h>
+#include <setjmp.h>
+#include <local/standard.h>
+#include "qms.h"
+
+extern FILE *_Ifp, *_Ofp;
+extern Boolean _FirstChar;
+static jmp_buf Env;
+char *malloc();
+static struct qmspfp *PfpList, *P;
+%}
+%token PFP NONE ENDLINE
+%token <s> STRING
+%union {
+ char s[81];
+}
+%%
+pfplines : pfplines pfpline | pfpline ;
+
+pfpline : PFP module ENDLINE ;
+
+module :
+ NONE
+ {
+ PfpList = NULL;
+ }
+ |
+ STRING
+ {
+ P = (struct qmspfp *)malloc((unsigned)sizeof(struct qmspfp));
+ P->next = PfpList, PfpList = P;
+ (void)strcpy(P->module = malloc((unsigned)(strlen($1) + 1)), $1);
+ }
+ ;
+%%
+#include "qmspfplex.c"
+
+struct qmspfp *qmspfp()
+{
+ _FirstChar = TRUE;
+ PfpList = NULL;
+ fputs(QUICON, _Ofp);
+ fprintf(_Ofp, "%s00000", SYNTAX);
+ fprintf(_Ofp, "%sPFP%s", INFO, ENDCMD);
+ fputs(QUICOFF, _Ofp);
+ (void)fflush(_Ofp);
+ if (setjmp(Env)) {
+ while (timedgetc(_Ifp) != EOF) /* Discard remaining input */
+ ;
+ return NULL;
+ }
+ if (yyparse() != 0)
+ return NULL;
+ yysptr = yysbuf; /* Resets lex lookahead buffer */
+ return PfpList;
+}
+
+static yyerror(s)
+char *s;
+{
+ longjmp(Env, TRUE);
+}