XMLParser.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. // DO NOT EDIT THIS FILE - it is machine generated -*- c++ -*-
  2. #ifndef __gnu_xml_stream_XMLParser__
  3. #define __gnu_xml_stream_XMLParser__
  4. #pragma interface
  5. #include <java/lang/Object.h>
  6. #include <gcj/array.h>
  7. extern "Java"
  8. {
  9. namespace gnu
  10. {
  11. namespace java
  12. {
  13. namespace lang
  14. {
  15. class CPStringBuilder;
  16. }
  17. }
  18. namespace xml
  19. {
  20. namespace stream
  21. {
  22. class XMLParser;
  23. class XMLParser$Attribute;
  24. class XMLParser$ContentModel;
  25. class XMLParser$ContentParticle;
  26. class XMLParser$Doctype;
  27. class XMLParser$ElementContentModel;
  28. class XMLParser$ExternalIds;
  29. class XMLParser$Input;
  30. }
  31. }
  32. }
  33. namespace javax
  34. {
  35. namespace xml
  36. {
  37. namespace namespace$
  38. {
  39. class NamespaceContext;
  40. class QName;
  41. }
  42. namespace stream
  43. {
  44. class Location;
  45. class XMLReporter;
  46. class XMLResolver;
  47. }
  48. }
  49. }
  50. }
  51. class gnu::xml::stream::XMLParser : public ::java::lang::Object
  52. {
  53. public:
  54. XMLParser(::java::io::InputStream *, ::java::lang::String *, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, ::javax::xml::stream::XMLReporter *, ::javax::xml::stream::XMLResolver *);
  55. XMLParser(::java::io::Reader *, ::java::lang::String *, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, ::javax::xml::stream::XMLReporter *, ::javax::xml::stream::XMLResolver *);
  56. virtual ::java::lang::String * getNamespaceURI(::java::lang::String *);
  57. virtual ::java::lang::String * getPrefix(::java::lang::String *);
  58. virtual ::java::util::Iterator * getPrefixes(::java::lang::String *);
  59. virtual void close();
  60. virtual ::javax::xml::namespace$::NamespaceContext * getNamespaceContext();
  61. virtual jint getAttributeCount();
  62. virtual ::java::lang::String * getAttributeLocalName(jint);
  63. virtual ::java::lang::String * getAttributeNamespace(jint);
  64. virtual ::java::lang::String * getAttributePrefix(jint);
  65. virtual ::javax::xml::namespace$::QName * getAttributeName(jint);
  66. virtual ::java::lang::String * getAttributeType(jint);
  67. private:
  68. ::java::lang::String * getAttributeType(::java::lang::String *, ::java::lang::String *);
  69. public:
  70. virtual ::java::lang::String * getAttributeValue(jint);
  71. virtual ::java::lang::String * getAttributeValue(::java::lang::String *, ::java::lang::String *);
  72. public: // actually package-private
  73. virtual jboolean isAttributeDeclared(jint);
  74. public:
  75. virtual ::java::lang::String * getCharacterEncodingScheme();
  76. virtual ::java::lang::String * getElementText();
  77. virtual ::java::lang::String * getEncoding();
  78. virtual jint getEventType();
  79. virtual ::java::lang::String * getLocalName();
  80. virtual ::javax::xml::stream::Location * getLocation();
  81. virtual ::javax::xml::namespace$::QName * getName();
  82. virtual jint getNamespaceCount();
  83. virtual ::java::lang::String * getNamespacePrefix(jint);
  84. virtual ::java::lang::String * getNamespaceURI();
  85. virtual ::java::lang::String * getNamespaceURI(jint);
  86. virtual ::java::lang::String * getPIData();
  87. virtual ::java::lang::String * getPITarget();
  88. virtual ::java::lang::String * getPrefix();
  89. virtual ::java::lang::Object * getProperty(::java::lang::String *);
  90. virtual ::java::lang::String * getText();
  91. virtual JArray< jchar > * getTextCharacters();
  92. virtual jint getTextCharacters(jint, JArray< jchar > *, jint, jint);
  93. virtual jint getTextLength();
  94. virtual jint getTextStart();
  95. virtual ::java::lang::String * getVersion();
  96. virtual jboolean hasName();
  97. virtual jboolean hasText();
  98. virtual jboolean isAttributeSpecified(jint);
  99. virtual jboolean isCharacters();
  100. virtual jboolean isEndElement();
  101. virtual jboolean isStandalone();
  102. virtual jboolean isStartElement();
  103. virtual jboolean isWhiteSpace();
  104. virtual jint nextTag();
  105. virtual void require(jint, ::java::lang::String *, ::java::lang::String *);
  106. virtual jboolean standaloneSet();
  107. virtual jboolean hasNext();
  108. virtual jint next();
  109. public: // actually package-private
  110. virtual ::java::lang::String * getCurrentElement();
  111. private:
  112. void mark(jint);
  113. void reset();
  114. jint read();
  115. jint read(JArray< jint > *, jint, jint);
  116. jint readCh();
  117. void require(jchar);
  118. void require(::java::lang::String *);
  119. jboolean tryRead(jchar);
  120. jboolean tryRead(::java::lang::String *);
  121. void readUntil(::java::lang::String *);
  122. jboolean tryWhitespace();
  123. void skipWhitespace();
  124. void requireWhitespace();
  125. public: // actually package-private
  126. virtual ::java::lang::String * getXMLBase();
  127. private:
  128. void pushInput(::java::lang::String *, ::java::lang::String *, jboolean, jboolean);
  129. void pushInput(::java::lang::String *, ::gnu::xml::stream::XMLParser$ExternalIds *, jboolean, jboolean);
  130. void pushInput(::gnu::xml::stream::XMLParser$Input *);
  131. public: // actually package-private
  132. static ::java::lang::String * canonicalize(::java::lang::String *);
  133. public:
  134. static ::java::lang::String * absolutize(::java::lang::String *, ::java::lang::String *);
  135. private:
  136. static jboolean isURLScheme(::java::lang::String *);
  137. public: // actually package-private
  138. static ::java::io::InputStream * resolve(::java::lang::String *);
  139. private:
  140. void popInput();
  141. void readTextDecl();
  142. void readXMLDecl();
  143. void readDoctypeDecl();
  144. void checkDoctype();
  145. void readMarkupdecl(jboolean);
  146. void readElementDecl();
  147. void readContentspec(::java::lang::String *);
  148. ::gnu::xml::stream::XMLParser$ElementContentModel * readElements(::gnu::java::lang::CPStringBuilder *);
  149. ::gnu::xml::stream::XMLParser$ContentParticle * readContentParticle(::gnu::java::lang::CPStringBuilder *);
  150. void readAttlistDecl();
  151. void readAttDef(::java::lang::String *);
  152. ::java::lang::String * readAttType(::gnu::java::lang::CPStringBuilder *, ::java::util::HashSet *);
  153. void readEnumeration(jboolean, ::gnu::java::lang::CPStringBuilder *, ::java::util::HashSet *);
  154. void readNotationType(::gnu::java::lang::CPStringBuilder *, ::java::util::HashSet *);
  155. void readDefault(::java::lang::String *, ::java::lang::String *, ::java::lang::String *, ::java::lang::String *, ::java::util::HashSet *);
  156. void readEntityDecl(jboolean);
  157. void readNotationDecl(jboolean);
  158. ::gnu::xml::stream::XMLParser$ExternalIds * readExternalIds(jboolean, jboolean);
  159. jint readStartElement();
  160. jboolean attributeSpecified(::java::lang::String *);
  161. void readAttribute(::java::lang::String *);
  162. jboolean addNamespace(::gnu::xml::stream::XMLParser$Attribute *);
  163. void readEndElement();
  164. void endElementValidationHook();
  165. void readComment(jboolean);
  166. void readPI(jboolean);
  167. void readReference();
  168. void readCDSect();
  169. jint readCharData(::java::lang::String *);
  170. void expandEntity(::java::lang::String *, jboolean, jboolean);
  171. jboolean isUnparsedEntity(::java::lang::String *);
  172. void readEq();
  173. jint literalReadCh(jboolean);
  174. ::java::lang::String * readLiteral(jint, jboolean);
  175. ::java::lang::StringBuffer * normalize(::java::lang::StringBuffer *);
  176. void normalizeCRLF(::java::lang::StringBuffer *);
  177. void expandPEReference();
  178. JArray< jchar > * readCharacterRef(jint);
  179. ::java::lang::String * readNmtoken(jboolean);
  180. ::java::lang::String * readNmtoken(jboolean, ::java::lang::StringBuffer *);
  181. public:
  182. static jboolean isXML11Char(jint);
  183. static jboolean isXML11RestrictedChar(jint);
  184. private:
  185. jboolean isNmtoken(::java::lang::String *, jboolean);
  186. public:
  187. static jboolean isNameStartCharacter(jint, jboolean);
  188. static jboolean isNameCharacter(jint, jboolean);
  189. static jboolean isLetter(jint);
  190. static jboolean isDigit(jint);
  191. static jboolean isCombiningChar(jint);
  192. static jboolean isExtender(jint);
  193. static jboolean isChar(jint);
  194. private:
  195. ::java::lang::String * intern(::java::lang::String *);
  196. void error(::java::lang::String *);
  197. void error(::java::lang::String *, ::java::lang::Object *);
  198. void validateStartElement(::java::lang::String *);
  199. void validateEndElement();
  200. void validatePCData(::java::lang::String *);
  201. void validateElementContent(::gnu::xml::stream::XMLParser$ElementContentModel *, ::java::util::LinkedList *);
  202. ::java::lang::String * createRegularExpression(::gnu::xml::stream::XMLParser$ElementContentModel *);
  203. public: // actually package-private
  204. virtual void validateDoctype();
  205. public:
  206. static void main(JArray< ::java::lang::String * > *);
  207. private:
  208. static ::java::lang::String * encodeText(::java::lang::String *);
  209. public: // actually package-private
  210. static ::java::lang::String * access$0(::gnu::xml::stream::XMLParser *, ::java::lang::String *);
  211. static jboolean access$1(::gnu::xml::stream::XMLParser *);
  212. static ::gnu::xml::stream::XMLParser$Input * access$2(::gnu::xml::stream::XMLParser *);
  213. static ::java::util::LinkedList * access$3(::gnu::xml::stream::XMLParser *);
  214. private:
  215. static const jint INIT = 0;
  216. static const jint PROLOG = 1;
  217. static const jint CONTENT = 2;
  218. static const jint EMPTY_ELEMENT = 3;
  219. static const jint MISC = 4;
  220. static const jint LIT_ENTITY_REF = 2;
  221. static const jint LIT_NORMALIZE = 4;
  222. static const jint LIT_ATTRIBUTE = 8;
  223. static const jint LIT_DISABLE_PE = 16;
  224. static const jint LIT_DISABLE_CREF = 32;
  225. static const jint LIT_DISABLE_EREF = 64;
  226. static const jint LIT_PUBID = 256;
  227. public: // actually package-private
  228. static const jint ATTRIBUTE_DEFAULT_UNDECLARED = 30;
  229. static const jint ATTRIBUTE_DEFAULT_SPECIFIED = 31;
  230. static const jint ATTRIBUTE_DEFAULT_IMPLIED = 32;
  231. static const jint ATTRIBUTE_DEFAULT_REQUIRED = 33;
  232. static const jint ATTRIBUTE_DEFAULT_FIXED = 34;
  233. static const jint START_ENTITY = 50;
  234. static const jint END_ENTITY = 51;
  235. private:
  236. ::gnu::xml::stream::XMLParser$Input * __attribute__((aligned(__alignof__( ::java::lang::Object)))) input;
  237. ::java::util::LinkedList * inputStack;
  238. ::java::util::LinkedList * startEntityStack;
  239. ::java::util::LinkedList * endEntityStack;
  240. jint state;
  241. jint event;
  242. ::java::util::LinkedList * stack;
  243. ::java::util::LinkedList * namespaces;
  244. ::java::util::LinkedList * bases;
  245. ::java::util::ArrayList * attrs;
  246. ::java::lang::StringBuffer * buf;
  247. ::java::lang::StringBuffer * nmtokenBuf;
  248. ::java::lang::StringBuffer * literalBuf;
  249. JArray< jint > * tmpBuf;
  250. ::gnu::xml::stream::XMLParser$ContentModel * currentContentModel;
  251. ::java::util::LinkedList * validationStack;
  252. ::java::util::HashSet * ids;
  253. ::java::util::HashSet * idrefs;
  254. ::java::lang::String * piTarget;
  255. ::java::lang::String * piData;
  256. ::java::lang::String * xmlVersion;
  257. ::java::lang::String * xmlEncoding;
  258. ::java::lang::Boolean * xmlStandalone;
  259. public: // actually package-private
  260. ::gnu::xml::stream::XMLParser$Doctype * doctype;
  261. private:
  262. jboolean expandPE;
  263. jboolean peIsError;
  264. jboolean validating;
  265. jboolean stringInterning;
  266. jboolean coalescing;
  267. jboolean replaceERefs;
  268. jboolean externalEntities;
  269. jboolean supportDTD;
  270. jboolean namespaceAware;
  271. jboolean baseAware;
  272. jboolean extendedEventTypes;
  273. public: // actually package-private
  274. ::javax::xml::stream::XMLReporter * reporter;
  275. ::javax::xml::stream::XMLResolver * resolver;
  276. private:
  277. static ::java::lang::String * TEST_START_ELEMENT;
  278. static ::java::lang::String * TEST_END_ELEMENT;
  279. static ::java::lang::String * TEST_COMMENT;
  280. static ::java::lang::String * TEST_PI;
  281. static ::java::lang::String * TEST_CDATA;
  282. static ::java::lang::String * TEST_XML_DECL;
  283. static ::java::lang::String * TEST_DOCTYPE_DECL;
  284. static ::java::lang::String * TEST_ELEMENT_DECL;
  285. static ::java::lang::String * TEST_ATTLIST_DECL;
  286. static ::java::lang::String * TEST_ENTITY_DECL;
  287. static ::java::lang::String * TEST_NOTATION_DECL;
  288. static ::java::lang::String * TEST_KET;
  289. static ::java::lang::String * TEST_END_COMMENT;
  290. static ::java::lang::String * TEST_END_PI;
  291. static ::java::lang::String * TEST_END_CDATA;
  292. static ::java::util::LinkedHashMap * PREDEFINED_ENTITIES;
  293. public:
  294. static ::java::lang::Class class$;
  295. };
  296. #endif // __gnu_xml_stream_XMLParser__