📄 qxmlstream.g
字号:
resume($rule_number); return false; } break;./element_decl ::= element_decl_start content_spec space_opt RANGLE;content_spec ::= EMPTY | ANY | mixed | children;pcdata_start ::= HASH;/. case $rule_number: if (!scanString(spell[PCDATA], PCDATA, false) && atEnd) { resume($rule_number); return false; } break;./pcdata ::= pcdata_start PCDATA;questionmark_or_star_or_plus_opt ::= QUESTIONMARK | STAR | PLUS;questionmark_or_star_or_plus_opt ::=;cp ::= name questionmark_or_star_or_plus_opt | choice_or_seq questionmark_or_star_or_plus_opt;cp_pipe_or_comma_list ::= cp space_opt;cp_pipe_or_comma_list ::= cp space_opt PIPE space_opt cp_pipe_list space_opt;cp_pipe_or_comma_list ::= cp space_opt COMMA space_opt cp_comma_list space_opt;cp_pipe_list ::= cp | cp_pipe_list space_opt PIPE space_opt cp;cp_comma_list ::= cp | cp_comma_list space_opt COMMA space_opt cp;name_pipe_list ::= PIPE space_opt name;name_pipe_list ::= name_pipe_list space_opt PIPE space_opt name;star_opt ::= | STAR;mixed ::= LPAREN space_opt pcdata space_opt RPAREN star_opt;mixed ::= LPAREN space_opt pcdata space_opt name_pipe_list space_opt RPAREN STAR;choice_or_seq ::= LPAREN space_opt cp_pipe_or_comma_list RPAREN;children ::= choice_or_seq questionmark_or_star_or_plus_opt;nmtoken_pipe_list ::= nmtoken;nmtoken_pipe_list ::= nmtoken_pipe_list space_opt PIPE space_opt nmtoken;att_type ::= CDATA;/. case $rule_number: { lastAttributeIsCData = true; } break;./att_type ::= ID | IDREF | IDREFS | ENTITY | ENTITIES | NMTOKEN | NMTOKENS;att_type ::= LPAREN space_opt nmtoken_pipe_list space_opt RPAREN space;att_type ::= NOTATION LPAREN space_opt nmtoken_pipe_list space_opt RPAREN space;default_declhash ::= HASH;/. case $rule_number: if (!scanAfterDefaultDecl() && atEnd) { resume($rule_number); return false; } break;./default_decl ::= default_declhash REQUIRED;default_decl ::= default_declhash IMPLIED;default_decl ::= attribute_value;default_decl ::= default_declhash FIXED space attribute_value;attdef_start ::= space qname space;/. case $rule_number: sym(1) = sym(2); lastAttributeValue.clear(); lastAttributeIsCData = false; if (!scanAttType() && atEnd) { resume($rule_number); return false; } break;./attdef ::= attdef_start att_type default_decl;/. case $rule_number: { DtdAttribute &dtdAttribute = dtdAttributes.push(); dtdAttribute.tagName.clear(); dtdAttribute.isCDATA = lastAttributeIsCData; dtdAttribute.attributePrefix = addToStringStorage(symPrefix(1)); dtdAttribute.attributeName = addToStringStorage(symString(1)); dtdAttribute.attributeQualifiedName = addToStringStorage(symName(1)); if (lastAttributeValue.isNull()) { dtdAttribute.defaultValue.clear(); } else { if (dtdAttribute.isCDATA) dtdAttribute.defaultValue = addToStringStorage(lastAttributeValue); else dtdAttribute.defaultValue = addToStringStorage(lastAttributeValue.toString().simplified()); } } break;./attdef_list ::= attdef;attdef_list ::= attdef_list attdef;attlist_decl ::= langle_bang ATTLIST qname space_opt RANGLE;attlist_decl ::= langle_bang ATTLIST qname attdef_list space_opt RANGLE;/. case $rule_number: { if (referenceToUnparsedEntityDetected && !standalone) break; int n = dtdAttributes.size(); QStringRef tagName = addToStringStorage(symString(3)); while (n--) { DtdAttribute &dtdAttribute = dtdAttributes[n]; if (!dtdAttribute.tagName.isNull()) break; dtdAttribute.tagName = tagName; for (int i = 0; i < n; ++i) { if ((dtdAttributes[i].tagName.isNull() || dtdAttributes[i].tagName == tagName) && dtdAttributes[i].attributeQualifiedName == dtdAttribute.attributeQualifiedName) { dtdAttribute.attributeQualifiedName.clear(); // redefined, delete it break; } } } } break;./entity_decl_start ::= langle_bang ENTITY name space;/. case $rule_number: { if (!scanPublicOrSystem() && atEnd) { resume($rule_number); return false; } EntityDeclaration &entityDeclaration = entityDeclarations.push(); entityDeclaration.clear(); entityDeclaration.name = symString(3); } break;./entity_decl_start ::= langle_bang ENTITY PERCENT space name space;/. case $rule_number: { if (!scanPublicOrSystem() && atEnd) { resume($rule_number); return false; } EntityDeclaration &entityDeclaration = entityDeclarations.push(); entityDeclaration.clear(); entityDeclaration.name = symString(5); entityDeclaration.parameter = true; } break;./entity_decl_external ::= entity_decl_start SYSTEM literal;/. case $rule_number: { if (!scanNData() && atEnd) { resume($rule_number); return false; } EntityDeclaration &entityDeclaration = entityDeclarations.top(); entityDeclaration.systemId = symString(3); entityDeclaration.external = true; } break;./entity_decl_external ::= entity_decl_start PUBLIC public_literal space literal;/. case $rule_number: { if (!scanNData() && atEnd) { resume($rule_number); return false; } EntityDeclaration &entityDeclaration = entityDeclarations.top(); checkPublicLiteral((entityDeclaration.publicId = symString(3))); entityDeclaration.systemId = symString(5); entityDeclaration.external = true; } break;./entity_decl ::= entity_decl_external NDATA name space_opt RANGLE;/. case $rule_number: { EntityDeclaration &entityDeclaration = entityDeclarations.top(); entityDeclaration.notationName = symString(3); if (entityDeclaration.parameter) raiseWellFormedError(QXmlStream::tr("NDATA in parameter entity declaration.")); } //fall through./entity_decl ::= entity_decl_external space_opt RANGLE;/. case $rule_number:./entity_decl ::= entity_decl_start entity_value space_opt RANGLE;/. case $rule_number: { if (referenceToUnparsedEntityDetected && !standalone) { entityDeclarations.pop(); break; } EntityDeclaration &entityDeclaration = entityDeclarations.top(); if (!entityDeclaration.external) entityDeclaration.value = symString(2); QString entityName = entityDeclaration.name.toString(); QHash<QString, Entity> &hash = entityDeclaration.parameter ? parameterEntityHash : entityHash; if (!hash.contains(entityName)) { Entity entity(entityDeclaration.value.toString()); entity.unparsed = (!entityDeclaration.notationName.isNull()); entity.external = entityDeclaration.external; hash.insert(entityName, entity); } } break;./processing_instruction ::= LANGLE QUESTIONMARK name space;/. case $rule_number: { setType(QXmlStreamReader::ProcessingInstruction); int pos = sym(4).pos + sym(4).len; processingInstructionTarget = symString(3); if (scanUntil("?>")) { processingInstructionData = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 2); const QString piTarget(processingInstructionTarget.toString()); if (!piTarget.compare(QLatin1String("xml"), Qt::CaseInsensitive)) { raiseWellFormedError(QXmlStream::tr("XML declaration not at start of document.")); } else if(!QXmlUtils::isNCName(piTarget)) raiseWellFormedError(QXmlStream::tr("%1 is an invalid processing instruction name.").arg(piTarget)); } else if (type != QXmlStreamReader::Invalid){ resume($rule_number); return false; } } break;./processing_instruction ::= LANGLE QUESTIONMARK name QUESTIONMARK RANGLE;/. case $rule_number: setType(QXmlStreamReader::ProcessingInstruction); processingInstructionTarget = symString(3); if (!processingInstructionTarget.toString().compare(QLatin1String("xml"), Qt::CaseInsensitive)) raiseWellFormedError(QXmlStream::tr("Invalid processing instruction name.")); break;./langle_bang ::= LANGLE BANG;/. case $rule_number: if (!scanAfterLangleBang() && atEnd) { resume($rule_number); return false; } break;./comment_start ::= langle_bang DASH DASH;/. case $rule_number: if (!scanUntil("--")) { resume($rule_number); return false; } break;./comment ::= comment_start RANGLE;/. case $rule_number: { setType(QXmlStreamReader::Comment); int pos = sym(1).pos + 4; text = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 3); } break;./cdata ::= langle_bang CDATA_START;/. case $rule_number: { setType(QXmlStreamReader::Characters); isCDATA = true; int pos = sym(2).pos; if (scanUntil("]]>", -1)) { text = QStringRef(&textBuffer, pos, textBuffer.size() - pos - 3); } else { resume($rule_number); return false; } } break;./notation_decl_start ::= langle_bang NOTATION name space;/. case $rule_number: { if (!scanPublicOrSystem() && atEnd) { resume($rule_number); return false; } NotationDeclaration ¬ationDeclaration = notationDeclarations.push(); notationDeclaration.name = symString(3); } break;./notation_decl ::= notation_decl_start SYSTEM literal space_opt RANGLE;/. case $rule_number: { NotationDeclaration ¬ationDeclaration = notationDeclarations.top(); notationDeclaration.systemId = symString(3); notationDeclaration.publicId.clear(); } break;./notation_decl ::= notation_decl_start PUBLIC public_literal space_opt RANGLE;/. case $rule_number: { NotationDeclaration ¬ationDeclaration = notationDeclarations.top(); notationDeclaration.systemId.clear(); checkPublicLiteral((notationDeclaration.publicId = symString(3))); } break;./notation_decl ::= notation_decl_start PUBLIC public_literal space literal space_opt RANGLE;/. case $rule_number: { NotationDeclaration ¬ationDeclaration = notationDeclarations.top(); checkPublicLiteral((notationDeclaration.publicId = symString(3))); notationDeclaration.systemId = symString(5); } break;./content_char ::= RANGLE | HASH | LBRACK | RBRACK | LPAREN | RPAREN | PIPE | EQ | PERCENT | SLASH | COLON | SEMICOLON | COMMA | DASH | PLUS | STAR | DOT | QUESTIONMARK | BANG | QUOTE | DBLQUOTE;content_char_list ::= SPACE;/. case $rule_number: isWhitespace = true; // fall through./content_char_list ::= LETTER;/. case $rule_number:./content_char_list ::= DIGIT;/. case $rule_number:./content_char_list ::= content_char;/. case $rule_number: setType(QXmlStreamReader::Characters); sym(1).len += fastScanContentCharList(); if (atEnd && !inParseEntity) { resume($rule_number); return false; } text = &textBuffer; break;./literal ::= QUOTE QUOTE;/. case $rule_number:./literal ::= DBLQUOTE DBLQUOTE;/. case $rule_number: clearSym(); break;./literal ::= QUOTE literal_content_with_dblquote QUOTE;/. case $rule_number:./literal ::= DBLQUOTE literal_content_with_quote DBLQUOTE;/. case $rule_number: sym(1) = sym(2); break;./literal_content_with_dblquote ::= literal_content_with_dblquote literal_content;/. case $rule_number:./literal_content_with_quote ::= literal_content_with_quote literal_content;/. case $rule_number:./literal_content_with_dblquote ::= literal_content_with_dblquote DBLQUOTE;/. case $rule_number:./literal_content_with_quote ::= literal_content_with_quote QUOTE;/. case $rule_number: sym(1).len += sym(2).len; break;./literal_content_with_dblquote ::= literal_content;literal_content_with_quote ::= literal_content;literal_content_with_dblquote ::= DBLQUOTE;literal_content_with_quote ::= QUOTE;literal_content_start ::= LETTER | DIGIT | RANGLE | HASH | LBRACK | RBRACK | LPAREN | RPAREN | PIPE | EQ | PERCENT | SLASH | COLON | SEMICOLON | COMMA | DASH | PLUS | STAR | DOT | QUESTIONMARK | BANG;literal_content_start ::= SPACE;/. case $rule_number: if (normalizeLiterals) textBuffer.data()[textBuffer.size()-1] = QLatin1Char(' '); break;./literal_content ::= literal_content_start;/. case $rule_number: sym(1).len += fastScanLiteralContent(); if (atEnd) { resume($rule_number); return false; } break;./public_literal ::= literal;/. case $rule_number: {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -