Home | History | Annotate | Download | only in lib

Lines Matching refs:parser

176    A parser re-uses these structures, maintaining a list of allocated
298 typedef enum XML_Error PTRCALL Processor(XML_Parser parser,
323 handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName);
325 processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
328 initializeEncoding(XML_Parser parser);
330 doProlog(XML_Parser parser, const ENCODING *enc, const char *s,
334 processInternalEntity(XML_Parser parser, ENTITY *entity,
337 doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
341 doCdataSection(XML_Parser parser, const ENCODING *, const char **startPtr,
345 doIgnoreSection(XML_Parser parser, const ENCODING *, const char **startPtr,
350 storeAtts(XML_Parser parser, const ENCODING *, const char *s,
353 addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
357 XML_Bool isId, const XML_Char *dfltValue, XML_Parser parser);
359 storeAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
362 appendAttributeValue(XML_Parser parser, const ENCODING *, XML_Bool isCdata,
365 getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start,
368 setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *);
370 storeEntityValue(XML_Parser parser, const ENCODING *enc, const char *start,
373 reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
376 reportComment(XML_Parser parser, const ENCODING *enc, const char *start,
379 reportDefault(XML_Parser parser, const ENCODING *enc, const char *start,
382 static const XML_Char * getContext(XML_Parser parser);
384 setContext(XML_Parser parser, const XML_Char *context);
426 static int FASTCALL nextScaffoldPart(XML_Parser parser);
427 static XML_Content * build_model(XML_Parser parser);
429 getElementType(XML_Parser parser, const ENCODING *enc,
438 parserInit(XML_Parser parser, const XML_Char *encodingName);
551 #define MALLOC(s) (parser->m_mem.malloc_fcn((s)))
552 #define REALLOC(p,s) (parser->m_mem.realloc_fcn((p),(s)))
553 #define FREE(p) (parser->m_mem.free_fcn((p)))
555 #define userData (parser->m_userData)
556 #define handlerArg (parser->m_handlerArg)
557 #define startElementHandler (parser->m_startElementHandler)
558 #define endElementHandler (parser->m_endElementHandler)
559 #define characterDataHandler (parser->m_characterDataHandler)
561 (parser->m_processingInstructionHandler)
562 #define commentHandler (parser->m_commentHandler)
564 (parser->m_startCdataSectionHandler)
565 #define endCdataSectionHandler (parser->m_endCdataSectionHandler)
566 #define defaultHandler (parser->m_defaultHandler)
567 #define startDoctypeDeclHandler (parser->m_startDoctypeDeclHandler)
568 #define endDoctypeDeclHandler (parser->m_endDoctypeDeclHandler)
570 (parser->m_unparsedEntityDeclHandler)
571 #define notationDeclHandler (parser->m_notationDeclHandler)
573 (parser->m_startNamespaceDeclHandler)
574 #define endNamespaceDeclHandler (parser->m_endNamespaceDeclHandler)
575 #define notStandaloneHandler (parser->m_notStandaloneHandler)
577 (parser->m_externalEntityRefHandler)
579 (parser->m_externalEntityRefHandlerArg)
581 (parser->m_internalEntityRefHandler)
582 #define skippedEntityHandler (parser->m_skippedEntityHandler)
583 #define unknownEncodingHandler (parser->m_unknownEncodingHandler)
584 #define elementDeclHandler (parser->m_elementDeclHandler)
585 #define attlistDeclHandler (parser->m_attlistDeclHandler)
586 #define entityDeclHandler (parser->m_entityDeclHandler)
587 #define xmlDeclHandler (parser->m_xmlDeclHandler)
588 #define encoding (parser->m_encoding)
589 #define initEncoding (parser->m_initEncoding)
590 #define internalEncoding (parser->m_internalEncoding)
591 #define unknownEncodingMem (parser->m_unknownEncodingMem)
592 #define unknownEncodingData (parser->m_unknownEncodingData)
594 (parser->m_unknownEncodingHandlerData)
595 #define unknownEncodingRelease (parser->m_unknownEncodingRelease)
596 #define protocolEncodingName (parser->m_protocolEncodingName)
597 #define ns (parser->m_ns)
598 #define ns_triplets (parser->m_ns_triplets)
599 #define prologState (parser->m_prologState)
600 #define processor (parser->m_processor)
601 #define errorCode (parser->m_errorCode)
602 #define eventPtr (parser->m_eventPtr)
603 #define eventEndPtr (parser->m_eventEndPtr)
604 #define positionPtr (parser->m_positionPtr)
605 #define position (parser->m_position)
606 #define openInternalEntities (parser->m_openInternalEntities)
607 #define freeInternalEntities (parser->m_freeInternalEntities)
609 (parser->m_defaultExpandInternalEntities)
610 #define tagLevel (parser->m_tagLevel)
611 #define buffer (parser->m_buffer)
612 #define bufferPtr (parser->m_bufferPtr)
613 #define bufferEnd (parser->m_bufferEnd)
614 #define parseEndByteIndex (parser->m_parseEndByteIndex)
615 #define parseEndPtr (parser->m_parseEndPtr)
616 #define bufferLim (parser->m_bufferLim)
617 #define dataBuf (parser->m_dataBuf)
618 #define dataBufEnd (parser->m_dataBufEnd)
619 #define _dtd (parser->m_dtd)
620 #define curBase (parser->m_curBase)
621 #define declEntity (parser->m_declEntity)
622 #define doctypeName (parser->m_doctypeName)
623 #define doctypeSysid (parser->m_doctypeSysid)
624 #define doctypePubid (parser->m_doctypePubid)
625 #define declAttributeType (parser->m_declAttributeType)
626 #define declNotationName (parser->m_declNotationName)
627 #define declNotationPublicId (parser->m_declNotationPublicId)
628 #define declElementType (parser->m_declElementType)
629 #define declAttributeId (parser->m_declAttributeId)
630 #define declAttributeIsCdata (parser->m_declAttributeIsCdata)
631 #define declAttributeIsId (parser->m_declAttributeIsId)
632 #define freeTagList (parser->m_freeTagList)
633 #define freeBindingList (parser->m_freeBindingList)
634 #define inheritedBindings (parser->m_inheritedBindings)
635 #define tagStack (parser->m_tagStack)
636 #define atts (parser->m_atts)
637 #define attsSize (parser->m_attsSize)
638 #define nSpecifiedAtts (parser->m_nSpecifiedAtts)
639 #define idAttIndex (parser->m_idAttIndex)
640 #define nsAtts (parser->m_nsAtts)
641 #define nsAttsVersion (parser->m_nsAttsVersion)
642 #define nsAttsPower (parser->m_nsAttsPower)
643 #define tempPool (parser->m_tempPool)
644 #define temp2Pool (parser->m_temp2Pool)
645 #define groupConnector (parser->m_groupConnector)
646 #define groupSize (parser->m_groupSize)
647 #define namespaceSeparator (parser->m_namespaceSeparator)
648 #define parentParser (parser->m_parentParser)
649 #define ps_parsing (parser->m_parsingStatus.parsing)
650 #define ps_finalBuffer (parser->m_parsingStatus.finalBuffer)
652 #define isParamEntity (parser->m_isParamEntity)
653 #define useForeignDTD (parser->m_useForeignDTD)
654 #define paramEntityParsing (parser->m_paramEntityParsing)
685 XML_Parser parser = parserCreate(encodingName, memsuite, nameSep, NULL);
686 if (parser != NULL && ns) {
687 /* implicit context only set for root parser, since child
690 if (!setContext(parser, implicitContext)) {
691 XML_ParserFree(parser);
695 return parser;
704 XML_Parser parser;
708 parser = (XML_Parser)
710 if (parser != NULL) {
711 mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem);
719 parser = (XML_Parser)malloc(sizeof(struct XML_ParserStruct));
720 if (parser != NULL) {
721 mtemp = (XML_Memory_Handling_Suite *)&(parser->m_mem);
728 if (!parser)
729 return parser;
737 FREE(parser);
743 FREE(parser);
751 _dtd = dtdCreate(&parser->m_mem);
755 FREE(parser);
778 poolInit(&tempPool, &(parser->m_mem));
779 poolInit(&temp2Pool, &(parser->m_mem));
780 parserInit(parser, encodingName);
783 XML_ParserFree(parser);
796 return parser;
800 parserInit(XML_Parser parser, const XML_Char *encodingName)
827 externalEntityRefHandlerArg = parser;
873 moveToFreeBindingList(XML_Parser parser, BINDING *bindings)
884 XML_ParserReset(XML_Parser parser, const XML_Char *encodingName)
896 moveToFreeBindingList(parser, tag->bindings);
908 moveToFreeBindingList(parser, inheritedBindings);
914 parserInit(parser, encodingName);
915 dtdReset(_dtd, &parser->m_mem);
916 return setContext(parser, implicitContext);
920 XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName)
943 XML_Parser parser = oldParser;
992 access look more like C++ require that `parser' be overwritten
999 parser = parserCreate(encodingName, &parser->m_mem, tmp, newDtd);
1002 parser = parserCreate(encodingName, &parser->m_mem, NULL, newDtd);
1005 if (!parser)
1033 handlerArg = parser;
1044 if (!dtdCopy(_dtd, oldDtd, &parser->m_mem)
1045 || !setContext(parser, context)) {
1046 XML_ParserFree(parser);
1054 root parser and external PE parsers, therefore one does not need to
1057 _dtd with ones that get destroyed with the external PE parser.
1065 return parser;
1069 destroyBindings(BINDING *bindings, XML_Parser parser)
1082 XML_ParserFree(XML_Parser parser)
1086 if (parser == NULL)
1101 destroyBindings(p->bindings, parser);
1119 destroyBindings(freeBindingList, parser);
1120 destroyBindings(inheritedBindings, parser);
1125 parser->m_dtd with the root parser, so we must not destroy it
1131 dtdDestroy(_dtd, (XML_Bool)!parentParser, &parser->m_mem);
1140 FREE(parser);
1144 XML_UseParserAsHandlerArg(XML_Parser parser)
1146 handlerArg = parser;
1150 XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD)
1164 XML_SetReturnNSTriplet(XML_Parser parser, int do_nst)
1173 XML_SetUserData(XML_Parser parser, void *p)
1182 XML_SetBase(XML_Parser parser, const XML_Char *p)
1196 XML_GetBase(XML_Parser parser)
1202 XML_GetSpecifiedAttributeCount(XML_Parser parser)
1208 XML_GetIdAttributeIndex(XML_Parser parser)
1214 XML_SetElementHandler(XML_Parser parser,
1223 XML_SetStartElementHandler(XML_Parser parser,
1229 XML_SetEndElementHandler(XML_Parser parser,
1235 XML_SetCharacterDataHandler(XML_Parser parser,
1242 XML_SetProcessingInstructionHandler(XML_Parser parser,
1249 XML_SetCommentHandler(XML_Parser parser,
1256 XML_SetCdataSectionHandler(XML_Parser parser,
1265 XML_SetStartCdataSectionHandler(XML_Parser parser,
1271 XML_SetEndCdataSectionHandler(XML_Parser parser,
1277 XML_SetDefaultHandler(XML_Parser parser,
1285 XML_SetDefaultHandlerExpand(XML_Parser parser,
1293 XML_SetDoctypeDeclHandler(XML_Parser parser,
1302 XML_SetStartDoctypeDeclHandler(XML_Parser parser,
1308 XML_SetEndDoctypeDeclHandler(XML_Parser parser,
1314 XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
1321 XML_SetNotationDeclHandler(XML_Parser parser,
1328 XML_SetNamespaceDeclHandler(XML_Parser parser,
1337 XML_SetStartNamespaceDeclHandler(XML_Parser parser,
1343 XML_SetEndNamespaceDeclHandler(XML_Parser parser,
1349 XML_SetNotStandaloneHandler(XML_Parser parser,
1356 XML_SetExternalEntityRefHandler(XML_Parser parser,
1363 XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg)
1368 externalEntityRefHandlerArg = parser;
1372 XML_SetSkippedEntityHandler(XML_Parser parser,
1379 XML_SetUnknownEncodingHandler(XML_Parser parser,
1388 XML_SetElementDeclHandler(XML_Parser parser,
1395 XML_SetAttlistDeclHandler(XML_Parser parser,
1402 XML_SetEntityDeclHandler(XML_Parser parser,
1409 XML_SetXmlDeclHandler(XML_Parser parser,
1415 XML_SetParamEntityParsing(XML_Parser parser,
1430 XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
1454 errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr);
1483 errorCode = processor(parser, s, parseEndPtr = s + len, &end);
1539 void *buff = XML_GetBuffer(parser, len);
1544 return XML_ParseBuffer(parser, len, isFinal);
1550 XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
1573 errorCode = processor(parser, start, parseEndPtr, &bufferPtr);
1601 XML_GetBuffer(XML_Parser parser, int len)
1680 XML_StopParser(XML_Parser parser, XML_Bool resumable)
1710 XML_ResumeParser(XML_Parser parser)
1720 errorCode = processor(parser, bufferPtr, parseEndPtr, &bufferPtr);
1748 XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status)
1751 *status = parser->m_parsingStatus;
1755 XML_GetErrorCode(XML_Parser parser)
1761 XML_GetCurrentByteIndex(XML_Parser parser)
1769 XML_GetCurrentByteCount(XML_Parser parser)
1777 XML_GetInputContext(XML_Parser parser, int *offset, int *size)
1790 XML_GetCurrentLineNumber(XML_Parser parser)
1800 XML_GetCurrentColumnNumber(XML_Parser parser)
1810 XML_FreeContentModel(XML_Parser parser, XML_Content *model)
1816 XML_MemMalloc(XML_Parser parser, size_t size)
1822 XML_MemRealloc(XML_Parser parser, void *ptr, size_t size)
1828 XML_MemFree(XML_Parser parser, void *ptr)
1834 XML_DefaultCurrent(XML_Parser parser)
1838 reportDefault(parser,
1843 reportDefault(parser, encoding, eventPtr, eventEndPtr);
1874 XML_L("unexpected parser state - please send a bug report"),
1884 XML_L("parser suspended"),
1885 XML_L("parser not suspended"),
1972 storeRawNames(XML_Parser parser)
2017 contentProcessor(XML_Parser parser,
2022 enum XML_Error result = doContent(parser, 0, encoding, start, end,
2025 if (!storeRawNames(parser))
2032 externalEntityInitProcessor(XML_Parser parser,
2037 enum XML_Error result = initializeEncoding(parser);
2041 return externalEntityInitProcessor2(parser, start, end, endPtr);
2045 externalEntityInitProcessor2(XML_Parser parser,
2081 return externalEntityInitProcessor3(parser, start, end, endPtr);
2085 externalEntityInitProcessor3(XML_Parser parser,
2100 result = processXmlDecl(parser, 1, start, next);
2129 return externalEntityContentProcessor(parser, start, end, endPtr);
2133 externalEntityContentProcessor(XML_Parser parser,
2138 enum XML_Error result = doContent(parser, 1, encoding, start, end,
2141 if (!storeRawNames(parser))
2148 doContent(XML_Parser parser,
2187 reportDefault(parser, enc, s, end);
2235 reportDefault(parser, enc, s, next);
2259 reportDefault(parser, enc, s, next);
2272 reportDefault(parser, enc, s, next);
2275 result = processInternalEntity(parser, entity, XML_FALSE);
2282 context = getContext(parser);
2295 reportDefault(parser, enc, s, next);
2356 result = storeAtts(parser, enc, s, &(tag->name), &(tag->bindings));
2363 reportDefault(parser, enc, s, next);
2381 result = storeAtts(parser, enc, s, &name, &bindings);
2396 reportDefault(parser, enc, s, next);
2409 return epilogProcessor(parser, next, end, nextPtr);
2452 reportDefault(parser, enc, s, next);
2463 return epilogProcessor(parser, next, end, nextPtr);
2476 reportDefault(parser, enc, s, next);
2487 reportDefault(parser, enc, s, next);
2511 reportDefault(parser, enc, s, next);
2512 result = doCdataSection(parser, enc, &next, end, nextPtr, haveMore);
2539 reportDefault(parser, enc, s, end);
2575 reportDefault(parser, enc, s, next);
2579 if (!reportProcessingInstruction(parser, enc, s, next))
2583 if (!reportComment(parser, enc, s, next))
2588 reportDefault(parser, enc, s, next);
2615 storeAtts(XML_Parser parser, const ENCODING *enc,
2642 if (ns && !setElementTypePrefix(parser, elementType))
2664 ATTRIBUTE_ID *attId = getAttributeId(parser, enc, atts[i].name,
2696 result = storeAttributeValue(parser, enc, isCdata,
2716 enum XML_Error result = addBinding(parser, attId->prefix, attId,
2751 enum XML_Error result = addBinding(parser, da->id->prefix, da->id,
2946 addBinding(XML_Parser parser, PREFIX *prefix, const ATTRIBUTE_ID *attId,
3063 cdataSectionProcessor(XML_Parser parser,
3068 enum XML_Error result = doCdataSection(parser, encoding, &start, end,
3075 return externalEntityContentProcessor(parser, start, end, endPtr);
3079 return contentProcessor(parser, start, end, endPtr);
3089 doCdataSection(XML_Parser parser,
3125 reportDefault(parser, enc, s, next);
3138 reportDefault(parser, enc, s, next);
3162 reportDefault(parser, enc, s, next);
3205 ignoreSectionProcessor(XML_Parser parser,
3210 enum XML_Error result = doIgnoreSection(parser, encoding, &start, end,
3216 return prologProcessor(parser, start, end, endPtr);
3225 doIgnoreSection(XML_Parser parser,
3253 reportDefault(parser, enc, s, next);
3286 initializeEncoding(XML_Parser parser)
3311 return handleUnknownEncoding(parser, protocolEncodingName);
3315 processXmlDecl(XML_Parser parser, int isGeneralTextEntity,
3371 reportDefault(parser, encoding, s, next);
3389 result = handleUnknownEncoding(parser, storedEncName);
3404 handleUnknownEncoding(XML_Parser parser, const XML_Char *encodingName)
3443 prologInitProcessor(XML_Parser parser,
3448 enum XML_Error result = initializeEncoding(parser);
3452 return prologProcessor(parser, s, end, nextPtr);
3458 externalParEntInitProcessor(XML_Parser parser,
3463 enum XML_Error result = initializeEncoding(parser);
3473 return entityValueInitProcessor(parser, s, end, nextPtr);
3477 return externalParEntProcessor(parser, s, end, nextPtr);
3482 entityValueInitProcessor(XML_Parser parser,
3512 return storeEntityValue(parser, encoding, s, end);
3516 result = processXmlDecl(parser, 0, start, next);
3530 return entityValueProcessor(parser, next, end, nextPtr);
3549 externalParEntProcessor(XML_Parser parser,
3585 return doProlog(parser, encoding, s, end, tok, next,
3590 entityValueProcessor(XML_Parser parser,
3619 return storeEntityValue(parser, enc, s, end);
3628 prologProcessor(XML_Parser parser,
3635 return doProlog(parser, encoding, s, end, tok, next,
3640 doProlog(XML_Parser parser,
3736 enum XML_Error result = processXmlDecl(parser, 0, s, next);
3766 enum XML_Error result = processXmlDecl(parser, 1, s, next);
3905 return contentProcessor(parser, s, end, nextPtr);
3907 declElementType = getElementType(parser, enc, s, next);
3912 declAttributeId = getAttributeId(parser, enc, s, next);
3973 0, parser))
4000 storeAttributeValue(parser, enc, declAttributeIsCdata,
4010 declAttributeIsCdata, XML_FALSE, attVal, parser))
4035 enum XML_Error result = storeEntityValue(parser, enc,
4177 /* if we have a parent parser or are reading an internal parameter
4209 /* if we have a parent parser or are reading an internal parameter
4298 reportDefault(parser, enc, s, next);
4300 result = doIgnoreSection(parser, enc, &next, end, nextPtr, haveMore);
4333 int myindex = nextScaffoldPart(parser);
4409 result = processInternalEntity(parser, entity, betweenDecl);
4449 declElementType = getElementType(parser, enc, s, next);
4509 int myindex = nextScaffoldPart(parser);
4514 el = getElementType(parser, enc, s, nxt);
4546 XML_Content *model = build_model(parser);
4560 if (!reportProcessingInstruction(parser, enc, s, next))
4565 if (!reportComment(parser, enc, s, next))
4599 reportDefault(parser, enc, s, next);
4616 epilogProcessor(XML_Parser parser,
4631 reportDefault(parser, encoding, s, next);
4642 reportDefault(parser, encoding, s, next);
4645 if (!reportProcessingInstruction(parser, encoding, s, next))
4649 if (!reportComment(parser, encoding, s, next))
4683 processInternalEntity(XML_Parser parser, ENTITY *entity,
4715 result = doProlog(parser, internalEncoding, textStart, textEnd, tok,
4720 result = doContent(parser, tagLevel, internalEncoding, textStart,
4740 internalEntityProcessor(XML_Parser parser,
4760 result = doProlog(parser, internalEncoding, textStart, textEnd, tok,
4765 result = doContent(parser, openEntity->startTagLevel, internalEncoding,
4787 return doProlog(parser, encoding, s, end, tok, next, nextPtr,
4795 return doContent(parser, parentParser ? 1 : 0, encoding, s, end,
4801 errorProcessor(XML_Parser parser,
4810 storeAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
4814 enum XML_Error result = appendAttributeValue(parser, enc, isCdata, ptr,
4826 appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
4933 reportDefault(parser, enc, ptr, next);
4956 result = appendAttributeValue(parser, internalEncoding, isCdata,
4976 storeEntityValue(XML_Parser parser,
5052 result = storeEntityValue(parser,
5165 reportProcessingInstruction(XML_Parser parser, const ENCODING *enc,
5173 reportDefault(parser, enc, start, end);
5194 reportComment(XML_Parser parser, const ENCODING *enc,
5200 reportDefault(parser, enc, start, end);
5216 reportDefault(XML_Parser parser, const ENCODING *enc,
5245 XML_Bool isId, const XML_Char *value, XML_Parser parser)
5288 setElementTypePrefix(XML_Parser parser, ELEMENT_TYPE *elementType)
5318 getAttributeId(XML_Parser parser, const ENCODING *enc,
5381 getContext(XML_Parser parser)
5450 setContext(XML_Parser parser, const XML_Char *context)
5493 if (addBinding(parser, prefix, NULL, poolStart(&tempPool),
6158 nextScaffoldPart(XML_Parser parser)
6206 build_node(XML_Parser parser,
6237 build_node(parser, cn, &(dest->children[i]), contpos, strpos);
6244 build_model (XML_Parser parser)
6260 build_node(parser, 0, ret, &cpos, &str);
6265 getElementType(XML_Parser parser,
6283 if (!setElementTypePrefix(parser, ret))