sax/qxml.cpp

Switch to Source codePreprocessed file
LineSource CodeCoverage
1 -
2 -
3 -
4static const signed char cltWS = 0; -
5static const signed char cltPer = 1; -
6static const signed char cltAmp = 2; -
7static const signed char cltGt = 3; -
8static const signed char cltLt = 4; -
9static const signed char cltSlash = 5; -
10static const signed char cltQm = 6; -
11static const signed char cltEm = 7; -
12static const signed char cltDash = 8; -
13static const signed char cltCB = 9; -
14static const signed char cltOB = 10; -
15static const signed char cltEq = 11; -
16static const signed char cltDq = 12; -
17static const signed char cltSq = 13; -
18static const signed char cltUnknown = 14; -
19 -
20 -
21 -
22bool qt_xml_skipped_entity_in_content; -
23 -
24 -
25static const signed char charLookupTable[256]={ -
26 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
27 cltUnknown, -
28 cltWS, -
29 cltWS, -
30 cltUnknown, -
31 cltUnknown, -
32 cltWS, -
33 cltUnknown, -
34 cltUnknown, -
35 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
36 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
37 cltWS, -
38 cltEm, -
39 cltDq, -
40 cltUnknown, -
41 cltUnknown, -
42 cltPer, -
43 cltAmp, -
44 cltSq, -
45 cltUnknown, -
46 cltUnknown, -
47 cltUnknown, -
48 cltUnknown, -
49 cltUnknown, -
50 cltDash, -
51 cltUnknown, -
52 cltSlash, -
53 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
54 cltUnknown, -
55 cltUnknown, -
56 cltUnknown, -
57 cltUnknown, -
58 cltLt, -
59 cltEq, -
60 cltGt, -
61 cltQm, -
62 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
63 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
64 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
65 cltUnknown, -
66 cltUnknown, -
67 cltUnknown, -
68 cltOB, -
69 cltUnknown, -
70 cltCB, -
71 cltUnknown, -
72 cltUnknown, -
73 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
74 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
75 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
76 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
77 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
78 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
79 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
80 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
81 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
82 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
83 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
84 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
85 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
86 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
87 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
88 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
89 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
90 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
91 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, -
92 cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown -
93}; -
94static bool stripTextDecl(QString& str) -
95{ -
96 QString textDeclStart(QLatin1String("<?xml")); -
97 if (str.startsWith(textDeclStart)) {
never evaluated: str.startsWith(textDeclStart)
0
98 QRegExp textDecl(QString::fromLatin1( -
99 "^<\\?xml\\s+" -
100 "(version\\s*=\\s*((['\"])[-a-zA-Z0-9_.:]+\\3))?" -
101 "\\s*" -
102 "(encoding\\s*=\\s*((['\"])[A-Za-z][-a-zA-Z0-9_.]*\\6))?" -
103 "\\s*\\?>" -
104 )); -
105 QString strTmp = str.replace(textDecl, QLatin1String("")); -
106 if (strTmp.length() != str.length())
never evaluated: strTmp.length() != str.length()
0
107 return false;
never executed: return false;
0
108 str = strTmp; -
109 }
never executed: }
0
110 return true;
never executed: return true;
0
111} -
112 -
113 -
114class QXmlAttributesPrivate -
115{ -
116}; -
117class QXmlInputSourcePrivate -
118{ -
119public: -
120 QIODevice *inputDevice; -
121 QTextStream *inputStream; -
122 -
123 QString str; -
124 const QChar *unicode; -
125 int pos; -
126 int length; -
127 bool nextReturnedEndOfData; -
128 -
129 QTextDecoder *encMapper; -
130 -
131 -
132 QByteArray encodingDeclBytes; -
133 QString encodingDeclChars; -
134 bool lookingForEncodingDecl; -
135}; -
136class QXmlParseExceptionPrivate -
137{ -
138public: -
139 QXmlParseExceptionPrivate() -
140 : column(-1), line(-1) -
141 { -
142 }
executed: }
Execution Count:159
159
143 QXmlParseExceptionPrivate(const QXmlParseExceptionPrivate &other) -
144 : msg(other.msg), column(other.column), line(other.line), -
145 pub(other.pub), sys(other.sys) -
146 { -
147 }
executed: }
Execution Count:2
2
148 -
149 QString msg; -
150 int column; -
151 int line; -
152 QString pub; -
153 QString sys; -
154 -
155}; -
156 -
157class QXmlLocatorPrivate -
158{ -
159}; -
160 -
161class QXmlDefaultHandlerPrivate -
162{ -
163}; -
164 -
165class QXmlSimpleReaderPrivate -
166{ -
167public: -
168 ~QXmlSimpleReaderPrivate(); -
169private: -
170 -
171 QXmlSimpleReaderPrivate(QXmlSimpleReader *reader); -
172 void initIncrementalParsing(); -
173 -
174 -
175 QStack<QString> tags; -
176 -
177 -
178 enum EntityRecognitionContext { InContent, InAttributeValue, InEntityValue, InDTD }; -
179 -
180 -
181 struct ExternParameterEntity -
182 { -
183 ExternParameterEntity() {} -
184 ExternParameterEntity(const QString &p, const QString &s) -
185 : publicId(p), systemId(s) {}
executed: }
Execution Count:62
62
186 QString publicId; -
187 QString systemId; -
188 -
189 -
190 }; -
191 struct ExternEntity -
192 { -
193 ExternEntity() {} -
194 ExternEntity(const QString &p, const QString &s, const QString &n) -
195 : publicId(p), systemId(s), notation(n) {}
executed: }
Execution Count:188
188
196 QString publicId; -
197 QString systemId; -
198 QString notation; -
199 -
200 }; -
201 QMap<QString,ExternParameterEntity> externParameterEntities; -
202 QMap<QString,QString> parameterEntities; -
203 QMap<QString,ExternEntity> externEntities; -
204 QMap<QString,QString> entities; -
205 -
206 -
207 struct XmlRef { -
208 XmlRef() -
209 : index(0) {}
never executed: }
0
210 XmlRef(const QString &_name, const QString &_value) -
211 : name(_name), value(_value), index(0) {}
executed: }
Execution Count:2826
2826
212 bool isEmpty() const { return index == value.length(); }
executed: return index == value.length();
Execution Count:14221
14221
213 QChar next() { return value.at(index++); }
executed: return value.at(index++);
Execution Count:11417
11417
214 QString name; -
215 QString value; -
216 int index; -
217 }; -
218 QStack<XmlRef> xmlRefStack; -
219 -
220 -
221 enum Standalone { Yes, No, Unknown }; -
222 -
223 QString doctype; -
224 QString xmlVersion; -
225 QString encoding; -
226 Standalone standalone; -
227 -
228 QString publicId; -
229 QString systemId; -
230 -
231 -
232 -
233 -
234 -
235 -
236 QString thisPublicId; -
237 QString thisSystemId; -
238 -
239 QString attDeclEName; -
240 QString attDeclAName; -
241 -
242 -
243 bool useNamespaces; -
244 bool useNamespacePrefixes; -
245 bool reportWhitespaceCharData; -
246 bool reportEntities; -
247 -
248 -
249 QXmlAttributes attList; -
250 -
251 -
252 -
253 bool contentCharDataRead; -
254 -
255 -
256 QScopedPointer<QXmlLocator> locator; -
257 QXmlNamespaceSupport namespaceSupport; -
258 -
259 -
260 QString error; -
261 -
262 -
263 -
264 bool parsePI_xmldecl; -
265 bool parseName_useRef; -
266 bool parseReference_charDataRead; -
267 EntityRecognitionContext parseReference_context; -
268 bool parseExternalID_allowPublicID; -
269 EntityRecognitionContext parsePEReference_context; -
270 QString parseString_s; -
271 -
272 -
273 struct ParseState { -
274 typedef bool (QXmlSimpleReaderPrivate::*ParseFunction)(); -
275 ParseFunction function; -
276 int state; -
277 }; -
278 QStack<ParseState> *parseStack; -
279 -
280 -
281 bool xmldecl_possible; -
282 bool doctype_read; -
283 -
284 -
285 bool startDTDwasReported; -
286 -
287 -
288 signed char Done; -
289 -
290 -
291 -
292 QXmlContentHandler *contentHnd; -
293 QXmlErrorHandler *errorHnd; -
294 QXmlDTDHandler *dtdHnd; -
295 QXmlEntityResolver *entityRes; -
296 QXmlLexicalHandler *lexicalHnd; -
297 QXmlDeclHandler *declHnd; -
298 -
299 QXmlInputSource *inputSource; -
300 -
301 QChar c; -
302 int lineNr; -
303 int columnNr; -
304 -
305 QChar nameArray[256]; -
306 QString nameValue; -
307 int nameArrayPos; -
308 int nameValueLen; -
309 QChar refArray[256]; -
310 QString refValue; -
311 int refArrayPos; -
312 int refValueLen; -
313 QChar stringArray[256]; -
314 QString stringValue; -
315 int stringArrayPos; -
316 int stringValueLen; -
317 QString emptyStr; -
318 -
319 const QString &string(); -
320 void stringClear(); -
321 void stringAddC(QChar); -
322 inline void stringAddC() { stringAddC(c); }
executed: }
Execution Count:2172170
2172170
323 const QString &name(); -
324 void nameClear(); -
325 void nameAddC(QChar); -
326 inline void nameAddC() { nameAddC(c); }
executed: }
Execution Count:448708
448708
327 const QString &ref(); -
328 void refClear(); -
329 void refAddC(QChar); -
330 inline void refAddC() { refAddC(c); }
executed: }
Execution Count:37949
37949
331 -
332 -
333 bool eat_ws(); -
334 bool next_eat_ws(); -
335 -
336 void next(); -
337 bool atEnd(); -
338 -
339 void init(const QXmlInputSource* i); -
340 void initData(); -
341 -
342 bool entityExist(const QString&) const; -
343 -
344 bool parseBeginOrContinue(int state, bool incremental); -
345 -
346 bool parseProlog(); -
347 bool parseElement(); -
348 bool processElementEmptyTag(); -
349 bool processElementETagBegin2(); -
350 bool processElementAttribute(); -
351 bool parseMisc(); -
352 bool parseContent(); -
353 -
354 bool parsePI(); -
355 bool parseDoctype(); -
356 bool parseComment(); -
357 -
358 bool parseName(); -
359 bool parseNmtoken(); -
360 bool parseAttribute(); -
361 bool parseReference(); -
362 bool processReference(); -
363 -
364 bool parseExternalID(); -
365 bool parsePEReference(); -
366 bool parseMarkupdecl(); -
367 bool parseAttlistDecl(); -
368 bool parseAttType(); -
369 bool parseAttValue(); -
370 bool parseElementDecl(); -
371 bool parseNotationDecl(); -
372 bool parseChoiceSeq(); -
373 bool parseEntityDecl(); -
374 bool parseEntityValue(); -
375 -
376 bool parseString(); -
377 -
378 bool insertXmlRef(const QString&, const QString&, bool); -
379 -
380 bool reportEndEntities(); -
381 void reportParseError(const QString& error); -
382 -
383 typedef bool (QXmlSimpleReaderPrivate::*ParseFunction) (); -
384 void unexpectedEof(ParseFunction where, int state); -
385 void parseFailed(ParseFunction where, int state); -
386 void pushParseState(ParseFunction function, int state); -
387 -
388 inline QXmlSimpleReader* q_func() { return static_cast<QXmlSimpleReader *>(q_ptr); } inline const QXmlSimpleReader* q_func() const { return static_cast<const QXmlSimpleReader *>(q_ptr); } friend class QXmlSimpleReader; -
389 QXmlSimpleReader *q_ptr; -
390 -
391 friend class QXmlSimpleReaderLocator; -
392}; -
393QXmlParseException::QXmlParseException(const QString& name, int c, int l, -
394 const QString& p, const QString& s) -
395 : d(new QXmlParseExceptionPrivate) -
396{ -
397 d->msg = name; -
398 d->column = c; -
399 d->line = l; -
400 d->pub = p; -
401 d->sys = s; -
402}
executed: }
Execution Count:159
159
403 -
404 -
405 -
406 -
407QXmlParseException::QXmlParseException(const QXmlParseException& other) : -
408 d(new QXmlParseExceptionPrivate(*other.d)) -
409{ -
410 -
411}
executed: }
Execution Count:2
2
412 -
413 -
414 -
415 -
416QXmlParseException::~QXmlParseException() -
417{ -
418} -
419 -
420 -
421 -
422 -
423QString QXmlParseException::message() const -
424{ -
425 return d->msg;
executed: return d->msg;
Execution Count:299
299
426} -
427 -
428 -
429 -
430int QXmlParseException::columnNumber() const -
431{ -
432 return d->column;
executed: return d->column;
Execution Count:299
299
433} -
434 -
435 -
436 -
437int QXmlParseException::lineNumber() const -
438{ -
439 return d->line;
executed: return d->line;
Execution Count:299
299
440} -
441 -
442 -
443 -
444QString QXmlParseException::publicId() const -
445{ -
446 return d->pub;
executed: return d->pub;
Execution Count:145
145
447} -
448 -
449 -
450 -
451QString QXmlParseException::systemId() const -
452{ -
453 return d->sys;
executed: return d->sys;
Execution Count:145
145
454} -
455QXmlLocator::QXmlLocator() -
456{ -
457} -
458 -
459 -
460 -
461 -
462QXmlLocator::~QXmlLocator() -
463{ -
464} -
465class QXmlSimpleReaderLocator : public QXmlLocator -
466{ -
467public: -
468 QXmlSimpleReaderLocator(QXmlSimpleReader* parent) -
469 { -
470 reader = parent; -
471 }
executed: }
Execution Count:2247
2247
472 ~QXmlSimpleReaderLocator() -
473 { -
474 } -
475 -
476 int columnNumber() const -
477 { -
478 return (reader->d_ptr->columnNr == -1 ? -1 : reader->d_ptr->columnNr + 1);
executed: return (reader->d_ptr->columnNr == -1 ? -1 : reader->d_ptr->columnNr + 1);
Execution Count:78305
78305
479 } -
480 int lineNumber() const -
481 { -
482 return (reader->d_ptr->lineNr == -1 ? -1 : reader->d_ptr->lineNr + 1);
executed: return (reader->d_ptr->lineNr == -1 ? -1 : reader->d_ptr->lineNr + 1);
Execution Count:78305
78305
483 } -
484 -
485 -
486 -
487private: -
488 QXmlSimpleReader *reader; -
489}; -
490 -
491 -
492 -
493 -
494 -
495 -
496 -
497typedef QMap<QString, QString> NamespaceMap; -
498 -
499class QXmlNamespaceSupportPrivate -
500{ -
501public: -
502 QXmlNamespaceSupportPrivate() -
503 { -
504 ns.insert(QLatin1String("xml"), QLatin1String("http://www.w3.org/XML/1998/namespace")); -
505 }
executed: }
Execution Count:2247
2247
506 -
507 ~QXmlNamespaceSupportPrivate() -
508 { -
509 } -
510 -
511 QStack<NamespaceMap> nsStack; -
512 NamespaceMap ns; -
513}; -
514QXmlNamespaceSupport::QXmlNamespaceSupport() -
515{ -
516 d = new QXmlNamespaceSupportPrivate; -
517}
executed: }
Execution Count:2247
2247
518 -
519 -
520 -
521 -
522QXmlNamespaceSupport::~QXmlNamespaceSupport() -
523{ -
524 delete d; -
525}
executed: }
Execution Count:2247
2247
526void QXmlNamespaceSupport::setPrefix(const QString& pre, const QString& uri) -
527{ -
528 if(pre.isNull()) {
evaluated: pre.isNull()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:14
5-14
529 d->ns.insert(QLatin1String(""), uri); -
530 } else {
executed: }
Execution Count:5
5
531 d->ns.insert(pre, uri); -
532 }
executed: }
Execution Count:14
14
533} -
534QString QXmlNamespaceSupport::prefix(const QString& uri) const -
535{ -
536 NamespaceMap::const_iterator itc, it = d->ns.constBegin(); -
537 while ((itc=it) != d->ns.constEnd()) {
never evaluated: (itc=it) != d->ns.constEnd()
0
538 ++it; -
539 if (*itc == uri && !itc.key().isEmpty())
never evaluated: *itc == uri
never evaluated: !itc.key().isEmpty()
0
540 return itc.key();
never executed: return itc.key();
0
541 }
never executed: }
0
542 return QLatin1String("");
never executed: return QLatin1String("");
0
543} -
544 -
545 -
546 -
547 -
548 -
549 -
550QString QXmlNamespaceSupport::uri(const QString& prefix) const -
551{ -
552 return d->ns[prefix];
executed: return d->ns[prefix];
Execution Count:46
46
553} -
554 -
555 -
556 -
557 -
558 -
559 -
560 -
561void QXmlNamespaceSupport::splitName(const QString& qname, QString& prefix, -
562 QString& localname) const -
563{ -
564 int pos = qname.indexOf(QLatin1Char(':')); -
565 if (pos == -1)
evaluated: pos == -1
TRUEFALSE
yes
Evaluation Count:12005
yes
Evaluation Count:48
48-12005
566 pos = qname.size();
executed: pos = qname.size();
Execution Count:12005
12005
567 -
568 prefix = qname.left(pos); -
569 localname = qname.mid(pos+1); -
570}
executed: }
Execution Count:12053
12053
571void QXmlNamespaceSupport::processName(const QString& qname, -
572 bool isAttribute, -
573 QString& nsuri, QString& localname) const -
574{ -
575 int len = qname.size(); -
576 const QChar *data = qname.constData(); -
577 for (int pos = 0; pos < len; ++pos) {
evaluated: pos < len
TRUEFALSE
yes
Evaluation Count:96816
yes
Evaluation Count:21326
21326-96816
578 if (data[pos] == QLatin1Char(':')) {
evaluated: data[pos] == QLatin1Char(':')
TRUEFALSE
yes
Evaluation Count:46
yes
Evaluation Count:96770
46-96770
579 nsuri = uri(qname.left(pos)); -
580 localname = qname.mid(pos + 1); -
581 return;
executed: return;
Execution Count:46
46
582 } -
583 }
executed: }
Execution Count:96770
96770
584 -
585 -
586 nsuri.clear(); -
587 -
588 if (!isAttribute && !d->ns.isEmpty()) {
evaluated: !isAttribute
TRUEFALSE
yes
Evaluation Count:9326
yes
Evaluation Count:12000
partially evaluated: !d->ns.isEmpty()
TRUEFALSE
yes
Evaluation Count:9326
no
Evaluation Count:0
0-12000
589 -
590 -
591 -
592 -
593 -
594 NamespaceMap::const_iterator first = d->ns.constBegin(); -
595 if (first.key().isEmpty())
evaluated: first.key().isEmpty()
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:9301
25-9301
596 nsuri = first.value();
executed: nsuri = first.value();
Execution Count:25
25
597 }
executed: }
Execution Count:9326
9326
598 localname = qname; -
599}
executed: }
Execution Count:21326
21326
600QStringList QXmlNamespaceSupport::prefixes() const -
601{ -
602 QStringList list; -
603 -
604 NamespaceMap::const_iterator itc, it = d->ns.constBegin(); -
605 while ((itc=it) != d->ns.constEnd()) {
evaluated: (itc=it) != d->ns.constEnd()
TRUEFALSE
yes
Evaluation Count:473
yes
Evaluation Count:458
458-473
606 ++it; -
607 if (!itc.key().isEmpty())
evaluated: !itc.key().isEmpty()
TRUEFALSE
yes
Evaluation Count:472
yes
Evaluation Count:1
1-472
608 list.append(itc.key());
executed: list.append(itc.key());
Execution Count:472
472
609 }
executed: }
Execution Count:473
473
610 return list;
executed: return list;
Execution Count:458
458
611} -
612QStringList QXmlNamespaceSupport::prefixes(const QString& uri) const -
613{ -
614 QStringList list; -
615 -
616 NamespaceMap::const_iterator itc, it = d->ns.constBegin(); -
617 while ((itc=it) != d->ns.constEnd()) {
never evaluated: (itc=it) != d->ns.constEnd()
0
618 ++it; -
619 if (*itc == uri && !itc.key().isEmpty())
never evaluated: *itc == uri
never evaluated: !itc.key().isEmpty()
0
620 list.append(itc.key());
never executed: list.append(itc.key());
0
621 }
never executed: }
0
622 return list;
never executed: return list;
0
623} -
624void QXmlNamespaceSupport::pushContext() -
625{ -
626 d->nsStack.push(d->ns); -
627}
executed: }
Execution Count:4841
4841
628void QXmlNamespaceSupport::popContext() -
629{ -
630 d->ns.clear(); -
631 if(!d->nsStack.isEmpty())
partially evaluated: !d->nsStack.isEmpty()
TRUEFALSE
yes
Evaluation Count:4769
no
Evaluation Count:0
0-4769
632 d->ns = d->nsStack.pop();
executed: d->ns = d->nsStack.pop();
Execution Count:4769
4769
633}
executed: }
Execution Count:4769
4769
634 -
635 -
636 -
637 -
638void QXmlNamespaceSupport::reset() -
639{ -
640 QXmlNamespaceSupportPrivate *newD = new QXmlNamespaceSupportPrivate; -
641 delete d; -
642 d = newD; -
643}
never executed: }
0
644int QXmlAttributes::index(const QString& qName) const -
645{ -
646 for (int i = 0; i < attList.size(); ++i) {
never evaluated: i < attList.size()
0
647 if (attList.at(i).qname == qName)
never evaluated: attList.at(i).qname == qName
0
648 return i;
never executed: return i;
0
649 }
never executed: }
0
650 return -1;
never executed: return -1;
0
651} -
652 -
653 -
654 -
655int QXmlAttributes::index(QLatin1String qName) const -
656{ -
657 for (int i = 0; i < attList.size(); ++i) {
evaluated: i < attList.size()
TRUEFALSE
yes
Evaluation Count:11810
yes
Evaluation Count:2589
2589-11810
658 if (attList.at(i).qname == qName)
evaluated: attList.at(i).qname == qName
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:11786
24-11786
659 return i;
executed: return i;
Execution Count:24
24
660 }
executed: }
Execution Count:11786
11786
661 return -1;
executed: return -1;
Execution Count:2589
2589
662} -
663int QXmlAttributes::index(const QString& uri, const QString& localPart) const -
664{ -
665 for (int i = 0; i < attList.size(); ++i) {
evaluated: i < attList.size()
TRUEFALSE
yes
Evaluation Count:51512
yes
Evaluation Count:5843
5843-51512
666 const Attribute &att = attList.at(i); -
667 if (att.uri == uri && att.localname == localPart)
partially evaluated: att.uri == uri
TRUEFALSE
yes
Evaluation Count:51512
no
Evaluation Count:0
evaluated: att.localname == localPart
TRUEFALSE
yes
Evaluation Count:8130
yes
Evaluation Count:43382
0-51512
668 return i;
executed: return i;
Execution Count:8130
8130
669 }
executed: }
Execution Count:43382
43382
670 return -1;
executed: return -1;
Execution Count:5843
5843
671} -
672 -
673 -
674 -
675 -
676 -
677 -
678int QXmlAttributes::length() const -
679{ -
680 return attList.count();
executed: return attList.count();
Execution Count:56766
56766
681} -
682QString QXmlAttributes::localName(int index) const -
683{ -
684 return attList.at(index).localname;
executed: return attList.at(index).localname;
Execution Count:408
408
685} -
686 -
687 -
688 -
689 -
690 -
691 -
692 -
693QString QXmlAttributes::qName(int index) const -
694{ -
695 return attList.at(index).qname;
executed: return attList.at(index).qname;
Execution Count:17161
17161
696} -
697QString QXmlAttributes::uri(int index) const -
698{ -
699 return attList.at(index).uri;
executed: return attList.at(index).uri;
Execution Count:421
421
700} -
701 -
702 -
703 -
704 -
705 -
706 -
707 -
708QString QXmlAttributes::type(int) const -
709{ -
710 return QLatin1String("CDATA");
executed: return QLatin1String("CDATA");
Execution Count:408
408
711} -
712QString QXmlAttributes::type(const QString&) const -
713{ -
714 return QLatin1String("CDATA");
never executed: return QLatin1String("CDATA");
0
715} -
716QString QXmlAttributes::type(const QString&, const QString&) const -
717{ -
718 return QLatin1String("CDATA");
never executed: return QLatin1String("CDATA");
0
719} -
720 -
721 -
722 -
723 -
724 -
725 -
726QString QXmlAttributes::value(int index) const -
727{ -
728 return attList.at(index).value;
executed: return attList.at(index).value;
Execution Count:17172
17172
729} -
730QString QXmlAttributes::value(const QString& qName) const -
731{ -
732 int i = index(qName); -
733 if (i == -1)
never evaluated: i == -1
0
734 return QString();
never executed: return QString();
0
735 return attList.at(i).value;
never executed: return attList.at(i).value;
0
736} -
737QString QXmlAttributes::value(QLatin1String qName) const -
738{ -
739 int i = index(qName); -
740 if (i == -1)
never evaluated: i == -1
0
741 return QString();
never executed: return QString();
0
742 return attList.at(i).value;
never executed: return attList.at(i).value;
0
743} -
744QString QXmlAttributes::value(const QString& uri, const QString& localName) const -
745{ -
746 int i = index(uri, localName); -
747 if (i == -1)
evaluated: i == -1
TRUEFALSE
yes
Evaluation Count:4320
yes
Evaluation Count:7751
4320-7751
748 return QString();
executed: return QString();
Execution Count:4320
4320
749 return attList.at(i).value;
executed: return attList.at(i).value;
Execution Count:7751
7751
750} -
751 -
752 -
753 -
754 -
755 -
756 -
757void QXmlAttributes::clear() -
758{ -
759 attList.clear(); -
760}
executed: }
Execution Count:42667
42667
761void QXmlAttributes::append(const QString &qName, const QString &uri, const QString &localPart, const QString &value) -
762{ -
763 Attribute att; -
764 att.qname = qName; -
765 att.uri = uri; -
766 att.localname = localPart; -
767 att.value = value; -
768 -
769 attList.append(att); -
770}
executed: }
Execution Count:28773
28773
771const ushort QXmlInputSource::EndOfData = 0xfffe; -
772const ushort QXmlInputSource::EndOfDocument = 0xffff; -
773 -
774 -
775 -
776 -
777void QXmlInputSource::init() -
778{ -
779 d = new QXmlInputSourcePrivate; -
780 -
781 if (true) {
partially evaluated: true
TRUEFALSE
yes
Evaluation Count:2245
no
Evaluation Count:0
0-2245
782 d->inputDevice = 0; -
783 d->inputStream = 0; -
784 -
785 setData(QString()); -
786 -
787 d->encMapper = 0; -
788 -
789 d->nextReturnedEndOfData = true; -
790 -
791 d->encodingDeclBytes.clear(); -
792 d->encodingDeclChars.clear(); -
793 d->lookingForEncodingDecl = true; -
794 } else {
executed: }
Execution Count:2245
2245
795 delete(d); -
796 qt_noop(); -
797 }
never executed: }
0
798} -
799 -
800 -
801 -
802 -
803 -
804 -
805QXmlInputSource::QXmlInputSource() -
806{ -
807 init(); -
808}
executed: }
Execution Count:1782
1782
809QXmlInputSource::QXmlInputSource(QIODevice *dev) -
810{ -
811 init(); -
812 d->inputDevice = dev; -
813 if (dev->isOpen())
evaluated: dev->isOpen()
TRUEFALSE
yes
Evaluation Count:447
yes
Evaluation Count:16
16-447
814 d->inputDevice->setTextModeEnabled(false);
executed: d->inputDevice->setTextModeEnabled(false);
Execution Count:447
447
815}
executed: }
Execution Count:463
463
816 -
817 -
818 -
819 -
820QXmlInputSource::~QXmlInputSource() -
821{ -
822 -
823 -
824 delete d->encMapper; -
825 -
826 delete d; -
827}
executed: }
Execution Count:2245
2245
828QChar QXmlInputSource::next() -
829{ -
830 if (d->pos >= d->length) {
evaluated: d->pos >= d->length
TRUEFALSE
yes
Evaluation Count:59811
yes
Evaluation Count:3167225
59811-3167225
831 if (d->nextReturnedEndOfData) {
evaluated: d->nextReturnedEndOfData
TRUEFALSE
yes
Evaluation Count:8428
yes
Evaluation Count:51383
8428-51383
832 d->nextReturnedEndOfData = false; -
833 fetchData(); -
834 if (d->pos >= d->length) {
evaluated: d->pos >= d->length
TRUEFALSE
yes
Evaluation Count:2098
yes
Evaluation Count:6330
2098-6330
835 return EndOfDocument;
executed: return EndOfDocument;
Execution Count:2098
2098
836 } -
837 return next();
executed: return next();
Execution Count:6330
6330
838 } -
839 d->nextReturnedEndOfData = true; -
840 return EndOfData;
executed: return EndOfData;
Execution Count:51383
51383
841 } -
842 -
843 -
844 -
845 -
846 QChar c = d->unicode[d->pos++]; -
847 if (c.unicode() == EndOfData)
partially evaluated: c.unicode() == EndOfData
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3167225
0-3167225
848 c = EndOfDocument;
never executed: c = EndOfDocument;
0
849 return c;
executed: return c;
Execution Count:3167225
3167225
850} -
851void QXmlInputSource::reset() -
852{ -
853 d->nextReturnedEndOfData = false; -
854 d->pos = 0; -
855}
executed: }
Execution Count:4
4
856 -
857 -
858 -
859 -
860 -
861 -
862 -
863QString QXmlInputSource::data() const -
864{ -
865 if (d->nextReturnedEndOfData) {
partially evaluated: d->nextReturnedEndOfData
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
866 QXmlInputSource *that = const_cast<QXmlInputSource*>(this); -
867 that->d->nextReturnedEndOfData = false; -
868 that->fetchData(); -
869 }
never executed: }
0
870 return d->str;
executed: return d->str;
Execution Count:4
4
871} -
872void QXmlInputSource::setData(const QString& dat) -
873{ -
874 d->str = dat; -
875 d->unicode = dat.unicode(); -
876 d->pos = 0; -
877 d->length = d->str.length(); -
878 d->nextReturnedEndOfData = false; -
879}
executed: }
Execution Count:54104
54104
880 -
881 -
882 -
883 -
884 -
885 -
886 -
887void QXmlInputSource::setData(const QByteArray& dat) -
888{ -
889 setData(fromRawData(dat)); -
890}
executed: }
Execution Count:44909
44909
891void QXmlInputSource::fetchData() -
892{ -
893 enum -
894 { -
895 BufferSize = 1024 -
896 }; -
897 -
898 QByteArray rawData; -
899 -
900 if (d->inputDevice || d->inputStream) {
evaluated: d->inputDevice
TRUEFALSE
yes
Evaluation Count:6659
yes
Evaluation Count:1769
partially evaluated: d->inputStream
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1769
0-6659
901 QIODevice *device = d->inputDevice ? d->inputDevice : d->inputStream->device();
partially evaluated: d->inputDevice
TRUEFALSE
yes
Evaluation Count:6659
no
Evaluation Count:0
0-6659
902 -
903 if (!device) {
partially evaluated: !device
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6659
0-6659
904 if (d->inputStream && d->inputStream->string()) {
never evaluated: d->inputStream
never evaluated: d->inputStream->string()
0
905 QString *s = d->inputStream->string(); -
906 rawData = QByteArray((const char *) s->constData(), s->size() * sizeof(QChar)); -
907 }
never executed: }
0
908 } else if (device->isOpen() || device->open(QIODevice::ReadOnly)) {
evaluated: device->isOpen()
TRUEFALSE
yes
Evaluation Count:6643
yes
Evaluation Count:16
partially evaluated: device->open(QIODevice::ReadOnly)
TRUEFALSE
yes
Evaluation Count:16
no
Evaluation Count:0
never executed: }
0-6643
909 rawData.resize(BufferSize); -
910 qint64 size = device->read(rawData.data(), BufferSize); -
911 -
912 if (size != -1) {
evaluated: size != -1
TRUEFALSE
yes
Evaluation Count:6655
yes
Evaluation Count:4
4-6655
913 -
914 while (size < 4) {
evaluated: size < 4
TRUEFALSE
yes
Evaluation Count:11517
yes
Evaluation Count:6326
6326-11517
915 if (!device->waitForReadyRead(-1))
evaluated: !device->waitForReadyRead(-1)
TRUEFALSE
yes
Evaluation Count:329
yes
Evaluation Count:11188
329-11188
916 break;
executed: break;
Execution Count:329
329
917 int ret = device->read(rawData.data() + size, BufferSize - size); -
918 if (ret <= 0)
partially evaluated: ret <= 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11188
0-11188
919 break;
never executed: break;
0
920 size += ret; -
921 }
executed: }
Execution Count:11188
11188
922 }
executed: }
Execution Count:6655
6655
923 -
924 rawData.resize(qMax(qint64(0), size)); -
925 }
executed: }
Execution Count:6659
6659
926 -
927 -
928 -
929 -
930 -
931 setData(fromRawData(rawData)); -
932 }
executed: }
Execution Count:6659
6659
933}
executed: }
Execution Count:8428
8428
934 -
935 -
936static QString extractEncodingDecl(const QString &text, bool *needMoreText) -
937{ -
938 *needMoreText = false; -
939 -
940 int l = text.length(); -
941 QString snip = QString::fromLatin1("<?xml").left(l); -
942 if (l > 0 && !text.startsWith(snip))
evaluated: l > 0
TRUEFALSE
yes
Evaluation Count:3223
yes
Evaluation Count:6
evaluated: !text.startsWith(snip)
TRUEFALSE
yes
Evaluation Count:1761
yes
Evaluation Count:1462
6-3223
943 return QString();
executed: return QString();
Execution Count:1761
1761
944 -
945 int endPos = text.indexOf(QLatin1Char('>')); -
946 if (endPos == -1) {
evaluated: endPos == -1
TRUEFALSE
yes
Evaluation Count:1276
yes
Evaluation Count:192
192-1276
947 *needMoreText = l < 255; -
948 return QString();
executed: return QString();
Execution Count:1276
1276
949 } -
950 -
951 int pos = text.indexOf(QLatin1String("encoding")); -
952 if (pos == -1 || pos >= endPos)
evaluated: pos == -1
TRUEFALSE
yes
Evaluation Count:59
yes
Evaluation Count:133
partially evaluated: pos >= endPos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:133
0-133
953 return QString();
executed: return QString();
Execution Count:59
59
954 -
955 while (pos < endPos) {
partially evaluated: pos < endPos
TRUEFALSE
yes
Evaluation Count:1330
no
Evaluation Count:0
0-1330
956 ushort uc = text.at(pos).unicode(); -
957 if (uc == '\'' || uc == '"')
evaluated: uc == '\''
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:1328
evaluated: uc == '"'
TRUEFALSE
yes
Evaluation Count:131
yes
Evaluation Count:1197
2-1328
958 break;
executed: break;
Execution Count:133
133
959 ++pos; -
960 }
executed: }
Execution Count:1197
1197
961 -
962 if (pos == endPos)
partially evaluated: pos == endPos
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:133
0-133
963 return QString();
never executed: return QString();
0
964 -
965 QString encoding; -
966 ++pos; -
967 while (pos < endPos) {
partially evaluated: pos < endPos
TRUEFALSE
yes
Evaluation Count:914
no
Evaluation Count:0
0-914
968 ushort uc = text.at(pos).unicode(); -
969 if (uc == '\'' || uc == '"')
evaluated: uc == '\''
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:912
evaluated: uc == '"'
TRUEFALSE
yes
Evaluation Count:131
yes
Evaluation Count:781
2-912
970 break;
executed: break;
Execution Count:133
133
971 encoding.append(uc); -
972 ++pos; -
973 }
executed: }
Execution Count:781
781
974 -
975 return encoding;
executed: return encoding;
Execution Count:133
133
976} -
977QString QXmlInputSource::fromRawData(const QByteArray &data, bool beginning) -
978{ -
979 -
980 -
981 -
982 -
983 if (data.size() == 0)
evaluated: data.size() == 0
TRUEFALSE
yes
Evaluation Count:329
yes
Evaluation Count:51239
329-51239
984 return QString();
executed: return QString();
Execution Count:329
329
985 if (beginning) {
partially evaluated: beginning
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:51239
0-51239
986 delete d->encMapper; -
987 d->encMapper = 0; -
988 }
never executed: }
0
989 -
990 int mib = 106; -
991 -
992 -
993 if (d->encMapper == 0) {
evaluated: d->encMapper == 0
TRUEFALSE
yes
Evaluation Count:1953
yes
Evaluation Count:49286
1953-49286
994 d->encodingDeclBytes.clear(); -
995 d->encodingDeclChars.clear(); -
996 d->lookingForEncodingDecl = true; -
997 -
998 -
999 if (data.size() >= 4) {
evaluated: data.size() >= 4
TRUEFALSE
yes
Evaluation Count:1459
yes
Evaluation Count:494
494-1459
1000 uchar ch1 = data.at(0); -
1001 uchar ch2 = data.at(1); -
1002 uchar ch3 = data.at(2); -
1003 uchar ch4 = data.at(3); -
1004 -
1005 if ((ch1 == 0 && ch2 == 0 && ch3 == 0xfe && ch4 == 0xff) ||
evaluated: ch1 == 0
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1449
partially evaluated: ch2 == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
never evaluated: ch3 == 0xfe
never evaluated: ch4 == 0xff
0-1449
1006 (ch1 == 0xff && ch2 == 0xfe && ch3 == 0 && ch4 == 0))
evaluated: ch1 == 0xff
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:1435
partially evaluated: ch2 == 0xfe
TRUEFALSE
yes
Evaluation Count:24
no
Evaluation Count:0
partially evaluated: ch3 == 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:24
never evaluated: ch4 == 0
0-1435
1007 mib = 1017;
never executed: mib = 1017;
0
1008 else if (ch1 == 0x3c && ch2 == 0x00 && ch3 == 0x00 && ch4 == 0x00)
evaluated: ch1 == 0x3c
TRUEFALSE
yes
Evaluation Count:1421
yes
Evaluation Count:38
evaluated: ch2 == 0x00
TRUEFALSE
yes
Evaluation Count:31
yes
Evaluation Count:1390
evaluated: ch3 == 0x00
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:21
partially evaluated: ch4 == 0x00
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-1421
1009 mib = 1019;
executed: mib = 1019;
Execution Count:10
10
1010 else if (ch1 == 0x00 && ch2 == 0x00 && ch3 == 0x00 && ch4 == 0x3c)
evaluated: ch1 == 0x00
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1439
partially evaluated: ch2 == 0x00
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
never evaluated: ch3 == 0x00
never evaluated: ch4 == 0x3c
0-1439
1011 mib = 1018;
never executed: mib = 1018;
0
1012 } -
1013 if (mib == 106 && data.size() >= 2) {
evaluated: mib == 106
TRUEFALSE
yes
Evaluation Count:1943
yes
Evaluation Count:10
evaluated: data.size() >= 2
TRUEFALSE
yes
Evaluation Count:1781
yes
Evaluation Count:162
10-1943
1014 uchar ch1 = data.at(0); -
1015 uchar ch2 = data.at(1); -
1016 -
1017 if ((ch1 == 0xfe && ch2 == 0xff) || (ch1 == 0xff && ch2 == 0xfe))
evaluated: ch1 == 0xfe
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:1778
partially evaluated: ch2 == 0xff
TRUEFALSE
yes
Evaluation Count:3
no
Evaluation Count:0
evaluated: ch1 == 0xff
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:1748
partially evaluated: ch2 == 0xfe
TRUEFALSE
yes
Evaluation Count:30
no
Evaluation Count:0
0-1778
1018 mib = 1015;
executed: mib = 1015;
Execution Count:33
33
1019 else if (ch1 == 0x3c && ch2 == 0x00)
evaluated: ch1 == 0x3c
TRUEFALSE
yes
Evaluation Count:1737
yes
Evaluation Count:11
evaluated: ch2 == 0x00
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:1716
11-1737
1020 mib = 1014;
executed: mib = 1014;
Execution Count:21
21
1021 else if (ch1 == 0x00 && ch2 == 0x3c)
evaluated: ch1 == 0x00
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1717
partially evaluated: ch2 == 0x3c
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
0-1717
1022 mib = 1013;
executed: mib = 1013;
Execution Count:10
10
1023 } -
1024 -
1025 QTextCodec *codec = QTextCodec::codecForMib(mib); -
1026 qt_noop(); -
1027 -
1028 d->encMapper = codec->makeDecoder(); -
1029 }
executed: }
Execution Count:1953
1953
1030 -
1031 QString input = d->encMapper->toUnicode(data.constData(), data.size()); -
1032 -
1033 if (d->lookingForEncodingDecl) {
evaluated: d->lookingForEncodingDecl
TRUEFALSE
yes
Evaluation Count:3229
yes
Evaluation Count:48010
3229-48010
1034 d->encodingDeclChars += input; -
1035 -
1036 bool needMoreText; -
1037 QString encoding = extractEncodingDecl(d->encodingDeclChars, &needMoreText); -
1038 -
1039 if (!encoding.isEmpty()) {
evaluated: !encoding.isEmpty()
TRUEFALSE
yes
Evaluation Count:133
yes
Evaluation Count:3096
133-3096
1040 if (QTextCodec *codec = QTextCodec::codecForName(encoding.toLatin1())) {
partially evaluated: QTextCodec *codec = QTextCodec::codecForName(encoding.toLatin1())
TRUEFALSE
yes
Evaluation Count:133
no
Evaluation Count:0
0-133
1041 -
1042 if(codec->mibEnum() != mib) {
evaluated: codec->mibEnum() != mib
TRUEFALSE
yes
Evaluation Count:35
yes
Evaluation Count:98
35-98
1043 delete d->encMapper; -
1044 d->encMapper = codec->makeDecoder(); -
1045 -
1046 -
1047 -
1048 -
1049 input.clear(); -
1050 -
1051 -
1052 d->encMapper->toUnicode(d->encodingDeclBytes.constData(), d->encodingDeclBytes.size()); -
1053 -
1054 input = d->encMapper->toUnicode(data.constData(), data.size()); -
1055 }
executed: }
Execution Count:35
35
1056 }
executed: }
Execution Count:133
133
1057 }
executed: }
Execution Count:133
133
1058 -
1059 d->encodingDeclBytes += data; -
1060 d->lookingForEncodingDecl = needMoreText; -
1061 }
executed: }
Execution Count:3229
3229
1062 -
1063 return input;
executed: return input;
Execution Count:51239
51239
1064 -
1065} -
1066void QXmlDefaultHandler::setDocumentLocator(QXmlLocator*) -
1067{ -
1068} -
1069 -
1070 -
1071 -
1072 -
1073 -
1074 -
1075bool QXmlDefaultHandler::startDocument() -
1076{ -
1077 return true;
executed: return true;
Execution Count:397
397
1078} -
1079 -
1080 -
1081 -
1082 -
1083 -
1084 -
1085bool QXmlDefaultHandler::endDocument() -
1086{ -
1087 return true;
executed: return true;
Execution Count:12
12
1088} -
1089 -
1090 -
1091 -
1092 -
1093 -
1094 -
1095bool QXmlDefaultHandler::startPrefixMapping(const QString&, const QString&) -
1096{ -
1097 return true;
executed: return true;
Execution Count:17
17
1098} -
1099 -
1100 -
1101 -
1102 -
1103 -
1104 -
1105bool QXmlDefaultHandler::endPrefixMapping(const QString&) -
1106{ -
1107 return true;
executed: return true;
Execution Count:15
15
1108} -
1109 -
1110 -
1111 -
1112 -
1113 -
1114 -
1115bool QXmlDefaultHandler::startElement(const QString&, const QString&, -
1116 const QString&, const QXmlAttributes&) -
1117{ -
1118 return true;
executed: return true;
Execution Count:206
206
1119} -
1120 -
1121 -
1122 -
1123 -
1124 -
1125 -
1126bool QXmlDefaultHandler::endElement(const QString&, const QString&, -
1127 const QString&) -
1128{ -
1129 return true;
executed: return true;
Execution Count:207
207
1130} -
1131 -
1132 -
1133 -
1134 -
1135 -
1136 -
1137bool QXmlDefaultHandler::characters(const QString&) -
1138{ -
1139 return true;
executed: return true;
Execution Count:394
394
1140} -
1141 -
1142 -
1143 -
1144 -
1145 -
1146 -
1147bool QXmlDefaultHandler::ignorableWhitespace(const QString&) -
1148{ -
1149 return true;
never executed: return true;
0
1150} -
1151 -
1152 -
1153 -
1154 -
1155 -
1156 -
1157bool QXmlDefaultHandler::processingInstruction(const QString&, -
1158 const QString&) -
1159{ -
1160 return true;
executed: return true;
Execution Count:6
6
1161} -
1162 -
1163 -
1164 -
1165 -
1166 -
1167 -
1168bool QXmlDefaultHandler::skippedEntity(const QString&) -
1169{ -
1170 return true;
never executed: return true;
0
1171} -
1172 -
1173 -
1174 -
1175 -
1176 -
1177 -
1178bool QXmlDefaultHandler::warning(const QXmlParseException&) -
1179{ -
1180 return true;
never executed: return true;
0
1181} -
1182 -
1183 -
1184 -
1185 -
1186 -
1187 -
1188bool QXmlDefaultHandler::error(const QXmlParseException&) -
1189{ -
1190 return true;
never executed: return true;
0
1191} -
1192 -
1193 -
1194 -
1195 -
1196 -
1197 -
1198bool QXmlDefaultHandler::fatalError(const QXmlParseException&) -
1199{ -
1200 return true;
executed: return true;
Execution Count:14
14
1201} -
1202 -
1203 -
1204 -
1205 -
1206 -
1207 -
1208bool QXmlDefaultHandler::notationDecl(const QString&, const QString&, -
1209 const QString&) -
1210{ -
1211 return true;
never executed: return true;
0
1212} -
1213 -
1214 -
1215 -
1216 -
1217 -
1218 -
1219bool QXmlDefaultHandler::unparsedEntityDecl(const QString&, const QString&, -
1220 const QString&, const QString&) -
1221{ -
1222 return true;
never executed: return true;
0
1223} -
1224 -
1225 -
1226 -
1227 -
1228 -
1229 -
1230 -
1231bool QXmlDefaultHandler::resolveEntity(const QString&, const QString&, -
1232 QXmlInputSource*& ret) -
1233{ -
1234 ret = 0; -
1235 return true;
never executed: return true;
0
1236} -
1237 -
1238 -
1239 -
1240 -
1241 -
1242 -
1243QString QXmlDefaultHandler::errorString() const -
1244{ -
1245 return QString::fromLatin1("error triggered by consumer");
executed: return QString::fromLatin1("error triggered by consumer");
Execution Count:1
1
1246} -
1247 -
1248 -
1249 -
1250 -
1251 -
1252 -
1253bool QXmlDefaultHandler::startDTD(const QString&, const QString&, const QString&) -
1254{ -
1255 return true;
never executed: return true;
0
1256} -
1257 -
1258 -
1259 -
1260 -
1261 -
1262 -
1263bool QXmlDefaultHandler::endDTD() -
1264{ -
1265 return true;
executed: return true;
Execution Count:124
124
1266} -
1267 -
1268 -
1269 -
1270 -
1271 -
1272 -
1273bool QXmlDefaultHandler::startEntity(const QString&) -
1274{ -
1275 return true;
never executed: return true;
0
1276} -
1277 -
1278 -
1279 -
1280 -
1281 -
1282 -
1283bool QXmlDefaultHandler::endEntity(const QString&) -
1284{ -
1285 return true;
never executed: return true;
0
1286} -
1287 -
1288 -
1289 -
1290 -
1291 -
1292 -
1293bool QXmlDefaultHandler::startCDATA() -
1294{ -
1295 return true;
never executed: return true;
0
1296} -
1297 -
1298 -
1299 -
1300 -
1301 -
1302 -
1303bool QXmlDefaultHandler::endCDATA() -
1304{ -
1305 return true;
never executed: return true;
0
1306} -
1307 -
1308 -
1309 -
1310 -
1311 -
1312 -
1313bool QXmlDefaultHandler::comment(const QString&) -
1314{ -
1315 return true;
never executed: return true;
0
1316} -
1317 -
1318 -
1319 -
1320 -
1321 -
1322 -
1323bool QXmlDefaultHandler::attributeDecl(const QString&, const QString&, const QString&, const QString&, const QString&) -
1324{ -
1325 return true;
never executed: return true;
0
1326} -
1327 -
1328 -
1329 -
1330 -
1331 -
1332 -
1333bool QXmlDefaultHandler::internalEntityDecl(const QString&, const QString&) -
1334{ -
1335 return true;
executed: return true;
Execution Count:212
212
1336} -
1337 -
1338 -
1339 -
1340 -
1341 -
1342 -
1343bool QXmlDefaultHandler::externalEntityDecl(const QString&, const QString&, const QString&) -
1344{ -
1345 return true;
never executed: return true;
0
1346} -
1347inline bool QXmlSimpleReaderPrivate::atEnd() -
1348{ -
1349 return (c.unicode()|0x0001) == 0xffff;
executed: return (c.unicode()|0x0001) == 0xffff;
Execution Count:3885588
3885588
1350} -
1351 -
1352inline void QXmlSimpleReaderPrivate::stringClear() -
1353{ -
1354 stringValueLen = 0; stringArrayPos = 0; -
1355}
executed: }
Execution Count:113035
113035
1356inline void QXmlSimpleReaderPrivate::nameClear() -
1357{ -
1358 nameValueLen = 0; nameArrayPos = 0; -
1359}
executed: }
Execution Count:118874
118874
1360 -
1361inline void QXmlSimpleReaderPrivate::refClear() -
1362{ -
1363 refValueLen = 0; refArrayPos = 0; -
1364}
executed: }
Execution Count:22875
22875
1365 -
1366QXmlSimpleReaderPrivate::QXmlSimpleReaderPrivate(QXmlSimpleReader *reader) -
1367{ -
1368 q_ptr = reader; -
1369 parseStack = 0; -
1370 -
1371 locator.reset(new QXmlSimpleReaderLocator(reader)); -
1372 entityRes = 0; -
1373 dtdHnd = 0; -
1374 contentHnd = 0; -
1375 errorHnd = 0; -
1376 lexicalHnd = 0; -
1377 declHnd = 0; -
1378 -
1379 -
1380 useNamespaces = true; -
1381 useNamespacePrefixes = false; -
1382 reportWhitespaceCharData = true; -
1383 reportEntities = false; -
1384}
executed: }
Execution Count:2247
2247
1385 -
1386QXmlSimpleReaderPrivate::~QXmlSimpleReaderPrivate() -
1387{ -
1388 delete parseStack; -
1389}
executed: }
Execution Count:2247
2247
1390 -
1391void QXmlSimpleReaderPrivate::initIncrementalParsing() -
1392{ -
1393 if(parseStack)
partially evaluated: parseStack
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1490
0-1490
1394 parseStack->clear();
never executed: parseStack->clear();
0
1395 else -
1396 parseStack = new QStack<ParseState>;
executed: parseStack = new QStack<ParseState>;
Execution Count:1490
1490
1397} -
1398static inline bool is_S(QChar ch) -
1399{ -
1400 ushort uc = ch.unicode(); -
1401 return (uc == ' ' || uc == '\t' || uc == '\n' || uc == '\r');
executed: return (uc == ' ' || uc == '\t' || uc == '\n' || uc == '\r');
Execution Count:316336
316336
1402} -
1403 -
1404enum NameChar { NameBeginning, NameNotBeginning, NotName }; -
1405 -
1406static const char Begi = (char)NameBeginning; -
1407static const char NtBg = (char)NameNotBeginning; -
1408static const char NotN = (char)NotName; -
1409 -
1410static const char nameCharTable[128] = -
1411{ -
1412 -
1413 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, -
1414 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, -
1415 -
1416 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, -
1417 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, -
1418 -
1419 NotN, NotN, NotN, NotN, NotN, NotN, NotN, NotN, -
1420 NotN, NotN, NotN, NotN, NotN, NtBg, NtBg, NotN, -
1421 -
1422 NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, NtBg, -
1423 NtBg, NtBg, Begi, NotN, NotN, NotN, NotN, NotN, -
1424 -
1425 NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi, -
1426 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, -
1427 -
1428 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, -
1429 Begi, Begi, Begi, NotN, NotN, NotN, NotN, Begi, -
1430 -
1431 NotN, Begi, Begi, Begi, Begi, Begi, Begi, Begi, -
1432 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, -
1433 -
1434 Begi, Begi, Begi, Begi, Begi, Begi, Begi, Begi, -
1435 Begi, Begi, Begi, NotN, NotN, NotN, NotN, NotN -
1436}; -
1437 -
1438static inline NameChar fastDetermineNameChar(QChar ch) -
1439{ -
1440 ushort uc = ch.unicode(); -
1441 if (!(uc & ~0x7f))
evaluated: !(uc & ~0x7f)
TRUEFALSE
yes
Evaluation Count:954653
yes
Evaluation Count:40753
40753-954653
1442 return (NameChar)nameCharTable[uc];
executed: return (NameChar)nameCharTable[uc];
Execution Count:954653
954653
1443 -
1444 QChar::Category cat = ch.category(); -
1445 -
1446 if ((cat >= QChar::Letter_Uppercase && cat <= QChar::Letter_Other)
evaluated: cat >= QChar::Letter_Uppercase
TRUEFALSE
yes
Evaluation Count:40652
yes
Evaluation Count:101
evaluated: cat <= QChar::Letter_Other
TRUEFALSE
yes
Evaluation Count:40546
yes
Evaluation Count:106
101-40652
1447 || cat == QChar::Number_Letter)
partially evaluated: cat == QChar::Number_Letter
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:207
0-207
1448 return NameBeginning;
executed: return NameBeginning;
Execution Count:40546
40546
1449 if ((cat >= QChar::Number_DecimalDigit && cat <= QChar::Number_Other)
evaluated: cat >= QChar::Number_DecimalDigit
TRUEFALSE
yes
Evaluation Count:130
yes
Evaluation Count:77
evaluated: cat <= QChar::Number_Other
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:117
13-130
1450 || (cat >= QChar::Mark_NonSpacing && cat <= QChar::Mark_Enclosing))
partially evaluated: cat >= QChar::Mark_NonSpacing
TRUEFALSE
yes
Evaluation Count:194
no
Evaluation Count:0
evaluated: cat <= QChar::Mark_Enclosing
TRUEFALSE
yes
Evaluation Count:77
yes
Evaluation Count:117
0-194
1451 return NameNotBeginning;
executed: return NameNotBeginning;
Execution Count:90
90
1452 return NotName;
executed: return NotName;
Execution Count:117
117
1453} -
1454 -
1455static NameChar determineNameChar(QChar ch) -
1456{ -
1457 return fastDetermineNameChar(ch);
executed: return fastDetermineNameChar(ch);
Execution Count:89970
89970
1458} -
1459 -
1460 -
1461 -
1462 -
1463 -
1464QXmlSimpleReader::QXmlSimpleReader() -
1465 : d_ptr(new QXmlSimpleReaderPrivate(this)) -
1466{ -
1467}
executed: }
Execution Count:2247
2247
1468 -
1469 -
1470 -
1471 -
1472QXmlSimpleReader::~QXmlSimpleReader() -
1473{ -
1474} -
1475 -
1476 -
1477 -
1478 -
1479bool QXmlSimpleReader::feature(const QString& name, bool *ok) const -
1480{ -
1481 const QXmlSimpleReaderPrivate *d = d_func(); -
1482 -
1483 if (ok != 0)
partially evaluated: ok != 0
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:403
0-403
1484 *ok = true;
never executed: *ok = true;
0
1485 if (name == QLatin1String("http://xml.org/sax/features/namespaces")) {
evaluated: name == QLatin1String("http://xml.org/sax/features/namespaces")
TRUEFALSE
yes
Evaluation Count:385
yes
Evaluation Count:18
18-385
1486 return d->useNamespaces;
executed: return d->useNamespaces;
Execution Count:385
385
1487 } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")) {
partially evaluated: name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")
TRUEFALSE
yes
Evaluation Count:18
no
Evaluation Count:0
0-18
1488 return d->useNamespacePrefixes;
executed: return d->useNamespacePrefixes;
Execution Count:18
18
1489 } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")
never evaluated: name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")
0
1490 || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")) {
never evaluated: name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
0
1491 return d->reportWhitespaceCharData;
never executed: return d->reportWhitespaceCharData;
0
1492 } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
never evaluated: name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
0
1493 || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")) {
never evaluated: name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")
0
1494 return d->reportEntities;
never executed: return d->reportEntities;
0
1495 } else { -
1496 QMessageLogger("sax/qxml.cpp", 3149, __PRETTY_FUNCTION__).warning("Unknown feature %s", name.toLatin1().data()); -
1497 if (ok != 0)
never evaluated: ok != 0
0
1498 *ok = false;
never executed: *ok = false;
0
1499 }
never executed: }
0
1500 return false;
never executed: return false;
0
1501} -
1502void QXmlSimpleReader::setFeature(const QString& name, bool enable) -
1503{ -
1504 QXmlSimpleReaderPrivate * const d = d_func(); -
1505 if (name == QLatin1String("http://xml.org/sax/features/namespaces")) {
evaluated: name == QLatin1String("http://xml.org/sax/features/namespaces")
TRUEFALSE
yes
Evaluation Count:379
yes
Evaluation Count:762
379-762
1506 d->useNamespaces = enable; -
1507 } else if (name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")) {
evaluated: name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")
TRUEFALSE
yes
Evaluation Count:379
yes
Evaluation Count:383
executed: }
Execution Count:379
379-383
1508 d->useNamespacePrefixes = enable; -
1509 } else if (name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")
executed: }
Execution Count:379
evaluated: name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")
TRUEFALSE
yes
Evaluation Count:381
yes
Evaluation Count:2
2-381
1510 || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")) {
partially evaluated: name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1511 d->reportWhitespaceCharData = enable; -
1512 } else if (name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
executed: }
Execution Count:381
partially evaluated: name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-381
1513 || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")) {
never evaluated: name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
0
1514 d->reportEntities = enable; -
1515 } else {
executed: }
Execution Count:2
2
1516 QMessageLogger("sax/qxml.cpp", 3220, __PRETTY_FUNCTION__).warning("Unknown feature %s", name.toLatin1().data()); -
1517 }
never executed: }
0
1518} -
1519 -
1520 -
1521 -
1522bool QXmlSimpleReader::hasFeature(const QString& name) const -
1523{ -
1524 if (name == QLatin1String("http://xml.org/sax/features/namespaces")
partially evaluated: name == QLatin1String("http://xml.org/sax/features/namespaces")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1525 || name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")
partially evaluated: name == QLatin1String("http://xml.org/sax/features/namespace-prefixes")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
1526 || name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")
evaluated: name == QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData")
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2
2-4
1527 || name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
partially evaluated: name == QLatin1String("http://qt-project.org/xml/features/report-whitespace-only-CharData")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
1528 || name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
partially evaluated: name == QLatin1String("http://trolltech.com/xml/features/report-start-end-entity")
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
1529 || name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")) {
never evaluated: name == QLatin1String("http://qt-project.org/xml/features/report-start-end-entity")
0
1530 return true;
executed: return true;
Execution Count:6
6
1531 } else { -
1532 return false;
never executed: return false;
0
1533 } -
1534} -
1535 -
1536 -
1537 -
1538void* QXmlSimpleReader::property(const QString&, bool *ok) const -
1539{ -
1540 if (ok != 0)
never evaluated: ok != 0
0
1541 *ok = false;
never executed: *ok = false;
0
1542 return 0;
never executed: return 0;
0
1543} -
1544 -
1545 -
1546 -
1547void QXmlSimpleReader::setProperty(const QString&, void*) -
1548{ -
1549} -
1550 -
1551 -
1552 -
1553 -
1554bool QXmlSimpleReader::hasProperty(const QString&) const -
1555{ -
1556 return false;
never executed: return false;
0
1557} -
1558 -
1559 -
1560 -
1561 -
1562void QXmlSimpleReader::setEntityResolver(QXmlEntityResolver* handler) -
1563{ -
1564 QXmlSimpleReaderPrivate * const d = d_func(); -
1565 d->entityRes = handler; -
1566}
executed: }
Execution Count:1847
1847
1567 -
1568 -
1569 -
1570 -
1571QXmlEntityResolver* QXmlSimpleReader::entityResolver() const -
1572{ -
1573 const QXmlSimpleReaderPrivate *d = d_func(); -
1574 return d->entityRes;
executed: return d->entityRes;
Execution Count:2
2
1575} -
1576 -
1577 -
1578 -
1579 -
1580void QXmlSimpleReader::setDTDHandler(QXmlDTDHandler* handler) -
1581{ -
1582 QXmlSimpleReaderPrivate * const d = d_func(); -
1583 d->dtdHnd = handler; -
1584}
executed: }
Execution Count:2230
2230
1585 -
1586 -
1587 -
1588 -
1589QXmlDTDHandler* QXmlSimpleReader::DTDHandler() const -
1590{ -
1591 const QXmlSimpleReaderPrivate *d = d_func(); -
1592 return d->dtdHnd;
never executed: return d->dtdHnd;
0
1593} -
1594 -
1595 -
1596 -
1597 -
1598void QXmlSimpleReader::setContentHandler(QXmlContentHandler* handler) -
1599{ -
1600 QXmlSimpleReaderPrivate * const d = d_func(); -
1601 d->contentHnd = handler; -
1602}
executed: }
Execution Count:2244
2244
1603 -
1604 -
1605 -
1606 -
1607QXmlContentHandler* QXmlSimpleReader::contentHandler() const -
1608{ -
1609 const QXmlSimpleReaderPrivate *d = d_func(); -
1610 return d->contentHnd;
executed: return d->contentHnd;
Execution Count:2
2
1611} -
1612 -
1613 -
1614 -
1615 -
1616void QXmlSimpleReader::setErrorHandler(QXmlErrorHandler* handler) -
1617{ -
1618 QXmlSimpleReaderPrivate * const d = d_func(); -
1619 d->errorHnd = handler; -
1620}
executed: }
Execution Count:2235
2235
1621 -
1622 -
1623 -
1624 -
1625QXmlErrorHandler* QXmlSimpleReader::errorHandler() const -
1626{ -
1627 const QXmlSimpleReaderPrivate *d = d_func(); -
1628 return d->errorHnd;
executed: return d->errorHnd;
Execution Count:2
2
1629} -
1630 -
1631 -
1632 -
1633 -
1634void QXmlSimpleReader::setLexicalHandler(QXmlLexicalHandler* handler) -
1635{ -
1636 QXmlSimpleReaderPrivate * const d = d_func(); -
1637 d->lexicalHnd = handler; -
1638}
executed: }
Execution Count:2232
2232
1639 -
1640 -
1641 -
1642 -
1643QXmlLexicalHandler* QXmlSimpleReader::lexicalHandler() const -
1644{ -
1645 const QXmlSimpleReaderPrivate *d = d_func(); -
1646 return d->lexicalHnd;
executed: return d->lexicalHnd;
Execution Count:2
2
1647} -
1648 -
1649 -
1650 -
1651 -
1652void QXmlSimpleReader::setDeclHandler(QXmlDeclHandler* handler) -
1653{ -
1654 QXmlSimpleReaderPrivate * const d = d_func(); -
1655 d->declHnd = handler; -
1656}
executed: }
Execution Count:2232
2232
1657 -
1658 -
1659 -
1660 -
1661QXmlDeclHandler* QXmlSimpleReader::declHandler() const -
1662{ -
1663 const QXmlSimpleReaderPrivate *d = d_func(); -
1664 return d->declHnd;
executed: return d->declHnd;
Execution Count:2
2
1665} -
1666 -
1667 -
1668 -
1669 -
1670 -
1671 -
1672bool QXmlSimpleReader::parse(const QXmlInputSource& input) -
1673{ -
1674 return parse(&input, false);
executed: return parse(&input, false);
Execution Count:359
359
1675} -
1676 -
1677 -
1678 -
1679 -
1680 -
1681bool QXmlSimpleReader::parse(const QXmlInputSource* input) -
1682{ -
1683 return parse(input, false);
executed: return parse(input, false);
Execution Count:391
391
1684} -
1685bool QXmlSimpleReader::parse(const QXmlInputSource *input, bool incremental) -
1686{ -
1687 QXmlSimpleReaderPrivate * const d = d_func(); -
1688 -
1689 if (incremental) {
evaluated: incremental
TRUEFALSE
yes
Evaluation Count:1490
yes
Evaluation Count:755
755-1490
1690 d->initIncrementalParsing(); -
1691 } else {
executed: }
Execution Count:1490
1490
1692 delete d->parseStack; -
1693 d->parseStack = 0; -
1694 }
executed: }
Execution Count:755
755
1695 d->init(input); -
1696 -
1697 -
1698 if (d->contentHnd) {
evaluated: d->contentHnd
TRUEFALSE
yes
Evaluation Count:2242
yes
Evaluation Count:3
3-2242
1699 d->contentHnd->setDocumentLocator(d->locator.data()); -
1700 if (!d->contentHnd->startDocument()) {
partially evaluated: !d->contentHnd->startDocument()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2242
0-2242
1701 d->reportParseError(d->contentHnd->errorString()); -
1702 d->tags.clear(); -
1703 return false;
never executed: return false;
0
1704 } -
1705 }
executed: }
Execution Count:2242
2242
1706 qt_xml_skipped_entity_in_content = false; -
1707 return d->parseBeginOrContinue(0, incremental);
executed: return d->parseBeginOrContinue(0, incremental);
Execution Count:2245
2245
1708} -
1709bool QXmlSimpleReader::parseContinue() -
1710{ -
1711 QXmlSimpleReaderPrivate * const d = d_func(); -
1712 if (d->parseStack == 0 || d->parseStack->isEmpty())
evaluated: d->parseStack == 0
TRUEFALSE
yes
Evaluation Count:1490
yes
Evaluation Count:44908
partially evaluated: d->parseStack->isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:44908
0-44908
1713 return false;
executed: return false;
Execution Count:1490
1490
1714 d->initData(); -
1715 int state = d->parseStack->pop().state; -
1716 return d->parseBeginOrContinue(state, true);
executed: return d->parseBeginOrContinue(state, true);
Execution Count:44908
44908
1717} -
1718 -
1719 -
1720 -
1721 -
1722bool QXmlSimpleReaderPrivate::parseBeginOrContinue(int state, bool incremental) -
1723{ -
1724 bool atEndOrig = atEnd(); -
1725 -
1726 if (state==0) {
evaluated: state==0
TRUEFALSE
yes
Evaluation Count:36186
yes
Evaluation Count:10967
10967-36186
1727 if (!parseProlog()) {
evaluated: !parseProlog()
TRUEFALSE
yes
Evaluation Count:34025
yes
Evaluation Count:2161
2161-34025
1728 if (incremental && error.isNull()) {
evaluated: incremental
TRUEFALSE
yes
Evaluation Count:33941
yes
Evaluation Count:84
partially evaluated: error.isNull()
TRUEFALSE
yes
Evaluation Count:33941
no
Evaluation Count:0
0-33941
1729 pushParseState(0, 0); -
1730 return true;
executed: return true;
Execution Count:33941
33941
1731 } else { -
1732 tags.clear(); -
1733 return false;
executed: return false;
Execution Count:84
84
1734 } -
1735 } -
1736 state = 1; -
1737 }
executed: }
Execution Count:2161
2161
1738 if (state==1) {
evaluated: state==1
TRUEFALSE
yes
Evaluation Count:10614
yes
Evaluation Count:2514
2514-10614
1739 if (!parseElement()) {
evaluated: !parseElement()
TRUEFALSE
yes
Evaluation Count:8517
yes
Evaluation Count:2097
2097-8517
1740 if (incremental && error.isNull()) {
evaluated: incremental
TRUEFALSE
yes
Evaluation Count:8453
yes
Evaluation Count:64
partially evaluated: error.isNull()
TRUEFALSE
yes
Evaluation Count:8453
no
Evaluation Count:0
0-8453
1741 pushParseState(0, 1); -
1742 return true;
executed: return true;
Execution Count:8453
8453
1743 } else { -
1744 tags.clear(); -
1745 return false;
executed: return false;
Execution Count:64
64
1746 } -
1747 } -
1748 state = 2; -
1749 }
executed: }
Execution Count:2097
2097
1750 -
1751 while (!atEnd()) {
evaluated: !atEnd()
TRUEFALSE
yes
Evaluation Count:2559
yes
Evaluation Count:2528
2528-2559
1752 if (!parseMisc()) {
evaluated: !parseMisc()
TRUEFALSE
yes
Evaluation Count:2083
yes
Evaluation Count:476
476-2083
1753 if (incremental && error.isNull()) {
evaluated: incremental
TRUEFALSE
yes
Evaluation Count:2073
yes
Evaluation Count:10
partially evaluated: error.isNull()
TRUEFALSE
yes
Evaluation Count:2073
no
Evaluation Count:0
0-2073
1754 pushParseState(0, 2); -
1755 return true;
executed: return true;
Execution Count:2073
2073
1756 } else { -
1757 tags.clear(); -
1758 return false;
executed: return false;
Execution Count:10
10
1759 } -
1760 } -
1761 }
executed: }
Execution Count:476
476
1762 if (!atEndOrig && incremental) {
evaluated: !atEndOrig
TRUEFALSE
yes
Evaluation Count:1038
yes
Evaluation Count:1490
evaluated: incremental
TRUEFALSE
yes
Evaluation Count:441
yes
Evaluation Count:597
441-1490
1763 -
1764 pushParseState(0, 2); -
1765 return true;
executed: return true;
Execution Count:441
441
1766 } -
1767 -
1768 if (!tags.isEmpty() && !error.isNull()) {
partially evaluated: !tags.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2087
never evaluated: !error.isNull()
0-2087
1769 reportParseError(QLatin1String("unexpected end of file")); -
1770 tags.clear(); -
1771 return false;
never executed: return false;
0
1772 } -
1773 -
1774 if (contentHnd) {
evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:2086
yes
Evaluation Count:1
1-2086
1775 delete parseStack; -
1776 parseStack = 0; -
1777 if (!contentHnd->endDocument()) {
partially evaluated: !contentHnd->endDocument()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2086
0-2086
1778 reportParseError(contentHnd->errorString()); -
1779 return false;
never executed: return false;
0
1780 } -
1781 }
executed: }
Execution Count:2086
2086
1782 return true;
executed: return true;
Execution Count:2087
2087
1783} -
1784bool QXmlSimpleReaderPrivate::parseProlog() -
1785{ -
1786 const signed char Init = 0; -
1787 const signed char EatWS = 1; -
1788 const signed char Lt = 2; -
1789 const signed char Em = 3; -
1790 const signed char DocType = 4; -
1791 const signed char Comment = 5; -
1792 const signed char CommentR = 6; -
1793 const signed char PInstr = 7; -
1794 const signed char PInstrR = 8; -
1795 const signed char Done = 9; -
1796 -
1797 const signed char InpWs = 0; -
1798 const signed char InpLt = 1; -
1799 const signed char InpQm = 2; -
1800 const signed char InpEm = 3; -
1801 const signed char InpD = 4; -
1802 const signed char InpDash = 5; -
1803 const signed char InpUnknown = 6; -
1804 -
1805 static const signed char table[9][7] = { -
1806 -
1807 { EatWS, Lt, -1, -1, -1, -1, -1 }, -
1808 { -1, Lt, -1, -1, -1, -1, -1 }, -
1809 { -1, -1, PInstr,Em, Done, -1, Done }, -
1810 { -1, -1, -1, -1, DocType, Comment, -1 }, -
1811 { EatWS, Lt, -1, -1, -1, -1, -1 }, -
1812 { EatWS, Lt, -1, -1, -1, -1, -1 }, -
1813 { EatWS, Lt, -1, -1, -1, -1, -1 }, -
1814 { EatWS, Lt, -1, -1, -1, -1, -1 }, -
1815 { EatWS, Lt, -1, -1, -1, -1, -1 } -
1816 }; -
1817 signed char state; -
1818 signed char input; -
1819 -
1820 if (parseStack == 0 || parseStack->isEmpty()) {
evaluated: parseStack == 0
TRUEFALSE
yes
Evaluation Count:755
yes
Evaluation Count:35431
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:1490
yes
Evaluation Count:33941
755-35431
1821 xmldecl_possible = true; -
1822 doctype_read = false; -
1823 state = Init; -
1824 } else {
executed: }
Execution Count:2245
2245
1825 state = parseStack->pop().state; -
1826 -
1827 -
1828 -
1829 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:32278
yes
Evaluation Count:1663
1663-32278
1830 ParseFunction function = parseStack->top().function; -
1831 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:923
yes
Evaluation Count:31355
923-31355
1832 parseStack->pop(); -
1833 -
1834 -
1835 -
1836 }
executed: }
Execution Count:923
923
1837 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:29925
yes
Evaluation Count:2353
2353-29925
1838 parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); -
1839 return false;
executed: return false;
Execution Count:29925
29925
1840 } -
1841 }
executed: }
Execution Count:2353
2353
1842 }
executed: }
Execution Count:4016
4016
1843 -
1844 for (;;) { -
1845 switch (state) { -
1846 case DocType: -
1847 if (doctype_read) {
partially evaluated: doctype_read
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2338
0-2338
1848 reportParseError(QLatin1String("more than one document type definition")); -
1849 return false;
never executed: return false;
0
1850 } else { -
1851 doctype_read = false; -
1852 }
executed: }
Execution Count:2338
2338
1853 break;
executed: break;
Execution Count:2338
2338
1854 case Comment: -
1855 if (lexicalHnd) {
evaluated: lexicalHnd
TRUEFALSE
yes
Evaluation Count:348
yes
Evaluation Count:5
5-348
1856 if (!lexicalHnd->comment(string())) {
partially evaluated: !lexicalHnd->comment(string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:348
0-348
1857 reportParseError(lexicalHnd->errorString()); -
1858 return false;
never executed: return false;
0
1859 } -
1860 }
executed: }
Execution Count:348
348
1861 state = CommentR; -
1862 break;
executed: break;
Execution Count:353
353
1863 case PInstr: -
1864 -
1865 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:263
no
Evaluation Count:0
0-263
1866 if (xmldecl_possible && !xmlVersion.isEmpty()) {
evaluated: xmldecl_possible
TRUEFALSE
yes
Evaluation Count:238
yes
Evaluation Count:25
evaluated: !xmlVersion.isEmpty()
TRUEFALSE
yes
Evaluation Count:225
yes
Evaluation Count:13
13-238
1867 QString value(QLatin1String("version='")); -
1868 value += xmlVersion; -
1869 value += QLatin1Char('\''); -
1870 if (!encoding.isEmpty()) {
evaluated: !encoding.isEmpty()
TRUEFALSE
yes
Evaluation Count:143
yes
Evaluation Count:82
82-143
1871 value += QLatin1String(" encoding='"); -
1872 value += encoding; -
1873 value += QLatin1Char('\''); -
1874 }
executed: }
Execution Count:143
143
1875 if (standalone == QXmlSimpleReaderPrivate::Yes) {
evaluated: standalone == QXmlSimpleReaderPrivate::Yes
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:202
23-202
1876 value += QLatin1String(" standalone='yes'"); -
1877 } else if (standalone == QXmlSimpleReaderPrivate::No) {
evaluated: standalone == QXmlSimpleReaderPrivate::No
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:172
executed: }
Execution Count:23
23-172
1878 value += QLatin1String(" standalone='no'"); -
1879 }
executed: }
Execution Count:30
30
1880 if (!contentHnd->processingInstruction(QLatin1String("xml"), value)) {
partially evaluated: !contentHnd->processingInstruction(QLatin1String("xml"), value)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:225
0-225
1881 reportParseError(contentHnd->errorString()); -
1882 return false;
never executed: return false;
0
1883 } -
1884 } else {
executed: }
Execution Count:225
225
1885 if (!contentHnd->processingInstruction(name(), string())) {
partially evaluated: !contentHnd->processingInstruction(name(), string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:38
0-38
1886 reportParseError(contentHnd->errorString()); -
1887 return false;
never executed: return false;
0
1888 } -
1889 }
executed: }
Execution Count:38
38
1890 } -
1891 -
1892 xmldecl_possible = false; -
1893 state = PInstrR; -
1894 break;
executed: break;
Execution Count:263
263
1895 case Done: -
1896 return true;
executed: return true;
Execution Count:2161
2161
1897 case -1: -
1898 reportParseError(QLatin1String("error occurred while parsing element")); -
1899 return false;
executed: return false;
Execution Count:6
6
1900 } -
1901 -
1902 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:1665
yes
Evaluation Count:14132
1665-14132
1903 unexpectedEof(&QXmlSimpleReaderPrivate::parseProlog, state); -
1904 return false;
executed: return false;
Execution Count:1665
1665
1905 } -
1906 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:2502
yes
Evaluation Count:11630
2502-11630
1907 input = InpWs; -
1908 } else if (c == QLatin1Char('<')) {
evaluated: c == QLatin1Char('<')
TRUEFALSE
yes
Evaluation Count:4692
yes
Evaluation Count:6938
executed: }
Execution Count:2502
2502-6938
1909 input = InpLt; -
1910 } else if (c == QLatin1Char('?')) {
evaluated: c == QLatin1Char('?')
TRUEFALSE
yes
Evaluation Count:287
yes
Evaluation Count:6651
executed: }
Execution Count:4692
287-6651
1911 input = InpQm; -
1912 } else if (c == QLatin1Char('!')) {
evaluated: c == QLatin1Char('!')
TRUEFALSE
yes
Evaluation Count:2243
yes
Evaluation Count:4408
executed: }
Execution Count:287
287-4408
1913 input = InpEm; -
1914 } else if (c == QLatin1Char('D')) {
evaluated: c == QLatin1Char('D')
TRUEFALSE
yes
Evaluation Count:1887
yes
Evaluation Count:2521
executed: }
Execution Count:2243
1887-2521
1915 input = InpD; -
1916 } else if (c == QLatin1Char('-')) {
evaluated: c == QLatin1Char('-')
TRUEFALSE
yes
Evaluation Count:354
yes
Evaluation Count:2167
executed: }
Execution Count:1887
354-2167
1917 input = InpDash; -
1918 } else {
executed: }
Execution Count:354
354
1919 input = InpUnknown; -
1920 }
executed: }
Execution Count:2167
2167
1921 state = table[state][input]; -
1922 -
1923 switch (state) { -
1924 case EatWS: -
1925 -
1926 xmldecl_possible = false; -
1927 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:746
yes
Evaluation Count:1756
746-1756
1928 parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); -
1929 return false;
executed: return false;
Execution Count:746
746
1930 } -
1931 break;
executed: break;
Execution Count:1756
1756
1932 case Lt: -
1933 next(); -
1934 break;
executed: break;
Execution Count:4692
4692
1935 case Em: -
1936 -
1937 xmldecl_possible = false; -
1938 next(); -
1939 break;
executed: break;
Execution Count:2243
2243
1940 case DocType: -
1941 if (!parseDoctype()) {
evaluated: !parseDoctype()
TRUEFALSE
yes
Evaluation Count:1541
yes
Evaluation Count:346
346-1541
1942 parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); -
1943 return false;
executed: return false;
Execution Count:1541
1541
1944 } -
1945 break;
executed: break;
Execution Count:346
346
1946 case Comment: -
1947 case CommentR: -
1948 if (!parseComment()) {
evaluated: !parseComment()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:344
10-344
1949 parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); -
1950 return false;
executed: return false;
Execution Count:10
10
1951 } -
1952 break;
executed: break;
Execution Count:344
344
1953 case PInstr: -
1954 case PInstrR: -
1955 parsePI_xmldecl = xmldecl_possible; -
1956 if (!parsePI()) {
evaluated: !parsePI()
TRUEFALSE
yes
Evaluation Count:132
yes
Evaluation Count:155
132-155
1957 parseFailed(&QXmlSimpleReaderPrivate::parseProlog, state); -
1958 return false;
executed: return false;
Execution Count:132
132
1959 } -
1960 break;
executed: break;
Execution Count:155
155
1961 } -
1962 }
executed: }
Execution Count:11703
11703
1963 return false;
never executed: return false;
0
1964} -
1965 -
1966 -
1967 -
1968 -
1969 -
1970 -
1971bool QXmlSimpleReaderPrivate::parseElement() -
1972{ -
1973 const int Init = 0; -
1974 const int ReadName = 1; -
1975 const int Ws1 = 2; -
1976 const int STagEnd = 3; -
1977 const int STagEnd2 = 4; -
1978 const int ETagBegin = 5; -
1979 const int ETagBegin2 = 6; -
1980 const int Ws2 = 7; -
1981 const int EmptyTag = 8; -
1982 const int Attrib = 9; -
1983 const int AttribPro = 10; -
1984 const int Ws3 = 11; -
1985 const int Done = 12; -
1986 -
1987 const int InpWs = 0; -
1988 const int InpNameBe = 1; -
1989 const int InpGt = 2; -
1990 const int InpSlash = 3; -
1991 const int InpUnknown = 4; -
1992 -
1993 static const int table[12][5] = { -
1994 -
1995 { -1, ReadName, -1, -1, -1 }, -
1996 { Ws1, Attrib, STagEnd, EmptyTag, -1 }, -
1997 { -1, Attrib, STagEnd, EmptyTag, -1 }, -
1998 { STagEnd2, STagEnd2, STagEnd2, STagEnd2, STagEnd2 }, -
1999 { -1, -1, -1, ETagBegin, -1 }, -
2000 { -1, ETagBegin2, -1, -1, -1 }, -
2001 { Ws2, -1, Done, -1, -1 }, -
2002 { -1, -1, Done, -1, -1 }, -
2003 { -1, -1, Done, -1, -1 }, -
2004 { Ws3, Attrib, STagEnd, EmptyTag, -1 }, -
2005 { Ws3, Attrib, STagEnd, EmptyTag, -1 }, -
2006 { -1, Attrib, STagEnd, EmptyTag, -1 } -
2007 }; -
2008 int state; -
2009 int input; -
2010 -
2011 if (parseStack == 0 || parseStack->isEmpty()) {
evaluated: parseStack == 0
TRUEFALSE
yes
Evaluation Count:40857
yes
Evaluation Count:11462
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:1814
yes
Evaluation Count:9648
1814-40857
2012 state = Init; -
2013 } else {
executed: }
Execution Count:42671
42671
2014 state = parseStack->pop().state; -
2015 -
2016 -
2017 -
2018 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:8425
yes
Evaluation Count:1223
1223-8425
2019 ParseFunction function = parseStack->top().function; -
2020 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:136
yes
Evaluation Count:8289
136-8289
2021 parseStack->pop(); -
2022 -
2023 -
2024 -
2025 }
executed: }
Execution Count:136
136
2026 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:4859
yes
Evaluation Count:3566
3566-4859
2027 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); -
2028 return false;
executed: return false;
Execution Count:4859
4859
2029 } -
2030 }
executed: }
Execution Count:3566
3566
2031 }
executed: }
Execution Count:4789
4789
2032 -
2033 for (;;) { -
2034 switch (state) { -
2035 case ReadName: -
2036 -
2037 tags.push(name()); -
2038 -
2039 attList.clear(); -
2040 if (useNamespaces)
evaluated: useNamespaces
TRUEFALSE
yes
Evaluation Count:4841
yes
Evaluation Count:37826
4841-37826
2041 namespaceSupport.pushContext();
executed: namespaceSupport.pushContext();
Execution Count:4841
4841
2042 break;
executed: break;
Execution Count:42667
42667
2043 case ETagBegin2: -
2044 if (!processElementETagBegin2())
evaluated: !processElementETagBegin2()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:40745
4-40745
2045 return false;
executed: return false;
Execution Count:4
4
2046 break;
executed: break;
Execution Count:40745
40745
2047 case Attrib: -
2048 if (!processElementAttribute())
partially evaluated: !processElementAttribute()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:28792
0-28792
2049 return false;
never executed: return false;
0
2050 state = AttribPro; -
2051 break;
executed: break;
Execution Count:28792
28792
2052 case Done: -
2053 return true;
executed: return true;
Execution Count:42592
42592
2054 case -1: -
2055 reportParseError(QLatin1String("error occurred while parsing element")); -
2056 return false;
executed: return false;
Execution Count:14
14
2057 } -
2058 -
2059 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:1223
yes
Evaluation Count:308012
1223-308012
2060 unexpectedEof(&QXmlSimpleReaderPrivate::parseElement, state); -
2061 return false;
executed: return false;
Execution Count:1223
1223
2062 } -
2063 if (fastDetermineNameChar(c) == NameBeginning) {
evaluated: fastDetermineNameChar(c) == NameBeginning
TRUEFALSE
yes
Evaluation Count:131397
yes
Evaluation Count:176615
131397-176615
2064 input = InpNameBe; -
2065 } else if (c == QLatin1Char('>')) {
evaluated: c == QLatin1Char('>')
TRUEFALSE
yes
Evaluation Count:83391
yes
Evaluation Count:93224
executed: }
Execution Count:131397
83391-131397
2066 input = InpGt; -
2067 } else if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:42598
yes
Evaluation Count:50626
executed: }
Execution Count:83391
42598-83391
2068 input = InpWs; -
2069 } else if (c == QLatin1Char('/')) {
evaluated: c == QLatin1Char('/')
TRUEFALSE
yes
Evaluation Count:42613
yes
Evaluation Count:8013
executed: }
Execution Count:42598
8013-42613
2070 input = InpSlash; -
2071 } else {
executed: }
Execution Count:42613
42613
2072 input = InpUnknown; -
2073 }
executed: }
Execution Count:8013
8013
2074 state = table[state][input]; -
2075 -
2076 switch (state) { -
2077 case ReadName: -
2078 parseName_useRef = false; -
2079 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:1145
yes
Evaluation Count:41522
1145-41522
2080 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); -
2081 return false;
executed: return false;
Execution Count:1145
1145
2082 } -
2083 break;
executed: break;
Execution Count:41522
41522
2084 case Ws1: -
2085 case Ws2: -
2086 case Ws3: -
2087 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:134
yes
Evaluation Count:28858
134-28858
2088 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); -
2089 return false;
executed: return false;
Execution Count:134
134
2090 } -
2091 break;
executed: break;
Execution Count:28858
28858
2092 case STagEnd: -
2093 -
2094 if (contentHnd) {
evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:40792
yes
Evaluation Count:4
4-40792
2095 const QString &tagsTop = tags.top(); -
2096 if (useNamespaces) {
evaluated: useNamespaces
TRUEFALSE
yes
Evaluation Count:4578
yes
Evaluation Count:36214
4578-36214
2097 QString uri, lname; -
2098 namespaceSupport.processName(tagsTop, false, uri, lname); -
2099 if (!contentHnd->startElement(uri, lname, tagsTop, attList)) {
evaluated: !contentHnd->startElement(uri, lname, tagsTop, attList)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:4577
1-4577
2100 reportParseError(contentHnd->errorString()); -
2101 return false;
executed: return false;
Execution Count:1
1
2102 } -
2103 } else {
executed: }
Execution Count:4577
4577
2104 if (!contentHnd->startElement(QString(), QString(), tagsTop, attList)) {
partially evaluated: !contentHnd->startElement(QString(), QString(), tagsTop, attList)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:36214
0-36214
2105 reportParseError(contentHnd->errorString()); -
2106 return false;
never executed: return false;
0
2107 } -
2108 }
executed: }
Execution Count:36214
36214
2109 } -
2110 next(); -
2111 break;
executed: break;
Execution Count:40795
40795
2112 case STagEnd2: -
2113 if (!parseContent()) {
evaluated: !parseContent()
TRUEFALSE
yes
Evaluation Count:919
yes
Evaluation Count:39876
919-39876
2114 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); -
2115 return false;
executed: return false;
Execution Count:919
919
2116 } -
2117 break;
executed: break;
Execution Count:39876
39876
2118 case ETagBegin: -
2119 next(); -
2120 break;
executed: break;
Execution Count:40750
40750
2121 case ETagBegin2: -
2122 -
2123 parseName_useRef = false; -
2124 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:1072
yes
Evaluation Count:39677
1072-39677
2125 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); -
2126 return false;
executed: return false;
Execution Count:1072
1072
2127 } -
2128 break;
executed: break;
Execution Count:39677
39677
2129 case EmptyTag: -
2130 if (tags.isEmpty()) {
partially evaluated: tags.isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1850
0-1850
2131 reportParseError(QLatin1String("tag mismatch")); -
2132 return false;
never executed: return false;
0
2133 } -
2134 if (!processElementEmptyTag())
partially evaluated: !processElementEmptyTag()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1850
0-1850
2135 return false;
never executed: return false;
0
2136 next(); -
2137 break;
executed: break;
Execution Count:1850
1850
2138 case Attrib: -
2139 case AttribPro: -
2140 -
2141 if (!parseAttribute()) {
evaluated: !parseAttribute()
TRUEFALSE
yes
Evaluation Count:356
yes
Evaluation Count:28451
356-28451
2142 parseFailed(&QXmlSimpleReaderPrivate::parseElement, state); -
2143 return false;
executed: return false;
Execution Count:356
356
2144 } -
2145 break;
executed: break;
Execution Count:28451
28451
2146 case Done: -
2147 next(); -
2148 break;
executed: break;
Execution Count:42592
42592
2149 } -
2150 }
executed: }
Execution Count:304385
304385
2151 return false;
never executed: return false;
0
2152} -
2153 -
2154 -
2155 -
2156 -
2157 -
2158bool QXmlSimpleReaderPrivate::processElementEmptyTag() -
2159{ -
2160 QString uri, lname; -
2161 -
2162 if (contentHnd) {
evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:1841
yes
Evaluation Count:9
9-1841
2163 if (useNamespaces) {
evaluated: useNamespaces
TRUEFALSE
yes
Evaluation Count:229
yes
Evaluation Count:1612
229-1612
2164 -
2165 namespaceSupport.processName(tags.top(), false, uri, lname); -
2166 if (!contentHnd->startElement(uri, lname, tags.top(), attList)) {
partially evaluated: !contentHnd->startElement(uri, lname, tags.top(), attList)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:229
0-229
2167 reportParseError(contentHnd->errorString()); -
2168 return false;
never executed: return false;
0
2169 } -
2170 -
2171 if (!contentHnd->endElement(uri, lname, tags.pop())) {
partially evaluated: !contentHnd->endElement(uri, lname, tags.pop())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:229
0-229
2172 reportParseError(contentHnd->errorString()); -
2173 return false;
never executed: return false;
0
2174 } -
2175 -
2176 QStringList prefixesBefore, prefixesAfter; -
2177 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:229
no
Evaluation Count:0
0-229
2178 prefixesBefore = namespaceSupport.prefixes(); -
2179 }
executed: }
Execution Count:229
229
2180 namespaceSupport.popContext(); -
2181 -
2182 prefixesAfter = namespaceSupport.prefixes(); -
2183 for (QStringList::Iterator it = prefixesBefore.begin(); it != prefixesBefore.end(); ++it) {
evaluated: it != prefixesBefore.end()
TRUEFALSE
yes
Evaluation Count:239
yes
Evaluation Count:229
229-239
2184 if (!prefixesAfter.contains(*it)) {
evaluated: !prefixesAfter.contains(*it)
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:233
6-233
2185 if (!contentHnd->endPrefixMapping(*it)) {
partially evaluated: !contentHnd->endPrefixMapping(*it)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
2186 reportParseError(contentHnd->errorString()); -
2187 return false;
never executed: return false;
0
2188 } -
2189 }
executed: }
Execution Count:6
6
2190 }
executed: }
Execution Count:239
239
2191 } else {
executed: }
Execution Count:229
229
2192 -
2193 if (!contentHnd->startElement(QString(), QString(), tags.top(), attList)) {
partially evaluated: !contentHnd->startElement(QString(), QString(), tags.top(), attList)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1612
0-1612
2194 reportParseError(contentHnd->errorString()); -
2195 return false;
never executed: return false;
0
2196 } -
2197 -
2198 if (!contentHnd->endElement(QString(), QString(), tags.pop())) {
partially evaluated: !contentHnd->endElement(QString(), QString(), tags.pop())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1612
0-1612
2199 reportParseError(contentHnd->errorString()); -
2200 return false;
never executed: return false;
0
2201 } -
2202 }
executed: }
Execution Count:1612
1612
2203 } else { -
2204 tags.pop_back(); -
2205 namespaceSupport.popContext(); -
2206 }
executed: }
Execution Count:9
9
2207 return true;
executed: return true;
Execution Count:1850
1850
2208} -
2209 -
2210 -
2211 -
2212 -
2213bool QXmlSimpleReaderPrivate::processElementETagBegin2() -
2214{ -
2215 const QString &name = QXmlSimpleReaderPrivate::name(); -
2216 -
2217 -
2218 if (tags.pop() != name) {
evaluated: tags.pop() != name
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:40745
4-40745
2219 reportParseError(QLatin1String("tag mismatch")); -
2220 return false;
executed: return false;
Execution Count:4
4
2221 } -
2222 -
2223 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:40745
no
Evaluation Count:0
0-40745
2224 QString uri, lname; -
2225 -
2226 if (useNamespaces)
evaluated: useNamespaces
TRUEFALSE
yes
Evaluation Count:4531
yes
Evaluation Count:36214
4531-36214
2227 namespaceSupport.processName(name, false, uri, lname);
executed: namespaceSupport.processName(name, false, uri, lname);
Execution Count:4531
4531
2228 if (!contentHnd->endElement(uri, lname, name)) {
partially evaluated: !contentHnd->endElement(uri, lname, name)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:40745
0-40745
2229 reportParseError(contentHnd->errorString()); -
2230 return false;
never executed: return false;
0
2231 } -
2232 }
executed: }
Execution Count:40745
40745
2233 if (useNamespaces) {
evaluated: useNamespaces
TRUEFALSE
yes
Evaluation Count:4531
yes
Evaluation Count:36214
4531-36214
2234 NamespaceMap prefixesBefore, prefixesAfter; -
2235 if (contentHnd)
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:4531
no
Evaluation Count:0
0-4531
2236 prefixesBefore = namespaceSupport.d->ns;
executed: prefixesBefore = namespaceSupport.d->ns;
Execution Count:4531
4531
2237 -
2238 namespaceSupport.popContext(); -
2239 -
2240 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:4531
no
Evaluation Count:0
0-4531
2241 prefixesAfter = namespaceSupport.d->ns; -
2242 if (prefixesBefore.size() != prefixesAfter.size()) {
evaluated: prefixesBefore.size() != prefixesAfter.size()
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:4515
16-4515
2243 for (NamespaceMap::const_iterator it = prefixesBefore.constBegin(); it != prefixesBefore.constEnd(); ++it) {
evaluated: it != prefixesBefore.constEnd()
TRUEFALSE
yes
Evaluation Count:39
yes
Evaluation Count:16
16-39
2244 if (!it.key().isEmpty() && !prefixesAfter.contains(it.key())) {
evaluated: !it.key().isEmpty()
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:12
evaluated: !prefixesAfter.contains(it.key())
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:18
9-27
2245 if (!contentHnd->endPrefixMapping(it.key())) {
partially evaluated: !contentHnd->endPrefixMapping(it.key())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:9
0-9
2246 reportParseError(contentHnd->errorString()); -
2247 return false;
never executed: return false;
0
2248 } -
2249 }
executed: }
Execution Count:9
9
2250 }
executed: }
Execution Count:39
39
2251 }
executed: }
Execution Count:16
16
2252 }
executed: }
Execution Count:4531
4531
2253 }
executed: }
Execution Count:4531
4531
2254 return true;
executed: return true;
Execution Count:40745
40745
2255} -
2256 -
2257 -
2258 -
2259 -
2260bool QXmlSimpleReaderPrivate::processElementAttribute() -
2261{ -
2262 QString uri, lname, prefix; -
2263 const QString &name = QXmlSimpleReaderPrivate::name(); -
2264 const QString &string = QXmlSimpleReaderPrivate::string(); -
2265 -
2266 -
2267 if (useNamespaces) {
evaluated: useNamespaces
TRUEFALSE
yes
Evaluation Count:12053
yes
Evaluation Count:16739
12053-16739
2268 -
2269 namespaceSupport.splitName(name, prefix, lname); -
2270 if (prefix == QLatin1String("xmlns")) {
evaluated: prefix == QLatin1String("xmlns")
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:12034
19-12034
2271 -
2272 namespaceSupport.setPrefix(lname, string); -
2273 if (useNamespacePrefixes) {
partially evaluated: useNamespacePrefixes
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:19
0-19
2274 -
2275 -
2276 -
2277 attList.append(name, QLatin1String("http://www.w3.org/2000/xmlns/"), lname, string); -
2278 }
never executed: }
0
2279 -
2280 if (contentHnd) {
evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:2
2-17
2281 if (!contentHnd->startPrefixMapping(lname, string)) {
partially evaluated: !contentHnd->startPrefixMapping(lname, string)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:17
0-17
2282 reportParseError(contentHnd->errorString()); -
2283 return false;
never executed: return false;
0
2284 } -
2285 }
executed: }
Execution Count:17
17
2286 } else {
executed: }
Execution Count:19
19
2287 -
2288 namespaceSupport.processName(name, true, uri, lname); -
2289 attList.append(name, uri, lname, string); -
2290 }
executed: }
Execution Count:12034
12034
2291 } else { -
2292 -
2293 attList.append(name, uri, lname, string); -
2294 }
executed: }
Execution Count:16739
16739
2295 return true;
executed: return true;
Execution Count:28792
28792
2296} -
2297 -
2298 -
2299 -
2300 -
2301 -
2302 -
2303 -
2304bool QXmlSimpleReaderPrivate::parseContent() -
2305{ -
2306 const signed char Init = 0; -
2307 const signed char ChD = 1; -
2308 const signed char ChD1 = 2; -
2309 const signed char ChD2 = 3; -
2310 const signed char Ref = 4; -
2311 const signed char Lt = 5; -
2312 const signed char PInstr = 6; -
2313 const signed char PInstrR = 7; -
2314 const signed char Elem = 8; -
2315 const signed char Em = 9; -
2316 const signed char Com = 10; -
2317 const signed char ComR = 11; -
2318 const signed char CDS = 12; -
2319 const signed char CDS1 = 13; -
2320 const signed char CDS2 = 14; -
2321 const signed char CDS3 = 15; -
2322 const signed char Done = 16; -
2323 -
2324 const signed char InpLt = 0; -
2325 const signed char InpGt = 1; -
2326 const signed char InpSlash = 2; -
2327 const signed char InpQMark = 3; -
2328 const signed char InpEMark = 4; -
2329 const signed char InpAmp = 5; -
2330 const signed char InpDash = 6; -
2331 const signed char InpOpenB = 7; -
2332 const signed char InpCloseB = 8; -
2333 const signed char InpUnknown = 9; -
2334 -
2335 static const signed char mapCLT2FSMChar[] = { -
2336 InpUnknown, -
2337 InpUnknown, -
2338 InpAmp, -
2339 InpGt, -
2340 InpLt, -
2341 InpSlash, -
2342 InpQMark, -
2343 InpEMark, -
2344 InpDash, -
2345 InpCloseB, -
2346 InpOpenB, -
2347 InpUnknown, -
2348 InpUnknown, -
2349 InpUnknown, -
2350 InpUnknown -
2351 }; -
2352 -
2353 static const signed char table[16][10] = { -
2354 -
2355 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD1, ChD }, -
2356 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD1, ChD }, -
2357 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD2, ChD }, -
2358 { Lt, -1, ChD, ChD, ChD, Ref, ChD, ChD, ChD2, ChD }, -
2359 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, -
2360 { -1, -1, Done, PInstr, Em, -1, -1, -1, -1, Elem }, -
2361 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, -
2362 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, -
2363 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, -
2364 { -1, -1, -1, -1, -1, -1, Com, CDS, -1, -1 }, -
2365 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, -
2366 { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, -
2367 { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS2, CDS1 }, -
2368 { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS2, CDS1 }, -
2369 { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS3, CDS1 }, -
2370 { CDS1, Init, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS3, CDS1 } -
2371 }; -
2372 signed char state; -
2373 signed char input; -
2374 -
2375 if (parseStack == 0 || parseStack->isEmpty()) {
evaluated: parseStack == 0
TRUEFALSE
yes
Evaluation Count:39161
yes
Evaluation Count:5718
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:1634
yes
Evaluation Count:4084
1634-39161
2376 contentCharDataRead = false; -
2377 state = Init; -
2378 } else {
executed: }
Execution Count:40795
40795
2379 state = parseStack->pop().state; -
2380 -
2381 -
2382 -
2383 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:2638
yes
Evaluation Count:1446
1446-2638
2384 ParseFunction function = parseStack->top().function; -
2385 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
partially evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2638
0-2638
2386 parseStack->pop(); -
2387 -
2388 -
2389 -
2390 }
never executed: }
0
2391 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:1813
yes
Evaluation Count:825
825-1813
2392 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); -
2393 return false;
executed: return false;
Execution Count:1813
1813
2394 } -
2395 }
executed: }
Execution Count:825
825
2396 }
executed: }
Execution Count:2271
2271
2397 -
2398 for (;;) { -
2399 switch (state) { -
2400 case Ref: -
2401 if (!contentCharDataRead)
evaluated: !contentCharDataRead
TRUEFALSE
yes
Evaluation Count:2703
yes
Evaluation Count:14316
2703-14316
2402 contentCharDataRead = parseReference_charDataRead;
executed: contentCharDataRead = parseReference_charDataRead;
Execution Count:2703
2703
2403 break;
executed: break;
Execution Count:17019
17019
2404 case PInstr: -
2405 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:31
no
Evaluation Count:0
0-31
2406 if (!contentHnd->processingInstruction(name(),string())) {
partially evaluated: !contentHnd->processingInstruction(name(),string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:31
0-31
2407 reportParseError(contentHnd->errorString()); -
2408 return false;
never executed: return false;
0
2409 } -
2410 }
executed: }
Execution Count:31
31
2411 state = PInstrR; -
2412 break;
executed: break;
Execution Count:31
31
2413 case Com: -
2414 if (lexicalHnd) {
evaluated: lexicalHnd
TRUEFALSE
yes
Evaluation Count:1593
yes
Evaluation Count:56
56-1593
2415 if (!lexicalHnd->comment(string())) {
partially evaluated: !lexicalHnd->comment(string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1593
0-1593
2416 reportParseError(lexicalHnd->errorString()); -
2417 return false;
never executed: return false;
0
2418 } -
2419 }
executed: }
Execution Count:1593
1593
2420 state = ComR; -
2421 break;
executed: break;
Execution Count:1649
1649
2422 case CDS: -
2423 stringClear(); -
2424 break;
executed: break;
Execution Count:243
243
2425 case CDS2: -
2426 if (!atEnd() && c != QLatin1Char(']'))
evaluated: !atEnd()
TRUEFALSE
yes
Evaluation Count:275
yes
Evaluation Count:17
evaluated: c != QLatin1Char(']')
TRUEFALSE
yes
Evaluation Count:37
yes
Evaluation Count:238
17-275
2427 stringAddC(QLatin1Char(']'));
executed: stringAddC(QLatin1Char(']'));
Execution Count:37
37
2428 break;
executed: break;
Execution Count:292
292
2429 case CDS3: -
2430 -
2431 if (!atEnd()) {
evaluated: !atEnd()
TRUEFALSE
yes
Evaluation Count:249
yes
Evaluation Count:11
11-249
2432 if (c == QLatin1Char('>')) {
evaluated: c == QLatin1Char('>')
TRUEFALSE
yes
Evaluation Count:238
yes
Evaluation Count:11
11-238
2433 -
2434 if (lexicalHnd) {
partially evaluated: lexicalHnd
TRUEFALSE
yes
Evaluation Count:238
no
Evaluation Count:0
0-238
2435 if (!lexicalHnd->startCDATA()) {
partially evaluated: !lexicalHnd->startCDATA()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:238
0-238
2436 reportParseError(lexicalHnd->errorString()); -
2437 return false;
never executed: return false;
0
2438 } -
2439 }
executed: }
Execution Count:238
238
2440 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:238
no
Evaluation Count:0
0-238
2441 if (!contentHnd->characters(string())) {
partially evaluated: !contentHnd->characters(string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:238
0-238
2442 reportParseError(contentHnd->errorString()); -
2443 return false;
never executed: return false;
0
2444 } -
2445 }
executed: }
Execution Count:238
238
2446 if (lexicalHnd) {
partially evaluated: lexicalHnd
TRUEFALSE
yes
Evaluation Count:238
no
Evaluation Count:0
0-238
2447 if (!lexicalHnd->endCDATA()) {
partially evaluated: !lexicalHnd->endCDATA()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:238
0-238
2448 reportParseError(lexicalHnd->errorString()); -
2449 return false;
never executed: return false;
0
2450 } -
2451 }
executed: }
Execution Count:238
238
2452 } else if (c == QLatin1Char(']')) {
partially evaluated: c == QLatin1Char(']')
TRUEFALSE
yes
Evaluation Count:11
no
Evaluation Count:0
executed: }
Execution Count:238
0-238
2453 -
2454 stringAddC(QLatin1Char(']')); -
2455 } else {
executed: }
Execution Count:11
11
2456 -
2457 stringAddC(QLatin1Char(']')); -
2458 stringAddC(QLatin1Char(']')); -
2459 }
never executed: }
0
2460 } -
2461 break;
executed: break;
Execution Count:260
260
2462 case Done: -
2463 -
2464 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:40750
no
Evaluation Count:0
0-40750
2465 if (contentCharDataRead) {
partially evaluated: contentCharDataRead
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:40750
0-40750
2466 if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
never evaluated: reportWhitespaceCharData
never evaluated: !string().simplified().isEmpty()
0
2467 if (!contentHnd->characters(string())) {
never evaluated: !contentHnd->characters(string())
0
2468 reportParseError(contentHnd->errorString()); -
2469 return false;
never executed: return false;
0
2470 } -
2471 }
never executed: }
0
2472 }
never executed: }
0
2473 }
executed: }
Execution Count:40750
40750
2474 -
2475 return true;
executed: return true;
Execution Count:40750
40750
2476 case -1: -
2477 -
2478 reportParseError(QLatin1String("error occurred while parsing content")); -
2479 return false;
executed: return false;
Execution Count:3
3
2480 } -
2481 -
2482 -
2483 -
2484 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:1451
yes
Evaluation Count:1575069
1451-1575069
2485 unexpectedEof(&QXmlSimpleReaderPrivate::parseContent, state); -
2486 return false;
executed: return false;
Execution Count:1451
1451
2487 } -
2488 if (c.row()) {
evaluated: c.row()
TRUEFALSE
yes
Evaluation Count:368293
yes
Evaluation Count:1206776
368293-1206776
2489 input = InpUnknown; -
2490 } else {
executed: }
Execution Count:368293
368293
2491 input = mapCLT2FSMChar[charLookupTable[c.cell()]]; -
2492 }
executed: }
Execution Count:1206776
1206776
2493 state = table[state][input]; -
2494 -
2495 switch (state) { -
2496 case Init: -
2497 -
2498 next(); -
2499 break;
executed: break;
Execution Count:238
238
2500 case ChD: -
2501 -
2502 if (!contentCharDataRead) {
evaluated: !contentCharDataRead
TRUEFALSE
yes
Evaluation Count:76983
yes
Evaluation Count:1285610
76983-1285610
2503 contentCharDataRead = true; -
2504 stringClear(); -
2505 }
executed: }
Execution Count:76983
76983
2506 stringAddC(); -
2507 if (reportEntities) {
evaluated: reportEntities
TRUEFALSE
yes
Evaluation Count:104
yes
Evaluation Count:1362489
104-1362489
2508 if (!reportEndEntities())
partially evaluated: !reportEndEntities()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:104
0-104
2509 return false;
never executed: return false;
0
2510 }
executed: }
Execution Count:104
104
2511 next(); -
2512 break;
executed: break;
Execution Count:1362593
1362593
2513 case ChD1: -
2514 -
2515 if (!contentCharDataRead) {
evaluated: !contentCharDataRead
TRUEFALSE
yes
Evaluation Count:51
yes
Evaluation Count:3778
51-3778
2516 contentCharDataRead = true; -
2517 stringClear(); -
2518 }
executed: }
Execution Count:51
51
2519 stringAddC(); -
2520 if (reportEntities) {
partially evaluated: reportEntities
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3829
0-3829
2521 if (!reportEndEntities())
never evaluated: !reportEndEntities()
0
2522 return false;
never executed: return false;
0
2523 }
never executed: }
0
2524 next(); -
2525 break;
executed: break;
Execution Count:3829
3829
2526 case ChD2: -
2527 stringAddC(); -
2528 if (reportEntities) {
partially evaluated: reportEntities
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:188
0-188
2529 if (!reportEndEntities())
never evaluated: !reportEndEntities()
0
2530 return false;
never executed: return false;
0
2531 }
never executed: }
0
2532 next(); -
2533 break;
executed: break;
Execution Count:188
188
2534 case Ref: -
2535 if (!contentCharDataRead) {
evaluated: !contentCharDataRead
TRUEFALSE
yes
Evaluation Count:2527
yes
Evaluation Count:14369
2527-14369
2536 -
2537 stringClear(); -
2538 parseReference_context = InContent; -
2539 if (!parseReference()) {
evaluated: !parseReference()
TRUEFALSE
yes
Evaluation Count:292
yes
Evaluation Count:2235
292-2235
2540 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); -
2541 return false;
executed: return false;
Execution Count:292
292
2542 } -
2543 } else {
executed: }
Execution Count:2235
2235
2544 if (reportEntities) {
evaluated: reportEntities
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:14365
4-14365
2545 -
2546 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:4
no
Evaluation Count:0
0-4
2547 if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
evaluated: reportWhitespaceCharData
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2
partially evaluated: !string().simplified().isEmpty()
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
2548 if (!contentHnd->characters(string())) {
partially evaluated: !contentHnd->characters(string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:4
0-4
2549 reportParseError(contentHnd->errorString()); -
2550 return false;
never executed: return false;
0
2551 } -
2552 }
executed: }
Execution Count:4
4
2553 }
executed: }
Execution Count:4
4
2554 stringClear(); -
2555 }
executed: }
Execution Count:4
4
2556 parseReference_context = InContent; -
2557 if (!parseReference()) {
evaluated: !parseReference()
TRUEFALSE
yes
Evaluation Count:180
yes
Evaluation Count:14189
180-14189
2558 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); -
2559 return false;
executed: return false;
Execution Count:180
180
2560 } -
2561 }
executed: }
Execution Count:14189
14189
2562 break;
executed: break;
Execution Count:16424
16424
2563 case Lt: -
2564 -
2565 if (contentHnd) {
evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:83182
yes
Evaluation Count:10
10-83182
2566 if (contentCharDataRead) {
evaluated: contentCharDataRead
TRUEFALSE
yes
Evaluation Count:78743
yes
Evaluation Count:4439
4439-78743
2567 if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
evaluated: reportWhitespaceCharData
TRUEFALSE
yes
Evaluation Count:5948
yes
Evaluation Count:72795
evaluated: !string().simplified().isEmpty()
TRUEFALSE
yes
Evaluation Count:36277
yes
Evaluation Count:36518
5948-72795
2568 if (!contentHnd->characters(string())) {
partially evaluated: !contentHnd->characters(string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:42225
0-42225
2569 reportParseError(contentHnd->errorString()); -
2570 return false;
never executed: return false;
0
2571 } -
2572 }
executed: }
Execution Count:42225
42225
2573 }
executed: }
Execution Count:78743
78743
2574 }
executed: }
Execution Count:83182
83182
2575 contentCharDataRead = false; -
2576 next(); -
2577 break;
executed: break;
Execution Count:83192
83192
2578 case PInstr: -
2579 case PInstrR: -
2580 parsePI_xmldecl = false; -
2581 if (!parsePI()) {
evaluated: !parsePI()
TRUEFALSE
yes
Evaluation Count:35
yes
Evaluation Count:4
4-35
2582 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); -
2583 return false;
executed: return false;
Execution Count:35
35
2584 } -
2585 break;
executed: break;
Execution Count:4
4
2586 case Elem: -
2587 if (!parseElement()) {
evaluated: !parseElement()
TRUEFALSE
yes
Evaluation Count:282
yes
Evaluation Count:40228
282-40228
2588 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); -
2589 return false;
executed: return false;
Execution Count:282
282
2590 } -
2591 break;
executed: break;
Execution Count:40228
40228
2592 case Em: -
2593 next(); -
2594 break;
executed: break;
Execution Count:1893
1893
2595 case Com: -
2596 case ComR: -
2597 if (!parseComment()) {
evaluated: !parseComment()
TRUEFALSE
yes
Evaluation Count:38
yes
Evaluation Count:1613
38-1613
2598 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); -
2599 return false;
executed: return false;
Execution Count:38
38
2600 } -
2601 break;
executed: break;
Execution Count:1613
1613
2602 case CDS: -
2603 parseString_s = QLatin1String("[CDATA["); -
2604 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:35
yes
Evaluation Count:207
35-207
2605 parseFailed(&QXmlSimpleReaderPrivate::parseContent, state); -
2606 return false;
executed: return false;
Execution Count:35
35
2607 } -
2608 break;
executed: break;
Execution Count:207
207
2609 case CDS1: -
2610 stringAddC(); -
2611 next(); -
2612 break;
executed: break;
Execution Count:22521
22521
2613 case CDS2: -
2614 -
2615 next(); -
2616 break;
executed: break;
Execution Count:275
275
2617 case CDS3: -
2618 -
2619 next(); -
2620 break;
executed: break;
Execution Count:249
249
2621 } -
2622 }
executed: }
Execution Count:1574207
1574207
2623 return false;
never executed: return false;
0
2624} -
2625 -
2626bool QXmlSimpleReaderPrivate::reportEndEntities() -
2627{ -
2628 int count = (int)xmlRefStack.count(); -
2629 while (count != 0 && xmlRefStack.top().isEmpty()) {
evaluated: count != 0
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:100
evaluated: xmlRefStack.top().isEmpty()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:4
2-100
2630 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
2631 if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
evaluated: reportWhitespaceCharData
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:1
partially evaluated: !string().simplified().isEmpty()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
2632 if (!contentHnd->characters(string())) {
partially evaluated: !contentHnd->characters(string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2633 reportParseError(contentHnd->errorString()); -
2634 return false;
never executed: return false;
0
2635 } -
2636 }
executed: }
Execution Count:2
2
2637 }
executed: }
Execution Count:2
2
2638 stringClear(); -
2639 if (lexicalHnd) {
partially evaluated: lexicalHnd
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2
2640 if (!lexicalHnd->endEntity(xmlRefStack.top().name)) {
partially evaluated: !lexicalHnd->endEntity(xmlRefStack.top().name)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
2641 reportParseError(lexicalHnd->errorString()); -
2642 return false;
never executed: return false;
0
2643 } -
2644 }
executed: }
Execution Count:2
2
2645 xmlRefStack.pop_back(); -
2646 count--; -
2647 }
executed: }
Execution Count:2
2
2648 return true;
executed: return true;
Execution Count:104
104
2649} -
2650 -
2651 -
2652 -
2653 -
2654bool QXmlSimpleReaderPrivate::parseMisc() -
2655{ -
2656 const signed char Init = 0; -
2657 const signed char Lt = 1; -
2658 const signed char Comment = 2; -
2659 const signed char eatWS = 3; -
2660 const signed char PInstr = 4; -
2661 const signed char Comment2 = 5; -
2662 -
2663 const signed char InpWs = 0; -
2664 const signed char InpLt = 1; -
2665 const signed char InpQm = 2; -
2666 const signed char InpEm = 3; -
2667 const signed char InpUnknown = 4; -
2668 -
2669 static const signed char table[3][5] = { -
2670 -
2671 { eatWS, Lt, -1, -1, -1 }, -
2672 { -1, -1, PInstr,Comment, -1 }, -
2673 { -1, -1, -1, -1, Comment2 } -
2674 }; -
2675 signed char state; -
2676 signed char input; -
2677 -
2678 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:450
yes
Evaluation Count:2109
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:1526
yes
Evaluation Count:583
450-2109
2679 state = Init; -
2680 } else {
executed: }
Execution Count:1976
1976
2681 state = parseStack->pop().state; -
2682 -
2683 -
2684 -
2685 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:579
yes
Evaluation Count:4
4-579
2686 ParseFunction function = parseStack->top().function; -
2687 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:515
yes
Evaluation Count:64
64-515
2688 parseStack->pop(); -
2689 -
2690 -
2691 -
2692 }
executed: }
Execution Count:515
515
2693 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:549
yes
Evaluation Count:30
30-549
2694 parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state); -
2695 return false;
executed: return false;
Execution Count:549
549
2696 } -
2697 }
executed: }
Execution Count:30
30
2698 }
executed: }
Execution Count:34
34
2699 -
2700 for (;;) { -
2701 switch (state) { -
2702 case eatWS: -
2703 return true;
executed: return true;
Execution Count:441
441
2704 case PInstr: -
2705 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:11
no
Evaluation Count:0
0-11
2706 if (!contentHnd->processingInstruction(name(),string())) {
partially evaluated: !contentHnd->processingInstruction(name(),string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:11
0-11
2707 reportParseError(contentHnd->errorString()); -
2708 return false;
never executed: return false;
0
2709 } -
2710 }
executed: }
Execution Count:11
11
2711 return true;
executed: return true;
Execution Count:11
11
2712 case Comment2: -
2713 if (lexicalHnd) {
partially evaluated: lexicalHnd
TRUEFALSE
yes
Evaluation Count:24
no
Evaluation Count:0
0-24
2714 if (!lexicalHnd->comment(string())) {
partially evaluated: !lexicalHnd->comment(string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:24
0-24
2715 reportParseError(lexicalHnd->errorString()); -
2716 return false;
never executed: return false;
0
2717 } -
2718 }
executed: }
Execution Count:24
24
2719 return true;
executed: return true;
Execution Count:24
24
2720 case -1: -
2721 -
2722 reportParseError(QLatin1String("unexpected character")); -
2723 return false;
executed: return false;
Execution Count:8
8
2724 } -
2725 -
2726 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2042
4-2042
2727 unexpectedEof(&QXmlSimpleReaderPrivate::parseMisc, state); -
2728 return false;
executed: return false;
Execution Count:4
4
2729 } -
2730 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:1931
yes
Evaluation Count:111
111-1931
2731 input = InpWs; -
2732 } else if (c == QLatin1Char('<')) {
evaluated: c == QLatin1Char('<')
TRUEFALSE
yes
Evaluation Count:41
yes
Evaluation Count:70
executed: }
Execution Count:1931
41-1931
2733 input = InpLt; -
2734 } else if (c == QLatin1Char('?')) {
evaluated: c == QLatin1Char('?')
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:58
executed: }
Execution Count:41
12-58
2735 input = InpQm; -
2736 } else if (c == QLatin1Char('!')) {
evaluated: c == QLatin1Char('!')
TRUEFALSE
yes
Evaluation Count:25
yes
Evaluation Count:33
executed: }
Execution Count:12
12-33
2737 input = InpEm; -
2738 } else {
executed: }
Execution Count:25
25
2739 input = InpUnknown; -
2740 }
executed: }
Execution Count:33
33
2741 state = table[state][input]; -
2742 -
2743 switch (state) { -
2744 case eatWS: -
2745 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:1502
yes
Evaluation Count:429
429-1502
2746 parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state); -
2747 return false;
executed: return false;
Execution Count:1502
1502
2748 } -
2749 break;
executed: break;
Execution Count:429
429
2750 case Lt: -
2751 next(); -
2752 break;
executed: break;
Execution Count:41
41
2753 case PInstr: -
2754 parsePI_xmldecl = false; -
2755 if (!parsePI()) {
evaluated: !parsePI()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:2
2-10
2756 parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state); -
2757 return false;
executed: return false;
Execution Count:10
10
2758 } -
2759 break;
executed: break;
Execution Count:2
2
2760 case Comment: -
2761 next(); -
2762 break;
executed: break;
Execution Count:25
25
2763 case Comment2: -
2764 if (!parseComment()) {
evaluated: !parseComment()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:15
10-15
2765 parseFailed(&QXmlSimpleReaderPrivate::parseMisc, state); -
2766 return false;
executed: return false;
Execution Count:10
10
2767 } -
2768 break;
executed: break;
Execution Count:15
15
2769 } -
2770 }
executed: }
Execution Count:520
520
2771 return false;
never executed: return false;
0
2772} -
2773bool QXmlSimpleReaderPrivate::parsePI() -
2774{ -
2775 const signed char Init = 0; -
2776 const signed char QmI = 1; -
2777 const signed char Name = 2; -
2778 const signed char XMLDecl = 3; -
2779 const signed char Ws1 = 4; -
2780 const signed char PInstr = 5; -
2781 const signed char Ws2 = 6; -
2782 const signed char Version = 7; -
2783 const signed char Ws3 = 8; -
2784 const signed char EorSD = 9; -
2785 const signed char Ws4 = 10; -
2786 const signed char SD = 11; -
2787 const signed char Ws5 = 12; -
2788 const signed char ADone = 13; -
2789 const signed char Char = 14; -
2790 const signed char Qm = 15; -
2791 const signed char Done = 16; -
2792 -
2793 const signed char InpWs = 0; -
2794 const signed char InpNameBe = 1; -
2795 const signed char InpGt = 2; -
2796 const signed char InpQm = 3; -
2797 const signed char InpUnknown = 4; -
2798 -
2799 static const signed char table[16][5] = { -
2800 -
2801 { -1, -1, -1, QmI, -1 }, -
2802 { -1, Name, -1, -1, -1 }, -
2803 { -1, -1, -1, -1, -1 }, -
2804 { Ws1, -1, -1, -1, -1 }, -
2805 { -1, Version, -1, -1, -1 }, -
2806 { Ws2, -1, -1, Qm, -1 }, -
2807 { Char, Char, Char, Qm, Char }, -
2808 { Ws3, -1, -1, ADone, -1 }, -
2809 { -1, EorSD, -1, ADone, -1 }, -
2810 { Ws4, -1, -1, ADone, -1 }, -
2811 { -1, SD, -1, ADone, -1 }, -
2812 { Ws5, -1, -1, ADone, -1 }, -
2813 { -1, -1, -1, ADone, -1 }, -
2814 { -1, -1, Done, -1, -1 }, -
2815 { Char, Char, Char, Qm, Char }, -
2816 { Char, Char, Done, Qm, Char }, -
2817 }; -
2818 signed char state; -
2819 signed char input; -
2820 -
2821 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:195
yes
Evaluation Count:1386
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:144
yes
Evaluation Count:1242
144-1386
2822 state = Init; -
2823 } else {
executed: }
Execution Count:339
339
2824 state = parseStack->pop().state; -
2825 -
2826 -
2827 -
2828 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:997
yes
Evaluation Count:245
245-997
2829 ParseFunction function = parseStack->top().function; -
2830 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:87
yes
Evaluation Count:910
87-910
2831 parseStack->pop(); -
2832 -
2833 -
2834 -
2835 }
executed: }
Execution Count:87
87
2836 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:639
yes
Evaluation Count:358
358-639
2837 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); -
2838 return false;
executed: return false;
Execution Count:639
639
2839 } -
2840 }
executed: }
Execution Count:358
358
2841 }
executed: }
Execution Count:603
603
2842 -
2843 for (;;) { -
2844 switch (state) { -
2845 case Name: -
2846 -
2847 -
2848 if (name().toLower() == QLatin1String("xml")) {
evaluated: name().toLower() == QLatin1String("xml")
TRUEFALSE
yes
Evaluation Count:255
yes
Evaluation Count:83
83-255
2849 if (parsePI_xmldecl && name() == QLatin1String("xml")) {
evaluated: parsePI_xmldecl
TRUEFALSE
yes
Evaluation Count:235
yes
Evaluation Count:20
evaluated: name() == QLatin1String("xml")
TRUEFALSE
yes
Evaluation Count:233
yes
Evaluation Count:2
2-235
2850 state = XMLDecl; -
2851 } else {
executed: }
Execution Count:233
233
2852 reportParseError(QLatin1String("invalid name for processing instruction")); -
2853 return false;
executed: return false;
Execution Count:22
22
2854 } -
2855 } else { -
2856 state = PInstr; -
2857 stringClear(); -
2858 }
executed: }
Execution Count:83
83
2859 break;
executed: break;
Execution Count:316
316
2860 case Version: -
2861 -
2862 if (name() != QLatin1String("version")) {
evaluated: name() != QLatin1String("version")
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:242
3-242
2863 reportParseError(QLatin1String("version expected while reading the XML declaration")); -
2864 return false;
executed: return false;
Execution Count:3
3
2865 } -
2866 xmlVersion = string(); -
2867 break;
executed: break;
Execution Count:242
242
2868 case EorSD: -
2869 -
2870 if (name() == QLatin1String("standalone")) {
evaluated: name() == QLatin1String("standalone")
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:181
18-181
2871 if (string()== QLatin1String("yes")) {
evaluated: string()== QLatin1String("yes")
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:1
1-17
2872 standalone = QXmlSimpleReaderPrivate::Yes; -
2873 } else if (string() == QLatin1String("no")) {
partially evaluated: string() == QLatin1String("no")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1
executed: }
Execution Count:17
0-17
2874 standalone = QXmlSimpleReaderPrivate::No; -
2875 } else {
never executed: }
0
2876 reportParseError(QLatin1String("wrong value for standalone declaration")); -
2877 return false;
executed: return false;
Execution Count:1
1
2878 } -
2879 } else if (name() == QLatin1String("encoding")) {
evaluated: name() == QLatin1String("encoding")
TRUEFALSE
yes
Evaluation Count:179
yes
Evaluation Count:2
2-179
2880 encoding = string(); -
2881 } else {
executed: }
Execution Count:179
179
2882 reportParseError(QLatin1String("encoding declaration or standalone declaration expected while reading the XML declaration")); -
2883 return false;
executed: return false;
Execution Count:2
2
2884 } -
2885 break;
executed: break;
Execution Count:196
196
2886 case SD: -
2887 if (name() != QLatin1String("standalone")) {
partially evaluated: name() != QLatin1String("standalone")
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:52
0-52
2888 reportParseError(QLatin1String("standalone declaration expected while reading the XML declaration")); -
2889 return false;
never executed: return false;
0
2890 } -
2891 if (string() == QLatin1String("yes")) {
evaluated: string() == QLatin1String("yes")
TRUEFALSE
yes
Evaluation Count:13
yes
Evaluation Count:39
13-39
2892 standalone = QXmlSimpleReaderPrivate::Yes; -
2893 } else if (string() == QLatin1String("no")) {
partially evaluated: string() == QLatin1String("no")
TRUEFALSE
yes
Evaluation Count:39
no
Evaluation Count:0
executed: }
Execution Count:13
0-39
2894 standalone = QXmlSimpleReaderPrivate::No; -
2895 } else {
executed: }
Execution Count:39
39
2896 reportParseError(QLatin1String("wrong value for standalone declaration")); -
2897 return false;
never executed: return false;
0
2898 } -
2899 break;
executed: break;
Execution Count:52
52
2900 case Qm: -
2901 -
2902 if (!atEnd() && c != QLatin1Char('>'))
evaluated: !atEnd()
TRUEFALSE
yes
Evaluation Count:101
yes
Evaluation Count:19
evaluated: c != QLatin1Char('>')
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:80
19-101
2903 stringAddC(QLatin1Char('?'));
executed: stringAddC(QLatin1Char('?'));
Execution Count:21
21
2904 break;
executed: break;
Execution Count:120
120
2905 case Done: -
2906 return true;
executed: return true;
Execution Count:305
305
2907 case -1: -
2908 -
2909 reportParseError(QLatin1String("unexpected character")); -
2910 return false;
executed: return false;
Execution Count:3
3
2911 } -
2912 -
2913 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:248
yes
Evaluation Count:2816
248-2816
2914 unexpectedEof(&QXmlSimpleReaderPrivate::parsePI, state); -
2915 return false;
executed: return false;
Execution Count:248
248
2916 } -
2917 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:639
yes
Evaluation Count:2177
639-2177
2918 input = InpWs; -
2919 } else if (determineNameChar(c) == NameBeginning) {
evaluated: determineNameChar(c) == NameBeginning
TRUEFALSE
yes
Evaluation Count:1139
yes
Evaluation Count:1038
executed: }
Execution Count:639
639-1139
2920 input = InpNameBe; -
2921 } else if (c == QLatin1Char('>')) {
evaluated: c == QLatin1Char('>')
TRUEFALSE
yes
Evaluation Count:319
yes
Evaluation Count:719
executed: }
Execution Count:1139
319-1139
2922 input = InpGt; -
2923 } else if (c == QLatin1Char('?')) {
evaluated: c == QLatin1Char('?')
TRUEFALSE
yes
Evaluation Count:665
yes
Evaluation Count:54
executed: }
Execution Count:319
54-665
2924 input = InpQm; -
2925 } else {
executed: }
Execution Count:665
665
2926 input = InpUnknown; -
2927 }
executed: }
Execution Count:54
54
2928 state = table[state][input]; -
2929 -
2930 switch (state) { -
2931 case QmI: -
2932 next(); -
2933 break;
executed: break;
Execution Count:339
339
2934 case Name: -
2935 parseName_useRef = false; -
2936 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:83
yes
Evaluation Count:255
83-255
2937 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); -
2938 return false;
executed: return false;
Execution Count:83
83
2939 } -
2940 break;
executed: break;
Execution Count:255
255
2941 case Ws1: -
2942 case Ws2: -
2943 case Ws3: -
2944 case Ws4: -
2945 case Ws5: -
2946 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:86
yes
Evaluation Count:451
86-451
2947 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); -
2948 return false;
executed: return false;
Execution Count:86
86
2949 } -
2950 break;
executed: break;
Execution Count:451
451
2951 case Version: -
2952 if (!parseAttribute()) {
evaluated: !parseAttribute()
TRUEFALSE
yes
Evaluation Count:90
yes
Evaluation Count:143
90-143
2953 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); -
2954 return false;
executed: return false;
Execution Count:90
90
2955 } -
2956 break;
executed: break;
Execution Count:143
143
2957 case EorSD: -
2958 if (!parseAttribute()) {
evaluated: !parseAttribute()
TRUEFALSE
yes
Evaluation Count:63
yes
Evaluation Count:94
63-94
2959 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); -
2960 return false;
executed: return false;
Execution Count:63
63
2961 } -
2962 break;
executed: break;
Execution Count:94
94
2963 case SD: -
2964 -
2965 if (standalone != QXmlSimpleReaderPrivate::Unknown) {
partially evaluated: standalone != QXmlSimpleReaderPrivate::Unknown
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:42
0-42
2966 -
2967 reportParseError(QLatin1String("unexpected character")); -
2968 return false;
never executed: return false;
0
2969 } -
2970 if (!parseAttribute()) {
evaluated: !parseAttribute()
TRUEFALSE
yes
Evaluation Count:36
yes
Evaluation Count:6
6-36
2971 parseFailed(&QXmlSimpleReaderPrivate::parsePI, state); -
2972 return false;
executed: return false;
Execution Count:36
36
2973 } -
2974 break;
executed: break;
Execution Count:6
6
2975 case ADone: -
2976 next(); -
2977 break;
executed: break;
Execution Count:225
225
2978 case Char: -
2979 stringAddC(); -
2980 next(); -
2981 break;
executed: break;
Execution Count:536
536
2982 case Qm: -
2983 -
2984 next(); -
2985 break;
executed: break;
Execution Count:101
101
2986 case Done: -
2987 next(); -
2988 break;
executed: break;
Execution Count:305
305
2989 } -
2990 }
executed: }
Execution Count:2458
2458
2991 return false;
never executed: return false;
0
2992} -
2993bool QXmlSimpleReaderPrivate::parseDoctype() -
2994{ -
2995 const signed char Init = 0; -
2996 const signed char Doctype = 1; -
2997 const signed char Ws1 = 2; -
2998 const signed char Doctype2 = 3; -
2999 const signed char Ws2 = 4; -
3000 const signed char Sys = 5; -
3001 const signed char Ws3 = 6; -
3002 const signed char MP = 7; -
3003 const signed char MPR = 8; -
3004 const signed char PER = 9; -
3005 const signed char Mup = 10; -
3006 const signed char Ws4 = 11; -
3007 const signed char MPE = 12; -
3008 const signed char Done = 13; -
3009 -
3010 const signed char InpWs = 0; -
3011 const signed char InpD = 1; -
3012 const signed char InpS = 2; -
3013 const signed char InpOB = 3; -
3014 const signed char InpCB = 4; -
3015 const signed char InpPer = 5; -
3016 const signed char InpGt = 6; -
3017 const signed char InpUnknown = 7; -
3018 -
3019 static const signed char table[13][8] = { -
3020 -
3021 { -1, Doctype, -1, -1, -1, -1, -1, -1 }, -
3022 { Ws1, -1, -1, -1, -1, -1, -1, -1 }, -
3023 { -1, Doctype2, Doctype2, -1, -1, -1, -1, Doctype2 }, -
3024 { Ws2, -1, Sys, MP, -1, -1, Done, -1 }, -
3025 { -1, -1, Sys, MP, -1, -1, Done, -1 }, -
3026 { Ws3, -1, -1, MP, -1, -1, Done, -1 }, -
3027 { -1, -1, -1, MP, -1, -1, Done, -1 }, -
3028 { -1, -1, -1, -1, MPE, PER, -1, Mup }, -
3029 { -1, -1, -1, -1, MPE, PER, -1, Mup }, -
3030 { Ws4, -1, -1, -1, MPE, PER, -1, Mup }, -
3031 { Ws4, -1, -1, -1, MPE, PER, -1, Mup }, -
3032 { -1, -1, -1, -1, MPE, PER, -1, Mup }, -
3033 { -1, -1, -1, -1, -1, -1, Done, -1 } -
3034 }; -
3035 signed char state; -
3036 signed char input; -
3037 -
3038 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:397
yes
Evaluation Count:31694
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:1490
yes
Evaluation Count:30204
397-31694
3039 startDTDwasReported = false; -
3040 systemId.clear(); -
3041 publicId.clear(); -
3042 state = Init; -
3043 } else {
executed: }
Execution Count:1887
1887
3044 state = parseStack->pop().state; -
3045 -
3046 -
3047 -
3048 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:28944
yes
Evaluation Count:1260
1260-28944
3049 ParseFunction function = parseStack->top().function; -
3050 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:4229
yes
Evaluation Count:24715
4229-24715
3051 parseStack->pop(); -
3052 -
3053 -
3054 -
3055 }
executed: }
Execution Count:4229
4229
3056 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:20449
yes
Evaluation Count:8495
8495-20449
3057 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); -
3058 return false;
executed: return false;
Execution Count:20449
20449
3059 } -
3060 }
executed: }
Execution Count:8495
8495
3061 }
executed: }
Execution Count:9755
9755
3062 -
3063 for (;;) { -
3064 switch (state) { -
3065 case Doctype2: -
3066 doctype = name(); -
3067 break;
executed: break;
Execution Count:1887
1887
3068 case MP: -
3069 if (!startDTDwasReported && lexicalHnd ) {
partially evaluated: !startDTDwasReported
TRUEFALSE
yes
Evaluation Count:1570
no
Evaluation Count:0
evaluated: lexicalHnd
TRUEFALSE
yes
Evaluation Count:1569
yes
Evaluation Count:1
0-1570
3070 startDTDwasReported = true; -
3071 if (!lexicalHnd->startDTD(doctype, publicId, systemId)) {
partially evaluated: !lexicalHnd->startDTD(doctype, publicId, systemId)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1569
0-1569
3072 reportParseError(lexicalHnd->errorString()); -
3073 return false;
never executed: return false;
0
3074 } -
3075 }
executed: }
Execution Count:1569
1569
3076 state = MPR; -
3077 break;
executed: break;
Execution Count:1570
1570
3078 case Done: -
3079 return true;
executed: return true;
Execution Count:1836
1836
3080 case -1: -
3081 -
3082 reportParseError(QLatin1String("error occurred while parsing document type definition")); -
3083 return false;
executed: return false;
Execution Count:2
2
3084 } -
3085 -
3086 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:1260
yes
Evaluation Count:19301
1260-19301
3087 unexpectedEof(&QXmlSimpleReaderPrivate::parseDoctype, state); -
3088 return false;
executed: return false;
Execution Count:1260
1260
3089 } -
3090 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:6991
yes
Evaluation Count:12310
6991-12310
3091 input = InpWs; -
3092 } else if (c == QLatin1Char('D')) {
evaluated: c == QLatin1Char('D')
TRUEFALSE
yes
Evaluation Count:1887
yes
Evaluation Count:10423
executed: }
Execution Count:6991
1887-10423
3093 input = InpD; -
3094 } else if (c == QLatin1Char('S')) {
evaluated: c == QLatin1Char('S')
TRUEFALSE
yes
Evaluation Count:331
yes
Evaluation Count:10092
executed: }
Execution Count:1887
331-10092
3095 input = InpS; -
3096 } else if (c == QLatin1Char('P')) {
evaluated: c == QLatin1Char('P')
TRUEFALSE
yes
Evaluation Count:87
yes
Evaluation Count:10005
executed: }
Execution Count:331
87-10005
3097 input = InpS; -
3098 } else if (c == QLatin1Char('[')) {
evaluated: c == QLatin1Char('[')
TRUEFALSE
yes
Evaluation Count:1570
yes
Evaluation Count:8435
executed: }
Execution Count:87
87-8435
3099 input = InpOB; -
3100 } else if (c == QLatin1Char(']')) {
evaluated: c == QLatin1Char(']')
TRUEFALSE
yes
Evaluation Count:1521
yes
Evaluation Count:6914
executed: }
Execution Count:1570
1521-6914
3101 input = InpCB; -
3102 } else if (c == QLatin1Char('%')) {
evaluated: c == QLatin1Char('%')
TRUEFALSE
yes
Evaluation Count:51
yes
Evaluation Count:6863
executed: }
Execution Count:1521
51-6863
3103 input = InpPer; -
3104 } else if (c == QLatin1Char('>')) {
evaluated: c == QLatin1Char('>')
TRUEFALSE
yes
Evaluation Count:1836
yes
Evaluation Count:5027
executed: }
Execution Count:51
51-5027
3105 input = InpGt; -
3106 } else {
executed: }
Execution Count:1836
1836
3107 input = InpUnknown; -
3108 }
executed: }
Execution Count:5027
5027
3109 state = table[state][input]; -
3110 -
3111 switch (state) { -
3112 case Doctype: -
3113 parseString_s = QLatin1String("DOCTYPE"); -
3114 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:1332
yes
Evaluation Count:555
555-1332
3115 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); -
3116 return false;
executed: return false;
Execution Count:1332
1332
3117 } -
3118 break;
executed: break;
Execution Count:555
555
3119 case Ws1: -
3120 case Ws2: -
3121 case Ws3: -
3122 case Ws4: -
3123 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:2308
yes
Evaluation Count:4683
2308-4683
3124 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); -
3125 return false;
executed: return false;
Execution Count:2308
2308
3126 } -
3127 break;
executed: break;
Execution Count:4683
4683
3128 case Doctype2: -
3129 parseName_useRef = false; -
3130 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:846
yes
Evaluation Count:1041
846-1041
3131 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); -
3132 return false;
executed: return false;
Execution Count:846
846
3133 } -
3134 break;
executed: break;
Execution Count:1041
1041
3135 case Sys: -
3136 parseExternalID_allowPublicID = false; -
3137 if (!parseExternalID()) {
evaluated: !parseExternalID()
TRUEFALSE
yes
Evaluation Count:279
yes
Evaluation Count:139
139-279
3138 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); -
3139 return false;
executed: return false;
Execution Count:279
279
3140 } -
3141 thisPublicId = publicId; -
3142 thisSystemId = systemId; -
3143 break;
executed: break;
Execution Count:139
139
3144 case MP: -
3145 case MPR: -
3146 if (!next_eat_ws()) {
evaluated: !next_eat_ws()
TRUEFALSE
yes
Evaluation Count:885
yes
Evaluation Count:685
685-885
3147 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); -
3148 return false;
executed: return false;
Execution Count:885
885
3149 } -
3150 break;
executed: break;
Execution Count:685
685
3151 case PER: -
3152 parsePEReference_context = InDTD; -
3153 if (!parsePEReference()) {
evaluated: !parsePEReference()
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:30
20-30
3154 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); -
3155 return false;
executed: return false;
Execution Count:20
20
3156 } -
3157 break;
executed: break;
Execution Count:30
30
3158 case Mup: -
3159 if (!parseMarkupdecl()) {
evaluated: !parseMarkupdecl()
TRUEFALSE
yes
Evaluation Count:2457
yes
Evaluation Count:682
682-2457
3160 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); -
3161 return false;
executed: return false;
Execution Count:2457
2457
3162 } -
3163 break;
executed: break;
Execution Count:682
682
3164 case MPE: -
3165 if (!next_eat_ws()) {
evaluated: !next_eat_ws()
TRUEFALSE
yes
Evaluation Count:417
yes
Evaluation Count:1104
417-1104
3166 parseFailed(&QXmlSimpleReaderPrivate::parseDoctype, state); -
3167 return false;
executed: return false;
Execution Count:417
417
3168 } -
3169 break;
executed: break;
Execution Count:1104
1104
3170 case Done: -
3171 if (lexicalHnd) {
evaluated: lexicalHnd
TRUEFALSE
yes
Evaluation Count:1830
yes
Evaluation Count:6
6-1830
3172 if (!startDTDwasReported) {
evaluated: !startDTDwasReported
TRUEFALSE
yes
Evaluation Count:311
yes
Evaluation Count:1519
311-1519
3173 startDTDwasReported = true; -
3174 if (!lexicalHnd->startDTD(doctype, publicId, systemId)) {
partially evaluated: !lexicalHnd->startDTD(doctype, publicId, systemId)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:311
0-311
3175 reportParseError(lexicalHnd->errorString()); -
3176 return false;
never executed: return false;
0
3177 } -
3178 }
executed: }
Execution Count:311
311
3179 if (!lexicalHnd->endDTD()) {
partially evaluated: !lexicalHnd->endDTD()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:1830
0-1830
3180 reportParseError(lexicalHnd->errorString()); -
3181 return false;
never executed: return false;
0
3182 } -
3183 }
executed: }
Execution Count:1830
1830
3184 next(); -
3185 break;
executed: break;
Execution Count:1836
1836
3186 } -
3187 }
executed: }
Execution Count:10757
10757
3188 return false;
never executed: return false;
0
3189} -
3190 -
3191 -
3192 -
3193 -
3194 -
3195 -
3196bool QXmlSimpleReaderPrivate::parseExternalID() -
3197{ -
3198 const signed char Init = 0; -
3199 const signed char Sys = 1; -
3200 const signed char SysWS = 2; -
3201 const signed char SysSQ = 3; -
3202 const signed char SysSQ2 = 4; -
3203 const signed char SysDQ = 5; -
3204 const signed char SysDQ2 = 6; -
3205 const signed char Pub = 7; -
3206 const signed char PubWS = 8; -
3207 const signed char PubSQ = 9; -
3208 const signed char PubSQ2 = 10; -
3209 const signed char PubDQ = 11; -
3210 const signed char PubDQ2 = 12; -
3211 const signed char PubE = 13; -
3212 const signed char PubWS2 = 14; -
3213 const signed char PDone = 15; -
3214 const signed char Done = 16; -
3215 -
3216 const signed char InpSQ = 0; -
3217 const signed char InpDQ = 1; -
3218 const signed char InpS = 2; -
3219 const signed char InpP = 3; -
3220 const signed char InpWs = 4; -
3221 const signed char InpUnknown = 5; -
3222 -
3223 static const signed char table[15][6] = { -
3224 -
3225 { -1, -1, Sys, Pub, -1, -1 }, -
3226 { -1, -1, -1, -1, SysWS, -1 }, -
3227 { SysSQ, SysDQ, -1, -1, -1, -1 }, -
3228 { Done, SysSQ2, SysSQ2, SysSQ2, SysSQ2, SysSQ2 }, -
3229 { Done, SysSQ2, SysSQ2, SysSQ2, SysSQ2, SysSQ2 }, -
3230 { SysDQ2, Done, SysDQ2, SysDQ2, SysDQ2, SysDQ2 }, -
3231 { SysDQ2, Done, SysDQ2, SysDQ2, SysDQ2, SysDQ2 }, -
3232 { -1, -1, -1, -1, PubWS, -1 }, -
3233 { PubSQ, PubDQ, -1, -1, -1, -1 }, -
3234 { PubE, -1, PubSQ2, PubSQ2, PubSQ2, PubSQ2 }, -
3235 { PubE, -1, PubSQ2, PubSQ2, PubSQ2, PubSQ2 }, -
3236 { -1, PubE, PubDQ2, PubDQ2, PubDQ2, PubDQ2 }, -
3237 { -1, PubE, PubDQ2, PubDQ2, PubDQ2, PubDQ2 }, -
3238 { PDone, PDone, PDone, PDone, PubWS2, PDone }, -
3239 { SysSQ, SysDQ, PDone, PDone, PDone, PDone } -
3240 }; -
3241 signed char state; -
3242 signed char input; -
3243 -
3244 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:205
yes
Evaluation Count:3322
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:522
yes
Evaluation Count:2800
205-3322
3245 systemId.clear(); -
3246 publicId.clear(); -
3247 state = Init; -
3248 } else {
executed: }
Execution Count:727
727
3249 state = parseStack->pop().state; -
3250 -
3251 -
3252 -
3253 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:956
yes
Evaluation Count:1844
956-1844
3254 ParseFunction function = parseStack->top().function; -
3255 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:173
yes
Evaluation Count:783
173-783
3256 parseStack->pop(); -
3257 -
3258 -
3259 -
3260 }
executed: }
Execution Count:173
173
3261 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:341
yes
Evaluation Count:615
341-615
3262 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); -
3263 return false;
executed: return false;
Execution Count:341
341
3264 } -
3265 }
executed: }
Execution Count:615
615
3266 }
executed: }
Execution Count:2459
2459
3267 -
3268 for (;;) { -
3269 switch (state) { -
3270 case PDone: -
3271 if (parseExternalID_allowPublicID) {
evaluated: parseExternalID_allowPublicID
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:2
2-20
3272 publicId = string(); -
3273 return true;
executed: return true;
Execution Count:20
20
3274 } else { -
3275 reportParseError(QLatin1String("unexpected character")); -
3276 return false;
executed: return false;
Execution Count:2
2
3277 } -
3278 case Done: -
3279 return true;
executed: return true;
Execution Count:705
705
3280 case -1: -
3281 -
3282 reportParseError(QLatin1String("unexpected character")); -
3283 return false;
never executed: return false;
0
3284 } -
3285 -
3286 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:1844
yes
Evaluation Count:14132
1844-14132
3287 unexpectedEof(&QXmlSimpleReaderPrivate::parseExternalID, state); -
3288 return false;
executed: return false;
Execution Count:1844
1844
3289 } -
3290 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:1022
yes
Evaluation Count:13110
1022-13110
3291 input = InpWs; -
3292 } else if (c == QLatin1Char('\'')) {
evaluated: c == QLatin1Char('\'')
TRUEFALSE
yes
Evaluation Count:80
yes
Evaluation Count:13030
executed: }
Execution Count:1022
80-13030
3293 input = InpSQ; -
3294 } else if (c == QLatin1Char('"')) {
evaluated: c == QLatin1Char('"')
TRUEFALSE
yes
Evaluation Count:1615
yes
Evaluation Count:11415
executed: }
Execution Count:80
80-11415
3295 input = InpDQ; -
3296 } else if (c == QLatin1Char('S')) {
evaluated: c == QLatin1Char('S')
TRUEFALSE
yes
Evaluation Count:586
yes
Evaluation Count:10829
executed: }
Execution Count:1615
586-10829
3297 input = InpS; -
3298 } else if (c == QLatin1Char('P')) {
evaluated: c == QLatin1Char('P')
TRUEFALSE
yes
Evaluation Count:142
yes
Evaluation Count:10687
executed: }
Execution Count:586
142-10687
3299 input = InpP; -
3300 } else {
executed: }
Execution Count:142
142
3301 input = InpUnknown; -
3302 }
executed: }
Execution Count:10687
10687
3303 state = table[state][input]; -
3304 -
3305 switch (state) { -
3306 case Sys: -
3307 parseString_s = QLatin1String("SYSTEM"); -
3308 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:392
yes
Evaluation Count:193
193-392
3309 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); -
3310 return false;
executed: return false;
Execution Count:392
392
3311 } -
3312 break;
executed: break;
Execution Count:193
193
3313 case SysWS: -
3314 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:133
yes
Evaluation Count:452
133-452
3315 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); -
3316 return false;
executed: return false;
Execution Count:133
133
3317 } -
3318 break;
executed: break;
Execution Count:452
452
3319 case SysSQ: -
3320 case SysDQ: -
3321 stringClear(); -
3322 next(); -
3323 break;
executed: break;
Execution Count:705
705
3324 case SysSQ2: -
3325 case SysDQ2: -
3326 stringAddC(); -
3327 next(); -
3328 break;
executed: break;
Execution Count:8466
8466
3329 case Pub: -
3330 parseString_s = QLatin1String("PUBLIC"); -
3331 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:50
yes
Evaluation Count:92
50-92
3332 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); -
3333 return false;
executed: return false;
Execution Count:50
50
3334 } -
3335 break;
executed: break;
Execution Count:92
92
3336 case PubWS: -
3337 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:22
yes
Evaluation Count:120
22-120
3338 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); -
3339 return false;
executed: return false;
Execution Count:22
22
3340 } -
3341 break;
executed: break;
Execution Count:120
120
3342 case PubSQ: -
3343 case PubDQ: -
3344 stringClear(); -
3345 next(); -
3346 break;
executed: break;
Execution Count:142
142
3347 case PubSQ2: -
3348 case PubDQ2: -
3349 stringAddC(); -
3350 next(); -
3351 break;
executed: break;
Execution Count:2376
2376
3352 case PubE: -
3353 next(); -
3354 break;
executed: break;
Execution Count:142
142
3355 case PubWS2: -
3356 publicId = string(); -
3357 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:102
18-102
3358 parseFailed(&QXmlSimpleReaderPrivate::parseExternalID, state); -
3359 return false;
executed: return false;
Execution Count:18
18
3360 } -
3361 break;
executed: break;
Execution Count:102
102
3362 case Done: -
3363 systemId = string(); -
3364 next(); -
3365 break;
executed: break;
Execution Count:705
705
3366 } -
3367 }
executed: }
Execution Count:13517
13517
3368 return false;
never executed: return false;
0
3369} -
3370 -
3371 -
3372 -
3373 -
3374bool QXmlSimpleReaderPrivate::parseMarkupdecl() -
3375{ -
3376 const signed char Init = 0; -
3377 const signed char Lt = 1; -
3378 const signed char Em = 2; -
3379 const signed char CE = 3; -
3380 const signed char Qm = 4; -
3381 const signed char Dash = 5; -
3382 const signed char CA = 6; -
3383 const signed char CEL = 7; -
3384 const signed char CEN = 8; -
3385 const signed char CN = 9; -
3386 const signed char Done = 10; -
3387 -
3388 const signed char InpLt = 0; -
3389 const signed char InpQm = 1; -
3390 const signed char InpEm = 2; -
3391 const signed char InpDash = 3; -
3392 const signed char InpA = 4; -
3393 const signed char InpE = 5; -
3394 const signed char InpL = 6; -
3395 const signed char InpN = 7; -
3396 const signed char InpUnknown = 8; -
3397 -
3398 static const signed char table[4][9] = { -
3399 -
3400 { Lt, -1, -1, -1, -1, -1, -1, -1, -1 }, -
3401 { -1, Qm, Em, -1, -1, -1, -1, -1, -1 }, -
3402 { -1, -1, -1, Dash, CA, CE, -1, CN, -1 }, -
3403 { -1, -1, -1, -1, -1, -1, CEL, CEN, -1 } -
3404 }; -
3405 signed char state; -
3406 signed char input; -
3407 -
3408 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:722
yes
Evaluation Count:21658
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:2417
yes
Evaluation Count:19241
722-21658
3409 state = Init; -
3410 } else {
executed: }
Execution Count:3139
3139
3411 state = parseStack->pop().state; -
3412 -
3413 -
3414 -
3415 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:16888
yes
Evaluation Count:2353
2353-16888
3416 ParseFunction function = parseStack->top().function; -
3417 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
partially evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:16888
0-16888
3418 parseStack->pop(); -
3419 -
3420 -
3421 -
3422 }
never executed: }
0
3423 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:14480
yes
Evaluation Count:2408
2408-14480
3424 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); -
3425 return false;
executed: return false;
Execution Count:14480
14480
3426 } -
3427 }
executed: }
Execution Count:2408
2408
3428 }
executed: }
Execution Count:4761
4761
3429 -
3430 for (;;) { -
3431 switch (state) { -
3432 case Qm: -
3433 if (contentHnd) {
never evaluated: contentHnd
0
3434 if (!contentHnd->processingInstruction(name(),string())) {
never evaluated: !contentHnd->processingInstruction(name(),string())
0
3435 reportParseError(contentHnd->errorString()); -
3436 return false;
never executed: return false;
0
3437 } -
3438 }
never executed: }
0
3439 return true;
never executed: return true;
0
3440 case Dash: -
3441 if (lexicalHnd) {
evaluated: lexicalHnd
TRUEFALSE
yes
Evaluation Count:55
yes
Evaluation Count:6
6-55
3442 if (!lexicalHnd->comment(string())) {
partially evaluated: !lexicalHnd->comment(string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:55
0-55
3443 reportParseError(lexicalHnd->errorString()); -
3444 return false;
never executed: return false;
0
3445 } -
3446 }
executed: }
Execution Count:55
55
3447 return true;
executed: return true;
Execution Count:61
61
3448 case CA: -
3449 return true;
executed: return true;
Execution Count:535
535
3450 case CEL: -
3451 return true;
executed: return true;
Execution Count:1558
1558
3452 case CEN: -
3453 return true;
executed: return true;
Execution Count:880
880
3454 case CN: -
3455 return true;
executed: return true;
Execution Count:56
56
3456 case Done: -
3457 return true;
never executed: return true;
0
3458 case -1: -
3459 -
3460 reportParseError(QLatin1String("letter is expected")); -
3461 return false;
executed: return false;
Execution Count:3
3
3462 } -
3463 -
3464 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:2353
yes
Evaluation Count:11885
2353-11885
3465 unexpectedEof(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); -
3466 return false;
executed: return false;
Execution Count:2353
2353
3467 } -
3468 if (c == QLatin1Char('<')) {
evaluated: c == QLatin1Char('<')
TRUEFALSE
yes
Evaluation Count:3139
yes
Evaluation Count:8746
3139-8746
3469 input = InpLt; -
3470 } else if (c == QLatin1Char('?')) {
evaluated: c == QLatin1Char('?')
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:8745
executed: }
Execution Count:3139
1-8745
3471 input = InpQm; -
3472 } else if (c == QLatin1Char('!')) {
evaluated: c == QLatin1Char('!')
TRUEFALSE
yes
Evaluation Count:3137
yes
Evaluation Count:5608
executed: }
Execution Count:1
1-5608
3473 input = InpEm; -
3474 } else if (c == QLatin1Char('-')) {
evaluated: c == QLatin1Char('-')
TRUEFALSE
yes
Evaluation Count:61
yes
Evaluation Count:5547
executed: }
Execution Count:3137
61-5547
3475 input = InpDash; -
3476 } else if (c == QLatin1Char('A')) {
evaluated: c == QLatin1Char('A')
TRUEFALSE
yes
Evaluation Count:548
yes
Evaluation Count:4999
executed: }
Execution Count:61
61-4999
3477 input = InpA; -
3478 } else if (c == QLatin1Char('E')) {
evaluated: c == QLatin1Char('E')
TRUEFALSE
yes
Evaluation Count:2470
yes
Evaluation Count:2529
executed: }
Execution Count:548
548-2529
3479 input = InpE; -
3480 } else if (c == QLatin1Char('L')) {
evaluated: c == QLatin1Char('L')
TRUEFALSE
yes
Evaluation Count:1577
yes
Evaluation Count:952
executed: }
Execution Count:2470
952-2470
3481 input = InpL; -
3482 } else if (c == QLatin1Char('N')) {
evaluated: c == QLatin1Char('N')
TRUEFALSE
yes
Evaluation Count:949
yes
Evaluation Count:3
executed: }
Execution Count:1577
3-1577
3483 input = InpN; -
3484 } else {
executed: }
Execution Count:949
949
3485 input = InpUnknown; -
3486 }
executed: }
Execution Count:3
3
3487 state = table[state][input]; -
3488 -
3489 switch (state) { -
3490 case Lt: -
3491 next(); -
3492 break;
executed: break;
Execution Count:3139
3139
3493 case Em: -
3494 next(); -
3495 break;
executed: break;
Execution Count:3137
3137
3496 case CE: -
3497 next(); -
3498 break;
executed: break;
Execution Count:2470
2470
3499 case Qm: -
3500 parsePI_xmldecl = false; -
3501 if (!parsePI()) {
partially evaluated: !parsePI()
TRUEFALSE
yes
Evaluation Count:1
no
Evaluation Count:0
0-1
3502 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); -
3503 return false;
executed: return false;
Execution Count:1
1
3504 } -
3505 break;
never executed: break;
0
3506 case Dash: -
3507 if (!parseComment()) {
evaluated: !parseComment()
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:52
9-52
3508 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); -
3509 return false;
executed: return false;
Execution Count:9
9
3510 } -
3511 break;
executed: break;
Execution Count:52
52
3512 case CA: -
3513 if (!parseAttlistDecl()) {
evaluated: !parseAttlistDecl()
TRUEFALSE
yes
Evaluation Count:490
yes
Evaluation Count:58
58-490
3514 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); -
3515 return false;
executed: return false;
Execution Count:490
490
3516 } -
3517 break;
executed: break;
Execution Count:58
58
3518 case CEL: -
3519 if (!parseElementDecl()) {
evaluated: !parseElementDecl()
TRUEFALSE
yes
Evaluation Count:1374
yes
Evaluation Count:203
203-1374
3520 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); -
3521 return false;
executed: return false;
Execution Count:1374
1374
3522 } -
3523 break;
executed: break;
Execution Count:203
203
3524 case CEN: -
3525 if (!parseEntityDecl()) {
evaluated: !parseEntityDecl()
TRUEFALSE
yes
Evaluation Count:535
yes
Evaluation Count:358
358-535
3526 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); -
3527 return false;
executed: return false;
Execution Count:535
535
3528 } -
3529 break;
executed: break;
Execution Count:358
358
3530 case CN: -
3531 if (!parseNotationDecl()) {
evaluated: !parseNotationDecl()
TRUEFALSE
yes
Evaluation Count:45
yes
Evaluation Count:11
11-45
3532 parseFailed(&QXmlSimpleReaderPrivate::parseMarkupdecl, state); -
3533 return false;
executed: return false;
Execution Count:45
45
3534 } -
3535 break;
executed: break;
Execution Count:11
11
3536 } -
3537 }
executed: }
Execution Count:9431
9431
3538 return false;
never executed: return false;
0
3539} -
3540 -
3541 -
3542 -
3543 -
3544bool QXmlSimpleReaderPrivate::parsePEReference() -
3545{ -
3546 const signed char Init = 0; -
3547 const signed char Next = 1; -
3548 const signed char Name = 2; -
3549 const signed char NameR = 3; -
3550 const signed char Done = 4; -
3551 -
3552 const signed char InpSemi = 0; -
3553 const signed char InpPer = 1; -
3554 const signed char InpUnknown = 2; -
3555 -
3556 static const signed char table[4][3] = { -
3557 -
3558 { -1, Next, -1 }, -
3559 { -1, -1, Name }, -
3560 { Done, -1, -1 }, -
3561 { Done, -1, -1 } -
3562 }; -
3563 signed char state; -
3564 signed char input; -
3565 -
3566 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:70
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:45
yes
Evaluation Count:25
7-70
3567 state = Init; -
3568 } else {
executed: }
Execution Count:52
52
3569 state = parseStack->pop().state; -
3570 -
3571 -
3572 -
3573 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:18
7-18
3574 ParseFunction function = parseStack->top().function; -
3575 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
partially evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
3576 parseStack->pop(); -
3577 -
3578 -
3579 -
3580 }
never executed: }
0
3581 if (!(this->*function)()) {
partially evaluated: !(this->*function)()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:7
0-7
3582 parseFailed(&QXmlSimpleReaderPrivate::parsePEReference, state); -
3583 return false;
never executed: return false;
0
3584 } -
3585 }
executed: }
Execution Count:7
7
3586 }
executed: }
Execution Count:25
25
3587 -
3588 for (;;) { -
3589 switch (state) { -
3590 case Name: -
3591 { -
3592 bool skipIt = true; -
3593 QString xmlRefString; -
3594 -
3595 QMap<QString,QString>::Iterator it; -
3596 it = parameterEntities.find(ref()); -
3597 if (it != parameterEntities.end()) {
evaluated: it != parameterEntities.end()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:40
12-40
3598 skipIt = false; -
3599 xmlRefString = *it; -
3600 } else if (entityRes) {
partially evaluated: entityRes
TRUEFALSE
yes
Evaluation Count:40
no
Evaluation Count:0
executed: }
Execution Count:12
0-40
3601 QMap<QString,QXmlSimpleReaderPrivate::ExternParameterEntity>::Iterator it2; -
3602 it2 = externParameterEntities.find(ref()); -
3603 QXmlInputSource *ret = 0; -
3604 if (it2 != externParameterEntities.end()) {
partially evaluated: it2 != externParameterEntities.end()
TRUEFALSE
yes
Evaluation Count:40
no
Evaluation Count:0
0-40
3605 if (!entityRes->resolveEntity((*it2).publicId, (*it2).systemId, ret)) {
partially evaluated: !entityRes->resolveEntity((*it2).publicId, (*it2).systemId, ret)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:40
0-40
3606 delete ret; -
3607 reportParseError(entityRes->errorString()); -
3608 return false;
never executed: return false;
0
3609 } -
3610 if (ret) {
partially evaluated: ret
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:40
0-40
3611 xmlRefString = ret->data(); -
3612 delete ret; -
3613 if (!stripTextDecl(xmlRefString)) {
never evaluated: !stripTextDecl(xmlRefString)
0
3614 reportParseError(QLatin1String("error in the text declaration of an external entity")); -
3615 return false;
never executed: return false;
0
3616 } -
3617 skipIt = false; -
3618 }
never executed: }
0
3619 }
executed: }
Execution Count:40
40
3620 }
executed: }
Execution Count:40
40
3621 -
3622 if (skipIt) {
evaluated: skipIt
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:12
12-40
3623 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:40
no
Evaluation Count:0
0-40
3624 if (!contentHnd->skippedEntity(QLatin1Char('%') + ref())) {
partially evaluated: !contentHnd->skippedEntity(QLatin1Char('%') + ref())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:40
0-40
3625 reportParseError(contentHnd->errorString()); -
3626 return false;
never executed: return false;
0
3627 } -
3628 }
executed: }
Execution Count:40
40
3629 } else {
executed: }
Execution Count:40
40
3630 if (parsePEReference_context == InEntityValue) {
evaluated: parsePEReference_context == InEntityValue
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:10
2-10
3631 -
3632 if (!insertXmlRef(xmlRefString, ref(), true))
partially evaluated: !insertXmlRef(xmlRefString, ref(), true)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
3633 return false;
never executed: return false;
0
3634 } else if (parsePEReference_context == InDTD) {
partially evaluated: parsePEReference_context == InDTD
TRUEFALSE
yes
Evaluation Count:10
no
Evaluation Count:0
executed: }
Execution Count:2
0-10
3635 -
3636 if (!insertXmlRef(QLatin1Char(' ') + xmlRefString + QLatin1Char(' '), ref(), false))
partially evaluated: !insertXmlRef(QLatin1Char(' ') + xmlRefString + QLatin1Char(' '), ref(), false)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10
0-10
3637 return false;
never executed: return false;
0
3638 }
executed: }
Execution Count:10
10
3639 } -
3640 } -
3641 state = NameR; -
3642 break;
executed: break;
Execution Count:52
52
3643 case Done: -
3644 return true;
executed: return true;
Execution Count:52
52
3645 case -1: -
3646 -
3647 reportParseError(QLatin1String("letter is expected")); -
3648 return false;
never executed: return false;
0
3649 } -
3650 -
3651 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:156
18-156
3652 unexpectedEof(&QXmlSimpleReaderPrivate::parsePEReference, state); -
3653 return false;
executed: return false;
Execution Count:18
18
3654 } -
3655 if (c == QLatin1Char(';')) {
evaluated: c == QLatin1Char(';')
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:104
52-104
3656 input = InpSemi; -
3657 } else if (c == QLatin1Char('%')) {
evaluated: c == QLatin1Char('%')
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:52
executed: }
Execution Count:52
52
3658 input = InpPer; -
3659 } else {
executed: }
Execution Count:52
52
3660 input = InpUnknown; -
3661 }
executed: }
Execution Count:52
52
3662 state = table[state][input]; -
3663 -
3664 switch (state) { -
3665 case Next: -
3666 next(); -
3667 break;
executed: break;
Execution Count:52
52
3668 case Name: -
3669 case NameR: -
3670 parseName_useRef = true; -
3671 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:7
yes
Evaluation Count:45
7-45
3672 parseFailed(&QXmlSimpleReaderPrivate::parsePEReference, state); -
3673 return false;
executed: return false;
Execution Count:7
7
3674 } -
3675 break;
executed: break;
Execution Count:45
45
3676 case Done: -
3677 next(); -
3678 break;
executed: break;
Execution Count:52
52
3679 } -
3680 }
executed: }
Execution Count:149
149
3681 return false;
never executed: return false;
0
3682} -
3683 -
3684 -
3685 -
3686 -
3687 -
3688 -
3689 -
3690bool QXmlSimpleReaderPrivate::parseAttlistDecl() -
3691{ -
3692 const signed char Init = 0; -
3693 const signed char Attlist = 1; -
3694 const signed char Ws = 2; -
3695 const signed char Name = 3; -
3696 const signed char Ws1 = 4; -
3697 const signed char Attdef = 5; -
3698 const signed char Ws2 = 6; -
3699 const signed char Atttype = 7; -
3700 const signed char Ws3 = 8; -
3701 const signed char DDecH = 9; -
3702 const signed char DefReq = 10; -
3703 const signed char DefImp = 11; -
3704 const signed char DefFix = 12; -
3705 const signed char Attval = 13; -
3706 const signed char Ws4 = 14; -
3707 const signed char Done = 15; -
3708 -
3709 const signed char InpWs = 0; -
3710 const signed char InpGt = 1; -
3711 const signed char InpHash = 2; -
3712 const signed char InpA = 3; -
3713 const signed char InpI = 4; -
3714 const signed char InpF = 5; -
3715 const signed char InpR = 6; -
3716 const signed char InpUnknown = 7; -
3717 -
3718 static const signed char table[15][8] = { -
3719 -
3720 { -1, -1, -1, Attlist, -1, -1, -1, -1 }, -
3721 { Ws, -1, -1, -1, -1, -1, -1, -1 }, -
3722 { -1, -1, -1, Name, Name, Name, Name, Name }, -
3723 { Ws1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef }, -
3724 { -1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef }, -
3725 { Ws2, -1, -1, -1, -1, -1, -1, -1 }, -
3726 { -1, Atttype, Atttype, Atttype, Atttype, Atttype, Atttype, Atttype }, -
3727 { Ws3, -1, -1, -1, -1, -1, -1, -1 }, -
3728 { -1, Attval, DDecH, Attval, Attval, Attval, Attval, Attval }, -
3729 { -1, -1, -1, -1, DefImp, DefFix, DefReq, -1 }, -
3730 { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, -
3731 { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, -
3732 { Ws3, -1, -1, -1, -1, -1, -1, -1 }, -
3733 { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, -
3734 { -1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef } -
3735 }; -
3736 signed char state; -
3737 signed char input; -
3738 -
3739 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:71
yes
Evaluation Count:5236
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:477
yes
Evaluation Count:4759
71-5236
3740 state = Init; -
3741 } else {
executed: }
Execution Count:548
548
3742 state = parseStack->pop().state; -
3743 -
3744 -
3745 -
3746 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:4331
yes
Evaluation Count:428
428-4331
3747 ParseFunction function = parseStack->top().function; -
3748 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:589
yes
Evaluation Count:3742
589-3742
3749 parseStack->pop(); -
3750 -
3751 -
3752 -
3753 }
executed: }
Execution Count:589
589
3754 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:1729
yes
Evaluation Count:2602
1729-2602
3755 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3756 return false;
executed: return false;
Execution Count:1729
1729
3757 } -
3758 }
executed: }
Execution Count:2602
2602
3759 }
executed: }
Execution Count:3030
3030
3760 -
3761 for (;;) { -
3762 switch (state) { -
3763 case Name: -
3764 attDeclEName = name(); -
3765 break;
executed: break;
Execution Count:547
547
3766 case Attdef: -
3767 attDeclAName = name(); -
3768 break;
executed: break;
Execution Count:618
618
3769 case Done: -
3770 return true;
executed: return true;
Execution Count:535
535
3771 case -1: -
3772 -
3773 reportParseError(QLatin1String("letter is expected")); -
3774 return false;
executed: return false;
Execution Count:5
5
3775 } -
3776 -
3777 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:428
yes
Evaluation Count:6877
428-6877
3778 unexpectedEof(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3779 return false;
executed: return false;
Execution Count:428
428
3780 } -
3781 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:2425
yes
Evaluation Count:4452
2425-4452
3782 input = InpWs; -
3783 } else if (c == QLatin1Char('>')) {
evaluated: c == QLatin1Char('>')
TRUEFALSE
yes
Evaluation Count:1060
yes
Evaluation Count:3392
executed: }
Execution Count:2425
1060-3392
3784 input = InpGt; -
3785 } else if (c == QLatin1Char('#')) {
evaluated: c == QLatin1Char('#')
TRUEFALSE
yes
Evaluation Count:427
yes
Evaluation Count:2965
executed: }
Execution Count:1060
427-2965
3786 input = InpHash; -
3787 } else if (c == QLatin1Char('A')) {
evaluated: c == QLatin1Char('A')
TRUEFALSE
yes
Evaluation Count:558
yes
Evaluation Count:2407
executed: }
Execution Count:427
427-2407
3788 input = InpA; -
3789 } else if (c == QLatin1Char('I')) {
evaluated: c == QLatin1Char('I')
TRUEFALSE
yes
Evaluation Count:424
yes
Evaluation Count:1983
executed: }
Execution Count:558
424-1983
3790 input = InpI; -
3791 } else if (c == QLatin1Char('F')) {
evaluated: c == QLatin1Char('F')
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:1962
executed: }
Execution Count:424
21-1962
3792 input = InpF; -
3793 } else if (c == QLatin1Char('R')) {
evaluated: c == QLatin1Char('R')
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:1952
executed: }
Execution Count:21
10-1952
3794 input = InpR; -
3795 } else {
executed: }
Execution Count:10
10
3796 input = InpUnknown; -
3797 }
executed: }
Execution Count:1952
1952
3798 state = table[state][input]; -
3799 -
3800 switch (state) { -
3801 case Attlist: -
3802 parseString_s = QLatin1String("ATTLIST"); -
3803 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:428
yes
Evaluation Count:120
120-428
3804 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3805 return false;
executed: return false;
Execution Count:428
428
3806 } -
3807 break;
executed: break;
Execution Count:120
120
3808 case Ws: -
3809 case Ws1: -
3810 case Ws2: -
3811 case Ws3: -
3812 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:545
yes
Evaluation Count:1799
545-1799
3813 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3814 return false;
executed: return false;
Execution Count:545
545
3815 } -
3816 break;
executed: break;
Execution Count:1799
1799
3817 case Name: -
3818 parseName_useRef = false; -
3819 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:401
yes
Evaluation Count:146
146-401
3820 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3821 return false;
executed: return false;
Execution Count:401
401
3822 } -
3823 break;
executed: break;
Execution Count:146
146
3824 case Attdef: -
3825 parseName_useRef = false; -
3826 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:230
yes
Evaluation Count:388
230-388
3827 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3828 return false;
executed: return false;
Execution Count:230
230
3829 } -
3830 break;
executed: break;
Execution Count:388
388
3831 case Atttype: -
3832 if (!parseAttType()) {
evaluated: !parseAttType()
TRUEFALSE
yes
Evaluation Count:489
yes
Evaluation Count:128
128-489
3833 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3834 return false;
executed: return false;
Execution Count:489
489
3835 } -
3836 break;
executed: break;
Execution Count:128
128
3837 case DDecH: -
3838 next(); -
3839 break;
executed: break;
Execution Count:425
425
3840 case DefReq: -
3841 parseString_s = QLatin1String("REQUIRED"); -
3842 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:9
yes
Evaluation Count:1
1-9
3843 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3844 return false;
executed: return false;
Execution Count:9
9
3845 } -
3846 break;
executed: break;
Execution Count:1
1
3847 case DefImp: -
3848 parseString_s = QLatin1String("IMPLIED"); -
3849 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:334
yes
Evaluation Count:60
60-334
3850 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3851 return false;
executed: return false;
Execution Count:334
334
3852 } -
3853 break;
executed: break;
Execution Count:60
60
3854 case DefFix: -
3855 parseString_s = QLatin1String("FIXED"); -
3856 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:9
9-12
3857 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3858 return false;
executed: return false;
Execution Count:12
12
3859 } -
3860 break;
executed: break;
Execution Count:9
9
3861 case Attval: -
3862 if (!parseAttValue()) {
evaluated: !parseAttValue()
TRUEFALSE
yes
Evaluation Count:127
yes
Evaluation Count:80
80-127
3863 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3864 return false;
executed: return false;
Execution Count:127
127
3865 } -
3866 break;
executed: break;
Execution Count:80
80
3867 case Ws4: -
3868 if (declHnd) {
partially evaluated: declHnd
TRUEFALSE
yes
Evaluation Count:606
no
Evaluation Count:0
0-606
3869 -
3870 if (!declHnd->attributeDecl(attDeclEName, attDeclAName, QLatin1String(""), QLatin1String(""), QLatin1String(""))) {
partially evaluated: !declHnd->attributeDecl(attDeclEName, attDeclAName, QLatin1String(""), QLatin1String(""), QLatin1String(""))
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:606
0-606
3871 reportParseError(declHnd->errorString()); -
3872 return false;
never executed: return false;
0
3873 } -
3874 }
executed: }
Execution Count:606
606
3875 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:35
yes
Evaluation Count:571
35-571
3876 parseFailed(&QXmlSimpleReaderPrivate::parseAttlistDecl, state); -
3877 return false;
executed: return false;
Execution Count:35
35
3878 } -
3879 break;
executed: break;
Execution Count:571
571
3880 case Done: -
3881 next(); -
3882 break;
executed: break;
Execution Count:535
535
3883 } -
3884 }
executed: }
Execution Count:4267
4267
3885 return false;
never executed: return false;
0
3886} -
3887 -
3888 -
3889 -
3890 -
3891bool QXmlSimpleReaderPrivate::parseAttType() -
3892{ -
3893 const signed char Init = 0; -
3894 const signed char ST = 1; -
3895 const signed char TTI = 2; -
3896 const signed char TTI2 = 3; -
3897 const signed char TTI3 = 4; -
3898 const signed char TTE = 5; -
3899 const signed char TTEY = 6; -
3900 const signed char TTEI = 7; -
3901 const signed char N = 8; -
3902 const signed char TTNM = 9; -
3903 const signed char TTNM2 = 10; -
3904 const signed char NO = 11; -
3905 const signed char NO2 = 12; -
3906 const signed char NO3 = 13; -
3907 const signed char NOName = 14; -
3908 const signed char NO4 = 15; -
3909 const signed char EN = 16; -
3910 const signed char ENNmt = 17; -
3911 const signed char EN2 = 18; -
3912 const signed char ADone = 19; -
3913 const signed char Done = 20; -
3914 -
3915 const signed char InpWs = 0; -
3916 const signed char InpOp = 1; -
3917 const signed char InpCp = 2; -
3918 const signed char InpPipe = 3; -
3919 const signed char InpC = 4; -
3920 const signed char InpE = 5; -
3921 const signed char InpI = 6; -
3922 const signed char InpM = 7; -
3923 const signed char InpN = 8; -
3924 const signed char InpO = 9; -
3925 const signed char InpR = 10; -
3926 const signed char InpS = 11; -
3927 const signed char InpY = 12; -
3928 const signed char InpUnknown = 13; -
3929 -
3930 static const signed char table[19][14] = { -
3931 -
3932 { -1, EN, -1, -1, ST, TTE, TTI, -1, N, -1, -1, -1, -1, -1 }, -
3933 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, -
3934 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTI2, Done, Done, Done }, -
3935 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTI3, Done, Done }, -
3936 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, -
3937 { -1, -1, -1, -1, -1, -1, TTEI, -1, -1, -1, -1, -1, TTEY, -1 }, -
3938 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, -
3939 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, -
3940 { -1, -1, -1, -1, -1, -1, -1, TTNM, -1, NO, -1, -1, -1, -1 }, -
3941 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTNM2, Done, Done }, -
3942 { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, -
3943 { NO2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -
3944 { -1, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -
3945 { NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName }, -
3946 { NO4, -1, ADone, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -
3947 { -1, -1, ADone, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -
3948 { -1, -1, ENNmt, -1, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt }, -
3949 { EN2, -1, ADone, EN, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -
3950 { -1, -1, ADone, EN, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } -
3951 }; -
3952 signed char state; -
3953 signed char input; -
3954 -
3955 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:77
yes
Evaluation Count:1519
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:540
yes
Evaluation Count:979
77-1519
3956 state = Init; -
3957 } else {
executed: }
Execution Count:617
617
3958 state = parseStack->pop().state; -
3959 -
3960 -
3961 -
3962 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:747
yes
Evaluation Count:232
232-747
3963 ParseFunction function = parseStack->top().function; -
3964 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:26
yes
Evaluation Count:721
26-721
3965 parseStack->pop(); -
3966 -
3967 -
3968 -
3969 }
executed: }
Execution Count:26
26
3970 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:267
yes
Evaluation Count:480
267-480
3971 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
3972 return false;
executed: return false;
Execution Count:267
267
3973 } -
3974 }
executed: }
Execution Count:480
480
3975 }
executed: }
Execution Count:712
712
3976 -
3977 for (;;) { -
3978 switch (state) { -
3979 case ADone: -
3980 return true;
executed: return true;
Execution Count:32
32
3981 case Done: -
3982 return true;
executed: return true;
Execution Count:582
582
3983 case -1: -
3984 -
3985 reportParseError(QLatin1String("letter is expected")); -
3986 return false;
executed: return false;
Execution Count:3
3
3987 } -
3988 -
3989 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:232
yes
Evaluation Count:1531
232-1531
3990 unexpectedEof(&QXmlSimpleReaderPrivate::parseAttType, state); -
3991 return false;
executed: return false;
Execution Count:232
232
3992 } -
3993 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:601
yes
Evaluation Count:930
601-930
3994 input = InpWs; -
3995 } else if (c == QLatin1Char('(')) {
evaluated: c == QLatin1Char('(')
TRUEFALSE
yes
Evaluation Count:34
yes
Evaluation Count:896
executed: }
Execution Count:601
34-896
3996 input = InpOp; -
3997 } else if (c == QLatin1Char(')')) {
evaluated: c == QLatin1Char(')')
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:864
executed: }
Execution Count:34
32-864
3998 input = InpCp; -
3999 } else if (c == QLatin1Char('|')) {
evaluated: c == QLatin1Char('|')
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:843
executed: }
Execution Count:32
21-843
4000 input = InpPipe; -
4001 } else if (c == QLatin1Char('C')) {
evaluated: c == QLatin1Char('C')
TRUEFALSE
yes
Evaluation Count:471
yes
Evaluation Count:372
executed: }
Execution Count:21
21-471
4002 input = InpC; -
4003 } else if (c == QLatin1Char('E')) {
evaluated: c == QLatin1Char('E')
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:342
executed: }
Execution Count:471
30-471
4004 input = InpE; -
4005 } else if (c == QLatin1Char('I')) {
evaluated: c == QLatin1Char('I')
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:302
executed: }
Execution Count:30
30-302
4006 input = InpI; -
4007 } else if (c == QLatin1Char('M')) {
evaluated: c == QLatin1Char('M')
TRUEFALSE
yes
Evaluation Count:51
yes
Evaluation Count:251
executed: }
Execution Count:40
40-251
4008 input = InpM; -
4009 } else if (c == QLatin1Char('N')) {
evaluated: c == QLatin1Char('N')
TRUEFALSE
yes
Evaluation Count:73
yes
Evaluation Count:178
executed: }
Execution Count:51
51-178
4010 input = InpN; -
4011 } else if (c == QLatin1Char('O')) {
evaluated: c == QLatin1Char('O')
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:157
executed: }
Execution Count:73
21-157
4012 input = InpO; -
4013 } else if (c == QLatin1Char('R')) {
evaluated: c == QLatin1Char('R')
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:137
executed: }
Execution Count:21
20-137
4014 input = InpR; -
4015 } else if (c == QLatin1Char('S')) {
evaluated: c == QLatin1Char('S')
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:77
executed: }
Execution Count:20
20-77
4016 input = InpS; -
4017 } else if (c == QLatin1Char('Y')) {
evaluated: c == QLatin1Char('Y')
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:57
executed: }
Execution Count:60
20-60
4018 input = InpY; -
4019 } else {
executed: }
Execution Count:20
20
4020 input = InpUnknown; -
4021 }
executed: }
Execution Count:57
57
4022 state = table[state][input]; -
4023 -
4024 switch (state) { -
4025 case ST: -
4026 parseString_s = QLatin1String("CDATA"); -
4027 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:324
yes
Evaluation Count:147
147-324
4028 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4029 return false;
executed: return false;
Execution Count:324
324
4030 } -
4031 break;
executed: break;
Execution Count:147
147
4032 case TTI: -
4033 parseString_s = QLatin1String("ID"); -
4034 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:12
12-18
4035 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4036 return false;
executed: return false;
Execution Count:18
18
4037 } -
4038 break;
executed: break;
Execution Count:12
12
4039 case TTI2: -
4040 parseString_s = QLatin1String("REF"); -
4041 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:10
10
4042 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4043 return false;
executed: return false;
Execution Count:10
10
4044 } -
4045 break;
executed: break;
Execution Count:10
10
4046 case TTI3: -
4047 next(); -
4048 break;
executed: break;
Execution Count:10
10
4049 case TTE: -
4050 parseString_s = QLatin1String("ENTIT"); -
4051 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:6
6-24
4052 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4053 return false;
executed: return false;
Execution Count:24
24
4054 } -
4055 break;
executed: break;
Execution Count:6
6
4056 case TTEY: -
4057 next(); -
4058 break;
executed: break;
Execution Count:20
20
4059 case TTEI: -
4060 parseString_s = QLatin1String("IES"); -
4061 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:5
5
4062 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4063 return false;
executed: return false;
Execution Count:5
5
4064 } -
4065 break;
executed: break;
Execution Count:5
5
4066 case N: -
4067 next(); -
4068 break;
executed: break;
Execution Count:73
73
4069 case TTNM: -
4070 parseString_s = QLatin1String("MTOKEN"); -
4071 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:40
yes
Evaluation Count:11
11-40
4072 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4073 return false;
executed: return false;
Execution Count:40
40
4074 } -
4075 break;
executed: break;
Execution Count:11
11
4076 case TTNM2: -
4077 next(); -
4078 break;
executed: break;
Execution Count:50
50
4079 case NO: -
4080 parseString_s = QLatin1String("OTATION"); -
4081 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:4
4-17
4082 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4083 return false;
executed: return false;
Execution Count:17
17
4084 } -
4085 break;
executed: break;
Execution Count:4
4
4086 case NO2: -
4087 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:12
8-12
4088 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4089 return false;
executed: return false;
Execution Count:8
8
4090 } -
4091 break;
executed: break;
Execution Count:12
12
4092 case NO3: -
4093 if (!next_eat_ws()) {
evaluated: !next_eat_ws()
TRUEFALSE
yes
Evaluation Count:10
yes
Evaluation Count:20
10-20
4094 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4095 return false;
executed: return false;
Execution Count:10
10
4096 } -
4097 break;
executed: break;
Execution Count:20
20
4098 case NOName: -
4099 parseName_useRef = false; -
4100 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:19
11-19
4101 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4102 return false;
executed: return false;
Execution Count:11
11
4103 } -
4104 break;
executed: break;
Execution Count:19
19
4105 case NO4: -
4106 if (!eat_ws()) {
never evaluated: !eat_ws()
0
4107 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4108 return false;
never executed: return false;
0
4109 } -
4110 break;
never executed: break;
0
4111 case EN: -
4112 if (!next_eat_ws()) {
evaluated: !next_eat_ws()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:16
8-16
4113 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4114 return false;
executed: return false;
Execution Count:8
8
4115 } -
4116 break;
executed: break;
Execution Count:16
16
4117 case ENNmt: -
4118 if (!parseNmtoken()) {
evaluated: !parseNmtoken()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:19
5-19
4119 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4120 return false;
executed: return false;
Execution Count:5
5
4121 } -
4122 break;
executed: break;
Execution Count:19
19
4123 case EN2: -
4124 if (!eat_ws()) {
never evaluated: !eat_ws()
0
4125 parseFailed(&QXmlSimpleReaderPrivate::parseAttType, state); -
4126 return false;
never executed: return false;
0
4127 } -
4128 break;
never executed: break;
0
4129 case ADone: -
4130 next(); -
4131 break;
executed: break;
Execution Count:32
32
4132 } -
4133 }
executed: }
Execution Count:1051
1051
4134 return false;
never executed: return false;
0
4135} -
4136bool QXmlSimpleReaderPrivate::parseAttValue() -
4137{ -
4138 const signed char Init = 0; -
4139 const signed char Dq = 1; -
4140 const signed char DqRef = 2; -
4141 const signed char DqC = 3; -
4142 const signed char Sq = 4; -
4143 const signed char SqRef = 5; -
4144 const signed char SqC = 6; -
4145 const signed char Done = 7; -
4146 -
4147 const signed char InpDq = 0; -
4148 const signed char InpSq = 1; -
4149 const signed char InpAmp = 2; -
4150 const signed char InpLt = 3; -
4151 const signed char InpUnknown = 4; -
4152 -
4153 static const signed char table[7][5] = { -
4154 -
4155 { Dq, Sq, -1, -1, -1 }, -
4156 { Done, DqC, DqRef, -1, DqC }, -
4157 { Done, DqC, DqRef, -1, DqC }, -
4158 { Done, DqC, DqRef, -1, DqC }, -
4159 { SqC, Done, SqRef, -1, SqC }, -
4160 { SqC, Done, SqRef, -1, SqC }, -
4161 { SqC, Done, SqRef, -1, SqC } -
4162 }; -
4163 signed char state; -
4164 signed char input; -
4165 -
4166 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:28714
yes
Evaluation Count:1870
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:729
yes
Evaluation Count:1141
729-28714
4167 state = Init; -
4168 } else {
executed: }
Execution Count:29443
29443
4169 state = parseStack->pop().state; -
4170 -
4171 -
4172 -
4173 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:193
yes
Evaluation Count:948
193-948
4174 ParseFunction function = parseStack->top().function; -
4175 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
partially evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:193
0-193
4176 parseStack->pop(); -
4177 -
4178 -
4179 -
4180 }
never executed: }
0
4181 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:69
yes
Evaluation Count:124
69-124
4182 parseFailed(&QXmlSimpleReaderPrivate::parseAttValue, state); -
4183 return false;
executed: return false;
Execution Count:69
69
4184 } -
4185 }
executed: }
Execution Count:124
124
4186 }
executed: }
Execution Count:1072
1072
4187 -
4188 for (;;) { -
4189 switch (state) { -
4190 case Done: -
4191 return true;
executed: return true;
Execution Count:29426
29426
4192 case -1: -
4193 -
4194 reportParseError(QLatin1String("unexpected character")); -
4195 return false;
executed: return false;
Execution Count:6
6
4196 } -
4197 -
4198 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:948
yes
Evaluation Count:377449
948-377449
4199 unexpectedEof(&QXmlSimpleReaderPrivate::parseAttValue, state); -
4200 return false;
executed: return false;
Execution Count:948
948
4201 } -
4202 if (c == QLatin1Char('"')) {
evaluated: c == QLatin1Char('"')
TRUEFALSE
yes
Evaluation Count:55590
yes
Evaluation Count:321859
55590-321859
4203 input = InpDq; -
4204 } else if (c == QLatin1Char('\'')) {
evaluated: c == QLatin1Char('\'')
TRUEFALSE
yes
Evaluation Count:3578
yes
Evaluation Count:318281
executed: }
Execution Count:55590
3578-318281
4205 input = InpSq; -
4206 } else if (c == QLatin1Char('&')) {
evaluated: c == QLatin1Char('&')
TRUEFALSE
yes
Evaluation Count:392
yes
Evaluation Count:317889
executed: }
Execution Count:3578
392-317889
4207 input = InpAmp; -
4208 } else if (c == QLatin1Char('<')) {
evaluated: c == QLatin1Char('<')
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:317884
executed: }
Execution Count:392
5-317884
4209 input = InpLt; -
4210 } else {
executed: }
Execution Count:5
5
4211 input = InpUnknown; -
4212 }
executed: }
Execution Count:317884
317884
4213 state = table[state][input]; -
4214 -
4215 switch (state) { -
4216 case Dq: -
4217 case Sq: -
4218 stringClear(); -
4219 next(); -
4220 break;
executed: break;
Execution Count:29442
29442
4221 case DqRef: -
4222 case SqRef: -
4223 parseReference_context = InAttributeValue; -
4224 if (!parseReference()) {
evaluated: !parseReference()
TRUEFALSE
yes
Evaluation Count:135
yes
Evaluation Count:257
135-257
4225 parseFailed(&QXmlSimpleReaderPrivate::parseAttValue, state); -
4226 return false;
executed: return false;
Execution Count:135
135
4227 } -
4228 break;
executed: break;
Execution Count:257
257
4229 case DqC: -
4230 case SqC: -
4231 stringAddC(); -
4232 next(); -
4233 break;
executed: break;
Execution Count:318183
318183
4234 case Done: -
4235 next(); -
4236 break;
executed: break;
Execution Count:29426
29426
4237 } -
4238 }
executed: }
Execution Count:377314
377314
4239 return false;
never executed: return false;
0
4240} -
4241 -
4242 -
4243 -
4244 -
4245 -
4246 -
4247 -
4248bool QXmlSimpleReaderPrivate::parseElementDecl() -
4249{ -
4250 const signed char Init = 0; -
4251 const signed char Elem = 1; -
4252 const signed char Ws1 = 2; -
4253 const signed char Nam = 3; -
4254 const signed char Ws2 = 4; -
4255 const signed char Empty = 5; -
4256 const signed char Any = 6; -
4257 const signed char Cont = 7; -
4258 const signed char Mix = 8; -
4259 const signed char Mix2 = 9; -
4260 const signed char Mix3 = 10; -
4261 const signed char MixN1 = 11; -
4262 const signed char MixN2 = 12; -
4263 const signed char MixN3 = 13; -
4264 const signed char MixN4 = 14; -
4265 const signed char Cp = 15; -
4266 const signed char Cp2 = 16; -
4267 const signed char WsD = 17; -
4268 const signed char Done = 18; -
4269 -
4270 const signed char InpWs = 0; -
4271 const signed char InpGt = 1; -
4272 const signed char InpPipe = 2; -
4273 const signed char InpOp = 3; -
4274 const signed char InpCp = 4; -
4275 const signed char InpHash = 5; -
4276 const signed char InpQm = 6; -
4277 const signed char InpAst = 7; -
4278 const signed char InpPlus = 8; -
4279 const signed char InpA = 9; -
4280 const signed char InpE = 10; -
4281 const signed char InpL = 11; -
4282 const signed char InpUnknown = 12; -
4283 -
4284 static const signed char table[18][13] = { -
4285 -
4286 { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, Elem, -1 }, -
4287 { Ws1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -
4288 { -1, -1, -1, -1, -1, -1, -1, -1, -1, Nam, Nam, Nam, Nam }, -
4289 { Ws2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -
4290 { -1, -1, -1, Cont, -1, -1, -1, -1, -1, Any, Empty, -1, -1 }, -
4291 { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -
4292 { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -
4293 { -1, -1, -1, Cp, Cp, Mix, -1, -1, -1, Cp, Cp, Cp, Cp }, -
4294 { Mix2, -1, MixN1, -1, Mix3, -1, -1, -1, -1, -1, -1, -1, -1 }, -
4295 { -1, -1, MixN1, -1, Mix3, -1, -1, -1, -1, -1, -1, -1, -1 }, -
4296 { WsD, Done, -1, -1, -1, -1, -1, WsD, -1, -1, -1, -1, -1 }, -
4297 { -1, -1, -1, -1, -1, -1, -1, -1, -1, MixN2, MixN2, MixN2, MixN2 }, -
4298 { MixN3, -1, MixN1, -1, MixN4, -1, -1, -1, -1, -1, -1, -1, -1 }, -
4299 { -1, -1, MixN1, -1, MixN4, -1, -1, -1, -1, -1, -1, -1, -1 }, -
4300 { -1, -1, -1, -1, -1, -1, -1, WsD, -1, -1, -1, -1, -1 }, -
4301 { WsD, Done, -1, -1, -1, -1, Cp2, Cp2, Cp2, -1, -1, -1, -1 }, -
4302 { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, -
4303 { -1, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } -
4304 }; -
4305 signed char state; -
4306 signed char input; -
4307 -
4308 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:213
yes
Evaluation Count:9563
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:1364
yes
Evaluation Count:8199
213-9563
4309 state = Init; -
4310 } else {
executed: }
Execution Count:1577
1577
4311 state = parseStack->pop().state; -
4312 -
4313 -
4314 -
4315 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:6984
yes
Evaluation Count:1215
1215-6984
4316 ParseFunction function = parseStack->top().function; -
4317 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:1242
yes
Evaluation Count:5742
1242-5742
4318 parseStack->pop(); -
4319 -
4320 -
4321 -
4322 }
executed: }
Execution Count:1242
1242
4323 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:2455
yes
Evaluation Count:4529
2455-4529
4324 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4325 return false;
executed: return false;
Execution Count:2455
2455
4326 } -
4327 }
executed: }
Execution Count:4529
4529
4328 }
executed: }
Execution Count:5744
5744
4329 -
4330 for (;;) { -
4331 switch (state) { -
4332 case Done: -
4333 return true;
executed: return true;
Execution Count:1558
1558
4334 case -1: -
4335 reportParseError(QLatin1String("unexpected character")); -
4336 return false;
executed: return false;
Execution Count:12
12
4337 } -
4338 -
4339 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:1215
yes
Evaluation Count:12207
1215-12207
4340 unexpectedEof(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4341 return false;
executed: return false;
Execution Count:1215
1215
4342 } -
4343 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:3158
yes
Evaluation Count:9049
3158-9049
4344 input = InpWs; -
4345 } else if (c == QLatin1Char('>')) {
evaluated: c == QLatin1Char('>')
TRUEFALSE
yes
Evaluation Count:1558
yes
Evaluation Count:7491
executed: }
Execution Count:3158
1558-7491
4346 input = InpGt; -
4347 } else if (c == QLatin1Char('|')) {
evaluated: c == QLatin1Char('|')
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:7479
executed: }
Execution Count:1558
12-7479
4348 input = InpPipe; -
4349 } else if (c == QLatin1Char('(')) {
evaluated: c == QLatin1Char('(')
TRUEFALSE
yes
Evaluation Count:1446
yes
Evaluation Count:6033
executed: }
Execution Count:12
12-6033
4350 input = InpOp; -
4351 } else if (c == QLatin1Char(')')) {
evaluated: c == QLatin1Char(')')
TRUEFALSE
yes
Evaluation Count:1247
yes
Evaluation Count:4786
executed: }
Execution Count:1446
1247-4786
4352 input = InpCp; -
4353 } else if (c == QLatin1Char('#')) {
evaluated: c == QLatin1Char('#')
TRUEFALSE
yes
Evaluation Count:1247
yes
Evaluation Count:3539
executed: }
Execution Count:1247
1247-3539
4354 input = InpHash; -
4355 } else if (c == QLatin1Char('?')) {
evaluated: c == QLatin1Char('?')
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:3536
executed: }
Execution Count:1247
3-3536
4356 input = InpQm; -
4357 } else if (c == QLatin1Char('*')) {
evaluated: c == QLatin1Char('*')
TRUEFALSE
yes
Evaluation Count:32
yes
Evaluation Count:3504
executed: }
Execution Count:3
3-3504
4358 input = InpAst; -
4359 } else if (c == QLatin1Char('+')) {
evaluated: c == QLatin1Char('+')
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:3492
executed: }
Execution Count:32
12-3492
4360 input = InpPlus; -
4361 } else if (c == QLatin1Char('A')) {
evaluated: c == QLatin1Char('A')
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:3462
executed: }
Execution Count:12
12-3462
4362 input = InpA; -
4363 } else if (c == QLatin1Char('E')) {
evaluated: c == QLatin1Char('E')
TRUEFALSE
yes
Evaluation Count:101
yes
Evaluation Count:3361
executed: }
Execution Count:30
30-3361
4364 input = InpE; -
4365 } else if (c == QLatin1Char('L')) {
evaluated: c == QLatin1Char('L')
TRUEFALSE
yes
Evaluation Count:1577
yes
Evaluation Count:1784
executed: }
Execution Count:101
101-1784
4366 input = InpL; -
4367 } else {
executed: }
Execution Count:1577
1577
4368 input = InpUnknown; -
4369 }
executed: }
Execution Count:1784
1784
4370 state = table[state][input]; -
4371 -
4372 switch (state) { -
4373 case Elem: -
4374 parseString_s = QLatin1String("LEMENT"); -
4375 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:1199
yes
Evaluation Count:378
378-1199
4376 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4377 return false;
executed: return false;
Execution Count:1199
1199
4378 } -
4379 break;
executed: break;
Execution Count:378
378
4380 case Ws1: -
4381 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:465
yes
Evaluation Count:1112
465-1112
4382 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4383 return false;
executed: return false;
Execution Count:465
465
4384 } -
4385 break;
executed: break;
Execution Count:1112
1112
4386 case Nam: -
4387 parseName_useRef = false; -
4388 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:961
yes
Evaluation Count:616
616-961
4389 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4390 return false;
executed: return false;
Execution Count:961
961
4391 } -
4392 break;
executed: break;
Execution Count:616
616
4393 case Ws2: -
4394 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:254
yes
Evaluation Count:1322
254-1322
4395 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4396 return false;
executed: return false;
Execution Count:254
254
4397 } -
4398 break;
executed: break;
Execution Count:1322
1322
4399 case Empty: -
4400 parseString_s = QLatin1String("EMPTY"); -
4401 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:65
yes
Evaluation Count:36
36-65
4402 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4403 return false;
executed: return false;
Execution Count:65
65
4404 } -
4405 break;
executed: break;
Execution Count:36
36
4406 case Any: -
4407 parseString_s = QLatin1String("ANY"); -
4408 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:14
14-16
4409 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4410 return false;
executed: return false;
Execution Count:16
16
4411 } -
4412 break;
executed: break;
Execution Count:14
14
4413 case Cont: -
4414 if (!next_eat_ws()) {
evaluated: !next_eat_ws()
TRUEFALSE
yes
Evaluation Count:513
yes
Evaluation Count:929
513-929
4415 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4416 return false;
executed: return false;
Execution Count:513
513
4417 } -
4418 break;
executed: break;
Execution Count:929
929
4419 case Mix: -
4420 parseString_s = QLatin1String("#PCDATA"); -
4421 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:964
yes
Evaluation Count:283
283-964
4422 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4423 return false;
executed: return false;
Execution Count:964
964
4424 } -
4425 break;
executed: break;
Execution Count:283
283
4426 case Mix2: -
4427 if (!eat_ws()) {
partially evaluated: !eat_ws()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
4428 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4429 return false;
never executed: return false;
0
4430 } -
4431 break;
executed: break;
Execution Count:2
2
4432 case Mix3: -
4433 next(); -
4434 break;
executed: break;
Execution Count:1235
1235
4435 case MixN1: -
4436 if (!next_eat_ws()) {
evaluated: !next_eat_ws()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:7
5-7
4437 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4438 return false;
executed: return false;
Execution Count:5
5
4439 } -
4440 break;
executed: break;
Execution Count:7
7
4441 case MixN2: -
4442 parseName_useRef = false; -
4443 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:10
1-10
4444 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4445 return false;
executed: return false;
Execution Count:1
1
4446 } -
4447 break;
executed: break;
Execution Count:10
10
4448 case MixN3: -
4449 if (!eat_ws()) {
never evaluated: !eat_ws()
0
4450 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4451 return false;
never executed: return false;
0
4452 } -
4453 break;
never executed: break;
0
4454 case MixN4: -
4455 next(); -
4456 break;
executed: break;
Execution Count:10
10
4457 case Cp: -
4458 if (!parseChoiceSeq()) {
evaluated: !parseChoiceSeq()
TRUEFALSE
yes
Evaluation Count:92
yes
Evaluation Count:103
92-103
4459 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4460 return false;
executed: return false;
Execution Count:92
92
4461 } -
4462 break;
executed: break;
Execution Count:103
103
4463 case Cp2: -
4464 next(); -
4465 break;
executed: break;
Execution Count:32
32
4466 case WsD: -
4467 if (!next_eat_ws()) {
evaluated: !next_eat_ws()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:12
1-12
4468 parseFailed(&QXmlSimpleReaderPrivate::parseElementDecl, state); -
4469 return false;
executed: return false;
Execution Count:1
1
4470 } -
4471 break;
executed: break;
Execution Count:12
12
4472 case Done: -
4473 next(); -
4474 break;
executed: break;
Execution Count:1558
1558
4475 } -
4476 }
executed: }
Execution Count:7671
7671
4477 return false;
never executed: return false;
0
4478} -
4479 -
4480 -
4481 -
4482 -
4483 -
4484 -
4485 -
4486bool QXmlSimpleReaderPrivate::parseNotationDecl() -
4487{ -
4488 const signed char Init = 0; -
4489 const signed char Not = 1; -
4490 const signed char Ws1 = 2; -
4491 const signed char Nam = 3; -
4492 const signed char Ws2 = 4; -
4493 const signed char ExtID = 5; -
4494 const signed char ExtIDR = 6; -
4495 const signed char Ws3 = 7; -
4496 const signed char Done = 8; -
4497 -
4498 const signed char InpWs = 0; -
4499 const signed char InpGt = 1; -
4500 const signed char InpN = 2; -
4501 const signed char InpUnknown = 3; -
4502 -
4503 static const signed char table[8][4] = { -
4504 -
4505 { -1, -1, Not, -1 }, -
4506 { Ws1, -1, -1, -1 }, -
4507 { -1, -1, Nam, Nam }, -
4508 { Ws2, Done, -1, -1 }, -
4509 { -1, Done, ExtID, ExtID }, -
4510 { Ws3, Done, -1, -1 }, -
4511 { Ws3, Done, -1, -1 }, -
4512 { -1, Done, -1, -1 } -
4513 }; -
4514 signed char state; -
4515 signed char input; -
4516 -
4517 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:11
yes
Evaluation Count:536
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:45
yes
Evaluation Count:491
11-536
4518 state = Init; -
4519 } else {
executed: }
Execution Count:56
56
4520 state = parseStack->pop().state; -
4521 -
4522 -
4523 -
4524 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:472
yes
Evaluation Count:19
19-472
4525 ParseFunction function = parseStack->top().function; -
4526 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:30
yes
Evaluation Count:442
30-442
4527 parseStack->pop(); -
4528 -
4529 -
4530 -
4531 }
executed: }
Execution Count:30
30
4532 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:333
yes
Evaluation Count:139
139-333
4533 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); -
4534 return false;
executed: return false;
Execution Count:333
333
4535 } -
4536 }
executed: }
Execution Count:139
139
4537 }
executed: }
Execution Count:158
158
4538 -
4539 for (;;) { -
4540 switch (state) { -
4541 case ExtID: -
4542 -
4543 if (dtdHnd) {
partially evaluated: dtdHnd
TRUEFALSE
yes
Evaluation Count:56
no
Evaluation Count:0
0-56
4544 if (!dtdHnd->notationDecl(name(), publicId, systemId)) {
partially evaluated: !dtdHnd->notationDecl(name(), publicId, systemId)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:56
0-56
4545 reportParseError(dtdHnd->errorString()); -
4546 return false;
never executed: return false;
0
4547 } -
4548 }
executed: }
Execution Count:56
56
4549 state = ExtIDR; -
4550 break;
executed: break;
Execution Count:56
56
4551 case Done: -
4552 return true;
executed: return true;
Execution Count:56
56
4553 case -1: -
4554 -
4555 reportParseError(QLatin1String("unexpected character")); -
4556 return false;
never executed: return false;
0
4557 } -
4558 -
4559 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:19
yes
Evaluation Count:336
19-336
4560 unexpectedEof(&QXmlSimpleReaderPrivate::parseNotationDecl, state); -
4561 return false;
executed: return false;
Execution Count:19
19
4562 } -
4563 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:112
yes
Evaluation Count:224
112-224
4564 input = InpWs; -
4565 } else if (c == QLatin1Char('>')) {
evaluated: c == QLatin1Char('>')
TRUEFALSE
yes
Evaluation Count:56
yes
Evaluation Count:168
executed: }
Execution Count:112
56-168
4566 input = InpGt; -
4567 } else if (c == QLatin1Char('N')) {
evaluated: c == QLatin1Char('N')
TRUEFALSE
yes
Evaluation Count:56
yes
Evaluation Count:112
executed: }
Execution Count:56
56-112
4568 input = InpN; -
4569 } else {
executed: }
Execution Count:56
56
4570 input = InpUnknown; -
4571 }
executed: }
Execution Count:112
112
4572 state = table[state][input]; -
4573 -
4574 switch (state) { -
4575 case Not: -
4576 parseString_s = QLatin1String("NOTATION"); -
4577 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:43
yes
Evaluation Count:13
13-43
4578 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); -
4579 return false;
executed: return false;
Execution Count:43
43
4580 } -
4581 break;
executed: break;
Execution Count:13
13
4582 case Ws1: -
4583 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:16
yes
Evaluation Count:40
16-40
4584 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); -
4585 return false;
executed: return false;
Execution Count:16
16
4586 } -
4587 break;
executed: break;
Execution Count:40
40
4588 case Nam: -
4589 parseName_useRef = false; -
4590 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:21
yes
Evaluation Count:35
21-35
4591 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); -
4592 return false;
executed: return false;
Execution Count:21
21
4593 } -
4594 break;
executed: break;
Execution Count:35
35
4595 case Ws2: -
4596 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:42
14-42
4597 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); -
4598 return false;
executed: return false;
Execution Count:14
14
4599 } -
4600 break;
executed: break;
Execution Count:42
42
4601 case ExtID: -
4602 case ExtIDR: -
4603 parseExternalID_allowPublicID = true; -
4604 if (!parseExternalID()) {
evaluated: !parseExternalID()
TRUEFALSE
yes
Evaluation Count:45
yes
Evaluation Count:11
11-45
4605 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); -
4606 return false;
executed: return false;
Execution Count:45
45
4607 } -
4608 break;
executed: break;
Execution Count:11
11
4609 case Ws3: -
4610 if (!eat_ws()) {
never evaluated: !eat_ws()
0
4611 parseFailed(&QXmlSimpleReaderPrivate::parseNotationDecl, state); -
4612 return false;
never executed: return false;
0
4613 } -
4614 break;
never executed: break;
0
4615 case Done: -
4616 next(); -
4617 break;
executed: break;
Execution Count:56
56
4618 } -
4619 }
executed: }
Execution Count:197
197
4620 return false;
never executed: return false;
0
4621} -
4622 -
4623 -
4624 -
4625 -
4626 -
4627 -
4628 -
4629bool QXmlSimpleReaderPrivate::parseChoiceSeq() -
4630{ -
4631 const signed char Init = 0; -
4632 const signed char Ws1 = 1; -
4633 const signed char CoS = 2; -
4634 const signed char Ws2 = 3; -
4635 const signed char More = 4; -
4636 const signed char Name = 5; -
4637 const signed char Done = 6; -
4638 -
4639 const signed char InpWs = 0; -
4640 const signed char InpOp = 1; -
4641 const signed char InpCp = 2; -
4642 const signed char InpQm = 3; -
4643 const signed char InpAst = 4; -
4644 const signed char InpPlus = 5; -
4645 const signed char InpPipe = 6; -
4646 const signed char InpComm = 7; -
4647 const signed char InpUnknown = 8; -
4648 -
4649 static const signed char table[6][9] = { -
4650 -
4651 { -1, Ws1, -1, -1, -1, -1, -1, -1, Name }, -
4652 { -1, CoS, -1, -1, -1, -1, -1, -1, CoS }, -
4653 { Ws2, -1, Done, Ws2, Ws2, Ws2, More, More, -1 }, -
4654 { -1, -1, Done, -1, -1, -1, More, More, -1 }, -
4655 { -1, Ws1, -1, -1, -1, -1, -1, -1, Name }, -
4656 { Ws2, -1, Done, Ws2, Ws2, Ws2, More, More, -1 } -
4657 }; -
4658 signed char state; -
4659 signed char input; -
4660 -
4661 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:39
yes
Evaluation Count:294
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:162
yes
Evaluation Count:132
39-294
4662 state = Init; -
4663 } else {
executed: }
Execution Count:201
201
4664 state = parseStack->pop().state; -
4665 -
4666 -
4667 -
4668 if (!parseStack->isEmpty()) {
partially evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:132
no
Evaluation Count:0
0-132
4669 ParseFunction function = parseStack->top().function; -
4670 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:59
yes
Evaluation Count:73
59-73
4671 parseStack->pop(); -
4672 -
4673 -
4674 -
4675 }
executed: }
Execution Count:59
59
4676 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:118
14-118
4677 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); -
4678 return false;
executed: return false;
Execution Count:14
14
4679 } -
4680 }
executed: }
Execution Count:118
118
4681 }
executed: }
Execution Count:118
118
4682 -
4683 for (;;) { -
4684 switch (state) { -
4685 case Done: -
4686 return true;
executed: return true;
Execution Count:193
193
4687 case -1: -
4688 -
4689 reportParseError(QLatin1String("unexpected character")); -
4690 return false;
executed: return false;
Execution Count:4
4
4691 } -
4692 -
4693 if (atEnd()) {
partially evaluated: atEnd()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:621
0-621
4694 unexpectedEof(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); -
4695 return false;
never executed: return false;
0
4696 } -
4697 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:597
24-597
4698 input = InpWs; -
4699 } else if (c == QLatin1Char('(')) {
evaluated: c == QLatin1Char('(')
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:591
executed: }
Execution Count:24
6-591
4700 input = InpOp; -
4701 } else if (c == QLatin1Char(')')) {
evaluated: c == QLatin1Char(')')
TRUEFALSE
yes
Evaluation Count:194
yes
Evaluation Count:397
executed: }
Execution Count:6
6-397
4702 input = InpCp; -
4703 } else if (c == QLatin1Char('?')) {
evaluated: c == QLatin1Char('?')
TRUEFALSE
yes
Evaluation Count:14
yes
Evaluation Count:383
executed: }
Execution Count:194
14-383
4704 input = InpQm; -
4705 } else if (c == QLatin1Char('*')) {
evaluated: c == QLatin1Char('*')
TRUEFALSE
yes
Evaluation Count:82
yes
Evaluation Count:301
executed: }
Execution Count:14
14-301
4706 input = InpAst; -
4707 } else if (c == QLatin1Char('+')) {
evaluated: c == QLatin1Char('+')
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:299
executed: }
Execution Count:82
2-299
4708 input = InpPlus; -
4709 } else if (c == QLatin1Char('|')) {
evaluated: c == QLatin1Char('|')
TRUEFALSE
yes
Evaluation Count:23
yes
Evaluation Count:276
executed: }
Execution Count:2
2-276
4710 input = InpPipe; -
4711 } else if (c == QLatin1Char(',')) {
evaluated: c == QLatin1Char(',')
TRUEFALSE
yes
Evaluation Count:26
yes
Evaluation Count:250
executed: }
Execution Count:23
23-250
4712 input = InpComm; -
4713 } else {
executed: }
Execution Count:26
26
4714 input = InpUnknown; -
4715 }
executed: }
Execution Count:250
250
4716 state = table[state][input]; -
4717 -
4718 switch (state) { -
4719 case Ws1: -
4720 if (!next_eat_ws()) {
partially evaluated: !next_eat_ws()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:6
0-6
4721 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); -
4722 return false;
never executed: return false;
0
4723 } -
4724 break;
executed: break;
Execution Count:6
6
4725 case CoS: -
4726 if (!parseChoiceSeq()) {
evaluated: !parseChoiceSeq()
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:5
1-5
4727 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); -
4728 return false;
executed: return false;
Execution Count:1
1
4729 } -
4730 break;
executed: break;
Execution Count:5
5
4731 case Ws2: -
4732 if (!next_eat_ws()) {
evaluated: !next_eat_ws()
TRUEFALSE
yes
Evaluation Count:38
yes
Evaluation Count:82
38-82
4733 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); -
4734 return false;
executed: return false;
Execution Count:38
38
4735 } -
4736 break;
executed: break;
Execution Count:82
82
4737 case More: -
4738 if (!next_eat_ws()) {
evaluated: !next_eat_ws()
TRUEFALSE
yes
Evaluation Count:17
yes
Evaluation Count:32
17-32
4739 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); -
4740 return false;
executed: return false;
Execution Count:17
17
4741 } -
4742 break;
executed: break;
Execution Count:32
32
4743 case Name: -
4744 parseName_useRef = false; -
4745 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:66
yes
Evaluation Count:177
66-177
4746 parseFailed(&QXmlSimpleReaderPrivate::parseChoiceSeq, state); -
4747 return false;
executed: return false;
Execution Count:66
66
4748 } -
4749 break;
executed: break;
Execution Count:177
177
4750 case Done: -
4751 next(); -
4752 break;
executed: break;
Execution Count:193
193
4753 } -
4754 }
executed: }
Execution Count:499
499
4755 return false;
never executed: return false;
0
4756} -
4757 -
4758 -
4759 -
4760 -
4761 -
4762 -
4763 -
4764bool QXmlSimpleReaderPrivate::parseEntityDecl() -
4765{ -
4766 const signed char Init = 0; -
4767 const signed char Ent = 1; -
4768 const signed char Ws1 = 2; -
4769 const signed char Name = 3; -
4770 const signed char Ws2 = 4; -
4771 const signed char EValue = 5; -
4772 const signed char EValueR = 6; -
4773 const signed char ExtID = 7; -
4774 const signed char Ws3 = 8; -
4775 const signed char Ndata = 9; -
4776 const signed char Ws4 = 10; -
4777 const signed char NNam = 11; -
4778 const signed char NNamR = 12; -
4779 const signed char PEDec = 13; -
4780 const signed char Ws6 = 14; -
4781 const signed char PENam = 15; -
4782 const signed char Ws7 = 16; -
4783 const signed char PEVal = 17; -
4784 const signed char PEValR = 18; -
4785 const signed char PEEID = 19; -
4786 const signed char PEEIDR = 20; -
4787 const signed char WsE = 21; -
4788 const signed char Done = 22; -
4789 const signed char EDDone = 23; -
4790 -
4791 const signed char InpWs = 0; -
4792 const signed char InpPer = 1; -
4793 const signed char InpQuot = 2; -
4794 const signed char InpGt = 3; -
4795 const signed char InpN = 4; -
4796 const signed char InpUnknown = 5; -
4797 -
4798 static const signed char table[22][6] = { -
4799 -
4800 { -1, -1, -1, -1, Ent, -1 }, -
4801 { Ws1, -1, -1, -1, -1, -1 }, -
4802 { -1, PEDec, -1, -1, Name, Name }, -
4803 { Ws2, -1, -1, -1, -1, -1 }, -
4804 { -1, -1, EValue, -1, -1, ExtID }, -
4805 { WsE, -1, -1, Done, -1, -1 }, -
4806 { WsE, -1, -1, Done, -1, -1 }, -
4807 { Ws3, -1, -1, EDDone,-1, -1 }, -
4808 { -1, -1, -1, EDDone,Ndata, -1 }, -
4809 { Ws4, -1, -1, -1, -1, -1 }, -
4810 { -1, -1, -1, -1, NNam, NNam }, -
4811 { WsE, -1, -1, Done, -1, -1 }, -
4812 { WsE, -1, -1, Done, -1, -1 }, -
4813 { Ws6, -1, -1, -1, -1, -1 }, -
4814 { -1, -1, -1, -1, PENam, PENam }, -
4815 { Ws7, -1, -1, -1, -1, -1 }, -
4816 { -1, -1, PEVal, -1, -1, PEEID }, -
4817 { WsE, -1, -1, Done, -1, -1 }, -
4818 { WsE, -1, -1, Done, -1, -1 }, -
4819 { WsE, -1, -1, Done, -1, -1 }, -
4820 { WsE, -1, -1, Done, -1, -1 }, -
4821 { -1, -1, -1, Done, -1, -1 } -
4822 }; -
4823 signed char state; -
4824 signed char input; -
4825 -
4826 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:371
yes
Evaluation Count:3893
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:522
yes
Evaluation Count:3371
371-3893
4827 state = Init; -
4828 } else {
executed: }
Execution Count:893
893
4829 state = parseStack->pop().state; -
4830 -
4831 -
4832 -
4833 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:3026
yes
Evaluation Count:345
345-3026
4834 ParseFunction function = parseStack->top().function; -
4835 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:431
yes
Evaluation Count:2595
431-2595
4836 parseStack->pop(); -
4837 -
4838 -
4839 -
4840 }
executed: }
Execution Count:431
431
4841 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:1549
yes
Evaluation Count:1477
1477-1549
4842 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4843 return false;
executed: return false;
Execution Count:1549
1549
4844 } -
4845 }
executed: }
Execution Count:1477
1477
4846 }
executed: }
Execution Count:1822
1822
4847 -
4848 for (;;) { -
4849 switch (state) { -
4850 case EValue: -
4851 if ( !entityExist(name())) {
evaluated: !entityExist(name())
TRUEFALSE
yes
Evaluation Count:530
yes
Evaluation Count:36
36-530
4852 entities.insert(name(), string()); -
4853 if (declHnd) {
partially evaluated: declHnd
TRUEFALSE
yes
Evaluation Count:530
no
Evaluation Count:0
0-530
4854 if (!declHnd->internalEntityDecl(name(), string())) {
partially evaluated: !declHnd->internalEntityDecl(name(), string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:530
0-530
4855 reportParseError(declHnd->errorString()); -
4856 return false;
never executed: return false;
0
4857 } -
4858 }
executed: }
Execution Count:530
530
4859 }
executed: }
Execution Count:530
530
4860 state = EValueR; -
4861 break;
executed: break;
Execution Count:566
566
4862 case NNam: -
4863 if ( !entityExist(name())) {
partially evaluated: !entityExist(name())
TRUEFALSE
yes
Evaluation Count:13
no
Evaluation Count:0
0-13
4864 externEntities.insert(name(), QXmlSimpleReaderPrivate::ExternEntity(publicId, systemId, ref())); -
4865 if (dtdHnd) {
partially evaluated: dtdHnd
TRUEFALSE
yes
Evaluation Count:13
no
Evaluation Count:0
0-13
4866 if (!dtdHnd->unparsedEntityDecl(name(), publicId, systemId, ref())) {
partially evaluated: !dtdHnd->unparsedEntityDecl(name(), publicId, systemId, ref())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:13
0-13
4867 reportParseError(declHnd->errorString()); -
4868 return false;
never executed: return false;
0
4869 } -
4870 }
executed: }
Execution Count:13
13
4871 }
executed: }
Execution Count:13
13
4872 state = NNamR; -
4873 break;
executed: break;
Execution Count:13
13
4874 case PEVal: -
4875 if ( !entityExist(name())) {
partially evaluated: !entityExist(name())
TRUEFALSE
yes
Evaluation Count:67
no
Evaluation Count:0
0-67
4876 parameterEntities.insert(name(), string()); -
4877 if (declHnd) {
partially evaluated: declHnd
TRUEFALSE
yes
Evaluation Count:67
no
Evaluation Count:0
0-67
4878 if (!declHnd->internalEntityDecl(QLatin1Char('%') + name(), string())) {
partially evaluated: !declHnd->internalEntityDecl(QLatin1Char('%') + name(), string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:67
0-67
4879 reportParseError(declHnd->errorString()); -
4880 return false;
never executed: return false;
0
4881 } -
4882 }
executed: }
Execution Count:67
67
4883 }
executed: }
Execution Count:67
67
4884 state = PEValR; -
4885 break;
executed: break;
Execution Count:67
67
4886 case PEEID: -
4887 if ( !entityExist(name())) {
partially evaluated: !entityExist(name())
TRUEFALSE
yes
Evaluation Count:62
no
Evaluation Count:0
0-62
4888 externParameterEntities.insert(name(), QXmlSimpleReaderPrivate::ExternParameterEntity(publicId, systemId)); -
4889 if (declHnd) {
partially evaluated: declHnd
TRUEFALSE
yes
Evaluation Count:62
no
Evaluation Count:0
0-62
4890 if (!declHnd->externalEntityDecl(QLatin1Char('%') + name(), publicId, systemId)) {
partially evaluated: !declHnd->externalEntityDecl(QLatin1Char('%') + name(), publicId, systemId)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:62
0-62
4891 reportParseError(declHnd->errorString()); -
4892 return false;
never executed: return false;
0
4893 } -
4894 }
executed: }
Execution Count:62
62
4895 }
executed: }
Execution Count:62
62
4896 state = PEEIDR; -
4897 break;
executed: break;
Execution Count:62
62
4898 case EDDone: -
4899 if ( !entityExist(name())) {
partially evaluated: !entityExist(name())
TRUEFALSE
yes
Evaluation Count:175
no
Evaluation Count:0
0-175
4900 externEntities.insert(name(), QXmlSimpleReaderPrivate::ExternEntity(publicId, systemId, QString())); -
4901 if (declHnd) {
evaluated: declHnd
TRUEFALSE
yes
Evaluation Count:156
yes
Evaluation Count:19
19-156
4902 if (!declHnd->externalEntityDecl(name(), publicId, systemId)) {
partially evaluated: !declHnd->externalEntityDecl(name(), publicId, systemId)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:156
0-156
4903 reportParseError(declHnd->errorString()); -
4904 return false;
never executed: return false;
0
4905 } -
4906 }
executed: }
Execution Count:156
156
4907 }
executed: }
Execution Count:175
175
4908 return true;
executed: return true;
Execution Count:175
175
4909 case Done: -
4910 return true;
executed: return true;
Execution Count:705
705
4911 case -1: -
4912 -
4913 reportParseError(QLatin1String("letter is expected")); -
4914 return false;
executed: return false;
Execution Count:6
6
4915 } -
4916 -
4917 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:345
yes
Evaluation Count:5658
345-5658
4918 unexpectedEof(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4919 return false;
executed: return false;
Execution Count:345
345
4920 } -
4921 if (is_S(c)) {
evaluated: is_S(c)
TRUEFALSE
yes
Evaluation Count:1941
yes
Evaluation Count:3717
1941-3717
4922 input = InpWs; -
4923 } else if (c == QLatin1Char('%')) {
evaluated: c == QLatin1Char('%')
TRUEFALSE
yes
Evaluation Count:131
yes
Evaluation Count:3586
executed: }
Execution Count:1941
131-3586
4924 input = InpPer; -
4925 } else if (c == QLatin1Char('"') || c == QLatin1Char('\'')) {
evaluated: c == QLatin1Char('"')
TRUEFALSE
yes
Evaluation Count:611
yes
Evaluation Count:2975
evaluated: c == QLatin1Char('\'')
TRUEFALSE
yes
Evaluation Count:27
yes
Evaluation Count:2948
executed: }
Execution Count:131
27-2975
4926 input = InpQuot; -
4927 } else if (c == QLatin1Char('>')) {
evaluated: c == QLatin1Char('>')
TRUEFALSE
yes
Evaluation Count:880
yes
Evaluation Count:2068
executed: }
Execution Count:638
638-2068
4928 input = InpGt; -
4929 } else if (c == QLatin1Char('N')) {
evaluated: c == QLatin1Char('N')
TRUEFALSE
yes
Evaluation Count:909
yes
Evaluation Count:1159
executed: }
Execution Count:880
880-1159
4930 input = InpN; -
4931 } else {
executed: }
Execution Count:909
909
4932 input = InpUnknown; -
4933 }
executed: }
Execution Count:1159
1159
4934 state = table[state][input]; -
4935 -
4936 switch (state) { -
4937 case Ent: -
4938 parseString_s = QLatin1String("NTITY"); -
4939 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:427
yes
Evaluation Count:466
427-466
4940 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4941 return false;
executed: return false;
Execution Count:427
427
4942 } -
4943 break;
executed: break;
Execution Count:466
466
4944 case Ws1: -
4945 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:162
yes
Evaluation Count:730
162-730
4946 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4947 return false;
executed: return false;
Execution Count:162
162
4948 } -
4949 break;
executed: break;
Execution Count:730
730
4950 case Name: -
4951 parseName_useRef = false; -
4952 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:145
yes
Evaluation Count:617
145-617
4953 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4954 return false;
executed: return false;
Execution Count:145
145
4955 } -
4956 break;
executed: break;
Execution Count:617
617
4957 case Ws2: -
4958 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:164
yes
Evaluation Count:596
164-596
4959 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4960 return false;
executed: return false;
Execution Count:164
164
4961 } -
4962 break;
executed: break;
Execution Count:596
596
4963 case EValue: -
4964 case EValueR: -
4965 if (!parseEntityValue()) {
evaluated: !parseEntityValue()
TRUEFALSE
yes
Evaluation Count:207
yes
Evaluation Count:362
207-362
4966 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4967 return false;
executed: return false;
Execution Count:207
207
4968 } -
4969 break;
executed: break;
Execution Count:362
362
4970 case ExtID: -
4971 parseExternalID_allowPublicID = false; -
4972 if (!parseExternalID()) {
evaluated: !parseExternalID()
TRUEFALSE
yes
Evaluation Count:146
yes
Evaluation Count:45
45-146
4973 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4974 return false;
executed: return false;
Execution Count:146
146
4975 } -
4976 break;
executed: break;
Execution Count:45
45
4977 case Ws3: -
4978 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:10
3-10
4979 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4980 return false;
executed: return false;
Execution Count:3
3
4981 } -
4982 break;
executed: break;
Execution Count:10
10
4983 case Ndata: -
4984 parseString_s = QLatin1String("NDATA"); -
4985 if (!parseString()) {
evaluated: !parseString()
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:7
6-7
4986 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4987 return false;
executed: return false;
Execution Count:6
6
4988 } -
4989 break;
executed: break;
Execution Count:7
7
4990 case Ws4: -
4991 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:9
4-9
4992 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
4993 return false;
executed: return false;
Execution Count:4
4
4994 } -
4995 break;
executed: break;
Execution Count:9
9
4996 case NNam: -
4997 case NNamR: -
4998 parseName_useRef = true; -
4999 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:11
2-11
5000 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
5001 return false;
executed: return false;
Execution Count:2
2
5002 } -
5003 break;
executed: break;
Execution Count:11
11
5004 case PEDec: -
5005 next(); -
5006 break;
executed: break;
Execution Count:130
130
5007 case Ws6: -
5008 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:52
yes
Evaluation Count:78
52-78
5009 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
5010 return false;
executed: return false;
Execution Count:52
52
5011 } -
5012 break;
executed: break;
Execution Count:78
78
5013 case PENam: -
5014 parseName_useRef = false; -
5015 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:112
18-112
5016 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
5017 return false;
executed: return false;
Execution Count:18
18
5018 } -
5019 break;
executed: break;
Execution Count:112
112
5020 case Ws7: -
5021 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:46
yes
Evaluation Count:84
46-84
5022 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
5023 return false;
executed: return false;
Execution Count:46
46
5024 } -
5025 break;
executed: break;
Execution Count:84
84
5026 case PEVal: -
5027 case PEValR: -
5028 if (!parseEntityValue()) {
evaluated: !parseEntityValue()
TRUEFALSE
yes
Evaluation Count:48
yes
Evaluation Count:20
20-48
5029 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
5030 return false;
executed: return false;
Execution Count:48
48
5031 } -
5032 break;
executed: break;
Execution Count:20
20
5033 case PEEID: -
5034 case PEEIDR: -
5035 parseExternalID_allowPublicID = false; -
5036 if (!parseExternalID()) {
evaluated: !parseExternalID()
TRUEFALSE
yes
Evaluation Count:54
yes
Evaluation Count:8
8-54
5037 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
5038 return false;
executed: return false;
Execution Count:54
54
5039 } -
5040 break;
executed: break;
Execution Count:8
8
5041 case WsE: -
5042 if (!eat_ws()) {
partially evaluated: !eat_ws()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:3
0-3
5043 parseFailed(&QXmlSimpleReaderPrivate::parseEntityDecl, state); -
5044 return false;
never executed: return false;
0
5045 } -
5046 break;
executed: break;
Execution Count:3
3
5047 case EDDone: -
5048 next(); -
5049 break;
executed: break;
Execution Count:175
175
5050 case Done: -
5051 next(); -
5052 break;
executed: break;
Execution Count:705
705
5053 } -
5054 }
executed: }
Execution Count:4174
4174
5055 return false;
never executed: return false;
0
5056} -
5057 -
5058 -
5059 -
5060 -
5061bool QXmlSimpleReaderPrivate::parseEntityValue() -
5062{ -
5063 const signed char Init = 0; -
5064 const signed char Dq = 1; -
5065 const signed char DqC = 2; -
5066 const signed char DqPER = 3; -
5067 const signed char DqRef = 4; -
5068 const signed char Sq = 5; -
5069 const signed char SqC = 6; -
5070 const signed char SqPER = 7; -
5071 const signed char SqRef = 8; -
5072 const signed char Done = 9; -
5073 -
5074 const signed char InpDq = 0; -
5075 const signed char InpSq = 1; -
5076 const signed char InpAmp = 2; -
5077 const signed char InpPer = 3; -
5078 const signed char InpUnknown = 4; -
5079 -
5080 static const signed char table[9][5] = { -
5081 -
5082 { Dq, Sq, -1, -1, -1 }, -
5083 { Done, DqC, DqRef, DqPER, DqC }, -
5084 { Done, DqC, DqRef, DqPER, DqC }, -
5085 { Done, DqC, DqRef, DqPER, DqC }, -
5086 { Done, DqC, DqRef, DqPER, DqC }, -
5087 { SqC, Done, SqRef, SqPER, SqC }, -
5088 { SqC, Done, SqRef, SqPER, SqC }, -
5089 { SqC, Done, SqRef, SqPER, SqC }, -
5090 { SqC, Done, SqRef, SqPER, SqC } -
5091 }; -
5092 signed char state; -
5093 signed char input; -
5094 -
5095 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:313
yes
Evaluation Count:957
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:324
yes
Evaluation Count:633
313-957
5096 state = Init; -
5097 } else {
executed: }
Execution Count:637
637
5098 state = parseStack->pop().state; -
5099 -
5100 -
5101 -
5102 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:172
yes
Evaluation Count:461
172-461
5103 ParseFunction function = parseStack->top().function; -
5104 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
partially evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:172
0-172
5105 parseStack->pop(); -
5106 -
5107 -
5108 -
5109 }
never executed: }
0
5110 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:60
yes
Evaluation Count:112
60-112
5111 parseFailed(&QXmlSimpleReaderPrivate::parseEntityValue, state); -
5112 return false;
executed: return false;
Execution Count:60
60
5113 } -
5114 }
executed: }
Execution Count:112
112
5115 }
executed: }
Execution Count:573
573
5116 -
5117 for (;;) { -
5118 switch (state) { -
5119 case Done: -
5120 return true;
executed: return true;
Execution Count:633
633
5121 case -1: -
5122 -
5123 reportParseError(QLatin1String("letter is expected")); -
5124 return false;
never executed: return false;
0
5125 } -
5126 -
5127 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:462
yes
Evaluation Count:4201
462-4201
5128 unexpectedEof(&QXmlSimpleReaderPrivate::parseEntityValue, state); -
5129 return false;
executed: return false;
Execution Count:462
462
5130 } -
5131 if (c == QLatin1Char('"')) {
evaluated: c == QLatin1Char('"')
TRUEFALSE
yes
Evaluation Count:1217
yes
Evaluation Count:2984
1217-2984
5132 input = InpDq; -
5133 } else if (c == QLatin1Char('\'')) {
evaluated: c == QLatin1Char('\'')
TRUEFALSE
yes
Evaluation Count:70
yes
Evaluation Count:2914
executed: }
Execution Count:1217
70-2914
5134 input = InpSq; -
5135 } else if (c == QLatin1Char('&')) {
evaluated: c == QLatin1Char('&')
TRUEFALSE
yes
Evaluation Count:222
yes
Evaluation Count:2692
executed: }
Execution Count:70
70-2692
5136 input = InpAmp; -
5137 } else if (c == QLatin1Char('%')) {
evaluated: c == QLatin1Char('%')
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2690
executed: }
Execution Count:222
2-2690
5138 input = InpPer; -
5139 } else {
executed: }
Execution Count:2
2
5140 input = InpUnknown; -
5141 }
executed: }
Execution Count:2690
2690
5142 state = table[state][input]; -
5143 -
5144 switch (state) { -
5145 case Dq: -
5146 case Sq: -
5147 stringClear(); -
5148 next(); -
5149 break;
executed: break;
Execution Count:637
637
5150 case DqC: -
5151 case SqC: -
5152 stringAddC(); -
5153 next(); -
5154 break;
executed: break;
Execution Count:2707
2707
5155 case DqPER: -
5156 case SqPER: -
5157 parsePEReference_context = InEntityValue; -
5158 if (!parsePEReference()) {
partially evaluated: !parsePEReference()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
5159 parseFailed(&QXmlSimpleReaderPrivate::parseEntityValue, state); -
5160 return false;
never executed: return false;
0
5161 } -
5162 break;
executed: break;
Execution Count:2
2
5163 case DqRef: -
5164 case SqRef: -
5165 parseReference_context = InEntityValue; -
5166 if (!parseReference()) {
evaluated: !parseReference()
TRUEFALSE
yes
Evaluation Count:115
yes
Evaluation Count:107
107-115
5167 parseFailed(&QXmlSimpleReaderPrivate::parseEntityValue, state); -
5168 return false;
executed: return false;
Execution Count:115
115
5169 } -
5170 break;
executed: break;
Execution Count:107
107
5171 case Done: -
5172 next(); -
5173 break;
executed: break;
Execution Count:633
633
5174 } -
5175 }
executed: }
Execution Count:4086
4086
5176 return false;
never executed: return false;
0
5177} -
5178bool QXmlSimpleReaderPrivate::parseComment() -
5179{ -
5180 const signed char Init = 0; -
5181 const signed char Dash1 = 1; -
5182 const signed char Dash2 = 2; -
5183 const signed char Com = 3; -
5184 const signed char Com2 = 4; -
5185 const signed char ComE = 5; -
5186 const signed char Done = 6; -
5187 -
5188 const signed char InpDash = 0; -
5189 const signed char InpGt = 1; -
5190 const signed char InpUnknown = 2; -
5191 -
5192 static const signed char table[6][3] = { -
5193 -
5194 { Dash1, -1, -1 }, -
5195 { Dash2, -1, -1 }, -
5196 { Com2, Com, Com }, -
5197 { Com2, Com, Com }, -
5198 { ComE, Com, Com }, -
5199 { -1, Done, -1 } -
5200 }; -
5201 signed char state; -
5202 signed char input; -
5203 -
5204 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:2028
yes
Evaluation Count:527
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:63
yes
Evaluation Count:464
63-2028
5205 state = Init; -
5206 } else {
executed: }
Execution Count:2091
2091
5207 state = parseStack->pop().state; -
5208 -
5209 -
5210 -
5211 if (!parseStack->isEmpty()) {
partially evaluated: !parseStack->isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:464
0-464
5212 ParseFunction function = parseStack->top().function; -
5213 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
never evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
0
5214 parseStack->pop(); -
5215 -
5216 -
5217 -
5218 }
never executed: }
0
5219 if (!(this->*function)()) {
never evaluated: !(this->*function)()
0
5220 parseFailed(&QXmlSimpleReaderPrivate::parseComment, state); -
5221 return false;
never executed: return false;
0
5222 } -
5223 }
never executed: }
0
5224 }
executed: }
Execution Count:464
464
5225 -
5226 for (;;) { -
5227 switch (state) { -
5228 case Dash2: -
5229 stringClear(); -
5230 break;
executed: break;
Execution Count:2116
2116
5231 case Com2: -
5232 -
5233 if (!atEnd() && c != QLatin1Char('-'))
evaluated: !atEnd()
TRUEFALSE
yes
Evaluation Count:6381
yes
Evaluation Count:30
evaluated: c != QLatin1Char('-')
TRUEFALSE
yes
Evaluation Count:4292
yes
Evaluation Count:2089
30-6381
5234 stringAddC(QLatin1Char('-'));
executed: stringAddC(QLatin1Char('-'));
Execution Count:4292
4292
5235 break;
executed: break;
Execution Count:6411
6411
5236 case Done: -
5237 return true;
executed: return true;
Execution Count:2087
2087
5238 case -1: -
5239 -
5240 reportParseError(QLatin1String("error occurred while parsing comment")); -
5241 return false;
executed: return false;
Execution Count:3
3
5242 } -
5243 -
5244 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:465
yes
Evaluation Count:465511
465-465511
5245 unexpectedEof(&QXmlSimpleReaderPrivate::parseComment, state); -
5246 return false;
executed: return false;
Execution Count:465
465
5247 } -
5248 if (c == QLatin1Char('-')) {
evaluated: c == QLatin1Char('-')
TRUEFALSE
yes
Evaluation Count:12651
yes
Evaluation Count:452860
12651-452860
5249 input = InpDash; -
5250 } else if (c == QLatin1Char('>')) {
evaluated: c == QLatin1Char('>')
TRUEFALSE
yes
Evaluation Count:13527
yes
Evaluation Count:439333
executed: }
Execution Count:12651
12651-439333
5251 input = InpGt; -
5252 } else {
executed: }
Execution Count:13527
13527
5253 input = InpUnknown; -
5254 }
executed: }
Execution Count:439333
439333
5255 state = table[state][input]; -
5256 -
5257 switch (state) { -
5258 case Dash1: -
5259 next(); -
5260 break;
executed: break;
Execution Count:2090
2090
5261 case Dash2: -
5262 next(); -
5263 break;
executed: break;
Execution Count:2090
2090
5264 case Com: -
5265 stringAddC(); -
5266 next(); -
5267 break;
executed: break;
Execution Count:450771
450771
5268 case Com2: -
5269 next(); -
5270 break;
executed: break;
Execution Count:6381
6381
5271 case ComE: -
5272 next(); -
5273 break;
executed: break;
Execution Count:2089
2089
5274 case Done: -
5275 next(); -
5276 break;
executed: break;
Execution Count:2087
2087
5277 } -
5278 }
executed: }
Execution Count:465511
465511
5279 return false;
never executed: return false;
0
5280} -
5281bool QXmlSimpleReaderPrivate::parseAttribute() -
5282{ -
5283 const int Init = 0; -
5284 const int PName = 1; -
5285 const int Ws = 2; -
5286 const int Eq = 3; -
5287 const int Quotes = 4; -
5288 -
5289 const int InpNameBe = 0; -
5290 const int InpEq = 1; -
5291 const int InpDq = 2; -
5292 const int InpSq = 3; -
5293 const int InpUnknown = 4; -
5294 -
5295 static const int table[4][5] = { -
5296 -
5297 { PName, -1, -1, -1, -1 }, -
5298 { -1, Eq, -1, -1, Ws }, -
5299 { -1, Eq, -1, -1, -1 }, -
5300 { -1, -1, Quotes, Quotes, -1 } -
5301 }; -
5302 int state; -
5303 int input; -
5304 -
5305 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:28690
yes
Evaluation Count:2446
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:549
yes
Evaluation Count:1897
549-28690
5306 state = Init; -
5307 } else {
executed: }
Execution Count:29239
29239
5308 state = parseStack->pop().state; -
5309 -
5310 -
5311 -
5312 if (!parseStack->isEmpty()) {
partially evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:1897
no
Evaluation Count:0
0-1897
5313 ParseFunction function = parseStack->top().function; -
5314 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
yes
Evaluation Count:158
yes
Evaluation Count:1739
158-1739
5315 parseStack->pop(); -
5316 -
5317 -
5318 -
5319 }
executed: }
Execution Count:158
158
5320 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:933
yes
Evaluation Count:964
933-964
5321 parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state); -
5322 return false;
executed: return false;
Execution Count:933
933
5323 } -
5324 }
executed: }
Execution Count:964
964
5325 }
executed: }
Execution Count:964
964
5326 -
5327 for (;;) { -
5328 switch (state) { -
5329 case Quotes: -
5330 -
5331 return true;
executed: return true;
Execution Count:29224
29224
5332 case -1: -
5333 -
5334 reportParseError(QLatin1String("unexpected character")); -
5335 return false;
executed: return false;
Execution Count:3
3
5336 } -
5337 -
5338 if (atEnd()) {
partially evaluated: atEnd()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:87737
0-87737
5339 unexpectedEof(&QXmlSimpleReaderPrivate::parseAttribute, state); -
5340 return false;
never executed: return false;
0
5341 } -
5342 if (determineNameChar(c) == NameBeginning) {
evaluated: determineNameChar(c) == NameBeginning
TRUEFALSE
yes
Evaluation Count:29240
yes
Evaluation Count:58497
29240-58497
5343 input = InpNameBe; -
5344 } else if (c == QLatin1Char('=')) {
executed: }
Execution Count:29240
evaluated: c == QLatin1Char('=')
TRUEFALSE
yes
Evaluation Count:29238
yes
Evaluation Count:29259
29238-29259
5345 input = InpEq; -
5346 } else if (c == QLatin1Char('"')) {
executed: }
Execution Count:29238
evaluated: c == QLatin1Char('"')
TRUEFALSE
yes
Evaluation Count:27596
yes
Evaluation Count:1663
1663-29238
5347 input = InpDq; -
5348 } else if (c == QLatin1Char('\'')) {
executed: }
Execution Count:27596
evaluated: c == QLatin1Char('\'')
TRUEFALSE
yes
Evaluation Count:1640
yes
Evaluation Count:23
23-27596
5349 input = InpSq; -
5350 } else {
executed: }
Execution Count:1640
1640
5351 input = InpUnknown; -
5352 }
executed: }
Execution Count:23
23
5353 state = table[state][input]; -
5354 -
5355 switch (state) { -
5356 case PName: -
5357 parseName_useRef = false; -
5358 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:362
yes
Evaluation Count:28877
362-28877
5359 parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state); -
5360 return false;
executed: return false;
Execution Count:362
362
5361 } -
5362 break;
executed: break;
Execution Count:28877
28877
5363 case Ws: -
5364 if (!eat_ws()) {
evaluated: !eat_ws()
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:17
4-17
5365 parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state); -
5366 return false;
executed: return false;
Execution Count:4
4
5367 } -
5368 break;
executed: break;
Execution Count:17
17
5369 case Eq: -
5370 if (!next_eat_ws()) {
evaluated: !next_eat_ws()
TRUEFALSE
yes
Evaluation Count:152
yes
Evaluation Count:29086
152-29086
5371 parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state); -
5372 return false;
executed: return false;
Execution Count:152
152
5373 } -
5374 break;
executed: break;
Execution Count:29086
29086
5375 case Quotes: -
5376 if (!parseAttValue()) {
evaluated: !parseAttValue()
TRUEFALSE
yes
Evaluation Count:458
yes
Evaluation Count:28778
458-28778
5377 parseFailed(&QXmlSimpleReaderPrivate::parseAttribute, state); -
5378 return false;
executed: return false;
Execution Count:458
458
5379 } -
5380 break;
executed: break;
Execution Count:28778
28778
5381 } -
5382 }
executed: }
Execution Count:86761
86761
5383 return false;
never executed: return false;
0
5384} -
5385 -
5386 -
5387 -
5388 -
5389bool QXmlSimpleReaderPrivate::parseName() -
5390{ -
5391 const int Init = 0; -
5392 const int Name1 = 1; -
5393 const int Name = 2; -
5394 const int Done = 3; -
5395 -
5396 static const int table[3][3] = { -
5397 -
5398 { Name1, -1, -1 }, -
5399 { Name, Name, Done }, -
5400 { Name, Name, Done } -
5401 }; -
5402 int state; -
5403 -
5404 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:114470
yes
Evaluation Count:18173
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:9758
yes
Evaluation Count:8415
8415-114470
5405 state = Init; -
5406 } else {
executed: }
Execution Count:124228
124228
5407 state = parseStack->pop().state; -
5408 -
5409 -
5410 -
5411 if (!parseStack->isEmpty()) {
partially evaluated: !parseStack->isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:8415
0-8415
5412 ParseFunction function = parseStack->top().function; -
5413 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
never evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
0
5414 parseStack->pop(); -
5415 -
5416 -
5417 -
5418 }
never executed: }
0
5419 if (!(this->*function)()) {
never evaluated: !(this->*function)()
0
5420 parseFailed(&QXmlSimpleReaderPrivate::parseName, state); -
5421 return false;
never executed: return false;
0
5422 } -
5423 }
never executed: }
0
5424 }
executed: }
Execution Count:8415
8415
5425 -
5426 for (;;) { -
5427 switch (state) { -
5428 case Done: -
5429 return true;
executed: return true;
Execution Count:124215
124215
5430 case -1: -
5431 -
5432 reportParseError(QLatin1String("letter is expected")); -
5433 return false;
executed: return false;
Execution Count:13
13
5434 } -
5435 -
5436 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:8415
yes
Evaluation Count:597424
8415-597424
5437 unexpectedEof(&QXmlSimpleReaderPrivate::parseName, state); -
5438 return false;
executed: return false;
Execution Count:8415
8415
5439 } -
5440 -
5441 -
5442 state = table[state][(int)fastDetermineNameChar(c)]; -
5443 -
5444 switch (state) { -
5445 case Name1: -
5446 if (parseName_useRef) {
evaluated: parseName_useRef
TRUEFALSE
yes
Evaluation Count:5365
yes
Evaluation Count:118850
5365-118850
5447 refClear(); -
5448 refAddC(); -
5449 } else {
executed: }
Execution Count:5365
5365
5450 nameClear(); -
5451 nameAddC(); -
5452 }
executed: }
Execution Count:118850
118850
5453 next(); -
5454 break;
executed: break;
Execution Count:124215
124215
5455 case Name: -
5456 if (parseName_useRef) {
evaluated: parseName_useRef
TRUEFALSE
yes
Evaluation Count:19155
yes
Evaluation Count:329826
19155-329826
5457 refAddC(); -
5458 } else {
executed: }
Execution Count:19155
19155
5459 nameAddC(); -
5460 }
executed: }
Execution Count:329826
329826
5461 next(); -
5462 break;
executed: break;
Execution Count:348981
348981
5463 } -
5464 }
executed: }
Execution Count:597424
597424
5465 return false;
never executed: return false;
0
5466} -
5467 -
5468 -
5469 -
5470 -
5471bool QXmlSimpleReaderPrivate::parseNmtoken() -
5472{ -
5473 const signed char Init = 0; -
5474 const signed char NameF = 1; -
5475 const signed char Name = 2; -
5476 const signed char Done = 3; -
5477 -
5478 const signed char InpNameCh = 0; -
5479 const signed char InpUnknown = 1; -
5480 -
5481 static const signed char table[3][2] = { -
5482 -
5483 { NameF, -1 }, -
5484 { Name, Done }, -
5485 { Name, Done } -
5486 }; -
5487 signed char state; -
5488 signed char input; -
5489 -
5490 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:6
yes
Evaluation Count:23
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:18
yes
Evaluation Count:5
5-23
5491 state = Init; -
5492 } else {
executed: }
Execution Count:24
24
5493 state = parseStack->pop().state; -
5494 -
5495 -
5496 -
5497 if (!parseStack->isEmpty()) {
partially evaluated: !parseStack->isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:5
0-5
5498 ParseFunction function = parseStack->top().function; -
5499 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
never evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
0
5500 parseStack->pop(); -
5501 -
5502 -
5503 -
5504 }
never executed: }
0
5505 if (!(this->*function)()) {
never evaluated: !(this->*function)()
0
5506 parseFailed(&QXmlSimpleReaderPrivate::parseNmtoken, state); -
5507 return false;
never executed: return false;
0
5508 } -
5509 }
never executed: }
0
5510 }
executed: }
Execution Count:5
5
5511 -
5512 for (;;) { -
5513 switch (state) { -
5514 case Done: -
5515 return true;
executed: return true;
Execution Count:24
24
5516 case -1: -
5517 -
5518 reportParseError(QLatin1String("letter is expected")); -
5519 return false;
never executed: return false;
0
5520 } -
5521 -
5522 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:5
yes
Evaluation Count:56
5-56
5523 unexpectedEof(&QXmlSimpleReaderPrivate::parseNmtoken, state); -
5524 return false;
executed: return false;
Execution Count:5
5
5525 } -
5526 if (determineNameChar(c) == NotName) {
evaluated: determineNameChar(c) == NotName
TRUEFALSE
yes
Evaluation Count:24
yes
Evaluation Count:32
24-32
5527 input = InpUnknown; -
5528 } else {
executed: }
Execution Count:24
24
5529 input = InpNameCh; -
5530 }
executed: }
Execution Count:32
32
5531 state = table[state][input]; -
5532 -
5533 switch (state) { -
5534 case NameF: -
5535 nameClear(); -
5536 nameAddC(); -
5537 next(); -
5538 break;
executed: break;
Execution Count:24
24
5539 case Name: -
5540 nameAddC(); -
5541 next(); -
5542 break;
executed: break;
Execution Count:8
8
5543 } -
5544 }
executed: }
Execution Count:56
56
5545 return false;
never executed: return false;
0
5546} -
5547bool QXmlSimpleReaderPrivate::parseReference() -
5548{ -
5549 -
5550 -
5551 uint tmp; -
5552 bool ok; -
5553 -
5554 const signed char Init = 0; -
5555 const signed char SRef = 1; -
5556 const signed char ChRef = 2; -
5557 const signed char ChDec = 3; -
5558 const signed char ChHexS = 4; -
5559 const signed char ChHex = 5; -
5560 const signed char Name = 6; -
5561 const signed char DoneD = 7; -
5562 const signed char DoneH = 8; -
5563 const signed char DoneN = 9; -
5564 -
5565 const signed char InpAmp = 0; -
5566 const signed char InpSemi = 1; -
5567 const signed char InpHash = 2; -
5568 const signed char InpX = 3; -
5569 const signed char InpNum = 4; -
5570 const signed char InpHex = 5; -
5571 const signed char InpUnknown = 6; -
5572 -
5573 static const signed char table[8][7] = { -
5574 -
5575 { SRef, -1, -1, -1, -1, -1, -1 }, -
5576 { -1, -1, ChRef, Name, Name, Name, Name }, -
5577 { -1, -1, -1, ChHexS, ChDec, -1, -1 }, -
5578 { -1, DoneD, -1, -1, ChDec, -1, -1 }, -
5579 { -1, -1, -1, -1, ChHex, ChHex, -1 }, -
5580 { -1, DoneH, -1, -1, ChHex, ChHex, -1 }, -
5581 { -1, DoneN, -1, -1, -1, -1, -1 } -
5582 }; -
5583 signed char state; -
5584 signed char input; -
5585 -
5586 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:16349
yes
Evaluation Count:2474
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:1161
yes
Evaluation Count:1313
1161-16349
5587 parseReference_charDataRead = false; -
5588 state = Init; -
5589 } else {
executed: }
Execution Count:17510
17510
5590 state = parseStack->pop().state; -
5591 -
5592 -
5593 -
5594 if (!parseStack->isEmpty()) {
evaluated: !parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:504
yes
Evaluation Count:809
504-809
5595 ParseFunction function = parseStack->top().function; -
5596 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
partially evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:504
0-504
5597 parseStack->pop(); -
5598 -
5599 -
5600 -
5601 }
never executed: }
0
5602 if (!(this->*function)()) {
evaluated: !(this->*function)()
TRUEFALSE
yes
Evaluation Count:130
yes
Evaluation Count:374
130-374
5603 parseFailed(&QXmlSimpleReaderPrivate::parseReference, state); -
5604 return false;
executed: return false;
Execution Count:130
130
5605 } -
5606 }
executed: }
Execution Count:374
374
5607 }
executed: }
Execution Count:1183
1183
5608 -
5609 for (;;) { -
5610 switch (state) { -
5611 case DoneD: -
5612 return true;
executed: return true;
Execution Count:281
281
5613 case DoneH: -
5614 return true;
executed: return true;
Execution Count:11916
11916
5615 case DoneN: -
5616 return true;
executed: return true;
Execution Count:5290
5290
5617 case -1: -
5618 -
5619 reportParseError(QLatin1String("error occurred while parsing reference")); -
5620 return false;
executed: return false;
Execution Count:6
6
5621 } -
5622 -
5623 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:809
yes
Evaluation Count:77865
809-77865
5624 unexpectedEof(&QXmlSimpleReaderPrivate::parseReference, state); -
5625 return false;
executed: return false;
Execution Count:809
809
5626 } -
5627 if (c.row()) {
partially evaluated: c.row()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:77865
0-77865
5628 input = InpUnknown; -
5629 } else if (c.cell() == '&') {
never executed: }
evaluated: c.cell() == '&'
TRUEFALSE
yes
Evaluation Count:17511
yes
Evaluation Count:60354
0-60354
5630 input = InpAmp; -
5631 } else if (c.cell() == ';') {
executed: }
Execution Count:17511
evaluated: c.cell() == ';'
TRUEFALSE
yes
Evaluation Count:17495
yes
Evaluation Count:42859
17495-42859
5632 input = InpSemi; -
5633 } else if (c.cell() == '#') {
executed: }
Execution Count:17495
evaluated: c.cell() == '#'
TRUEFALSE
yes
Evaluation Count:12200
yes
Evaluation Count:30659
12200-30659
5634 input = InpHash; -
5635 } else if (c.cell() == 'x') {
executed: }
Execution Count:12200
evaluated: c.cell() == 'x'
TRUEFALSE
yes
Evaluation Count:11930
yes
Evaluation Count:18729
11930-18729
5636 input = InpX; -
5637 } else if ('0' <= c.cell() && c.cell() <= '9') {
executed: }
Execution Count:11930
evaluated: '0' <= c.cell()
TRUEFALSE
yes
Evaluation Count:18718
yes
Evaluation Count:11
evaluated: c.cell() <= '9'
TRUEFALSE
yes
Evaluation Count:1537
yes
Evaluation Count:17181
11-18718
5638 input = InpNum; -
5639 } else if ('a' <= c.cell() && c.cell() <= 'f') {
executed: }
Execution Count:1537
evaluated: 'a' <= c.cell()
TRUEFALSE
yes
Evaluation Count:17055
yes
Evaluation Count:137
evaluated: c.cell() <= 'f'
TRUEFALSE
yes
Evaluation Count:13671
yes
Evaluation Count:3384
137-17055
5640 input = InpHex; -
5641 } else if ('A' <= c.cell() && c.cell() <= 'F') {
executed: }
Execution Count:13671
evaluated: 'A' <= c.cell()
TRUEFALSE
yes
Evaluation Count:3509
yes
Evaluation Count:12
evaluated: c.cell() <= 'F'
TRUEFALSE
yes
Evaluation Count:53
yes
Evaluation Count:3456
12-13671
5642 input = InpHex; -
5643 } else {
executed: }
Execution Count:53
53
5644 input = InpUnknown; -
5645 }
executed: }
Execution Count:3468
3468
5646 state = table[state][input]; -
5647 -
5648 switch (state) { -
5649 case SRef: -
5650 refClear(); -
5651 next(); -
5652 break;
executed: break;
Execution Count:17510
17510
5653 case ChRef: -
5654 next(); -
5655 break;
executed: break;
Execution Count:12200
12200
5656 case ChDec: -
5657 refAddC(); -
5658 next(); -
5659 break;
executed: break;
Execution Count:928
928
5660 case ChHexS: -
5661 next(); -
5662 break;
executed: break;
Execution Count:11916
11916
5663 case ChHex: -
5664 refAddC(); -
5665 next(); -
5666 break;
executed: break;
Execution Count:12501
12501
5667 case Name: -
5668 -
5669 parseName_useRef = true; -
5670 if (!parseName()) {
evaluated: !parseName()
TRUEFALSE
yes
Evaluation Count:383
yes
Evaluation Count:4926
383-4926
5671 parseFailed(&QXmlSimpleReaderPrivate::parseReference, state); -
5672 return false;
executed: return false;
Execution Count:383
383
5673 } -
5674 break;
executed: break;
Execution Count:4926
4926
5675 case DoneD: -
5676 tmp = ref().toUInt(&ok, 10); -
5677 if (ok) {
partially evaluated: ok
TRUEFALSE
yes
Evaluation Count:281
no
Evaluation Count:0
0-281
5678 stringAddC(QChar(tmp)); -
5679 } else {
executed: }
Execution Count:281
281
5680 reportParseError(QLatin1String("error occurred while parsing reference")); -
5681 return false;
never executed: return false;
0
5682 } -
5683 parseReference_charDataRead = true; -
5684 next(); -
5685 break;
executed: break;
Execution Count:281
281
5686 case DoneH: -
5687 tmp = ref().toUInt(&ok, 16); -
5688 if (ok) {
partially evaluated: ok
TRUEFALSE
yes
Evaluation Count:11916
no
Evaluation Count:0
0-11916
5689 stringAddC(QChar(tmp)); -
5690 } else {
executed: }
Execution Count:11916
11916
5691 reportParseError(QLatin1String("error occurred while parsing reference")); -
5692 return false;
never executed: return false;
0
5693 } -
5694 parseReference_charDataRead = true; -
5695 next(); -
5696 break;
executed: break;
Execution Count:11916
11916
5697 case DoneN: -
5698 if (!processReference())
evaluated: !processReference()
TRUEFALSE
yes
Evaluation Count:8
yes
Evaluation Count:5290
8-5290
5699 return false;
executed: return false;
Execution Count:8
8
5700 next(); -
5701 break;
executed: break;
Execution Count:5290
5290
5702 } -
5703 }
executed: }
Execution Count:77474
77474
5704 return false;
never executed: return false;
0
5705} -
5706 -
5707 -
5708 -
5709 -
5710bool QXmlSimpleReaderPrivate::processReference() -
5711{ -
5712 QString reference = ref(); -
5713 if (reference == QLatin1String("amp")) {
evaluated: reference == QLatin1String("amp")
TRUEFALSE
yes
Evaluation Count:596
yes
Evaluation Count:4702
596-4702
5714 if (parseReference_context == InEntityValue) {
evaluated: parseReference_context == InEntityValue
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:594
2-594
5715 -
5716 stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('a')); stringAddC(QLatin1Char('m')); stringAddC(QLatin1Char('p')); stringAddC(QLatin1Char(';')); -
5717 } else {
executed: }
Execution Count:2
2
5718 -
5719 stringAddC(QLatin1Char('&')); -
5720 }
executed: }
Execution Count:594
594
5721 parseReference_charDataRead = true; -
5722 } else if (reference == QLatin1String("lt")) {
executed: }
Execution Count:596
evaluated: reference == QLatin1String("lt")
TRUEFALSE
yes
Evaluation Count:1143
yes
Evaluation Count:3559
596-3559
5723 if (parseReference_context == InEntityValue) {
evaluated: parseReference_context == InEntityValue
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:1131
12-1131
5724 -
5725 stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('l')); stringAddC(QLatin1Char('t')); stringAddC(QLatin1Char(';')); -
5726 } else {
executed: }
Execution Count:12
12
5727 -
5728 stringAddC(QLatin1Char('<')); -
5729 }
executed: }
Execution Count:1131
1131
5730 parseReference_charDataRead = true; -
5731 } else if (reference == QLatin1String("gt")) {
executed: }
Execution Count:1143
evaluated: reference == QLatin1String("gt")
TRUEFALSE
yes
Evaluation Count:244
yes
Evaluation Count:3315
244-3315
5732 if (parseReference_context == InEntityValue) {
partially evaluated: parseReference_context == InEntityValue
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:244
0-244
5733 -
5734 stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('g')); stringAddC(QLatin1Char('t')); stringAddC(QLatin1Char(';')); -
5735 } else {
never executed: }
0
5736 -
5737 stringAddC(QLatin1Char('>')); -
5738 }
executed: }
Execution Count:244
244
5739 parseReference_charDataRead = true; -
5740 } else if (reference == QLatin1String("apos")) {
executed: }
Execution Count:244
evaluated: reference == QLatin1String("apos")
TRUEFALSE
yes
Evaluation Count:20
yes
Evaluation Count:3295
20-3295
5741 if (parseReference_context == InEntityValue) {
partially evaluated: parseReference_context == InEntityValue
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:20
0-20
5742 -
5743 stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('a')); stringAddC(QLatin1Char('p')); stringAddC(QLatin1Char('o')); stringAddC(QLatin1Char('s')); stringAddC(QLatin1Char(';')); -
5744 } else {
never executed: }
0
5745 -
5746 stringAddC(QLatin1Char('\'')); -
5747 }
executed: }
Execution Count:20
20
5748 parseReference_charDataRead = true; -
5749 } else if (reference == QLatin1String("quot")) {
executed: }
Execution Count:20
evaluated: reference == QLatin1String("quot")
TRUEFALSE
yes
Evaluation Count:35
yes
Evaluation Count:3260
20-3260
5750 if (parseReference_context == InEntityValue) {
partially evaluated: parseReference_context == InEntityValue
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:35
0-35
5751 -
5752 stringAddC(QLatin1Char('&')); stringAddC(QLatin1Char('q')); stringAddC(QLatin1Char('u')); stringAddC(QLatin1Char('o')); stringAddC(QLatin1Char('t')); stringAddC(QLatin1Char(';')); -
5753 } else {
never executed: }
0
5754 -
5755 stringAddC(QLatin1Char('"')); -
5756 }
executed: }
Execution Count:35
35
5757 parseReference_charDataRead = true; -
5758 } else {
executed: }
Execution Count:35
35
5759 QMap<QString,QString>::Iterator it; -
5760 it = entities.find(reference); -
5761 if (it != entities.end()) {
evaluated: it != entities.end()
TRUEFALSE
yes
Evaluation Count:2820
yes
Evaluation Count:440
440-2820
5762 -
5763 switch (parseReference_context) { -
5764 case InContent: -
5765 -
5766 if (!insertXmlRef(*it, reference, false))
evaluated: !insertXmlRef(*it, reference, false)
TRUEFALSE
yes
Evaluation Count:1
yes
Evaluation Count:2649
1-2649
5767 return false;
executed: return false;
Execution Count:1
1
5768 parseReference_charDataRead = false; -
5769 break;
executed: break;
Execution Count:2649
2649
5770 case InAttributeValue: -
5771 -
5772 if (!insertXmlRef(*it, reference, true))
evaluated: !insertXmlRef(*it, reference, true)
TRUEFALSE
yes
Evaluation Count:3
yes
Evaluation Count:161
3-161
5773 return false;
executed: return false;
Execution Count:3
3
5774 parseReference_charDataRead = false; -
5775 break;
executed: break;
Execution Count:161
161
5776 case InEntityValue: -
5777 { -
5778 -
5779 stringAddC(QLatin1Char('&')); -
5780 for (int i=0; i<(int)reference.length(); i++) {
evaluated: i<(int)reference.length()
TRUEFALSE
yes
Evaluation Count:42
yes
Evaluation Count:6
6-42
5781 stringAddC(reference[i]); -
5782 }
executed: }
Execution Count:42
42
5783 stringAddC(QLatin1Char(';')); -
5784 parseReference_charDataRead = true; -
5785 } -
5786 break;
executed: break;
Execution Count:6
6
5787 case InDTD: -
5788 -
5789 parseReference_charDataRead = false; -
5790 reportParseError(QLatin1String("internal general entity reference not allowed in DTD")); -
5791 return false;
never executed: return false;
0
5792 } -
5793 } else {
executed: }
Execution Count:2816
2816
5794 QMap<QString,QXmlSimpleReaderPrivate::ExternEntity>::Iterator itExtern; -
5795 itExtern = externEntities.find(reference); -
5796 if (itExtern == externEntities.end()) {
evaluated: itExtern == externEntities.end()
TRUEFALSE
yes
Evaluation Count:296
yes
Evaluation Count:144
144-296
5797 -
5798 -
5799 if (parseReference_context == InEntityValue) {
evaluated: parseReference_context == InEntityValue
TRUEFALSE
yes
Evaluation Count:99
yes
Evaluation Count:197
99-197
5800 -
5801 stringAddC(QLatin1Char('&')); -
5802 for (int i=0; i<(int)reference.length(); i++) {
evaluated: i<(int)reference.length()
TRUEFALSE
yes
Evaluation Count:209
yes
Evaluation Count:99
99-209
5803 stringAddC(reference[i]); -
5804 }
executed: }
Execution Count:209
209
5805 stringAddC(QLatin1Char(';')); -
5806 parseReference_charDataRead = true; -
5807 } else {
executed: }
Execution Count:99
99
5808 -
5809 if (parseReference_context == InContent) {
evaluated: parseReference_context == InContent
TRUEFALSE
yes
Evaluation Count:183
yes
Evaluation Count:14
14-183
5810 if (contentCharDataRead) {
evaluated: contentCharDataRead
TRUEFALSE
yes
Evaluation Count:100
yes
Evaluation Count:83
83-100
5811 if (reportWhitespaceCharData || !string().simplified().isEmpty()) {
partially evaluated: reportWhitespaceCharData
TRUEFALSE
yes
Evaluation Count:100
no
Evaluation Count:0
never evaluated: !string().simplified().isEmpty()
0-100
5812 if (contentHnd != 0 && !contentHnd->characters(string())) {
partially evaluated: contentHnd != 0
TRUEFALSE
yes
Evaluation Count:100
no
Evaluation Count:0
partially evaluated: !contentHnd->characters(string())
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:100
0-100
5813 reportParseError(contentHnd->errorString()); -
5814 return false;
never executed: return false;
0
5815 } -
5816 }
executed: }
Execution Count:100
100
5817 stringClear(); -
5818 contentCharDataRead = false; -
5819 }
executed: }
Execution Count:100
100
5820 }
executed: }
Execution Count:183
183
5821 -
5822 if (contentHnd) {
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:197
no
Evaluation Count:0
0-197
5823 qt_xml_skipped_entity_in_content = parseReference_context == InContent; -
5824 if (!contentHnd->skippedEntity(reference)) {
partially evaluated: !contentHnd->skippedEntity(reference)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:197
0-197
5825 qt_xml_skipped_entity_in_content = false; -
5826 reportParseError(contentHnd->errorString()); -
5827 return false;
never executed: return false;
0
5828 } -
5829 qt_xml_skipped_entity_in_content = false; -
5830 }
executed: }
Execution Count:197
197
5831 }
executed: }
Execution Count:197
197
5832 } else if ((*itExtern).notation.isNull()) {
evaluated: (*itExtern).notation.isNull()
TRUEFALSE
yes
Evaluation Count:142
yes
Evaluation Count:2
2-142
5833 -
5834 switch (parseReference_context) { -
5835 case InContent: -
5836 { -
5837 -
5838 bool skipIt = true; -
5839 if (entityRes) {
partially evaluated: entityRes
TRUEFALSE
yes
Evaluation Count:140
no
Evaluation Count:0
0-140
5840 QXmlInputSource *ret = 0; -
5841 if (!entityRes->resolveEntity((*itExtern).publicId, (*itExtern).systemId, ret)) {
partially evaluated: !entityRes->resolveEntity((*itExtern).publicId, (*itExtern).systemId, ret)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:140
0-140
5842 delete ret; -
5843 reportParseError(entityRes->errorString()); -
5844 return false;
never executed: return false;
0
5845 } -
5846 if (ret) {
partially evaluated: ret
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:140
0-140
5847 QString xmlRefString = ret->data(); -
5848 delete ret; -
5849 if (!stripTextDecl(xmlRefString)) {
never evaluated: !stripTextDecl(xmlRefString)
0
5850 reportParseError(QLatin1String("error in the text declaration of an external entity")); -
5851 return false;
never executed: return false;
0
5852 } -
5853 if (!insertXmlRef(xmlRefString, reference, false))
never evaluated: !insertXmlRef(xmlRefString, reference, false)
0
5854 return false;
never executed: return false;
0
5855 skipIt = false; -
5856 }
never executed: }
0
5857 }
executed: }
Execution Count:140
140
5858 if (skipIt && contentHnd) {
partially evaluated: skipIt
TRUEFALSE
yes
Evaluation Count:140
no
Evaluation Count:0
partially evaluated: contentHnd
TRUEFALSE
yes
Evaluation Count:140
no
Evaluation Count:0
0-140
5859 qt_xml_skipped_entity_in_content = true; -
5860 if (!contentHnd->skippedEntity(reference)) {
partially evaluated: !contentHnd->skippedEntity(reference)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:140
0-140
5861 qt_xml_skipped_entity_in_content = false; -
5862 reportParseError(contentHnd->errorString()); -
5863 return false;
never executed: return false;
0
5864 } -
5865 qt_xml_skipped_entity_in_content = false; -
5866 }
executed: }
Execution Count:140
140
5867 parseReference_charDataRead = false; -
5868 } break;
executed: break;
Execution Count:140
140
5869 case InAttributeValue: -
5870 -
5871 parseReference_charDataRead = false; -
5872 reportParseError(QLatin1String("external parsed general entity reference not allowed in attribute value")); -
5873 return false;
executed: return false;
Execution Count:2
2
5874 case InEntityValue: -
5875 { -
5876 -
5877 stringAddC(QLatin1Char('&')); -
5878 for (int i=0; i<(int)reference.length(); i++) {
never evaluated: i<(int)reference.length()
0
5879 stringAddC(reference[i]); -
5880 }
never executed: }
0
5881 stringAddC(QLatin1Char(';')); -
5882 parseReference_charDataRead = true; -
5883 } -
5884 break;
never executed: break;
0
5885 case InDTD: -
5886 -
5887 parseReference_charDataRead = false; -
5888 reportParseError(QLatin1String("external parsed general entity reference not allowed in DTD")); -
5889 return false;
never executed: return false;
0
5890 } -
5891 } else {
executed: }
Execution Count:140
140
5892 -
5893 -
5894 -
5895 parseReference_charDataRead = false; -
5896 reportParseError(QLatin1String("unparsed entity reference in wrong context")); -
5897 return false;
executed: return false;
Execution Count:2
2
5898 } -
5899 } -
5900 } -
5901 return true;
executed: return true;
Execution Count:5290
5290
5902} -
5903bool QXmlSimpleReaderPrivate::parseString() -
5904{ -
5905 const signed char InpCharExpected = 0; -
5906 const signed char InpUnknown = 1; -
5907 -
5908 signed char state; -
5909 signed char input; -
5910 -
5911 if (parseStack==0 || parseStack->isEmpty()) {
evaluated: parseStack==0
TRUEFALSE
yes
Evaluation Count:1767
yes
Evaluation Count:17594
evaluated: parseStack->isEmpty()
TRUEFALSE
yes
Evaluation Count:6612
yes
Evaluation Count:10982
1767-17594
5912 Done = parseString_s.length(); -
5913 state = 0; -
5914 } else {
executed: }
Execution Count:8379
8379
5915 state = parseStack->pop().state; -
5916 -
5917 -
5918 -
5919 if (!parseStack->isEmpty()) {
partially evaluated: !parseStack->isEmpty()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:10982
0-10982
5920 ParseFunction function = parseStack->top().function; -
5921 if (function == &QXmlSimpleReaderPrivate::eat_ws) {
never evaluated: function == &QXmlSimpleReaderPrivate::eat_ws
0
5922 parseStack->pop(); -
5923 -
5924 -
5925 -
5926 }
never executed: }
0
5927 if (!(this->*function)()) {
never evaluated: !(this->*function)()
0
5928 parseFailed(&QXmlSimpleReaderPrivate::parseString, state); -
5929 return false;
never executed: return false;
0
5930 } -
5931 }
never executed: }
0
5932 }
executed: }
Execution Count:10982
10982
5933 -
5934 for (;;) { -
5935 if (state == Done) {
evaluated: state == Done
TRUEFALSE
yes
Evaluation Count:8376
yes
Evaluation Count:63893
8376-63893
5936 return true;
executed: return true;
Execution Count:8376
8376
5937 } -
5938 -
5939 if (atEnd()) {
evaluated: atEnd()
TRUEFALSE
yes
Evaluation Count:10982
yes
Evaluation Count:52911
10982-52911
5940 unexpectedEof(&QXmlSimpleReaderPrivate::parseString, state); -
5941 return false;
executed: return false;
Execution Count:10982
10982
5942 } -
5943 if (c == parseString_s[(int)state]) {
evaluated: c == parseString_s[(int)state]
TRUEFALSE
yes
Evaluation Count:52908
yes
Evaluation Count:3
3-52908
5944 input = InpCharExpected; -
5945 } else {
executed: }
Execution Count:52908
52908
5946 input = InpUnknown; -
5947 }
executed: }
Execution Count:3
3
5948 if (input == InpCharExpected) {
evaluated: input == InpCharExpected
TRUEFALSE
yes
Evaluation Count:52908
yes
Evaluation Count:3
3-52908
5949 state++; -
5950 } else {
executed: }
Execution Count:52908
52908
5951 -
5952 reportParseError(QLatin1String("unexpected character")); -
5953 return false;
executed: return false;
Execution Count:3
3
5954 } -
5955 -
5956 next(); -
5957 }
executed: }
Execution Count:52908
52908
5958 return false;
never executed: return false;
0
5959} -
5960bool QXmlSimpleReaderPrivate::insertXmlRef(const QString &data, const QString &name, bool inLiteral) -
5961{ -
5962 if (inLiteral) {
evaluated: inLiteral
TRUEFALSE
yes
Evaluation Count:166
yes
Evaluation Count:2660
166-2660
5963 QString tmp = data; -
5964 xmlRefStack.push(XmlRef(name, tmp.replace(QLatin1Char('\"'), -
5965 QLatin1String("&quot;")).replace(QLatin1Char('\''), QLatin1String("&apos;")))); -
5966 } else {
executed: }
Execution Count:166
166
5967 xmlRefStack.push(XmlRef(name, data)); -
5968 }
executed: }
Execution Count:2660
2660
5969 int n = qMax(parameterEntities.count(), entities.count()); -
5970 if (xmlRefStack.count() > n+1) {
evaluated: xmlRefStack.count() > n+1
TRUEFALSE
yes
Evaluation Count:4
yes
Evaluation Count:2822
4-2822
5971 -
5972 reportParseError(QLatin1String("recursive entities")); -
5973 return false;
executed: return false;
Execution Count:4
4
5974 } -
5975 if (reportEntities && lexicalHnd) {
evaluated: reportEntities
TRUEFALSE
yes
Evaluation Count:2
yes
Evaluation Count:2820
partially evaluated: lexicalHnd
TRUEFALSE
yes
Evaluation Count:2
no
Evaluation Count:0
0-2820
5976 if (!lexicalHnd->startEntity(name)) {
partially evaluated: !lexicalHnd->startEntity(name)
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:2
0-2
5977 reportParseError(lexicalHnd->errorString()); -
5978 return false;
never executed: return false;
0
5979 } -
5980 }
executed: }
Execution Count:2
2
5981 return true;
executed: return true;
Execution Count:2822
2822
5982} -
5983 -
5984 -
5985 -
5986 -
5987void QXmlSimpleReaderPrivate::next() -
5988{ -
5989 int count = xmlRefStack.size(); -
5990 while (count != 0) {
evaluated: count != 0
TRUEFALSE
yes
Evaluation Count:14215
yes
Evaluation Count:3214231
14215-3214231
5991 if (xmlRefStack.top().isEmpty()) {
evaluated: xmlRefStack.top().isEmpty()
TRUEFALSE
yes
Evaluation Count:2798
yes
Evaluation Count:11417
2798-11417
5992 xmlRefStack.pop_back(); -
5993 count--; -
5994 } else {
executed: }
Execution Count:2798
2798
5995 c = xmlRefStack.top().next(); -
5996 return;
executed: return;
Execution Count:11417
11417
5997 } -
5998 } -
5999 -
6000 -
6001 -
6002 ushort uc = c.unicode(); -
6003 c = inputSource->next(); -
6004 -
6005 -
6006 if (c == QXmlInputSource::EndOfData && parseStack == 0)
evaluated: c == QXmlInputSource::EndOfData
TRUEFALSE
yes
Evaluation Count:51383
yes
Evaluation Count:3162848
evaluated: parseStack == 0
TRUEFALSE
yes
Evaluation Count:6475
yes
Evaluation Count:44908
6475-3162848
6007 c = inputSource->next();
executed: c = inputSource->next();
Execution Count:6475
6475
6008 if (uc == '\n') {
evaluated: uc == '\n'
TRUEFALSE
yes
Evaluation Count:81113
yes
Evaluation Count:3133118
81113-3133118
6009 lineNr++; -
6010 columnNr = -1; -
6011 } else if (uc == '\r') {
executed: }
Execution Count:81113
evaluated: uc == '\r'
TRUEFALSE
yes
Evaluation Count:23975
yes
Evaluation Count:3109143
23975-3109143
6012 if (c != QLatin1Char('\n')) {
evaluated: c != QLatin1Char('\n')
TRUEFALSE
yes
Evaluation Count:2548
yes
Evaluation Count:21427
2548-21427
6013 lineNr++; -
6014 columnNr = -1; -
6015 }
executed: }
Execution Count:2548
2548
6016 }
executed: }
Execution Count:23975
23975
6017 ++columnNr; -
6018}
executed: }
Execution Count:3214231
3214231
6019bool QXmlSimpleReaderPrivate::eat_ws() -
6020{ -
6021 while (!atEnd()) {
evaluated: !atEnd()
TRUEFALSE
yes
Evaluation Count:143459
yes
Evaluation Count:10486
10486-143459
6022 if (!is_S(c)) {
evaluated: !is_S(c)
TRUEFALSE
yes
Evaluation Count:82136
yes
Evaluation Count:61323
61323-82136
6023 return true;
executed: return true;
Execution Count:82136
82136
6024 } -
6025 next(); -
6026 }
executed: }
Execution Count:61323
61323
6027 if (parseStack != 0) {
evaluated: parseStack != 0
TRUEFALSE
yes
Evaluation Count:10088
yes
Evaluation Count:398
398-10088
6028 unexpectedEof(&QXmlSimpleReaderPrivate::eat_ws, 0); -
6029 return false;
executed: return false;
Execution Count:10088
10088
6030 } -
6031 return true;
executed: return true;
Execution Count:398
398
6032} -
6033 -
6034bool QXmlSimpleReaderPrivate::next_eat_ws() -
6035{ -
6036 next(); -
6037 return eat_ws();
executed: return eat_ws();
Execution Count:34025
34025
6038} -
6039 -
6040 -
6041 -
6042 -
6043 -
6044 -
6045void QXmlSimpleReaderPrivate::init(const QXmlInputSource *i) -
6046{ -
6047 lineNr = 0; -
6048 columnNr = -1; -
6049 inputSource = const_cast<QXmlInputSource *>(i); -
6050 initData(); -
6051 -
6052 externParameterEntities.clear(); -
6053 parameterEntities.clear(); -
6054 externEntities.clear(); -
6055 entities.clear(); -
6056 -
6057 tags.clear(); -
6058 -
6059 doctype.clear(); -
6060 xmlVersion.clear(); -
6061 encoding.clear(); -
6062 standalone = QXmlSimpleReaderPrivate::Unknown; -
6063 error.clear(); -
6064}
executed: }
Execution Count:2245
2245
6065 -
6066 -
6067 -
6068 -
6069 -
6070void QXmlSimpleReaderPrivate::initData() -
6071{ -
6072 c = QXmlInputSource::EndOfData; -
6073 xmlRefStack.clear(); -
6074 next(); -
6075}
executed: }
Execution Count:47153
47153
6076 -
6077 -
6078 -
6079 -
6080 -
6081bool QXmlSimpleReaderPrivate::entityExist(const QString& e) const -
6082{ -
6083 if ( parameterEntities.find(e) == parameterEntities.end() &&
evaluated: parameterEntities.find(e) == parameterEntities.end()
TRUEFALSE
yes
Evaluation Count:873
yes
Evaluation Count:10
10-873
6084 externParameterEntities.find(e) == externParameterEntities.end() &&
partially evaluated: externParameterEntities.find(e) == externParameterEntities.end()
TRUEFALSE
yes
Evaluation Count:873
no
Evaluation Count:0
0-873
6085 externEntities.find(e) == externEntities.end() &&
partially evaluated: externEntities.find(e) == externEntities.end()
TRUEFALSE
yes
Evaluation Count:873
no
Evaluation Count:0
0-873
6086 entities.find(e) == entities.end()) {
evaluated: entities.find(e) == entities.end()
TRUEFALSE
yes
Evaluation Count:847
yes
Evaluation Count:26
26-847
6087 return false;
executed: return false;
Execution Count:847
847
6088 } else { -
6089 return true;
executed: return true;
Execution Count:36
36
6090 } -
6091} -
6092 -
6093void QXmlSimpleReaderPrivate::reportParseError(const QString& error) -
6094{ -
6095 this->error = error; -
6096 if (errorHnd) {
partially evaluated: errorHnd
TRUEFALSE
yes
Evaluation Count:158
no
Evaluation Count:0
0-158
6097 if (this->error.isNull()) {
partially evaluated: this->error.isNull()
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:158
0-158
6098 const QXmlParseException ex(QLatin1String("no error occurred"), columnNr+1, lineNr+1, -
6099 thisPublicId, thisSystemId); -
6100 errorHnd->fatalError(ex); -
6101 } else {
never executed: }
0
6102 const QXmlParseException ex(this->error, columnNr+1, lineNr+1, -
6103 thisPublicId, thisSystemId); -
6104 errorHnd->fatalError(ex); -
6105 }
executed: }
Execution Count:158
158
6106 } -
6107}
executed: }
Execution Count:158
158
6108 -
6109 -
6110 -
6111 -
6112 -
6113 -
6114 -
6115void QXmlSimpleReaderPrivate::unexpectedEof(ParseFunction where, int state) -
6116{ -
6117 if (parseStack == 0) {
evaluated: parseStack == 0
TRUEFALSE
yes
Evaluation Count:12
yes
Evaluation Count:44467
12-44467
6118 reportParseError(QLatin1String("unexpected end of file")); -
6119 } else {
executed: }
Execution Count:12
12
6120 if (c == QXmlInputSource::EndOfDocument) {
partially evaluated: c == QXmlInputSource::EndOfDocument
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:44467
0-44467
6121 reportParseError(QLatin1String("unexpected end of file")); -
6122 } else {
never executed: }
0
6123 pushParseState(where, state); -
6124 }
executed: }
Execution Count:44467
44467
6125 } -
6126} -
6127void QXmlSimpleReaderPrivate::parseFailed(ParseFunction where, int state) -
6128{ -
6129 if (parseStack!=0 && error.isNull()) {
evaluated: parseStack!=0
TRUEFALSE
yes
Evaluation Count:111660
yes
Evaluation Count:331
partially evaluated: error.isNull()
TRUEFALSE
yes
Evaluation Count:111660
no
Evaluation Count:0
0-111660
6130 pushParseState(where, state); -
6131 }
executed: }
Execution Count:111660
111660
6132}
executed: }
Execution Count:111991
111991
6133void QXmlSimpleReaderPrivate::pushParseState(ParseFunction function, int state) -
6134{ -
6135 QXmlSimpleReaderPrivate::ParseState ps; -
6136 ps.function = function; -
6137 ps.state = state; -
6138 parseStack->push(ps); -
6139}
executed: }
Execution Count:201035
201035
6140 -
6141inline static void updateValue(QString &value, const QChar *array, int &arrayPos, int &valueLen) -
6142{ -
6143 value.resize(valueLen + arrayPos); -
6144 memcpy(value.data() + valueLen, array, arrayPos * sizeof(QChar)); -
6145 valueLen += arrayPos; -
6146 arrayPos = 0; -
6147}
executed: }
Execution Count:287706
287706
6148 -
6149 -
6150const QString& QXmlSimpleReaderPrivate::string() -
6151{ -
6152 updateValue(stringValue, stringArray, stringArrayPos, stringValueLen); -
6153 return stringValue;
executed: return stringValue;
Execution Count:148829
148829
6154} -
6155const QString& QXmlSimpleReaderPrivate::name() -
6156{ -
6157 updateValue(nameValue, nameArray, nameArrayPos, nameValueLen); -
6158 return nameValue;
executed: return nameValue;
Execution Count:119204
119204
6159} -
6160const QString& QXmlSimpleReaderPrivate::ref() -
6161{ -
6162 updateValue(refValue, refArray, refArrayPos, refValueLen); -
6163 return refValue;
executed: return refValue;
Execution Count:17665
17665
6164} -
6165 -
6166void QXmlSimpleReaderPrivate::stringAddC(QChar ch) -
6167{ -
6168 if (stringArrayPos == 256)
evaluated: stringArrayPos == 256
TRUEFALSE
yes
Evaluation Count:2008
yes
Evaluation Count:2189263
2008-2189263
6169 updateValue(stringValue, stringArray, stringArrayPos, stringValueLen);
executed: updateValue(stringValue, stringArray, stringArrayPos, stringValueLen);
Execution Count:2008
2008
6170 stringArray[stringArrayPos++] = ch; -
6171}
executed: }
Execution Count:2191271
2191271
6172void QXmlSimpleReaderPrivate::nameAddC(QChar ch) -
6173{ -
6174 if (nameArrayPos == 256)
partially evaluated: nameArrayPos == 256
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:448708
0-448708
6175 updateValue(nameValue, nameArray, nameArrayPos, nameValueLen);
never executed: updateValue(nameValue, nameArray, nameArrayPos, nameValueLen);
0
6176 nameArray[nameArrayPos++] = ch; -
6177}
executed: }
Execution Count:448708
448708
6178void QXmlSimpleReaderPrivate::refAddC(QChar ch) -
6179{ -
6180 if (refArrayPos == 256)
partially evaluated: refArrayPos == 256
TRUEFALSE
no
Evaluation Count:0
yes
Evaluation Count:37949
0-37949
6181 updateValue(refValue, refArray, refArrayPos, refValueLen);
never executed: updateValue(refValue, refArray, refArrayPos, refValueLen);
0
6182 refArray[refArrayPos++] = ch; -
6183}
executed: }
Execution Count:37949
37949
6184 -
6185 -
Switch to Source codePreprocessed file

Generated by Squish Coco Non-Commercial