diff options
author | David Boddie <david.boddie@nokia.com> | 2010-12-01 11:30:19 (GMT) |
---|---|---|
committer | David Boddie <david.boddie@nokia.com> | 2010-12-01 11:30:19 (GMT) |
commit | d877b3d3b34d4f5c6f9683c54d54e54a37a39998 (patch) | |
tree | 87bd5958b636d52fb442b874965e6fe772a116ab /tools | |
parent | 76152172c04a40dc9e27423ec092f23da4d628dc (diff) | |
download | Qt-d877b3d3b34d4f5c6f9683c54d54e54a37a39998.zip Qt-d877b3d3b34d4f5c6f9683c54d54e54a37a39998.tar.gz Qt-d877b3d3b34d4f5c6f9683c54d54e54a37a39998.tar.bz2 |
Fixed/adjusted handling of UiPublicMember nodes.
Removed debugging code.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qdoc3/qmlmarkupvisitor.cpp | 202 | ||||
-rw-r--r-- | tools/qdoc3/qmlmarkupvisitor.h | 2 |
2 files changed, 5 insertions, 199 deletions
diff --git a/tools/qdoc3/qmlmarkupvisitor.cpp b/tools/qdoc3/qmlmarkupvisitor.cpp index 387b562..6335ab6 100644 --- a/tools/qdoc3/qmlmarkupvisitor.cpp +++ b/tools/qdoc3/qmlmarkupvisitor.cpp @@ -56,7 +56,6 @@ QmlMarkupVisitor::QmlMarkupVisitor(const QString &source, QDeclarativeJS::Engine indent = 0; cursor = 0; commentIndex = 0; - QString("Comments %1\n").arg(engine->comments().length()); } QmlMarkupVisitor::~QmlMarkupVisitor() @@ -90,7 +89,7 @@ QString QmlMarkupVisitor::protect(const QString& str) QString QmlMarkupVisitor::markedUpCode() { - if (cursor < source.length()) + if (int(cursor) < source.length()) addExtra(cursor, source.length()); return output; @@ -184,36 +183,22 @@ void QmlMarkupVisitor::addVerbatim(QDeclarativeJS::AST::SourceLocation first, return; QString text = source.mid(start, finish - start); - write(text); indent -= 1; output += protect(text); cursor = finish; } -void QmlMarkupVisitor::write(const QString &text) -{ - indent += 1; -} - -void QmlMarkupVisitor::endWrite(const QString &text) -{ - indent -= 1; -} - bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiProgram *) { - write("<UiProgram>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiProgram *) { - endWrite("<UiProgram>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImport *uiimport) { - write("<UiImport>"); addVerbatim(uiimport->importToken); if (!uiimport->importUri) addMarkedUpToken(uiimport->fileNameToken, QLatin1String("headerfile")); @@ -222,17 +207,14 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImport *uiimport) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiImport *uiimport) { - endWrite("<UiImport>"); addVerbatim(uiimport->versionToken); addVerbatim(uiimport->asToken); addMarkedUpToken(uiimport->importIdToken, QLatin1String("headerfile")); addVerbatim(uiimport->semicolonToken); - //endWrite("<UiImport>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member) { - write("<UiPublicMember>"); if (member->type == QDeclarativeJS::AST::UiPublicMember::Property) { addVerbatim(member->defaultToken); addVerbatim(member->readonlyToken); @@ -241,7 +223,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member) addMarkedUpToken(member->typeToken, QLatin1String("type")); addMarkedUpToken(member->identifierToken, QLatin1String("name")); addVerbatim(member->colonToken); - QDeclarativeJS::AST::Node::accept(member->binding, this); + if (member->binding) + QDeclarativeJS::AST::Node::accept(member->binding, this); + else if (member->expression) + QDeclarativeJS::AST::Node::accept(member->expression, this); } else { addVerbatim(member->propertyToken); addVerbatim(member->typeModifierToken); @@ -255,47 +240,39 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiPublicMember *member) { - endWrite("<UiPublicMember>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSourceElement *) { - write("<UiSourceElement>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiSourceElement *) { - endWrite("<UiSourceElement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiParameterList *) { - write("<UiParameterList>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiParameterList *) { - endWrite("<UiParameterList>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectInitializer *initializer) { - write("<UiObjectInitializer>"); addVerbatim(initializer->lbraceToken, initializer->lbraceToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectInitializer *initializer) { - endWrite("<UiObjectInitializer>"); addVerbatim(initializer->rbraceToken, initializer->rbraceToken); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectBinding *binding) { - write("<UiObjectBinding>"); QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); addVerbatim(binding->colonToken); QDeclarativeJS::AST::Node::accept(binding->qualifiedTypeNameId, this); @@ -305,12 +282,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectBinding *binding) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectBinding *) { - endWrite("<UiObjectBinding>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiScriptBinding *binding) { - write("<UiScriptBinding>"); QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); addVerbatim(binding->colonToken); QDeclarativeJS::AST::Node::accept(binding->statement, this); @@ -319,12 +294,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiScriptBinding *binding) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiScriptBinding *) { - endWrite("<UiScriptBinding>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayBinding *binding) { - write("<UiArrayBinding>"); QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this); addVerbatim(binding->colonToken); addVerbatim(binding->lbracketToken); @@ -335,12 +308,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayBinding *binding) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayBinding *formal) { - endWrite("<UiArrayBinding>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayMemberList *list) { - write("<UiArrayMemberList>"); for (QDeclarativeJS::AST::UiArrayMemberList *it = list; it; it = it->next) { QDeclarativeJS::AST::Node::accept(it->member, this); //addVerbatim(it->commaToken); @@ -350,24 +321,20 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayMemberList *list) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayMemberList *) { - endWrite("<UiArrayMemberList>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiQualifiedId *id) { - write("<UiQualifiedId>"); addMarkedUpToken(id->identifierToken, QLatin1String("name")); return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiQualifiedId *) { - endWrite("<UiQualifiedId>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSignature *signature) { - write("<UiSignature>"); addVerbatim(signature->lparenToken); return true; } @@ -375,12 +342,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSignature *signature) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiSignature *signature) { addVerbatim(signature->rparenToken); - endWrite("<UiSignature>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormal *formal) { - write("<UiFormal>"); addMarkedUpToken(formal->identifierToken, QLatin1String("name")); addVerbatim(formal->asToken); addVerbatim(formal->aliasToken); @@ -389,116 +354,98 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormal *formal) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiFormal *) { - endWrite("<UiFormal>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThisExpression *expression) { - write("<ThisExpression>"); addVerbatim(expression->thisToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThisExpression *) { - endWrite("<ThisExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierExpression *identifier) { - write("<IdentifierExpression>"); addMarkedUpToken(identifier->identifierToken, QLatin1String("name")); return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierExpression *) { - endWrite("<IdentifierExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NullExpression *null) { - write("<NullExpression>"); addMarkedUpToken(null->nullToken, QLatin1String("number")); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NullExpression *) { - endWrite("<NullExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TrueLiteral *literal) { - write("<TrueLiteral>"); addMarkedUpToken(literal->trueToken, QLatin1String("number")); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TrueLiteral *) { - endWrite("<TrueLiteral>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FalseLiteral *literal) { - write("<FalseLiteral>"); addMarkedUpToken(literal->falseToken, QLatin1String("number")); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FalseLiteral *) { - endWrite("<FalseLiteral>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteral *literal) { - //write("<NumericLiteral>"); addMarkedUpToken(literal->literalToken, QLatin1String("number")); return false; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteral *) { - //endWrite("<NumericLiteral>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteral *literal) { - //write("<StringLiteral>"); addMarkedUpToken(literal->literalToken, QLatin1String("string")); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteral *) { - //endWrite("<StringLiteral>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::RegExpLiteral *literal) { - write("<RegExpLiteral>"); addVerbatim(literal->literalToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::RegExpLiteral *) { - endWrite("<RegExpLiteral>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayLiteral *literal) { - write("<ArrayLiteral>"); addVerbatim(literal->lbracketToken); QDeclarativeJS::AST::Node::accept(literal->elements, this); addVerbatim(literal->rbracketToken); @@ -507,13 +454,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayLiteral *literal) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArrayLiteral *) { - endWrite("<ArrayLiteral>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ObjectLiteral *literal) { - write("<ObjectLiteral>"); addVerbatim(literal->lbraceToken); return true; } @@ -521,13 +466,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ObjectLiteral *literal) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ObjectLiteral *literal) { addVerbatim(literal->rbraceToken); - endWrite("<ObjectLiteral>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ElementList *list) { - write("<ElementList>"); for (QDeclarativeJS::AST::ElementList *it = list; it; it = it->next) { QDeclarativeJS::AST::Node::accept(it->expression, this); //addVerbatim(it->commaToken); @@ -538,58 +481,48 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ElementList *list) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ElementList *) { - endWrite("<ElementList>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Elision *elision) { - write("<Elision>"); addVerbatim(elision->commaToken, elision->commaToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Elision *) { - endWrite("<Elision>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierPropertyName *) { - write("<IdentifierPropertyName>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierPropertyName *) { - endWrite("<IdentifierPropertyName>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteralPropertyName *) { - write("<StringLiteralPropertyName>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteralPropertyName *) { - endWrite("<StringLiteralPropertyName>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteralPropertyName *) { - write("<NumericLiteralPropertyName>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteralPropertyName *) { - endWrite("<NumericLiteralPropertyName>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PropertyNameAndValueList *list) { - write("<PropertyNameAndValueList>"); QDeclarativeJS::AST::Node::accept(list->name, this); addVerbatim(list->colonToken, list->colonToken); QDeclarativeJS::AST::Node::accept(list->value, this); @@ -599,24 +532,20 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PropertyNameAndValueList *list void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PropertyNameAndValueList *) { - endWrite("<PropertyNameAndValueList>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NestedExpression *expression) { - write("<NestedExpression>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NestedExpression *) { - endWrite("<NestedExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayMemberExpression *expression) { - write("<ArrayMemberExpression>"); QDeclarativeJS::AST::Node::accept(expression->base, this); addVerbatim(expression->lbracketToken); QDeclarativeJS::AST::Node::accept(expression->expression, this); @@ -626,13 +555,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayMemberExpression *express void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArrayMemberExpression *) { - endWrite("<ArrayMemberExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FieldMemberExpression *expression) { - write("<FieldMemberExpression>"); QDeclarativeJS::AST::Node::accept(expression->base, this); addVerbatim(expression->dotToken); addMarkedUpToken(expression->identifierToken, QLatin1String("name")); @@ -641,13 +568,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FieldMemberExpression *express void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FieldMemberExpression *expression) { - endWrite("<FieldMemberExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewMemberExpression *expression) { - write("<NewMemberExpression>"); addVerbatim(expression->newToken); QDeclarativeJS::AST::Node::accept(expression->base, this); addVerbatim(expression->lparenToken); @@ -658,194 +583,164 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewMemberExpression *expressio void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewMemberExpression *expression) { - endWrite("<NewMemberExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewExpression *expression) { - write("<NewExpression>"); addVerbatim(expression->newToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewExpression *) { - endWrite("<NewExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CallExpression *expression) { - write("<CallExpression>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CallExpression *) { - endWrite("<CallExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArgumentList *list) { - write("<ArgumentList>"); addVerbatim(list->commaToken, list->commaToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArgumentList *) { - endWrite("<ArgumentList>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PostIncrementExpression *expression) { - write("<PostIncrementExpression>"); addVerbatim(expression->incrementToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PostIncrementExpression *) { - endWrite("<PostIncrementExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PostDecrementExpression *expression) { - write("<PostDecrementExpression>"); addVerbatim(expression->decrementToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PostDecrementExpression *) { - endWrite("<PostDecrementExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DeleteExpression *expression) { - write("<DeleteExpression>"); addVerbatim(expression->deleteToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DeleteExpression *) { - endWrite("<DeleteExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VoidExpression *expression) { - write("<VoidExpression>"); addVerbatim(expression->voidToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VoidExpression *) { - endWrite("<VoidExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TypeOfExpression *expression) { - write("<TypeOfExpression>"); addVerbatim(expression->typeofToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TypeOfExpression *) { - endWrite("<TypeOfExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PreIncrementExpression *expression) { - write("<PreIncrementExpression>"); addVerbatim(expression->incrementToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PreIncrementExpression *) { - endWrite("<PreIncrementExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PreDecrementExpression *expression) { - write("<PreDecrementExpression>"); addVerbatim(expression->decrementToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PreDecrementExpression *) { - endWrite("<PreDecrementExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryPlusExpression *expression) { - write("<UnaryPlusExpression>"); addVerbatim(expression->plusToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryPlusExpression *) { - endWrite("<UnaryPlusExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryMinusExpression *expression) { - write("<UnaryMinusExpression>"); addVerbatim(expression->minusToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryMinusExpression *) { - endWrite("<UnaryMinusExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TildeExpression *expression) { - write("<TildeExpression>"); addVerbatim(expression->tildeToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TildeExpression *) { - endWrite("<TildeExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NotExpression *expression) { - write("<NotExpression>"); addVerbatim(expression->notToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NotExpression *) { - endWrite("<NotExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BinaryExpression *expression) { - write("<BinaryExpression>"); QDeclarativeJS::AST::Node::accept(expression->left, this); addMarkedUpToken(expression->operatorToken, QLatin1String("op")); QDeclarativeJS::AST::Node::accept(expression->right, this); @@ -854,25 +749,21 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BinaryExpression *expression) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BinaryExpression *) { - endWrite("<BinaryExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ConditionalExpression *expression) { - write("<ConditionalExpression>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ConditionalExpression *) { - endWrite("<ConditionalExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Expression *expression) { - write("<Expression>"); QDeclarativeJS::AST::Node::accept(expression->left, this); addVerbatim(expression->commaToken); QDeclarativeJS::AST::Node::accept(expression->right, this); @@ -881,12 +772,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Expression *expression) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Expression *) { - endWrite("<Expression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Block *block) { - write("<Block>"); addVerbatim(block->lbraceToken); return true; } @@ -894,23 +783,19 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Block *block) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Block *block) { addVerbatim(block->rbraceToken); - endWrite("<Block>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StatementList *) { - write("<StatementList>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementList *) { - endWrite("<StatementList"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableStatement *statement) { - write("<VariableStatement>"); addVerbatim(statement->declarationKindToken); QDeclarativeJS::AST::Node::accept(statement->declarations, this); addVerbatim(statement->semicolonToken); @@ -919,13 +804,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableStatement *) { - endWrite("<VariableStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclarationList *list) { - write("<VariableDeclarationList>"); for (QDeclarativeJS::AST::VariableDeclarationList *it = list; it; it = it->next) { QDeclarativeJS::AST::Node::accept(it->declaration, this); addVerbatim(it->commaToken); @@ -935,12 +818,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclarationList *list) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclarationList *) { - endWrite("<VariableDeclarationList>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclaration *declaration) { - write("<VariableDeclaration>"); addMarkedUpToken(declaration->identifierToken, QLatin1String("name")); QDeclarativeJS::AST::Node::accept(declaration->expression, this); return false; @@ -948,39 +829,33 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclaration *declarati void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclaration *) { - endWrite("<VariableDeclaration>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::EmptyStatement *statement) { - write("<EmptyStatement>"); addVerbatim(statement->semicolonToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::EmptyStatement *) { - endWrite("<EmptyStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ExpressionStatement *) { - write("<ExpressionStatement>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ExpressionStatement *statement) { addVerbatim(statement->semicolonToken); - endWrite("<ExpressionStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement) { - write("<IfStatement>"); addMarkedUpToken(statement->ifToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->expression, this); @@ -995,13 +870,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IfStatement *) { - endWrite("<IfStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DoWhileStatement *statement) { - write("<DoWhileStatement>"); addMarkedUpToken(statement->doToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->statement, this); addMarkedUpToken(statement->whileToken, QLatin1String("keyword")); @@ -1014,25 +887,21 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DoWhileStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DoWhileStatement *) { - endWrite("<DoWhileStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WhileStatement *statement) { - write("<WhileStatement>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WhileStatement *) { - endWrite("<WhileStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForStatement *statement) { - write("<ForStatement>"); addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->initialiser, this); @@ -1047,13 +916,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForStatement *) { - endWrite("<ForStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForStatement *statement) { - write("<LocalForStatement>"); addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); addMarkedUpToken(statement->varToken, QLatin1String("keyword")); @@ -1069,13 +936,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForStatement *) { - endWrite("<LocalForStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForEachStatement *statement) { - write("<ForEachStatement>"); addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->initialiser, this); @@ -1088,13 +953,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForEachStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForEachStatement *) { - endWrite("<ForEachStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForEachStatement *statement) { - write("<LocalForEachStatement>"); addMarkedUpToken(statement->forToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); addMarkedUpToken(statement->varToken, QLatin1String("keyword")); @@ -1108,13 +971,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForEachStatement *stateme void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForEachStatement *) { - endWrite("<LocalForEachStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ContinueStatement *statement) { - write("<ContinueStatement>"); addMarkedUpToken(statement->continueToken, QLatin1String("keyword")); addMarkedUpToken(statement->identifierToken, QLatin1String("name")); addVerbatim(statement->semicolonToken); @@ -1123,13 +984,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ContinueStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ContinueStatement *) { - endWrite("<ContinueStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BreakStatement *statement) { - write("<BreakStatement>"); addMarkedUpToken(statement->breakToken, QLatin1String("keyword")); addMarkedUpToken(statement->identifierToken, QLatin1String("name")); addVerbatim(statement->semicolonToken); @@ -1138,13 +997,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BreakStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BreakStatement *) { - endWrite("<BreakStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ReturnStatement *statement) { - write("<ReturnStatement>"); addMarkedUpToken(statement->returnToken, QLatin1String("keyword")); return true; } @@ -1152,13 +1009,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ReturnStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ReturnStatement *statement) { addVerbatim(statement->semicolonToken); - endWrite("<ReturnStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WithStatement *statement) { - write("<WithStatement>"); addMarkedUpToken(statement->withToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); addVerbatim(statement->rparenToken); @@ -1167,27 +1022,23 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WithStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WithStatement *) { - endWrite("<WithStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseBlock *block) { - write("<CaseBlock>"); addVerbatim(block->lbraceToken); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseBlock *block) { - endWrite("<CaseBlock>"); addVerbatim(block->rbraceToken, block->rbraceToken); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SwitchStatement *statement) { - write("<SwitchStatement>"); addMarkedUpToken(statement->switchToken, QLatin1String("keyword")); addVerbatim(statement->lparenToken); QDeclarativeJS::AST::Node::accept(statement->expression, this); @@ -1198,23 +1049,19 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SwitchStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::SwitchStatement *statement) { - endWrite("<SwitchStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClauses *) { - write("<CaseClauses>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClauses *) { - endWrite("<CaseClauses>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClause *clause) { - write("<CaseClause>"); addMarkedUpToken(clause->caseToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(clause->expression, this); addVerbatim(clause->colonToken); @@ -1224,13 +1071,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClause *clause) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClause *clause) { - endWrite("<CaseClause>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DefaultClause *clause) { - write("<DefaultClause>"); addMarkedUpToken(clause->defaultToken, QLatin1String("keyword")); addVerbatim(clause->colonToken, clause->colonToken); return true; @@ -1238,13 +1083,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DefaultClause *clause) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DefaultClause *) { - endWrite("<DefaultClause>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LabelledStatement *statement) { - write("<LabelledStatement>"); addMarkedUpToken(statement->identifierToken, QLatin1String("name")); addVerbatim(statement->colonToken); QDeclarativeJS::AST::Node::accept(statement->statement, this); @@ -1253,13 +1096,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LabelledStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LabelledStatement *) { - endWrite("<LabelledStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThrowStatement *statement) { - write("<ThrowStatement>"); addMarkedUpToken(statement->throwToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->expression, this); addVerbatim(statement->semicolonToken); @@ -1268,13 +1109,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThrowStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThrowStatement *) { - endWrite("<ThrowStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Catch *c) { - write("<Catch>"); addMarkedUpToken(c->catchToken, QLatin1String("keyword")); addVerbatim(c->lparenToken); addMarkedUpToken(c->identifierToken, QLatin1String("name")); @@ -1284,13 +1123,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Catch *c) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Catch *) { - endWrite("<Catch>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Finally *f) { - write("<Finally>"); addMarkedUpToken(f->finallyToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(f->statement, this); return false; @@ -1298,13 +1135,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Finally *f) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Finally *) { - endWrite("<Finally>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TryStatement *statement) { - write("<TryStatement>"); addMarkedUpToken(statement->tryToken, QLatin1String("keyword")); QDeclarativeJS::AST::Node::accept(statement->statement, this); QDeclarativeJS::AST::Node::accept(statement->catchExpression, this); @@ -1314,13 +1149,11 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TryStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TryStatement *) { - endWrite("<TryStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionExpression *expression) { - write("<FunctionExpression>"); addMarkedUpToken(expression->functionToken, QLatin1String("keyword")); addMarkedUpToken(expression->identifierToken, QLatin1String("name")); addVerbatim(expression->lparenToken); @@ -1334,12 +1167,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionExpression *expression void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionExpression *expression) { - endWrite("<FunctionExpression>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionDeclaration *declaration) { - write("<FunctionDeclaration>"); addMarkedUpToken(declaration->functionToken, QLatin1String("keyword")); addMarkedUpToken(declaration->identifierToken, QLatin1String("name")); addVerbatim(declaration->lparenToken); @@ -1353,12 +1184,10 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionDeclaration *declarati void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionDeclaration *) { - endWrite("<FunctionDeclaration>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FormalParameterList *list) { - write("<FormalParameterList>"); addVerbatim(list->commaToken); addMarkedUpToken(list->identifierToken, QLatin1String("name")); return false; @@ -1366,23 +1195,19 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FormalParameterList *list) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FormalParameterList *) { - endWrite("<FormalParameterList>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionBody *body) { - write("<FunctionBody>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionBody *body) { - endWrite("<FunctionBody>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DebuggerStatement *statement) { - write("<DebuggerStatement>"); addVerbatim(statement->debuggerToken); addVerbatim(statement->semicolonToken); return true; @@ -1390,34 +1215,28 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DebuggerStatement *statement) void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DebuggerStatement *) { - endWrite("<DebuggerStatement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionSourceElement *) { - write("<FunctionSourceElement>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionSourceElement *) { - endWrite("<FunctionSourceElement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StatementSourceElement *) { - write("<StatementSourceElement>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementSourceElement *) { - endWrite("<StatementSourceElement>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition) { - write("<UiObjectDefinition>"); QDeclarativeJS::AST::Node::accept(definition->qualifiedTypeNameId, this); QDeclarativeJS::AST::Node::accept(definition->initializer, this); return false; @@ -1425,62 +1244,51 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectDefinition *) { - endWrite("<UiObjectDefinition>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImportList *) { - write("<UiImportList>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiImportList *) { - endWrite("<UiImportList>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectMemberList *) { - write("<UiObjectMemberList>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectMemberList *) { - endWrite("<UiObjectMemberList>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormalList *) { - write("<UiFormalList>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiFormalList *) { - endWrite("<UiFormalList>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Program *) { - write("<Program>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Program *) { - endWrite("<Program>"); } bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SourceElements *) { - write("<SourceElements>"); return true; } void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::SourceElements *) { - endWrite("<SourceElements>"); } QT_END_NAMESPACE diff --git a/tools/qdoc3/qmlmarkupvisitor.h b/tools/qdoc3/qmlmarkupvisitor.h index 01b0acf..8177798 100644 --- a/tools/qdoc3/qmlmarkupvisitor.h +++ b/tools/qdoc3/qmlmarkupvisitor.h @@ -327,8 +327,6 @@ private: void addVerbatim(QDeclarativeJS::AST::SourceLocation first, QDeclarativeJS::AST::SourceLocation last = QDeclarativeJS::AST::SourceLocation()); QString sourceText(QDeclarativeJS::AST::SourceLocation &location); - void write(const QString &text); - void endWrite(const QString &text); QDeclarativeJS::Engine *engine; QString source; |