<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Mon Jun 09 23:45:36 GMT+03:30 1997 -->
<title>
  Class w3c.xmlOnline.parser.Parser
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-w3c.xmlOnline.parser.html">This Package</a>  <a href="w3c.xmlOnline.parser.ISO88591InputStream.html#_top_">Previous</a>  <a href="w3c.xmlOnline.parser.UTF8InputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class w3c.xmlOnline.parser.Parser
</h1>
<pre>
java.lang.Object
   |
   +----w3c.xmlOnline.parser.Parser
</pre>
<hr>
<dl>
  <dt> public class <b>Parser</b>
  <dt> extends Object
  <dt> implements <a href="w3c.xmlOnline.parser.ParserDef.html#_top_">ParserDef</a>
</dl>
(Generated by ll1genj)
<p>
<hr>
<a name="index"></a>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#Parser(w3c.xmlOnline.parser.Scanner)"><b>Parser</b></a>(Scanner)
  <dd> Initializer
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#addListener(w3c.xmlOnline.parser.XMLListener)"><b>addListener</b></a>(XMLListener)
  <dd>  Register an XMLListener with the parser.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#deletion(int)"><b>deletion</b></a>(int)
  <dd>  <p>Print error message for unexpected token.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#handleAttribute(java.lang.String, java.lang.String)"><b>handleAttribute</b></a>(String, String)
  <dd>  This function is called by the parser when it has
 recognized an attribute name/value pair.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#handleComment(java.lang.String)"><b>handleComment</b></a>(String)
  <dd>  This function is called by the parser when it has recognized a
 comment.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#handleData(java.lang.String)"><b>handleData</b></a>(String)
  <dd>  This function is called by the parser when it has
 recognized character data.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#handleEndDoc(java.lang.String)"><b>handleEndDoc</b></a>(String)
  <dd>  This function is called by the parser when it has
 recognized the end of a document or subdocument.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#handleEndTag(java.lang.String)"><b>handleEndTag</b></a>(String)
  <dd>  This function is called by the parser when it has
 recognized an end tag or the end of an empty tag.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#handlePI(java.lang.String)"><b>handlePI</b></a>(String)
  <dd>  This function is called by the parser when it has recognized a
 processing instruction.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#handleStartDoc(java.lang.String, java.lang.String)"><b>handleStartDoc</b></a>(String, String)
  <dd>  This function is called by the parser when it has
 recognized a doctype declaration.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#handleStartTag(java.lang.String)"><b>handleStartTag</b></a>(String)
  <dd>  This function is called by the parser when it has
 recognized a start tag.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#insertion(int)"><b>insertion</b></a>(int)
  <dd>  <p>Print error message for missing token.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#parse()"><b>parse</b></a>()
  <dd> 
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#protect(java.lang.String)"><b>protect</b></a>(String)
  <dd>  Encode a string with certain characters replaced by
 numerical character entities.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="Parser"></a>
<a name="Parser(w3c.xmlOnline.parser.Scanner)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>Parser</b>
<pre>
 public Parser(<a href="w3c.xmlOnline.parser.Scanner.html#_top_">Scanner</a> s)
</pre>
<dl>
  <dd> Initializer
<p>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="addListener(w3c.xmlOnline.parser.XMLListener)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="addListener"><b>addListener</b></a>
<pre>
 public <a href="#_top_">Parser</a> addListener(<a href="w3c.xmlOnline.parser.XMLListener.html#_top_">XMLListener</a> listener)
</pre>
<dl>
  <dd> Register an XMLListener with the parser. An XMLListener is
 an object that will be called whenever an XML-event occurs:
 the parser finds a start tag, an end tag, an attribute,
 a PI, etc. There may be any number of listeners registered.
 <p>See <a href="Parser.ll1">Parser.ll1</a> for the grammar
 accepted by this parser.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> listener - the listener to register
    <dt> <b>Returns:</b>
    <dd> this
  </dl></dd>
</dl>
<a name="handleComment(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="handleComment"><b>handleComment</b></a>
<pre>
 protected void handleComment(String comment)
</pre>
<dl>
  <dd> This function is called by the parser when it has recognized a
 comment. It calls each of the listeners in turn. Note that
 comments are not part of the data model, but they are passed on
 anyway, for the benefit of XML editors and similar programs.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> comment - the comment string (without &lt;!-- --&gt;)
  </dl></dd>
</dl>
<a name="handleStartTag(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="handleStartTag"><b>handleStartTag</b></a>
<pre>
 protected void handleStartTag(String tag)
