diff options
| author | Martin Smith <martin.smith@nokia.com> | 2012-09-13 11:38:45 +0200 |
|---|---|---|
| committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-14 15:23:15 +0200 |
| commit | 14f7eb86ca2275d91f284279af5f77205d4ae3c0 (patch) | |
| tree | ed4e91d6422dd814ac3e81739ad4a3b55bf050c7 /src/tools/qdoc/qmlcodeparser.cpp | |
| parent | 817a4474676b30a964de476d26bd70ddba3d379a (diff) | |
qdoc: Refactoring of qdoc data structures
This commit is the beginning of a significant
overhaul of qdoc. A new class, QDocDatabase, is
added, which will eventually encapsulate all the
data structures used by qdoc. In this commit, the
Tree class is made private and only accessible
from QDocDatabase. Several maps structures are
also moved into QDocDatabase from other classes.
Much dead code and unused parameters were removed.
Further simplification will follow.
Change-Id: I237411c50f3ced0d2fc8d3b0fbfdf4e55880f8e9
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
Diffstat (limited to 'src/tools/qdoc/qmlcodeparser.cpp')
| -rw-r--r-- | src/tools/qdoc/qmlcodeparser.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/src/tools/qdoc/qmlcodeparser.cpp b/src/tools/qdoc/qmlcodeparser.cpp index 57885cfa1a2..e4bdc4ec899 100644 --- a/src/tools/qdoc/qmlcodeparser.cpp +++ b/src/tools/qdoc/qmlcodeparser.cpp @@ -45,10 +45,8 @@ #include "qqmljsast_p.h" #include "qqmljsastvisitor_p.h" - #include "qmlcodeparser.h" #include "node.h" -#include "tree.h" #include "config.h" #include "qmlvisitor.h" #include <qdebug.h> @@ -84,10 +82,16 @@ QT_BEGIN_NAMESPACE #define COMMAND_QMLBASICTYPE Doc::alias("qmlbasictype") #define COMMAND_QMLMODULE Doc::alias("qmlmodule") +/*! + Constructs the QML code parser. + */ QmlCodeParser::QmlCodeParser() { } +/*! + Destroys the QML code parser. + */ QmlCodeParser::~QmlCodeParser() { } @@ -107,7 +111,8 @@ void QmlCodeParser::initializeParser(const Config &config) } /*! - Deletes the lexer and parser created by the constructor. + Terminates the QML code parser. Deletes the lexer and parser + created by the constructor. */ void QmlCodeParser::terminateParser() { @@ -124,7 +129,8 @@ QString QmlCodeParser::language() } /*! - Returns a filter string of "*.qml". + Returns a string list containing "*.qml". This is the only + file type parsed by the QMLN parser. */ QStringList QmlCodeParser::sourceFileNameFilter() { @@ -132,16 +138,13 @@ QStringList QmlCodeParser::sourceFileNameFilter() } /*! - Parses the source file at \a filePath, creating nodes as - needed and inserting them into the \a tree. \a location is - used for error reporting. + Parses the source file at \a filePath and inserts the contents + into the database. The \a location is used for error reporting. - If it can't open the file at \a filePath, it reports an - error and returns without doing anything. + If it can't open the file at \a filePath, it reports an error + and returns without doing anything. */ -void QmlCodeParser::parseSourceFile(const Location& location, - const QString& filePath, - Tree *tree) +void QmlCodeParser::parseSourceFile(const Location& location, const QString& filePath) { QFile in(filePath); currentFile_ = filePath; @@ -170,7 +173,6 @@ void QmlCodeParser::parseSourceFile(const Location& location, QmlDocVisitor visitor(filePath, newCode, &engine, - tree, metacommandsAllowed, topicCommandsAllowed); QQmlJS::AST::Node::accept(ast, &visitor); @@ -184,10 +186,10 @@ void QmlCodeParser::parseSourceFile(const Location& location, } /*! - This function is called when the parser finishes parsing - the file, but in this case the function does nothing. + Performs cleanup after qdoc is done parsing all the QML files. + Currently, no cleanup is required. */ -void QmlCodeParser::doneParsingSourceFiles(Tree *) +void QmlCodeParser::doneParsingSourceFiles() { } |
