%{ #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 #include #include #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 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); }