Qt 4.8
Classes | Macros | Functions
qdeclarativecompiler.cpp File Reference
#include "private/qdeclarativecompiler_p.h"
#include "private/qdeclarativeparser_p.h"
#include "private/qdeclarativescriptparser_p.h"
#include "qdeclarativepropertyvaluesource.h"
#include "qdeclarativecomponent.h"
#include "private/qmetaobjectbuilder_p.h"
#include "private/qdeclarativestringconverters_p.h"
#include "private/qdeclarativeengine_p.h"
#include "qdeclarativeengine.h"
#include "qdeclarativecontext.h"
#include "private/qdeclarativemetatype_p.h"
#include "private/qdeclarativecustomparser_p_p.h"
#include "private/qdeclarativecontext_p.h"
#include "private/qdeclarativecomponent_p.h"
#include "parser/qdeclarativejsast_p.h"
#include "private/qdeclarativevmemetaobject_p.h"
#include "private/qdeclarativeexpression_p.h"
#include "private/qdeclarativeproperty_p.h"
#include "private/qdeclarativerewrite_p.h"
#include "qdeclarativescriptstring.h"
#include "private/qdeclarativeglobal_p.h"
#include "private/qdeclarativebinding_p.h"
#include "private/qdeclarativecompiledbindings_p.h"
#include "private/qdeclarativeglobalscriptclass_p.h"
#include <QColor>
#include <QDebug>
#include <QPointF>
#include <QSizeF>
#include <QRectF>
#include <QAtomicInt>
#include <QtCore/qdebug.h>
#include <QtCore/qdatetime.h>
#include <qdeclarativejsparser_p.h>

Go to the source code of this file.

Classes

struct  StaticQtMetaObject
 

Macros

#define COMPILE_CHECK(a)
 Returns false if is false, otherwise does nothing. More...
 
#define COMPILE_EXCEPTION(token, desc)
 Inserts an error into the QDeclarativeCompiler error list, and returns false (failure). More...
 

Functions

static QStringList astNodeToStringList (QDeclarativeJS::AST::Node *node)
 
 DEFINE_BOOL_CONFIG_OPTION (compilerDump, QML_COMPILER_DUMP)
 
 DEFINE_BOOL_CONFIG_OPTION (compilerStatDump, QML_COMPILER_STATS)
 
 DEFINE_BOOL_CONFIG_OPTION (bindingsDump, QML_BINDINGS_DUMP)
 
static bool ValuePtrLessThan (const QDeclarativeParser::Value *t1, const QDeclarativeParser::Value *t2)
 

Macro Definition Documentation

◆ COMPILE_CHECK

#define COMPILE_CHECK (   a)

◆ COMPILE_EXCEPTION

#define COMPILE_EXCEPTION (   token,
  desc 
)
Value:
{ \
QString exceptionDescription; \
QDeclarativeError error; \
error.setUrl(output->url); \
error.setLine((token)->location.start.line); \
error.setColumn((token)->location.start.column); \
error.setDescription(desc.trimmed()); \
exceptions << error; \
return false; \
}
#define error(msg)
static QTestResult::TestLocation location
Definition: qtestresult.cpp:63

Inserts an error into the QDeclarativeCompiler error list, and returns false (failure).

Warning
This function is not part of the public interface.

token is used to source the error line and column, and desc is the error itself. desc can be an expression that can be piped into QDebug.

For example:

COMPILE_EXCEPTION(property, tr("Error for property \"%1\"").arg(QString::fromUtf8(property->name)));

Definition at line 153 of file qdeclarativecompiler.cpp.

Referenced by QDeclarativeCompiler::buildBinding(), QDeclarativeCompiler::buildComponent(), QDeclarativeCompiler::buildDynamicMeta(), QDeclarativeCompiler::buildGroupedProperty(), QDeclarativeCompiler::buildIdProperty(), QDeclarativeCompiler::buildListProperty(), QDeclarativeCompiler::buildProperty(), QDeclarativeCompiler::buildPropertyAssignment(), QDeclarativeCompiler::buildPropertyInNamespace(), QDeclarativeCompiler::buildPropertyObjectAssignment(), QDeclarativeCompiler::buildPropertyOnAssignment(), QDeclarativeCompiler::buildScriptStringProperty(), QDeclarativeCompiler::buildSignal(), QDeclarativeCompiler::buildValueTypeProperty(), QDeclarativeCompiler::checkDynamicMeta(), QDeclarativeCompiler::checkValidId(), QDeclarativeCompiler::compile(), QDeclarativeCompiler::compileAlias(), QDeclarativeCompiler::mergeDynamicMetaProperties(), QDeclarativeCompiler::testLiteralAssignment(), and QDeclarativeCompiler::testQualifiedEnumAssignment().

Function Documentation

◆ astNodeToStringList()

static QStringList astNodeToStringList ( QDeclarativeJS::AST::Node node)
static

Definition at line 2695 of file qdeclarativecompiler.cpp.

Referenced by QDeclarativeCompiler::compileAlias().

2696 {
2698  QString name =
2699  static_cast<QDeclarativeJS::AST::IdentifierExpression *>(node)->name->asString();
2700  return QStringList() << name;
2703 
2704  QStringList rv = astNodeToStringList(expr->base);
2705  if (rv.isEmpty())
2706  return rv;
2707  rv.append(expr->name->asString());
2708  return rv;
2709  }
2710  return QStringList();
2711 }
static QStringList astNodeToStringList(QDeclarativeJS::AST::Node *node)
const QString asString() const
The QString class provides a Unicode character string.
Definition: qstring.h:83
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
const char * name
The QStringList class provides a list of strings.
Definition: qstringlist.h:66

◆ DEFINE_BOOL_CONFIG_OPTION() [1/3]

DEFINE_BOOL_CONFIG_OPTION ( compilerDump  ,
QML_COMPILER_DUMP   
)

◆ DEFINE_BOOL_CONFIG_OPTION() [2/3]

DEFINE_BOOL_CONFIG_OPTION ( compilerStatDump  ,
QML_COMPILER_STATS   
)

◆ DEFINE_BOOL_CONFIG_OPTION() [3/3]

DEFINE_BOOL_CONFIG_OPTION ( bindingsDump  ,
QML_BINDINGS_DUMP   
)

◆ ValuePtrLessThan()

static bool ValuePtrLessThan ( const QDeclarativeParser::Value t1,
const QDeclarativeParser::Value t2 
)
static