1 /* $XConsortium: parutil.c /main/3 1995/11/08 10:23:54 rswiston $ */
3 Copyright 1986 Tandem Computers Incorporated.
4 This product and information is proprietary of Tandem Computers Incorporated.
5 Copyright 1986, 1987, 1988, 1989 Hewlett-Packard Co.
8 /* Parutil.c contains utility functions for program PARSER */
28 /* Adjust parsing state after each token if necessary */
29 void m_adjuststate(M_NOPAR)
31 if (m_curcon == START) {
33 if (m_stacktop->intext) m_curcon = NETCDATA ;
34 else if (m_textpermitted()) m_curcon = NETDATACON ;
35 else m_curcon = NETELCON ;
38 if (m_stacktop->intext) m_curcon = POUNDCDATA ;
39 else if (m_textpermitted()) m_curcon = DATACON ;
40 else m_curcon = ELCON ;
43 else if (m_netlevel) switch(m_curcon) {
48 if (m_stacktop->neednet) m_curcon = NETELCDATA ;
51 if (m_stacktop->neednet) m_curcon = NETRCDATA ;
58 /* Tests whether the element named in a tag is defined; if so, returns its
59 index; otherwise return FALSE */
60 M_ELEMENT m_eltname(M_NOPAR)
64 if (eltid = m_packedlook(m_entree, m_name)) return(eltid) ;
66 m_err1("Undefined element %s", m_name) ;
83 /* Program initialization */
84 void m_initialize(M_NOPAR)
90 "MARKUP PARSER (with non-canonical SGML enhancements) ") ;
91 m_signmsg(M_VERSION) ;
93 m_signmsg("(c) Copyright 1993, 1994, 1995 Hewlett-Packard Company\n");
94 m_signmsg("(c) Copyright 1993, 1994, 1995 International Business Machines Corp.\n");
95 m_signmsg("(c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.\n");
96 m_signmsg("(c) Copyright 1993, 1994, 1995 Unix System Labs, Inc., a subsidiary of Novell, Inc.\n");
97 /* took this out since it seemed frivolous and failed tests with
102 if (! (m_sysent[m_sysecnt] = m_openfirst()))
104 m_error("Unable to open input file") ;
108 setlocale(LC_ALL, "");
111 mb_delims = mb_dlmptr;
112 wc_delims = m_dlmptr;
116 *wc_delims++ = MakeWideCharString(*mb_delims);