Qt 4.8
|
#include <qdeclarativecompiler_p.h>
Classes | |
struct | BindingContext |
struct | BindingReference |
struct | ComponentCompileState |
struct | ComponentStat |
Public Functions | |
bool | compile (QDeclarativeEngine *, QDeclarativeTypeData *, QDeclarativeCompiledData *) |
Compile unit, and store the output in out. More... | |
QList< QDeclarativeError > | errors () const |
Return the list of errors from the last call to compile(), or an empty list if there were no errors. More... | |
int | evaluateEnum (const QByteArray &script) const |
bool | isError () const |
Returns true if the last call to compile() caused errors. More... | |
QDeclarativeCompiler () | |
Instantiate a new QDeclarativeCompiler. More... | |
const QMetaObject * | resolveType (const QByteArray &name) const |
int | rewriteBinding (const QString &expression, const QByteArray &name) |
Static Public Functions | |
static bool | isAttachedPropertyName (const QByteArray &) |
Returns true if name refers to an attached property, false otherwise. More... | |
static bool | isSignalPropertyName (const QByteArray &) |
Returns true if name refers to a signal property, false otherwise. More... | |
Private Types | |
enum | DynamicMetaMode { IgnoreAliases, ResolveAliases, ForceCreation } |
Static Private Functions | |
static void | reset (QDeclarativeCompiledData *) |
Resets data by clearing the lists that the QDeclarativeCompiler modifies. More... | |
static QDeclarativeType * | toQmlType (QDeclarativeParser::Object *from) |
Definition at line 151 of file qdeclarativecompiler_p.h.
|
private |
Enumerator | |
---|---|
IgnoreAliases | |
ResolveAliases | |
ForceCreation |
Definition at line 242 of file qdeclarativecompiler_p.h.
QDeclarativeCompiler::QDeclarativeCompiler | ( | ) |
Instantiate a new QDeclarativeCompiler.
Definition at line 89 of file qdeclarativecompiler.cpp.
|
private |
Definition at line 1796 of file qdeclarativecompiler.cpp.
Referenced by buildBinding(), and buildValueTypeProperty().
|
private |
Definition at line 1787 of file qdeclarativecompiler.cpp.
Referenced by buildComponent(), and buildIdProperty().
|
private |
Definition at line 1823 of file qdeclarativecompiler.cpp.
Referenced by buildProperty(), and buildPropertyInNamespace().
|
private |
Definition at line 2814 of file qdeclarativecompiler.cpp.
Referenced by buildListProperty(), and buildPropertyLiteralAssignment().
|
private |
Definition at line 1239 of file qdeclarativecompiler.cpp.
Referenced by buildObject().
|
private |
Definition at line 1294 of file qdeclarativecompiler.cpp.
Referenced by buildComponent().
|
private |
Definition at line 2432 of file qdeclarativecompiler.cpp.
Referenced by buildObject(), buildPropertyOnAssignment(), and completeComponentBuild().
|
private |
Definition at line 1844 of file qdeclarativecompiler.cpp.
Referenced by buildProperty().
|
private |
Definition at line 1763 of file qdeclarativecompiler.cpp.
Referenced by buildProperty().
|
private |
Definition at line 1966 of file qdeclarativecompiler.cpp.
Referenced by buildProperty().
|
private |
Definition at line 736 of file qdeclarativecompiler.cpp.
Referenced by buildComponentFromRoot(), buildListProperty(), buildPropertyObjectAssignment(), buildPropertyOnAssignment(), buildSignal(), and compileTree().
|
private |
Definition at line 1436 of file qdeclarativecompiler.cpp.
Referenced by buildObject(), buildSignal(), and buildSubObject().
|
private |
Definition at line 2026 of file qdeclarativecompiler.cpp.
Referenced by buildProperty().
|
private |
Definition at line 1576 of file qdeclarativecompiler.cpp.
Referenced by buildProperty().
|
private |
Definition at line 2183 of file qdeclarativecompiler.cpp.
Referenced by buildPropertyAssignment().
|
private |
Definition at line 2059 of file qdeclarativecompiler.cpp.
Referenced by buildPropertyAssignment().
|
private |
Definition at line 2139 of file qdeclarativecompiler.cpp.
Referenced by buildPropertyAssignment(), and buildValueTypeProperty().
|
private |
Definition at line 2010 of file qdeclarativecompiler.cpp.
Referenced by buildProperty().
|
private |
Definition at line 1353 of file qdeclarativecompiler.cpp.
Referenced by buildObject(), and buildSubObject().
|
private |
Definition at line 1321 of file qdeclarativecompiler.cpp.
Referenced by buildAttachedProperty(), and buildGroupedProperty().
|
private |
Definition at line 1896 of file qdeclarativecompiler.cpp.
Referenced by buildGroupedProperty().
|
private |
Returns true if from can be assigned to a (QObject) property of type to.
Definition at line 3048 of file qdeclarativecompiler.cpp.
Referenced by buildListProperty().
|
private |
Definition at line 2345 of file qdeclarativecompiler.cpp.
Referenced by buildObject().
|
private |
Definition at line 2668 of file qdeclarativecompiler.cpp.
Referenced by buildComponent(), and buildIdProperty().
bool QDeclarativeCompiler::compile | ( | QDeclarativeEngine * | engine, |
QDeclarativeTypeData * | unit, | ||
QDeclarativeCompiledData * | out | ||
) |
Compile unit, and store the output in out.
engine is the QDeclarativeEngine with which the QDeclarativeCompiledData will be associated.
Returns true on success, false on failure. On failure, the compile errors are available from errors().
If the environment variant QML_COMPILER_DUMP is set (eg. QML_COMPILER_DUMP=1) the compiled instructions will be dumped to stderr on a successful compiler.
Definition at line 573 of file qdeclarativecompiler.cpp.
Referenced by QDeclarativeTypeData::compile().
|
private |
Definition at line 2713 of file qdeclarativecompiler.cpp.
Referenced by buildDynamicMeta().
|
private |
Definition at line 651 of file qdeclarativecompiler.cpp.
Referenced by compile().
|
private |
Definition at line 2916 of file qdeclarativecompiler.cpp.
Referenced by buildComponentFromRoot(), and compileTree().
|
private |
Definition at line 1812 of file qdeclarativecompiler.cpp.
Referenced by genComponent().
|
private |
Definition at line 1339 of file qdeclarativecompiler.cpp.
Referenced by buildPropertyObjectAssignment().
|
private |
Definition at line 3074 of file qdeclarativecompiler.cpp.
Referenced by buildObject().
|
private |
Returns true if (value) property prop exists on obj, false otherwise.
Definition at line 1416 of file qdeclarativecompiler.cpp.
Referenced by buildObject().
|
private |
Definition at line 2995 of file qdeclarativecompiler.cpp.
Referenced by compile().
QList< QDeclarativeError > QDeclarativeCompiler::errors | ( | ) | const |
Return the list of errors from the last call to compile(), or an empty list if there were no errors.
Definition at line 108 of file qdeclarativecompiler.cpp.
Referenced by QDeclarativeTypeData::compile().
int QDeclarativeCompiler::evaluateEnum | ( | const QByteArray & | script | ) | const |
Definition at line 2284 of file qdeclarativecompiler.cpp.
|
private |
Definition at line 2836 of file qdeclarativecompiler.cpp.
Referenced by genListProperty(), and genPropertyAssignment().
|
private |
Definition at line 1184 of file qdeclarativecompiler.cpp.
Referenced by genObject().
|
private |
Definition at line 2883 of file qdeclarativecompiler.cpp.
Referenced by compileTree(), and genComponent().
|
private |
Definition at line 1620 of file qdeclarativecompiler.cpp.
Referenced by genValueProperty().
|
private |
Generate a store instruction for assigning literal v to property prop.
Any literal assignment that is approved in testLiteralAssignment() must have a corresponding action in this method.
Definition at line 326 of file qdeclarativecompiler.cpp.
Referenced by genPropertyAssignment().
|
private |
Definition at line 910 of file qdeclarativecompiler.cpp.
Referenced by compileTree(), genComponent(), genListProperty(), genObjectBody(), and genPropertyAssignment().
|
private |
Definition at line 1010 of file qdeclarativecompiler.cpp.
Referenced by genObject().
|
private |
Definition at line 1665 of file qdeclarativecompiler.cpp.
Referenced by genValueProperty(), and genValueTypeProperty().
|
private |
Definition at line 2911 of file qdeclarativecompiler.cpp.
Referenced by genBindingAssignment(), and genPropertyAssignment().
|
private |
Definition at line 1610 of file qdeclarativecompiler.cpp.
Referenced by genObjectBody().
|
private |
Definition at line 2899 of file qdeclarativecompiler.cpp.
Referenced by genBindingAssignment(), and genPropertyAssignment().
|
private |
Definition at line 1149 of file qdeclarativecompiler.cpp.
Referenced by genObjectBody().
|
private |
Definition at line 3129 of file qdeclarativecompiler.cpp.
Referenced by buildProperty(), buildSignal(), compileAlias(), doesPropertyExist(), and indexOfSignal().
|
private |
Definition at line 3088 of file qdeclarativecompiler.cpp.
Referenced by buildSignal().
|
static |
Returns true if name refers to an attached property, false otherwise.
Attached property names are those that start with a capital letter.
Definition at line 118 of file qdeclarativecompiler.cpp.
Referenced by buildObject(), buildProperty(), buildPropertyInNamespace(), and doesPropertyExist().
bool QDeclarativeCompiler::isError | ( | ) | const |
Returns true if the last call to compile() caused errors.
Definition at line 99 of file qdeclarativecompiler.cpp.
Referenced by compile().
|
static |
Returns true if name refers to a signal property, false otherwise.
Signal property names are those that start with "on", followed by a capital letter.
Definition at line 129 of file qdeclarativecompiler.cpp.
Referenced by buildObject(), and buildSubObject().
|
private |
Definition at line 2401 of file qdeclarativecompiler.cpp.
Referenced by buildObject().
|
staticprivate |
Resets data by clearing the lists that the QDeclarativeCompiler modifies.
Definition at line 551 of file qdeclarativecompiler.cpp.
Referenced by compile().
const QMetaObject * QDeclarativeCompiler::resolveType | ( | const QByteArray & | name | ) | const |
Definition at line 2304 of file qdeclarativecompiler.cpp.
int QDeclarativeCompiler::rewriteBinding | ( | const QString & | expression, |
const QByteArray & | name | ||
) |
Definition at line 2316 of file qdeclarativecompiler.cpp.
Referenced by completeComponentBuild().
|
private |
Definition at line 1802 of file qdeclarativecompiler.cpp.
Referenced by completeComponentBuild().
|
private |
Returns true if literal v can be assigned to property prop, otherwise false.
This test corresponds to action taken by genLiteralAssignment(). Any change made here, must have a corresponding action in genLiteralAssigment().
Definition at line 185 of file qdeclarativecompiler.cpp.
Referenced by buildPropertyLiteralAssignment(), and buildValueTypeProperty().
|
private |
Definition at line 2220 of file qdeclarativecompiler.cpp.
Referenced by buildPropertyLiteralAssignment(), and buildValueTypeProperty().
|
staticprivate |
Definition at line 3062 of file qdeclarativecompiler.cpp.
Referenced by buildObject(), buildPropertyOnAssignment(), genPropertyAssignment(), and testQualifiedEnumAssignment().
|
private |
Definition at line 321 of file qdeclarativecompiler_p.h.
Referenced by addBindingReference(), addId(), buildComponent(), buildComponentFromRoot(), buildDynamicMeta(), buildIdProperty(), buildObject(), buildSignal(), compile(), compileAlias(), compileTree(), completeComponentBuild(), genBindingAssignment(), genComponent(), genContextCache(), genObject(), genObjectBody(), and saveComponentState().
|
private |
Definition at line 334 of file qdeclarativecompiler_p.h.
Referenced by buildComponentFromRoot(), buildObject(), compileTree(), completeComponentBuild(), and saveComponentState().
|
private |
Definition at line 344 of file qdeclarativecompiler_p.h.
Referenced by buildDynamicMeta(), compile(), compileTree(), genComponent(), genContextCache(), and genObject().
|
private |
Definition at line 345 of file qdeclarativecompiler_p.h.
Referenced by buildDynamicMeta(), buildGroupedProperty(), buildListProperty(), buildProperty(), buildPropertyObjectAssignment(), canCoerce(), checkDynamicMeta(), checkValidId(), compile(), compileAlias(), compileTree(), completeComponentBuild(), genListProperty(), genValueProperty(), and genValueTypeData().
|
private |
Definition at line 342 of file qdeclarativecompiler_p.h.
Referenced by buildObject(), compile(), errors(), and isError().
|
private |
Definition at line 343 of file qdeclarativecompiler_p.h.
Referenced by buildDynamicMeta(), buildObject(), buildProperty(), buildPropertyObjectAssignment(), buildPropertyOnAssignment(), compile(), compileTree(), completeComponentBuild(), componentTypeRef(), dumpStats(), genBindingAssignment(), genComponent(), genContextCache(), genListProperty(), genLiteralAssignment(), genObject(), genObjectBody(), genPropertyAssignment(), genPropertyData(), genValueTypeData(), genValueTypeProperty(), indexOfProperty(), indexOfSignal(), and rewriteBinding().
|
private |
Definition at line 339 of file qdeclarativecompiler_p.h.
Referenced by compile(), componentState(), and saveComponentState().
|
private |
Definition at line 340 of file qdeclarativecompiler_p.h.
Referenced by dumpStats(), and saveComponentState().
|
private |
Definition at line 347 of file qdeclarativecompiler_p.h.
Referenced by buildDynamicMeta(), buildProperty(), buildPropertyInNamespace(), buildSignal(), compile(), compileTree(), completeComponentBuild(), evaluateEnum(), resolveType(), and testQualifiedEnumAssignment().
|
private |
Definition at line 346 of file qdeclarativecompiler_p.h.
Referenced by compile(), genComponent(), and genObject().