summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Boddie <david.boddie@nokia.com>2010-12-01 17:15:46 (GMT)
committerDavid Boddie <david.boddie@nokia.com>2010-12-01 17:15:46 (GMT)
commitff9b210719da21a6724bad51e908f9754c7fa172 (patch)
tree1d6c51230534530ecde851543278d182d998ebdc /tools
parentd877b3d3b34d4f5c6f9683c54d54e54a37a39998 (diff)
downloadQt-ff9b210719da21a6724bad51e908f9754c7fa172.zip
Qt-ff9b210719da21a6724bad51e908f9754c7fa172.tar.gz
Qt-ff9b210719da21a6724bad51e908f9754c7fa172.tar.bz2
Updated handling of some statement nodes, removed unnecessary functions.
Diffstat (limited to 'tools')
-rw-r--r--tools/qdoc3/qmlmarkupvisitor.cpp512
-rw-r--r--tools/qdoc3/qmlmarkupvisitor.h185
2 files changed, 28 insertions, 669 deletions
diff --git a/tools/qdoc3/qmlmarkupvisitor.cpp b/tools/qdoc3/qmlmarkupvisitor.cpp
index 6335ab6..907b95d 100644
--- a/tools/qdoc3/qmlmarkupvisitor.cpp
+++ b/tools/qdoc3/qmlmarkupvisitor.cpp
@@ -53,7 +53,6 @@ QmlMarkupVisitor::QmlMarkupVisitor(const QString &source, QDeclarativeJS::Engine
{
this->source = source;
this->engine = engine;
- indent = 0;
cursor = 0;
commentIndex = 0;
}
@@ -183,20 +182,10 @@ void QmlMarkupVisitor::addVerbatim(QDeclarativeJS::AST::SourceLocation first,
return;
QString text = source.mid(start, finish - start);
- indent -= 1;
output += protect(text);
cursor = finish;
}
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiProgram *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiProgram *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImport *uiimport)
{
addVerbatim(uiimport->importToken);
@@ -238,28 +227,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiPublicMember *member)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiPublicMember *member)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSourceElement *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiSourceElement *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiParameterList *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiParameterList *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectInitializer *initializer)
{
addVerbatim(initializer->lbraceToken, initializer->lbraceToken);
@@ -280,10 +247,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectBinding *binding)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectBinding *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiScriptBinding *binding)
{
QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this);
@@ -292,10 +255,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiScriptBinding *binding)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiScriptBinding *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayBinding *binding)
{
QDeclarativeJS::AST::Node::accept(binding->qualifiedId, this);
@@ -306,10 +265,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayBinding *binding)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayBinding *formal)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayMemberList *list)
{
for (QDeclarativeJS::AST::UiArrayMemberList *it = list; it; it = it->next) {
@@ -319,20 +274,12 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiArrayMemberList *list)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiArrayMemberList *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiQualifiedId *id)
{
addMarkedUpToken(id->identifierToken, QLatin1String("name"));
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiQualifiedId *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiSignature *signature)
{
addVerbatim(signature->lparenToken);
@@ -352,98 +299,54 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormal *formal)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiFormal *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThisExpression *expression)
{
addVerbatim(expression->thisToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThisExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierExpression *identifier)
{
addMarkedUpToken(identifier->identifierToken, QLatin1String("name"));
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NullExpression *null)
{
addMarkedUpToken(null->nullToken, QLatin1String("number"));
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NullExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TrueLiteral *literal)
{
addMarkedUpToken(literal->trueToken, QLatin1String("number"));
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TrueLiteral *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FalseLiteral *literal)
{
addMarkedUpToken(literal->falseToken, QLatin1String("number"));
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FalseLiteral *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteral *literal)
{
addMarkedUpToken(literal->literalToken, QLatin1String("number"));
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteral *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteral *literal)
{
addMarkedUpToken(literal->literalToken, QLatin1String("string"));
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteral *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::RegExpLiteral *literal)
{
addVerbatim(literal->literalToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::RegExpLiteral *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayLiteral *literal)
{
addVerbatim(literal->lbracketToken);
@@ -452,11 +355,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayLiteral *literal)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArrayLiteral *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ObjectLiteral *literal)
{
addVerbatim(literal->lbraceToken);
@@ -479,48 +377,12 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ElementList *list)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ElementList *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Elision *elision)
{
addVerbatim(elision->commaToken, elision->commaToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Elision *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IdentifierPropertyName *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IdentifierPropertyName *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StringLiteralPropertyName *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StringLiteralPropertyName *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NumericLiteralPropertyName *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NumericLiteralPropertyName *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PropertyNameAndValueList *list)
{
QDeclarativeJS::AST::Node::accept(list->name, this);
@@ -530,20 +392,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PropertyNameAndValueList *list
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PropertyNameAndValueList *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NestedExpression *expression)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NestedExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayMemberExpression *expression)
{
QDeclarativeJS::AST::Node::accept(expression->base, this);
@@ -553,11 +401,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArrayMemberExpression *express
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArrayMemberExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FieldMemberExpression *expression)
{
QDeclarativeJS::AST::Node::accept(expression->base, this);
@@ -566,11 +409,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FieldMemberExpression *express
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FieldMemberExpression *expression)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewMemberExpression *expression)
{
addVerbatim(expression->newToken);
@@ -581,164 +419,84 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewMemberExpression *expressio
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewMemberExpression *expression)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NewExpression *expression)
{
addVerbatim(expression->newToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NewExpression *)
-{
-}
-
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CallExpression *expression)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CallExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ArgumentList *list)
{
addVerbatim(list->commaToken, list->commaToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ArgumentList *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PostIncrementExpression *expression)
{
addVerbatim(expression->incrementToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PostIncrementExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PostDecrementExpression *expression)
{
addVerbatim(expression->decrementToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PostDecrementExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DeleteExpression *expression)
{
addVerbatim(expression->deleteToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DeleteExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VoidExpression *expression)
{
addVerbatim(expression->voidToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VoidExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TypeOfExpression *expression)
{
addVerbatim(expression->typeofToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TypeOfExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PreIncrementExpression *expression)
{
addVerbatim(expression->incrementToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PreIncrementExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::PreDecrementExpression *expression)
{
addVerbatim(expression->decrementToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::PreDecrementExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryPlusExpression *expression)
{
addVerbatim(expression->plusToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryPlusExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UnaryMinusExpression *expression)
{
addVerbatim(expression->minusToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UnaryMinusExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TildeExpression *expression)
{
addVerbatim(expression->tildeToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TildeExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::NotExpression *expression)
{
addVerbatim(expression->notToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::NotExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BinaryExpression *expression)
{
QDeclarativeJS::AST::Node::accept(expression->left, this);
@@ -747,31 +505,22 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BinaryExpression *expression)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BinaryExpression *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ConditionalExpression *expression)
{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ConditionalExpression *)
-{
+ QDeclarativeJS::AST::Node::accept(expression->expression, this);
+ addVerbatim(expression->questionToken);
+ QDeclarativeJS::AST::Node::accept(expression->ok, this);
+ addVerbatim(expression->colonToken);
+ QDeclarativeJS::AST::Node::accept(expression->ko, this);
+ return false;
}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Expression *expression)
{
QDeclarativeJS::AST::Node::accept(expression->left, this);
addVerbatim(expression->commaToken);
QDeclarativeJS::AST::Node::accept(expression->right, this);
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Expression *)
-{
+ return false;
}
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Block *block)
@@ -785,15 +534,6 @@ void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Block *block)
addVerbatim(block->rbraceToken);
}
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StatementList *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementList *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableStatement *statement)
{
addVerbatim(statement->declarationKindToken);
@@ -802,11 +542,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclarationList *list)
{
for (QDeclarativeJS::AST::VariableDeclarationList *it = list; it; it = it->next) {
@@ -816,10 +551,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclarationList *list)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclarationList *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclaration *declaration)
{
addMarkedUpToken(declaration->identifierToken, QLatin1String("name"));
@@ -827,33 +558,19 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::VariableDeclaration *declarati
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::VariableDeclaration *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::EmptyStatement *statement)
{
addVerbatim(statement->semicolonToken);
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::EmptyStatement *)
-{
-}
-
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ExpressionStatement *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ExpressionStatement *statement)
+bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ExpressionStatement *statement)
{
+ QDeclarativeJS::AST::Node::accept(statement->expression, this);
addVerbatim(statement->semicolonToken);
+ return false;
}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement)
{
addMarkedUpToken(statement->ifToken, QLatin1String("keyword"));
@@ -868,11 +585,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::IfStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::IfStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DoWhileStatement *statement)
{
addMarkedUpToken(statement->doToken, QLatin1String("keyword"));
@@ -885,21 +597,16 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DoWhileStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DoWhileStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WhileStatement *statement)
{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WhileStatement *)
-{
+ addMarkedUpToken(statement->whileToken, QLatin1String("keyword"));
+ addVerbatim(statement->lparenToken);
+ QDeclarativeJS::AST::Node::accept(statement->expression, this);
+ addVerbatim(statement->rparenToken);
+ QDeclarativeJS::AST::Node::accept(statement->statement, this);
+ return false;
}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForStatement *statement)
{
addMarkedUpToken(statement->forToken, QLatin1String("keyword"));
@@ -914,11 +621,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForStatement *statement)
{
addMarkedUpToken(statement->forToken, QLatin1String("keyword"));
@@ -934,11 +636,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForEachStatement *statement)
{
addMarkedUpToken(statement->forToken, QLatin1String("keyword"));
@@ -951,11 +648,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ForEachStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ForEachStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForEachStatement *statement)
{
addMarkedUpToken(statement->forToken, QLatin1String("keyword"));
@@ -969,11 +661,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LocalForEachStatement *stateme
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LocalForEachStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ContinueStatement *statement)
{
addMarkedUpToken(statement->continueToken, QLatin1String("keyword"));
@@ -982,11 +669,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ContinueStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ContinueStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BreakStatement *statement)
{
addMarkedUpToken(statement->breakToken, QLatin1String("keyword"));
@@ -995,36 +677,24 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::BreakStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::BreakStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ReturnStatement *statement)
{
addMarkedUpToken(statement->returnToken, QLatin1String("keyword"));
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ReturnStatement *statement)
-{
+ QDeclarativeJS::AST::Node::accept(statement->expression, this);
addVerbatim(statement->semicolonToken);
+ return false;
}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::WithStatement *statement)
{
addMarkedUpToken(statement->withToken, QLatin1String("keyword"));
addVerbatim(statement->lparenToken);
+ QDeclarativeJS::AST::Node::accept(statement->expression, this);
addVerbatim(statement->rparenToken);
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::WithStatement *)
-{
+ QDeclarativeJS::AST::Node::accept(statement->statement, this);
+ return false;
}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseBlock *block)
{
addVerbatim(block->lbraceToken);
@@ -1047,19 +717,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SwitchStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::SwitchStatement *statement)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClauses *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClauses *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClause *clause)
{
addMarkedUpToken(clause->caseToken, QLatin1String("keyword"));
@@ -1069,11 +726,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::CaseClause *clause)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::CaseClause *clause)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DefaultClause *clause)
{
addMarkedUpToken(clause->defaultToken, QLatin1String("keyword"));
@@ -1081,11 +733,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DefaultClause *clause)
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DefaultClause *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LabelledStatement *statement)
{
addMarkedUpToken(statement->identifierToken, QLatin1String("name"));
@@ -1094,11 +741,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::LabelledStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::LabelledStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThrowStatement *statement)
{
addMarkedUpToken(statement->throwToken, QLatin1String("keyword"));
@@ -1107,11 +749,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::ThrowStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::ThrowStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Catch *c)
{
addMarkedUpToken(c->catchToken, QLatin1String("keyword"));
@@ -1121,11 +758,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Catch *c)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Catch *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Finally *f)
{
addMarkedUpToken(f->finallyToken, QLatin1String("keyword"));
@@ -1133,11 +765,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Finally *f)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Finally *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TryStatement *statement)
{
addMarkedUpToken(statement->tryToken, QLatin1String("keyword"));
@@ -1147,11 +774,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::TryStatement *statement)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::TryStatement *)
-{
-}
-
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionExpression *expression)
{
addMarkedUpToken(expression->functionToken, QLatin1String("keyword"));
@@ -1165,10 +787,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionExpression *expression
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionExpression *expression)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionDeclaration *declaration)
{
addMarkedUpToken(declaration->functionToken, QLatin1String("keyword"));
@@ -1182,10 +800,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionDeclaration *declarati
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionDeclaration *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FormalParameterList *list)
{
addVerbatim(list->commaToken);
@@ -1193,19 +807,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FormalParameterList *list)
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FormalParameterList *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionBody *body)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionBody *body)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DebuggerStatement *statement)
{
addVerbatim(statement->debuggerToken);
@@ -1213,28 +814,6 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::DebuggerStatement *statement)
return true;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::DebuggerStatement *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::FunctionSourceElement *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::FunctionSourceElement *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::StatementSourceElement *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::StatementSourceElement *)
-{
-}
-
bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition)
{
QDeclarativeJS::AST::Node::accept(definition->qualifiedTypeNameId, this);
@@ -1242,53 +821,4 @@ bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectDefinition *definition
return false;
}
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectDefinition *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiImportList *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiImportList *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiObjectMemberList *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiObjectMemberList *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::UiFormalList *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::UiFormalList *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::Program *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::Program *)
-{
-}
-
-bool QmlMarkupVisitor::visit(QDeclarativeJS::AST::SourceElements *)
-{
- return true;
-}
-
-void QmlMarkupVisitor::endVisit(QDeclarativeJS::AST::SourceElements *)
-{
-}
-
QT_END_NAMESPACE
diff --git a/tools/qdoc3/qmlmarkupvisitor.h b/tools/qdoc3/qmlmarkupvisitor.h
index 8177798..35f1b5bc 100644
--- a/tools/qdoc3/qmlmarkupvisitor.h
+++ b/tools/qdoc3/qmlmarkupvisitor.h
@@ -57,265 +57,96 @@ public:
QString markedUpCode();
- virtual bool visit(QDeclarativeJS::AST::UiProgram *);
- virtual bool visit(QDeclarativeJS::AST::UiImportList *);
virtual bool visit(QDeclarativeJS::AST::UiImport *);
+ virtual void endVisit(QDeclarativeJS::AST::UiImport *);
+
virtual bool visit(QDeclarativeJS::AST::UiPublicMember *);
- virtual bool visit(QDeclarativeJS::AST::UiSourceElement *);
virtual bool visit(QDeclarativeJS::AST::UiObjectDefinition *);
+
virtual bool visit(QDeclarativeJS::AST::UiObjectInitializer *);
+ virtual void endVisit(QDeclarativeJS::AST::UiObjectInitializer *);
+
virtual bool visit(QDeclarativeJS::AST::UiObjectBinding *);
virtual bool visit(QDeclarativeJS::AST::UiScriptBinding *);
virtual bool visit(QDeclarativeJS::AST::UiArrayBinding *);
- virtual bool visit(QDeclarativeJS::AST::UiObjectMemberList *);
virtual bool visit(QDeclarativeJS::AST::UiArrayMemberList *);
virtual bool visit(QDeclarativeJS::AST::UiQualifiedId *);
- virtual bool visit(QDeclarativeJS::AST::UiSignature *);
- virtual bool visit(QDeclarativeJS::AST::UiFormalList *);
- virtual bool visit(QDeclarativeJS::AST::UiFormal *);
- virtual void endVisit(QDeclarativeJS::AST::UiProgram *);
- virtual void endVisit(QDeclarativeJS::AST::UiImportList *);
- virtual void endVisit(QDeclarativeJS::AST::UiImport *);
- virtual void endVisit(QDeclarativeJS::AST::UiPublicMember *);
- virtual void endVisit(QDeclarativeJS::AST::UiSourceElement *);
- virtual void endVisit(QDeclarativeJS::AST::UiObjectDefinition *);
- virtual void endVisit(QDeclarativeJS::AST::UiObjectInitializer *);
- virtual void endVisit(QDeclarativeJS::AST::UiObjectBinding *);
- virtual void endVisit(QDeclarativeJS::AST::UiScriptBinding *);
- virtual void endVisit(QDeclarativeJS::AST::UiArrayBinding *);
- virtual void endVisit(QDeclarativeJS::AST::UiObjectMemberList *);
- virtual void endVisit(QDeclarativeJS::AST::UiArrayMemberList *);
- virtual void endVisit(QDeclarativeJS::AST::UiQualifiedId *);
+ virtual bool visit(QDeclarativeJS::AST::UiSignature *);
virtual void endVisit(QDeclarativeJS::AST::UiSignature *);
- virtual void endVisit(QDeclarativeJS::AST::UiFormalList *);
- virtual void endVisit(QDeclarativeJS::AST::UiFormal *);
- // QDeclarativeJS
+ virtual bool visit(QDeclarativeJS::AST::UiFormal *);
virtual bool visit(QDeclarativeJS::AST::ThisExpression *);
- virtual void endVisit(QDeclarativeJS::AST::ThisExpression *);
-
virtual bool visit(QDeclarativeJS::AST::IdentifierExpression *);
- virtual void endVisit(QDeclarativeJS::AST::IdentifierExpression *);
-
virtual bool visit(QDeclarativeJS::AST::NullExpression *);
- virtual void endVisit(QDeclarativeJS::AST::NullExpression *);
-
virtual bool visit(QDeclarativeJS::AST::TrueLiteral *);
- virtual void endVisit(QDeclarativeJS::AST::TrueLiteral *);
-
virtual bool visit(QDeclarativeJS::AST::FalseLiteral *);
- virtual void endVisit(QDeclarativeJS::AST::FalseLiteral *);
-
virtual bool visit(QDeclarativeJS::AST::NumericLiteral *);
- virtual void endVisit(QDeclarativeJS::AST::NumericLiteral *);
-
virtual bool visit(QDeclarativeJS::AST::StringLiteral *);
- virtual void endVisit(QDeclarativeJS::AST::StringLiteral *);
-
virtual bool visit(QDeclarativeJS::AST::RegExpLiteral *);
- virtual void endVisit(QDeclarativeJS::AST::RegExpLiteral *);
-
virtual bool visit(QDeclarativeJS::AST::ArrayLiteral *);
- virtual void endVisit(QDeclarativeJS::AST::ArrayLiteral *);
virtual bool visit(QDeclarativeJS::AST::ObjectLiteral *);
virtual void endVisit(QDeclarativeJS::AST::ObjectLiteral *);
virtual bool visit(QDeclarativeJS::AST::ElementList *);
- virtual void endVisit(QDeclarativeJS::AST::ElementList *);
-
virtual bool visit(QDeclarativeJS::AST::Elision *);
- virtual void endVisit(QDeclarativeJS::AST::Elision *);
-
virtual bool visit(QDeclarativeJS::AST::PropertyNameAndValueList *);
- virtual void endVisit(QDeclarativeJS::AST::PropertyNameAndValueList *);
-
- virtual bool visit(QDeclarativeJS::AST::NestedExpression *);
- virtual void endVisit(QDeclarativeJS::AST::NestedExpression *);
-
- virtual bool visit(QDeclarativeJS::AST::IdentifierPropertyName *);
- virtual void endVisit(QDeclarativeJS::AST::IdentifierPropertyName *);
-
- virtual bool visit(QDeclarativeJS::AST::StringLiteralPropertyName *);
- virtual void endVisit(QDeclarativeJS::AST::StringLiteralPropertyName *);
-
- virtual bool visit(QDeclarativeJS::AST::NumericLiteralPropertyName *);
- virtual void endVisit(QDeclarativeJS::AST::NumericLiteralPropertyName *);
-
virtual bool visit(QDeclarativeJS::AST::ArrayMemberExpression *);
- virtual void endVisit(QDeclarativeJS::AST::ArrayMemberExpression *);
-
virtual bool visit(QDeclarativeJS::AST::FieldMemberExpression *);
- virtual void endVisit(QDeclarativeJS::AST::FieldMemberExpression *);
-
virtual bool visit(QDeclarativeJS::AST::NewMemberExpression *);
- virtual void endVisit(QDeclarativeJS::AST::NewMemberExpression *);
-
virtual bool visit(QDeclarativeJS::AST::NewExpression *);
- virtual void endVisit(QDeclarativeJS::AST::NewExpression *);
-
- virtual bool visit(QDeclarativeJS::AST::CallExpression *);
- virtual void endVisit(QDeclarativeJS::AST::CallExpression *);
-
virtual bool visit(QDeclarativeJS::AST::ArgumentList *);
- virtual void endVisit(QDeclarativeJS::AST::ArgumentList *);
-
virtual bool visit(QDeclarativeJS::AST::PostIncrementExpression *);
- virtual void endVisit(QDeclarativeJS::AST::PostIncrementExpression *);
-
virtual bool visit(QDeclarativeJS::AST::PostDecrementExpression *);
- virtual void endVisit(QDeclarativeJS::AST::PostDecrementExpression *);
-
virtual bool visit(QDeclarativeJS::AST::DeleteExpression *);
- virtual void endVisit(QDeclarativeJS::AST::DeleteExpression *);
-
virtual bool visit(QDeclarativeJS::AST::VoidExpression *);
- virtual void endVisit(QDeclarativeJS::AST::VoidExpression *);
-
virtual bool visit(QDeclarativeJS::AST::TypeOfExpression *);
- virtual void endVisit(QDeclarativeJS::AST::TypeOfExpression *);
-
virtual bool visit(QDeclarativeJS::AST::PreIncrementExpression *);
- virtual void endVisit(QDeclarativeJS::AST::PreIncrementExpression *);
-
virtual bool visit(QDeclarativeJS::AST::PreDecrementExpression *);
- virtual void endVisit(QDeclarativeJS::AST::PreDecrementExpression *);
-
virtual bool visit(QDeclarativeJS::AST::UnaryPlusExpression *);
- virtual void endVisit(QDeclarativeJS::AST::UnaryPlusExpression *);
-
virtual bool visit(QDeclarativeJS::AST::UnaryMinusExpression *);
- virtual void endVisit(QDeclarativeJS::AST::UnaryMinusExpression *);
-
virtual bool visit(QDeclarativeJS::AST::TildeExpression *);
- virtual void endVisit(QDeclarativeJS::AST::TildeExpression *);
-
virtual bool visit(QDeclarativeJS::AST::NotExpression *);
- virtual void endVisit(QDeclarativeJS::AST::NotExpression *);
-
virtual bool visit(QDeclarativeJS::AST::BinaryExpression *);
- virtual void endVisit(QDeclarativeJS::AST::BinaryExpression *);
-
virtual bool visit(QDeclarativeJS::AST::ConditionalExpression *);
- virtual void endVisit(QDeclarativeJS::AST::ConditionalExpression *);
-
virtual bool visit(QDeclarativeJS::AST::Expression *);
- virtual void endVisit(QDeclarativeJS::AST::Expression *);
virtual bool visit(QDeclarativeJS::AST::Block *);
virtual void endVisit(QDeclarativeJS::AST::Block *);
- virtual bool visit(QDeclarativeJS::AST::StatementList *);
- virtual void endVisit(QDeclarativeJS::AST::StatementList *);
-
virtual bool visit(QDeclarativeJS::AST::VariableStatement *);
- virtual void endVisit(QDeclarativeJS::AST::VariableStatement *);
-
virtual bool visit(QDeclarativeJS::AST::VariableDeclarationList *);
- virtual void endVisit(QDeclarativeJS::AST::VariableDeclarationList *);
-
virtual bool visit(QDeclarativeJS::AST::VariableDeclaration *);
- virtual void endVisit(QDeclarativeJS::AST::VariableDeclaration *);
-
virtual bool visit(QDeclarativeJS::AST::EmptyStatement *);
- virtual void endVisit(QDeclarativeJS::AST::EmptyStatement *);
-
virtual bool visit(QDeclarativeJS::AST::ExpressionStatement *);
- virtual void endVisit(QDeclarativeJS::AST::ExpressionStatement *);
-
virtual bool visit(QDeclarativeJS::AST::IfStatement *);
- virtual void endVisit(QDeclarativeJS::AST::IfStatement *);
-
virtual bool visit(QDeclarativeJS::AST::DoWhileStatement *);
- virtual void endVisit(QDeclarativeJS::AST::DoWhileStatement *);
-
virtual bool visit(QDeclarativeJS::AST::WhileStatement *);
- virtual void endVisit(QDeclarativeJS::AST::WhileStatement *);
-
virtual bool visit(QDeclarativeJS::AST::ForStatement *);
- virtual void endVisit(QDeclarativeJS::AST::ForStatement *);
-
virtual bool visit(QDeclarativeJS::AST::LocalForStatement *);
- virtual void endVisit(QDeclarativeJS::AST::LocalForStatement *);
-
virtual bool visit(QDeclarativeJS::AST::ForEachStatement *);
- virtual void endVisit(QDeclarativeJS::AST::ForEachStatement *);
-
virtual bool visit(QDeclarativeJS::AST::LocalForEachStatement *);
- virtual void endVisit(QDeclarativeJS::AST::LocalForEachStatement *);
-
virtual bool visit(QDeclarativeJS::AST::ContinueStatement *);
- virtual void endVisit(QDeclarativeJS::AST::ContinueStatement *);
-
virtual bool visit(QDeclarativeJS::AST::BreakStatement *);
- virtual void endVisit(QDeclarativeJS::AST::BreakStatement *);
-
virtual bool visit(QDeclarativeJS::AST::ReturnStatement *);
- virtual void endVisit(QDeclarativeJS::AST::ReturnStatement *);
-
virtual bool visit(QDeclarativeJS::AST::WithStatement *);
- virtual void endVisit(QDeclarativeJS::AST::WithStatement *);
virtual bool visit(QDeclarativeJS::AST::CaseBlock *);
virtual void endVisit(QDeclarativeJS::AST::CaseBlock *);
virtual bool visit(QDeclarativeJS::AST::SwitchStatement *);
- virtual void endVisit(QDeclarativeJS::AST::SwitchStatement *);
-
- virtual bool visit(QDeclarativeJS::AST::CaseClauses *);
- virtual void endVisit(QDeclarativeJS::AST::CaseClauses *);
-
virtual bool visit(QDeclarativeJS::AST::CaseClause *);
- virtual void endVisit(QDeclarativeJS::AST::CaseClause *);
-
virtual bool visit(QDeclarativeJS::AST::DefaultClause *);
- virtual void endVisit(QDeclarativeJS::AST::DefaultClause *);
-
virtual bool visit(QDeclarativeJS::AST::LabelledStatement *);
- virtual void endVisit(QDeclarativeJS::AST::LabelledStatement *);
-
virtual bool visit(QDeclarativeJS::AST::ThrowStatement *);
- virtual void endVisit(QDeclarativeJS::AST::ThrowStatement *);
-
virtual bool visit(QDeclarativeJS::AST::TryStatement *);
- virtual void endVisit(QDeclarativeJS::AST::TryStatement *);
-
virtual bool visit(QDeclarativeJS::AST::Catch *);
- virtual void endVisit(QDeclarativeJS::AST::Catch *);
-
virtual bool visit(QDeclarativeJS::AST::Finally *);
- virtual void endVisit(QDeclarativeJS::AST::Finally *);
-
virtual bool visit(QDeclarativeJS::AST::FunctionDeclaration *);
- virtual void endVisit(QDeclarativeJS::AST::FunctionDeclaration *);
-
virtual bool visit(QDeclarativeJS::AST::FunctionExpression *);
- virtual void endVisit(QDeclarativeJS::AST::FunctionExpression *);
-
virtual bool visit(QDeclarativeJS::AST::FormalParameterList *);
- virtual void endVisit(QDeclarativeJS::AST::FormalParameterList *);
-
- virtual bool visit(QDeclarativeJS::AST::FunctionBody *);
- virtual void endVisit(QDeclarativeJS::AST::FunctionBody *);
-
- virtual bool visit(QDeclarativeJS::AST::Program *);
- virtual void endVisit(QDeclarativeJS::AST::Program *);
-
- virtual bool visit(QDeclarativeJS::AST::SourceElements *);
- virtual void endVisit(QDeclarativeJS::AST::SourceElements *);
-
- virtual bool visit(QDeclarativeJS::AST::FunctionSourceElement *);
- virtual void endVisit(QDeclarativeJS::AST::FunctionSourceElement *);
-
- virtual bool visit(QDeclarativeJS::AST::StatementSourceElement *);
- virtual void endVisit(QDeclarativeJS::AST::StatementSourceElement *);
-
virtual bool visit(QDeclarativeJS::AST::DebuggerStatement *);
- virtual void endVisit(QDeclarativeJS::AST::DebuggerStatement *);
-
- virtual bool visit(QDeclarativeJS::AST::UiParameterList *);
- virtual void endVisit(QDeclarativeJS::AST::UiParameterList *);
protected:
QString protect(const QString &string);
@@ -333,8 +164,6 @@ private:
QString output;
quint32 cursor;
quint32 commentIndex;
- int indent;
- QString debug;
};
QT_END_NAMESPACE