
// DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-

#ifndef __gnu_xml_aelfred2_XmlParser__
#define __gnu_xml_aelfred2_XmlParser__

#pragma interface

#include <java/lang/Object.h>
#include <gcj/array.h>

extern "Java"
{
  namespace gnu
  {
    namespace xml
    {
      namespace aelfred2
      {
          class SAXDriver;
          class XmlParser;
          class XmlParser$AttributeDecl;
          class XmlParser$ElementDecl;
          class XmlParser$ExternalIdentifiers;
      }
    }
  }
  namespace java
  {
    namespace net
    {
        class URLConnection;
    }
  }
  namespace org
  {
    namespace xml
    {
      namespace sax
      {
          class InputSource;
      }
    }
  }
}

class gnu::xml::aelfred2::XmlParser : public ::java::lang::Object
{

public: // actually package-private
  XmlParser();
  void setHandler(::gnu::xml::aelfred2::SAXDriver *);
  void doParse(::java::lang::String *, ::java::lang::String *, ::java::io::Reader *, ::java::io::InputStream *, ::java::lang::String *);
private:
  void error(::java::lang::String *, ::java::lang::String *, ::java::lang::String *);
  void error(::java::lang::String *, jchar, ::java::lang::String *);
  void error(::java::lang::String *);
  void parseDocument();
  void parseComment();
  void parsePI();
  void parseCDSect();
  jboolean parseProlog();
  void checkLegalVersion(::java::lang::String *);
  ::java::lang::String * parseXMLDecl(jboolean);
  ::java::lang::String * parseTextDecl(jboolean);
  void setupDecoding(::java::lang::String *);
  void parseMisc();
  void parseDoctypedecl();
  void parseMarkupdecl();
  void parseElement(jboolean);
  void parseAttribute(::java::lang::String *);
  void parseEq();
  void parseETag();
  void parseContent();
  void parseElementDecl();
  void parseContentspec(::java::lang::String *);
  void parseElements(JArray< jchar > *);
  void parseCp();
  void parseMixed(JArray< jchar > *);
  void parseAttlistDecl();
  void parseAttDef(::java::lang::String *);
  ::java::lang::String * readAttType();
  void parseEnumeration(jboolean);
  void parseNotationType();
  void parseDefault(::java::lang::String *, ::java::lang::String *, ::java::lang::String *, ::java::lang::String *);
  void parseConditionalSect(JArray< jchar > *);
  void parseCharRef();
  void tryReadCharRef();
  void parseCharRef(jboolean);
  void parseEntityRef(jboolean);
  void parsePEReference();
  void parseEntityDecl();
  void parseNotationDecl();
  void parseCharData();
  void requireWhitespace();
  void skipWhitespace();
  ::java::lang::String * readNmtoken(jboolean);
  static jboolean isExtender(jchar);
  ::java::lang::String * readLiteral(jint);
  ::gnu::xml::aelfred2::XmlParser$ExternalIdentifiers * readExternalIds(jboolean, jboolean);
  jboolean isWhitespace(jchar);
  void dataBufferAppend(jchar);
  void dataBufferAppend(::java::lang::String *);
  void dataBufferAppend(JArray< jchar > *, jint, jint);
  void dataBufferNormalize();
  ::java::lang::String * dataBufferToString();
  void dataBufferFlush();
  void require(::java::lang::String *);
  void require(jchar);
public:
  ::java::lang::String * intern(JArray< jchar > *, jint, jint);
private:
  ::java::lang::Object * extendArray(::java::lang::Object *, jint, jint);
public: // actually package-private
  jboolean isStandalone();
private:
  jint getContentType(::gnu::xml::aelfred2::XmlParser$ElementDecl *, jint);
public:
  jint getElementContentType(::java::lang::String *);
private:
  void setElement(::java::lang::String *, jint, ::java::lang::String *, ::java::util::HashMap *);
  ::java::util::HashMap * getElementAttributes(::java::lang::String *);
  ::java::util::Iterator * declaredAttributes(::gnu::xml::aelfred2::XmlParser$ElementDecl *);
public:
  ::java::util::Iterator * declaredAttributes(::java::lang::String *);
  ::java::lang::String * getAttributeType(::java::lang::String *, ::java::lang::String *);
  ::java::lang::String * getAttributeEnumeration(::java::lang::String *, ::java::lang::String *);
  ::java::lang::String * getAttributeDefaultValue(::java::lang::String *, ::java::lang::String *);
  jint getAttributeDefaultValueType(::java::lang::String *, ::java::lang::String *);
private:
  void setAttribute(::java::lang::String *, ::java::lang::String *, ::java::lang::String *, ::java::lang::String *, ::java::lang::String *, jint);
  ::gnu::xml::aelfred2::XmlParser$AttributeDecl * getAttribute(::java::lang::String *, ::java::lang::String *);
public:
  jint getEntityType(::java::lang::String *);
  ::gnu::xml::aelfred2::XmlParser$ExternalIdentifiers * getEntityIds(::java::lang::String *);
  ::java::lang::String * getEntityValue(::java::lang::String *);
private:
  void setInternalEntity(::java::lang::String *, ::java::lang::String *);
  void setExternalEntity(::java::lang::String *, jint, ::gnu::xml::aelfred2::XmlParser$ExternalIdentifiers *, ::java::lang::String *);
  void setNotation(::java::lang::String *, ::gnu::xml::aelfred2::XmlParser$ExternalIdentifiers *);
public:
  jint getLineNumber();
  jint getColumnNumber();
private:
  jchar readCh();
  void unread(jchar);
  void unread(JArray< jchar > *, jint);
  void pushURL(jboolean, ::java::lang::String *, ::gnu::xml::aelfred2::XmlParser$ExternalIdentifiers *, ::java::io::Reader *, ::java::io::InputStream *, ::java::lang::String *, jboolean);
  ::java::lang::String * tryEncodingDecl(jboolean);
  void detectEncoding();
  static jboolean tryEncoding(JArray< jbyte > *, jbyte, jbyte, jbyte, jbyte);
  static jboolean tryEncoding(JArray< jbyte > *, jbyte, jbyte);
  void pushString(::java::lang::String *, ::java::lang::String *);
  void pushCharArray(::java::lang::String *, JArray< jchar > *, jint, jint);
  void pushInput(::java::lang::String *);
  void popInput();
  jboolean tryRead(jchar);
  jboolean tryRead(::java::lang::String *);
  jboolean tryRead(JArray< jchar > *);
  jboolean tryWhitespace();
  void parseUntil(::java::lang::String *);
  void parseUntil(JArray< jchar > *);
  void prefetchASCIIEncodingDecl();
  void readDataChunk();
  void filterCR(jboolean);
  void copyUtf8ReadBuffer(jint);
  jint getNextUtf8Byte(jint, jint);
  void copyIso8859_1ReadBuffer(jint, jchar);
  void copyUcs2ReadBuffer(jint, jint, jint);
  void copyUcs4ReadBuffer(jint, jint, jint, jint, jint);
  void encodingError(::java::lang::String *, jint, jint);
  void initializeVariables();
  static const jboolean USE_CHEATS = 1;
public:
  static const jint CONTENT_UNDECLARED = 0;
  static const jint CONTENT_ANY = 1;
  static const jint CONTENT_EMPTY = 2;
  static const jint CONTENT_MIXED = 3;
  static const jint CONTENT_ELEMENTS = 4;
  static const jint ENTITY_UNDECLARED = 0;
  static const jint ENTITY_INTERNAL = 1;
  static const jint ENTITY_NDATA = 2;
  static const jint ENTITY_TEXT = 3;
private:
  static const jint ENCODING_EXTERNAL = 0;
  static const jint ENCODING_UTF_8 = 1;
  static const jint ENCODING_ISO_8859_1 = 2;
  static const jint ENCODING_UCS_2_12 = 3;
  static const jint ENCODING_UCS_2_21 = 4;
  static const jint ENCODING_UCS_4_1234 = 5;
  static const jint ENCODING_UCS_4_4321 = 6;
  static const jint ENCODING_UCS_4_2143 = 7;
  static const jint ENCODING_UCS_4_3412 = 8;
  static const jint ENCODING_ASCII = 9;
public:
  static const jint ATTRIBUTE_DEFAULT_UNDECLARED = 30;
  static const jint ATTRIBUTE_DEFAULT_SPECIFIED = 31;
  static const jint ATTRIBUTE_DEFAULT_IMPLIED = 32;
  static const jint ATTRIBUTE_DEFAULT_REQUIRED = 33;
  static const jint ATTRIBUTE_DEFAULT_FIXED = 34;
private:
  static const jint INPUT_NONE = 0;
  static const jint INPUT_INTERNAL = 1;
  static const jint INPUT_STREAM = 3;
  static const jint INPUT_READER = 5;
  static const jint LIT_ENTITY_REF = 2;
  static const jint LIT_NORMALIZE = 4;
  static const jint LIT_ATTRIBUTE = 8;
  static const jint LIT_DISABLE_PE = 16;
  static const jint LIT_DISABLE_CREF = 32;
  static const jint LIT_DISABLE_EREF = 64;
  static const jint LIT_PUBID = 256;
  static const jint CONTEXT_NORMAL = 0;
  static const jint CONTEXT_LITERAL = 1;
public: // actually package-private
  static jboolean uriWarnings;
private:
  ::gnu::xml::aelfred2::SAXDriver * __attribute__((aligned(__alignof__( ::java::lang::Object)))) handler;
  ::java::io::Reader * reader;
  ::java::io::InputStream * is;
  jint line;
  jint column;
  jint sourceType;
  ::java::util::LinkedList * inputStack;
  ::java::net::URLConnection * externalEntity;
  jint encoding;
  jint currentByteCount;
  ::org::xml::sax::InputSource * scratch;
  JArray< jchar > * readBuffer;
  jint readBufferPos;
  jint readBufferLength;
  jint readBufferOverflow;
  static const jint READ_BUFFER_MAX = 16384;
  JArray< jbyte > * rawReadBuffer;
  static jint DATA_BUFFER_INITIAL;
  JArray< jchar > * dataBuffer;
  jint dataBufferPos;
  static jint NAME_BUFFER_INITIAL;
  JArray< jchar > * nameBuffer;
  jint nameBufferPos;
  jboolean docIsStandalone;
  ::java::util::HashMap * elementInfo;
  ::java::util::HashMap * entityInfo;
  ::java::util::HashMap * notationInfo;
  jboolean skippedPE;
  ::java::lang::String * currentElement;
  jint currentElementContent;
  ::java::util::LinkedList * entityStack;
  jboolean inLiteral;
  jboolean expandPE;
  jboolean peIsError;
  jboolean doReport;
  static const jint SYMBOL_TABLE_LENGTH = 2039;
  JArray< JArray< ::java::lang::Object * > * > * symbolTable;
  JArray< ::java::lang::String * > * tagAttributes;
  jint tagAttributePos;
  jboolean sawCR;
  jboolean inCDATA;
  static const jint XML_10 = 0;
  static const jint XML_11 = 1;
  jint xmlVersion;
public: // actually package-private
  static JArray< jchar > * startDelimComment;
  static JArray< jchar > * endDelimComment;
  static JArray< jchar > * startDelimPI;
  static JArray< jchar > * endDelimPI;
  static JArray< jchar > * endDelimCDATA;
private:
  jboolean isDirtyCurrentElement;
public:
  static ::java::lang::Class class$;
};

#endif // __gnu_xml_aelfred2_XmlParser__
