diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-04-30 03:58:26 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-04-30 03:58:26 (GMT) |
commit | 7e95bf13d72b28c87dab4b346fd96de6e8a4c046 (patch) | |
tree | 562dca6217f57472537df4a2eeeb11e0b6effa3f /src/declarative | |
parent | 9b08198a1bac0347767a426ddc53d5ebe903b1a7 (diff) | |
parent | 0ee6bf1226f3069f117d0b0b75df14ddf38e75de (diff) | |
download | Qt-7e95bf13d72b28c87dab4b346fd96de6e8a4c046.zip Qt-7e95bf13d72b28c87dab4b346fd96de6e8a4c046.tar.gz Qt-7e95bf13d72b28c87dab4b346fd96de6e8a4c046.tar.bz2 |
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative')
22 files changed, 1411 insertions, 1237 deletions
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp index 0724e3a..13e5b21 100644 --- a/src/declarative/fx/qfxlistview.cpp +++ b/src/declarative/fx/qfxlistview.cpp @@ -798,37 +798,23 @@ void QFxListViewPrivate::fixupX() \brief The ListView element provides a list view of items provided by a model. The model is typically provided by a QAbstractListModel "C++ model object", but can also be created directly in XML. - The items are laid out vertically or horizontally and may be flicked to scroll. The below example creates a very simple vertical list, using an XML model. \image trivialListView.png - \code - <resources> - <ListModel id="contactModel"> - <Contact> - <firstName>John</firstName> - <lastName>Smith</lastName> - </Contact> - <Contact> - <firstName>Bill</firstName> - <lastName>Jones</lastName> - </Contact> - <Contact> - <firstName>Jane</firstName> - <lastName>Doe</lastName> - </Contact> - </ListModel> - <Component id="contactDelegate"> - <Rect pen.color="blue" z="-1" height="20" width="80" color="white" radius="2"> - <Text id="name" text="{firstName + ' ' + lastName}" font.size="11"/> - </Rect> - </Component> - </resources> - - <ListView id="list" width="320" height="240" clip="true" - model="{contactModel}" delegate="{contactDelegate}"/> - \endcode + + The user interface defines a delegate to display an item, a highlight, + and the ListView which uses the above. + + \snippet doc/src/snippets/declarative/listview/listview.qml 3 + + The model is defined as a ListModel using XML: + \quotefromfile doc/src/snippets/declarative/listview/dummydata/ContactModel.qml + \skipto <ListModel + \printuntil </ListModel + + In this case ListModel is a handy way for us to test our UI. In practice + the model would be implemented in C++, or perhaps via a SQL data source. */ QFxListView::QFxListView(QFxItem *parent) @@ -854,25 +840,7 @@ QFxListView::~QFxListView() The C++ model object must be a \l QListModelInterface subclass, a \l VisualModel, or a simple list. - Models can also be created directly in XML, using the \l ListModel element. For example: - \code - <ListModel id="contactModel"> - <Contact> - <firstName>John</firstName> - <lastName>Smith</lastName> - </Contact> - <Contact> - <firstName>Bill</firstName> - <lastName>Jones</lastName> - </Contact> - <Contact> - <firstName>Jane</firstName> - <lastName>Doe</lastName> - </Contact> - </ListModel> - - <ListView model="{contactModel}" .../> - \endcode + Models can also be created directly in XML, using the \l ListModel element. */ QVariant QFxListView::model() const { @@ -922,17 +890,7 @@ void QFxListView::setModel(const QVariant &model) The delegate provides a template describing what each item in the view should look and act like. Here is an example delegate: - \code - <Component id="contactDelegate"> - <Item id="wrapper"> - <Image id="pic" width="100" height="100" file="{portrait}"/> - <Text id="name" text="{firstName + ' ' + lastName}" - anchors.left="{pic.right}" anchors.leftMargin="5"/> - </Item> - </Component> - ... - <ListView delegate="{contactDelegate}" .../> - \endcode + \snippet doc/src/snippets/declarative/listview/listview.qml 0 */ QmlComponent *QFxListView::delegate() const { @@ -1012,13 +970,9 @@ int QFxListView::count() const The below example demonstrates how to make a simple highlight for a vertical list. - \code - <Component id="ListHighlight"> - <Rect color="lightsteelblue" radius="4"/> - </Component> - <ListView highlight="{ListHighlight}"> - \endcode - \image ListViewHighlight.png + + \snippet doc/src/snippets/declarative/listview/listview.qml 1 + \image trivialListView.png \sa autoHighlight */ @@ -1043,17 +997,12 @@ void QFxListView::setHighlight(QmlComponent *highlight) If autoHighlight is true, the highlight will be moved smoothly to follow the current item. If autoHighlight is false, the highlight will not be moved by the view, and must be implemented - by the highlight, for example: - - \code - <Component id="Highlight"> - <Rect id="Wrapper" color="#242424" radius="4" width="320" height="60" > - <y> - <Follow source="{Wrapper.ListView.view.current.y}" spring="3" damping="0.2"/> - </y> - </Rect> - </Component> - \endcode + by the highlight. The following example creates a highlight with + its motion defined by the spring \l {Follow}: + + \snippet doc/src/snippets/declarative/listview/highlight.qml 1 + + \sa highlight */ bool QFxListView::autoHighlight() const { @@ -1079,11 +1028,18 @@ void QFxListView::setAutoHighlight(bool autoHighlight) The modes supported are: \list \i Free - For Mouse, the current item may be positioned anywhere, - whether within the visible area, or outside. during Keyboard interaction, + whether within the visible area, or outside. During Keyboard interaction, the current item can move within the visible area, and the view will scroll to keep the highlight visible. - \i Snap - - \i SnapAuto - + \i Snap - For mouse, the current item may be positioned anywhere, + whether within the visible area, or outside. During keyboard interaction, + the current item will be kept in the visible area and will prefer to be + positioned at the \l snapPosition, however the view will never scroll + beyond the beginning or end of the view. + \i SnapAuto - For both mouse and keyboard, the current item will be + kept at the \l {snapPosition}. Additionally, if the view is dragged or + flicked, the current item will be automatically updated to be the item + currently at the snapPosition. \endlist */ QFxListView::CurrentItemPositioning QFxListView::currentItemPositioning() const @@ -1121,10 +1077,10 @@ void QFxListView::setSnapPosition(int pos) \qmlproperty enumeration ListView::orientation This property holds the orientation of the list. - Possible values are \c Qt::Vertical (default) and \c Qt::Horizontal. + Possible values are \c Vertical (default) and \c Horizontal. Vertical Example: - \image ListViewVertical.png + \image trivialListView.png Horizontal Example: \image ListViewHorizontal.png */ @@ -1205,24 +1161,15 @@ void QFxListView::setCacheBuffer(int b) \qmlproperty string ListView::sectionExpression This property holds the expression to be evaluated for the section attached property. - Each item in the list has attached properties named \c section and - \c prevSection. These may be used to place a section header for - related items. The example below assumes that the model is alphabetically - sorted. The section expression is the first character of the \c description - property. If \c section and \c prevSection differ, the item will - display a section header. - - \code - <Component id="Delegate"> - <Item id="wrapper" x="0" width="240" height="{Separator.height + Desc.height}"> - <Item id="Separator" height="{wrapper.ListView.prevSection != wrapper.ListView.section ? 10 : 0}" width="240"> - <Text text="{wrapper.ListView.section}" anchors.fill="{parent}"/> - </Item> - <Text id="Desc" text="{description} width="{parent.width}" height="30"/> - </Item> - </Component> - <ListView anchors.fill="{parent}" sectionExpression="{String(description).charAt(0)}" delegate="{Delegate}" model="{Model}"/> - \endcode + Each item in the list has attached properties named \c ListView.section and + \c ListView.prevSection. These may be used to place a section header for + related items. The example below assumes that the model is sorted by size of + pet. The section expression is the size property. If \c ListView.section and + \c ListView.prevSection differ, the item will display a section header. + + \snippet examples/declarative/listview/sections.qml 0 + + \image ListViewSections.png */ QString QFxListView::sectionExpression() const { diff --git a/src/declarative/qml/parser/javascript.g b/src/declarative/qml/parser/javascript.g index 52d076f..f9a2165 100644 --- a/src/declarative/qml/parser/javascript.g +++ b/src/declarative/qml/parser/javascript.g @@ -634,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: { @@ -647,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: { diff --git a/src/declarative/qml/parser/javascriptast_p.h b/src/declarative/qml/parser/javascriptast_p.h index 8515998..4aa89c9 100644 --- a/src/declarative/qml/parser/javascriptast_p.h +++ b/src/declarative/qml/parser/javascriptast_p.h @@ -2326,13 +2326,13 @@ 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 @@ -2357,6 +2357,7 @@ public: JavaScriptNameIdImpl *memberType; JavaScriptNameIdImpl *name; ExpressionNode *expression; + bool isDefaultMember; SourceLocation publicToken; SourceLocation attributeTypeToken; SourceLocation identifierToken; diff --git a/src/declarative/qml/parser/javascriptgrammar.cpp b/src/declarative/qml/parser/javascriptgrammar.cpp index b344366..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,514 +15,516 @@ 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, 4, 3, 0, 0, 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, 296}; + 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 [] = { - 6, 5, 18, 1, 4, 3, 17, 493, 494, 477, + 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, 510, 509, 345, 346, 512, - 348, 511, 347, 414, 418, 421, 417, 416, 436, 437, + 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 [] = { - -21, -88, 43, -88, -11, 246, 80, 75, -88, -88, - -88, -88, -88, 56, 66, 50, -88, -88, 238, 173, - 71, -88, 51, 27, 9, -30, -88, -2, -88, -7, - 1298, 132, -88, 23, -34, -73, -88, -88, 205, -88, - -88, -88, -88, 239, 203, -88, -88, -18, -88, -88, - -88, -88, -88, 489, 133, 111, 197, 177, -88, -88, - -88, 404, -88, 274, -88, 1298, -88, -88, 186, 181, - 89, 566, -88, -88, 1214, -88, 74, 68, 83, 69, - 1550, 87, 566, 566, 566, 379, 566, -88, -88, 566, - 566, 566, -88, -88, 52, -88, 566, 566, -88, 65, - 566, 566, 53, 58, -88, -88, -88, -88, -88, 566, - 566, 90, 172, 63, -88, 1046, -88, -88, 566, 566, - 566, -88, -88, -88, 40, -88, -17, -52, -28, 1298, - -26, -88, 24, 88, -12, -88, -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, - 566, -88, 1130, 32, -88, 566, -88, -88, 187, 566, - 233, 566, 566, 566, 566, 312, 566, 566, 566, 566, - 566, 566, 274, 566, 566, 566, 118, 131, 128, 160, - 180, 168, 200, 165, 322, 302, 404, 566, -8, 566, - 72, 962, 566, 566, -88, -88, -88, 106, 566, -88, - -88, 73, 59, -88, 566, -88, -88, -88, -88, -88, - 566, -88, -88, -88, -88, -88, -88, -88, -88, -88, - -88, -88, -88, -88, 566, 13, 566, 566, 133, 60, - 566, -88, 962, 566, 566, -88, 117, -88, 17, -88, - -88, -88, 92, -88, -88, -88, -88, 85, -88, -88, - -88, -88, -88, -88, 67, 70, 566, 104, 115, -88, - -88, 643, -88, 19, -29, -55, -88, 237, 8, -46, - 421, 20, 79, 339, 274, -4, 566, 227, 566, 566, - 566, 566, 257, 566, 566, 566, 566, 566, 274, 274, - 274, 274, 274, 263, 339, 339, 566, -75, 566, 3, - 566, -88, 489, 566, -88, 566, 47, -33, 566, -60, - 1214, -88, 566, 136, 1214, -88, 566, -35, 566, 566, - 7, 0, 566, -88, 1, 99, 2, -88, -88, 566, - -88, 28, 566, -88, 4, 566, 12, 1214, -88, 566, - 114, 1214, -88, 34, 1214, -88, 566, 110, 1214, 22, - 1214, -88, -88, 1214, -20, 152, 5, 162, 77, 566, - 1214, 41, 14, 84, 42, 11, 353, 38, 35, 801, - 25, 10, 33, 566, 44, 21, 566, 31, 566, 26, - 39, -88, -88, 194, -88, 566, -1, -88, 105, -88, - -88, 566, 95, 45, -88, 6, -88, 48, 211, 566, - -88, 36, 37, -88, -19, -88, 1214, -88, 109, 1214, - -88, 192, -88, -88, 120, 1214, 46, -88, 16, 30, - -88, 29, -54, -23, -88, -88, -88, -88, 566, 137, - 1214, -88, 566, 126, 1214, -88, 119, -6, 720, -88, - 15, -88, 878, -88, -88, -88, -88, -88, 96, -88, - -88, -88, -88, -88, -88, -88, 286, -88, -88, 248, - -88, -88, 54, 64, 566, 61, 1382, 55, -88, 171, - 123, -88, 49, 103, -88, 94, -88, 57, -88, -88, - 1466, -88, 116, 113, -88, 107, -88, -88, 76, -88, - 140, -88, -88, 566, -88, -88, 62, -88, -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, 13, 6, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, -98, 60, -98, + -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, - 62, -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, -98, -98, -32, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, 174, -98, -98, -98, -98, - -98, 63, -98, -98, -2, -98, -98, -98, -98, -98, - -98, -98, 51, 80, 83, 56, 99, -98, -98, 87, - 59, 48, -98, -98, -98, -98, 40, 113, -98, -17, - 139, 123, -98, -98, -98, -98, -98, -98, -98, 130, - 131, -98, -98, -98, -98, -98, -98, -98, 120, 117, - 112, -98, -98, -98, -98, -98, -60, -98, -98, 175, + -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, -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, - 33, -98, 35, -98, -98, 39, -98, -98, -98, 54, - -98, 64, 66, 67, 68, -98, 55, 52, 41, 71, - 93, 95, -98, 92, 86, 75, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, -98, 69, -98, 78, - -98, 20, 32, 26, -98, -98, -98, -98, 8, -98, - -98, -98, -98, -98, 15, -98, -98, -98, -98, -98, - 31, -98, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, 97, -98, 102, 34, -98, -98, - 38, -98, 47, 36, 42, -98, -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, 30, -98, -98, -98, - -98, 144, -98, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, 187, -98, 173, 170, - 176, 162, -98, 140, 137, 127, 103, 121, -98, -98, - -98, -98, -98, -98, -98, -98, 158, -98, 161, -98, - 185, -98, -98, 188, -98, 129, -98, -98, 135, -98, - 29, -98, 19, -98, 21, -98, 189, -98, 186, 179, - -98, -98, 160, -98, -98, -98, -98, -98, -98, 146, - -98, -52, 128, -98, -98, 124, -98, 22, -98, 24, - -98, 27, -98, -98, 28, -98, 25, -98, 23, -98, - 18, -98, -98, 53, -98, -98, -98, -98, -98, 136, - 50, -98, -98, -98, -98, -98, 110, -98, -98, 44, - -98, -98, -98, 43, -98, -11, 49, -98, 45, -98, - -98, -98, -98, -98, -98, 88, -98, -98, -98, -98, - -98, 37, -98, -98, -98, -98, -98, -84, -98, -6, - -98, -83, -98, -98, -98, -98, -62, -98, -98, -47, - -98, -98, -98, -98, -98, -98, -77, -98, -98, -42, - -98, -98, -98, -37, -98, -98, -98, -98, -10, -98, - -7, -98, 77, -98, 0, -98, -98, -98, 7, -98, - 1, -98, -1, -98, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -98, -98, -98, 240, -98, -98, 73, - -98, -98, -98, -98, 12, -98, -3, -98, -98, -9, - 3, -98, 14, -98, -98, -98, -98, 57, -98, -98, - 4, -98, 5, 115, -98, -98, -98, -98, -98, -98, - -98, -98, -98, -13, -98, -98, -71, -98, -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 [] = { - 330, 318, 465, 209, 296, 129, 443, 342, 128, 336, - 435, 419, 26, 316, 207, 325, 320, 27, 349, 316, - 296, 318, 336, 459, 179, 344, 30, 28, 328, 131, - 29, 170, -53, 359, -223, 402, 425, 229, 370, 175, - -75, 419, -54, 177, 426, -72, 411, 366, -64, -52, - 281, -77, 441, 419, 435, 218, 26, 344, 442, 407, - -224, 207, 448, 435, 2, 355, 439, 250, 209, 218, - 23, 484, 357, 179, 2, 452, 126, 259, 415, 482, - 519, 224, 476, 483, 507, 22, 492, 23, 411, 448, - 364, 508, 125, 513, 452, 459, 172, 363, 435, 476, - 508, 500, 0, 218, 218, 366, 276, 351, 7, 487, - 281, 497, 218, 125, 218, 497, 429, 218, 218, 226, - -292, 459, 218, 364, 0, 218, 438, 460, 0, 338, - 0, 459, 116, 339, 218, 244, 9, 8, 272, 271, - 439, 275, 492, 117, 218, 218, 270, 269, 516, 476, - 272, 271, 492, 265, 264, 413, 469, 0, 109, 498, - 352, 246, 219, 506, 278, 247, 410, 409, 109, 110, - 368, 109, 109, 257, 361, 461, 280, 279, 364, 110, - 486, 262, 110, 110, 118, 193, 454, 194, 487, 118, - 193, 267, 194, 193, 0, 194, 334, 450, 195, 118, - 218, 517, 515, 195, 476, 193, 195, 194, 0, 252, - 267, 218, 252, 263, 261, 262, 0, 0, 195, 0, - 211, 422, 0, 268, 266, 193, 0, 194, 253, 119, - 405, 253, 0, 254, 119, 120, 0, 0, 195, 212, - 120, 213, 268, 266, 119, 298, 299, 263, 261, 0, - 120, 181, 182, 433, 432, 298, 299, 181, 182, 0, - 13, 0, 0, 0, 228, 227, 423, 14, 13, 0, - 13, 0, 300, 301, 0, 14, 0, 14, 183, 184, - 303, 304, 300, 301, 183, 184, 303, 304, 0, 305, - 0, 0, 306, 0, 307, 305, 0, 0, 306, 193, - 307, 194, 0, 480, 0, 0, 0, 0, 13, 0, - 16, 0, 195, 0, 0, 14, 0, 0, 16, 12, - 16, 0, 15, 0, 0, 186, 187, 12, 0, 12, - 15, 0, 15, 188, 189, 186, 187, 190, 0, 191, - 0, 478, 0, 188, 189, 186, 187, 190, 0, 191, - 0, 0, 0, 188, 189, 0, 0, 190, 16, 191, - 0, 0, 303, 304, 0, 72, 73, 12, 0, 0, - 15, 305, 0, 0, 306, 113, 307, 0, 0, 0, - 0, 0, 114, 0, 0, 0, 115, 81, 0, 82, - 0, 72, 73, 0, 0, 0, 85, 0, 0, 0, - 88, 113, 0, 0, 0, 0, 0, 0, 114, 0, - 0, 0, 115, 81, 0, 82, 0, 0, 93, 0, - 95, 0, 85, 0, 231, 0, 88, 186, 187, 0, - 0, 87, 98, 75, 232, 188, 189, 0, 233, 190, - 0, 191, 0, 0, 93, 0, 95, 234, 0, 235, - 0, 0, 332, 0, 0, 0, 0, 87, 98, 75, - 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, 231, 0, 0, 0, 0, 0, 242, 0, - 0, 0, 232, 0, 0, 0, 233, 0, 0, 0, - 0, 0, 0, 0, 0, 234, 0, 235, 0, 0, - 0, 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, + 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, 93, 0, 95, 0, 97, 0, 100, 0, 101, - 0, 0, 0, 0, 87, 98, 75, 0, 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, 295, 101, 0, 0, 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, 467, 0, 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, -73, 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, 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, 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, 78, 79, 0, 0, 80, 81, 0, + 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, 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, - 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, 489, 79, 0, 0, 80, 490, 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, 502, 79, 0, 0, 80, - 503, 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, -219, 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, - - 491, 424, 449, 420, 451, 518, 428, 514, 488, 274, - 427, 455, 440, 495, 504, 501, 445, 462, 10, 463, - 21, 444, 230, 496, 485, 430, 353, 466, 220, 371, - 127, 333, 335, 358, 369, 225, 360, 367, 362, 365, - 331, 434, 277, 215, 217, 0, 223, 434, 256, 412, - 0, 243, 431, 171, 249, 431, 326, 173, 251, 176, - 326, 274, 223, 468, 401, 499, 481, 495, 0, 258, - 215, 255, 111, 66, 21, 48, 111, 200, 447, 481, - 111, 403, 446, 111, 404, 111, 111, 21, 199, 453, - 111, 192, 474, 180, 111, 111, 273, 111, 111, 111, - 111, 185, 111, 204, 205, 206, 111, 201, 223, 111, - 198, 111, 208, 470, 111, 406, 471, 111, 111, 210, - 473, 197, 505, 111, 111, 495, 111, 196, 111, 202, - 111, 203, 472, 111, 111, 403, 326, 0, 404, 311, - 326, 326, 245, 111, 111, 123, 475, 326, 111, 248, - 122, 111, 111, 121, 111, 0, 447, 312, 111, 0, - 0, 111, 111, 310, 112, 178, 0, 111, 111, 273, - 111, 111, 446, 309, 0, 290, 308, 322, 0, 356, - 294, 0, 294, 354, 327, 66, 66, 48, 48, 111, - 329, 322, 111, 111, 294, 0, 294, 294, 294, 350, - 315, 111, 317, 319, 111, 0, 294, 111, 313, 294, - 322, 302, 294, 343, 314, 294, 322, 111, 111, 322, - 111, 294, 294, 294, 294, 294, 0, 297, 0, 0, - 0, 0, 341, 0, 340, 337, 0, 0, 321, 0, - 0, 324, 479, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 130, 0, 0, 0, - 260, 0, 0, 0, 0, 0, 0, 0, 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, + 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, + 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, + + 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, 0, 0, 0, 260, 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}; const int JavaScriptGrammar::action_check [] = { - 60, 76, 8, 76, 1, 33, 60, 7, 60, 2, - 33, 5, 29, 48, 48, 61, 8, 8, 17, 48, - 1, 76, 2, 8, 1, 29, 33, 29, 61, 55, - 60, 7, 7, 31, 29, 55, 55, 55, 16, 7, - 7, 5, 7, 55, 7, 7, 36, 36, 7, 7, - 36, 7, 36, 5, 33, 8, 29, 29, 29, 60, - 29, 48, 36, 33, 85, 61, 20, 7, 76, 8, - 36, 7, 60, 1, 85, 36, 36, 60, 33, 29, - 0, 8, 33, 29, 29, 29, 29, 36, 36, 36, - 7, 29, 29, 17, 36, 8, 8, 29, 33, 33, - 29, 7, -1, 8, 8, 36, 36, 8, 65, 15, - 36, 8, 8, 29, 8, 8, 7, 8, 8, 60, - 36, 8, 8, 7, -1, 8, 6, 8, -1, 50, - -1, 8, 42, 54, 8, 2, 61, 62, 61, 62, - 20, 74, 29, 53, 8, 8, 61, 62, 8, 33, - 61, 62, 29, 61, 62, 60, 60, -1, 40, 56, - 61, 50, 56, 56, 60, 54, 61, 62, 40, 51, - 60, 40, 40, 56, 60, 56, 61, 62, 7, 51, - 7, 29, 51, 51, 12, 25, 60, 27, 15, 12, - 25, 29, 27, 25, -1, 27, 60, 60, 38, 12, - 8, 61, 62, 38, 33, 25, 38, 27, -1, 15, - 29, 8, 15, 61, 62, 29, -1, -1, 38, -1, - 15, 10, -1, 61, 62, 25, -1, 27, 34, 57, - 36, 34, -1, 36, 57, 63, -1, -1, 38, 34, - 63, 36, 61, 62, 57, 18, 19, 61, 62, -1, - 63, 18, 19, 61, 62, 18, 19, 18, 19, -1, - 22, -1, -1, -1, 61, 62, 55, 29, 22, -1, - 22, -1, 45, 46, -1, 29, -1, 29, 45, 46, - 23, 24, 45, 46, 45, 46, 23, 24, -1, 32, - -1, -1, 35, -1, 37, 32, -1, -1, 35, 25, - 37, 27, -1, 55, -1, -1, -1, -1, 22, -1, - 72, -1, 38, -1, -1, 29, -1, -1, 72, 81, - 72, -1, 84, -1, -1, 23, 24, 81, -1, 81, - 84, -1, 84, 31, 32, 23, 24, 35, -1, 37, - -1, 55, -1, 31, 32, 23, 24, 35, -1, 37, - -1, -1, -1, 31, 32, -1, -1, 35, 72, 37, - -1, -1, 23, 24, -1, 12, 13, 81, -1, -1, - 84, 32, -1, -1, 35, 22, 37, -1, -1, -1, - -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, - -1, 12, 13, -1, -1, -1, 43, -1, -1, -1, - 47, 22, -1, -1, -1, -1, -1, -1, 29, -1, - -1, -1, 33, 34, -1, 36, -1, -1, 65, -1, - 67, -1, 43, -1, 3, -1, 47, 23, 24, -1, - -1, 78, 79, 80, 13, 31, 32, -1, 17, 35, - -1, 37, -1, -1, 65, -1, 67, 26, -1, 28, - -1, -1, 31, -1, -1, -1, -1, 78, 79, 80, - 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, 3, -1, -1, -1, -1, -1, 77, -1, - -1, -1, 13, -1, -1, -1, 17, -1, -1, -1, - -1, -1, -1, -1, -1, 26, -1, 28, -1, -1, - -1, -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, + 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, 65, -1, 67, -1, 69, -1, 71, -1, 73, - -1, -1, -1, -1, 78, 79, 80, -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, 72, 73, -1, -1, -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, @@ -572,123 +533,130 @@ const int JavaScriptGrammar::action_check [] = { -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, 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, 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, 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, -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, -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, + 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, -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, 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, -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, -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, -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, 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, - - 9, 84, 12, 87, 11, 76, 12, 20, 11, 11, - 72, 11, 89, 10, 9, 11, 58, 16, 5, 20, - 14, 58, 54, 9, 12, 72, 78, 20, 20, 11, - 90, 12, 11, 11, 11, 20, 12, 12, 11, 11, - 11, 58, 12, 23, 12, -1, 20, 58, 12, 12, - -1, 20, 12, 20, 20, 12, 12, 22, 20, 20, - 12, 11, 20, 12, 11, 8, 6, 10, -1, 27, - 23, 24, 31, 11, 14, 13, 31, 36, 33, 6, - 31, 25, 33, 31, 28, 31, 31, 14, 36, 12, - 31, 36, 33, 39, 31, 31, 33, 31, 31, 31, - 31, 37, 31, 37, 37, 37, 31, 36, 20, 31, - 35, 31, 43, 33, 31, 27, 33, 31, 31, 41, - 33, 35, 7, 31, 31, 10, 31, 35, 31, 36, - 31, 36, 33, 31, 31, 25, 12, -1, 28, 36, - 12, 12, 45, 31, 31, 33, 33, 12, 31, 47, - 33, 31, 31, 33, 31, -1, 33, 36, 31, -1, - -1, 31, 31, 36, 34, 34, -1, 31, 31, 33, - 31, 31, 33, 36, -1, 31, 36, 31, -1, 55, - 36, -1, 36, 55, 55, 11, 11, 13, 13, 31, - 55, 31, 31, 31, 36, -1, 36, 36, 36, 53, - 38, 31, 44, 42, 31, -1, 36, 31, 38, 36, - 31, 38, 36, 53, 38, 36, 31, 31, 31, 31, - 31, 36, 36, 36, 36, 36, -1, 40, -1, -1, - -1, -1, 53, -1, 48, 46, -1, -1, 53, -1, - -1, 53, 2, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 14, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 91, -1, -1, -1, - 96, -1, -1, -1, -1, -1, -1, -1, -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, 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, + 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, + -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, -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, + -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, -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, -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, 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, + + 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, -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 c35c56e..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 = 519, - 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 = 1638, - GOTO_CHECK_OFFSET = 1638 + 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 03bbc13..f868216 100644 --- a/src/declarative/qml/parser/javascriptparser.cpp +++ b/src/declarative/qml/parser/javascriptparser.cpp @@ -268,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); @@ -277,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(), @@ -351,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(), @@ -363,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); @@ -385,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(), @@ -397,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); @@ -405,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); @@ -457,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: @@ -542,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); @@ -568,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; @@ -891,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; @@ -905,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; @@ -919,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; @@ -933,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; @@ -946,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); @@ -953,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); @@ -961,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); @@ -1074,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); @@ -1152,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); @@ -1160,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); @@ -1170,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); @@ -1178,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); @@ -1189,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); @@ -1202,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); @@ -1212,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); @@ -1223,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); @@ -1238,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); @@ -1253,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); @@ -1268,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); @@ -1276,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); @@ -1361,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); @@ -1385,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) @@ -1397,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; diff --git a/src/declarative/qml/parser/javascriptparser_p.h b/src/declarative/qml/parser/javascriptparser_p.h index e97abeb..34edaf7 100644 --- a/src/declarative/qml/parser/javascriptparser_p.h +++ b/src/declarative/qml/parser/javascriptparser_p.h @@ -206,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/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/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/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp index 8a10ca3..755befe 100644 --- a/src/declarative/util/qmlstateoperations.cpp +++ b/src/declarative/util/qmlstateoperations.cpp @@ -59,6 +59,7 @@ public: }; /*! + \preliminary \qmlclass ParentChange \brief The ParentChange element allows you to reparent an object in a state. */ |