<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>class XML_Parser</TITLE> <META NAME="GENERATOR" CONTENT="DOC++ 3.4.6"> </HEAD> <body bgcolor="#ffffff" link="#0000ff" vlink="#dd0000" text="#000088" alink="9000ff"> <A HREF = "http://www.cstr.ed.ac.uk/"> <IMG align=left BORDER=0 SRC = "cstr.gif"></A> <A HREF="http://www.cstr.ed.ac.uk/projects/speech_tools.html"> <IMG BORDER=0 ALIGN=right SRC="est.jpg" width=150 height=93></A> <br> <br clear=left> <p align=right> In file ../include/rxp/XML_Parser.h:<TABLE BORDER=0><TR> <TD VALIGN=TOP><H2>class <A HREF="#DOC.DOCU">XML_Parser</A></H2></TD></H2></TD></TR></TABLE> <BLOCKQUOTE>An actual parser.</BLOCKQUOTE> <HR> <DL> <P><TABLE> <DT><H3>Public Methods</H3><DD><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.14"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>~XML_Parser</B> ()<BR> <I>Destructor, may close input if required</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.15"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void </TD><TD><B>track_context</B> (bool flag)<BR> <I>Request that parser keep track of the currently open elements.</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.16"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void </TD><TD><B>track_contents</B> (bool flag)<BR> <I>Keep track of the content of open elements.</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.17"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="EST_String.html">EST_String</A> </TD><TD><B>context</B> (int <!1><A HREF="EST_TVector.html#DOC.15.1.20.3">n</A>)<BR> <I>Get the name of the nth enclosing element.</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.18"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void </TD><TD><B>go</B> ()<BR> <I>Run the parser.</I> </TD></TR></TABLE></P> <P><TABLE> <DT><H3>Protected Fields</H3><DD><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.4"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="XML_Parser_Class.html">XML_Parser_Class</A>* </TD><TD><B>pclass</B> <BR> <I>The class to which this parser belogs.</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.5"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>XBit </TD><TD><B>current_bit</B> <BR> <I>The piece of markup being processed</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.6"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>InputSource </TD><TD><B>source</B> <BR> <I>Where we are reading from</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.7"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>Entity </TD><TD><B>initial_entity</B> <BR> <I>The entity we started from.</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.8"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>void* </TD><TD><B>data</B> <BR> <I>Arbitrary data which can beused by callbacks</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.9"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>Parser </TD><TD><B>p</B> <BR> <I>The RXP parser object</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.10"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A><!1><A HREF="EST_TDeque.html">EST_TDeque</A><<!1><A HREF="EST_String.html">EST_String</A>> </TD><TD><B>p_context</B> <BR> <I>If context is being tracked, this is a stack of element names</I> </TD></TR></TABLE></P> <P><TABLE> <DT><H3>Protected Methods</H3><DD><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.11"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A> </TD><TD><B>XML_Parser</B> (<!1><A HREF="XML_Parser_Class.html">XML_Parser_Class</A> &<!1><A HREF="parent.html">parent</A>, InputSource <!1><A HREF="XML_Parser.html#DOC.190.3.6">source</A>, Entity <!1><A HREF="XML_Parser.html#DOC.190.3.7">initial_entity</A>, void* <!1><A HREF="XML_Parser.html#DOC.190.3.8">data</A>)<BR> <I>Creator used by XML_Parser_Class::make_parser()</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.12"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>InputSource </TD><TD><B>open</B> (Entity ent)<BR> <I>Open.</I> </TD></TR><TR> <TD VALIGN=TOP><A HREF="#DOC.190.3.13"><IMG ALT="[more]" BORDER=0 SRC=icon1.gif></A>const char* </TD><TD><B>get_error</B> ()<BR> <I>Get the error message for the last error</I> </TD></TR></TABLE></P> </DL> <A NAME="DOC.DOCU"></A> <HR> <H2>Documentation</H2> <BLOCKQUOTE>An actual parser. Each such instance parses just one stream which is given when the parser is created. <P>The behaviour of the parser is given by the class to which it belongs.</BLOCKQUOTE> <DL> <A NAME="pclass"></A> <A NAME="DOC.190.3.4"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="XML_Parser_Class.html">XML_Parser_Class</A>* pclass</B></TT> <DD>The class to which this parser belogs. Defines the behaviour of the parser. <DL><DT><DD></DL><P> <A NAME="current_bit"></A> <A NAME="DOC.190.3.5"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>XBit current_bit</B></TT> <DD>The piece of markup being processed <DL><DT><DD></DL><P> <A NAME="source"></A> <A NAME="DOC.190.3.6"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>InputSource source</B></TT> <DD>Where we are reading from <DL><DT><DD></DL><P> <A NAME="initial_entity"></A> <A NAME="DOC.190.3.7"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>Entity initial_entity</B></TT> <DD>The entity we started from. May beed to be freed at the end of the parse. <DL><DT><DD></DL><P> <A NAME="data"></A> <A NAME="DOC.190.3.8"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void* data</B></TT> <DD>Arbitrary data which can beused by callbacks <DL><DT><DD></DL><P> <A NAME="p"></A> <A NAME="DOC.190.3.9"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>Parser p</B></TT> <DD>The RXP parser object <DL><DT><DD></DL><P> <A NAME="p_context"></A> <A NAME="DOC.190.3.10"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="EST_TDeque.html">EST_TDeque</A><<!1><A HREF="EST_String.html">EST_String</A>> p_context</B></TT> <DD>If context is being tracked, this is a stack of element names <DL><DT><DD></DL><P> <A NAME="XML_Parser"></A> <A NAME="DOC.190.3.11"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> XML_Parser(<!1><A HREF="XML_Parser_Class.html">XML_Parser_Class</A> &<!1><A HREF="parent.html">parent</A>, InputSource <!1><A HREF="XML_Parser.html#DOC.190.3.6">source</A>, Entity <!1><A HREF="XML_Parser.html#DOC.190.3.7">initial_entity</A>, void* <!1><A HREF="XML_Parser.html#DOC.190.3.8">data</A>)</B></TT> <DD>Creator used by XML_Parser_Class::make_parser() <DL><DT><DD></DL><P> <A NAME="open"></A> <A NAME="DOC.190.3.12"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>InputSource open(Entity ent)</B></TT> <DD>Open. Asks the parser class to do the work. <DL><DT><DD></DL><P> <A NAME="get_error"></A> <A NAME="DOC.190.3.13"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>const char* get_error()</B></TT> <DD>Get the error message for the last error <DL><DT><DD></DL><P> <A NAME="~XML_Parser"></A> <A NAME="DOC.190.3.14"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B> ~XML_Parser()</B></TT> <DD>Destructor, may close input if required <DL><DT><DD></DL><P> <A NAME="track_context"></A> <A NAME="DOC.190.3.15"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void track_context(bool flag)</B></TT> <DD>Request that parser keep track of the currently open elements. <P>These are recorded on a atsck. Use context() to access the information. <DL><DT><DD></DL><P> <A NAME="track_contents"></A> <A NAME="DOC.190.3.16"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void track_contents(bool flag)</B></TT> <DD>Keep track of the content of open elements. <P>Not yet implemented. <DL><DT><DD></DL><P> <A NAME="context"></A> <A NAME="DOC.190.3.17"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B><!1><A HREF="EST_String.html">EST_String</A> context(int <!1><A HREF="EST_TVector.html#DOC.15.1.20.3">n</A>)</B></TT> <DD>Get the name of the nth enclosing element. <P>context(0) is the element we are directly inside. <DL><DT><DD></DL><P> <A NAME="go"></A> <A NAME="DOC.190.3.18"></A> <DT><IMG ALT="o" BORDER=0 SRC=icon2.gif><TT><B>void go()</B></TT> <DD>Run the parser. <DL><DT><DD></DL><P></DL> <HR><DL><DT><B>This class has no child classes.</B></DL> <DL><DT><DT><B>Friends:</B><DD> class <!1><A HREF="XML_Parser_Class.html">XML_Parser_Class</A><BR><DD></DL><P><P><I><A HREF="index.html">Alphabetic index</A></I> <I><A HREF="HIER.html">HTML hierarchy of classes</A> or <A HREF="HIERjava.html">Java</A></I></P><HR> <A HREF = "http://www.ed.ac.uk/"> <IMG align=right BORDER=0 SRC = "edcrest.gif"></A> <P Align=left><I>This page is part of the <A HREF="http://www.cstr.ed.ac.uk/projects/speech_tools.html"> Edinburgh Speech Tools Library</A> documentation <br> Copyright <A HREF="http://www.ed.ac.uk"> University of Edinburgh</A> 1997 <br> Contact: <A HREF="mailto:speech_toolss@cstr.ed.ac.uk"> speech_tools@cstr.ed.ac.uk </a> </P> <br clear=right>