3 /* $XConsortium: context.dat /main/3 1995/07/17 19:52:49 lehors $ */
5 Copyright 1986 Tandem Computers Incorporated.
6 This product and information is proprietary of Tandem Computers Incorporated.
7 Copyright (c) 1986, 1987, 1988, 1989 Hewlett-Packard Co.
9 Context.dat defines the state transitions for program ELTDEF.
25 entval:typedec {enttype(M_SYSTEM) ;}
29 entval:typedec {enttype(M_STARTTAG) ;}
33 entval:typedec {enttype(M_ENDTAG) ;}
37 entval:typedec {enttype(M_MD) ;}
41 entval:piorsdata {enttype(M_PI) ;}
45 entval:piorsdata {enttype(M_SDATA) ;}
49 entval:typedec {enttype(M_CDATAENT) ;}
54 entity->wheredef = M_DELTDEF ;
55 enttype(entity->type == M_PI ? M_CODEPI : M_CODESDATA) ;
56 entity->codeindex = ++codeent ;
77 typedec:declitent {entclen = 0 ;}
81 entcontent[entclen] = M_EOS ;
83 (M_WCHAR *) m_malloc(entclen + 1, "entity content") ;
84 w_strcpy(entity->content, entcontent) ;
85 entity->wheredef = M_DELTDEF ;
92 typedec:declitaent {entclen = 0 ;}
96 entcontent[entclen] = M_EOS ;
98 (M_WCHAR *) m_malloc(entclen + 1, "entity content") ;
99 w_strcpy(entity->content, entcontent) ;
100 entity->wheredef = M_DELTDEF ;
145 start:insignon {restart = RSIGNON ;}
154 /* fprintf(globdef, "#line %d \"%s\"\n", m_line, iffile) ; */
159 /* fprintf(globdef, "#line %d \"%s\"\n", m_line, iffile) ; */
169 /* fprintf(globdec, "#line %d \"%s\"\n", m_line, iffile) ; */
173 /* fprintf(globdec, "#line %d \"%s\"\n", m_line, iffile) ; */
177 if (! signonend) endsignon() ;
179 /* fprintf(globdec, "#line %d \"%s\"\n", m_line, iffile) ; */
195 m_error("Multiple specification of global start string") ;
205 m_error("Multiple specification of global start string") ;
227 m_error("Multiple specification of global end string") ;
239 m_error("Multiple specification of global end string") ;
255 /* fprintf(stfile, "#line %d \"%s\"\n", m_line, iffile) ; */
264 m_error("Multiple specification of global string code") ;
272 m_error("Multiple specification of global string code") ;
273 /* fprintf(stfile, "#line %d \"%s\"\n", m_line, iffile) ; */
280 /* fprintf(stfile, "#line %d \"%s\"\n", m_line, iffile) ; */
288 /* fprintf(sfile, "#line %d \"%s\"\n", m_line, iffile) ; */
292 inies:inisc {endstring() ;}
300 /* fprintf(sfile, "#line %d \"%s\"\n", m_line, iffile) ; */
308 /* fprintf(efile, "#line %d \"%s\"\n", m_line, iffile) ; */
312 inies:iniec {endstring() ;}
320 /* fprintf(efile, "#line %d \"%s\"\n", m_line, iffile) ; */
328 /* fprintf(tfile, "#line %d \"%s\"\n", m_line, iffile) ; */
333 inies:initc {endstring() ;}
341 /* fprintf(tfile, "#line %d \"%s\"\n", m_line, iffile) ; */
350 /* fprintf(pfile, "#line %d \"%s\"\n", m_line, iffile) ; */
355 inies:inipc {endstring() ;}
363 /* fprintf(pfile, "#line %d \"%s\"\n", m_line, iffile) ; */
382 inipc:needn {endini() ;}
385 ines:needn {endstring() ;}
400 startcode(entity->codeindex, &inent, entfile,
401 "c", nopar, nopar, "") ;
405 *getaction(starray) = stringcnt ;
409 *getaction(etarray) = stringcnt ;
413 *getaction(pcarray) = ++pactions ;
414 startcode(pactions, &inpc, pfile, "p", pproto, pformal, pftype) ;
417 *getaction(tcarray) = ++tactions ;
418 startcode(tactions, &intext, tfile, "t", tproto, tformal,
422 *getaction(scarray) = ++sactions ;
423 startcode(sactions, &insc, sfile, "s", nopar, nopar, "") ;
426 *getaction(ecarray) = ++eactions ;
427 startcode(eactions, &inec, efile, "e", nopar, nopar, "") ;
430 *getaction(stcarray) = ++stactions ;
431 startcode(stactions, &instc, stfile, "st", stproto, stformal,
437 sschain:sschain {*getaction(starray) = stringcnt ;}
438 eschain:eschain {*getaction(etarray) = stringcnt ;}
439 pcchain:pcchain {*getaction(pcarray) = pactions + 1 ;}
440 tcchain:tcchain {*getaction(tcarray) = tactions + 1 ;}
441 scchain:scchain {*getaction(scarray) = sactions + 1 ;}
442 ecchain:ecchain {*getaction(ecarray) = eactions + 1 ;}
443 stcchain:stcchain {*getaction(stcarray) = stactions + 1 ;}
473 ines:sschain {endstring() ;}
486 inss:inelt {endstring() ;}
492 ines:eschain {endstring() ;}
505 ines:inelt {endstring() ;}
510 ines:scchain {endstring() ;}
524 ines:ecchain {endstring() ;}
538 ines:tcchain {endstring() ;}
555 ines:pcchain {endstring() ;}
568 ines:stcchain {endstring() ;}
590 inipc:finish {endini() ;}
601 *nextchain = (CHAIN *) m_malloc(sizeof(CHAIN), "chain") ;
602 (*nextchain)->elt = 1 ;
603 (*nextchain)->next = NULL ;
604 nextchain = &(*nextchain)->next ;
609 value:postvalue {value(literal) ;}
613 needn:close {startelement() ;}
614 inparam:cvar {storecvar() ;}
615 pname:postpname {storepname() ;}
616 invalue:cvalue {cvalue() ;}
617 value:postvalue {value(name) ;}
618 entdec:entval {addent() ;}
627 *nextchain = (CHAIN *) m_malloc(sizeof(CHAIN), "chain") ;
628 (*nextchain)->next = NULL ;
629 if ((*nextchain)->elt = m_packedlook(m_entree, name))
630 (*nextchain)->elt++ ;
632 m_err1("Undefined element: %s", name) ;
633 nextchain = &(*nextchain)->next ;
638 declitent:declitent {
639 if (entclen >= M_LITLEN) {
640 curcon = EDECLITENT ;
641 m_error("Entity content too long") ;
643 else entcontent[entclen++] = textchar ;
645 declitaent:declitaent {
646 if (entclen >= M_LITLEN) {
647 curcon = EDCLITAENT ;
648 m_error("Entity content too long") ;
650 else entcontent[entclen++] = textchar ;
652 edeclitent:edeclitent
653 edclitaent:edclitaent
655 socr = (LOGICAL) (textchar == '\n') ;
656 signonmsg[sochar++] = textchar ;
657 if (sochar >= SOCHAR) {
658 m_error("Exceeded buffer for sign-on message") ;
663 fprintf(globdef, "%c", textchar) ;
664 /* if (textchar == '\n') fprintf(globdef, "#line %d \"%s\"\n",
668 fprintf(globdec, "%c", textchar) ;
669 /* if (textchar == '\n') fprintf(globdec, "#line %d \"%s\"\n",
674 if (! stringstart) fprintf(string, ",\n") ;
675 fprintf(string, " %d", textchar) ;
676 stringstart = FALSE ;
681 if (! stringstart) fprintf(string, ",\n") ;
682 fprintf(string, " %d", textchar) ;
683 stringstart = FALSE ;
688 fprintf(sfile, "%c", textchar) ;
689 /* if (textchar == '\n') fprintf(sfile, "#line %d \"%s\"\n",
694 fprintf(efile, "%c", textchar) ;
695 /* if (textchar == '\n') fprintf(efile, "#line %d \"%s\"\n",
700 fprintf(tfile, "%c", textchar) ;
701 /* if (textchar == '\n') fprintf(tfile, "#line %d \"%s\"\n",
706 fprintf(pfile, "%c", textchar) ;
707 /* if (textchar == '\n') fprintf(pfile, "#line %d \"%s\"\n",
712 fprintf(stfile, "%c", textchar) ;
713 /* if (textchar == '\n') fprintf(stfile, "#line %d \"%s\"\n",
717 fprintf(entfile, "%c", textchar) ;
718 /* if (textchar == '\n') fprintf(entfile, "#line %d \"%s\"\n",