home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / misc / compsci / arcsgm.cpt / ARC SGML 1.0 / sgmlc / modsgml1.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-12-17  |  20.7 KB  |  442 lines

  1. #ifdef applec
  2. #pragma segment SegB
  3. #endif
  4. /******************************************************************************/
  5. /* Deleted idcan, entref, and entdef services (prohibited by standard).       */
  6. /* Removed obsolete declarations of iolpu and ielpu.                          */
  7. /******************************************************************************/
  8. #include "sgmlincl.h"         /* #INCLUDE statements for SGML parser. */
  9. /******************************************************************************/
  10. #define ETDCON (tags[ts].tetd->etdmod->ttype)     /* ETD content flags. */
  11. #define PUTRCB(ptr) *tprcbp = (UNIV)ptr           /* Set RCB pointer. */
  12. #define PUTRC *tprc = rc                          /* Set return code. */
  13. /******************************************************************************/
  14. /* SGML: Main SGML driver routine.
  15. */
  16. /* global */ VOID sgml(
  17. struct ipbt *ipbl)            /* IPB: SGML services (or NULL). */
  18. {
  19.      unsigned swact;          /* Switch action: saved conact, new, or sgmlact.*/
  20.  
  21.      if (ipbl) {
  22.           sgmlserv(ipbl);     /* If non-NULL ptr, go do services. */
  23.           return;
  24.      }
  25.      if (prologsw) {
  26.           conact = parsepro(tbuf);
  27.           conactsw = 0;       /* Assume SGMLACT will not be skipped. */
  28.           switch(conact) {
  29.  
  30.           case PIS_:
  31.           case EOD_:
  32.                conactsw = 1;   /* We can skip sgmlact in opening state. */
  33.                break;
  34.  
  35.           case DAF_:
  36.                newetd = stagreal = ETDCDATA;
  37.                conact = stag(datarc = DAF_);
  38.                conactsw = 1;   /* We can skip sgmlact in opening state. */
  39.                prologsw = 0;   /* End the prolog. */
  40.                break;
  41.  
  42.           default:             /* DCE_ PEP_: not defined in SGMLACT.H. */
  43.                if (msplevel==0) conpcb = getpcb((int)ETDCON);
  44.           case MSS_:
  45.                prologsw = 0;   /* End the prolog. */
  46.           case DTD_:
  47.                break;
  48.           }
  49.           if (!prologsw || newdtdsw) {  /* Prolog start or end; return DTD. */
  50.                newdtdsw = 0;            /* No longer the prolog start. */
  51.                rcbdaf.rcbtype = prologsw ? SGMLSDTD : SGMLEDTD;
  52.                rcbdaf.contersw = ds.srcnt; /* >0=SHORTREF maps in use. */
  53.                rcbdaf.datalen = *dtype;
  54.                rcbdaf.data = dtype;
  55.                rcbdaf.sgmles = es;      /* Current level in scb stack. */
  56.                scbset();                /* Update location in current scb. */
  57.                PUTRCB(&rcbdaf); return;
  58.           }
  59.      }
  60. /*lint -e716*/
  61.      while (1) {
  62. /*lint +e716*/
  63.           if (conactsw) {conactsw = 0; swact = conact; contersw = contersv;}
  64.           else swact =
  65.                sgmlact((UNCH)((conact = parsecon(tbuf, lbuf, conpcb))!=EOD_
  66.                                  ? conact : LOP_));
  67.  
  68.           switch (swact) {
  69.  
  70.           case MD_:           /* Process markup declaration. */
  71.                parsenm(tbuf, NAMECASE); /* Get declaration name. */
  72.                if (!strcmp((char *)tbuf+1, (char *)syn.k.usemap)) {
  73.                     mdsrmuse(tbuf);
  74. #ifndef NOTVM
  75.                     rcbdaf.rcbtype = SGMLMV;
  76.                     rcbdaf.data = tags[ts].tsrm!=SRMNULL
  77.                                   ? tags[ts].tsrm[0]->ename : 0;
  78.                     rcbdaf.datalen = *rcbdaf.data;
  79.                     rcbdaf.sgmles = es;    /* Current level in scb stack. */
  80.                     scbset();              /* Update location in current scb. */
  81.                     PUTRCB(&rcbdaf); return;
  82. #endif
  83.                }
  84.                else sgmlerr(_MDNAME, conpcb, tbuf+1, NULL);
  85.                continue;
  86.           case MDC_:           /* Process markup declaration comment. */
  87.                if (*FPOS!=lex.d.mdc)
  88.                     parsemd(tbuf, NAMECASE, (struct parse *)0, NAMELEN);
  89.                continue;
  90.  
  91.           case MSS_:           /* Process marked section start. */
  92.                conpcb = mdms(tbuf, conpcb);
  93.                continue;
  94.           case MSE_:           /* Process marked section end (drop to LOP_). */
  95.                if (mdmse()) conpcb = getpcb((int)ETDCON);
  96.                continue;
  97.  
  98.           case PIS_:           /* Return processing instruction (string). */
  99.                rcbdaf.rcbtype = SGMLPIS;
  100.                if (entpisw) rcbdaf.data = data;
  101.                else {
  102.                     parselit(tbuf, &pcblitc, PILEN, lex.d.pic);
  103.                     rcbdaf.data = tbuf+1;
  104.                }
  105.                rcbdaf.datalen = datalen;
  106.                rcbdaf.contersw = entpisw;
  107.                                  entpisw = 0;        /* Reset for next time.*/
  108.                rcbdaf.sgmles = es;      /* Current level in scb stack. */
  109.                scbset();                /* Update location in current scb. */
  110.                PUTRCB(&rcbdaf); return;
  111.  
  112.           case ETG_:               /* Return end-tag. */
  113.                charmode = 0;       /* Not in char mode unless CDATA or RCDATA.*/
  114.                if (msplevel==0) conpcb = getpcb((int)ETDCON);
  115.                if (!tags[ts+1].tetd->etdetag && sw.swetdtag) continue;
  116.                rcbetag.contersw = tags[ts+1].tflags;
  117.                rcbetag.tagmin = etagimsw ? MINETAG : etagmin;
  118.                memcpy(rcbetag.curgi, tags[ts+1].tetd->etdgi, (size_t)(NAMELEN+2));
  119.                rcbetag.gidata = tags[ts+1].tetd->etdetag;
  120.                rcbetag.ru.oldgi = tags[ts].tetd->etdgi;
  121.                if (etagmin==MINSTAG) rcbetag.tagreal =
  122.                      stagreal<MINPTR ? stagreal : (PETD)stagreal->etdgi;
  123.                else rcbetag.tagreal =
  124.                      etagreal<MINPTR ? etagreal : (PETD)etagreal->etdgi;
  125. #ifdef V2
  126.                rcbetag.format = chainsaw(tags[ts+1].tetd->etdmod->ttype);
  127. #endif
  128.                rcbetag.etictr = etictr;
  129.                rcbetag.srmnm = tags[ts].tsrm!=SRMNULL ? tags[ts].tsrm[0]->ename
  130.                                                       : 0;
  131.                rcbetag.sgmles = es;     /* Current level in scb stack. */
  132.                scbset();                /* Update location in current scb. */
  133.                PUTRCB(&rcbetag); return;
  134.  
  135.           case STG_:               /* Return start-tag. */
  136.                charmode = 0;       /* Not in char mode unless CDATA or RCDATA.*/
  137.                if (!conrefsw && msplevel==0) conpcb = getpcb((int)ETDCON);
  138.                if (!tags[ts].tetd->etdstag && sw.swetdtag) continue;
  139.                rcbstag.contersw = tags[ts].tflags;
  140.                rcbstag.tagmin = dostag ? MINSTAG : stagmin;
  141.                memcpy(rcbstag.curgi, tags[ts].tetd->etdgi, (size_t)(NAMELEN+2));
  142.                rcbstag.gidata = tags[ts].tetd->etdstag;
  143.                /* Get attribute list if one was defined for this element. */
  144.                rcbstag.ru.al = !tags[ts].tetd->adl ? 0 :
  145.                     rcbstag.tagmin==MINNONE  ? al : tags[ts].tetd->adl;
  146.                rcbstag.idrefl = idrefl;
  147.                rcbstag.aentl = aentl;
  148.                rcbstag.tagreal = stagreal<MINPTR?stagreal:(PETD)stagreal->etdgi;
  149. #ifdef V2
  150.                rcbstag.format = chainsaw(tags[ts].tetd->etdmod->ttype);
  151. #endif
  152.                rcbstag.etictr = etictr;
  153.                rcbstag.srmnm = tags[ts].tsrm!=SRMNULL ? tags[ts].tsrm[0]->ename
  154.                                                       : 0;
  155.                rcbstag.sgmles = es;     /* Current level in scb stack. */
  156.                scbset();                /* Update location in current scb. */
  157.                PUTRCB(&rcbstag); return;
  158.  
  159.           case DAF_:               /* Return data in source entity buffer. */
  160.                charmode = 1;
  161.                rcbdaf.rcbtype = SGMLDAF;
  162.                rcbdaf.datalen = datalen;
  163.                rcbdaf.data = data;
  164.                rcbdaf.contersw = contersw | entdatsw;
  165.                                contersw = entdatsw = 0;/* Reset for next time.*/
  166.                rcbdaf.sgmles = es;      /* Current level in scb stack. */
  167.                scbset();                /* Update location in current scb. */
  168.                PUTRCB(&rcbdaf); return;
  169.  
  170.           case CON_:               /* Process conact after returning REF_. */
  171.                conactsw = 1;
  172.                contersv = contersw;
  173.           case REF_:               /* Return RE found. */
  174.                if (badresw) {
  175.                     badresw = 0;
  176.                     sgmlerr(_CHARS, &pcbconm, tags[ts].tetd->etdgi+1, NULL);
  177.                     continue;
  178.                }
  179.                charmode = 1;
  180.                rcbdaf.rcbtype = SGMLREF;
  181.                rcbdaf.contersw = contersw;
  182.                                  contersw = 0;        /* Reset for next time.*/
  183.                rcbdaf.sgmles = es;      /* Current level in scb stack. */
  184.                scbset();                /* Update location in current scb. */
  185.                PUTRCB(&rcbdaf); return;
  186.  
  187.           case EOD_:               /* End of source document entity. */
  188.                if (mslevel != 0) sgmlerr(139, conpcb, NULL, NULL);
  189.                rcbdaf.rcbtype = SGMLEOD;
  190.                rcbdaf.sgmles = es;      /* Current level in scb stack. */
  191.                scbset();                /* Update location in current scb. */
  192.                PUTRCB(&rcbdaf); return;
  193.  
  194.           default:             /* LOP_: Loop again with no action. */
  195.                continue;
  196.           }
  197.      }
  198. }
  199. /******************************************************************************/
  200. /* PCBSGML: State and action table for action codes returned to text processor
  201.             by SGML.C.  It causes a REF_ to be handled as follows:
  202.             ST1: Ignore first REF_ of content if no DAF, ETG, or RS intervenes.
  203.             NR1: Process REF_ if it is a REF-only record (null record).
  204.             DA1: Save REF_ if record contains data.
  205.             NR2: (REF_ pending) Process REF_ if it is a null record.
  206.             ST2: (REF_ pending) Ignore REF_ if no MD_, PIS_, or DAF_ intervenes.
  207.             Columns are based on SGMLACT.H values minus DAF_, except that end
  208.             of document has input code LOP_, regardless of its action code.
  209. */
  210. /* Symbols for state names (end with a number). */
  211. #define ST1     0   /* Trailing STG_ or markup record: ignore REF_. */
  212. #define NR1     2   /* New record: return immediate REF_. */
  213. #define DA1     4   /* Data or element found: save REF_. */
  214. #define NR2     6   /* New record with REF_ pending: return immediate REF_. */
  215. #define ST2     8   /* REF_ pending; return it and conact except ETG EOD. */
  216.  
  217. static UNCH sgmltab[10][12] = {
  218. /*daf_ etg_ md_  mdc_ mss_ mse_ pis_ ref_ stg_ etgp_rsr_ eod  */
  219.   DA1 ,DA1 ,ST1 ,ST1 ,ST1 ,ST1 ,ST1 ,NR1 ,ST1 ,ST1 ,NR1 ,ST1 ,/*st1*/
  220.   DAF_,ETG_,MD_ ,MDC_,MSS_,MSE_,PIS_,LOP_,STG_,ETG_,LOP_,EOD_,
  221.  
  222.   DA1 ,DA1 ,ST1 ,ST1 ,ST1 ,ST1 ,ST1 ,NR1 ,ST1 ,DA1 ,NR1 ,ST1 ,/*nr1*/
  223.   DAF_,ETG_,MD_ ,MDC_,MSS_,MSE_,PIS_,REF_,STG_,ETG_,LOP_,EOD_,
  224.  
  225.   DA1 ,DA1 ,DA1 ,DA1 ,DA1 ,DA1 ,DA1 ,NR2 ,ST1 ,DA1 ,NR1 ,ST1 ,/*da1*/
  226.   DAF_,ETG_,MD_ ,MDC_,MSS_,MSE_,PIS_,LOP_,STG_,ETG_,LOP_,EOD_,
  227.  
  228.   DA1 ,DA1 ,ST2 ,ST2 ,ST2 ,ST2 ,ST2 ,NR2 ,ST1 ,ST2 ,NR2 ,ST1 ,/*nr2*/
  229.   CON_,ETG_,MD_ ,MDC_,MSS_,MSE_,PIS_,REF_,CON_,ETG_,LOP_,EOD_,
  230.  
  231.   DA1 ,DA1 ,ST2 ,ST2 ,ST2 ,ST2 ,ST2 ,NR2 ,ST1 ,ST2 ,NR2 ,ST1 ,/*st2*/
  232.   CON_,ETG_,MD_ ,MDC_,MSS_,MSE_,PIS_,LOP_,CON_,ETG_,LOP_,EOD_
  233. };
  234. int scbsgmst = ST1;           /* SCBSGML: trailing stag or markup; ignore RE. */
  235. int scbsgmnr = NR1;           /* SCBSGML: new record; do not ignore RE. */
  236. /******************************************************************************/
  237. /* SGMLACT: Determine action to be taken by SGML.C based on current state and
  238.             specified input.
  239.             For start or end of a plus exception element, push or pop the
  240.             pcbsgml stack.
  241.             Return to caller with action code.
  242. */
  243. int sgmlact(
  244. UNCH conret)                  /* Action returned to SGML.C by content parse. */
  245. {
  246.  
  247.      if (conret==STG_ && GET(tags[ts].tflags, TAGPEX))
  248.           {++pss; scbsgml[pss].snext = ST1;}
  249.      scbsgml[pss].sstate = scbsgml[pss].snext;
  250.      scbsgml[pss].snext = sgmltab[scbsgml[pss].sstate]
  251.                                     [scbsgml[pss].sinput = conret-DAF_];
  252.      scbsgml[pss].saction = sgmltab[scbsgml[pss].sstate+1][scbsgml[pss].sinput];
  253. #ifndef FINAL
  254.      if (trace) tracegml(scbsgml, pss, conactsw, conact);
  255. #endif
  256.      return (int)scbsgml[(conret==ETG_ && GET(tags[ts+1].tflags, TAGPEX)) ?
  257.                          pss-- : pss].saction;
  258. }
  259. /******************************************************************************/
  260. #undef ST1
  261. #undef NR1
  262. #undef DA1
  263. #undef NR2
  264. #undef ST2
  265. /******************************************************************************/
  266. /* GETPCB: Choose pcb for new or resumed element.
  267. */
  268. struct parse *getpcb(
  269. int etdcon)                   /* Content type of new or resumed element. */
  270. {
  271.      if (BITON(etdcon, MGI)) {
  272.           return(BITON(etdcon, MCHARS) ? &pcbconm : &pcbcone);
  273.      }
  274.      if (BITON(etdcon, MCDATA) || BITON(etdcon, MRCDATA)) {
  275.          charmode = 1;
  276.          return(BITON(etdcon, MCDATA) ? &pcbconc : (rcessv = es, &pcbconr));
  277.      }
  278.      return(&pcbconm);
  279. }
  280. /******************************************************************************/
  281. #ifdef V2
  282. /* CHAINSAW: Set format class based on Goldfarb convention.
  283. */
  284. int chainsaw(
  285. int mtype)                    /* Model type byte. */
  286. {
  287.      if (GET(mtype, MPHRASE)) return FORMATP;
  288.      if (GET(mtype, MGI) && !GET(mtype, MCHARS)) return FORMATS;
  289.      if (mtype==MNDATA) return FORMATN;
  290.      return FORMATB;
  291. }
  292. #endif
  293. /******************************************************************************/
  294. /* SGMLSERV: Main interface to SGML services.
  295. */
  296. VOID sgmlserv(
  297. struct ipbt *ipb)             /* Caller's IPB: SGML services. */
  298. {
  299.      struct ipbt it;          /* Our copy of caller's IPB. */
  300.      struct etd *p;           /* Pointer to an etd. */
  301.      UNCH iname[NAMELEN+2];   /* Buffer for names moved from IPB. */
  302.      int rc;                  /* Save area for return codes. */
  303.      PECB ep;                 /* Pointer to an entity control block. */
  304.  
  305.      memcpy((UNIV)&it, (UNIV)ipb, (size_t)sizeof(it));
  306.      memcpy(iname, it.itnm, (size_t)sizeof(iname));
  307.      switch (it.ipbtype) {
  308.  
  309.      case SGMLSET:            /* SGML: set up run (returns delims, DS).*/
  310.           /* Initialize variables based on switches structure members. */
  311.           memcpy((UNIV)&sw, (UNIV)it.itp1, (size_t)sizeof(struct switches));
  312.           tprc = sw.src;                /* Save addr to return rc. */
  313.           tprcbp = sw.srcbp;            /* Save addr to return rcb ptr. */
  314.           nonchbuf[0] = sw.delnonch;    /* Prefix delimiter for non-SGML char.*/
  315.           rbuf = rmalloc((UNS)RCCBUFSZ+sw.swbufsz); /* DOS file read area. */
  316.           rbufs = rbuf+RCCBUFSZ;        /* DOS read area: start read position.*/
  317.           /* Initialize lexical tables for non-SGML char prefix delimiter. */
  318.           lexcnm[sw.delnonch] =
  319.                lexcon[sw.delnonch] = lexlms[sw.delnonch] = lex.l.lmnsc;
  320.           /* Initialize IPBERR and RCBs with SGML entity stack address. */
  321.           ie.sgmlscbs = rcbdaf.sgmlscbs = rcbetag.sgmlscbs =
  322.                rcbstag.sgmlscbs = scbs;
  323. #ifndef FINAL
  324.           tracepro();         /* Set trace switches for prolog. */
  325. #endif
  326.           PUTRCB(&lex.m);
  327.           return;
  328.      case SGMLRSET:           /* SGML: set up for each pass. */
  329.           /* Parser pass number has origin of 0; no setup for 1st (0) pass. */
  330.           if ((pass = (int)it.itl1-1)>0) sgmlrset();
  331.           return;
  332.      case SGMLEND:            /* SGML: clean up after entire run. */
  333.           for (; es>0; --es) if (FILESW) fileclos();    /* was >= WMW */
  334.           rcbdaf.data = (STRING)&ds;
  335.           ds.capused = (long)((ds.dcncnt+ds.pmexgcnt+ds.etdcnt+ds.etdercnt+
  336.                         ds.pmexcnt+ds.modcnt+ds.attcnt+ds.attgcnt+
  337.                         ds.idcnt+ds.idrcnt+ds.ecbcnt)*NAMELEN +
  338.                         ds.attdef+ds.ecbtext+ds.dcntext +
  339.                         ds.srcnt*NAMELEN*(lex.s.dtb[0].mapdata+1));
  340.           ds.capacity = CAPACITY;
  341.           PUTRCB(&ds); return;
  342.      case ENTGET:             /* Entity: get text if data entity. */
  343.           if ((ep = entfind(iname))!=0) {
  344.                rc = -2;       /* Assume not a data entity. */
  345.                if (ep->estore==ESN) {
  346.                     rc = 1;   /* NDATA entity. */
  347.                     it.itp1 = (UNIV)ep->etx.n;
  348.                }
  349.                else if (ep->estore==ESC)
  350.                     rc = 2;   /* CDATA entity. */
  351.                else if (ep->estore==ESX)
  352.                     rc = 3;   /* SDATA entity. */
  353.                if (rc>1) it.itp1 = ep->etx.c;
  354.                if (rc>0)      /* Copy control block for a data entity. */
  355.                     memcpy((UNIV)ipb, (UNIV)&it, (size_t)sizeof(it));
  356.           }
  357.           else rc = -1;
  358.           PUTRC; return;
  359.      case ENTPRIME:           /* Entity: define and reference primary entity. */
  360.           rc = entopen(xentdef(indocent, it.itl1, it.itp1));
  361.           PUTRC; return;
  362.      case GISET:              /* GI: associate start- & end-tag ptrs with GI.*/
  363.           if ((p = etdref(iname))!=0) {
  364.             p->etdstag = it.itp1;
  365.             p->etdetag = it.itp2;
  366.           }
  367.           rc = !p;
  368.           PUTRC; return;
  369.      case GIGET:              /* GI: retrieve start- and end-tag ptrs for GI. */
  370.           if ((p = etdref(iname))!=0) {
  371.                it.itp1 = p->etdstag;
  372.                it.itp2 = p->etdetag;
  373.                memcpy((UNIV)ipb, (UNIV)&it, (size_t)sizeof(it));
  374.           }
  375.           rc = !p;
  376.           PUTRC; return;
  377.      }
  378. }
  379. /******************************************************************************/
  380. /* XENTDEF: Define an entity for a system identifier.
  381. */
  382. struct entity *xentdef(
  383. UNCH *ename,                  /* Entity name. */
  384. UNS len,                      /* Length of system identifier. */
  385. UNCH *etext)                  /* System identifier. */
  386. {
  387.      struct fpi f;            /* Formal public identifier structure. */
  388.      union etext etx;         /* Ptr to entity text. */
  389.  
  390.      memset((UNIV)&f, 0, (size_t)FPISZ);                       /* Initialize fpi.*/
  391.      memcpy(f.fpinm, ename, (size_t)(f.fpinml = (UNCH)*ename));     /* Store name. */
  392.      memcpy(f.fpisysis, etext, (size_t)(f.fpisysl = (UNCH)len));    /* Store sys ID. */
  393.      f.fpistore = 2;                                        /* Type: general. */
  394.      etx.x = entgen(&f);                                    /* Get SGMLIO nm. */
  395.      return(entdef(indocent, ESF, &etx));                   /* Store it. */
  396. }
  397. /******************************************************************************/
  398. /* SGMLRSET: Initialization for start of pass.
  399. */
  400. VOID sgmlrset(void)
  401. {
  402.      for (; es>=0; --es) if (FILESW) fileclos();
  403.      badresw = 0;             /* 1=REF_ out of context; 0=valid. */
  404.      charmode = 0;            /* >0=in #CHARS; 0=not. */
  405.      conactsw = 0;            /* No saved content parse action. */
  406.      conrefsw = 0;            /* 1=content reference att or empty; 0=no. */
  407.      contersv = 0;            /* Save contersw if next action is in hand. */
  408.      contersw = 0;            /* 1=element or #CHARS out of context; 0=valid. */
  409.      datarc = 0;              /* Return code for data: DAF_ or REF_. */
  410.      delmscsw = 0;            /* 1=DELMSC must be inserted in read buffer. */
  411.      didreq = 0;              /* 1=required implied tag processed; 0=no. */
  412.      dostag = 0;              /* 1=retry newetd instead of parsing; 0=parse. */
  413.      dtdsw = 0;               /* DOCTYPE declaration found: 1=yes; 0=no. */
  414.      entdatsw = 0;            /* 2=CDATA entity; 4=SDATA; 8=NDATA; 0=none. */
  415.      entpisw = 0;             /* 4=PI entity occurred; 0=not. */
  416.      eodsw = 0;               /* 1=eod found in error; 0=not yet. */
  417.      eofsw = 0;               /* EOF not yet found in document body. */
  418.      etagimct = 0;            /* Implicitly ended elements left on stack. */
  419.      etagimsw = 0;            /* 1=end-tag implied by other end-tag; 0=not. */
  420.      etagmin = MINNONE;       /* Minim: NONE NULL NET DATA; implied by S/ETAG*/
  421.      etictr = 0;              /* Number of "NET enabled" tags on stack. */
  422.      etisw = 0;               /* 1=tag ended with eti; 0=did not. */
  423.      indtdsw = 0;             /* Are we in the DTD? 1=yes; 0=no. */
  424.      mslevel = 0;             /* Nesting level of marked sections. */
  425.      msplevel = 0;            /* Nested MS levels subject to special parse. */
  426.      newdtdsw = 0;            /* 1=DTD just started; 0=DTD returned to TP. */
  427.      prologsw = 1;            /* Start parsing with prolog. */
  428.      propcb = &pcbpro;        /* Start with normal prolog PCB. */
  429.      pss = 0;                 /* SGMLACT pcb stack level. */
  430.      sgmlsw = 0;              /* SGML declaration found: 1=yes; 0=no. */
  431.      stagmin = MINNONE;       /* Minimization: NONE, NULL tag, implied by STAG*/
  432.      tagctr = 0;              /* No start-tag chars counted yet. */
  433.      ts = -1;                 /* Index of current tag in stack. */
  434.      nextetd = 0;             /* ETD that must come next (only one choice). */
  435.      return;
  436. }
  437. /******************************************************************************/
  438. #undef ETDCON
  439. #undef PUTRCB
  440. #undef PUTRC
  441. /******************************************************************************/
  442.