</pre>
<dl>
  <dd> This function is called by the parser when it has
 recognized a start tag. This is the beginning of
 a lexical scope: if any &lt;?xml default... ?&gt;
 declarations are found, they only apply to elements
 in this scope.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> tag - the tag name in lowercase
  </dl></dd>
</dl>
<a name="handleAttribute(java.lang.String, java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="handleAttribute"><b>handleAttribute</b></a>
<pre>
 protected void handleAttribute(String attribute,
                                String value)
</pre>
<dl>
  <dd> This function is called by the parser when it has
 recognized an attribute name/value pair. The attribute
 belongs to the tag that was handled by the most recent
 call to handleStartTag().
 <p>Note that there is no indication of whether this
 attribute was actually on the tag, or whether it
 is the declared default value for the attribute on
 this tag (&lt;?XML DEFAULT...?&gt;)
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> attribute - the name of the attribute in lowercase
    <dd> value - the value of the attribute
  </dl></dd>
</dl>
<a name="handleEndTag(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="handleEndTag"><b>handleEndTag</b></a>
<pre>
 protected void handleEndTag(String tag)
</pre>
<dl>
  <dd> This function is called by the parser when it has
 recognized an end tag or the end of an empty tag.
 This is also the end of a lexical scope.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> tag - the name of the tag in lowercase
  </dl></dd>
</dl>
<a name="handleData(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="handleData"><b>handleData</b></a>
<pre>
 protected void handleData(String data)
</pre>
<dl>
  <dd> This function is called by the parser when it has
 recognized character data. The function may be called
 several times without intervening calls to handleStartTag()
 or handleEndTag(). The content of an element is thus the
 concatenation of all consecutive calls to handleData().
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> data - the character data
  </dl></dd>
</dl>
<a name="handlePI(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="handlePI"><b>handlePI</b></a>
<pre>
 protected void handlePI(String pi)
</pre>
<dl>
  <dd> This function is called by the parser when it has recognized a
 processing instruction. Note that PIs are not part of the data
 model, but they are passed on anyway, for the benefit of XML
 editors and similar programs.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> pi - the processing instruction (without &lt;? ?&gt;)
  </dl></dd>
</dl>
<a name="handleStartDoc(java.lang.String, java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="handleStartDoc"><b>handleStartDoc</b></a>
<pre>
 protected void handleStartDoc(String root,
                               String doctype)
</pre>
<dl>
  <dd> This function is called by the parser when it has
 recognized a doctype declaration. Documents can be nested
 and there may thus be a doctype in the middle of a
 document. A document constitutes a scope for the
 default attributes, just like an element.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> root - the name of the start tag
    <dd> doctype - the URL defining the document type (may be null)
  </dl></dd>
</dl>
<a name="handleEndDoc(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="handleEndDoc"><b>handleEndDoc</b></a>
<pre>
 protected void handleEndDoc(String root)
</pre>
<dl>
  <dd> This function is called by the parser when it has
 recognized the end of a document or subdocument.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> root - the name of the start tag
  </dl></dd>
</dl>
<a name="protect(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="protect"><b>protect</b></a>
<pre>
 protected String protect(String s)
</pre>
<dl>
  <dd> Encode a string with certain characters replaced by
 numerical character entities.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> s - string to encode
    <dt> <b>Returns:</b>
    <dd> the encoded string
  </dl></dd>
</dl>
<a name="insertion(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="insertion"><b>insertion</b></a>
<pre>
 protected void insertion(int sym)
</pre>
<dl>
  <dd> <p>Print error message for missing token. Subclasses often override
 this method. If they don't, the default does this:
 <pre>
 System.err.println(this.in.getLineno() + ":" + this.in.getColno() +
   ": " + symbolName[sym] + " expected");
 </pre>
 <p>symbolName can be found in the generated interface xxxDef.
<p>
</dl>
<a name="deletion(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="deletion"><b>deletion</b></a>
<pre>
 protected void deletion(int sym)
</pre>
<dl>
  <dd> <p>Print error message for unexpected token. Subclasses often override
 this method. If they don't, the default does this:
 <pre>
 System.err.println(this.in.getLineno() + ":" + this.in.getColno() +
   ": " + symbolName[sym] + " unexpected");
 </pre>
<p>
</dl>
<a name="parse()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="parse"><b>parse</b></a>
<pre>
 public final int parse() throws IOException
</pre>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-w3c.xmlOnline.parser.html">This Package</a>  <a href="w3c.xmlOnline.parser.ISO88591InputStream.html#_top_">Previous</a>  <a href="w3c.xmlOnline.parser.UTF8InputStream.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
