Commit dfd58916 authored by Christian Kamm's avatar Christian Kamm

QmlJS: Add documentation for QmlJS::Value.

Also:
* Remove unnecessary QmlJS:: qualifications in existing documentation.
* Remove unnecessary explicit links in the documentation.

Change-Id: Icb41941d98b5cfe9d2fb3b3887fafee16635eb13
Reviewed-by: default avatarLeandro Melo <leandro.melo@nokia.com>
parent 35cad941
......@@ -48,17 +48,16 @@ using namespace QmlJS::AST;
/*!
\class QmlJS::Bind
\brief Collected information about a single Document.
\sa QmlJS::Document QmlJS::Context
\sa Document Context
Each QmlJS::Document owns an instance of Bind. It provides access to data
Each Document owns an instance of Bind. It provides access to data
that can be derived by looking at the document in isolation. If you need
information that goes beyond that, you need to use a
\l{QmlJS::Context}.
information that goes beyond that, you need to use a Context.
The document's imports are classified and available through imports().
This class makes the structural information found in the AST available
for analysis through \l{QmlJS::Value} instances. See findQmlObject(),
for analysis through Value instances. See findQmlObject(),
idEnvironment(), rootObjectValue() and findAttachedJSScope().
*/
......
......@@ -39,10 +39,10 @@ using namespace QmlJS::AST;
/*!
\class QmlJS::Context
\brief Holds information about relationships between documents in a QmlJS::Snapshot.
\sa QmlJS::Document QmlJS::Link QmlJS::Snapshot
\brief Holds information about relationships between documents in a Snapshot.
\sa Document Link Snapshot
Contexts are usually created through \l{QmlJS::Link}.
Contexts are usually created through Link.
Once created, a Context is immutable and can be freely shared between threads.
......
......@@ -44,15 +44,15 @@ using namespace QmlJS::AST;
/*!
\class QmlJS::Document
\brief A Qml or JavaScript document.
\sa QmlJS::Snapshot
\sa Snapshot
Documents are usually created by the \l{QmlJS::ModelManagerInterface}
and stored in a \l{QmlJS::Snapshot}. They allow access to data such as
the file path, source code, abstract syntax tree and the \l{QmlJS::Bind}
Documents are usually created by the ModelManagerInterface
and stored in a Snapshot. They allow access to data such as
the file path, source code, abstract syntax tree and the Bind
instance for the document.
To make sure unused and outdated documents are removed correctly, Document
instances are usually accessed through a shared pointer, see \l{Document::Ptr}.
instances are usually accessed through a shared pointer, see Document::Ptr.
Documents in a Snapshot are immutable: They, or anything reachable through them,
must not be changed. This allows Documents to be shared freely among threads
......@@ -62,9 +62,9 @@ using namespace QmlJS::AST;
/*!
\class QmlJS::LibraryInfo
\brief A Qml library.
\sa QmlJS::Snapshot
\sa Snapshot
A LibraryInfo is created when the \l{QmlJS::ModelManagerInterface} finds
A LibraryInfo is created when the ModelManagerInterface finds
a Qml library and parses the qmldir file. The instance holds information about
which Components the library provides and which plugins to load.
......@@ -76,12 +76,12 @@ using namespace QmlJS::AST;
/*!
\class QmlJS::Snapshot
\brief A set of Document::Ptr and LibraryInfo instances.
\sa QmlJS::Document QmlJS::LibraryInfo
\sa Document LibraryInfo
A Snapshot holds and offers access to a set of Document and LibraryInfo instances.
Usually Snapshots are copies of the snapshot maintained and updated by the
\l{QmlJS::ModelManagerInterface} that updates its instance as parsing
ModelManagerInterface that updates its instance as parsing
threads finish and new information becomes available.
*/
......
......@@ -61,6 +61,35 @@ using namespace LanguageUtils;
using namespace QmlJS;
using namespace QmlJS::AST;
/*!
\class QmlJS::Value
\brief Abstract base class for the result of a JS expression.
\sa Evaluate ValueOwner ValueVisitor
A Value represents a category of JavaScript values, such as number
(NumberValue), string (StringValue) or functions with a
specific signature (FunctionValue). It can also represent internal
categories such as "a QML component instantiation defined in a file"
(ASTObjectValue), "a QML component defined in C++"
(CppComponentValue) or "no specific information is available"
(UnknownValue).
The Value class itself provides accept() for admitting
\l{ValueVisitor}s and a do-nothing getSourceLocation().
Value instances should be cast to a derived type either through the
asXXX() helper functions such as asNumberValue() or via the
value_cast() template function.
Values are the result of many operations in the QmlJS code model:
\list
\o \l{Evaluate}
\o Context::lookupType() and Context::lookupReference()
\o ScopeChain::lookup()
\o ObjectValue::lookupMember()
\endlist
*/
namespace {
class LookupMember: public MemberProcessor
......
......@@ -126,7 +126,7 @@ public:
/*!
\class QmlJS::Link
\brief Creates a Context for a Snapshot.
\sa QmlJS::Context QmlJS::Snapshot
\sa Context Snapshot
Initializes a context by resolving imports. This is an expensive operation.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment