diff options
Diffstat (limited to 'quanta/parsers/saparser.cpp')
-rw-r--r-- | quanta/parsers/saparser.cpp | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/quanta/parsers/saparser.cpp b/quanta/parsers/saparser.cpp index f402e0c8..e562d47b 100644 --- a/quanta/parsers/saparser.cpp +++ b/quanta/parsers/saparser.cpp @@ -86,29 +86,29 @@ bool SAParser::slotParseOneLine() //search for different s_contexts if (s_searchContent) //search for quoted strings, comments, groups only in non-comment special areas { - quotedStringPos = s_textLine.find(m_quotesRx, s_col); //quoted strings + quotedStringPos = s_textLine.tqfind(m_quotesRx, s_col); //quoted strings s_searchedString = s_textLine.left(quotedStringPos); - commentPos = s_searchedString.find(s_dtd->commentsStartRx, s_col); //comments + commentPos = s_searchedString.tqfind(s_dtd->commentsStartRx, s_col); //comments s_searchedString = s_textLine.left(commentPos); if (s_fullParse) - groupKeywordPos = s_searchedString.find(s_dtd->structRx, s_col); //groups, like { } + groupKeywordPos = s_searchedString.tqfind(s_dtd->structRx, s_col); //groups, like { } } else s_searchedString = s_textLine; int specialAreaPos = -1; if (s_searchForSpecialAreas) //special area inside special area { s_searchedString = s_textLine.left(groupKeywordPos); - specialAreaPos = s_searchedString.find(s_dtd->specialAreaStartRx, s_col); + specialAreaPos = s_searchedString.tqfind(s_dtd->specialAreaStartRx, s_col); } if (s_searchForAreaEnd) //the end of the special area { s_searchedString = s_textLine.left(specialAreaPos); - areaEndPos = s_searchedString.find(s_areaEndString, s_col); + areaEndPos = s_searchedString.tqfind(s_areaEndString, s_col); } else if (s_searchForForcedAreaEnd) //the end of the special area if a forcing string was specified { s_searchedString = s_textLine.left(specialAreaPos); - areaEndPos = s_searchedString.find(s_forcedAreaRx, s_col); + areaEndPos = s_searchedString.tqfind(s_forcedAreaRx, s_col); if (areaEndPos != -1) s_areaEndString = s_forcedAreaRx.cap(); } @@ -157,7 +157,7 @@ bool SAParser::slotParseOneLine() s_currentNode->tag->type == Tag::Empty) ) ParserCommon::appendAreaToTextNode(m_write, s_currentContext.area, s_currentNode); else - s_currentNode = ParserCommon::createTextNode(m_write, s_currentNode, s_line, s_currentContext.area.eCol + 1, s_currentContext.parentNode); + s_currentNode = ParserCommon::createTextNode(m_write, s_currentNode, s_line, s_currentContext.area.eCol + 1, s_currentContext.tqparentNode); s_currentNode->tag->type = Tag::ScriptStructureBegin; s_currentNode->tag->single = false; @@ -166,7 +166,7 @@ bool SAParser::slotParseOneLine() s_currentContext.lastNode = s_currentNode; s_contextStack.push(s_currentContext); - s_currentContext.parentNode = s_currentNode; + s_currentContext.tqparentNode = s_currentNode; s_col = s_context.area.bCol + s_context.startString.length(); s_currentContext.area.bLine = s_line; s_currentContext.area.bCol = s_col; @@ -201,21 +201,21 @@ bool SAParser::slotParseOneLine() } s_currentContext.area.eLine = s_line; s_currentContext.area.eCol = groupKeywordPos - 1; - //kdDebug(24000) << TQString("Group Struct s_context: %1, %2, %3, %4").arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; + //kdDebug(24000) << TQString("Group Struct s_context: %1, %2, %3, %4").tqarg( s_currentContext.bLine).tqarg(s_currentContext.bCol).tqarg(s_currentContext.eLine).tqarg(s_currentContext.eCol) << endl; if (s_currentNode && (s_currentNode->tag->type == Tag::Text || s_currentNode->tag->type == Tag::Empty) ) ParserCommon::appendAreaToTextNode(m_write, s_currentContext.area, s_currentNode); else - s_currentNode = ParserCommon::createTextNode(m_write, s_currentNode, s_line, groupKeywordPos, s_currentContext.parentNode); + s_currentNode = ParserCommon::createTextNode(m_write, s_currentNode, s_line, groupKeywordPos, s_currentContext.tqparentNode); if (s_currentNode) { s_currentNode->insideSpecial = true; s_currentNode->specialInsideXml = m_specialInsideXml; } s_previousContext = s_contextStack.pop(); - s_currentContext.parentNode = s_previousContext.parentNode; + s_currentContext.tqparentNode = s_previousContext.tqparentNode; s_currentContext.lastNode = s_previousContext.lastNode; s_currentContext.type = s_previousContext.type; s_currentContext.area.bLine = s_line; @@ -232,14 +232,14 @@ bool SAParser::slotParseOneLine() tag->setDtd(s_dtd); tag->type = Tag::ScriptStructureEnd; tag->single = true; - Node *node = new Node(s_currentContext.parentNode); + Node *node = new Node(s_currentContext.tqparentNode); nodeNum++; node->tag = tag; node->insideSpecial = true; node->specialInsideXml = m_specialInsideXml; - if (s_currentContext.parentNode && !s_currentContext.parentNode->child) + if (s_currentContext.tqparentNode && !s_currentContext.tqparentNode->child) { - s_currentContext.parentNode->child = node; + s_currentContext.tqparentNode->child = node; } else if (s_currentContext.lastNode) { @@ -275,7 +275,7 @@ bool SAParser::slotParseOneLine() s_currentNode->tag->type == Tag::Empty) ) ParserCommon::appendAreaToTextNode(m_write, s_currentContext.area, s_currentNode); else - s_currentNode = ParserCommon::createTextNode(m_write, s_currentNode, s_line, specialAreaPos, s_currentContext.parentNode); + s_currentNode = ParserCommon::createTextNode(m_write, s_currentNode, s_line, specialAreaPos, s_currentContext.tqparentNode); if (s_currentNode) { s_currentNode->insideSpecial = true; @@ -284,7 +284,7 @@ bool SAParser::slotParseOneLine() } //create a toplevel node for the included special area AreaStruct area(s_line, specialAreaPos, s_line, specialAreaPos + foundText.length() - 1); - Node *node = ParserCommon::createScriptTagNode(m_write, area, foundText, s_dtd, s_currentContext.parentNode, s_currentNode); + Node *node = ParserCommon::createScriptTagNode(m_write, area, foundText, s_dtd, s_currentContext.tqparentNode, s_currentNode); #ifdef DEBUG_PARSER kdDebug(24001) << "Parsing a nested area." << endl; #endif @@ -316,11 +316,11 @@ bool SAParser::slotParseOneLine() } else //when we look only for the area end string if (s_searchForAreaEnd) { - areaEndPos = s_textLine.find(s_areaEndString, s_col); + areaEndPos = s_textLine.tqfind(s_areaEndString, s_col); } else if (s_searchForForcedAreaEnd) { - areaEndPos = s_textLine.find(s_forcedAreaRx, s_col); + areaEndPos = s_textLine.tqfind(s_forcedAreaRx, s_col); if (areaEndPos != -1) s_areaEndString = s_forcedAreaRx.cap(); } @@ -351,7 +351,7 @@ bool SAParser::slotParseOneLine() s_currentNode->specialInsideXml = m_specialInsideXml; } } - //kdDebug(24000) << TQString("Special area %1 ends at %2, %3").arg(s_dtd->name).arg(s_line).arg(lastCol) << endl; + //kdDebug(24000) << TQString("Special area %1 ends at %2, %3").tqarg(s_dtd->name).tqarg(s_line).tqarg(lastCol) << endl; //create a closing node for the special area Tag *tag = new Tag(); @@ -363,7 +363,7 @@ bool SAParser::slotParseOneLine() tag->single = true; //at this point s_parentNode = the opening node of the special area (eg. <?) //and it should always exist - Node *node = new Node(s_parentNode->parent); + Node *node = new Node(s_parentNode->tqparent); nodeNum++; s_parentNode->next = node; node->prev = s_parentNode; @@ -419,10 +419,10 @@ bool SAParser::slotParseOneLine() { s_context.area.bLine = s_line; s_context.area.eLine = s_context.area.eCol = -1; - s_context.parentNode = s_currentContext.parentNode; + s_context.tqparentNode = s_currentContext.tqparentNode; s_currentContext.area.eLine = s_context.area.bLine; s_currentContext.area.eCol = s_context.area.bCol - 1; - // s_currentContext.parentNode = s_parentNode; + // s_currentContext.tqparentNode = s_parentNode; s_contextStack.push(s_currentContext); if (s_fullParse) { @@ -451,14 +451,14 @@ bool SAParser::slotParseOneLine() } tag->single = true; //create a node with the above tag - Node *node = new Node(s_currentContext.parentNode); + Node *node = new Node(s_currentContext.tqparentNode); nodeNum++; node->tag = tag; node->insideSpecial = true; node->specialInsideXml = m_specialInsideXml; - if (s_currentContext.parentNode && !s_currentContext.parentNode->child) + if (s_currentContext.tqparentNode && !s_currentContext.tqparentNode->child) { - s_currentContext.parentNode->child = node; + s_currentContext.tqparentNode->child = node; } else if (s_currentNode) { @@ -468,7 +468,7 @@ bool SAParser::slotParseOneLine() s_currentNode = node; } } - //kdDebug(24000) << TQString("%1 s_context: %2, %3, %4, %5").arg(s_currentContext.type).arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; + //kdDebug(24000) << TQString("%1 s_context: %2, %3, %4, %5").tqarg(s_currentContext.type).tqarg( s_currentContext.bLine).tqarg(s_currentContext.bCol).tqarg(s_currentContext.eLine).tqarg(s_currentContext.eCol) << endl; s_currentContext = s_context; s_col = s_context.area.bCol + s_context.startString.length(); @@ -487,7 +487,7 @@ bool SAParser::slotParseOneLine() int l = s_textLine.length(); while (p < l) { - p = s_textLine.find(s_currentContext.startString, p); + p = s_textLine.tqfind(s_currentContext.startString, p); if (p != -1) { if (p >= 0) @@ -514,7 +514,7 @@ bool SAParser::slotParseOneLine() // if (pos != 0) pos++; s_currentContext.area.eLine = s_line; s_currentContext.area.eCol = pos; - //kdDebug(24000) << TQString("Quoted String s_context: %1, %2, %3, %4").arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; + //kdDebug(24000) << TQString("Quoted String s_context: %1, %2, %3, %4").tqarg( s_currentContext.bLine).tqarg(s_currentContext.bCol).tqarg(s_currentContext.eLine).tqarg(s_currentContext.eCol) << endl; if (s_fullParse) { if ( s_currentNode && @@ -522,12 +522,12 @@ bool SAParser::slotParseOneLine() s_currentNode->tag->type == Tag::Empty) ) ParserCommon::appendAreaToTextNode(m_write, s_currentContext.area, s_currentNode); else - s_currentNode = ParserCommon::createTextNode(m_write, 0L, s_line, pos, s_currentContext.parentNode); + s_currentNode = ParserCommon::createTextNode(m_write, 0L, s_line, pos, s_currentContext.tqparentNode); s_currentNode->insideSpecial = true; s_currentNode->specialInsideXml = m_specialInsideXml; } s_previousContext = s_contextStack.pop(); - s_currentContext.parentNode = s_previousContext.parentNode; + s_currentContext.tqparentNode = s_previousContext.tqparentNode; s_currentContext.type = s_previousContext.type; s_currentContext.area.bLine = s_line; s_currentContext.area.bCol = pos + 1; @@ -544,10 +544,10 @@ bool SAParser::slotParseOneLine() } case Comment: { - int pos = s_textLine.find(s_dtd->comments[s_currentContext.startString], s_col); + int pos = s_textLine.tqfind(s_dtd->comments[s_currentContext.startString], s_col); if (pos == -1 && s_dtd->comments[s_currentContext.startString] == "\n") { - int pos2 = s_textLine.find(s_areaEndString, s_col); + int pos2 = s_textLine.tqfind(s_areaEndString, s_col); if (pos2 != -1) { pos = pos2 - 1; @@ -561,7 +561,7 @@ bool SAParser::slotParseOneLine() s_currentContext.area.eLine = s_line; s_currentContext.area.eCol = pos + s_dtd->comments[s_currentContext.startString].length() - 1; s_currentContext.type = s_previousContext.type; - //kdDebug(24000) << TQString("Comment s_context: %1, %2, %3, %4").arg( s_currentContext.bLine).arg(s_currentContext.bCol).arg(s_currentContext.eLine).arg(s_currentContext.eCol) << endl; + //kdDebug(24000) << TQString("Comment s_context: %1, %2, %3, %4").tqarg( s_currentContext.bLine).tqarg(s_currentContext.bCol).tqarg(s_currentContext.eLine).tqarg(s_currentContext.eCol) << endl; if (s_fullParse) { @@ -570,22 +570,22 @@ bool SAParser::slotParseOneLine() tag->type = Tag::Comment; tag->single = true; //create a node with the above tag - Node *node = new Node(s_currentContext.parentNode); + Node *node = new Node(s_currentContext.tqparentNode); nodeNum++; node->tag = tag; node->insideSpecial = true; node->specialInsideXml = m_specialInsideXml; - if (s_currentNode && s_currentNode != node->parent) + if (s_currentNode && s_currentNode != node->tqparent) { s_currentNode->next = node; node->prev = s_currentNode; } else - if (node->parent && !node->parent->child) - node->parent->child = node; + if (node->tqparent && !node->tqparent->child) + node->tqparent->child = node; s_currentNode = node; } s_previousContext = s_contextStack.pop(); - s_currentContext.parentNode = s_previousContext.parentNode; + s_currentContext.tqparentNode = s_previousContext.tqparentNode; s_currentContext.type = s_previousContext.type; s_currentContext.area.bLine = s_line; s_currentContext.area.bCol = s_currentContext.area.eCol + 1; @@ -635,11 +635,11 @@ bool SAParser::slotParseOneLine() Node* SAParser::parseArea(const AreaStruct &specialArea, const TQString &areaStartString, const TQString &forcedAreaEndString, - Node *parentNode, + Node *tqparentNode, bool fullParse, bool synchronous) { m_synchronous = synchronous; - s_parentNode = parentNode; + s_parentNode = tqparentNode; s_fullParse = fullParse; #ifdef DEBUG_PARSER kdDebug(24001) << "parseArea full: " << s_fullParse << " synch: " << m_synchronous <<endl; @@ -649,18 +649,18 @@ Node* SAParser::parseArea(const AreaStruct &specialArea, int s_startCol = specialArea.bCol; s_endLine = specialArea.eLine; s_endCol = specialArea.eCol; - //kdDebug(24000) << TQString("Starting to parse at %1, %2 for %3").arg(s_startLine).arg(s_startCol).arg(areaStartString) << endl; + //kdDebug(24000) << TQString("Starting to parse at %1, %2 for %3").tqarg(s_startLine).tqarg(s_startCol).tqarg(areaStartString) << endl; s_searchForAreaEnd = false; s_searchForForcedAreaEnd = false; s_dtd = 0L; if (s_parentNode && !areaStartString.isEmpty()) { - const DTDStruct *parentDTD = m_dtd; - if (s_parentNode->parent) - parentDTD = s_parentNode->parent->tag->dtd(); - s_dtd = DTDs::ref()->find(parentDTD->specialAreaNames[areaStartString]); - s_areaEndString = parentDTD->specialAreas[areaStartString]; + const DTDStruct *tqparentDTD = m_dtd; + if (s_parentNode->tqparent) + tqparentDTD = s_parentNode->tqparent->tag->dtd(); + s_dtd = DTDs::ref()->tqfind(tqparentDTD->specialAreaNames[areaStartString]); + s_areaEndString = tqparentDTD->specialAreas[areaStartString]; s_searchForAreaEnd = true; } if (!forcedAreaEndString.isEmpty()) @@ -702,7 +702,7 @@ Node* SAParser::parseArea(const AreaStruct &specialArea, s_currentContext.area.bLine = s_line; s_currentContext.area.bCol = s_col; s_currentContext.area.eLine = s_currentContext.area.eCol = -1; - s_currentContext.parentNode = s_parentNode; + s_currentContext.tqparentNode = s_parentNode; s_currentNode = s_parentNode; m_lastParsedNode = 0L; s_useReturnVars = false; |