summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/qmlparser.cpp
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-07-14 03:54:55 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-07-15 07:30:16 (GMT)
commit4f7e21dc04ce93531ef68f7694a5e8969448de8b (patch)
treece7e8170b5be6c974420d012a03f620f86cd6d8d /src/declarative/qml/qmlparser.cpp
parent9eca9e028884fb82d97e284826faa7965af356bd (diff)
downloadQt-4f7e21dc04ce93531ef68f7694a5e8969448de8b.zip
Qt-4f7e21dc04ce93531ef68f7694a5e8969448de8b.tar.gz
Qt-4f7e21dc04ce93531ef68f7694a5e8969448de8b.tar.bz2
Rework compiler to a two phase analyse/generate approach
Diffstat (limited to 'src/declarative/qml/qmlparser.cpp')
-rw-r--r--src/declarative/qml/qmlparser.cpp44
1 files changed, 38 insertions, 6 deletions
diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp
index 8daab6a..02f229e 100644
--- a/src/declarative/qml/qmlparser.cpp
+++ b/src/declarative/qml/qmlparser.cpp
@@ -62,7 +62,8 @@ QT_BEGIN_NAMESPACE
using namespace QmlParser;
QmlParser::Object::Object()
-: type(-1), metatype(0), extObjectData(0), defaultProperty(0)
+: type(-1), metatype(0), extObjectData(0), defaultProperty(0),
+ parserStatusCast(-1)
{
}
@@ -71,6 +72,10 @@ QmlParser::Object::~Object()
if (defaultProperty) defaultProperty->release();
foreach(Property *prop, properties)
prop->release();
+ foreach(Property *prop, valueProperties)
+ prop->release();
+ foreach(Property *prop, signalProperties)
+ prop->release();
}
const QMetaObject *Object::metaObject() const
@@ -90,6 +95,30 @@ QmlParser::Property *Object::getDefaultProperty()
return defaultProperty;
}
+void QmlParser::Object::addValueProperty(Property *p)
+{
+ p->addref();
+ valueProperties << p;
+}
+
+void QmlParser::Object::addSignalProperty(Property *p)
+{
+ p->addref();
+ signalProperties << p;
+}
+
+void QmlParser::Object::addAttachedProperty(Property *p)
+{
+ p->addref();
+ attachedProperties << p;
+}
+
+void QmlParser::Object::addGroupedProperty(Property *p)
+{
+ p->addref();
+ groupedProperties << p;
+}
+
Property *QmlParser::Object::getProperty(const QByteArray &name, bool create)
{
if (!properties.contains(name)) {
@@ -160,12 +189,13 @@ void QmlParser::Object::dump(int indent) const
}
QmlParser::Property::Property()
-: parent(0), type(0), index(-1), value(0), isDefault(true)
+: parent(0), type(0), index(-1), value(0), isDefault(true), isDeferred(false)
{
}
QmlParser::Property::Property(const QByteArray &n)
-: parent(0), type(0), index(-1), value(0), name(n), isDefault(false)
+: parent(0), type(0), index(-1), value(0), name(n), isDefault(false),
+ isDeferred(false)
{
}
@@ -187,6 +217,11 @@ void QmlParser::Property::addValue(Value *v)
values << v;
}
+bool QmlParser::Property::isEmpty() const
+{
+ return !value && values.isEmpty();
+}
+
void QmlParser::Property::dump(int indent) const
{
QByteArray ba(indent * 4, ' ');
@@ -232,9 +267,6 @@ void QmlParser::Value::dump(int indent) const
case Value::SignalExpression:
type = "SignalExpression";
break;
- case Value::Component:
- type = "Component";
- break;
case Value::Id:
type = "Id";
break;