diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-04-30 03:26:05 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-04-30 03:26:05 (GMT) |
commit | 0ee6bf1226f3069f117d0b0b75df14ddf38e75de (patch) | |
tree | 01a63f8585790624e1746ba1b43cd91731699e42 /src/declarative | |
parent | 0a4b78de06b60a5fc0a9182687ded099968c4055 (diff) | |
parent | 0282ea19722c247157c652ef9122379f0e715497 (diff) | |
download | Qt-0ee6bf1226f3069f117d0b0b75df14ddf38e75de.zip Qt-0ee6bf1226f3069f117d0b0b75df14ddf38e75de.tar.gz Qt-0ee6bf1226f3069f117d0b0b75df14ddf38e75de.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
38 files changed, 1849 insertions, 1265 deletions
diff --git a/src/declarative/extra/qmlxmllistmodel.cpp b/src/declarative/extra/qmlxmllistmodel.cpp index 562a1c8..91c8139 100644 --- a/src/declarative/extra/qmlxmllistmodel.cpp +++ b/src/declarative/extra/qmlxmllistmodel.cpp @@ -192,13 +192,13 @@ QString QmlXmlListModel::toString(int role) const return d->roleNames.at(index); } -QString QmlXmlListModel::src() const +QString QmlXmlListModel::source() const { Q_D(const QmlXmlListModel); return d->src; } -void QmlXmlListModel::setSrc(const QString &src) +void QmlXmlListModel::setSource(const QString &src) { Q_D(QmlXmlListModel); d->src = src; diff --git a/src/declarative/extra/qmlxmllistmodel.h b/src/declarative/extra/qmlxmllistmodel.h index a8f3087..d06cabf 100644 --- a/src/declarative/extra/qmlxmllistmodel.h +++ b/src/declarative/extra/qmlxmllistmodel.h @@ -90,7 +90,7 @@ class Q_DECLARATIVE_EXPORT QmlXmlListModel : public QListModelInterface, public Q_OBJECT Q_INTERFACES(QmlParserStatus) - Q_PROPERTY(QString src READ src WRITE setSrc) + Q_PROPERTY(QString source READ source WRITE setSource) Q_PROPERTY(QString query READ query WRITE setQuery) Q_PROPERTY(QString namespaceDeclarations READ namespaceDeclarations WRITE setNamespaceDeclarations) Q_PROPERTY(QmlList<XmlListModelRole *> *roles READ roleObjects) @@ -106,8 +106,8 @@ public: QmlList<XmlListModelRole *> *roleObjects(); - QString src() const; - void setSrc(const QString&); + QString source() const; + void setSource(const QString&); QString query() const; void setQuery(const QString&); diff --git a/src/declarative/fx/qfxcomponentinstance.cpp b/src/declarative/fx/qfxcomponentinstance.cpp index 951c25d..5343f7d 100644 --- a/src/declarative/fx/qfxcomponentinstance.cpp +++ b/src/declarative/fx/qfxcomponentinstance.cpp @@ -51,15 +51,14 @@ QML_DEFINE_TYPE(QFxComponentInstance,ComponentInstance); /*! \internal - \class QFxComponentInstance - \qmlclass ComponentInstance + \class QFxComponentInstance ComponentInstance \brief The QFxComponentInstance class provides a way to instantiate an item from a component. */ /*! \qmlclass ComponentInstance QFxComponentInstance - \brief The ComponentInstance element allows you to instantiate an arbitrary component. + \brief The ComponentInstance element allows you to instantiate a \l{qml-component.html} {Component}. \code <Item> diff --git a/src/declarative/fx/qfxflipable.cpp b/src/declarative/fx/qfxflipable.cpp index 9db0b57..1d15827 100644 --- a/src/declarative/fx/qfxflipable.cpp +++ b/src/declarative/fx/qfxflipable.cpp @@ -49,11 +49,17 @@ QML_DEFINE_TYPE(QFxFlipable,Flipable); class QFxFlipablePrivate : public QFxItemPrivate { public: - QFxFlipablePrivate() : current(QFxFlipable::Front), front(0), back(0) {} + QFxFlipablePrivate() : current(QFxFlipable::Front), front(0), back(0), axis(0), rotation(0) {} + + void setBackTransform(); + void _q_updateAxis(); QFxFlipable::Side current; QFxItem *front; QFxItem *back; + QFxAxis *axis; + QFxRotation axisRotation; + qreal rotation; }; /*! @@ -65,18 +71,18 @@ public: \code <Flipable id="flipable" width="40" height="40"> - <transform> - <Axis id="axis" xStart="20" xEnd="20" yStart="20" yEnd="0" /> - </transform> + <axis> + <Axis startX="20" startY="0" endX="20" endY="40" /> + </axis> <front> - <Image file="front.png"/> + <Image src="front.png"/> </front> <back> - <Image file="back.png"/> + <Image src="back.png"/> </back> <states> <State name="back"> - <SetProperty target="{axis}" property="rotation" value="180" /> + <SetProperty target="{flipable}" property="rotation" value="180" /> </State> </states> <transitions> @@ -153,6 +159,114 @@ void QFxFlipable::setBack(QFxItem *back) children()->append(d->back); if (Front == d->current) d->back->setOpacity(0.); + d->setBackTransform(); +} + +/*! + \qmlproperty Axis Flipable::axis + + The axis to flip around. See the \l Axis documentation for more + information on specifying an axis. +*/ + +QFxAxis *QFxFlipable::axis() +{ + Q_D(QFxFlipable); + return d->axis; +} + +void QFxFlipable::setAxis(QFxAxis *axis) +{ + Q_D(QFxFlipable); + //### disconnect if we are already connected? + if (d->axis) + disconnect(d->axis, SIGNAL(updated()), this, SLOT(_q_updateAxis())); + d->axis = axis; + connect(d->axis, SIGNAL(updated()), this, SLOT(_q_updateAxis())); + d->_q_updateAxis(); +} + +void QFxFlipablePrivate::_q_updateAxis() +{ + axisRotation.axis()->setStartX(axis->startX()); + axisRotation.axis()->setStartY(axis->startY()); + axisRotation.axis()->setEndX(axis->endX()); + axisRotation.axis()->setEndY(axis->endY()); + axisRotation.axis()->setEndZ(axis->endZ()); + + setBackTransform(); +} + +void QFxFlipablePrivate::setBackTransform() +{ + if (!back) + return; + + QPointF p1(0, 0); + QPointF p2(1, 0); + QPointF p3(1, 1); + + axisRotation.setAngle(180); + p1 = axisRotation.transform().map(p1); + p2 = axisRotation.transform().map(p2); + p3 = axisRotation.transform().map(p3); + axisRotation.setAngle(rotation); + + QSimpleCanvas::Matrix mat; +#ifdef QFX_RENDER_OPENGL + mat.translate(back->width()/2,back->height()/2, 0); + if (back->width() && p1.x() >= p2.x()) + mat.rotate(180, 0, 1, 0); + if (back->height() && p2.y() >= p3.y()) + mat.rotate(180, 1, 0, 0); + mat.translate(-back->width()/2,-back->height()/2, 0); +#else + mat.translate(back->width()/2,back->height()/2); + if (back->width() && p1.x() >= p2.x()) + mat.rotate(180, Qt::YAxis); + if (back->height() && p2.y() >= p3.y()) + mat.rotate(180, Qt::XAxis); + mat.translate(-back->width()/2,-back->height()/2); +#endif + back->setTransform(mat); +} + +/*! + \qmlproperty real Flipable::rotation + The angle to rotate the flipable. For example, to show the back side of the flipable + you can set the rotation to 180. +*/ +qreal QFxFlipable::rotation() const +{ + Q_D(const QFxFlipable); + return d->rotation; +} + +void QFxFlipable::setRotation(qreal angle) +{ + Q_D(QFxFlipable); + d->rotation = angle; + d->axisRotation.setAngle(angle); + setTransform(d->axisRotation.transform()); + + + int simpleAngle = int(angle) % 360; + + Side newSide; + if (simpleAngle < 91 || simpleAngle > 270) { + newSide = Front; + } else { + newSide = Back; + } + + if (newSide != d->current) { + d->current = newSide; + if (d->front) + d->front->setOpacity((d->current==Front)?1.:0.); + if (d->back) + d->back->setOpacity((d->current==Back)?1.:0.); + emit sideChanged(); + } } /*! @@ -167,6 +281,9 @@ QFxFlipable::Side QFxFlipable::side() const return d->current; } +//in some cases the user may want to specify a more complex transformation. +//in that case, we still allow the generic use of transform. +//(the logic here should be kept in sync with setBackTransform and setRotation) void QFxFlipable::transformChanged(const QSimpleCanvas::Matrix &trans) { Q_D(QFxFlipable); @@ -218,3 +335,5 @@ void QFxFlipable::transformChanged(const QSimpleCanvas::Matrix &trans) } QT_END_NAMESPACE + +#include "moc_qfxflipable.cpp" diff --git a/src/declarative/fx/qfxflipable.h b/src/declarative/fx/qfxflipable.h index 2c6c849..ef1832e 100644 --- a/src/declarative/fx/qfxflipable.h +++ b/src/declarative/fx/qfxflipable.h @@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) +class QFxAxis; class QFxFlipablePrivate; class Q_DECLARATIVE_EXPORT QFxFlipable : public QFxItem { @@ -63,6 +64,8 @@ class Q_DECLARATIVE_EXPORT QFxFlipable : public QFxItem Q_ENUMS(Side); Q_PROPERTY(QFxItem *front READ front WRITE setFront) Q_PROPERTY(QFxItem *back READ back WRITE setBack) + Q_PROPERTY(QFxAxis *axis READ axis WRITE setAxis) + Q_PROPERTY(qreal rotation READ rotation WRITE setRotation) Q_PROPERTY(Side side READ side NOTIFY sideChanged) public: QFxFlipable(QFxItem *parent=0); @@ -74,6 +77,12 @@ public: QFxItem *back(); void setBack(QFxItem *); + QFxAxis *axis(); + void setAxis(QFxAxis *axis); + + qreal rotation() const; + void setRotation(qreal angle); + enum Side { Front, Back }; Side side() const; @@ -84,6 +93,7 @@ Q_SIGNALS: void sideChanged(); private: + Q_PRIVATE_SLOT(d_func(), void _q_updateAxis()) Q_DISABLE_COPY(QFxFlipable) Q_DECLARE_PRIVATE(QFxFlipable) }; diff --git a/src/declarative/fx/qfxhighlightfilter.cpp b/src/declarative/fx/qfxhighlightfilter.cpp index ab0512c..70b50cd 100644 --- a/src/declarative/fx/qfxhighlightfilter.cpp +++ b/src/declarative/fx/qfxhighlightfilter.cpp @@ -119,7 +119,7 @@ QFxHighlightFilter::~QFxHighlightFilter() */ /*! - \property QFxHighlightFilter::src + \property QFxHighlightFilter::source \brief the URL of the image to be used as the highlight. */ QString QFxHighlightFilter::source() const diff --git a/src/declarative/fx/qfxhighlightfilter.h b/src/declarative/fx/qfxhighlightfilter.h index 6204242..218f4e1 100644 --- a/src/declarative/fx/qfxhighlightfilter.h +++ b/src/declarative/fx/qfxhighlightfilter.h @@ -56,7 +56,7 @@ class Q_DECLARATIVE_EXPORT QFxHighlightFilter : public QSimpleCanvasFilter { Q_OBJECT - Q_PROPERTY(QString src READ source WRITE setSource NOTIFY sourceChanged) + Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged) Q_PROPERTY(bool tiled READ tiled WRITE setTiled NOTIFY tiledChanged) Q_PROPERTY(int xOffset READ xOffset WRITE setXOffset NOTIFY offsetChanged) Q_PROPERTY(int yOffset READ yOffset WRITE setYOffset NOTIFY offsetChanged) diff --git a/src/declarative/fx/qfximage.h b/src/declarative/fx/qfximage.h index 4eed0ef..37fe5be 100644 --- a/src/declarative/fx/qfximage.h +++ b/src/declarative/fx/qfximage.h @@ -57,7 +57,7 @@ class Q_DECLARATIVE_EXPORT QFxImage : public QFxItem Q_ENUMS(Status) Q_PROPERTY(Status status READ status NOTIFY statusChanged) - Q_PROPERTY(QString src READ source WRITE setSource NOTIFY sourceChanged) + Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged) Q_PROPERTY(QFxScaleGrid *scaleGrid READ scaleGrid) Q_PROPERTY(bool tile READ isTiled WRITE setTiled) diff --git a/src/declarative/fx/qfxparticles.cpp b/src/declarative/fx/qfxparticles.cpp index 309ebe8..16b3570 100644 --- a/src/declarative/fx/qfxparticles.cpp +++ b/src/declarative/fx/qfxparticles.cpp @@ -573,10 +573,10 @@ QFxParticles::~QFxParticles() */ /*! - \property QFxParticles::src + \property QFxParticles::source \brief the URL of the particle image. */ -QString QFxParticles::url() const +QString QFxParticles::source() const { Q_D(const QFxParticles); return d->source; @@ -593,7 +593,7 @@ void QFxParticles::imageLoaded() update(); } -void QFxParticles::setUrl(const QString &name) +void QFxParticles::setSource(const QString &name) { Q_D(QFxParticles); diff --git a/src/declarative/fx/qfxparticles.h b/src/declarative/fx/qfxparticles.h index d9c810d..0696e60 100644 --- a/src/declarative/fx/qfxparticles.h +++ b/src/declarative/fx/qfxparticles.h @@ -153,7 +153,7 @@ class Q_DECLARATIVE_EXPORT QFxParticles : public QFxItem { Q_OBJECT - Q_PROPERTY(QString src READ url WRITE setUrl); + Q_PROPERTY(QString source READ source WRITE setSource); Q_PROPERTY(int count READ count WRITE setCount); Q_PROPERTY(int lifeSpan READ lifeSpan WRITE setLifeSpan); Q_PROPERTY(int lifeSpanDeviation READ lifeSpanDeviation WRITE setLifeSpanDeviation); @@ -172,8 +172,8 @@ public: QFxParticles(QFxItem *parent=0); ~QFxParticles(); - QString url() const; - void setUrl(const QString &); + QString source() const; + void setSource(const QString &); int count() const; void setCount(int cnt); diff --git a/src/declarative/fx/qfxtransform.cpp b/src/declarative/fx/qfxtransform.cpp index 9f18413..c355158 100644 --- a/src/declarative/fx/qfxtransform.cpp +++ b/src/declarative/fx/qfxtransform.cpp @@ -85,7 +85,16 @@ void QFxTransform::update() /*! \qmlclass Axis - \brief An axis that can be used for rotation or translation. + \brief The Axis element defines an axis that can be used for rotation or translation. + + An axis is specified by 2 points in 3D space: a start point and + an end point. While technically the axis is the line running through these two points + (and thus many different sets of two points could define the same axis), the distance + between the points does matter for translation along an axis. + + \code + <Axis startX="0" startY="0" endX="20" endY="30"/> + \endcode */ QML_DEFINE_TYPE(QFxAxis, Axis); @@ -99,6 +108,13 @@ QFxAxis::~QFxAxis() { } +/*! + \qmlproperty real Axis::startX + \qmlproperty real Axis::startY + + The start point of the axis. The z-position of the start point is assumed to be 0, and cannot + be changed. +*/ qreal QFxAxis::startX() const { return _startX; @@ -121,6 +137,13 @@ void QFxAxis::setStartY(qreal y) emit updated(); } +/*! + \qmlproperty real Axis::endX + \qmlproperty real Axis::endY + \qmlproperty real Axis::endZ + + The end point of the axis. +*/ qreal QFxAxis::endX() const { return _endX; diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp index a6210e5..7c05088 100644 --- a/src/declarative/fx/qfxwebview.cpp +++ b/src/declarative/fx/qfxwebview.cpp @@ -75,6 +75,73 @@ QML_DEFINE_TYPE(QFxWebView,WebView); static const int MAX_DOUBLECLICK_TIME=500; // XXX need better gesture system +class QFxWebSettings : public QObject { + Q_OBJECT + /* + StandardFont, + FixedFont, + SerifFont, + SansSerifFont, + CursiveFont, + FantasyFont + + MinimumFontSize, + MinimumLogicalFontSize, + DefaultFontSize, + DefaultFixedFontSize + */ + + Q_PROPERTY(bool autoLoadImages READ autoLoadImages WRITE setAutoLoadImages) + Q_PROPERTY(bool javascriptEnabled READ javascriptEnabled WRITE setJavascriptEnabled) + Q_PROPERTY(bool javaEnabled READ javaEnabled WRITE setJavaEnabled) + Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled) + Q_PROPERTY(bool privateBrowsingEnabled READ privateBrowsingEnabled WRITE setPrivateBrowsingEnabled) + Q_PROPERTY(bool javascriptCanOpenWindows READ javascriptCanOpenWindows WRITE setJavascriptCanOpenWindows) + Q_PROPERTY(bool javascriptCanAccessClipboard READ javascriptCanAccessClipboard WRITE setJavascriptCanAccessClipboard) + Q_PROPERTY(bool developerExtrasEnabled READ developerExtrasEnabled WRITE setDeveloperExtrasEnabled) + Q_PROPERTY(bool linksIncludedInFocusChain READ linksIncludedInFocusChain WRITE setLinksIncludedInFocusChain) + Q_PROPERTY(bool zoomTextOnly READ zoomTextOnly WRITE setZoomTextOnly) + Q_PROPERTY(bool printElementBackgrounds READ printElementBackgrounds WRITE setPrintElementBackgrounds) + Q_PROPERTY(bool offlineStorageDatabaseEnabled READ offlineStorageDatabaseEnabled WRITE setOfflineStorageDatabaseEnabled) + Q_PROPERTY(bool offlineWebApplicationCacheEnabled READ offlineWebApplicationCacheEnabled WRITE setOfflineWebApplicationCacheEnabled) + Q_PROPERTY(bool localStorageDatabaseEnabled READ localStorageDatabaseEnabled WRITE setLocalStorageDatabaseEnabled) + +public: + QFxWebSettings() {} + + bool autoLoadImages() const { return s->testAttribute(QWebSettings::AutoLoadImages); } + void setAutoLoadImages(bool on) { s->setAttribute(QWebSettings::AutoLoadImages, on); } + bool javascriptEnabled() const { return s->testAttribute(QWebSettings::JavascriptEnabled); } + void setJavascriptEnabled(bool on) { s->setAttribute(QWebSettings::JavascriptEnabled, on); } + bool javaEnabled() const { return s->testAttribute(QWebSettings::JavaEnabled); } + void setJavaEnabled(bool on) { s->setAttribute(QWebSettings::JavaEnabled, on); } + bool pluginsEnabled() const { return s->testAttribute(QWebSettings::PluginsEnabled); } + void setPluginsEnabled(bool on) { s->setAttribute(QWebSettings::PluginsEnabled, on); } + bool privateBrowsingEnabled() const { return s->testAttribute(QWebSettings::PrivateBrowsingEnabled); } + void setPrivateBrowsingEnabled(bool on) { s->setAttribute(QWebSettings::PrivateBrowsingEnabled, on); } + bool javascriptCanOpenWindows() const { return s->testAttribute(QWebSettings::JavascriptCanOpenWindows); } + void setJavascriptCanOpenWindows(bool on) { s->setAttribute(QWebSettings::JavascriptCanOpenWindows, on); } + bool javascriptCanAccessClipboard() const { return s->testAttribute(QWebSettings::JavascriptCanAccessClipboard); } + void setJavascriptCanAccessClipboard(bool on) { s->setAttribute(QWebSettings::JavascriptCanAccessClipboard, on); } + bool developerExtrasEnabled() const { return s->testAttribute(QWebSettings::DeveloperExtrasEnabled); } + void setDeveloperExtrasEnabled(bool on) { s->setAttribute(QWebSettings::DeveloperExtrasEnabled, on); } + bool linksIncludedInFocusChain() const { return s->testAttribute(QWebSettings::LinksIncludedInFocusChain); } + void setLinksIncludedInFocusChain(bool on) { s->setAttribute(QWebSettings::LinksIncludedInFocusChain, on); } + bool zoomTextOnly() const { return s->testAttribute(QWebSettings::ZoomTextOnly); } + void setZoomTextOnly(bool on) { s->setAttribute(QWebSettings::ZoomTextOnly, on); } + bool printElementBackgrounds() const { return s->testAttribute(QWebSettings::PrintElementBackgrounds); } + void setPrintElementBackgrounds(bool on) { s->setAttribute(QWebSettings::PrintElementBackgrounds, on); } + bool offlineStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::OfflineStorageDatabaseEnabled); } + void setOfflineStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, on); } + bool offlineWebApplicationCacheEnabled() const { return s->testAttribute(QWebSettings::OfflineWebApplicationCacheEnabled); } + void setOfflineWebApplicationCacheEnabled(bool on) { s->setAttribute(QWebSettings::OfflineWebApplicationCacheEnabled, on); } + bool localStorageDatabaseEnabled() const { return s->testAttribute(QWebSettings::LocalStorageDatabaseEnabled); } + void setLocalStorageDatabaseEnabled(bool on) { s->setAttribute(QWebSettings::LocalStorageDatabaseEnabled, on); } + + QWebSettings *s; +}; + + class QFxWebViewPrivate : public QFxItemPrivate { Q_DECLARE_PUBLIC(QFxWebView) @@ -131,6 +198,7 @@ public: QUrl pending_url; QString pending_string; QByteArray pending_data; + mutable QFxWebSettings settings; }; @@ -866,9 +934,6 @@ QWebPage *QFxWebView::page() const wp->setNetworkAccessManager(qmlEngine(this)->networkAccessManager()); - // XXX settable from QML? - wp->settings()->setAttribute(QWebSettings::PluginsEnabled, true); - self->setPage(wp); return wp; @@ -877,6 +942,13 @@ QWebPage *QFxWebView::page() const return d->page; } +// The QObject interface to settings(). +QObject *QFxWebView::settingsObject() const +{ + Q_D(const QFxWebView); + d->settings.s = page()->settings(); + return &d->settings; +} void QFxWebView::setPage(QWebPage *page) { @@ -946,11 +1018,11 @@ QString QFxWebView::html() const void QFxWebView::setHtml(const QString &html, const QUrl &baseUrl) { Q_D(QFxWebView); - d->page->setViewportSize(QSize( + page()->setViewportSize(QSize( d->idealwidth>0 ? d->idealwidth : width(), d->idealheight>0 ? d->idealheight : height())); if (isComponentComplete()) - d->page->mainFrame()->setHtml(html, baseUrl); + page()->mainFrame()->setHtml(html, baseUrl); else { d->pending = d->PendingHtml; d->pending_url = baseUrl; @@ -961,12 +1033,12 @@ void QFxWebView::setHtml(const QString &html, const QUrl &baseUrl) void QFxWebView::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl) { Q_D(QFxWebView); - d->page->setViewportSize(QSize( + page()->setViewportSize(QSize( d->idealwidth>0 ? d->idealwidth : width(), d->idealheight>0 ? d->idealheight : height())); if (isComponentComplete()) - d->page->mainFrame()->setContent(data,mimeType,baseUrl); + page()->mainFrame()->setContent(data,mimeType,baseUrl); else { d->pending = d->PendingContent; d->pending_url = baseUrl; @@ -1031,7 +1103,10 @@ public: QmlEngine *engine = qmlEngine(webview); component = new QmlComponent(engine, url, this); item = 0; - connect(engine, SIGNAL(statusChanged(Status)), this, SLOT(qmlLoaded())); + if (component->isReady()) + qmlLoaded(); + else + connect(component, SIGNAL(statusChanged(QmlComponent::Status)), this, SLOT(qmlLoaded())); } public Q_SLOTS: diff --git a/src/declarative/fx/qfxwebview.h b/src/declarative/fx/qfxwebview.h index 1eede52..6ba4601 100644 --- a/src/declarative/fx/qfxwebview.h +++ b/src/declarative/fx/qfxwebview.h @@ -103,6 +103,8 @@ class Q_DECLARATIVE_EXPORT QFxWebView : public QFxItem Q_PROPERTY(QObject* forward READ forwardAction) Q_PROPERTY(QObject* stop READ stopAction) + Q_PROPERTY(QObject* settings READ settingsObject) + public: QFxWebView(QFxItem *parent=0); ~QFxWebView(); @@ -164,6 +166,7 @@ public: QWebHistory *history() const; QWebSettings *settings() const; + QObject *settingsObject() const; QString status() const; diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 961041e..f9a2165 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -87,7 +87,7 @@ %nonassoc T_IDENTIFIER T_COLON %nonassoc REDUCE_HERE -%start Program +%start UiProgram /. /**************************************************************************** @@ -286,7 +286,7 @@ public: bool parse(JavaScriptEnginePrivate *driver); JavaScript::AST::UiProgram *ast() - { return sym(1).UiProgram; } + { return program; } QList<DiagnosticMessage> diagnosticMessages() const { return diagnostic_messages; } @@ -326,6 +326,8 @@ protected: int *state_stack; JavaScript::AST::SourceLocation *location_stack; + JavaScript::AST::UiProgram *program; + // error recovery enum { TOKEN_BUFFER_SIZE = 3 }; @@ -422,6 +424,7 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) first_token = last_token = 0; tos = -1; + program = 0; do { if (++tos == stack_size) @@ -466,11 +469,12 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) -- Declarative UI -------------------------------------------------------------------------------------------------------- -Program: UiImportListOpt UiObjectMemberList ; +UiProgram: UiImportListOpt UiObjectMemberList ; /. case $rule_number: { - sym(1).Node = makeAstNode<AST::UiProgram> (driver->nodePool(), sym(1).UiImportList, + program = makeAstNode<AST::UiProgram> (driver->nodePool(), sym(1).UiImportList, sym(2).UiObjectMemberList->finish()); + sym(1).UiProgram = program; } break; ./ @@ -602,7 +606,7 @@ case $rule_number: { sym(4).UiObjectMemberList->finish()); node->colonToken = loc(2); node->lbracketToken = loc(3); - node->rbraceToken = loc(5); + node->rbracketToken = loc(5); sym(1).Node = node; } break; ./ @@ -630,6 +634,18 @@ case $rule_number: { } break; ./ +UiObjectMember: T_PUBLIC T_DEFAULT T_IDENTIFIER T_IDENTIFIER ; +/. +case $rule_number: { + AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval); + node->isDefaultMember = true; + node->publicToken = loc(1); + node->attributeTypeToken = loc(3); + node->identifierToken = loc(4); + sym(1).Node = node; +} break; +./ + UiObjectMember: T_PUBLIC T_IDENTIFIER T_IDENTIFIER T_COLON Expression ; /. case $rule_number: { @@ -643,6 +659,20 @@ case $rule_number: { } break; ./ +UiObjectMember: T_PUBLIC T_DEFAULT T_IDENTIFIER T_IDENTIFIER T_COLON Expression ; +/. +case $rule_number: { + AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval, + sym(6).Expression); + node->isDefaultMember = true; + node->publicToken = loc(1); + node->attributeTypeToken = loc(3); + node->identifierToken = loc(4); + node->colonToken = loc(5); + sym(1).Node = node; +} break; +./ + UiObjectMember: FunctionDeclaration ; /. case $rule_number: { @@ -2617,6 +2647,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; yytoken = *tk; yylval = 0; yylloc = token_buffer[0].loc; + yylloc.length = 0; first_token = &token_buffer[0]; last_token = &token_buffer[2]; @@ -2639,6 +2670,7 @@ PropertyNameAndValueListOpt: PropertyNameAndValueList ; yytoken = tk; yylval = 0; yylloc = token_buffer[0].loc; + yylloc.length = 0; action = errorState; goto _Lcheck_token; diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 69958e5..4aa89c9 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -128,6 +128,11 @@ public: startLine(0), startColumn(0) { } + bool isValid() const { return length != 0; } + + quint32 begin() const { return offset; } + quint32 end() const { return offset + length; } + // attributes // ### encode quint32 offset; @@ -2175,6 +2180,40 @@ public: UiObjectMemberList *members; }; +class UiQualifiedId: public Node +{ +public: + JAVASCRIPT_DECLARE_AST_NODE(UiQualifiedId) + + UiQualifiedId(JavaScriptNameIdImpl *name) + : next(this), name(name) + { kind = K; } + + UiQualifiedId(UiQualifiedId *previous, JavaScriptNameIdImpl *name) + : name(name) + { + kind = K; + next = previous->next; + previous->next = this; + } + + virtual ~UiQualifiedId() {} + + UiQualifiedId *finish() + { + UiQualifiedId *head = next; + next = 0; + return head; + } + + virtual void accept0(Visitor *visitor); + +// attributes + UiQualifiedId *next; + JavaScriptNameIdImpl *name; + SourceLocation identifierToken; +}; + class UiImport: public Node { public: @@ -2227,6 +2266,57 @@ public: class UiObjectMember: public Node { +public: + virtual SourceLocation firstSourceLocation() const = 0; + virtual SourceLocation lastSourceLocation() const = 0; +}; + +class UiObjectMemberList: public Node +{ +public: + JAVASCRIPT_DECLARE_AST_NODE(UiObjectMemberList) + + UiObjectMemberList(UiObjectMember *member) + : next(this), member(member) + { kind = K; } + + UiObjectMemberList(UiObjectMemberList *previous, UiObjectMember *member) + : member(member) + { + kind = K; + next = previous->next; + previous->next = this; + } + + virtual void accept0(Visitor *visitor); + + UiObjectMemberList *finish() + { + UiObjectMemberList *head = next; + next = 0; + return head; + } + +// attributes + UiObjectMemberList *next; + UiObjectMember *member; +}; + +class UiObjectInitializer: public Node +{ +public: + JAVASCRIPT_DECLARE_AST_NODE(UiObjectInitializer) + + UiObjectInitializer(UiObjectMemberList *members) + : members(members) + { kind = K; } + + virtual void accept0(Visitor *visitor); + +// attributes + SourceLocation lbraceToken; + UiObjectMemberList *members; + SourceLocation rbraceToken; }; class UiPublicMember: public UiObjectMember @@ -2236,21 +2326,38 @@ public: UiPublicMember(JavaScriptNameIdImpl *memberType, JavaScriptNameIdImpl *name) - : memberType(memberType), name(name), expression(0) + : memberType(memberType), name(name), expression(0), isDefaultMember(false) { kind = K; } UiPublicMember(JavaScriptNameIdImpl *memberType, JavaScriptNameIdImpl *name, ExpressionNode *expression) - : memberType(memberType), name(name), expression(expression) + : memberType(memberType), name(name), expression(expression), isDefaultMember(false) { kind = K; } + virtual SourceLocation firstSourceLocation() const + { return publicToken; } + + virtual SourceLocation lastSourceLocation() const + { + if (expression) + return expression->lastSourceLocation(); + else if (colonToken.isValid()) + return colonToken; + else if (identifierToken.isValid()) + return identifierToken; + else if (attributeTypeToken.isValid()) + return attributeTypeToken; + return publicToken; + } + virtual void accept0(Visitor *visitor); // attributes JavaScriptNameIdImpl *memberType; JavaScriptNameIdImpl *name; ExpressionNode *expression; + bool isDefaultMember; SourceLocation publicToken; SourceLocation attributeTypeToken; SourceLocation identifierToken; @@ -2267,29 +2374,23 @@ public: : name(name), initializer(initializer) { kind = K; } - virtual void accept0(Visitor *visitor); - -// attributes - JavaScriptNameIdImpl *name; - UiObjectInitializer *initializer; - SourceLocation identifierToken; -}; + virtual SourceLocation firstSourceLocation() const + { return identifierToken; } -class UiObjectInitializer: public Node -{ -public: - JAVASCRIPT_DECLARE_AST_NODE(UiObjectInitializer) + virtual SourceLocation lastSourceLocation() const + { + if (initializer) + return initializer->rbraceToken; - UiObjectInitializer(UiObjectMemberList *members) - : members(members) - { kind = K; } + return identifierToken; + } virtual void accept0(Visitor *visitor); // attributes - SourceLocation lbraceToken; - UiObjectMemberList *members; - SourceLocation rbraceToken; + JavaScriptNameIdImpl *name; + UiObjectInitializer *initializer; + SourceLocation identifierToken; }; class UiSourceElement: public UiObjectMember @@ -2301,6 +2402,27 @@ public: : sourceElement(sourceElement) { kind = K; } + virtual SourceLocation firstSourceLocation() const + { + if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement)) + return funDecl->firstSourceLocation(); + else if (VariableStatement *varStmt = cast<VariableStatement *>(sourceElement)) + return varStmt->firstSourceLocation(); + + return SourceLocation(); + } + + virtual SourceLocation lastSourceLocation() const + { + if (FunctionDeclaration *funDecl = cast<FunctionDeclaration *>(sourceElement)) + return funDecl->lastSourceLocation(); + else if (VariableStatement *varStmt = cast<VariableStatement *>(sourceElement)) + return varStmt->lastSourceLocation(); + + return SourceLocation(); + } + + virtual void accept0(Visitor *visitor); // attributes @@ -2320,6 +2442,12 @@ public: initializer(initializer) { kind = K; } + virtual SourceLocation firstSourceLocation() const + { return qualifiedId->identifierToken; } + + virtual SourceLocation lastSourceLocation() const + { return initializer->rbraceToken; } + virtual void accept0(Visitor *visitor); // attributes @@ -2341,6 +2469,12 @@ public: statement(statement) { kind = K; } + virtual SourceLocation firstSourceLocation() const + { return qualifiedId->identifierToken; } + + virtual SourceLocation lastSourceLocation() const + { return statement->lastSourceLocation(); } + virtual void accept0(Visitor *visitor); // attributes @@ -2360,6 +2494,12 @@ public: members(members) { kind = K; } + virtual SourceLocation firstSourceLocation() const + { return lbracketToken; } + + virtual SourceLocation lastSourceLocation() const + { return rbracketToken; } + virtual void accept0(Visitor *visitor); // attributes @@ -2367,75 +2507,9 @@ public: UiObjectMemberList *members; SourceLocation colonToken; SourceLocation lbracketToken; - SourceLocation rbraceToken; -}; - -class UiObjectMemberList: public Node -{ -public: - JAVASCRIPT_DECLARE_AST_NODE(UiObjectMemberList) - - UiObjectMemberList(UiObjectMember *member) - : next(this), member(member) - { kind = K; } - - UiObjectMemberList(UiObjectMemberList *previous, UiObjectMember *member) - : member(member) - { - kind = K; - next = previous->next; - previous->next = this; - } - - virtual void accept0(Visitor *visitor); - - UiObjectMemberList *finish() - { - UiObjectMemberList *head = next; - next = 0; - return head; - } - -// attributes - UiObjectMemberList *next; - UiObjectMember *member; -}; - -class UiQualifiedId: public Node -{ -public: - JAVASCRIPT_DECLARE_AST_NODE(UiQualifiedId) - - UiQualifiedId(JavaScriptNameIdImpl *name) - : next(this), name(name) - { kind = K; } - - UiQualifiedId(UiQualifiedId *previous, JavaScriptNameIdImpl *name) - : name(name) - { - kind = K; - next = previous->next; - previous->next = this; - } - - virtual ~UiQualifiedId() {} - - UiQualifiedId *finish() - { - UiQualifiedId *head = next; - next = 0; - return head; - } - - virtual void accept0(Visitor *visitor); - -// attributes - UiQualifiedId *next; - JavaScriptNameIdImpl *name; - SourceLocation identifierToken; + SourceLocation rbracketToken; }; - } } // namespace AST diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index b06fd32..13c3fad 100644 --- a/src/declarative/qml/parser/javascriptgrammar.cpp +++ b/src/declarative/qml/parser/javascriptgrammar.cpp @@ -1,45 +1,4 @@ // This file was generated by qlalr - DO NOT EDIT! -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - #include "javascriptgrammar_p.h" const char *const JavaScriptGrammar::spell [] = { @@ -56,545 +15,563 @@ const char *const JavaScriptGrammar::spell [] = { const int JavaScriptGrammar::lhs [] = { 88, 89, 89, 92, 92, 93, 93, 91, 90, 90, 95, 95, 97, 97, 96, 94, 96, 94, 96, 94, - 96, 94, 94, 94, 94, 94, 98, 98, 103, 103, + 96, 94, 94, 94, 94, 94, 94, 94, 98, 98, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, - 103, 103, 103, 105, 105, 109, 109, 104, 104, 107, - 107, 110, 110, 110, 110, 111, 111, 111, 111, 111, + 103, 103, 103, 103, 103, 105, 105, 109, 109, 104, + 104, 107, 107, 110, 110, 110, 110, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 111, 111, 111, 111, 112, 112, 113, 113, - 113, 113, 113, 116, 116, 117, 117, 117, 117, 115, - 115, 118, 118, 119, 119, 120, 120, 120, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 122, 122, - 122, 122, 123, 123, 123, 124, 124, 124, 124, 125, - 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, - 126, 126, 127, 127, 127, 127, 127, 128, 128, 128, - 128, 128, 129, 129, 130, 130, 131, 131, 132, 132, - 133, 133, 134, 134, 135, 135, 136, 136, 137, 137, - 138, 138, 139, 139, 140, 140, 108, 108, 141, 141, - 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, - 142, 142, 100, 100, 143, 143, 144, 144, 145, 145, - 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, - 99, 99, 99, 99, 99, 146, 161, 161, 160, 160, - 102, 102, 162, 162, 163, 163, 165, 165, 164, 166, - 169, 167, 167, 170, 168, 168, 147, 148, 148, 149, - 149, 150, 150, 150, 150, 150, 150, 150, 151, 151, - 151, 151, 152, 152, 152, 152, 153, 153, 154, 156, - 171, 171, 174, 174, 172, 172, 175, 173, 155, 157, - 157, 158, 158, 158, 176, 177, 159, 159, 101, 114, - 181, 181, 178, 178, 179, 179, 182, 183, 183, 184, - 184, 180, 180, 106, 106, 185}; + 111, 111, 111, 111, 111, 111, 111, 111, 112, 112, + 113, 113, 113, 113, 113, 116, 116, 117, 117, 117, + 117, 115, 115, 118, 118, 119, 119, 120, 120, 120, + 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, + 122, 122, 122, 122, 123, 123, 123, 124, 124, 124, + 124, 125, 125, 125, 125, 125, 125, 125, 126, 126, + 126, 126, 126, 126, 127, 127, 127, 127, 127, 128, + 128, 128, 128, 128, 129, 129, 130, 130, 131, 131, + 132, 132, 133, 133, 134, 134, 135, 135, 136, 136, + 137, 137, 138, 138, 139, 139, 140, 140, 108, 108, + 141, 141, 142, 142, 142, 142, 142, 142, 142, 142, + 142, 142, 142, 142, 100, 100, 143, 143, 144, 144, + 145, 145, 99, 99, 99, 99, 99, 99, 99, 99, + 99, 99, 99, 99, 99, 99, 99, 146, 161, 161, + 160, 160, 102, 102, 162, 162, 163, 163, 165, 165, + 164, 166, 169, 167, 167, 170, 168, 168, 147, 148, + 148, 149, 149, 150, 150, 150, 150, 150, 150, 150, + 151, 151, 151, 151, 152, 152, 152, 152, 153, 153, + 154, 156, 171, 171, 174, 174, 172, 172, 175, 173, + 155, 157, 157, 158, 158, 158, 176, 177, 159, 159, + 101, 114, 181, 181, 178, 178, 179, 179, 182, 183, + 183, 184, 184, 180, 180, 106, 106, 185}; const int JavaScriptGrammar:: rhs[] = { 2, 1, 1, 1, 2, 3, 3, 0, 1, 2, 1, 3, 2, 3, 4, 4, 2, 2, 5, 5, - 3, 3, 3, 5, 1, 1, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 3, 3, 5, - 3, 4, 3, 2, 4, 1, 2, 0, 1, 3, - 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 3, 3, 4, 5, 6, 1, 1, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, + 3, 5, 3, 4, 3, 2, 4, 1, 2, 0, + 1, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 4, 3, 5, 1, 2, 4, 4, 4, 3, 0, - 1, 1, 3, 1, 1, 1, 2, 2, 1, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, - 3, 3, 1, 3, 3, 1, 3, 3, 3, 1, - 3, 3, 3, 3, 3, 3, 1, 3, 3, 3, - 3, 3, 1, 3, 3, 3, 3, 1, 3, 3, - 3, 3, 1, 3, 1, 3, 1, 3, 1, 3, + 1, 1, 4, 3, 5, 1, 2, 4, 4, 4, + 3, 0, 1, 1, 3, 1, 1, 1, 2, 2, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 1, 3, 3, 3, 1, 3, 3, 1, 3, 3, + 3, 1, 3, 3, 3, 3, 3, 3, 1, 3, + 3, 3, 3, 3, 1, 3, 3, 3, 3, 1, + 3, 3, 3, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, - 1, 3, 1, 5, 1, 5, 1, 3, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 0, 1, 1, 3, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 1, 2, 0, 1, - 3, 3, 1, 1, 1, 3, 1, 3, 2, 2, - 2, 0, 1, 2, 0, 1, 1, 2, 2, 7, - 5, 7, 7, 5, 9, 10, 7, 8, 2, 2, - 3, 3, 2, 2, 3, 3, 3, 3, 5, 5, - 3, 5, 1, 2, 0, 1, 4, 3, 3, 3, - 3, 3, 3, 4, 5, 2, 2, 2, 8, 8, - 1, 3, 0, 1, 0, 1, 1, 1, 2, 1, - 1, 0, 1, 0, 1, 2}; + 1, 3, 1, 3, 1, 5, 1, 5, 1, 3, + 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 3, 0, 1, 1, 3, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, + 0, 1, 3, 3, 1, 1, 1, 3, 1, 3, + 2, 2, 2, 0, 1, 2, 0, 1, 1, 2, + 2, 7, 5, 7, 7, 5, 9, 10, 7, 8, + 2, 2, 3, 3, 2, 2, 3, 3, 3, 3, + 5, 5, 3, 5, 1, 2, 0, 1, 4, 3, + 3, 3, 3, 3, 3, 4, 5, 2, 2, 2, + 8, 8, 1, 3, 0, 1, 0, 1, 1, 1, + 2, 1, 1, 0, 1, 0, 1, 2}; const int JavaScriptGrammar::action_default [] = { - 8, 2, 0, 0, 4, 3, 0, 296, 0, 6, - 7, 5, 25, 223, 0, 27, 0, 224, 9, 1, - 0, 0, 26, 0, 283, 284, 0, 281, 0, 282, - 0, 285, 126, 193, 157, 165, 161, 201, 208, 105, - 177, 207, 215, 203, 153, 0, 204, 286, 0, 291, - 90, 205, 206, 211, 106, 169, 173, 94, 123, 104, - 109, 89, 143, 209, 130, 288, 287, 290, 212, 0, - 0, 0, 0, 36, 37, 0, 33, 0, 292, 30, - 0, 294, 48, 0, 0, 0, 0, 0, 31, 34, - 0, 0, 195, 237, 35, 0, 29, 0, 0, 32, - 0, 0, 0, 0, 0, 213, 214, 119, 202, 210, - 0, 0, 106, 125, 292, 30, 294, 108, 107, 0, - 0, 0, 121, 122, 120, 0, 293, 283, 0, 0, - 285, 0, 280, 0, 295, 0, 55, 56, 57, 58, - 83, 59, 84, 60, 61, 62, 63, 64, 65, 66, - 67, 52, 68, 69, 70, 71, 72, 54, 85, 73, - 53, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 86, 0, 50, 0, 0, 42, 0, 51, 41, 124, - 0, 154, 0, 0, 0, 0, 144, 0, 0, 0, - 0, 0, 0, 134, 0, 0, 0, 128, 129, 127, - 132, 136, 135, 133, 131, 146, 145, 147, 0, 162, - 0, 158, 0, 0, 100, 99, 88, 87, 0, 0, - 98, 194, 101, 0, 102, 0, 103, 97, 238, 239, - 279, 0, 190, 183, 181, 188, 189, 187, 186, 192, - 185, 184, 182, 191, 178, 0, 166, 0, 0, 170, - 0, 0, 174, 0, 0, 100, 92, 0, 91, 0, - 96, 289, 253, 0, 254, 255, 256, 249, 0, 250, - 251, 252, 277, 278, 110, 0, 0, 0, 0, 0, - 242, 243, 199, 197, 159, 167, 163, 179, 155, 200, - 0, 106, 171, 175, 148, 137, 0, 0, 156, 0, - 0, 0, 0, 149, 0, 0, 0, 0, 0, 141, - 139, 142, 140, 138, 151, 150, 152, 0, 164, 0, - 160, 0, 198, 106, 0, 180, 195, 196, 0, 195, - 0, 0, 245, 0, 0, 0, 247, 0, 168, 0, - 0, 172, 0, 0, 176, 235, 0, 227, 236, 230, - 0, 234, 0, 195, 228, 0, 195, 0, 0, 246, - 0, 0, 0, 248, 293, 0, 269, 0, 0, 0, - 241, 0, 240, 217, 220, 0, 56, 83, 59, 84, - 61, 62, 33, 66, 67, 30, 68, 71, 31, 34, - 195, 35, 74, 29, 76, 32, 78, 79, 80, 81, - 82, 86, 218, 216, 94, 95, 100, 0, 93, 0, - 257, 258, 0, 0, 0, 260, 265, 263, 266, 0, - 0, 264, 265, 0, 261, 0, 262, 219, 268, 0, - 219, 267, 0, 270, 271, 0, 219, 272, 273, 0, - 0, 274, 0, 0, 0, 275, 276, 112, 111, 0, - 0, 0, 244, 0, 0, 0, 259, 0, 49, 0, - 46, 48, 39, 0, 45, 40, 47, 44, 38, 0, - 43, 116, 114, 118, 115, 113, 117, 0, 18, 13, - 0, 14, 10, 0, 23, 0, 24, 0, 0, 22, - 30, 48, 16, 27, 0, 11, 0, 17, 0, 20, - 12, 0, 21, 30, 48, 15, 0, 19, 28, 232, - 225, 0, 233, 229, 0, 231, 221, 0, 222, 226}; + 8, 2, 0, 4, 3, 0, 0, 0, 6, 7, + 5, 27, 225, 0, 29, 0, 226, 9, 1, 0, + 0, 28, 0, 285, 286, 0, 283, 0, 284, 0, + 287, 128, 195, 159, 167, 163, 203, 210, 107, 179, + 209, 217, 205, 155, 0, 206, 288, 0, 293, 92, + 207, 208, 213, 108, 171, 175, 96, 125, 106, 111, + 91, 145, 211, 132, 290, 289, 292, 214, 0, 0, + 0, 0, 38, 39, 0, 35, 0, 294, 32, 0, + 296, 50, 0, 0, 0, 0, 0, 33, 36, 0, + 0, 197, 239, 37, 0, 31, 0, 0, 34, 0, + 0, 0, 0, 0, 215, 216, 121, 204, 212, 0, + 0, 108, 127, 294, 32, 296, 110, 109, 0, 0, + 0, 123, 124, 122, 0, 295, 285, 0, 0, 287, + 0, 282, 0, 297, 0, 57, 58, 59, 60, 85, + 61, 86, 62, 63, 64, 65, 66, 67, 68, 69, + 54, 70, 71, 72, 73, 74, 56, 87, 75, 55, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 88, + 0, 52, 0, 0, 44, 0, 53, 43, 126, 0, + 156, 0, 0, 0, 0, 146, 0, 0, 0, 0, + 0, 0, 136, 0, 0, 0, 130, 131, 129, 134, + 138, 137, 135, 133, 148, 147, 149, 0, 164, 0, + 160, 0, 0, 102, 101, 90, 89, 0, 0, 100, + 196, 103, 0, 104, 0, 105, 99, 240, 241, 281, + 0, 192, 185, 183, 190, 191, 189, 188, 194, 187, + 186, 184, 193, 180, 0, 168, 0, 0, 172, 0, + 0, 176, 0, 0, 102, 94, 0, 93, 0, 98, + 291, 255, 0, 256, 257, 258, 251, 0, 252, 253, + 254, 279, 280, 112, 0, 0, 0, 0, 0, 244, + 245, 201, 199, 161, 169, 165, 181, 157, 202, 0, + 108, 173, 177, 150, 139, 0, 0, 158, 0, 0, + 0, 0, 151, 0, 0, 0, 0, 0, 143, 141, + 144, 142, 140, 153, 152, 154, 0, 166, 0, 162, + 0, 200, 108, 0, 182, 197, 198, 0, 197, 0, + 0, 247, 0, 0, 0, 249, 0, 170, 0, 0, + 174, 0, 0, 178, 237, 0, 229, 238, 232, 0, + 236, 0, 197, 230, 0, 197, 0, 0, 248, 0, + 0, 0, 250, 295, 0, 271, 0, 0, 0, 243, + 0, 242, 219, 222, 0, 58, 85, 61, 86, 63, + 64, 35, 68, 69, 32, 70, 73, 33, 36, 197, + 37, 76, 31, 78, 34, 80, 81, 82, 83, 84, + 88, 220, 218, 96, 97, 102, 0, 95, 0, 259, + 260, 0, 0, 0, 262, 267, 265, 268, 0, 0, + 266, 267, 0, 263, 0, 264, 221, 270, 0, 221, + 269, 0, 272, 273, 0, 221, 274, 275, 0, 0, + 276, 0, 0, 0, 277, 278, 114, 113, 0, 0, + 0, 246, 0, 0, 0, 261, 0, 51, 0, 48, + 50, 41, 0, 47, 42, 49, 46, 40, 0, 45, + 118, 116, 120, 117, 115, 119, 0, 18, 13, 0, + 14, 10, 0, 0, 0, 24, 0, 26, 23, 0, + 25, 0, 0, 22, 32, 50, 16, 29, 0, 11, + 0, 17, 0, 20, 12, 0, 21, 32, 50, 15, + 0, 19, 30, 234, 227, 0, 235, 231, 0, 233, + 223, 0, 224, 228, 298}; const int JavaScriptGrammar::goto_default [] = { - 2, 6, 19, 1, 5, 4, 18, 494, 495, 478, - 20, 373, 45, 12, 108, 61, 459, 457, 135, 134, - 33, 458, 133, 136, 215, 57, 50, 223, 59, 39, - 222, 54, 60, 107, 58, 32, 64, 62, 294, 44, - 288, 34, 284, 36, 286, 35, 285, 55, 292, 56, - 293, 40, 287, 283, 324, 409, 289, 290, 37, 43, - 46, 51, 52, 41, 38, 63, 109, 53, 68, 105, - 106, 42, 375, 374, 21, 511, 510, 346, 347, 513, - 349, 512, 348, 415, 419, 422, 418, 417, 437, 438, - 26, 48, 125, 25, 47, 66, 65, 0}; + 6, 5, 18, 1, 4, 3, 17, 498, 499, 477, + 19, 372, 44, 11, 107, 60, 458, 456, 134, 133, + 32, 457, 132, 135, 214, 56, 49, 222, 58, 38, + 221, 53, 59, 106, 57, 31, 63, 61, 293, 43, + 287, 33, 283, 35, 285, 34, 284, 54, 291, 55, + 292, 39, 286, 282, 323, 408, 288, 289, 36, 42, + 45, 50, 51, 40, 37, 62, 108, 52, 67, 104, + 105, 41, 374, 373, 20, 515, 514, 345, 346, 517, + 348, 516, 347, 414, 418, 421, 417, 416, 436, 437, + 25, 47, 124, 24, 46, 65, 64, 0}; const int JavaScriptGrammar::action_index [] = { - -25, -88, 89, 70, -88, -15, 251, -88, 85, -88, - -88, -88, -88, -88, 56, 48, 46, -88, -88, 262, - 127, 72, -88, -17, -9, 20, -29, -88, -3, -88, - -6, 1289, 112, -88, 13, -44, -76, -88, -88, 212, - -88, -88, -88, -88, 253, 228, -88, -88, -10, -88, - -88, -88, -88, -88, 347, 53, 87, 154, 274, -88, - -88, -88, 287, -88, 191, -88, 1289, -88, -88, 199, - 194, 115, 557, -88, -88, 1205, -88, 66, 71, 77, - 63, 1541, 79, 557, 557, 557, 480, 557, -88, -88, - 557, 557, 557, -88, -88, 60, -88, 557, 557, -88, - 41, 557, 557, 42, 44, -88, -88, -88, -88, -88, - 557, 557, 83, 177, -24, -88, 1037, -88, -88, 557, - 557, 557, -88, -88, -88, 25, -88, -18, -58, -8, - 1289, -26, -88, 58, 64, 67, -88, -88, -88, -88, + -18, -88, 35, -88, 13, 262, 83, 118, -88, -88, + -88, -88, -88, 76, 71, 162, -88, -88, 249, 125, + 46, -88, 42, 41, 58, 17, -88, 52, -88, 54, + 1419, 126, -88, 156, 31, 10, -88, -88, 228, -88, + -88, -88, -88, 201, 199, -88, -88, 55, -88, -88, + -88, -88, -88, 408, 72, 79, 203, 188, -88, -88, + -88, 365, -88, 300, -88, 1419, -88, -88, 197, 204, + 80, 603, -88, -88, 1335, -88, 48, 33, 61, 37, + 1587, 64, 603, 603, 603, 441, 603, -88, -88, 603, + 603, 603, -88, -88, 44, -88, 603, 603, -88, 36, + 603, 603, 73, 59, -88, -88, -88, -88, -88, 603, + 603, 78, 185, 62, -88, 1083, -88, -88, 603, 603, + 603, -88, -88, -88, 65, -88, 74, 32, 60, 1419, + 57, -88, 81, 77, 75, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, -88, - -88, 557, -88, 1121, 55, -88, 557, -88, -88, 175, - 557, 250, 557, 557, 557, 557, 404, 557, 557, 557, - 557, 557, 557, 158, 557, 557, 557, 80, 73, 81, - 197, 238, 220, 159, 167, 277, 404, 317, 557, 14, - 557, 90, 953, 557, 557, -88, -88, -88, 108, 557, - -88, -88, 65, 49, -88, 557, -88, -88, -88, -88, - -88, 557, -88, -88, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, -88, 557, 45, 557, 557, 75, - 69, 557, -88, 953, 557, 557, -88, 153, -88, 6, - -88, -88, -88, 105, -88, -88, -88, -88, 111, -88, - -88, -88, -88, -88, -88, 21, 62, 557, 122, 95, - -88, -88, 634, -88, 39, -30, -59, -88, 259, 8, - -46, 417, 19, 125, 339, 188, -7, 557, 248, 557, - 557, 557, 557, 339, 557, 557, 557, 557, 557, 187, - 166, 192, 206, 232, 339, 339, 339, 557, -59, 557, - 39, 557, -88, 380, 557, -88, 557, -5, -60, 557, - -48, 1205, -88, 557, 142, 1205, -88, 557, -38, 557, - 557, 7, 0, 557, -88, 17, 84, 22, -88, -88, - 557, -88, 27, 557, -88, -13, 557, 52, 1205, -88, - 557, 102, 1205, -88, 28, 1205, -88, 557, 100, 1205, - 34, 1205, -88, -88, 1205, -19, 139, 9, 149, 82, - 557, 1205, 23, 1, 119, 36, 10, 480, 40, 120, - 869, 35, 5, 26, 557, 37, -1, 557, 29, 557, - 31, 33, -88, -88, 205, -88, 557, -11, -88, 78, - -88, -88, 557, 98, 38, -88, 47, -88, 54, 198, - 557, -88, 30, 32, -88, -4, -88, 1205, -88, 107, - 1205, -88, 213, -88, -88, 113, 1205, 43, -88, 18, - 24, -88, -21, -54, -20, -88, -88, -88, -88, 557, - 143, 1205, -88, 557, 110, 1205, -88, 118, 16, 788, - -88, 15, -88, 711, -88, -88, -88, -88, -88, 121, - -88, -88, -88, -88, -88, -88, -88, 298, -88, -88, - 284, -88, -88, 59, 76, 557, 74, 1373, 57, -88, - 147, 130, -88, 61, 97, -88, 96, -88, 50, -88, - -88, 1457, -88, 116, 99, -88, 109, -88, -88, 51, - -88, 190, -88, -88, 557, -88, -88, 68, -88, -88, + 603, -88, 1167, 56, -88, 603, -88, -88, 166, 603, + 235, 603, 603, 603, 603, 365, 603, 603, 603, 603, + 603, 603, 163, 603, 603, 603, 94, 96, 84, 300, + 300, 300, 300, 190, 365, 365, 365, 603, 10, 603, + 156, 999, 603, 603, -88, -88, -88, 131, 603, -88, + -88, 68, 30, -88, 603, -88, -88, -88, -88, -88, + 603, -88, -88, -88, -88, -88, -88, -88, -88, -88, + -88, -88, -88, -88, 603, 34, 603, 603, 63, 82, + 603, -88, 999, 603, 603, -88, 148, -88, 67, -88, + -88, -88, 124, -88, -88, -88, -88, 120, -88, -88, + -88, -88, -88, -88, 70, 66, 603, 111, 122, -88, + -88, 757, -88, 21, -24, -53, -88, 222, 5, -51, + 526, 69, 108, 266, 300, -17, 603, 251, 603, 603, + 603, 603, 250, 603, 603, 603, 603, 603, 211, 168, + 187, 167, 171, 276, 291, 270, 603, -76, 603, 1, + 603, -88, 352, 603, -88, 603, -1, -8, 603, 4, + 1335, -88, 603, 114, 1335, -88, 603, -20, 603, 603, + 69, 24, 603, -88, 18, 89, 9, -88, -88, 603, + -88, 15, 603, -88, -19, 603, -21, 1335, -88, 603, + 86, 1335, -88, 2, 1335, -88, 603, 88, 1335, 27, + 1335, -88, -88, 1335, -22, 173, 3, 170, 92, 603, + 1335, 49, 19, 85, 53, 25, 441, 47, 38, 915, + 39, 11, 43, 603, 45, -6, 603, 0, 603, -32, + -27, -88, -88, 174, -88, 603, -43, -88, 90, -88, + -88, 603, 100, -25, -88, 6, -88, 20, 106, 603, + -88, 14, 7, -88, -39, -88, 1335, -88, 99, 1335, + -88, 160, -88, -88, 93, 1335, -2, -88, -15, -13, + -88, -23, -57, -28, -88, -88, -88, -88, 603, 110, + 1335, -88, 603, 109, 1335, -88, 103, 50, 834, -88, + 40, -88, 680, -88, -88, -88, -88, -88, 107, -88, + -88, -88, -88, -88, -88, -88, 287, -88, -88, 295, + -88, -88, 12, 8, -3, 23, 603, 26, 29, 603, + 51, 1503, 28, -88, 130, 147, -88, 16, 117, -88, + 237, -88, 22, -88, -88, 1251, -88, 116, 135, -88, + 157, -88, -88, -16, -88, 195, -88, -88, 603, -88, + -88, -14, -88, -88, -88, - -98, -98, -98, -98, -98, 30, 13, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, -98, -98, 87, + -98, -98, -98, -98, 2, -10, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, -98, 50, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, + 57, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, 83, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -36, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, 191, -98, -98, -98, -98, + -98, 68, -98, -98, 67, -98, -98, -98, -98, -98, + -98, -98, 41, 114, 150, 232, 153, -98, -98, 146, + 149, 47, -98, -98, -98, -98, 25, 89, -98, -29, + 85, 80, -98, -98, -98, -98, -98, -98, -98, 103, + 108, -98, -98, -98, -98, -98, -98, -98, 105, 100, + 96, -98, -98, -98, -98, -98, -68, -98, -98, 176, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -43, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, 184, -98, -98, -98, - -98, -98, 113, -98, -98, -9, -98, -98, -98, -98, - -98, -98, -98, 42, 116, 112, 127, 146, -98, -98, - 151, 147, 40, -98, -98, -98, -98, 37, 89, -98, - -10, 90, 86, -98, -98, -98, -98, -98, -98, -98, - 77, 94, -98, -98, -98, -98, -98, -98, -98, 106, - 103, 98, -98, -98, -98, -98, -98, -47, -98, -98, - 253, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -7, -98, 0, -98, -98, -3, -98, -98, -98, - 136, -98, 117, 119, 132, 134, -98, 130, 49, 36, - 35, 61, 64, -98, 47, 46, 38, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, -98, 59, -98, - 58, -98, 24, 32, 17, -98, -98, -98, -98, 21, - -98, -98, -98, -98, -98, 8, -98, -98, -98, -98, - -98, 4, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, 60, -98, 57, -19, -98, - -98, -17, -98, 118, 44, 133, -98, -98, -98, -98, + -12, -98, -13, -98, -98, 7, -98, -98, -98, 118, + -98, 117, 119, 141, 121, -98, 128, 130, 124, 140, + 83, 51, -98, 48, 62, 55, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, -98, 60, -98, 54, + -98, 31, 37, 43, -98, -98, -98, -98, 22, -98, + -98, -98, -98, -98, 42, -98, -98, -98, -98, -98, + 45, -98, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, 61, -98, 58, -20, -98, -98, + -7, -98, 52, 4, 53, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, 3, -98, -98, - -98, -98, 67, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, 186, -98, 196, - 183, 177, 187, -98, 82, 76, 79, 96, 99, -98, - -98, -98, -98, -98, -98, -98, -98, 168, -98, 158, - -98, 156, -98, -98, 175, -98, 102, -98, -98, 104, - -98, 25, -98, 27, -98, 29, -98, 155, -98, 154, - 157, -98, -98, 167, -98, -98, -98, -98, -98, -98, - 193, -98, -48, 126, -98, -98, 128, -98, 15, -98, - 19, -98, 22, -98, -98, 23, -98, 20, -98, 18, - -98, 34, -98, -98, 53, -98, -98, -98, -98, -98, - 93, 52, -98, -98, -98, -98, -98, 81, -98, -98, - 45, -98, -98, -98, 43, -98, -35, 137, -98, 141, - -98, -98, -98, -98, -98, -98, 131, -98, -98, -98, - -98, -98, -8, -98, -98, -98, -98, -98, -77, -98, - 6, -98, -76, -98, -98, -98, -98, -52, -98, -98, - -51, -98, -98, -98, -98, -98, -98, -75, -98, -98, - -46, -98, -98, -98, -49, -98, -98, -98, -98, 7, - -98, 5, -98, -12, -98, 75, -98, -98, -98, -14, - -98, -11, -98, -13, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, 73, -98, -98, - 56, -98, -98, -98, -98, 41, -98, 39, -98, -98, - 50, 48, -98, 51, -98, -98, -98, -98, 66, -98, - -98, 31, -98, 16, 166, -98, -98, -98, -98, -98, - -98, -98, -98, -98, 26, -98, -98, -38, -98, -98}; + -98, -98, -98, -98, -98, -98, 9, -98, -98, -98, + -98, 138, -98, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, 194, -98, 167, 170, + 180, 186, -98, 73, 76, 90, 92, 99, -98, -98, + -98, -98, -98, -98, -98, -98, 196, -98, 184, -98, + 161, -98, -98, 160, -98, 112, -98, -98, 120, -98, + 6, -98, 12, -98, 17, -98, 163, -98, 164, 157, + -98, -98, 154, -98, -98, -98, -98, -98, -98, 192, + -98, -28, 113, -98, -98, 86, -98, 49, -98, 20, + -98, 28, -98, -98, 35, -98, 36, -98, 24, -98, + 30, -98, -98, 29, -98, -98, -98, -98, -98, 77, + 67, -98, -98, -98, -98, -98, 115, -98, -98, 19, + -98, -98, -98, 26, -98, -24, 84, -98, 69, -98, + -98, -98, -98, -98, -98, 126, -98, -98, -98, -98, + -98, 39, -98, -98, -98, -98, -98, -42, -98, 18, + -98, -82, -98, -98, -98, -98, -67, -98, -98, -71, + -98, -98, -98, -98, -98, -98, -86, -98, -98, -35, + -98, -98, -98, -33, -98, -98, -98, -98, 14, -98, + 8, -98, -2, -98, 1, -98, -98, -98, -9, -98, + -1, -98, -6, -98, -98, -98, -98, -98, -98, -98, + -98, -98, -98, -98, -98, -98, 82, -98, -98, 159, + -98, -98, -98, -98, -98, -98, 40, -98, -98, 46, + -98, 44, -98, -98, 38, 23, -98, 27, -98, -98, + -98, -98, 64, -98, -98, 33, -98, 34, 59, -98, + -98, -98, -98, -98, -98, -98, -98, -98, -14, -98, + -98, -56, -98, -98, -98}; const int JavaScriptGrammar::action_info [] = { - 210, 329, 129, 219, 208, 126, 444, 343, 443, 337, - 317, 27, 331, 436, 180, 326, 321, 319, 317, 24, - 27, 337, 345, 460, 466, 130, 29, 31, 28, 132, - -64, 30, 436, -75, 350, 420, 403, 282, -223, 427, - 297, 412, -53, -52, -77, 230, 367, -72, 356, 408, - 371, 426, 420, 360, 442, 245, 345, 436, -224, 420, - 3, 127, 176, 440, 24, 171, 260, 449, 514, 453, - 3, 416, 173, 225, 436, 483, 251, 245, 449, 493, - 453, 477, 219, 485, 365, 23, 508, 460, 484, 7, - 210, 180, 352, 208, 477, 276, 412, 509, 277, 367, - 364, 509, 282, 501, 0, 498, 219, 460, 219, 227, - 219, 488, 358, 110, 430, 219, 219, 498, 219, 439, - 110, 110, 178, 365, 111, 117, 461, -54, 493, 219, - 219, 111, 111, 440, 487, 8, 118, 247, 460, 411, - 410, 248, 488, 273, 272, 353, 10, 9, 126, 477, - 219, 219, 110, 499, 365, -292, 281, 280, 414, 493, - 369, 219, 362, 111, 220, 507, 266, 265, 263, 253, - 455, 0, 271, 270, 462, 339, 273, 272, 268, 340, - 477, 470, 279, 194, 194, 195, 195, 119, 254, 119, - 255, 194, 194, 195, 195, 0, 196, 196, 517, 0, - 264, 262, 335, 451, 196, 196, 0, 0, 423, 258, - 269, 267, 194, 194, 195, 195, 194, 194, 195, 195, - 253, 219, 194, 268, 195, 196, 196, 212, 263, 196, - 196, 194, 120, 195, 120, 196, 219, 0, 121, 254, - 121, 406, 0, 0, 196, 194, 213, 195, 214, 0, - 0, 518, 516, 424, 0, 269, 267, 194, 196, 195, - 264, 262, 0, 194, 0, 195, 299, 300, 182, 183, - 196, 182, 183, 14, 434, 433, 196, 299, 300, 0, - 15, 0, 0, 0, 14, 0, 119, 0, 0, 229, - 228, 15, 0, 301, 302, 184, 185, 0, 184, 185, - 187, 188, 0, 0, 301, 302, 14, 0, 189, 190, - 187, 188, 191, 15, 192, 0, 0, 0, 189, 190, - 14, 0, 191, 17, 192, 0, 0, 15, 0, 0, - 0, 120, 13, 0, 17, 16, 0, 121, 0, 481, - 187, 188, 0, 13, 0, 0, 16, 0, 189, 190, - 232, 0, 191, 479, 192, 0, 17, 0, 0, 0, - 233, 0, 304, 305, 234, 13, 0, 0, 16, 0, - 17, 306, 0, 235, 307, 236, 308, 0, 0, 13, - 0, 0, 16, 232, 0, 0, 237, 0, 238, 117, - 0, 0, 0, 233, 0, 0, 239, 234, 0, 240, - 118, 0, 0, 0, 0, 241, 235, 0, 236, 0, - 0, 242, 0, 0, 0, 0, 0, 0, 0, 237, - 232, 238, 117, 0, 243, 0, 0, 187, 188, 239, - 233, 0, 240, 118, 234, 189, 190, 0, 241, 191, - 0, 192, 0, 235, 242, 236, 0, 0, 333, 0, - 0, 0, 0, 0, 0, 0, 237, 243, 238, 117, - 0, 0, 0, 0, 0, 0, 239, 0, 0, 240, - 118, 0, 0, 0, 0, 241, 0, 0, 0, 0, - 0, 242, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 73, 74, 243, 0, 0, 0, 0, 0, - 0, 0, 114, 0, 0, 0, 0, 0, 0, 115, - 0, 0, 0, 116, 82, 0, 83, 0, 0, 0, - 0, 0, 0, 86, 0, 0, 0, 89, 0, 0, + 318, 518, 296, 443, 448, 435, 442, 218, 415, 452, + 325, 419, 344, 320, 426, 513, 425, 407, 439, 419, + 435, 441, 296, 318, 316, 419, 485, 435, 316, -226, + 486, 342, -225, 402, 218, 349, 489, 488, 23, 357, + 359, 484, 355, 370, 344, -56, -55, 411, 459, 476, + -77, 497, -79, 328, -74, 281, -66, 512, 465, 218, + -54, 366, 363, 175, 330, 244, 27, 2, 364, 435, + 26, 336, 459, 366, 244, 513, 224, 29, 23, 207, + 411, 28, 207, 524, 281, 172, 209, 30, 170, 250, + 226, 125, 128, 129, 218, 452, 218, 351, 2, 438, + 7, 126, 276, 26, 476, 22, 429, 218, 218, 448, + 229, 460, 131, 439, 125, 218, 422, 218, 218, 218, + 116, -294, 218, 364, 109, 502, 0, 259, 0, 246, + 177, 117, 491, 247, 109, 110, 109, 364, 0, 218, + 492, 272, 271, 459, 275, 110, 361, 110, 368, 476, + 352, 410, 409, 272, 271, 459, 218, 179, 338, 461, + 413, 423, 339, 476, 497, 502, 109, 469, 218, 454, + 450, 278, 482, 503, 334, 0, 497, 110, 118, 9, + 8, 270, 269, 280, 279, 265, 264, 219, 193, 252, + 194, 483, 193, 193, 194, 194, 193, 118, 194, 267, + 118, 195, 262, 521, 257, 195, 195, 218, 253, 195, + 405, 0, 193, 511, 194, 193, 0, 194, 252, 181, + 182, 433, 432, 119, 0, 195, 262, 0, 195, 120, + 0, 268, 266, 267, 263, 261, 193, 253, 194, 254, + 298, 299, 119, 211, 505, 119, 183, 184, 120, 195, + 0, 120, 492, 181, 182, 0, 522, 520, 263, 261, + 228, 227, 212, 0, 213, 268, 266, 300, 301, 298, + 299, 13, 0, 303, 304, 0, 0, 0, 14, 0, + 183, 184, 305, 0, 13, 306, 0, 307, 0, 303, + 304, 14, 0, 303, 304, 0, 300, 301, 305, 303, + 304, 306, 305, 307, 0, 306, 0, 307, 305, 13, + 0, 306, 0, 307, 303, 304, 14, 13, 0, 0, + 0, 16, 0, 305, 14, 193, 306, 194, 307, 0, + 12, 0, 0, 15, 16, 0, 0, 0, 195, 0, + 0, 0, 478, 12, 0, 0, 15, 0, 0, 0, + 480, 0, 0, 0, 0, 231, 0, 0, 0, 16, + 0, 0, 0, 0, 0, 232, 0, 16, 12, 233, + 0, 15, 0, 0, 0, 0, 12, 0, 234, 15, + 235, 0, 0, 0, 0, 0, 0, 0, 186, 187, + 0, 236, 0, 237, 116, 0, 188, 189, 0, 0, + 190, 238, 191, 0, 239, 117, 0, 0, 0, 0, + 240, 231, 0, 0, 0, 0, 241, 0, 0, 0, + 0, 232, 0, 0, 0, 233, 0, 0, 0, 242, + 0, 0, 0, 0, 234, 0, 235, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 236, 0, 237, + 116, 0, 0, 72, 73, 0, 0, 238, 0, 0, + 239, 117, 0, 113, 0, 0, 240, 0, 0, 0, + 114, 0, 241, 0, 115, 81, 0, 82, 0, 0, + 0, 0, 0, 0, 85, 242, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 94, 0, 96, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 88, 99, - 76, 0, 0, 0, 0, 0, 0, 0, 72, 73, - 74, 0, 0, 0, 0, 0, 0, 0, 0, 114, - 0, 0, 0, 0, 0, 0, 115, 0, 0, 0, - 116, 82, 0, 83, 0, 0, 0, 84, 0, 85, - 86, 87, 0, 0, 89, 0, 0, 0, 90, 0, - 91, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 94, 0, 96, 0, 98, 0, 101, 0, - 102, 0, 0, 0, 0, 88, 99, 76, 0, 0, - 0, 0, 0, 0, 0, 72, 73, 74, 0, 0, + 0, 0, 0, 0, 0, 0, 93, 0, 95, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, + 98, 75, 0, 0, 0, 0, 0, 0, 0, 231, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, + 0, 0, 0, 233, 0, 0, 0, 0, 0, 0, + 0, 0, 234, 0, 235, 0, 0, 332, 0, 0, + 0, 0, 0, 0, 0, 236, 0, 237, 116, 0, + 0, 0, 0, 0, 0, 238, 0, 0, 239, 117, + 0, 0, 0, 0, 240, 0, 0, 0, 0, 0, + 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 242, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 71, 72, 73, 0, 0, 0, + 0, 0, 0, 0, 0, 113, 0, 0, 0, 0, + 0, 0, 114, 0, 0, 0, 115, 81, 0, 82, + 0, 0, 0, 83, 0, 84, 85, 86, 0, 0, + 88, 0, 0, 0, 89, 0, 90, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 93, 0, + 95, 0, 97, 0, 100, 0, 101, 0, 0, 0, + 0, 87, 98, 75, 0, 0, 0, 0, 0, 0, + 0, 71, 72, 73, 0, 0, 0, 0, 0, 0, + 0, 0, 113, 0, 0, 0, 0, 0, 0, 114, + 0, 0, 0, 115, 81, 0, 82, 0, 0, 0, + 83, 0, 84, 85, 86, 0, 0, 88, 0, 0, + 0, 89, 0, 90, 0, 0, 464, 0, 0, 0, + 0, 0, 0, 0, 0, 93, 0, 95, 0, 97, + 0, 100, 0, 101, 0, 0, 0, 0, 87, 98, + 75, 0, 0, 0, 0, 0, 0, 0, 71, 72, + 73, 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, 0, 0, 0, 0, 0, 114, 0, 0, 0, - 0, 0, 0, 115, 0, 0, 0, 116, 82, 0, - 83, 0, 0, 0, 84, 0, 85, 86, 87, 0, - 0, 89, 0, 0, 0, 90, 0, 91, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, - 0, 96, 0, 98, 0, 101, 296, 102, 0, 0, - 0, 0, 88, 99, 76, 0, 0, 0, 0, 0, - 0, 0, 72, 73, 74, 0, 0, 0, 0, 0, - 0, 0, 0, 114, 0, 0, 0, 0, 0, 0, - 115, 0, 0, 0, 116, 82, 0, 83, 0, 0, - 0, 84, 0, 85, 86, 87, 0, 0, 89, 0, - 0, 0, 90, 0, 91, 0, 0, 465, 0, 0, - 0, 0, 0, 0, 0, 0, 94, 0, 96, 0, - 98, 0, 101, 0, 102, 0, 0, 0, 0, 88, - 99, 76, 0, 0, 0, 0, 0, 0, 0, 72, - 73, 74, 0, 0, 0, 0, 0, 0, 0, 0, - 114, 0, 0, 0, 0, 0, 0, 115, 0, 0, - 0, 116, 82, 0, 83, 0, 0, 0, 84, 0, - 85, 86, 87, 0, 0, 89, 0, 0, 0, 90, - 0, 91, 0, 0, 468, 0, 0, 0, 0, 0, - 0, 0, 0, 94, 0, 96, 0, 98, 0, 101, - 0, 102, 0, 0, 0, 0, 88, 99, 76, 0, - 0, 0, 0, 0, 0, 0, -73, 0, 0, 0, - 72, 73, 74, 0, 0, 0, 0, 0, 0, 0, - 0, 114, 0, 0, 0, 0, 0, 0, 115, 0, - 0, 0, 116, 82, 0, 83, 0, 0, 0, 84, - 0, 85, 86, 87, 0, 0, 89, 0, 0, 0, - 90, 0, 91, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 94, 0, 96, 0, 98, 0, - 101, 0, 102, 0, 0, 0, 0, 88, 99, 76, - 0, 0, 0, 0, 0, 0, 0, 137, 138, 139, - 0, 0, 141, 143, 144, 0, 0, 145, 0, 146, - 0, 0, 0, 148, 149, 150, 0, 0, 0, 0, - 0, 0, 217, 152, 153, 154, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 155, 0, 0, 0, + 115, 81, 0, 82, 0, 0, 0, 83, 0, 84, + 85, 86, 0, 0, 88, 0, 0, 0, 89, 0, + 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 93, 0, 95, 0, 97, 0, 100, 295, + 101, 0, 0, 0, 0, 87, 98, 75, 0, 0, + 0, 0, 0, 0, 0, 71, 72, 73, 0, 0, + 0, 0, 0, 0, 0, 0, 113, 0, 0, 0, + 0, 0, 0, 114, 0, 0, 0, 115, 81, 0, + 82, 0, 0, 0, 83, 0, 84, 85, 86, 0, + 0, 88, 0, 0, 0, 89, 0, 90, 0, 0, + 467, 0, 0, 0, 0, 0, 0, 0, 0, 93, + 0, 95, 0, 97, 0, 100, 0, 101, 0, 0, + 0, 0, 87, 98, 75, 0, 0, 0, 0, 0, + 0, 0, -75, 0, 0, 0, 71, 72, 73, 0, + 0, 0, 0, 0, 0, 0, 0, 113, 0, 0, + 0, 0, 0, 0, 114, 0, 0, 0, 115, 81, + 0, 82, 0, 0, 0, 83, 0, 84, 85, 86, + 0, 0, 88, 0, 0, 0, 89, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 159, 0, 0, 0, 0, 0, 0, 161, - 162, 163, 0, 165, 166, 167, 168, 169, 170, 0, - 0, 156, 164, 147, 140, 142, 158, 0, 0, 0, - 0, 137, 138, 139, 0, 0, 141, 143, 144, 0, - 0, 145, 0, 146, 0, 0, 0, 148, 149, 150, - 0, 0, 0, 0, 0, 0, 151, 152, 153, 154, + 93, 0, 95, 0, 97, 0, 100, 0, 101, 0, + 0, 0, 0, 87, 98, 75, 0, 0, 0, 0, + 0, 0, 0, 136, 137, 138, 0, 0, 140, 142, + 143, 0, 0, 144, 0, 145, 0, 0, 0, 147, + 148, 149, 0, 0, 0, 0, 0, 0, 216, 151, + 152, 153, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 154, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 158, 0, + 0, 0, 0, 0, 0, 160, 161, 162, 0, 164, + 165, 166, 167, 168, 169, 0, 0, 155, 163, 146, + 139, 141, 157, 0, 0, 0, 0, 136, 137, 138, + 0, 0, 140, 142, 143, 0, 0, 144, 0, 145, + 0, 0, 0, 147, 148, 149, 0, 0, 0, 0, + 0, 0, 150, 151, 152, 153, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 154, 0, 0, 0, + 156, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 158, 0, 0, 0, 0, 0, 159, 160, + 161, 162, 0, 164, 165, 166, 167, 168, 169, 0, + 0, 155, 163, 146, 139, 141, 157, 0, 0, 0, + 0, 136, 137, 138, 0, 0, 140, 142, 143, 0, + 0, 144, 0, 145, 0, 0, 0, 147, 148, 149, + 0, 0, 0, 0, 0, 0, 150, 151, 152, 153, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 155, 0, 0, 0, 157, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 159, 0, 0, 0, - 0, 0, 160, 161, 162, 163, 0, 165, 166, 167, - 168, 169, 170, 0, 0, 156, 164, 147, 140, 142, - 158, 0, 0, 0, 0, 137, 138, 139, 0, 0, - 141, 143, 144, 0, 0, 145, 0, 146, 0, 0, - 0, 148, 149, 150, 0, 0, 0, 0, 0, 0, - 151, 152, 153, 154, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 155, 0, 0, 0, 157, 0, - 0, 0, 0, 0, 0, 0, 175, 0, 0, 0, - 159, 0, 0, 0, 0, 0, 160, 161, 162, 163, - 0, 165, 166, 167, 168, 169, 170, 0, 0, 156, - 164, 147, 140, 142, 158, 0, 0, 0, 0, 69, - 0, 0, 0, 0, 70, 0, 72, 73, 74, 75, - 0, 0, 0, 0, 0, 0, 77, 114, 0, 0, - 0, 0, 0, 0, 79, 80, 0, 0, 81, 82, - 0, 83, 0, 0, 0, 84, 0, 85, 86, 87, - 0, 0, 89, 0, 0, 0, 90, 0, 91, 0, - 0, 0, 0, 0, 92, 0, 93, 0, 0, 0, - 94, 95, 96, 97, 98, 100, 101, 17, 102, 103, - 104, 0, 0, 88, 99, 76, 13, 71, 0, 0, - 0, 0, 0, 69, 0, 0, 0, 0, 70, 0, - 72, 73, 74, 75, 0, 0, 0, 0, 0, 0, - 77, 78, 0, 0, 0, 0, 0, 0, 79, 80, - 0, 0, 81, 82, 0, 83, 0, 0, 0, 84, - 0, 85, 86, 87, 0, 0, 89, 0, 0, 0, - 90, 0, 91, 0, 0, 0, 0, 0, 92, 0, - 93, 0, 0, 0, 94, 95, 96, 97, 98, 100, - 101, 17, 102, 103, 104, 0, 0, 88, 99, 76, - 13, 71, 0, 0, 0, 0, 0, 69, 0, 0, - 0, 0, 70, 0, 72, 73, 74, 75, 0, 0, - 0, 0, 0, 0, 77, 114, 0, 0, 0, 0, - 0, 0, 490, 80, 0, 0, 81, 491, 0, 83, - 0, 0, 0, 84, 0, 85, 86, 87, 0, 0, - 89, 0, 0, 0, 90, 0, 91, 0, 0, 0, - 0, 0, 92, 0, 93, 0, 0, 0, 94, 95, - 96, 97, 98, 100, 101, 17, 102, 103, 104, 0, - 0, 88, 99, 76, 13, 71, 0, 0, 0, 0, - 0, 69, 0, 0, 0, 0, 70, 0, 72, 73, - 74, 75, 0, 0, 0, 0, 0, 0, 77, 114, - 0, 0, 0, 0, 0, 0, 503, 80, 0, 0, - 81, 504, 0, 83, 0, 0, 0, 84, 0, 85, - 86, 87, 0, 0, 89, 0, 0, 0, 90, 0, - 91, 0, 0, 0, 0, 0, 92, 0, 93, 0, - 0, 0, 94, 95, 96, 97, 98, 100, 101, 17, - 102, 103, 104, 0, 0, 88, 99, 76, 13, 71, - 0, 0, 0, 0, 0, 376, 138, 139, 0, 0, - 378, 143, 380, 73, 74, 381, 0, 146, 0, 0, - 0, 148, 383, 384, 0, 0, 0, 0, 0, 0, - 385, 386, 153, 154, 81, 82, 0, 83, 0, 0, - 0, 84, 0, 85, 387, 87, 0, 0, 389, 0, - 0, 0, 90, 0, 91, 0, -219, 0, 0, 0, - 390, 0, 93, 0, 0, 0, 391, 392, 393, 394, - 98, 396, 397, 398, 399, 400, 401, 0, 0, 388, - 395, 382, 377, 379, 158, 0, 0, 0, 0, + 154, 0, 0, 0, 156, 0, 0, 0, 0, 0, + 0, 0, 174, 0, 0, 0, 158, 0, 0, 0, + 0, 0, 159, 160, 161, 162, 0, 164, 165, 166, + 167, 168, 169, 0, 0, 155, 163, 146, 139, 141, + 157, 0, 0, 0, 0, 68, 0, 0, 0, 0, + 69, 0, 71, 72, 73, 74, 0, 0, 0, 0, + 0, 0, 76, 113, 0, 0, 0, 0, 0, 0, + 507, 79, 0, 0, 80, 508, 0, 82, 0, 0, + 0, 83, 0, 84, 85, 86, 0, 0, 88, 0, + 0, 0, 89, 0, 90, 0, 0, 0, 0, 0, + 91, 0, 92, 0, 0, 0, 93, 94, 95, 96, + 97, 99, 100, 16, 101, 102, 103, 0, 0, 87, + 98, 75, 12, 70, 0, 0, 0, 0, 0, 68, + 0, 0, 0, 0, 69, 0, 71, 72, 73, 74, + 0, 0, 0, 0, 0, 0, 76, 113, 0, 0, + 0, 0, 0, 0, 78, 79, 0, 0, 80, 81, + 0, 82, 0, 0, 0, 83, 0, 84, 85, 86, + 0, 0, 88, 0, 0, 0, 89, 0, 90, 0, + 0, 0, 0, 0, 91, 0, 92, 0, 0, 0, + 93, 94, 95, 96, 97, 99, 100, 16, 101, 102, + 103, 0, 0, 87, 98, 75, 12, 70, 0, 0, + 0, 0, 0, 68, 0, 0, 0, 0, 69, 0, + 71, 72, 73, 74, 0, 0, 0, 0, 0, 0, + 76, 77, 0, 0, 0, 0, 0, 0, 78, 79, + 0, 0, 80, 81, 0, 82, 0, 0, 0, 83, + 0, 84, 85, 86, 0, 0, 88, 0, 0, 0, + 89, 0, 90, 0, 0, 0, 0, 0, 91, 0, + 92, 0, 0, 0, 93, 94, 95, 96, 97, 99, + 100, 16, 101, 102, 103, 0, 0, 87, 98, 75, + 12, 70, 0, 0, 0, 0, 0, 68, 0, 0, + 0, 0, 69, 0, 71, 72, 73, 74, 0, 0, + 0, 0, 0, 0, 76, 113, 0, 0, 0, 0, + 0, 0, 494, 79, 0, 0, 80, 495, 0, 82, + 0, 0, 0, 83, 0, 84, 85, 86, 0, 0, + 88, 0, 0, 0, 89, 0, 90, 0, 0, 0, + 0, 0, 91, 0, 92, 0, 0, 0, 93, 94, + 95, 96, 97, 99, 100, 16, 101, 102, 103, 0, + 0, 87, 98, 75, 12, 70, 0, 0, 0, 0, + 0, 375, 137, 138, 0, 0, 377, 142, 379, 72, + 73, 380, 0, 145, 0, 0, 0, 147, 382, 383, + 0, 0, 0, 0, 0, 0, 384, 385, 152, 153, + 80, 81, 0, 82, 0, 0, 0, 83, 0, 84, + 386, 86, 0, 0, 388, 0, 0, 0, 89, 0, + 90, 0, -221, 0, 0, 0, 389, 0, 92, 0, + 0, 0, 390, 391, 392, 393, 97, 395, 396, 397, + 398, 399, 400, 0, 0, 387, 394, 381, 376, 378, + 157, 0, 0, 0, 0, - 454, 250, 275, 252, 413, 463, 467, 464, 425, 445, - 421, 231, 446, 172, 441, 278, 452, 177, 429, 450, - 428, 431, 174, 435, 244, 505, 359, 22, 226, 370, - 354, 361, 368, 363, 366, 11, 332, 224, 519, 334, - 336, 221, 502, 128, 218, 372, 515, 216, 435, 432, - 489, 0, 327, 486, 469, 432, 257, 327, 496, 492, - 497, 0, 482, 275, 402, 0, 112, 112, 0, 112, - 22, 202, 201, 199, 500, 480, 496, 112, 112, 0, - 112, 198, 197, 0, 0, 200, 456, 22, 112, 112, - 112, 112, 112, 482, 67, 112, 49, 203, 291, 211, - 204, 22, 209, 295, 249, 246, 404, 112, 112, 405, - 112, 113, 310, 112, 327, 311, 327, 112, 309, 448, - 112, 112, 476, 447, 112, 112, 274, 112, 179, 112, - 112, 124, 312, 0, 112, 313, 123, 112, 327, 122, - 327, 216, 256, 112, 112, 472, 274, 112, 112, 471, - 112, 224, 404, 224, 186, 405, 205, 328, 407, 330, - 259, 112, 0, 112, 0, 112, 193, 112, 112, 206, - 447, 207, 112, 506, 448, 181, 496, 112, 112, 473, - 475, 355, 112, 357, 474, 112, 112, 323, 323, 112, - 295, 295, 295, 295, 295, 67, 0, 49, 323, 112, - 320, 338, 341, 295, 295, 0, 323, 0, 112, 322, - 342, 295, 318, 295, 112, 315, 0, 112, 112, 295, - 344, 314, 295, 295, 323, 316, 298, 112, 325, 295, - 0, 0, 295, 0, 303, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 351, 0, 0, 0, + 249, 430, 424, 440, 21, 427, 519, 10, 171, 173, + 453, 466, 455, 251, 463, 462, 256, 331, 230, 451, + 523, 277, 127, 445, 333, 444, 449, 176, 335, 434, + 428, 326, 360, 500, 434, 369, 501, 431, 431, 362, + 401, 371, 220, 509, 506, 420, 365, 496, 367, 217, + 353, 412, 487, 468, 215, 493, 481, 0, 490, 326, + 358, 0, 225, 223, 21, 243, 510, 0, 66, 500, + 48, 0, 504, 223, 500, 215, 255, 0, 274, 111, + 258, 0, 111, 196, 479, 111, 111, 203, 0, 111, + 198, 111, 111, 111, 0, 210, 21, 197, 326, 111, + 111, 273, 447, 208, 111, 248, 245, 111, 111, 308, + 273, 111, 309, 447, 111, 111, 111, 446, 446, 202, + 111, 111, 475, 111, 326, 326, 310, 111, 311, 123, + 111, 111, 326, 122, 111, 312, 111, 112, 121, 111, + 403, 356, 178, 404, 0, 111, 223, 470, 111, 111, + 111, 0, 111, 406, 185, 111, 204, 180, 206, 111, + 200, 111, 0, 0, 192, 481, 199, 327, 354, 290, + 0, 111, 111, 21, 294, 329, 201, 111, 205, 473, + 111, 111, 474, 471, 111, 322, 472, 66, 322, 48, + 294, 322, 322, 294, 111, 111, 294, 294, 111, 294, + 294, 111, 66, 294, 48, 302, 294, 343, 313, 337, + 341, 111, 340, 324, 321, 111, 294, 111, 314, 0, + 294, 0, 294, 322, 315, 111, 319, 111, 294, 0, + 294, 0, 294, 0, 297, 0, 0, 0, 0, 0, + 317, 0, 0, 0, 0, 350, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 403, 0, 0, + 404, 0, 0, 0, 0, 0, 0, 130, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 67, 0, 49, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 260, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 261, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 131, 0, 0, 0, 0, 0, - 0}; + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; const int JavaScriptGrammar::action_check [] = { - 76, 61, 60, 8, 48, 29, 60, 7, 29, 2, - 48, 29, 60, 33, 1, 61, 8, 76, 48, 36, - 29, 2, 29, 8, 8, 33, 29, 33, 8, 55, - 7, 60, 33, 7, 17, 5, 55, 36, 29, 7, - 1, 36, 7, 7, 7, 55, 36, 7, 61, 60, - 16, 55, 5, 31, 36, 2, 29, 33, 29, 5, - 85, 36, 7, 20, 36, 7, 60, 36, 17, 36, - 85, 33, 8, 8, 33, 29, 7, 2, 36, 29, - 36, 33, 8, 7, 7, 29, 29, 8, 29, 0, - 76, 1, 8, 48, 33, 74, 36, 29, 36, 36, - 29, 29, 36, 7, -1, 8, 8, 8, 8, 60, - 8, 15, 60, 40, 7, 8, 8, 8, 8, 6, - 40, 40, 55, 7, 51, 42, 8, 7, 29, 8, - 8, 51, 51, 20, 7, 65, 53, 50, 8, 61, - 62, 54, 15, 61, 62, 61, 61, 62, 29, 33, - 8, 8, 40, 56, 7, 36, 61, 62, 60, 29, - 60, 8, 60, 51, 56, 56, 61, 62, 29, 15, - 60, -1, 61, 62, 56, 50, 61, 62, 29, 54, - 33, 60, 60, 25, 25, 27, 27, 12, 34, 12, - 36, 25, 25, 27, 27, -1, 38, 38, 8, -1, - 61, 62, 60, 60, 38, 38, -1, -1, 10, 56, - 61, 62, 25, 25, 27, 27, 25, 25, 27, 27, - 15, 8, 25, 29, 27, 38, 38, 15, 29, 38, - 38, 25, 57, 27, 57, 38, 8, -1, 63, 34, - 63, 36, -1, -1, 38, 25, 34, 27, 36, -1, - -1, 61, 62, 55, -1, 61, 62, 25, 38, 27, - 61, 62, -1, 25, -1, 27, 18, 19, 18, 19, - 38, 18, 19, 22, 61, 62, 38, 18, 19, -1, - 29, -1, -1, -1, 22, -1, 12, -1, -1, 61, - 62, 29, -1, 45, 46, 45, 46, -1, 45, 46, - 23, 24, -1, -1, 45, 46, 22, -1, 31, 32, - 23, 24, 35, 29, 37, -1, -1, -1, 31, 32, - 22, -1, 35, 72, 37, -1, -1, 29, -1, -1, - -1, 57, 81, -1, 72, 84, -1, 63, -1, 55, - 23, 24, -1, 81, -1, -1, 84, -1, 31, 32, - 3, -1, 35, 55, 37, -1, 72, -1, -1, -1, - 13, -1, 23, 24, 17, 81, -1, -1, 84, -1, - 72, 32, -1, 26, 35, 28, 37, -1, -1, 81, - -1, -1, 84, 3, -1, -1, 39, -1, 41, 42, - -1, -1, -1, 13, -1, -1, 49, 17, -1, 52, - 53, -1, -1, -1, -1, 58, 26, -1, 28, -1, - -1, 64, -1, -1, -1, -1, -1, -1, -1, 39, - 3, 41, 42, -1, 77, -1, -1, 23, 24, 49, - 13, -1, 52, 53, 17, 31, 32, -1, 58, 35, - -1, 37, -1, 26, 64, 28, -1, -1, 31, -1, - -1, -1, -1, -1, -1, -1, 39, 77, 41, 42, - -1, -1, -1, -1, -1, -1, 49, -1, -1, 52, - 53, -1, -1, -1, -1, 58, -1, -1, -1, -1, - -1, 64, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 12, 13, 77, -1, -1, -1, -1, -1, + 76, 17, 1, 60, 36, 33, 29, 8, 33, 36, + 61, 5, 29, 8, 7, 29, 55, 60, 20, 5, + 33, 36, 1, 76, 48, 5, 29, 33, 48, 29, + 7, 7, 29, 55, 8, 17, 7, 29, 36, 60, + 31, 29, 61, 16, 29, 7, 7, 36, 8, 33, + 7, 29, 7, 61, 7, 36, 7, 29, 8, 8, + 7, 36, 29, 7, 60, 2, 8, 85, 7, 33, + 29, 2, 8, 36, 2, 29, 8, 60, 36, 48, + 36, 29, 48, 0, 36, 8, 76, 33, 7, 7, + 60, 29, 60, 33, 8, 36, 8, 8, 85, 6, + 65, 36, 36, 29, 33, 29, 7, 8, 8, 36, + 55, 8, 55, 20, 29, 8, 10, 8, 8, 8, + 42, 36, 8, 7, 40, 8, -1, 60, -1, 50, + 55, 53, 7, 54, 40, 51, 40, 7, -1, 8, + 15, 61, 62, 8, 74, 51, 60, 51, 60, 33, + 61, 61, 62, 61, 62, 8, 8, 1, 50, 56, + 60, 55, 54, 33, 29, 8, 40, 60, 8, 60, + 60, 60, 10, 56, 60, -1, 29, 51, 12, 61, + 62, 61, 62, 61, 62, 61, 62, 56, 25, 15, + 27, 29, 25, 25, 27, 27, 25, 12, 27, 29, + 12, 38, 29, 8, 56, 38, 38, 8, 34, 38, + 36, -1, 25, 56, 27, 25, -1, 27, 15, 18, + 19, 61, 62, 57, -1, 38, 29, -1, 38, 63, + -1, 61, 62, 29, 61, 62, 25, 34, 27, 36, + 18, 19, 57, 15, 7, 57, 45, 46, 63, 38, + -1, 63, 15, 18, 19, -1, 61, 62, 61, 62, + 61, 62, 34, -1, 36, 61, 62, 45, 46, 18, + 19, 22, -1, 23, 24, -1, -1, -1, 29, -1, + 45, 46, 32, -1, 22, 35, -1, 37, -1, 23, + 24, 29, -1, 23, 24, -1, 45, 46, 32, 23, + 24, 35, 32, 37, -1, 35, -1, 37, 32, 22, + -1, 35, -1, 37, 23, 24, 29, 22, -1, -1, + -1, 72, -1, 32, 29, 25, 35, 27, 37, -1, + 81, -1, -1, 84, 72, -1, -1, -1, 38, -1, + -1, -1, 55, 81, -1, -1, 84, -1, -1, -1, + 55, -1, -1, -1, -1, 3, -1, -1, -1, 72, + -1, -1, -1, -1, -1, 13, -1, 72, 81, 17, + -1, 84, -1, -1, -1, -1, 81, -1, 26, 84, + 28, -1, -1, -1, -1, -1, -1, -1, 23, 24, + -1, 39, -1, 41, 42, -1, 31, 32, -1, -1, + 35, 49, 37, -1, 52, 53, -1, -1, -1, -1, + 58, 3, -1, -1, -1, -1, 64, -1, -1, -1, + -1, 13, -1, -1, -1, 17, -1, -1, -1, 77, + -1, -1, -1, -1, 26, -1, 28, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 39, -1, 41, + 42, -1, -1, 12, 13, -1, -1, 49, -1, -1, + 52, 53, -1, 22, -1, -1, 58, -1, -1, -1, + 29, -1, 64, -1, 33, 34, -1, 36, -1, -1, + -1, -1, -1, -1, 43, 77, -1, -1, 47, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 65, -1, 67, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 78, + 79, 80, -1, -1, -1, -1, -1, -1, -1, 3, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 13, + -1, -1, -1, 17, -1, -1, -1, -1, -1, -1, + -1, -1, 26, -1, 28, -1, -1, 31, -1, -1, + -1, -1, -1, -1, -1, 39, -1, 41, 42, -1, + -1, -1, -1, -1, -1, 49, -1, -1, 52, 53, + -1, -1, -1, -1, 58, -1, -1, -1, -1, -1, + 64, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 77, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, + -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, + -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, + -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, + 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 65, -1, + 67, -1, 69, -1, 71, -1, 73, -1, -1, -1, + -1, 78, 79, 80, -1, -1, -1, -1, -1, -1, + -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, - -1, -1, -1, 43, -1, -1, -1, 47, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 65, -1, 67, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 78, 79, + 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, + -1, 51, -1, 53, -1, -1, 56, -1, -1, -1, + -1, -1, -1, -1, -1, 65, -1, 67, -1, 69, + -1, 71, -1, 73, -1, -1, -1, -1, 78, 79, 80, -1, -1, -1, -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 65, -1, 67, -1, 69, -1, 71, -1, + -1, -1, 65, -1, 67, -1, 69, -1, 71, 72, 73, -1, -1, -1, -1, 78, 79, 80, -1, -1, -1, -1, -1, -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 65, - -1, 67, -1, 69, -1, 71, 72, 73, -1, -1, + 56, -1, -1, -1, -1, -1, -1, -1, -1, 65, + -1, 67, -1, 69, -1, 71, -1, 73, -1, -1, -1, -1, 78, 79, 80, -1, -1, -1, -1, -1, - -1, -1, 11, 12, 13, -1, -1, -1, -1, -1, - -1, -1, -1, 22, -1, -1, -1, -1, -1, -1, - 29, -1, -1, -1, 33, 34, -1, 36, -1, -1, - -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, - -1, -1, 51, -1, 53, -1, -1, 56, -1, -1, - -1, -1, -1, -1, -1, -1, 65, -1, 67, -1, - 69, -1, 71, -1, 73, -1, -1, -1, -1, 78, - 79, 80, -1, -1, -1, -1, -1, -1, -1, 11, - 12, 13, -1, -1, -1, -1, -1, -1, -1, -1, - 22, -1, -1, -1, -1, -1, -1, 29, -1, -1, - -1, 33, 34, -1, 36, -1, -1, -1, 40, -1, - 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, - -1, 53, -1, -1, 56, -1, -1, -1, -1, -1, - -1, -1, -1, 65, -1, 67, -1, 69, -1, 71, - -1, 73, -1, -1, -1, -1, 78, 79, 80, -1, - -1, -1, -1, -1, -1, -1, 7, -1, -1, -1, - 11, 12, 13, -1, -1, -1, -1, -1, -1, -1, - -1, 22, -1, -1, -1, -1, -1, -1, 29, -1, - -1, -1, 33, 34, -1, 36, -1, -1, -1, 40, - -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, - 51, -1, 53, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 65, -1, 67, -1, 69, -1, - 71, -1, 73, -1, -1, -1, -1, 78, 79, 80, - -1, -1, -1, -1, -1, -1, -1, 4, 5, 6, + -1, -1, 7, -1, -1, -1, 11, 12, 13, -1, + -1, -1, -1, -1, -1, -1, -1, 22, -1, -1, + -1, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, + -1, -1, 47, -1, -1, -1, 51, -1, 53, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 65, -1, 67, -1, 69, -1, 71, -1, 73, -1, + -1, -1, -1, 78, 79, 80, -1, -1, -1, -1, + -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, + 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, + 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, + 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 43, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 59, -1, + -1, -1, -1, -1, -1, 66, 67, 68, -1, 70, + 71, 72, 73, 74, 75, -1, -1, 78, 79, 80, + 81, 82, 83, -1, -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 59, -1, -1, -1, -1, -1, -1, 66, + 47, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 59, -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, 75, -1, -1, 78, 79, 80, 81, 82, 83, -1, -1, -1, -1, 4, 5, 6, -1, -1, 9, 10, 11, -1, @@ -602,18 +579,18 @@ const int JavaScriptGrammar::action_check [] = { -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 59, -1, -1, -1, + -1, -1, 55, -1, -1, -1, 59, -1, -1, -1, -1, -1, 65, 66, 67, 68, -1, 70, 71, 72, 73, 74, 75, -1, -1, 78, 79, 80, 81, 82, - 83, -1, -1, -1, -1, 4, 5, 6, -1, -1, - 9, 10, 11, -1, -1, 14, -1, 16, -1, -1, - -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, - 29, 30, 31, 32, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 43, -1, -1, -1, 47, -1, - -1, -1, -1, -1, -1, -1, 55, -1, -1, -1, - 59, -1, -1, -1, -1, -1, 65, 66, 67, 68, - -1, 70, 71, 72, 73, 74, 75, -1, -1, 78, - 79, 80, 81, 82, 83, -1, -1, -1, -1, 4, + 83, -1, -1, -1, -1, 4, -1, -1, -1, -1, + 9, -1, 11, 12, 13, 14, -1, -1, -1, -1, + -1, -1, 21, 22, -1, -1, -1, -1, -1, -1, + 29, 30, -1, -1, 33, 34, -1, 36, -1, -1, + -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, + -1, -1, 51, -1, 53, -1, -1, -1, -1, -1, + 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, + 69, 70, 71, 72, 73, 74, 75, -1, -1, 78, + 79, 80, 81, 82, -1, -1, -1, -1, -1, 4, -1, -1, -1, -1, 9, -1, 11, 12, 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, -1, -1, -1, -1, -1, -1, 29, 30, -1, -1, 33, 34, @@ -639,58 +616,47 @@ const int JavaScriptGrammar::action_check [] = { -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, 78, 79, 80, 81, 82, -1, -1, -1, -1, - -1, 4, -1, -1, -1, -1, 9, -1, 11, 12, - 13, 14, -1, -1, -1, -1, -1, -1, 21, 22, - -1, -1, -1, -1, -1, -1, 29, 30, -1, -1, + -1, 4, 5, 6, -1, -1, 9, 10, 11, 12, + 13, 14, -1, 16, -1, -1, -1, 20, 21, 22, + -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, 33, 34, -1, 36, -1, -1, -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, -1, -1, 51, -1, - 53, -1, -1, -1, -1, -1, 59, -1, 61, -1, + 53, -1, 55, -1, -1, -1, 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, -1, -1, 78, 79, 80, 81, 82, - -1, -1, -1, -1, -1, 4, 5, 6, -1, -1, - 9, 10, 11, 12, 13, 14, -1, 16, -1, -1, - -1, 20, 21, 22, -1, -1, -1, -1, -1, -1, - 29, 30, 31, 32, 33, 34, -1, 36, -1, -1, - -1, 40, -1, 42, 43, 44, -1, -1, 47, -1, - -1, -1, 51, -1, 53, -1, 55, -1, -1, -1, - 59, -1, 61, -1, -1, -1, 65, 66, 67, 68, - 69, 70, 71, 72, 73, 74, 75, -1, -1, 78, - 79, 80, 81, 82, 83, -1, -1, -1, -1, + 83, -1, -1, -1, -1, - 12, 20, 11, 20, 12, 16, 20, 20, 84, 58, - 87, 54, 58, 20, 89, 12, 11, 20, 12, 12, - 72, 72, 22, 58, 20, 9, 11, 14, 20, 11, - 78, 12, 12, 11, 11, 5, 11, 20, 76, 12, - 11, 20, 11, 90, 12, 11, 20, 23, 58, 12, - 11, -1, 12, 12, 12, 12, 12, 12, 10, 9, - 9, -1, 6, 11, 11, -1, 31, 31, -1, 31, - 14, 36, 36, 35, 8, 2, 10, 31, 31, -1, - 31, 35, 35, -1, -1, 36, 11, 14, 31, 31, - 31, 31, 31, 6, 11, 31, 13, 36, 31, 41, - 36, 14, 43, 36, 47, 45, 25, 31, 31, 28, - 31, 34, 36, 31, 12, 36, 12, 31, 36, 33, - 31, 31, 33, 33, 31, 31, 33, 31, 34, 31, - 31, 33, 36, -1, 31, 36, 33, 31, 12, 33, - 12, 23, 24, 31, 31, 33, 33, 31, 31, 33, - 31, 20, 25, 20, 37, 28, 37, 55, 27, 55, - 27, 31, -1, 31, -1, 31, 36, 31, 31, 37, - 33, 37, 31, 7, 33, 39, 10, 31, 31, 33, - 33, 55, 31, 55, 33, 31, 31, 31, 31, 31, - 36, 36, 36, 36, 36, 11, -1, 13, 31, 31, - 42, 46, 48, 36, 36, -1, 31, -1, 31, 53, - 53, 36, 44, 36, 31, 38, -1, 31, 31, 36, - 53, 38, 36, 36, 31, 38, 40, 31, 53, 36, - -1, -1, 36, -1, 38, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 53, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 11, -1, 13, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 20, 72, 84, 89, 14, 72, 20, 5, 20, 22, + 12, 20, 11, 20, 20, 16, 12, 11, 54, 11, + 76, 12, 90, 58, 12, 58, 12, 20, 11, 58, + 12, 12, 12, 10, 58, 11, 9, 12, 12, 11, + 11, 11, 20, 9, 11, 87, 11, 9, 12, 12, + 78, 12, 12, 12, 23, 11, 6, -1, 12, 12, + 11, -1, 20, 20, 14, 20, 7, -1, 11, 10, + 13, -1, 8, 20, 10, 23, 24, -1, 11, 31, + 27, -1, 31, 35, 2, 31, 31, 36, -1, 31, + 35, 31, 31, 31, -1, 41, 14, 35, 12, 31, + 31, 33, 33, 43, 31, 47, 45, 31, 31, 36, + 33, 31, 36, 33, 31, 31, 31, 33, 33, 36, + 31, 31, 33, 31, 12, 12, 36, 31, 36, 33, + 31, 31, 12, 33, 31, 36, 31, 34, 33, 31, + 25, 55, 34, 28, -1, 31, 20, 33, 31, 31, + 31, -1, 31, 27, 37, 31, 37, 39, 37, 31, + 36, 31, -1, -1, 36, 6, 36, 55, 55, 31, + -1, 31, 31, 14, 36, 55, 36, 31, 37, 33, + 31, 31, 33, 33, 31, 31, 33, 11, 31, 13, + 36, 31, 31, 36, 31, 31, 36, 36, 31, 36, + 36, 31, 11, 36, 13, 38, 36, 53, 38, 46, + 53, 31, 48, 53, 53, 31, 36, 31, 38, -1, + 36, -1, 36, 31, 38, 31, 42, 31, 36, -1, + 36, -1, 36, -1, 40, -1, -1, -1, -1, -1, + 44, -1, -1, -1, -1, 53, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 25, -1, -1, + 28, -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 96, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 91, -1, -1, -1, -1, -1, - -1}; + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}; diff --git a/src/declarative/qml/parser/javascriptgrammar_p.h b/src/declarative/qml/parser/javascriptgrammar_p.h index 490acb2..b6ffbc6 100644 --- a/src/declarative/qml/parser/javascriptgrammar_p.h +++ b/src/declarative/qml/parser/javascriptgrammar_p.h @@ -1,56 +1,4 @@ // This file was generated by qlalr - DO NOT EDIT! -/**************************************************************************** -** -** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** Contact: Qt Software Information (qt-info@nokia.com) -** -** This file is part of the QtCore module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the either Technology Preview License Agreement or the -** Beta Release License Agreement. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain -** additional rights. These rights are described in the Nokia Qt LGPL -** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this -** package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** If you are unsure which license is appropriate for your use, please -** contact the sales department at qt-sales@nokia.com. -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists for the convenience -// of other Qt classes. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - #ifndef JAVASCRIPTGRAMMAR_P_H #define JAVASCRIPTGRAMMAR_P_H @@ -147,15 +95,15 @@ public: T_XOR = 76, T_XOR_EQ = 77, - ACCEPT_STATE = 7, - RULE_COUNT = 296, - STATE_COUNT = 520, + ACCEPT_STATE = 524, + RULE_COUNT = 298, + STATE_COUNT = 525, TERMINAL_COUNT = 88, NON_TERMINAL_COUNT = 98, - GOTO_INDEX_OFFSET = 520, - GOTO_INFO_OFFSET = 1629, - GOTO_CHECK_OFFSET = 1629 + GOTO_INDEX_OFFSET = 525, + GOTO_INFO_OFFSET = 1675, + GOTO_CHECK_OFFSET = 1675 }; static const char *const spell []; diff --git a/src/declarative/qml/parser/javascriptlexer.cpp b/src/declarative/qml/parser/javascriptlexer.cpp index 80a558d..81f0983 100644 --- a/src/declarative/qml/parser/javascriptlexer.cpp +++ b/src/declarative/qml/parser/javascriptlexer.cpp @@ -311,7 +311,7 @@ int JavaScript::Lexer::findReservedWord(const QChar *c, int size) const else if (c[0] == QLatin1Char('p') && c[1] == QLatin1Char('u') && c[2] == QLatin1Char('b') && c[3] == QLatin1Char('l') && c[4] == QLatin1Char('i') && c[5] == QLatin1Char('c')) - return JavaScriptGrammar::T_RESERVED_WORD; + return JavaScriptGrammar::T_PUBLIC; else if (c[0] == QLatin1Char('n') && c[1] == QLatin1Char('a') && c[2] == QLatin1Char('t') && c[3] == QLatin1Char('i') && c[4] == QLatin1Char('v') && c[5] == QLatin1Char('e')) diff --git a/src/declarative/qml/parser/javascriptparser.cpp b/src/declarative/qml/parser/javascriptparser.cpp index 6221386..f868216 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -123,6 +123,7 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) first_token = last_token = 0; tos = -1; + program = 0; do { if (++tos == stack_size) @@ -163,8 +164,9 @@ bool JavaScriptParser::parse(JavaScriptEnginePrivate *driver) switch (r) { case 0: { - sym(1).Node = makeAstNode<AST::UiProgram> (driver->nodePool(), sym(1).UiImportList, + program = makeAstNode<AST::UiProgram> (driver->nodePool(), sym(1).UiImportList, sym(2).UiObjectMemberList->finish()); + sym(1).UiProgram = program; } break; case 2: { @@ -246,7 +248,7 @@ case 19: { sym(4).UiObjectMemberList->finish()); node->colonToken = loc(2); node->lbracketToken = loc(3); - node->rbraceToken = loc(5); + node->rbracketToken = loc(5); sym(1).Node = node; } break; case 20: @@ -266,6 +268,15 @@ case 22: { } break; case 23: { + AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval); + node->isDefaultMember = true; + node->publicToken = loc(1); + node->attributeTypeToken = loc(3); + node->identifierToken = loc(4); + sym(1).Node = node; +} break; + +case 24: { AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(2).sval, sym(3).sval, sym(5).Expression); node->publicToken = loc(1); @@ -275,69 +286,80 @@ case 23: { sym(1).Node = node; } break; -case 24: { +case 25: { + AST::UiPublicMember *node = makeAstNode<AST::UiPublicMember> (driver->nodePool(), sym(3).sval, sym(4).sval, + sym(6).Expression); + node->isDefaultMember = true; + node->publicToken = loc(1); + node->attributeTypeToken = loc(3); + node->identifierToken = loc(4); + node->colonToken = loc(5); + sym(1).Node = node; +} break; + +case 26: { sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node); } break; -case 25: { +case 27: { sym(1).Node = makeAstNode<AST::UiSourceElement>(driver->nodePool(), sym(1).Node); } break; -case 26: { +case 28: { AST::UiQualifiedId *node = makeAstNode<AST::UiQualifiedId> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 27: { +case 29: { AST::UiQualifiedId *node = makeAstNode<AST::UiQualifiedId> (driver->nodePool(), sym(1).UiQualifiedId, sym(3).sval); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 28: { +case 30: { AST::ThisExpression *node = makeAstNode<AST::ThisExpression> (driver->nodePool()); node->thisToken = loc(1); sym(1).Node = node; } break; -case 29: { +case 31: { AST::IdentifierExpression *node = makeAstNode<AST::IdentifierExpression> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 30: { +case 32: { AST::NullExpression *node = makeAstNode<AST::NullExpression> (driver->nodePool()); node->nullToken = loc(1); sym(1).Node = node; } break; -case 31: { +case 33: { AST::TrueLiteral *node = makeAstNode<AST::TrueLiteral> (driver->nodePool()); node->trueToken = loc(1); sym(1).Node = node; } break; -case 32: { +case 34: { AST::FalseLiteral *node = makeAstNode<AST::FalseLiteral> (driver->nodePool()); node->falseToken = loc(1); sym(1).Node = node; } break; -case 33: { +case 35: { AST::NumericLiteral *node = makeAstNode<AST::NumericLiteral> (driver->nodePool(), sym(1).dval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 34: { +case 36: { AST::StringLiteral *node = makeAstNode<AST::StringLiteral> (driver->nodePool(), sym(1).sval); node->literalToken = loc(1); sym(1).Node = node; } break; -case 35: { +case 37: { bool rx = lexer->scanRegExp(Lexer::NoPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -349,7 +371,7 @@ case 35: { sym(1).Node = node; } break; -case 36: { +case 38: { bool rx = lexer->scanRegExp(Lexer::EqualPrefix); if (!rx) { diagnostic_messages.append(DiagnosticMessage(DiagnosticMessage::Error, lexer->startLineNo(), @@ -361,21 +383,21 @@ case 36: { sym(1).Node = node; } break; -case 37: { +case 39: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).Elision); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 38: { +case 40: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish ()); node->lbracketToken = loc(1); node->rbracketToken = loc(3); sym(1).Node = node; } break; -case 39: { +case 41: { AST::ArrayLiteral *node = makeAstNode<AST::ArrayLiteral> (driver->nodePool(), sym(2).ElementList->finish (), sym(4).Elision); node->lbracketToken = loc(1); node->commaToken = loc(3); @@ -383,7 +405,7 @@ case 39: { sym(1).Node = node; } break; -case 40: { +case 42: { AST::ObjectLiteral *node = 0; if (sym(2).Node) node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(), @@ -395,7 +417,7 @@ case 40: { sym(1).Node = node; } break; -case 41: { +case 43: { AST::ObjectLiteral *node = makeAstNode<AST::ObjectLiteral> (driver->nodePool(), sym(2).PropertyNameAndValueList->finish ()); node->lbraceToken = loc(1); @@ -403,51 +425,51 @@ case 41: { sym(1).Node = node; } break; -case 42: { +case 44: { AST::NestedExpression *node = makeAstNode<AST::NestedExpression>(driver->nodePool(), sym(2).Expression); node->lparenToken = loc(1); node->rparenToken = loc(3); sym(1).Node = node; } break; -case 43: { +case 45: { sym(1).Node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).Elision, sym(2).Expression); } break; -case 44: { +case 46: { AST::ElementList *node = makeAstNode<AST::ElementList> (driver->nodePool(), sym(1).ElementList, sym(3).Elision, sym(4).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 45: { +case 47: { AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool()); node->commaToken = loc(1); sym(1).Node = node; } break; -case 46: { +case 48: { AST::Elision *node = makeAstNode<AST::Elision> (driver->nodePool(), sym(1).Elision); node->commaToken = loc(2); sym(1).Node = node; } break; -case 47: { +case 49: { sym(1).Node = 0; } break; -case 48: { +case 50: { sym(1).Elision = sym(1).Elision->finish (); } break; -case 49: { +case 51: { AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyName, sym(3).Expression); node->colonToken = loc(2); sym(1).Node = node; } break; -case 50: { +case 52: { AST::PropertyNameAndValueList *node = makeAstNode<AST::PropertyNameAndValueList> (driver->nodePool(), sym(1).PropertyNameAndValueList, sym(3).PropertyName, sym(5).Expression); node->commaToken = loc(2); @@ -455,34 +477,30 @@ case 50: { sym(1).Node = node; } break; -case 51: { +case 53: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 52: { +case 54: { AST::StringLiteralPropertyName *node = makeAstNode<AST::StringLiteralPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 53: { +case 55: { AST::NumericLiteralPropertyName *node = makeAstNode<AST::NumericLiteralPropertyName> (driver->nodePool(), sym(1).dval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 54: { +case 56: { AST::IdentifierPropertyName *node = makeAstNode<AST::IdentifierPropertyName> (driver->nodePool(), sym(1).sval); node->propertyNameToken = loc(1); sym(1).Node = node; } break; -case 55: - -case 56: - case 57: case 58: @@ -540,25 +558,29 @@ case 83: case 84: case 85: + +case 86: + +case 87: { sym(1).sval = driver->intern(lexer->characterBuffer(), lexer->characterCount()); } break; -case 90: { +case 92: { AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 91: { +case 93: { AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 92: { +case 94: { AST::NewMemberExpression *node = makeAstNode<AST::NewMemberExpression> (driver->nodePool(), sym(2).Expression, sym(4).ArgumentList); node->newToken = loc(1); node->lparenToken = loc(3); @@ -566,316 +588,309 @@ case 92: { sym(1).Node = node; } break; -case 94: { +case 96: { AST::NewExpression *node = makeAstNode<AST::NewExpression> (driver->nodePool(), sym(2).Expression); node->newToken = loc(1); sym(1).Node = node; } break; -case 95: { +case 97: { AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 96: { +case 98: { AST::CallExpression *node = makeAstNode<AST::CallExpression> (driver->nodePool(), sym(1).Expression, sym(3).ArgumentList); node->lparenToken = loc(2); node->rparenToken = loc(4); sym(1).Node = node; } break; -case 97: { +case 99: { AST::ArrayMemberExpression *node = makeAstNode<AST::ArrayMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->lbracketToken = loc(2); node->rbracketToken = loc(4); sym(1).Node = node; } break; -case 98: { +case 100: { AST::FieldMemberExpression *node = makeAstNode<AST::FieldMemberExpression> (driver->nodePool(), sym(1).Expression, sym(3).sval); node->dotToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 99: { +case 101: { sym(1).Node = 0; } break; -case 100: { +case 102: { sym(1).Node = sym(1).ArgumentList->finish(); } break; -case 101: { +case 103: { sym(1).Node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).Expression); } break; -case 102: { +case 104: { AST::ArgumentList *node = makeAstNode<AST::ArgumentList> (driver->nodePool(), sym(1).ArgumentList, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 106: { +case 108: { AST::PostIncrementExpression *node = makeAstNode<AST::PostIncrementExpression> (driver->nodePool(), sym(1).Expression); node->incrementToken = loc(2); sym(1).Node = node; } break; -case 107: { +case 109: { AST::PostDecrementExpression *node = makeAstNode<AST::PostDecrementExpression> (driver->nodePool(), sym(1).Expression); node->decrementToken = loc(2); sym(1).Node = node; } break; -case 109: { +case 111: { AST::DeleteExpression *node = makeAstNode<AST::DeleteExpression> (driver->nodePool(), sym(2).Expression); node->deleteToken = loc(1); sym(1).Node = node; } break; -case 110: { +case 112: { AST::VoidExpression *node = makeAstNode<AST::VoidExpression> (driver->nodePool(), sym(2).Expression); node->voidToken = loc(1); sym(1).Node = node; } break; -case 111: { +case 113: { AST::TypeOfExpression *node = makeAstNode<AST::TypeOfExpression> (driver->nodePool(), sym(2).Expression); node->typeofToken = loc(1); sym(1).Node = node; } break; -case 112: { +case 114: { AST::PreIncrementExpression *node = makeAstNode<AST::PreIncrementExpression> (driver->nodePool(), sym(2).Expression); node->incrementToken = loc(1); sym(1).Node = node; } break; -case 113: { +case 115: { AST::PreDecrementExpression *node = makeAstNode<AST::PreDecrementExpression> (driver->nodePool(), sym(2).Expression); node->decrementToken = loc(1); sym(1).Node = node; } break; -case 114: { +case 116: { AST::UnaryPlusExpression *node = makeAstNode<AST::UnaryPlusExpression> (driver->nodePool(), sym(2).Expression); node->plusToken = loc(1); sym(1).Node = node; } break; -case 115: { +case 117: { AST::UnaryMinusExpression *node = makeAstNode<AST::UnaryMinusExpression> (driver->nodePool(), sym(2).Expression); node->minusToken = loc(1); sym(1).Node = node; } break; -case 116: { +case 118: { AST::TildeExpression *node = makeAstNode<AST::TildeExpression> (driver->nodePool(), sym(2).Expression); node->tildeToken = loc(1); sym(1).Node = node; } break; -case 117: { +case 119: { AST::NotExpression *node = makeAstNode<AST::NotExpression> (driver->nodePool(), sym(2).Expression); node->notToken = loc(1); sym(1).Node = node; } break; -case 119: { +case 121: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mul, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 120: { +case 122: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Div, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 121: { +case 123: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Mod, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 123: { +case 125: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Add, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 124: { +case 126: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Sub, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 126: { +case 128: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::LShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 127: { +case 129: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::RShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 128: { +case 130: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::URShift, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 130: { +case 132: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 131: { +case 133: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 132: { +case 134: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 133: { +case 135: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 134: { +case 136: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 135: { +case 137: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::In, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 137: { +case 139: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Lt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 138: { +case 140: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Gt, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 139: { +case 141: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Le, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 140: { +case 142: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Ge, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 141: { +case 143: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::InstanceOf, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 143: { +case 145: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 144: { +case 146: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 145: { +case 147: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 146: { +case 148: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 148: { +case 150: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::Equal, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 149: { +case 151: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::NotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 150: { +case 152: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, QSOperator::StrictEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 151: { - AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::StrictNotEqual, sym(3).Expression); - node->operatorToken = loc(2); - sym(1).Node = node; -} break; - case 153: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitAnd, sym(3).Expression); + QSOperator::StrictNotEqual, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -889,7 +904,7 @@ case 155: { case 157: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitXor, sym(3).Expression); + QSOperator::BitAnd, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -903,7 +918,7 @@ case 159: { case 161: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::BitOr, sym(3).Expression); + QSOperator::BitXor, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -917,7 +932,7 @@ case 163: { case 165: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::And, sym(3).Expression); + QSOperator::BitOr, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -931,7 +946,7 @@ case 167: { case 169: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, - QSOperator::Or, sym(3).Expression); + QSOperator::And, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; @@ -944,6 +959,13 @@ case 171: { } break; case 173: { + AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, + QSOperator::Or, sym(3).Expression); + node->operatorToken = loc(2); + sym(1).Node = node; +} break; + +case 175: { AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -951,7 +973,7 @@ case 173: { sym(1).Node = node; } break; -case 175: { +case 177: { AST::ConditionalExpression *node = makeAstNode<AST::ConditionalExpression> (driver->nodePool(), sym(1).Expression, sym(3).Expression, sym(5).Expression); node->questionToken = loc(2); @@ -959,112 +981,112 @@ case 175: { sym(1).Node = node; } break; -case 177: { +case 179: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 179: { +case 181: { AST::BinaryExpression *node = makeAstNode<AST::BinaryExpression> (driver->nodePool(), sym(1).Expression, sym(2).ival, sym(3).Expression); node->operatorToken = loc(2); sym(1).Node = node; } break; -case 180: { +case 182: { sym(1).ival = QSOperator::Assign; } break; -case 181: { +case 183: { sym(1).ival = QSOperator::InplaceMul; } break; -case 182: { +case 184: { sym(1).ival = QSOperator::InplaceDiv; } break; -case 183: { +case 185: { sym(1).ival = QSOperator::InplaceMod; } break; -case 184: { +case 186: { sym(1).ival = QSOperator::InplaceAdd; } break; -case 185: { +case 187: { sym(1).ival = QSOperator::InplaceSub; } break; -case 186: { +case 188: { sym(1).ival = QSOperator::InplaceLeftShift; } break; -case 187: { +case 189: { sym(1).ival = QSOperator::InplaceRightShift; } break; -case 188: { +case 190: { sym(1).ival = QSOperator::InplaceURightShift; } break; -case 189: { +case 191: { sym(1).ival = QSOperator::InplaceAnd; } break; -case 190: { +case 192: { sym(1).ival = QSOperator::InplaceXor; } break; -case 191: { +case 193: { sym(1).ival = QSOperator::InplaceOr; } break; -case 193: { +case 195: { AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 194: { +case 196: { sym(1).Node = 0; } break; -case 197: { +case 199: { AST::Expression *node = makeAstNode<AST::Expression> (driver->nodePool(), sym(1).Expression, sym(3).Expression); node->commaToken = loc(2); sym(1).Node = node; } break; -case 198: { +case 200: { sym(1).Node = 0; } break; -case 215: { +case 217: { AST::Block *node = makeAstNode<AST::Block> (driver->nodePool(), sym(2).StatementList); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 216: { +case 218: { sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).Statement); } break; -case 217: { +case 219: { sym(1).Node = makeAstNode<AST::StatementList> (driver->nodePool(), sym(1).StatementList, sym(2).Statement); } break; -case 218: { +case 220: { sym(1).Node = 0; } break; -case 219: { +case 221: { sym(1).Node = sym(1).StatementList->finish (); } break; -case 221: { +case 223: { AST::VariableStatement *node = makeAstNode<AST::VariableStatement> (driver->nodePool(), sym(2).VariableDeclarationList->finish (/*readOnly=*/sym(1).ival == T_CONST)); node->declarationKindToken = loc(1); @@ -1072,76 +1094,76 @@ case 221: { sym(1).Node = node; } break; -case 222: { +case 224: { sym(1).ival = T_CONST; } break; -case 223: { +case 225: { sym(1).ival = T_VAR; } break; -case 224: { +case 226: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 225: { +case 227: { AST::VariableDeclarationList *node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); node->commaToken = loc(2); sym(1).Node = node; } break; -case 226: { +case 228: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclaration); } break; -case 227: { +case 229: { sym(1).Node = makeAstNode<AST::VariableDeclarationList> (driver->nodePool(), sym(1).VariableDeclarationList, sym(3).VariableDeclaration); } break; -case 228: { +case 230: { AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 229: { +case 231: { AST::VariableDeclaration *node = makeAstNode<AST::VariableDeclaration> (driver->nodePool(), sym(1).sval, sym(2).Expression); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 230: { +case 232: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 231: { +case 233: { sym(1).Node = 0; } break; -case 233: { +case 235: { // ### TODO: AST for initializer sym(1) = sym(2); } break; -case 234: { +case 236: { sym(1).Node = 0; } break; -case 236: { +case 238: { AST::EmptyStatement *node = makeAstNode<AST::EmptyStatement> (driver->nodePool()); node->semicolonToken = loc(1); sym(1).Node = node; } break; -case 238: { +case 240: { AST::ExpressionStatement *node = makeAstNode<AST::ExpressionStatement> (driver->nodePool(), sym(1).Expression); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 239: { +case 241: { AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement, sym(7).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1150,7 +1172,7 @@ case 239: { sym(1).Node = node; } break; -case 240: { +case 242: { AST::IfStatement *node = makeAstNode<AST::IfStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->ifToken = loc(1); node->lparenToken = loc(2); @@ -1158,7 +1180,7 @@ case 240: { sym(1).Node = node; } break; -case 242: { +case 244: { AST::DoWhileStatement *node = makeAstNode<AST::DoWhileStatement> (driver->nodePool(), sym(2).Statement, sym(5).Expression); node->doToken = loc(1); node->whileToken = loc(3); @@ -1168,7 +1190,7 @@ case 242: { sym(1).Node = node; } break; -case 243: { +case 245: { AST::WhileStatement *node = makeAstNode<AST::WhileStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->whileToken = loc(1); node->lparenToken = loc(2); @@ -1176,7 +1198,7 @@ case 243: { sym(1).Node = node; } break; -case 244: { +case 246: { AST::ForStatement *node = makeAstNode<AST::ForStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Expression, sym(9).Statement); node->forToken = loc(1); @@ -1187,7 +1209,7 @@ case 244: { sym(1).Node = node; } break; -case 245: { +case 247: { AST::LocalForStatement *node = makeAstNode<AST::LocalForStatement> (driver->nodePool(), sym(4).VariableDeclarationList->finish (/*readOnly=*/false), sym(6).Expression, sym(8).Expression, sym(10).Statement); @@ -1200,7 +1222,7 @@ case 245: { sym(1).Node = node; } break; -case 246: { +case 248: { AST:: ForEachStatement *node = makeAstNode<AST::ForEachStatement> (driver->nodePool(), sym(3).Expression, sym(5).Expression, sym(7).Statement); node->forToken = loc(1); @@ -1210,7 +1232,7 @@ case 246: { sym(1).Node = node; } break; -case 247: { +case 249: { AST::LocalForEachStatement *node = makeAstNode<AST::LocalForEachStatement> (driver->nodePool(), sym(4).VariableDeclaration, sym(6).Expression, sym(8).Statement); node->forToken = loc(1); @@ -1221,14 +1243,14 @@ case 247: { sym(1).Node = node; } break; -case 249: { +case 251: { AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool()); node->continueToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 251: { +case 253: { AST::ContinueStatement *node = makeAstNode<AST::ContinueStatement> (driver->nodePool(), sym(2).sval); node->continueToken = loc(1); node->identifierToken = loc(2); @@ -1236,14 +1258,14 @@ case 251: { sym(1).Node = node; } break; -case 253: { +case 255: { AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool()); node->breakToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 255: { +case 257: { AST::BreakStatement *node = makeAstNode<AST::BreakStatement> (driver->nodePool(), sym(2).sval); node->breakToken = loc(1); node->identifierToken = loc(2); @@ -1251,14 +1273,14 @@ case 255: { sym(1).Node = node; } break; -case 257: { +case 259: { AST::ReturnStatement *node = makeAstNode<AST::ReturnStatement> (driver->nodePool(), sym(2).Expression); node->returnToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 258: { +case 260: { AST::WithStatement *node = makeAstNode<AST::WithStatement> (driver->nodePool(), sym(3).Expression, sym(5).Statement); node->withToken = loc(1); node->lparenToken = loc(2); @@ -1266,7 +1288,7 @@ case 258: { sym(1).Node = node; } break; -case 259: { +case 261: { AST::SwitchStatement *node = makeAstNode<AST::SwitchStatement> (driver->nodePool(), sym(3).Expression, sym(5).CaseBlock); node->switchToken = loc(1); node->lparenToken = loc(2); @@ -1274,83 +1296,83 @@ case 259: { sym(1).Node = node; } break; -case 260: { +case 262: { AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(3); sym(1).Node = node; } break; -case 261: { +case 263: { AST::CaseBlock *node = makeAstNode<AST::CaseBlock> (driver->nodePool(), sym(2).CaseClauses, sym(3).DefaultClause, sym(4).CaseClauses); node->lbraceToken = loc(1); node->rbraceToken = loc(5); sym(1).Node = node; } break; -case 262: { +case 264: { sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClause); } break; -case 263: { +case 265: { sym(1).Node = makeAstNode<AST::CaseClauses> (driver->nodePool(), sym(1).CaseClauses, sym(2).CaseClause); } break; -case 264: { +case 266: { sym(1).Node = 0; } break; -case 265: { +case 267: { sym(1).Node = sym(1).CaseClauses->finish (); } break; -case 266: { +case 268: { AST::CaseClause *node = makeAstNode<AST::CaseClause> (driver->nodePool(), sym(2).Expression, sym(4).StatementList); node->caseToken = loc(1); node->colonToken = loc(3); sym(1).Node = node; } break; -case 267: { +case 269: { AST::DefaultClause *node = makeAstNode<AST::DefaultClause> (driver->nodePool(), sym(3).StatementList); node->defaultToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 268: { +case 270: { AST::LabelledStatement *node = makeAstNode<AST::LabelledStatement> (driver->nodePool(), sym(1).sval, sym(3).Statement); node->identifierToken = loc(1); node->colonToken = loc(2); sym(1).Node = node; } break; -case 270: { +case 272: { AST::ThrowStatement *node = makeAstNode<AST::ThrowStatement> (driver->nodePool(), sym(2).Expression); node->throwToken = loc(1); node->semicolonToken = loc(3); sym(1).Node = node; } break; -case 271: { +case 273: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch); node->tryToken = loc(1); sym(1).Node = node; } break; -case 272: { +case 274: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 273: { +case 275: { AST::TryStatement *node = makeAstNode<AST::TryStatement> (driver->nodePool(), sym(2).Statement, sym(3).Catch, sym(4).Finally); node->tryToken = loc(1); sym(1).Node = node; } break; -case 274: { +case 276: { AST::Catch *node = makeAstNode<AST::Catch> (driver->nodePool(), sym(3).sval, sym(5).Block); node->catchToken = loc(1); node->lparenToken = loc(2); @@ -1359,20 +1381,20 @@ case 274: { sym(1).Node = node; } break; -case 275: { +case 277: { AST::Finally *node = makeAstNode<AST::Finally> (driver->nodePool(), sym(2).Block); node->finallyToken = loc(1); sym(1).Node = node; } break; -case 277: { +case 279: { AST::DebuggerStatement *node = makeAstNode<AST::DebuggerStatement> (driver->nodePool()); node->debuggerToken = loc(1); node->semicolonToken = loc(2); sym(1).Node = node; } break; -case 278: { +case 280: { AST::FunctionDeclaration *node = makeAstNode<AST::FunctionDeclaration> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); node->identifierToken = loc(2); @@ -1383,7 +1405,7 @@ case 278: { sym(1).Node = node; } break; -case 279: { +case 281: { AST::FunctionExpression *node = makeAstNode<AST::FunctionExpression> (driver->nodePool(), sym(2).sval, sym(4).FormalParameterList, sym(7).FunctionBody); node->functionToken = loc(1); if (sym(2).sval) @@ -1395,56 +1417,56 @@ case 279: { sym(1).Node = node; } break; -case 280: { +case 282: { AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).sval); node->identifierToken = loc(1); sym(1).Node = node; } break; -case 281: { +case 283: { AST::FormalParameterList *node = makeAstNode<AST::FormalParameterList> (driver->nodePool(), sym(1).FormalParameterList, sym(3).sval); node->commaToken = loc(2); node->identifierToken = loc(3); sym(1).Node = node; } break; -case 282: { +case 284: { sym(1).Node = 0; } break; -case 283: { +case 285: { sym(1).Node = sym(1).FormalParameterList->finish (); } break; -case 284: { +case 286: { sym(1).Node = 0; } break; -case 286: { +case 288: { sym(1).Node = makeAstNode<AST::FunctionBody> (driver->nodePool(), sym(1).SourceElements->finish ()); } break; -case 287: { +case 289: { sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElement); } break; -case 288: { +case 290: { sym(1).Node = makeAstNode<AST::SourceElements> (driver->nodePool(), sym(1).SourceElements, sym(2).SourceElement); } break; -case 289: { +case 291: { sym(1).Node = makeAstNode<AST::StatementSourceElement> (driver->nodePool(), sym(1).Statement); } break; -case 290: { +case 292: { sym(1).Node = makeAstNode<AST::FunctionSourceElement> (driver->nodePool(), sym(1).FunctionDeclaration); } break; -case 291: { +case 293: { sym(1).sval = 0; } break; -case 293: { +case 295: { sym(1).Node = 0; } break; @@ -1530,6 +1552,7 @@ case 293: { yytoken = *tk; yylval = 0; yylloc = token_buffer[0].loc; + yylloc.length = 0; first_token = &token_buffer[0]; last_token = &token_buffer[2]; @@ -1552,6 +1575,7 @@ case 293: { yytoken = tk; yylval = 0; yylloc = token_buffer[0].loc; + yylloc.length = 0; action = errorState; goto _Lcheck_token; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index c08a14a..34edaf7 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -143,7 +143,7 @@ public: bool parse(JavaScriptEnginePrivate *driver); JavaScript::AST::UiProgram *ast() - { return sym(1).UiProgram; } + { return program; } QList<DiagnosticMessage> diagnosticMessages() const { return diagnostic_messages; } @@ -183,6 +183,8 @@ protected: int *state_stack; JavaScript::AST::SourceLocation *location_stack; + JavaScript::AST::UiProgram *program; + // error recovery enum { TOKEN_BUFFER_SIZE = 3 }; @@ -204,9 +206,9 @@ protected: }; -#define J_SCRIPT_REGEXPLITERAL_RULE1 35 +#define J_SCRIPT_REGEXPLITERAL_RULE1 37 -#define J_SCRIPT_REGEXPLITERAL_RULE2 36 +#define J_SCRIPT_REGEXPLITERAL_RULE2 38 QT_END_NAMESPACE diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index 00e3ccb..40b854f 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -33,6 +33,7 @@ HEADERS += qml/qmlparser_p.h \ qml/qmlcomponent.h \ qml/qmlcomponent_p.h \ qml/qmlcustomparser.h \ + qml/qmlcustomparser_p.h \ qml/qmlpropertyvaluesource.h \ qml/qmlboundsignal_p.h \ qml/qmlxmlparser_p.h \ diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index fae0f43..4433286 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -59,6 +59,7 @@ #include <qmlcontext.h> #include <qmlmetatype.h> #include <QtCore/qdebug.h> +#include "private/qmlcustomparser_p.h" #include "qmlscriptparser_p.h" @@ -552,6 +553,7 @@ bool QmlCompiler::compileObject(Object *obj, int ctxt) obj->properties.remove(SIGNALS_NAME); } + int createInstrIdx = output->bytecode.count(); if (obj->type != -1 && output->types.at(obj->type).parser) { QByteArray data = obj->custom; int ref = output->indexForByteArray(data); @@ -567,6 +569,7 @@ bool QmlCompiler::compileObject(Object *obj, int ctxt) QmlInstruction create; create.type = QmlInstruction::CreateObject; create.line = obj->line; + create.create.data = -1; create.create.type = obj->type; output->bytecode << create; } @@ -591,19 +594,48 @@ bool QmlCompiler::compileObject(Object *obj, int ctxt) } } + bool isCustomParser = output->types.at(obj->type).type && + output->types.at(obj->type).type->customParser() != 0; + QList<QmlCustomParserProperty> customProps; + foreach(Property *prop, obj->properties) { if (!ignoreProperties && prop->name == PROPERTIES_NAME) { } else if (!ignoreSignals && prop->name == SIGNALS_NAME) { } else if (prop->name.length() >= 3 && prop->name.startsWith("on") && ('A' <= prop->name.at(2) && 'Z' >= prop->name.at(2))) { - COMPILE_CHECK(compileSignal(prop, obj)); + if (!isCustomParser) { + COMPILE_CHECK(compileSignal(prop, obj)); + } else { + customProps << QmlCustomParserNodePrivate::fromProperty(prop); + } } else { - COMPILE_CHECK(compileProperty(prop, obj, ctxt)); + if (!isCustomParser || (isCustomParser && testProperty(prop, obj))) { + COMPILE_CHECK(compileProperty(prop, obj, ctxt)); + } else { + customProps << QmlCustomParserNodePrivate::fromProperty(prop); + } } } - if (obj->defaultProperty) - COMPILE_CHECK(compileProperty(obj->defaultProperty, obj, ctxt)); + if (obj->defaultProperty) { + if(!isCustomParser || (isCustomParser && testProperty(obj->defaultProperty, obj))) { + COMPILE_CHECK(compileProperty(obj->defaultProperty, obj, ctxt)); + } else { + customProps << QmlCustomParserNodePrivate::fromProperty(obj->defaultProperty); + } + } + + if (isCustomParser && !customProps.isEmpty()) { + // ### Check for failure + bool ok = false; + QmlCustomParser *cp = output->types.at(obj->type).type->customParser(); + QByteArray customData = cp->compile(customProps, &ok); + if(!ok) + COMPILE_EXCEPTION("Failure compiling custom type"); + if(!customData.isEmpty()) + output->bytecode[createInstrIdx].create.data = + output->indexForByteArray(customData); + } if (obj->type != -1) { if (output->types.at(obj->type).component) { @@ -764,65 +796,61 @@ bool QmlCompiler::compileSignal(Property *prop, Object *obj) return true; } +// Returns true if prop exists on obj, false otherwise +bool QmlCompiler::testProperty(QmlParser::Property *prop, + QmlParser::Object *obj) +{ + if(isAttachedProperty(prop->name) || prop->name == "id") + return true; + + const QMetaObject *mo = obj->metaObject(); + if (mo) { + if (prop->isDefault) { + QMetaProperty p = QmlMetaType::defaultProperty(mo); + return p.name() != 0; + } else { + int idx = mo->indexOfProperty(prop->name.constData()); + return idx != -1; + } + } + + return false; +} + bool QmlCompiler::compileProperty(Property *prop, Object *obj, int ctxt) { if (prop->values.isEmpty() && !prop->value) return true; // First we're going to need a reference to this property - if (obj->type != -1) { + const QMetaObject *mo = obj->metaObject(); + if (mo && !isAttachedProperty(prop->name)) { + if (prop->isDefault) { + QMetaProperty p = QmlMetaType::defaultProperty(mo); + // XXX + // Currently we don't handle enums in the static analysis + // so we let them drop through to generateStoreInstruction() + if (p.name() && !p.isEnumType()) { + prop->index = mo->indexOfProperty(p.name()); + prop->name = p.name(); - const QMetaObject *mo = obj->metaObject(); - if (mo) { - if (prop->isDefault) { - QMetaProperty p = QmlMetaType::defaultProperty(mo); - // XXX - // Currently we don't handle enums in the static analysis - // so we let them drop through to generateStoreInstruction() - if (p.name() && !p.isEnumType()) { - prop->index = mo->indexOfProperty(p.name()); - prop->name = p.name(); - - int t = p.type(); - if (t == QVariant::UserType) - t = p.userType(); - - prop->type = t; - } - } else { - prop->index = mo->indexOfProperty(prop->name.constData()); - QMetaProperty p = mo->property(prop->index); - // XXX - // Currently we don't handle enums in the static analysis - // so we let them drop through to generateStoreInstruction() - if (p.name() && !p.isEnumType()) { - int t = p.type(); - if (t == QVariant::UserType) - t = p.userType(); - - prop->type = t; - } - } - } - } else { - const QMetaObject *mo = obj->metaObject(); - if (mo) { - if (prop->isDefault) { - QMetaProperty p = QmlMetaType::defaultProperty(mo); - if (p.name()) { - prop->index = mo->indexOfProperty(p.name()); - prop->name = p.name(); - } int t = p.type(); if (t == QVariant::UserType) t = p.userType(); + prop->type = t; - } else { - prop->index = mo->indexOfProperty(prop->name.constData()); - QMetaProperty p = mo->property(prop->index); + } + } else { + prop->index = mo->indexOfProperty(prop->name.constData()); + QMetaProperty p = mo->property(prop->index); + // XXX + // Currently we don't handle enums in the static analysis + // so we let them drop through to generateStoreInstruction() + if (p.name() && !p.isEnumType()) { int t = p.type(); if (t == QVariant::UserType) t = p.userType(); + prop->type = t; } } @@ -841,7 +869,7 @@ bool QmlCompiler::compileProperty(Property *prop, Object *obj, int ctxt) COMPILE_CHECK(compileNestedProperty(prop, ctxt)); } else if (QmlMetaType::isQmlList(prop->type) || - QmlMetaType::isList(prop->type)) { + QmlMetaType::isList(prop->type)) { COMPILE_CHECK(compileListProperty(prop, obj, ctxt)); @@ -1351,7 +1379,7 @@ bool QmlCompiler::findDynamicProperties(QmlParser::Property *prop, definedProperties << propDef; } - obj->dynamicProperties = definedProperties; + obj->dynamicProperties << definedProperties; return true; } @@ -1407,7 +1435,7 @@ bool QmlCompiler::findDynamicSignals(QmlParser::Property *sigs, definedSignals << sigDef; } - obj->dynamicSignals = definedSignals; + obj->dynamicSignals << definedSignals; return true; } diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index 2a06f73..9a0ce1c 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -139,6 +139,7 @@ private: bool compileComponentFromRoot(QmlParser::Object *obj, int); bool compileFetchedObject(QmlParser::Object *obj, int); bool compileSignal(QmlParser::Property *prop, QmlParser::Object *obj); + bool testProperty(QmlParser::Property *prop, QmlParser::Object *obj); bool compileProperty(QmlParser::Property *prop, QmlParser::Object *obj, int); bool compileIdProperty(QmlParser::Property *prop, QmlParser::Object *obj); diff --git a/src/declarative/qml/qmlcustomparser.cpp b/src/declarative/qml/qmlcustomparser.cpp index a342ca8..fe0c3a8 100644 --- a/src/declarative/qml/qmlcustomparser.cpp +++ b/src/declarative/qml/qmlcustomparser.cpp @@ -40,10 +40,13 @@ ****************************************************************************/ #include "qmlcustomparser.h" - +#include "qmlcustomparser_p.h" +#include "qmlparser_p.h" QT_BEGIN_NAMESPACE +using namespace QmlParser; + /*! \class QmlCustomParser \brief The QmlCustomParser class allows you to add new arbitrary types to QML. @@ -92,5 +95,129 @@ QT_BEGIN_NAMESPACE the same-named type as this custom parser is defined for). */ +QmlCustomParserNode +QmlCustomParserNodePrivate::fromObject(QmlParser::Object *root) +{ + QmlCustomParserNode rootNode; + rootNode.d->name = root->typeName; + + for(QHash<QByteArray, Property *>::Iterator iter = root->properties.begin(); + iter != root->properties.end(); + ++iter) { + + Property *p = *iter; + + rootNode.d->properties << fromProperty(p); + } + + return rootNode; +} + +QmlCustomParserProperty +QmlCustomParserNodePrivate::fromProperty(QmlParser::Property *p) +{ + QmlCustomParserProperty prop; + prop.d->name = p->name; + prop.d->isList = (p->values.count() > 1); + + for(int ii = 0; ii < p->values.count(); ++ii) { + Value *v = p->values.at(ii); + + // We skip fetched properties for now + if(v->object && v->object->type == -1) + continue; + + if(v->object) { + QmlCustomParserNode node = fromObject(v->object); + prop.d->values << QVariant::fromValue(node); + } else { + prop.d->values << QVariant::fromValue(v->primitive); + } + + } + + return prop; +} + +QmlCustomParserNode::QmlCustomParserNode() +: d(new QmlCustomParserNodePrivate) +{ +} + +QmlCustomParserNode::QmlCustomParserNode(const QmlCustomParserNode &other) +: d(new QmlCustomParserNodePrivate) +{ + *this = other; +} + +QmlCustomParserNode &QmlCustomParserNode::operator=(const QmlCustomParserNode &other) +{ + d->name = other.d->name; + d->properties = other.d->properties; + return *this; +} + +QmlCustomParserNode::~QmlCustomParserNode() +{ + delete d; d = 0; +} + +QByteArray QmlCustomParserNode::name() const +{ + return d->name; +} + +QList<QmlCustomParserProperty> QmlCustomParserNode::properties() const +{ + return d->properties; +} + +QmlCustomParserProperty::QmlCustomParserProperty() +: d(new QmlCustomParserPropertyPrivate) +{ +} + +QmlCustomParserProperty::QmlCustomParserProperty(const QmlCustomParserProperty &other) +: d(new QmlCustomParserPropertyPrivate) +{ + *this = other; +} + +QmlCustomParserProperty &QmlCustomParserProperty::operator=(const QmlCustomParserProperty &other) +{ + d->name = other.d->name; + d->isList = other.d->isList; + d->values = other.d->values; + return *this; +} + +QmlCustomParserProperty::~QmlCustomParserProperty() +{ + delete d; d = 0; +} + +QByteArray QmlCustomParserProperty::name() const +{ + return d->name; +} + +bool QmlCustomParserProperty::isList() const +{ + return d->isList; +} + +QList<QVariant> QmlCustomParserProperty::assignedValues() const +{ + return d->values; +} + +QByteArray QmlCustomParser::compile(const QList<QmlCustomParserProperty> &, bool *ok) +{ + return QByteArray(); +} + +void QmlCustomParser::setCustomData(QObject *, const QByteArray &) +{ +} QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlcustomparser.h b/src/declarative/qml/qmlcustomparser.h index 9de1be4..0e6a619 100644 --- a/src/declarative/qml/qmlcustomparser.h +++ b/src/declarative/qml/qmlcustomparser.h @@ -53,13 +53,55 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) +class QmlCustomParserPropertyPrivate; +class Q_DECLARATIVE_EXPORT QmlCustomParserProperty +{ +public: + QmlCustomParserProperty(); + QmlCustomParserProperty(const QmlCustomParserProperty &); + QmlCustomParserProperty &operator=(const QmlCustomParserProperty &); + ~QmlCustomParserProperty(); + + QByteArray name() const; + + bool isList() const; + QList<QVariant> assignedValues() const; + +private: + friend class QmlCustomParserNodePrivate; + friend class QmlCustomParserPropertyPrivate; + QmlCustomParserPropertyPrivate *d; +}; +Q_DECLARE_METATYPE(QmlCustomParserProperty); + +class QmlCustomParserNodePrivate; +class Q_DECLARATIVE_EXPORT QmlCustomParserNode +{ +public: + QmlCustomParserNode(); + QmlCustomParserNode(const QmlCustomParserNode &); + QmlCustomParserNode &operator=(const QmlCustomParserNode &); + ~QmlCustomParserNode(); + + QByteArray name() const; + + QList<QmlCustomParserProperty> properties() const; + +private: + friend class QmlCustomParserNodePrivate; + QmlCustomParserNodePrivate *d; +}; +Q_DECLARE_METATYPE(QmlCustomParserNode); + class Q_DECLARATIVE_EXPORT QmlCustomParser { public: virtual ~QmlCustomParser() {} virtual QByteArray compile(QXmlStreamReader&, bool *ok)=0; + virtual QByteArray compile(const QList<QmlCustomParserProperty> &, bool *ok); virtual QVariant create(const QByteArray &)=0; + virtual void setCustomData(QObject *, const QByteArray &); struct Register { Register(const char *name, QmlCustomParser *parser) { @@ -76,7 +118,11 @@ public: #define QML_DEFINE_CUSTOM_PARSER_NS(namespacestring, name, parserClass) \ template<> QmlCustomParser::Register QmlCustomParser::Define<parserClass>::instance(namespacestring "/" # name, new parserClass); +#define QML_DEFINE_CUSTOM_TYPE(TYPE, NAME, CUSTOMTYPE) \ + template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *>::instance(qmlRegisterCustomType<TYPE>(#NAME, #TYPE, new CUSTOMTYPE)); + QT_END_NAMESPACE QT_END_HEADER + #endif diff --git a/src/declarative/qml/qmlcustomparser_p.h b/src/declarative/qml/qmlcustomparser_p.h new file mode 100644 index 0000000..63d148c --- /dev/null +++ b/src/declarative/qml/qmlcustomparser_p.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** This file is part of the QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** No Commercial Usage +** This file contains pre-release code and may not be distributed. +** You may use this file in accordance with the terms and conditions +** contained in the either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QMLCUSTOMPARSER_P_H +#define QMLCUSTOMPARSER_P_H + +#include <QtCore/qglobal.h> +#include "qmlcustomparser.h" + +QT_BEGIN_NAMESPACE + +namespace QmlParser +{ + class Object; + class Property; +}; + +class QmlCustomParserNodePrivate +{ +public: + QByteArray name; + QList<QmlCustomParserProperty> properties; + + static QmlCustomParserNode fromObject(QmlParser::Object *); + static QmlCustomParserProperty fromProperty(QmlParser::Property *); +}; + +class QmlCustomParserPropertyPrivate +{ +public: + QmlCustomParserPropertyPrivate() + : isList(false) {} + + QByteArray name; + bool isList; + QList<QVariant> values; +}; + +QT_END_NAMESPACE + +#endif // QMLCUSTOMPARSER_P_H diff --git a/src/declarative/qml/qmlinfo.cpp b/src/declarative/qml/qmlinfo.cpp index a2b304f..65a4298 100644 --- a/src/declarative/qml/qmlinfo.cpp +++ b/src/declarative/qml/qmlinfo.cpp @@ -47,12 +47,14 @@ QT_BEGIN_NAMESPACE \class QmlInfo \brief The QmlInfo class prints warnings messages that include the file and line number for QML types. - When QML types display warning messages, it improves tracibility if they include the - QML file and line number on which the particular instance was instantiated. + When QML types display warning messages, it improves tracibility + if they include the QML file and line number on which the + particular instance was instantiated. - QmlInfo statements work just like regular Qt qDebug() statements. To include the file - and line number, an object must be passed. If the file and line number is not available - for that instance (either it was not instantiated by the QML engine or location + QmlInfo statements work just like regular Qt qDebug() statements. + To include the file and line number, an object must be passed. If + the file and line number is not available for that instance + (either it was not instantiated by the QML engine or location information is disabled), "unknown location" will be used instead. For example, @@ -69,7 +71,8 @@ QT_BEGIN_NAMESPACE */ /*! - Construct a QmlInfo, using \a object for file and line number information. + Construct a QmlInfo, using \a object for file and line number + information. */ QmlInfo::QmlInfo(QObject *object) : QDebug(QtWarningMsg) @@ -81,17 +84,16 @@ QmlInfo::QmlInfo(QObject *object) } /*! - \internal + The destructor does nothing special. */ QmlInfo::~QmlInfo() { } /*! - \fn QmlInfo qmlInfo(QObject *me) - \internal - - XXX - how do we document these? + \relates QmlInfo + \fn QmlInfo qmlInfo(QObject *me) + Constructs an instance of QmlInfo from \a me and returns it. */ QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlinstruction_p.h b/src/declarative/qml/qmlinstruction_p.h index 440b54a..922fc61 100644 --- a/src/declarative/qml/qmlinstruction_p.h +++ b/src/declarative/qml/qmlinstruction_p.h @@ -174,6 +174,7 @@ public: } init; struct { int type; + int data; } create; struct { int data; diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp index 9b99917..fbfeca0 100644 --- a/src/declarative/qml/qmlmetatype.cpp +++ b/src/declarative/qml/qmlmetatype.cpp @@ -118,6 +118,7 @@ public: QmlPrivate::CreateFunc m_extFunc; const QMetaObject *m_extMetaObject; int m_index; + QmlCustomParser *m_customParser; mutable volatile bool m_isSetup:1; mutable QList<QmlProxyMetaObject::ProxyData> m_metaObjects; mutable QByteArray m_hash; @@ -126,7 +127,8 @@ public: QmlTypePrivate::QmlTypePrivate() : m_isInterface(false), m_iid(0), m_typeId(0), m_listId(0), m_qmlListId(0), m_opFunc(0), m_baseMetaObject(0), m_attachedPropertiesFunc(0), - m_parserStatusCast(-1), m_extFunc(0), m_extMetaObject(0), m_index(-1), m_isSetup(false) + m_parserStatusCast(-1), m_extFunc(0), m_extMetaObject(0), m_index(-1), + m_customParser(0), m_isSetup(false) { } @@ -150,7 +152,8 @@ QmlType::QmlType(int type, int listType, int qmlListType, const QMetaObject *metaObject, QmlAttachedPropertiesFunc attachedPropertiesFunc, int parserStatusCast, QmlPrivate::CreateFunc extFunc, - const QMetaObject *extMetaObject, int index) + const QMetaObject *extMetaObject, int index, + QmlCustomParser *customParser) : d(new QmlTypePrivate) { d->m_name = qmlName; @@ -163,6 +166,7 @@ QmlType::QmlType(int type, int listType, int qmlListType, d->m_parserStatusCast = parserStatusCast; d->m_extFunc = extFunc; d->m_index = index; + d->m_customParser = customParser; if (extMetaObject) d->m_extMetaObject = extMetaObject; @@ -272,6 +276,11 @@ QObject *QmlType::create() const return rv; } +QmlCustomParser *QmlType::customParser() const +{ + return d->m_customParser; +} + bool QmlType::isInterface() const { return d->m_isInterface; @@ -396,7 +405,7 @@ int QmlMetaType::registerInterface(const QmlPrivate::MetaTypeIds &id, return index; } -int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QmlPrivate::Func func, const char *cname, const QMetaObject *mo, QmlAttachedPropertiesFunc attach, int pStatus, int object, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo) +int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QmlPrivate::Func func, const char *cname, const QMetaObject *mo, QmlAttachedPropertiesFunc attach, int pStatus, int object, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo, QmlCustomParser *parser) { Q_UNUSED(object); QWriteLocker lock(metaTypeDataLock()); @@ -414,7 +423,7 @@ int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QmlPrivate::Fun QmlType *type = new QmlType(id.typeId, id.listId, id.qmlListId, func, cname, mo, attach, pStatus, extFunc, - extmo, index); + extmo, index, parser); data->types.append(type); data->idToType.insert(type->typeId(), type); diff --git a/src/declarative/qml/qmlmetatype.h b/src/declarative/qml/qmlmetatype.h index 83fb60b..99f8e93 100644 --- a/src/declarative/qml/qmlmetatype.h +++ b/src/declarative/qml/qmlmetatype.h @@ -59,7 +59,7 @@ class QmlCustomParser; class Q_DECLARATIVE_EXPORT QmlMetaType { public: - static int registerType(const QmlPrivate::MetaTypeIds &, QmlPrivate::Func, const char *, const QMetaObject *, QmlAttachedPropertiesFunc, int pStatus, int object, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo); + static int registerType(const QmlPrivate::MetaTypeIds &, QmlPrivate::Func, const char *, const QMetaObject *, QmlAttachedPropertiesFunc, int pStatus, int object, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo, QmlCustomParser *); static int registerInterface(const QmlPrivate::MetaTypeIds &, QmlPrivate::Func, const char *); static void registerCustomParser(const char *, QmlCustomParser *); @@ -121,6 +121,8 @@ public: QObject *create() const; + QmlCustomParser *customParser() const; + bool isInterface() const; int typeId() const; int qListTypeId() const; @@ -145,7 +147,7 @@ private: friend class QmlMetaType; friend class QmlTypePrivate; QmlType(int, int, int, QmlPrivate::Func, const char *, int); - QmlType(int, int, int, QmlPrivate::Func, const char *, const QMetaObject *, QmlAttachedPropertiesFunc, int, QmlPrivate::CreateFunc, const QMetaObject *, int); + QmlType(int, int, int, QmlPrivate::Func, const char *, const QMetaObject *, QmlAttachedPropertiesFunc, int, QmlPrivate::CreateFunc, const QMetaObject *, int, QmlCustomParser *); ~QmlType(); QmlTypePrivate *d; @@ -166,7 +168,7 @@ int qmlRegisterType(const char *typeName) QmlPrivate::attachedPropertiesFunc<T>(), QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(), QmlPrivate::StaticCastSelector<T,QObject>::cast(), - 0, 0); + 0, 0, 0); } template<typename T> @@ -184,7 +186,7 @@ int qmlRegisterType(const char *qmlName, const char *typeName) QmlPrivate::attachedPropertiesFunc<T>(), QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(), QmlPrivate::StaticCastSelector<T,QObject>::cast(), - 0, 0); + 0, 0, 0); } template<typename T, typename E> @@ -206,7 +208,7 @@ int qmlRegisterExtendedType(const char *typeName) &T::staticMetaObject, attached, QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(), QmlPrivate::StaticCastSelector<T,QObject>::cast(), - &QmlPrivate::CreateParent<E>::create, &E::staticMetaObject); + &QmlPrivate::CreateParent<E>::create, &E::staticMetaObject, 0); } template<typename T, typename E> @@ -231,7 +233,7 @@ int qmlRegisterExtendedType(const char *qmlName, const char *typeName) QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(), QmlPrivate::StaticCastSelector<T,QObject>::cast(), &QmlPrivate::CreateParent<E>::create, - &E::staticMetaObject); + &E::staticMetaObject, 0); } template<typename T> @@ -249,6 +251,24 @@ int qmlRegisterInterface(const char *typeName) qobject_interface_iid<T *>()); } +template<typename T> +int qmlRegisterCustomType(const char *qmlName, const char *typeName, QmlCustomParser *parser) +{ + QByteArray name(typeName); + QmlPrivate::MetaTypeIds ids = { + qRegisterMetaType<T *>(QByteArray(name + "*").constData()), + qRegisterMetaType<T *>(QByteArray("QList<" + name + "*>*").constData()), + qRegisterMetaType<T *>(QByteArray("QmlList<" + name + "*>*").constData()) + }; + + return QmlMetaType::registerType(ids, QmlPrivate::list_op<T>, qmlName, + &T::staticMetaObject, + QmlPrivate::attachedPropertiesFunc<T>(), + QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(), + QmlPrivate::StaticCastSelector<T,QObject>::cast(), + 0, 0, parser); +} + void qmlRegisterCustomParser(const char *qmlName, QmlCustomParser *); QT_END_NAMESPACE diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 317a3bf..adc30dd 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -326,6 +326,8 @@ bool ProcessAST::visit(AST::UiImport *node) return false; } +// UiObjectMember: T_PUBLIC T_DEFAULT UiMemberType T_IDENTIFIER T_COLON Expression +// UiObjectMember: T_PUBLIC T_DEFAULT UiMemberType T_IDENTIFIER // UiObjectMember: T_PUBLIC UiMemberType T_IDENTIFIER T_COLON Expression // UiObjectMember: T_PUBLIC UiMemberType T_IDENTIFIER // @@ -335,6 +337,9 @@ bool ProcessAST::visit(AST::UiPublicMember *node) const QString memberType = node->memberType->asString(); const QString name = node->name->asString(); + if (node->isDefaultMember) + qWarning() << "default-ness not implemented"; + if (memberType == QLatin1String("property")) { _stateStack.pushProperty(QLatin1String("properties"), node->publicToken.startLine); diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp index 253e9a7..7b3291e 100644 --- a/src/declarative/qml/qmlvme.cpp +++ b/src/declarative/qml/qmlvme.cpp @@ -257,6 +257,11 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in if (!o) VME_EXCEPTION("Unable to create object of type" << types.at(instr.create.type).className); + if (instr.create.data != -1) { + QmlCustomParser *customParser = + types.at(instr.create.type).type->customParser(); + customParser->setCustomData(o, datas.at(instr.create.data)); + } if (!stack.isEmpty()) { QObject *parent = stack.top(); o->setParent(parent); diff --git a/src/declarative/util/qfxview.cpp b/src/declarative/util/qfxview.cpp index 1e9d5a4..42047b6 100644 --- a/src/declarative/util/qfxview.cpp +++ b/src/declarative/util/qfxview.cpp @@ -49,6 +49,7 @@ #include "qicon.h" #include "qurl.h" #include "qboxlayout.h" +#include "qbasictimer.h" #include "qmlbindablevalue.h" #include "qml.h" @@ -100,6 +101,8 @@ public: QmlEngine engine; QmlComponent *component; + QBasicTimer resizetimer; + void init(); }; @@ -107,10 +110,10 @@ public: \class QFxView \brief The QFxView class provides a widget for displaying a Qt Declarative user interface. - QFxView currently provides a minimal interface for displaying Qml files, and - connecting between QML and C++ Qt objects. + QFxView currently provides a minimal interface for displaying QML + files, and connecting between QML and C++ Qt objects. - Typcial usage looks something like this: + Typcial usage: \code ... QFxView *view = new QFxView(this); @@ -129,12 +132,24 @@ public: \endcode */ +/*! + \fn QFxView::QFxView(QWidget *parent) + + Constructs a QFxView with the given \a parent. +*/ QFxView::QFxView(QWidget *parent) : QSimpleCanvas(parent), d(new QFxViewPrivate(this)) { d->init(); } +/*! + \fn QFxView::QFxView(QSimpleCanvas::CanvasMode mode, QWidget *parent) + + Constructs a QFxView with the given \a parent. The canvas + \a mode can be QSimpleCanvas::GraphicsView or + QSimpleCanvas::SimpleCanvas. +*/ QFxView::QFxView(QSimpleCanvas::CanvasMode mode, QWidget *parent) : QSimpleCanvas(mode, parent), d(new QFxViewPrivate(this)) { @@ -157,29 +172,49 @@ void QFxViewPrivate::init() QFontDatabase database; } +/*! + The destructor clears the instance and deletes the internal + representation. + + \sa clearItems() + */ QFxView::~QFxView() { clearItems(); delete d; d = 0; } +/*! + Sets the source to the \a url. The XML string is set to + empty. + */ void QFxView::setUrl(const QUrl& url) { d->source = url; d->xml = QString(); } +/*! + Sets the source to the URL from the \a filename, and sets + the XML string to \a xml. + */ void QFxView::setXml(const QString &xml, const QString &filename) { d->source = QUrl::fromLocalFile(filename); d->xml = xml; } +/*! + Returns the XML string. + */ QString QFxView::xml() const { return d->xml; } +/*! + Returns a pointer to the QmlEngine. + */ QmlEngine* QFxView::engine() { return &d->engine; @@ -250,8 +285,17 @@ void QFxView::continueExecute() void QFxView::sizeChanged() { - if (d->root) - emit sceneResized(QSize(d->root->width(),d->root->height())); + // delay, so we catch both width and height changing. + d->resizetimer.start(0,this); +} + +void QFxView::timerEvent(QTimerEvent* e) +{ + if (e->timerId() == d->resizetimer.timerId()) { + if (d->root) + emit sceneResized(QSize(d->root->width(),d->root->height())); + d->resizetimer.stop(); + } } QFxItem* QFxView::addItem(const QString &xml, QFxItem* parent) diff --git a/src/declarative/util/qfxview.h b/src/declarative/util/qfxview.h index 3c4be20..c658f07 100644 --- a/src/declarative/util/qfxview.h +++ b/src/declarative/util/qfxview.h @@ -95,6 +95,7 @@ protected: virtual void resizeEvent(QResizeEvent *); void focusInEvent(QFocusEvent *); void focusOutEvent(QFocusEvent *); + void timerEvent(QTimerEvent*); private: friend class QFxViewPrivate; diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index 54aea2c..968e17b 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -53,55 +53,23 @@ QT_BEGIN_NAMESPACE #define DATA_ROLE_ID 1 #define DATA_ROLE_NAME "data" -Q_DECLARE_METATYPE(QListModelInterface *); -class QmlListModelPrivate +struct ListInstruction { -public: - QmlListModelPrivate(QmlListModel *m) - : q(m), - type(QmlListModel::Invalid), - listModelInterface(0), - singleObject(0), - roleCacheValid(false) - { - } - - void clear() - { - type = QmlListModel::Invalid; - model = QVariant(); - if (listModelInterface) - listModelInterface->disconnect(q); - listModelInterface = 0; - singleObject = 0; - roleCacheValid = false; - roleCache.clear(); - } - - void updateRoleCache() - { - if (roleCacheValid) - return; - - roleCacheValid = true; - if (type == QmlListModel::SingleObject) - roleCache = QmlMetaProperty::properties(singleObject); - } - - QmlListModel *q; - - QmlListModel::ModelType type; - - QVariant model; - QListModelInterface *listModelInterface; - QObject *singleObject; + enum { Push, Pop, Value, Set } type; + int dataIdx; +}; - bool roleCacheValid; - QStringList roleCache; +struct ListModelData +{ + int dataOffset; + int instrCount; + ListInstruction *instructions() const { return (ListInstruction *)((char *)this + sizeof(ListModelData)); } }; +Q_DECLARE_METATYPE(QListModelInterface *); + /*! - \qmlclass ListModel QmlListModel + \qmlclass ListModel \brief The ListModel element defines a free-form list data source. The ListModel is a simple XML heirarchy of items containing data roles. @@ -140,157 +108,6 @@ public: <ListView model="{FruitModel}" delegate="{FruitDelegate}" anchors.fill="{parent}"/> \endcode */ -/*! - \internal - \class QmlListModel -*/ -QmlListModel::QmlListModel(QObject *parent) -: QListModelInterface(parent), d(new QmlListModelPrivate(this)) -{ -} - -QmlListModel::~QmlListModel() -{ - delete d; d = 0; -} - -QmlListModel::ModelType QmlListModel::modelType() const -{ - return d->type; -} - -bool QmlListModel::setModel(const QVariant &model) -{ - d->clear(); - - QListModelInterface *iface = qvariant_cast<QListModelInterface *>(model); - if (iface) { - QObject::connect(iface, SIGNAL(itemsInserted(int,int)), - this, SIGNAL(itemsInserted(int,int))); - QObject::connect(iface, SIGNAL(itemsRemoved(int,int)), - this, SIGNAL(itemsRemoved(int,int))); - QObject::connect(iface, SIGNAL(itemsMoved(int,int,int)), - this, SIGNAL(itemsMoved(int,int,int))); - QObject::connect(iface, SIGNAL(itemsChanged(int,int,QList<int>)), - this, SIGNAL(itemsChanged(int,int,QList<int>))); - d->listModelInterface = iface; - d->type = ListInterface; - d->model = model; - return true; - } - - QObject *object = qvariant_cast<QObject *>(model); - if (object) { - d->singleObject = object; - d->type = SingleObject; - d->model = model; - return true; - } - - if (QmlMetaType::isList(model)) { - d->type = SimpleList; - d->model = model; - return true; - } - - return false; -} - -QVariant QmlListModel::model() const -{ - return d->model; -} - -QList<int> QmlListModel::roles() const -{ - d->updateRoleCache(); - switch(modelType()) { - case Invalid: - return QList<int>(); - case SimpleList: - return QList<int>() << DATA_ROLE_ID; - case ListInterface: - return d->listModelInterface->roles(); - case SingleObject: - { - QList<int> rv; - for (int ii = 0; ii < d->roleCache.count(); ++ii) - rv << ii; - return rv; - } - break; - }; - return QList<int>(); -} - -QString QmlListModel::toString(int role) const -{ - d->updateRoleCache(); - switch(modelType()) { - case Invalid: - return QString(); - case SimpleList: - if (role == DATA_ROLE_ID) - return QLatin1String(DATA_ROLE_NAME); - else - return QString(); - case ListInterface: - return d->listModelInterface->toString(role); - case SingleObject: - if (role >= d->roleCache.count()) - return QString(); - else - return d->roleCache.at(role); - }; - return QString(); -} - -/*! - \qmlproperty int ListModel::count - This property holds the number of items in the list. -*/ -int QmlListModel::count() const -{ - switch(modelType()) { - case Invalid: - return 0; - case SimpleList: - return QmlMetaType::listCount(model()); - case ListInterface: - return d->listModelInterface->count(); - case SingleObject: - return 1; - } - return 0; -} - -QHash<int,QVariant> QmlListModel::data(int index, const QList<int> &roles) const -{ - d->updateRoleCache(); - QHash<int, QVariant> rv; - switch(modelType()) { - case Invalid: - break; - case SimpleList: - if (roles.contains(DATA_ROLE_ID)) - rv.insert(DATA_ROLE_ID, QmlMetaType::listAt(d->model, index)); - break; - case ListInterface: - return d->listModelInterface->data(index, roles); - case SingleObject: - { - for (int ii = 0; ii < roles.count(); ++ii) { - QmlMetaProperty prop(d->singleObject, toString(roles.at(ii))); - rv.insert(roles.at(ii), prop.read()); - } - } - break; - }; - - return rv; -} - - struct ModelNode; class ListModel : public QListModelInterface @@ -484,20 +301,181 @@ int ListModel::count() const return _root->values.count(); } -struct ListInstruction -{ - enum { Push, Pop, Value, Set } type; - int dataIdx; -}; - class ListModelParser : public QmlCustomParser { public: virtual QByteArray compile(QXmlStreamReader& reader, bool *); + QByteArray compile(const QList<QmlCustomParserProperty> &, bool *ok); virtual QVariant create(const QByteArray &); + + bool compileProperty(const QmlCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data); + void setCustomData(QObject *, const QByteArray &); }; QML_DEFINE_CUSTOM_PARSER(ListModel, ListModelParser); +bool ListModelParser::compileProperty(const QmlCustomParserProperty &prop, QList<ListInstruction> &instr, QByteArray &data) +{ + QList<QVariant> values = prop.assignedValues(); + for(int ii = 0; ii < values.count(); ++ii) { + const QVariant &value = values.at(ii); + + if(value.userType() == qMetaTypeId<QmlCustomParserNode>()) { + QmlCustomParserNode node = + qvariant_cast<QmlCustomParserNode>(value); + + { + ListInstruction li; + li.type = ListInstruction::Push; + li.dataIdx = -1; + instr << li; + } + + QList<QmlCustomParserProperty> props = node.properties(); + for(int jj = 0; jj < props.count(); ++jj) { + const QmlCustomParserProperty &nodeProp = props.at(jj); + if(nodeProp.name() == "") + return false; + + ListInstruction li; + int ref = data.count(); + data.append(nodeProp.name()); + data.append('\0'); + li.type = ListInstruction::Set; + li.dataIdx = ref; + instr << li; + + if(!compileProperty(nodeProp, instr, data)) + return false; + + li.type = ListInstruction::Pop; + li.dataIdx = -1; + instr << li; + } + + { + ListInstruction li; + li.type = ListInstruction::Pop; + li.dataIdx = -1; + instr << li; + } + + } else { + + int ref = data.count(); + QByteArray d = value.toString().toLatin1(); + d.append('\0'); + data.append(d); + + ListInstruction li; + li.type = ListInstruction::Value; + li.dataIdx = ref; + instr << li; + + } + } + + return true; +} + +QByteArray ListModelParser::compile(const QList<QmlCustomParserProperty> &customProps, bool *ok) +{ + *ok = true; + QList<ListInstruction> instr; + QByteArray data; + + for(int ii = 0; ii < customProps.count(); ++ii) { + const QmlCustomParserProperty &prop = customProps.at(ii); + if(prop.name() != "") { // isn't default property + *ok = false; + return QByteArray(); + } + + if(!compileProperty(prop, instr, data)) { + *ok = false; + return QByteArray(); + } + } + + int size = sizeof(ListModelData) + + instr.count() * sizeof(ListInstruction) + + data.count(); + + QByteArray rv; + rv.resize(size); + + ListModelData *lmd = (ListModelData *)rv.data(); + lmd->dataOffset = sizeof(ListModelData) + + instr.count() * sizeof(ListInstruction); + lmd->instrCount = instr.count(); + for (int ii = 0; ii < instr.count(); ++ii) + lmd->instructions()[ii] = instr.at(ii); + ::memcpy(rv.data() + lmd->dataOffset, data.constData(), data.count()); + + return rv; +} + +void ListModelParser::setCustomData(QObject *obj, const QByteArray &d) +{ + ListModel *rv = static_cast<ListModel *>(obj); + + ModelNode *root = new ModelNode; + rv->_root = root; + QStack<ModelNode *> nodes; + nodes << root; + + const ListModelData *lmd = (const ListModelData *)d.constData(); + const char *data = ((const char *)lmd) + lmd->dataOffset; + + for (int ii = 0; ii < lmd->instrCount; ++ii) { + const ListInstruction &instr = lmd->instructions()[ii]; + + switch(instr.type) { + case ListInstruction::Push: + { + ModelNode *n = nodes.top(); + ModelNode *n2 = new ModelNode; + n->values << qVariantFromValue(n2); + nodes.push(n2); + } + break; + + case ListInstruction::Pop: + nodes.pop(); + break; + + case ListInstruction::Value: + { + ModelNode *n = nodes.top(); + n->values.append(QByteArray(data + instr.dataIdx)); + } + break; + + case ListInstruction::Set: + { + ModelNode *n = nodes.top(); + ModelNode *n2 = new ModelNode; + n->properties.insert(QLatin1String(data + instr.dataIdx), n2); + nodes.push(n2); + } + break; + } + } +} + +class ListModel2 : public ListModel +{ +Q_OBJECT +}; +QML_DECLARE_TYPE(ListModel2); +QML_DEFINE_CUSTOM_TYPE(ListModel2, ListModel2, ListModelParser); + +class ListElement : public QObject +{ +Q_OBJECT +}; +QML_DECLARE_TYPE(ListElement); +QML_DEFINE_TYPE(ListElement,ListElement); + static void dump(ModelNode *node, int ind) { QByteArray indentBa(ind * 4, ' '); @@ -534,13 +512,6 @@ ModelNode::~ModelNode() if (modelCache) { delete modelCache; modelCache = 0; } } -struct ListModelData -{ - int dataOffset; - int instrCount; - ListInstruction *instructions() const { return (ListInstruction *)((char *)this + sizeof(ListModelData)); } -}; - QByteArray ListModelParser::compile(QXmlStreamReader& reader, bool *ok) { *ok = true; diff --git a/src/declarative/util/qmllistmodel.h b/src/declarative/util/qmllistmodel.h index 3dcac4f..36aa009 100644 --- a/src/declarative/util/qmllistmodel.h +++ b/src/declarative/util/qmllistmodel.h @@ -57,40 +57,10 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QmlListModelPrivate; -class Q_DECLARATIVE_EXPORT QmlListModel : public QListModelInterface -{ -Q_OBJECT -public: - QmlListModel(QObject *parent = 0); - virtual ~QmlListModel(); - - enum ModelType { - Invalid, - SimpleList, - ListInterface, - SingleObject - }; - - ModelType modelType() const; - bool setModel(const QVariant &); - QVariant model() const; - - virtual QList<int> roles() const; - virtual QString toString(int role) const; - - Q_PROPERTY(int count READ count); - virtual int count() const; - virtual QHash<int,QVariant> - data(int index, const QList<int> &roles = (QList<int>())) const; -private: - QmlListModelPrivate *d; -}; -QML_DECLARE_TYPE(QmlListModel); - -#endif // QMLLISTMODEL_H QT_END_NAMESPACE QT_END_HEADER + +#endif // QMLLISTMODEL_H diff --git a/src/declarative/util/qmlscript.h b/src/declarative/util/qmlscript.h index fc038b4..8047a88 100644 --- a/src/declarative/util/qmlscript.h +++ b/src/declarative/util/qmlscript.h @@ -58,7 +58,7 @@ class Q_DECLARATIVE_EXPORT QmlScript : public QObject Q_DECLARE_PRIVATE(QmlScript); Q_PROPERTY(QString script READ script WRITE setScript); - Q_PROPERTY(QString src READ source WRITE setSource); + Q_PROPERTY(QString source READ source WRITE setSource); Q_CLASSINFO("DefaultProperty", "script"); public: diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index 5850a97..cd33f5e 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -175,7 +175,6 @@ void QmlState::setWhen(QmlBindableValue *when) } /*! - \advanced \qmlproperty string State::extends This property holds the state that this state extends |